/**
 * AI_site 门户与文档页共用样式（科技主题 - Tech Sci-Fi Edition）
 */
:root {
  --bg-page: #0a0e17;
  --bg-page-accent: #0d1321;
  --surface: #111827;
  --surface-elevated: #1a2332;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --border: #1e3a5f;
  --border-glow: #0066ff;
  --primary: #00d4ff;
  --primary-hover: #00a8cc;
  --primary-soft: rgba(0, 212, 255, 0.1);
  --accent: #8b5cf6;
  --accent-glow: #d946ef;
  --top-bg: linear-gradient(135deg, #0a0e17 0%, #1a1a2e 50%, #0f172a 100%);
  --top-text: #e2e8f0;
  --top-link: #00d4ff;
  --top-link-hover: #ffffff;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 102, 255, 0.15);
  --shadow-glow: 0 0 20px rgba(0, 212, 255, 0.3), 0 0 40px rgba(0, 102, 255, 0.1);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --font: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  --mono: ui-monospace, "Cascadia Code", "Consolas", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: 
    radial-gradient(ellipse at 20% 0%, rgba(0, 102, 255, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
    linear-gradient(180deg, var(--bg-page) 0%, var(--bg-page-accent) 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: var(--top-link-hover);
  text-shadow: 0 0 10px var(--primary);
  text-decoration: none;
}

/* ---------- 顶栏（分组导航） ---------- */
.site-header {
  background: var(--top-bg);
  color: var(--top-text);
  border-bottom: 1px solid var(--border);
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(0, 102, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  position: sticky;
  top: 0;
  z-index: 200;
}

.site-header::before {
  content: '';
  display: block;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary));
  opacity: 0.85;
}

.site-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 18px 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--top-text);
  text-decoration: none;
  flex: 0 1 auto;
  min-width: 0;
}

.site-brand:hover {
  color: var(--top-link-hover);
  text-shadow: none;
}

.site-brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
  background:
    radial-gradient(circle at 30% 30%, rgba(0, 212, 255, 0.9), transparent 55%),
    linear-gradient(135deg, #0f2744, #1e3a5f);
  border: 1px solid rgba(0, 212, 255, 0.45);
  box-shadow: 0 0 16px rgba(0, 212, 255, 0.25);
}

.site-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.site-brand-title {
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--primary);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

.site-brand-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.site-nav-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.site-nav-toggle-btn {
  display: none;
  margin-left: auto;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 212, 255, 0.06);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.site-nav-toggle-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.site-header-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  flex: 1 1 520px;
  justify-content: flex-end;
}

.nav-group {
  display: flex;
  align-items: center;
  gap: 6px 8px;
  flex-wrap: wrap;
}

.nav-group-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 2px;
  user-select: none;
  white-space: nowrap;
}

.nav-group-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
}

.nav-group-more {
  position: relative;
}

.nav-group-more > summary {
  list-style: none;
  cursor: pointer;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  color: var(--top-link);
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.nav-group-more > summary::-webkit-details-marker {
  display: none;
}

.nav-group-more > summary::after {
  content: ' ▾';
  font-size: 0.75em;
  opacity: 0.8;
}

.nav-group-more[open] > summary,
.nav-group-more > summary:hover {
  background: rgba(0, 212, 255, 0.1);
  border-color: rgba(0, 212, 255, 0.35);
  color: var(--top-link-hover);
}

.nav-dropdown-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 168px;
  padding: 8px;
  border-radius: var(--radius);
  background: linear-gradient(160deg, #111827 0%, #1a2332 100%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg), 0 0 24px rgba(0, 102, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 220;
}

.nav-dropdown-panel .nav-link {
  display: block;
  width: 100%;
}

.site-header .nav-link {
  display: inline-block;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  color: var(--top-link);
  font-size: 0.875rem;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.site-header .nav-link:hover {
  background: rgba(0, 212, 255, 0.1);
  color: var(--top-link-hover);
  text-decoration: none;
  border-color: rgba(0, 212, 255, 0.4);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.15);
  text-shadow: none;
}

.site-header .nav-link.is-active {
  background: rgba(0, 212, 255, 0.16);
  color: #fff;
  border-color: rgba(0, 212, 255, 0.55);
  box-shadow: 0 0 14px rgba(0, 212, 255, 0.25);
}

.nav-cta-login {
  margin-left: 4px;
  font-weight: 600;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(139, 92, 246, 0.15));
  border-color: rgba(0, 212, 255, 0.45) !important;
}

