/* ==========================================
   维权快速响应系统 - 样式表
   ========================================== */

:root {
  --primary: #1a73e8;
  --primary-light: #e8f0fe;
  --primary-dark: #1557b0;
  --success: #0d9488;
  --success-light: #ccfbf1;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --radius: 8px;
  --radius-lg: 12px;
  --sidebar-width: 240px;
  --header-height: 60px;
  --transition: 0.2s ease;

  /* 语义别名 */
  --bg: var(--gray-50);
  --bg-secondary: var(--gray-100);
  --border: var(--gray-200);
  --text-secondary: var(--gray-500);
  --hover-bg: var(--gray-100);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  font-size: 14px;
}

/* ===== 侧边栏 ===== */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--white);
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.sidebar-logo {
  padding: 20px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo .logo-icon {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  font-weight: 700;
}

.sidebar-logo .logo-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-800);
  line-height: 1.3;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.nav-section {
  padding: 8px 20px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  margin: 2px 8px;
  border-radius: var(--radius);
  color: var(--gray-600);
  cursor: pointer;
  transition: var(--transition);
  font-size: 14px;
  text-decoration: none;
  border: none;
  background: none;
  width: calc(100% - 16px);
  text-align: left;
}

.nav-item:hover { background: var(--gray-100); color: var(--gray-800); }
.nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 500; }

.nav-item .nav-icon { font-size: 18px; width: 22px; text-align: center; }
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 600;
}

/* ===== 主内容区 ===== */
.main-content {
  margin-left: var(--sidebar-width);
  padding: 24px 32px;
  min-height: 100vh;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--gray-900);
}

.page-header .header-actions {
  display: flex;
  gap: 10px;
}

/* ===== 卡片 ===== */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-800);
}

.card-body { padding: 20px; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { opacity: 0.9; }

.btn-warning { background: var(--warning); color: white; }
.btn-danger { background: var(--danger); color: white; }

.btn-outline {
  background: white;
  color: var(--gray-700);
  border-color: var(--gray-300);
}
.btn-outline:hover { background: var(--gray-50); border-color: var(--gray-400); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 10px 24px; font-size: 15px; }

/* ===== 表单 ===== */
.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-group label .required { color: var(--danger); margin-left: 2px; }

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--gray-800);
  transition: var(--transition);
  font-family: inherit;
  background: white;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-textarea { min-height: 100px; resize: vertical; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-hint {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 4px;
}

/* ===== 表格 ===== */
.table-container { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
}

table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}

table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
  color: var(--gray-700);
}

table tr:hover td { background: var(--gray-50); }

table tr.clickable { cursor: pointer; }

/* ===== 徽章/标签 ===== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: #92400e; }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* ===== 统计卡片 ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}

.stat-card .stat-label {
  font-size: 12px;
  color: var(--gray-500);
  margin-bottom: 6px;
}

.stat-card .stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--gray-900);
}

.stat-card .stat-sub {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 4px;
}

/* ===== 工作流步骤 ===== */
.workflow-steps {
  display: flex;
  gap: 0;
  margin: 20px 0;
  overflow-x: auto;
  padding: 4px 0;
}

.workflow-step {
  flex: 1;
  min-width: 140px;
  text-align: center;
  position: relative;
  padding: 16px 12px;
  background: var(--gray-100);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}

.workflow-step + .workflow-step { margin-left: -1px; }

.workflow-step .step-number {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--gray-300);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}

.workflow-step .step-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-600);
}

.workflow-step .step-desc {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 2px;
}

.workflow-step.active {
  background: var(--primary-light);
  border: 2px solid var(--primary);
}

.workflow-step.active .step-number {
  background: var(--primary);
}

.workflow-step.active .step-title {
  color: var(--primary);
}

.workflow-step.completed {
  background: var(--success-light);
}

.workflow-step.completed .step-number {
  background: var(--success);
}

.workflow-step.completed .step-title {
  color: var(--success);
}

/* ===== 模态框 ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.show { display: flex; }

.modal {
  background: white;
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 720px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: white;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  z-index: 1;
}

.modal-header h2 {
  font-size: 17px;
  font-weight: 600;
}

.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--gray-100);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--gray-500);
  transition: var(--transition);
}

.modal-close:hover { background: var(--gray-200); }

.modal-body { padding: 24px; }

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  position: sticky;
  bottom: 0;
  background: white;
}

/* ===== 时间线 ===== */
.timeline {
  position: relative;
  padding-left: 24px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gray-200);
}

.timeline-item {
  position: relative;
  margin-bottom: 20px;
  padding-left: 20px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 4px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid white;
  box-shadow: 0 0 0 2px var(--primary);
}

.timeline-item .tl-time {
  font-size: 11px;
  color: var(--gray-400);
  margin-bottom: 2px;
}

.timeline-item .tl-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-800);
}

.timeline-item .tl-detail {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 2px;
}

/* ===== 标签页 ===== */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 20px;
}

.tab {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
}

.tab:hover { color: var(--gray-700); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-400);
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 16px;
  color: var(--gray-500);
  margin-bottom: 8px;
}

/* ===== 搜索栏 ===== */
.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.search-bar .form-input { max-width: 280px; }

/* ===== Toast 通知 ===== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius);
  color: white;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
  max-width: 380px;
}

.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-warning { background: var(--warning); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===== 附件列表 ===== */
.file-list { list-style: none; }

.file-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 8px;
  background: var(--gray-50);
  font-size: 13px;
}

.file-list li .file-icon { font-size: 20px; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; padding: 16px; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ===== 流程指引提示框 ===== */
.guide-box {
  background: var(--primary-light);
  border: 1px solid #b6d4fe;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--primary-dark);
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.guide-box .guide-icon { font-size: 18px; flex-shrink: 0; }

/* ===== 专利卡片 ===== */
.patent-card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  background: white;
  transition: var(--transition);
}

.patent-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }

.patent-card .patent-no {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}

.patent-card .patent-name {
  font-size: 14px;
  color: var(--gray-800);
  margin: 4px 0;
}

.patent-card .patent-meta {
  font-size: 12px;
  color: var(--gray-500);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
