/* css/main.css — AI Supply-Demand Platform v2
   Aesthetic: Deep Space Indigo — dark-accented, glassmorphic, premium SaaS */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Noto+Sans+SC:wght@400;500;600;700&display=swap');

/* ── Design Tokens ── */
:root {
  --c-primary: #00478d;
  --c-primary-light: #0060a9;
  --c-primary-bg: #eff6ff;
  --c-primary-hover: #003a73;
  --c-primary-glow: rgba(0,71,141,.25);
  --c-accent: #F59E0B;
  --c-accent-bg: #FFFBEB;
  --c-success: #10B981;
  --c-success-bg: #ECFDF5;
  --c-danger: #EF4444;
  --c-danger-bg: #FEF2F2;
  --c-warning: #F97316;
  --c-warning-bg: #FFF7ED;
  --c-surface: #FFFFFF;
  --c-bg: #F1F5F9;
  --c-bg-warm: #F8FAFC;
  --c-border: #E2E8F0;
  --c-border-light: #F1F5F9;
  --c-text: #0F172A;
  --c-text-secondary: #475569;
  --c-text-muted: #94A3B8;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-xs: 0 1px 2px rgba(0,0,0,.03);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.04), 0 2px 8px rgba(0,0,0,.03);
  --shadow-md: 0 4px 16px rgba(0,0,0,.06), 0 1px 4px rgba(0,0,0,.03);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.04);
  --shadow-xl: 0 24px 64px rgba(0,0,0,.12), 0 8px 20px rgba(0,0,0,.06);
  --shadow-glow: 0 0 0 1px rgba(0,71,141,.08), 0 4px 20px rgba(0,71,141,.06);
  --font-display: 'Plus Jakarta Sans', 'Noto Sans SC', -apple-system, sans-serif;
  --font-body: 'Plus Jakarta Sans', 'Noto Sans SC', -apple-system, sans-serif;
  --transition-fast: .15s cubic-bezier(.4,0,.2,1);
  --transition-smooth: .25s cubic-bezier(.4,0,.2,1);
  --transition-spring: .4s cubic-bezier(.34,1.56,.64,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--c-bg);
  color: var(--c-text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

/* ── Entrance Animations ── */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeScale {
  from { opacity: 0; transform: scale(.96); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ── 导航栏 ── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--c-text);
  height: 64px;
  border-bottom: 1px solid var(--c-border);
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.navbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 32px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.navbar-sticky {
  /* kept for backwards compat; navbar is already fixed */
}
.navbar .logo {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: #1B1C1C;
}
.navbar .nav-links { display: flex; align-items: center; gap: 6px; }
.navbar .nav-links a {
  color: #64748b;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition-fast);
  letter-spacing: -.01em;
  padding: 6px 14px;
  border-radius: 8px;
}
.navbar .nav-links a:hover {
  color: #00478d;
  background: transparent;
}

/* ── 导航身份标签 ── */
.nav-user {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  background: linear-gradient(135deg, rgba(0,71,141,.15), rgba(0,96,169,.15));
  border: 1px solid rgba(0,71,141,.2);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  color: #C4B5FD;
  margin-right: 8px;
  letter-spacing: -.01em;
}

/* ── 容器 ── */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 96px 24px 32px;
  animation: fadeIn .4s ease;
}
.page-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 24px;
  color: var(--c-text);
  letter-spacing: -.04em;
  position: relative;
}
.page-title::after {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, var(--c-primary), var(--c-primary-light));
  border-radius: 100px;
  margin-top: 8px;
}

/* ── 卡片 ── */
.card {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-smooth);
  animation: slideUp .4s ease both;
  position: relative;
}
.card:hover {
  box-shadow: var(--shadow-md);
  border-color: #CBD5E1;
}
.card-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--c-text);
  letter-spacing: -.02em;
}

/* ── 卡片状态边框 ── */
.card-status-pending {
  border-left: 3px solid var(--c-warning);
  background: linear-gradient(90deg, rgba(249,115,22,.02), transparent 30%);
}
.card-status-published {
  border-left: 3px solid var(--c-primary);
  background: linear-gradient(90deg, rgba(99,102,241,.02), transparent 30%);
}
.card-status-selected {
  border-left: 3px solid var(--c-success);
  background: linear-gradient(90deg, rgba(16,185,129,.02), transparent 30%);
}
.card-status-done {
  border-left: 3px solid var(--c-success);
  background: linear-gradient(90deg, rgba(16,185,129,.02), transparent 30%);
}