.nav-cta-login:hover {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.35), rgba(139, 92, 246, 0.25));
}

@media (max-width: 1024px) {
  .site-brand-title {
    max-width: 200px;
  }
}

@media (max-width: 900px) {
  .site-nav-toggle-btn {
    display: flex;
  }

  .site-header-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px 0 4px;
    border-top: 1px solid var(--border);
  }

  .site-nav-toggle:checked ~ .site-header-nav {
    display: flex;
  }

  .nav-group {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .nav-group-links {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-group-more > summary {
    width: 100%;
  }

  .nav-dropdown-panel {
    position: static;
    margin-top: 4px;
    box-shadow: none;
  }

  .nav-cta-login {
    margin-left: 0;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .site-brand-sub {
    display: none;
  }

  .site-brand-title {
    max-width: 160px;
    font-size: 0.9rem;
  }
}

/* 兼容旧类名（个别页面若仍引用） */
.top {
  background: var(--top-bg);
  color: var(--top-text);
  padding: 14px 22px;
}

/* ---------- 主布局 ---------- */
.wrap {
  max-width: 1180px;
  margin: 28px auto 40px;
  padding: 0 18px;
}

.card {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-elevated) 100%);
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: 
    var(--shadow-lg),
    0 0 30px rgba(0, 102, 255, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.3), transparent);
}

.card > h1:first-child,
h1.page-title {
  margin-top: 0;
  margin-bottom: 0.65em;
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  text-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.card h2,
.card h3 {
  margin-top: 1.35em;
  margin-bottom: 0.55em;
  font-weight: 600;
  color: var(--primary);
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
}

.card h3 {
  font-size: 1.05rem;
  color: var(--text);
  text-shadow: none;
}

/* ---------- 表格 ---------- */
.table-scroll {
  overflow-x: auto;
  margin: 0.75rem 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: 0 0 10px rgba(0, 102, 255, 0.1);
  -webkit-overflow-scrolling: touch;
}

.card .table-scroll > table {
  margin: 0;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
}

th,
td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  transition: all 0.2s ease;
}

th {
  background: linear-gradient(180deg, var(--surface-elevated) 0%, var(--surface) 100%);
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
  border-bottom: 2px solid var(--border-glow);
}

tbody tr:nth-child(even) td {
  background: rgba(0, 212, 255, 0.02);
}

tbody tr:hover td {
  background: var(--primary-soft);
  box-shadow: inset 0 0 20px rgba(0, 212, 255, 0.05);
}

/* ---------- 表单 ---------- */
form .row {
  margin-bottom: 12px;
}

label {
  display: inline-block;
  min-width: 140px;
  vertical-align: top;
  padding-top: 4px;
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

label:hover {
  color: var(--primary);
}

input,
select,
textarea {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  max-width: 100%;
  background: var(--surface);
  color: var(--text);
  transition: all 0.2s ease;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--border-glow);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 
    0 0 0 3px rgba(0, 212, 255, 0.2),
    0 0 15px rgba(0, 212, 255, 0.1);
}

.btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary) 0%, #0099cc 100%);
  color: #fff;
  border: 0;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.3s ease;
}

.btn:hover {
  background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary) 100%);
  box-shadow: 
    0 0 20px rgba(0, 212, 255, 0.4),
    0 0 40px rgba(0, 102, 255, 0.2);
  transform: translateY(-1px);
}