/* ── 表格 ── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--c-border);
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  background: linear-gradient(180deg, #F8FAFC, #F1F5F9);
  color: var(--c-text-secondary);
  font-weight: 600;
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
}
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--c-border-light);
  color: var(--c-text);
  vertical-align: middle;
}
tr { transition: background var(--transition-fast); }
tr:hover td { background: rgba(99,102,241,.03); }
tr:last-child td { border-bottom: none; }

/* ── 表单 ── */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: 13px;
  color: var(--c-text-secondary);
  margin-bottom: 8px;
  font-weight: 600;
  letter-spacing: -.01em;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 11px 16px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  font-size: 14px;
  outline: none;
  transition: all var(--transition-fast);
  font-family: inherit;
  background: var(--c-surface);
  color: var(--c-text);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-glow);
}
.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--c-text-muted);
}
.form-group textarea { resize: vertical; min-height: 90px; line-height: 1.7; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── 表单校验 ── */
.form-group.error input,
.form-group.error select,
.form-group.error textarea {
  border-color: var(--c-danger);
  box-shadow: 0 0 0 3px rgba(239,68,68,.1);
}
.form-group .error-msg {
  font-size: 12px;
  color: var(--c-danger);
  margin-top: 6px;
  display: none;
  font-weight: 500;
}
.form-group.error .error-msg { display: block; }

/* ── 按钮 ── */
.btn {
  padding: 9px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  letter-spacing: -.01em;
  font-family: inherit;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--transition-fast);
}
.btn:active::after { background: rgba(0,0,0,.08); }
.btn-primary {
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-hover));
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,71,141,.3), inset 0 1px 0 rgba(255,255,255,.1);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--c-primary-hover), #002d5e);
  box-shadow: 0 4px 16px rgba(0,71,141,.35);
  transform: translateY(-1px);
}
.btn-success {
  background: linear-gradient(135deg, var(--c-success), #059669);
  color: #fff;
  box-shadow: 0 2px 8px rgba(16,185,129,.3), inset 0 1px 0 rgba(255,255,255,.1);
}
.btn-success:hover {
  background: linear-gradient(135deg, #059669, #047857);
  box-shadow: 0 4px 16px rgba(16,185,129,.35);
  transform: translateY(-1px);
}
.btn-danger {
  background: linear-gradient(135deg, var(--c-danger), #DC2626);
  color: #fff;
  box-shadow: 0 2px 8px rgba(239,68,68,.3), inset 0 1px 0 rgba(255,255,255,.1);
}
.btn-danger:hover {
  background: linear-gradient(135deg, #DC2626, #B91C1C);
  transform: translateY(-1px);
}
.btn-default {
  background: var(--c-surface);
  color: var(--c-text);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-xs);
}
.btn-default:hover {
  background: var(--c-bg);
  border-color: #CBD5E1;
  box-shadow: var(--shadow-sm);
}
.btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; transform: none !important; }

/* ── 按钮内联 spinner ── */
@keyframes btnSpin { from { transform: rotate(0deg) } to { transform: rotate(360deg) } }
.btn-spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btnSpin .6s linear infinite;
  vertical-align: middle;
}
.btn-default .btn-spinner {
  border-color: rgba(0,0,0,.1);
  border-top-color: var(--c-text);
}

/* ── 状态标签 ── */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
}
.tag-blue    { background: var(--c-primary-bg); color: var(--c-primary); }
.tag-green   { background: var(--c-success-bg); color: var(--c-success); }
.tag-red     { background: var(--c-danger-bg); color: var(--c-danger); }
.tag-orange  { background: var(--c-warning-bg); color: var(--c-warning); }
.tag-gray    { background: #F1F5F9; color: var(--c-text-muted); }
.tag-purple  { background: #eff6ff; color: #00478d; }

/* ── 信用标签 ── */
.credit-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
}

/* ── 空状态 ── */
.empty {
  text-align: center;
  padding: 64px 20px;
  color: var(--c-text-muted);
  font-size: 14px;
}
.empty-icon { font-size: 44px; margin-bottom: 14px; opacity: .6; }
.empty a {
  color: var(--c-primary);
  text-decoration: none;
  font-weight: 600;
}
.empty a:hover { text-decoration: underline; }

/* ── 弹窗 ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.6);
  backdrop-filter: blur(8px) saturate(1.2);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  animation: fadeIn .15s ease;
}
.modal {
  background: var(--c-surface);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 90%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(0,0,0,.05);
  border: 1px solid var(--c-border-light);
  animation: slideUp .25s ease;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: -.02em;
  color: var(--c-text);
}
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.hidden { display: none !important; }

/* ── 下一步引导 ── */
.next-step-banner {
  background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 50%, #e0f2fe 100%);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.next-step-banner::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 100px; height: 100px;
  background: radial-gradient(circle, rgba(99,102,241,.1), transparent 70%);
  border-radius: 50%;
}
.next-step-banner .title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--c-primary);
  margin-bottom: 6px;
  letter-spacing: -.02em;
}
.next-step-banner .desc {
  font-size: 13px;
  color: var(--c-text-secondary);
  margin-bottom: 14px;
}

/* ── 统计卡片 ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-align: center;
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-smooth);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--c-primary), var(--c-primary-light));
  opacity: 0;
  transition: opacity var(--transition-smooth);
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.stat-card:hover::before { opacity: 1; }
.stat-num {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--c-primary), #0060a9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -.03em;
}
.stat-label { font-size: 12px; color: var(--c-text-muted); margin-top: 6px; font-weight: 500; }

/* ── 消息提示 ── */
.toast {
  position: fixed; top: 74px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, #1E1B4B, #312E81);
  color: #fff; padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  animation: toastIn .3s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 8px 32px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.08);
}
@keyframes toastIn {
  from { opacity:0; transform: translateX(-50%) translateY(-14px) scale(.96); }
  to { opacity:1; transform: translateX(-50%) translateY(0) scale(1); }
}
.toast-out { animation: toastOut .3s ease forwards; }
@keyframes toastOut {
  from { opacity:1; transform: translateX(-50%) translateY(0); }
  to { opacity:0; transform: translateX(-50%) translateY(-14px); }
}

/* ── 进度条 ── */
.progress-bar {
  background: var(--c-border-light);
  border-radius: 100px;
  height: 8px;
  overflow: hidden;
  margin: 8px 0;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--c-primary), var(--c-success));
  transition: width .6s cubic-bezier(.4,0,.2,1);
  position: relative;
}
.progress-bar-fill::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.3), transparent);
  animation: shimmer 2s infinite;
}

/* ── 合同概览 ── */
.contract-summary {
  background: var(--c-bg-warm);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}
.contract-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--c-border-light);
  font-size: 14px;
}
.contract-row:last-child { border-bottom: none; }
.contract-row .label { color: var(--c-text-muted); font-size: 13px; }
.contract-row .value { font-weight: 600; color: var(--c-text); }

/* ── 周期分组头 ── */
.cycle-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--c-primary-bg);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin: 16px 0 8px;
  font-weight: 700;
  font-size: 13px;
  color: var(--c-primary);
}

/* ── 里程碑进度摘要 ── */
.ms-summary {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
  padding: 16px 20px;
  background: linear-gradient(135deg, #F8FAFC, #EEF2FF);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--c-text-secondary);
}
.ms-summary .num {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--c-primary);
  font-size: 16px;
  letter-spacing: -.02em;
}

/* ── 工作流指南 ── */
.workflow-guide {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 32px;
}
.workflow-step {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  padding: 24px 16px;
  text-align: center;
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: all var(--transition-smooth);
}
.workflow-step:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.workflow-step .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--c-primary), #0060a9);
  color: #fff;
  font-weight: 800; font-size: 14px;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(99,102,241,.3);
}
.workflow-step h4 {
  font-family: var(--font-display);
  font-size: 14px; font-weight: 700;
  margin-bottom: 6px; letter-spacing: -.02em;
}
.workflow-step p { font-size: 12px; color: var(--c-text-muted); line-height: 1.6; }

/* ── 合同双方确认状态栏 ── */
.contract-confirm-bar {
  display: flex; gap: 16px; align-items: center;
  padding: 14px 18px;
  background: var(--c-bg-warm);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}
.contract-confirm-bar .confirm-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--c-text-secondary);
}
.contract-confirm-bar .confirm-check {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--c-border);
  font-size: 12px; color: var(--c-border);
  flex-shrink: 0;
  transition: all var(--transition-fast);
}
.contract-confirm-bar .confirm-check.checked {
  border-color: var(--c-success);
  background: var(--c-success);
  color: #fff;
}
.contract-confirm-bar .confirm-label { font-weight: 500; }
.contract-confirm-bar .confirm-label.confirmed {
  color: var(--c-success); font-weight: 600;
}
.contract-locked-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 16px;
  background: var(--c-success-bg);
  border: 1px solid #6EE7B7;
  border-radius: 100px;
  font-size: 12px; font-weight: 600; color: #059669;
}