.btn:hover::before {
  left: 100%;
}

.btn:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--accent) 0%, #7c3aed 100%);
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #7c3aed 0%, var(--accent) 100%);
  box-shadow: 
    0 0 20px rgba(139, 92, 246, 0.4),
    0 0 40px rgba(217, 70, 239, 0.2);
}

/* ---------- 辅助 ---------- */
.hint {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 10px;
}

.err {
  color: var(--danger);
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

details {
  margin-top: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: 8px 12px;
  background: var(--surface);
  transition: all 0.2s ease;
}

details:hover {
  border-color: var(--border-glow);
  box-shadow: 0 0 10px rgba(0, 102, 255, 0.1);
}

summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--primary);
  transition: color 0.2s ease;
}

summary:hover {
  color: var(--top-link-hover);
  text-shadow: 0 0 10px var(--primary);
}

pre {
  overflow-x: auto;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  line-height: 1.45;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--surface-elevated);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--primary);
}

pre code {
  padding: 0;
  background: none;
  border: none;
  color: var(--text);
}

/* ---------- Blueprint 文档页 ---------- */
.blueprint-top .top-extra {
  margin-left: auto;
  opacity: 0.9;
  font-size: 0.9rem;
}

.blueprint-intro {
  background: linear-gradient(135deg, var(--primary-soft) 0%, rgba(139, 92, 246, 0.1) 100%);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin: 1rem 0 1.5rem;
  color: var(--text);
  box-shadow: 
    0 0 20px rgba(0, 212, 255, 0.1),
    inset 0 0 20px rgba(0, 212, 255, 0.05);
}

.blueprint-intro strong {
  color: var(--primary);
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.endpoint-path {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--surface);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--primary);
  box-shadow: 0 0 5px rgba(0, 212, 255, 0.1);
}

.blueprint-divider {
  margin: 28px 0;
  border: 0;
  border-top: 1px solid var(--border);
  background: linear-gradient(90deg, transparent, var(--border-glow), transparent);
  height: 1px;
}

.blueprint-footer {
  color: var(--text-muted);
  font-size: 14px;
}

.method {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: all 0.2s ease;
  box-shadow: 0 0 10px currentColor;
}

.method-get {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.method-get:hover {
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
}

.method-post {
  background: rgba(0, 212, 255, 0.2);
  color: #00d4ff;
  border: 1px solid rgba(0, 212, 255, 0.4);
}

.method-post:hover {
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
}

.method-put {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.method-put:hover {
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.5);
}

.method-delete {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.method-delete:hover {
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
}

.blueprint-card {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-elevated) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 
    var(--shadow-md),
    0 0 20px rgba(0, 102, 255, 0.05);
  transition: all 0.2s ease;
}

.blueprint-card:hover {
  border-color: var(--border-glow);
  box-shadow: 
    var(--shadow-glow),
    0 0 30px rgba(0, 102, 255, 0.1);
}

.blueprint-card ul {
  line-height: 1.85;
  color: var(--text);
}

.blueprint-card h2:first-of-type {
  margin-top: 0;
  color: var(--primary);
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

/* ---------- 个人工作台指标 ---------- */
.uc-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin: 12px 0 20px;
}

.uc-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 12px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-elevated) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.uc-metric:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.uc-metric-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.uc-metric-label {
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.uc-metric-alert {
  border-color: rgba(245, 158, 11, 0.5);
}

/* ---------- 监管仪表盘（图表优先） ---------- */
.gov-dashboard {
  margin: 16px 0 24px;
}

.gov-hours-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 16px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.gov-hours-bar a {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
}

.gov-hours-bar a:hover,
.gov-hours-bar a.gov-hours-active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.gov-kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.gov-kpi-card {
  padding: 14px 12px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-elevated) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}

.gov-kpi-card.gov-kpi-warn {
  border-color: rgba(245, 158, 11, 0.45);
}