/* ── 状态横幅 ── */
.contract-status-banner {
  padding: 14px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  letter-spacing: -.01em;
}
.contract-status-banner.draft {
  background: var(--c-bg-warm);
  border: 1px dashed var(--c-border);
  color: var(--c-text-muted);
}
.contract-status-banner.partial {
  background: var(--c-primary-bg);
  border: 1px solid #bfdbfe;
  color: var(--c-primary);
}
.contract-status-banner.locked {
  background: var(--c-success-bg);
  border: 1px solid #6EE7B7;
  color: #059669;
}

/* ── Staggered card entrance ── */
.card:nth-child(1) { animation-delay: 0ms; }
.card:nth-child(2) { animation-delay: 60ms; }
.card:nth-child(3) { animation-delay: 120ms; }
.card:nth-child(4) { animation-delay: 180ms; }
.card:nth-child(5) { animation-delay: 240ms; }
.card:nth-child(6) { animation-delay: 300ms; }

/* ── Account selector card (enterprise/aicompany pages) ── */
.account-selector {
  display: flex;
  gap: 12px;
  align-items: center;
}
.account-selector label {
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text-secondary);
}
.account-selector select {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  font-size: 14px;
  outline: none;
  font-family: inherit;
  background: var(--c-surface);
  transition: all var(--transition-fast);
}
.account-selector select:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-glow);
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .navbar { height: 54px; }
  .navbar-inner { padding: 0 16px; }
  .navbar .logo { font-size: 13px; }
  .workflow-guide { grid-template-columns: 1fr 1fr; }
  .navbar .nav-links { gap: 2px; }
  .navbar .nav-links a { padding: 4px 8px; font-size: 11px; }
  .container { padding: 20px 14px; }
  .page-title { font-size: 22px; }
  .modal { padding: 24px 20px; border-radius: var(--radius-lg); }
  .account-selector { flex-wrap: wrap; }
}

/* ── Smooth scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 100px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* ── Selection color ── */
::selection { background: rgba(99,102,241,.15); color: var(--c-text); }

/* ═══════════════════════════════════════════════════════════════
   HOMEPAGE STYLES
   ═══════════════════════════════════════════════════════════════ */

/* ── Hero ── */
.hero {
  position: relative;
  background: linear-gradient(160deg, #0F172A 0%, #1E293B 40%, #312E81 100%);
  color: #fff;
  padding: 88px 24px 108px;
  text-align: center;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -40%; left: -10%;
  width: 60%; height: 180%;
  background: radial-gradient(ellipse, rgba(99,102,241,.18) 0%, transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -30%; right: -10%;
  width: 50%; height: 160%;
  background: radial-gradient(ellipse, rgba(139,92,246,.12) 0%, transparent 70%);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; max-width: 720px; margin: 0 auto; }
.hero-badge {
  display: inline-block;
  padding: 6px 18px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  margin-bottom: 28px;
  color: rgba(255,255,255,.7);
  backdrop-filter: blur(8px);
}
.hero-badge span { color: #A78BFA; }
.hero h1 {
  font-family: var(--font-display);
  font-size: 48px; font-weight: 800;
  line-height: 1.15; letter-spacing: -.04em;
  margin-bottom: 18px;
  background: linear-gradient(135deg, #fff 30%, #C4B5FD 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  font-size: 17px;
  color: rgba(255,255,255,.55);
  line-height: 1.8;
  margin-bottom: 40px;
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-btn {
  padding: 14px 36px;
  border-radius: 14px;
  font-size: 15px; font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-smooth);
  border: none;
  letter-spacing: -.01em;
  font-family: inherit;
}
.hero-btn-primary {
  background: linear-gradient(135deg, #00478d, #003a73);
  color: #fff;
  box-shadow: 0 4px 24px rgba(0,71,141,.4), inset 0 1px 0 rgba(255,255,255,.15);
}
.hero-btn-primary:hover {
  background: linear-gradient(135deg, #003a73, #002d5e);
  box-shadow: 0 8px 32px rgba(99,102,241,.5);
  transform: translateY(-2px);
}
.hero-btn-secondary {
  background: rgba(255,255,255,.06);
  color: #fff;
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(8px);
}
.hero-btn-secondary:hover {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.2);
  transform: translateY(-2px);
}

/* ── Stats bar ── */
.hero-stats {
  display: flex; gap: 44px; justify-content: center; margin-top: 56px; flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.hero-stat-num {
  font-family: var(--font-display);
  font-size: 34px; font-weight: 800;
  letter-spacing: -.03em; color: #fff;
}
.hero-stat-label {
  font-size: 12px;
  color: rgba(255,255,255,.4);
  margin-top: 4px; font-weight: 500;
}

/* ── Live Ticker ── */
.ticker-wrap {
  background: #0F172A;
  border-top: 1px solid rgba(255,255,255,.05);
  border-bottom: 1px solid rgba(255,255,255,.05);
  overflow: hidden; white-space: nowrap; position: relative;
}
.ticker-wrap::before,
.ticker-wrap::after {
  content: '';
  position: absolute; top: 0; bottom: 0; width: 80px;
  z-index: 2; pointer-events: none;
}
.ticker-wrap::before { left: 0; background: linear-gradient(90deg, #0F172A, transparent); }
.ticker-wrap::after { right: 0; background: linear-gradient(-90deg, #0F172A, transparent); }
.ticker-track {
  display: inline-flex;
  animation: tickerScroll var(--ticker-duration, 60s) linear infinite;
}
.ticker-track:hover { animation-play-state: paused; }
@keyframes tickerScroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
.ticker-item {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; font-size: 13px;
  color: rgba(255,255,255,.5);
  border-right: 1px solid rgba(255,255,255,.05);
  flex-shrink: 0;
}
.ticker-item .ticker-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.ticker-dot-blue { background: #0060a9; }
.ticker-dot-green { background: #34D399; }
.ticker-dot-amber { background: #FBBF24; }
.ticker-dot-purple { background: #A78BFA; }
.ticker-item strong { color: rgba(255,255,255,.8); font-weight: 600; }

/* ── Section titles ── */
.section { padding: 80px 20px; max-width: 1120px; margin: 0 auto; }
.section-header { text-align: center; margin-bottom: 52px; }
.section-header h2 {
  font-family: var(--font-display);
  font-size: 30px; font-weight: 800;
  letter-spacing: -.03em; color: var(--c-text);
  margin-bottom: 10px;
}
.section-header p { font-size: 15px; color: var(--c-text-muted); }

/* ── Portal grid ── */
.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px; margin-top: -56px;
  position: relative; z-index: 10;
  max-width: 1120px; margin-left: auto; margin-right: auto;
  padding: 0 20px;
}
.portal-card {
  background: #fff;
  border-radius: 20px; padding: 36px 28px;
  text-align: center;
  border: 1px solid var(--c-border);
  box-shadow: 0 8px 32px rgba(0,0,0,.08);
  cursor: pointer;
  transition: all .3s cubic-bezier(.4,0,.2,1);
  position: relative; overflow: hidden;
}
.portal-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--portal-accent, var(--c-primary));
  opacity: 0; transition: opacity .3s;
}
.portal-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(0,0,0,.12);
}
.portal-card:hover::before { opacity: 1; }
.portal-icon-wrap {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; border-radius: 18px;
  margin-bottom: 20px; font-size: 28px;
}
.portal-card h3 {
  font-family: var(--font-display);
  font-size: 19px; font-weight: 700;
  margin-bottom: 8px; letter-spacing: -.02em;
}
.portal-card p { font-size: 13px; color: var(--c-text-muted); line-height: 1.7; margin-bottom: 20px; }
.portal-card .btn { width: 100%; justify-content: center; padding: 11px 18px; border-radius: 10px; }

/* ── Cases / Showcase ── */
.cases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}
.case-card {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
  transition: all .3s cubic-bezier(.4,0,.2,1);
}
.case-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,.1);
}
.case-card-img {
  width: 100%; height: 200px;
  background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 50%, #e0f2fe 100%);
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.case-card-img img { width: 100%; height: 100%; object-fit: cover; }
.case-card-img .case-placeholder { font-size: 48px; opacity: .2; }
.case-card-img .case-tag {
  position: absolute; top: 12px; left: 12px;
  padding: 4px 12px; border-radius: 100px;
  font-size: 11px; font-weight: 600;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
  color: var(--c-primary);
  border: 1px solid rgba(99,102,241,.12);
}
.case-card-body { padding: 20px 24px 24px; }
.case-card-body h4 {
  font-family: var(--font-display);
  font-size: 16px; font-weight: 700;
  letter-spacing: -.02em; margin-bottom: 8px; color: var(--c-text);
}
.case-card-body p { font-size: 13px; color: var(--c-text-muted); line-height: 1.7; margin-bottom: 16px; }
.case-meta { display: flex; gap: 16px; font-size: 12px; color: var(--c-text-muted); }
.case-meta span { display: flex; align-items: center; gap: 4px; }
.case-meta strong { color: var(--c-text); font-weight: 600; }

/* ── Workflow enhanced ── */
.workflow-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 0; position: relative;
}
.workflow-grid::before {
  content: '';
  position: absolute; top: 36px; left: 12%; right: 12%;
  height: 2px;
  background: linear-gradient(90deg, var(--c-primary), var(--c-success));
  opacity: .15; z-index: 0;
}
.wf-step { text-align: center; padding: 0 12px; position: relative; z-index: 1; }
.wf-step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 16px;
  font-family: var(--font-display);
  font-size: 18px; font-weight: 800;
  margin-bottom: 16px;
  background: var(--c-surface);
  border: 2px solid var(--c-border);
  color: var(--c-primary);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-smooth);
}
.wf-step:hover .wf-step-num {
  background: linear-gradient(135deg, var(--c-primary), #0060a9);
  color: #fff; border-color: transparent;
  box-shadow: 0 4px 16px rgba(99,102,241,.3);
}
.wf-step h4 {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 700;
  letter-spacing: -.02em; margin-bottom: 6px;
}
.wf-step p { font-size: 12px; color: var(--c-text-muted); line-height: 1.7; }

/* ── Footer ── */
.site-footer {
  background: linear-gradient(135deg, #0F172A, #1E1B4B);
  color: rgba(255,255,255,.35);
  text-align: center; padding: 40px 20px;
  font-size: 13px;
  border-top: 1px solid rgba(255,255,255,.05);
}
.site-footer a { color: rgba(255,255,255,.5); text-decoration: none; }
.site-footer a:hover { color: #fff; }

/* ── Homepage Responsive ── */
@media (max-width: 768px) {
  .hero { padding: 56px 16px 80px; }
  .hero h1 { font-size: 32px; }
  .hero p { font-size: 15px; }
  .hero-stats { gap: 24px; }
  .hero-stat-num { font-size: 24px; }
  .portal-grid { grid-template-columns: 1fr; margin-top: -40px; padding: 0 16px; }
  .cases-grid { grid-template-columns: 1fr; }
  .workflow-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .workflow-grid::before { display: none; }
  .section { padding: 48px 16px; }
  .section-header h2 { font-size: 22px; }
}

/* User Dropdown */
.user-dropdown {
  position: relative;
}

.user-btn {
  padding: 8px 16px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
}

.user-btn:hover {
  background: var(--c-bg-warm);
  border-color: var(--c-primary);
  box-shadow: var(--shadow-sm);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition-smooth);
  z-index: 1000;
}

.user-dropdown.active .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu a {
  display: block;
  padding: 12px 16px;
  color: var(--c-text);
  text-decoration: none;
  font-size: 14px;
  transition: all var(--transition-fast);
  border-bottom: 1px solid var(--c-border-light);
}

.dropdown-menu a:last-child {
  border-bottom: none;
}

.dropdown-menu a:hover {
  background: var(--c-primary-bg);
  color: var(--c-primary);
}

/* ── 分页 ── */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 4px; margin-top: 28px; padding: 8px 0; user-select: none;
}
.pagination button {
  min-width: 36px; height: 36px; padding: 0 8px;
  border-radius: var(--radius-sm); border: 1px solid var(--c-border);
  background: var(--c-surface); color: var(--c-text-secondary);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all .15s; font-family: inherit;
}
.pagination button:hover:not(:disabled):not(.active) {
  border-color: var(--c-primary-light); color: var(--c-primary); background: var(--c-primary-bg);
}
.pagination button.active {
  background: var(--c-primary); color: #fff; border-color: var(--c-primary);
}
.pagination button:disabled { opacity: .4; cursor: default; }
.pagination .pg-ellipsis {
  min-width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  color: var(--c-text-muted); font-size: 13px;
}
.pagination .pg-info {
  font-size: 12px; color: var(--c-text-muted); margin-left: 12px;
}