.gov-kpi-card.gov-kpi-danger {
  border-color: rgba(239, 68, 68, 0.45);
}

.gov-kpi-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.gov-kpi-label {
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.gov-chart-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 14px 8px;
  min-height: 200px;
}

.gov-chart-panel h4 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.gov-chart-panel canvas {
  max-height: 280px;
}

.gov-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 16px 0;
}

.gov-dashboard-grid.gov-grid-1 {
  grid-template-columns: 1fr;
}

@media (max-width: 768px) {
  .gov-dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.gov-trend-chart {
  margin: 8px 0 16px;
}

.uc-metric-alert .uc-metric-value {
  color: var(--warning);
}

.uc-quick-links {
  line-height: 2.2;
}

/* ---------- 状态 badge 与进度步骤 ---------- */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: none;
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
}

.badge-info {
  background: rgba(59, 130, 246, 0.15);
  color: #2563eb;
}

.progress-steps {
  list-style: none;
  padding: 0;
  margin: 16px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.progress-step {
  flex: 1 1 140px;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

.progress-step-done {
  border-color: rgba(16, 185, 129, 0.5);
}

.progress-step-current {
  border-color: rgba(59, 130, 246, 0.6);
  box-shadow: var(--shadow-md);
}

.progress-step-pending {
  opacity: 0.65;
}

/* ---------- 站点地图（图表式） ---------- */
.sitemap-intro {
  background: linear-gradient(135deg, var(--primary-soft) 0%, rgba(139, 92, 246, 0.08) 100%);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  color: var(--text);
}

.sitemap-intro strong {
  color: var(--primary);
}

.sitemap-flow {
  margin-bottom: 28px;
  padding: 20px 16px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-elevated) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}

.sitemap-flow-track {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 4px;
  min-width: min(100%, 720px);
  margin: 0 auto;
}

.sitemap-flow-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 12px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  text-align: center;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sitemap-flow-node span {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}

.sitemap-flow-node small {
  margin-top: 4px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.sitemap-flow-home {
  border-color: rgba(0, 212, 255, 0.5);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.15);
}

.sitemap-flow-lims {
  border-color: rgba(16, 185, 129, 0.45);
}

.sitemap-flow-safety {
  border-color: rgba(245, 158, 11, 0.45);
}

.sitemap-flow-expert {
  border-color: rgba(139, 92, 246, 0.45);
}

.sitemap-flow-finance {
  border-color: rgba(0, 212, 255, 0.45);
}

.sitemap-flow-services {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.15);
}

.sitemap-flow-arrow {
  width: 24px;
  height: 2px;
  background: linear-gradient(90deg, var(--border), var(--primary));
  position: relative;
  flex-shrink: 0;
}

.sitemap-flow-arrow::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-left-color: var(--primary);
}

.sitemap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.sitemap-module {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-elevated) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sitemap-module:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-md);
}

.sitemap-module-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.sitemap-module-icon {
  font-size: 1.75rem;
  line-height: 1;
  flex-shrink: 0;
}

.sitemap-module-head h2 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  color: var(--primary);
}

.sitemap-module-summary {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.sitemap-module-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sitemap-link-chip {
  display: inline-block;
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.sitemap-link-chip:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  text-shadow: none;
}

.sitemap-link-auth::after {
  content: " \1F512";
  font-size: 0.75em;
  opacity: 0.75;
}

.sitemap-accent-portal .sitemap-module-head h2 {
  color: #00d4ff;
}

.sitemap-accent-lims .sitemap-module-head h2 {
  color: #10b981;
}

.sitemap-accent-safety .sitemap-module-head h2 {
  color: #f59e0b;
}

.sitemap-accent-expert .sitemap-module-head h2 {
  color: #a78bfa;
}

.sitemap-accent-finance .sitemap-module-head h2 {
  color: #38bdf8;
}

.sitemap-accent-ops .sitemap-module-head h2 {
  color: #818cf8;
}

.sitemap-accent-wechat .sitemap-module-head h2 {
  color: #34d399;
}

.sitemap-footer-hint {
  margin-top: 24px;
}

/* ---------- 门户首页 ---------- */
.portal-home {
  margin-top: 4px;
}

.portal-lead {
  margin: 0 0 20px;
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.portal-section {
  margin-bottom: 24px;
}

.portal-section-title {
  margin: 0 0 12px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.02em;
}

.portal-section-desc {
  margin: -4px 0 14px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.portal-quick-grid {
  margin-bottom: 0;
}

.portal-home-layout {
  display: grid;
  grid-template-columns: minmax(240px, 300px) 1fr;
  gap: 20px;
  align-items: start;
  margin-bottom: 20px;
}

.portal-home-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.portal-panel {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.portal-panel-title {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.portal-feed-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text-muted);
}

.portal-feed-list a {
  color: var(--text);
}

.portal-panel-more {
  margin: 10px 0 0;
  font-size: 0.85rem;
}

.portal-panel-stats {
  margin-bottom: 18px;
}

.portal-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.portal-stat {
  text-align: center;
  padding: 12px 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}

.portal-stat strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.portal-stat span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.portal-panel-cases {
  margin-top: 14px;
}

.portal-case-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.portal-case-item {
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border-left: 3px solid var(--primary);
}

.portal-case-item strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.portal-case-item p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

@media (max-width: 640px) {
  .portal-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.portal-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.portal-module-card {
  display: flex;
  gap: 14px;
  padding: 18px 18px 16px;
  background: linear-gradient(145deg, rgba(17, 24, 39, 0.95) 0%, rgba(26, 35, 50, 0.9) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  position: relative;
  overflow: hidden;
}

.portal-module-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--portal-accent, var(--primary));
  opacity: 0.85;
}

.portal-module-card:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
  text-shadow: none;
}

.portal-module-icon {
  flex-shrink: 0;
  font-size: 2rem;
  line-height: 1;
  margin-top: 2px;
}

.portal-module-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.portal-module-title {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--portal-accent, var(--primary));
  margin-bottom: 4px;
}

.portal-module-tagline {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.4;
}

.portal-module-status {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.portal-module-highlights {
  margin: 0 0 10px;
  padding-left: 1rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.portal-module-highlights li {
  margin-bottom: 2px;
}

.portal-module-cta {
  margin-top: auto;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--portal-accent, var(--primary));
}

.portal-accent-portal {
  --portal-accent: #00d4ff;
}

.portal-accent-base {
  --portal-accent: #818cf8;
}

.portal-accent-lims {
  --portal-accent: #10b981;
}

.portal-accent-safety {
  --portal-accent: #f59e0b;
}

.portal-accent-expert {
  --portal-accent: #a78bfa;
}

.portal-accent-finance {
  --portal-accent: #38bdf8;
}

.portal-accent-default {
  --portal-accent: #94a3b8;
}

.portal-home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
}

@media (max-width: 900px) {
  .portal-home-layout {
    grid-template-columns: 1fr;
  }

  .portal-home-side {
    order: 2;
  }

  .portal-home-main {
    order: 1;
  }
}

@media (max-width: 640px) {
  .portal-module-grid {
    grid-template-columns: 1fr;
  }

  .sitemap-flow-track {
    flex-direction: column;
    align-items: stretch;
  }

  .sitemap-flow-arrow {
    width: 2px;
    height: 20px;
    margin: 0 auto;
    background: linear-gradient(180deg, var(--border), var(--primary));
  }

  .sitemap-flow-arrow::after {
    right: 50%;
    top: auto;
    bottom: 0;
    transform: translateX(50%);
    border: 5px solid transparent;
    border-top-color: var(--primary);
    border-left-color: transparent;
  }

  .sitemap-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- LIMS 报告要素校验 ---------- */
.lims-viz-panel {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.lims-viz-checklist {
  margin: 12px 0 20px;
  overflow-x: auto;
}

.lims-viz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.lims-viz-card {
  background: linear-gradient(145deg, rgba(17, 24, 39, 0.95) 0%, rgba(26, 35, 50, 0.9) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.lims-viz-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.lims-viz-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 8px 0;
}

.lims-viz-card-actions {
  margin-top: 10px;
  font-size: 0.88rem;
}

.lims-viz-status-passed {
  border-left: 4px solid var(--success);
}

.lims-viz-status-warning {
  border-left: 4px solid var(--warning);
}

.lims-viz-status-failed {
  border-left: 4px solid var(--danger);
}

.lims-viz-status-not_verified {
  border-left: 4px solid var(--text-muted);
}

.invoice-kpi-strip {
  margin-bottom: 18px;
}

.finance-kpi-strip {
  margin-bottom: 18px;
}

/* ---------- 专家预约日历 ---------- */
.expert-calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.expert-cal-day {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.2);
  min-height: 88px;
}

.expert-cal-day header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  font-size: 0.88rem;
}

.expert-cal-day header span {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.expert-cal-metrics {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.expert-cal-open {
  border-left: 3px solid var(--success);
}

.expert-cal-partial {
  border-left: 3px solid var(--warning);
}

.expert-cal-full {
  border-left: 3px solid var(--danger);
}

.expert-cal-empty {
  border-left: 3px solid var(--border);
  opacity: 0.75;
}

/* AI 智能助手 */
.ai-assistant {
  margin-top: 24px;
  padding: 16px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  background: #f8fafc;
}

.ai-assistant-compact {
  margin-top: 16px;
}

.ai-assistant-title {
  margin: 0 0 12px;
  font-size: 1.05rem;
}

.ai-assistant-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 6px;
  font-size: 14px;
  resize: vertical;
}

.ai-assistant-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.ai-assistant-steps {
  margin: 12px 0 0 18px;
  padding: 0;
}

.ai-assistant-summary {
  margin-top: 12px;
  padding: 12px;
  background: #fff;
  border-radius: 6px;
  border: 1px solid var(--border, #e5e7eb);
}

/* 全站底部 AI 助手 Dock */
body.has-ai-assistant-dock {
  padding-bottom: 72px;
}

body.has-ai-assistant-dock.ai-dock-expanded {
  padding-bottom: 220px;
}

.ai-assistant-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 900;
  background: #fff;
  border-top: 1px solid var(--border, #e5e7eb);
  box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.08);
}

.ai-assistant-dock-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 16px;
  box-sizing: border-box;
}

.ai-assistant-dock-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 8px;
  background: #f1f5f9;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
}

.ai-assistant-dock-toggle-icon {
  display: inline-block;
  transition: transform 0.2s ease;
  font-size: 10px;
}

.ai-assistant-dock.is-expanded .ai-assistant-dock-toggle-icon {
  transform: rotate(180deg);
}

.ai-assistant-dock-input {
  flex: 1 1 200px;
  min-width: 120px;
  min-height: 40px;
  max-height: 120px;
  margin: 0;
}

.ai-assistant-dock-panel {
  display: none;
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 16px 0;
  max-height: 160px;
  overflow-y: auto;
  box-sizing: border-box;
}

.ai-assistant-dock.is-expanded .ai-assistant-dock-panel {
  display: block;
}

.ai-assistant-dock .ai-assistant-run,
.ai-assistant-dock .ai-assistant-voice {
  flex: 0 0 auto;
}

.nav-cta-assistant {
  font-weight: 600;
  color: #4f46e5 !important;
  border: 1px solid rgba(79, 70, 229, 0.35);
  border-radius: 6px;
  padding: 6px 12px !important;
  margin-right: 4px;
}

.portal-ai-dock-hint {
  margin-top: 16px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 6px;
  border-left: 3px solid #6366f1;
}

.expert-cal-weekend {
  background: rgba(139, 92, 246, 0.08);
}
