/* ═══════════════════════════════════════════════════════════════
   Engma Finance Intelligence · Cyber Fluid Neon Theme
   设计方向：赛博流体 / 深空霓虹 / 持续脉动
   适配 web-lite 视觉风格，覆盖全 6 模板
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* 背景层 */
  --bg0: #020308;
  --bg1: #050712;
  --bg2: #0a0f1e;
  --surface: rgba(12, 16, 32, 0.72);
  --surface-strong: rgba(18, 24, 48, 0.86);
  --surface-hover: rgba(22, 30, 58, 0.92);

  /* 文字 */
  --ink: #f0f6ff;
  --ink2: #9fb3d6;
  --ink3: #c8d6f0;
  --muted: #5f7294;
  --muted-strong: #7e91b6;

  /* 边线 */
  --line: rgba(120, 180, 255, 0.14);
  --line-strong: rgba(120, 180, 255, 0.30);
  --line-bright: rgba(120, 180, 255, 0.45);

  /* 霓虹主色 */
  --cyan: #00f0ff;
  --magenta: #ff2a8c;
  --violet: #a855f7;
  --gold: #ffd166;
  --green: #39ff14;
  --red: #f87171;
  --blue: #60a5fa;

  /* 发光阴影 */
  --glow-cyan: rgba(0, 240, 255, 0.35);
  --glow-magenta: rgba(255, 42, 140, 0.35);
  --glow-violet: rgba(168, 85, 247, 0.35);
  --glow-gold: rgba(255, 209, 102, 0.32);
  --glow-green: rgba(57, 255, 20, 0.30);

  /* 渐变组合 */
  --grad-primary: linear-gradient(135deg, var(--cyan), var(--violet));
  --grad-warm: linear-gradient(135deg, var(--magenta), var(--gold));
  --grad-cool: linear-gradient(135deg, var(--cyan), var(--blue));
  --grad-accent: linear-gradient(90deg, var(--cyan), var(--violet), var(--magenta), var(--gold));

  /* 圆角 / 阴影 */
  --radius: 20px;
  --radius-sm: 12px;
  --radius-lg: 28px;
  --shadow-soft: 0 20px 50px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.05);

  /* 字体 */
  --mono: "JetBrains Mono", "SF Mono", "Consolas", "PingFang SC", monospace;
}

/* ── Reset ── */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  color: var(--ink);
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg0);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }

/* ══════════ 背景层（4 层叠加）══════════ */
.bg-aurora {
  position: fixed; inset: 0; z-index: -4; pointer-events: none;
  background:
    radial-gradient(ellipse at 15% 15%, rgba(0, 240, 255, 0.18) 0%, transparent 42%),
    radial-gradient(ellipse at 85% 20%, rgba(255, 42, 140, 0.16) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 90%, rgba(168, 85, 247, 0.20) 0%, transparent 48%),
    linear-gradient(180deg, var(--bg0) 0%, var(--bg1) 50%, var(--bg2) 100%);
  animation: aurora-shift 14s ease-in-out infinite alternate;
}
@keyframes aurora-shift {
  0% { transform: scale(1) rotate(0deg); opacity: 0.9; }
  50% { transform: scale(1.06) rotate(1deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 0.9; }
}

.bg-orbs {
  position: fixed; inset: 0; z-index: -3; pointer-events: none; overflow: hidden;
}
.bg-orbs::before, .bg-orbs::after {
  content: ""; position: absolute; border-radius: 50%;
  filter: blur(70px); opacity: 0.45;
  animation: orb-float 12s ease-in-out infinite;
}
.bg-orbs::before {
  width: 36vw; height: 36vw; min-width: 260px; min-height: 260px;
  top: 8%; left: -8%;
  background: radial-gradient(circle, var(--cyan), transparent 70%);
}
.bg-orbs::after {
  width: 30vw; height: 30vw; min-width: 220px; min-height: 220px;
  bottom: 5%; right: -6%;
  background: radial-gradient(circle, var(--magenta), transparent 70%);
  animation-delay: -6s;
}
@keyframes orb-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(4vw, -6vh) scale(1.08); }
  66% { transform: translate(-3vw, 5vh) scale(0.95); }
}

.bg-grid {
  position: fixed; inset: 0; z-index: -2; pointer-events: none; opacity: 0.08;
  background-image:
    linear-gradient(rgba(120, 180, 255, 0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 180, 255, 0.5) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, black 30%, transparent 90%);
}

.bg-scanlines {
  position: fixed; inset: 0; z-index: 1000; pointer-events: none;
  background: repeating-linear-gradient(
    0deg, rgba(0, 0, 0, 0) 0px, rgba(0, 0, 0, 0) 2px,
    rgba(0, 240, 255, 0.03) 3px, rgba(0, 0, 0, 0) 4px
  );
  opacity: 0.5;
}

/* ══════════ 旋转边框（rim）══════════ */
.rim { position: relative; }
.rim::before {
  content: ""; position: absolute; inset: -1.5px;
  border-radius: calc(var(--radius) + 1.5px);
  background: conic-gradient(from 0deg, var(--cyan), var(--violet), var(--magenta), var(--gold), var(--cyan));
  z-index: -1; animation: rim-rotate 5s linear infinite;
  filter: blur(1px); opacity: 0.65;
}
.rim::after {
  content: ""; position: absolute; inset: 0;
  border-radius: var(--radius);
  background: var(--surface-strong); z-index: -1;
}
@keyframes rim-rotate { to { transform: rotate(360deg); } }

/* ══════════ 顶部导航 topbar ═════════ */
.topbar {
  background: rgba(5, 8, 16, 0.72) !important;
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line) !important;
  padding: 14px 28px !important;
  display: flex; align-items: center; gap: 16px;
  position: sticky; top: 0; z-index: 50;
  color: var(--ink);
}

.logo { display: flex; align-items: center; gap: 12px; }
.logo-badge {
  width: 42px; height: 42px; border-radius: 14px;
  background: var(--bg1);
  position: relative; overflow: hidden;
  border: 2px solid transparent;
  background-clip: padding-box;
  font-weight: 800; font-size: 13px; color: var(--ink);
  font-family: var(--mono); letter-spacing: 0.04em;
  box-shadow: 0 0 24px var(--glow-cyan);
}
.logo-badge::before {
  content: ""; position: absolute; inset: -4px;
  background: conic-gradient(from 0deg, var(--cyan), var(--violet), var(--magenta), var(--gold), var(--cyan));
  z-index: -2; animation: rim-rotate 5s linear infinite;
}
.logo-badge::after {
  content: ""; position: absolute; inset: 0;
  border-radius: 12px; background: var(--bg1);
  z-index: -1;
}
.logo-badge span { position: relative; z-index: 1; color: var(--ink); }
.logo h1 { font-size: 18px; font-weight: 700; letter-spacing: 0.02em; color: var(--ink); }
.logo small { display: block; color: var(--muted-strong); font-weight: 400; font-size: 11px; font-family: var(--mono); letter-spacing: 0.12em; text-transform: uppercase; margin-top: 2px; }

.topbar-right { margin-left: auto; display: flex; gap: 10px; align-items: center; color: var(--ink2); }

.user-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface) !important;
  padding: 6px 14px; border-radius: 20px; font-size: 13px;
  border: 1px solid var(--line);
  color: var(--ink2);
}
.user-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--grad-warm) !important;
  color: var(--bg0); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
}

.env-tag {
  font-size: 11px; padding: 4px 10px; border-radius: 12px;
  background: rgba(255, 209, 102, 0.10) !important;
  color: var(--gold) !important;
  border: 1px solid rgba(255, 209, 102, 0.30) !important;
  font-family: var(--mono); font-weight: 700;
}
.env-tag.demo {
  background: rgba(0, 240, 255, 0.10) !important;
  color: var(--cyan) !important;
  border-color: rgba(0, 240, 255, 0.30) !important;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.12);
}

.crumb { color: var(--muted); font-size: 13px; }

/* ══════════ 容器 main ═════════ */
main { max-width: 1280px; margin: 26px auto; padding: 0 28px; color: var(--ink); }

/* ══════════ 章节标题 ═════════ */
.sec-title {
  font-size: 14px; color: var(--ink2); font-weight: 600;
  margin: 28px 0 14px; display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); letter-spacing: 0.04em; text-transform: uppercase;
}
.sec-title .bar {
  width: 4px; height: 18px; border-radius: 2px;
  background: linear-gradient(180deg, var(--cyan), var(--violet));
  box-shadow: 0 0 8px var(--glow-cyan);
  display: inline-block;
}

/* ══════════ 通用玻璃面板 card ═════════ */
.upper { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.card {
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-soft) !important;
  backdrop-filter: blur(16px);
  overflow: hidden;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}
.card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong) !important;
  box-shadow: 0 24px 60px rgba(0,0,0,0.38), 0 0 24px var(--glow-cyan), inset 0 1px 0 rgba(255,255,255,0.06) !important;
}
.card-head {
  padding: 18px 22px 0; display: flex; align-items: center; gap: 12px;
  color: var(--ink);
}
.card-head h2 { font-size: 16px; font-weight: 700; letter-spacing: 0.01em; }
.card-head .sub { font-size: 12px; color: var(--muted-strong); font-family: var(--mono); }
.card-head .sub a { color: var(--cyan) !important; transition: color 160ms; }
.card-head .sub a:hover { color: var(--violet); text-shadow: 0 0 8px var(--glow-cyan); }

.icon-wrap {
  width: 38px; height: 38px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  background: rgba(0, 240, 255, 0.10) !important;
  border: 1px solid rgba(0, 240, 255, 0.22);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.10);
}
.icon-blue { background: rgba(0, 240, 255, 0.10) !important; border-color: rgba(0, 240, 255, 0.22); }
.icon-purple { background: rgba(168, 85, 247, 0.10) !important; border-color: rgba(168, 85, 247, 0.22); box-shadow: 0 0 12px rgba(168, 85, 247, 0.10); }
.icon-amber { background: rgba(255, 209, 102, 0.10) !important; border-color: rgba(255, 209, 102, 0.22); box-shadow: 0 0 12px rgba(255, 209, 102, 0.10); }
.icon-green { background: rgba(57, 255, 20, 0.10) !important; border-color: rgba(57, 255, 20, 0.22); box-shadow: 0 0 12px rgba(57, 255, 20, 0.10); }
.icon-red { background: rgba(255, 42, 140, 0.10) !important; border-color: rgba(255, 42, 140, 0.22); box-shadow: 0 0 12px rgba(255, 42, 140, 0.10); }
.icon-cyan { background: rgba(0, 240, 255, 0.10) !important; border-color: rgba(0, 240, 255, 0.22); }

/* ══════════ 工单流 ═════════ */
.ticket-feed { padding: 14px 20px 18px; }
.ticket-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 180ms ease;
  color: var(--ink2);
}
.ticket-item:hover {
  border-color: var(--line-strong);
  box-shadow: 0 0 14px var(--glow-cyan);
  transform: translateX(2px);
}
.t-id {
  font-family: var(--mono); font-size: 12px;
  color: var(--cyan) !important;
  background: rgba(0, 240, 255, 0.08) !important;
  padding: 3px 9px; border-radius: 6px;
  border: 1px solid rgba(0, 240, 255, 0.22);
  white-space: nowrap;
}
.t-info { flex: 1; min-width: 0; }
.t-skill { font-size: 13px; font-weight: 600; color: var(--ink); }
.t-time { font-size: 11px; color: var(--muted-strong); font-family: var(--mono); }
.pill {
  font-size: 11px; padding: 3px 9px; border-radius: 10px; white-space: nowrap;
  font-family: var(--mono); font-weight: 700;
}
.pill.ok { background: rgba(57, 255, 20, 0.10); color: var(--green); border: 1px solid rgba(57, 255, 20, 0.30); }
.pill.demo { background: rgba(255, 209, 102, 0.10); color: var(--gold); border: 1px solid rgba(255, 209, 102, 0.30); }
.pill.error { background: rgba(255, 42, 140, 0.10); color: var(--magenta); border: 1px solid rgba(255, 42, 140, 0.30); }
.pill.building { background: rgba(255, 255, 255, 0.06); color: var(--muted-strong); border: 1px solid var(--line); }
.feed-empty { color: var(--muted-strong); font-size: 13px; text-align: center; padding: 24px 0; font-style: italic; }

/* ══════════ 知识库分类 ═════════ */
.kb-cats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 14px 22px 18px; }
.kb-cat {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 14px !important;
  cursor: pointer; transition: all 220ms ease;
  background: rgba(255, 255, 255, 0.03);
}
.kb-cat:hover {
  border-color: rgba(0, 240, 255, 0.40) !important;
  box-shadow: 0 0 16px var(--glow-cyan);
  transform: translateY(-2px);
  background: rgba(0, 240, 255, 0.06);
}
.kb-cat .ic { font-size: 24px; }
.kb-cat .nm { font-size: 13px; font-weight: 700; color: var(--ink); }
.kb-cat .cn { font-size: 11px; color: var(--muted-strong); font-family: var(--mono); margin-top: 2px; }

/* ══════════ 税务风险 banner ═════════ */
.tax-banner {
  margin-top: 22px; border-radius: var(--radius);
  padding: 18px 26px;
  color: #fff !important;
  background: linear-gradient(135deg, rgba(255, 42, 140, 0.85), rgba(168, 85, 247, 0.85), rgba(0, 240, 255, 0.85)) !important;
  box-shadow: 0 12px 40px rgba(255, 42, 140, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.10);
  display: flex; align-items: center; gap: 18px;
  cursor: pointer; transition: transform 200ms ease, box-shadow 200ms ease;
  border: 1px solid rgba(255, 255, 255, 0.18);
  position: relative; overflow: hidden;
}
.tax-banner::before {
  content: ""; position: absolute; inset: -50%;
  background: conic-gradient(from 0deg, transparent, rgba(255, 255, 255, 0.18), transparent 30%);
  animation: rim-rotate 6s linear infinite;
  opacity: 0.6; pointer-events: none;
}
.tax-banner:hover { transform: translateY(-3px); box-shadow: 0 16px 50px rgba(255, 42, 140, 0.45); }
.tax-banner > * { position: relative; z-index: 1; }
.tax-ic { font-size: 32px; filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.5)); }
.tax-banner h3 { font-size: 17px; font-weight: 700; letter-spacing: 0.01em; }
.tax-banner p { font-size: 12.5px; opacity: .92; margin-top: 4px; }
.tax-banner .go {
  margin-left: auto;
  background: rgba(0, 0, 0, 0.30) !important;
  padding: 10px 18px; border-radius: 12px; font-size: 13px; font-weight: 700;
  white-space: nowrap; border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
  font-family: var(--mono);
}

/* ══════════ 4 模块网格 mod ═════════ */
.modules { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 12px; }
.mod {
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-soft) !important;
  backdrop-filter: blur(16px);
  padding: 22px !important; cursor: pointer;
  transition: all 240ms ease;
  position: relative;
  color: var(--ink);
}
.mod:hover {
  transform: translateY(-4px);
  border-color: var(--line-bright) !important;
  box-shadow: 0 24px 60px rgba(0,0,0,0.42), 0 0 26px var(--glow-cyan) !important;
}
.mod .big-ic {
  font-size: 34px;
  width: 60px; height: 60px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 240, 255, 0.10) !important;
  border: 1px solid rgba(0, 240, 255, 0.22);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.10);
}
.mod h3 { margin-top: 16px; font-size: 17px; font-weight: 700; letter-spacing: 0.01em; }
.mod .desc { font-size: 12.5px; color: var(--muted-strong); margin-top: 8px; line-height: 1.65; }
.mod .skills { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.mod .sk {
  font-size: 11px; padding: 4px 9px; border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted-strong);
  font-family: var(--mono);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.mod .sk.hot {
  background: rgba(0, 240, 255, 0.08) !important;
  color: var(--cyan) !important;
  font-weight: 600;
  border-color: rgba(0, 240, 255, 0.22);
}
.mod .p0-tag {
  position: absolute; top: 14px; right: 14px;
  font-size: 10px; font-weight: 700;
  color: var(--magenta) !important;
  border: 1px solid rgba(255, 42, 140, 0.40) !important;
  background: rgba(255, 42, 140, 0.10) !important;
  padding: 3px 9px; border-radius: 8px;
  font-family: var(--mono);
  box-shadow: 0 0 12px rgba(255, 42, 140, 0.20);
}

/* ══════════ AI FAB + Chat Panel ═════════ */
.ai-fab {
  position: fixed; right: 28px; bottom: 28px;
  width: 62px; height: 62px;
  border-radius: 50% !important;
  background: conic-gradient(from 0deg, var(--cyan), var(--violet), var(--magenta), var(--gold), var(--cyan)) !important;
  color: var(--bg0) !important;
  font-size: 26px;
  border: none;
  cursor: pointer;
  z-index: 100;
  box-shadow: 0 0 32px var(--glow-cyan), 0 8px 24px rgba(0, 0, 0, 0.40);
  display: flex; align-items: center; justify-content: center;
  transition: transform 200ms ease, box-shadow 200ms ease;
  animation: rim-rotate 6s linear infinite;
}
.ai-fab::after {
  content: ""; position: absolute; inset: 4px;
  border-radius: 50%; background: var(--bg1);
}
.ai-fab:hover { transform: scale(1.10); box-shadow: 0 0 40px var(--glow-cyan), 0 12px 32px rgba(0, 0, 0, 0.50); }
.ai-fab span, .ai-fab { position: relative; }

.chat-panel {
  position: fixed; right: 28px; bottom: 108px;
  width: 440px; height: 640px;
  max-height: calc(100vh - 140px);
  background: var(--surface-strong) !important;
  border-radius: 20px !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.50), 0 0 32px var(--glow-cyan) !important;
  border: 1px solid var(--line-bright) !important;
  backdrop-filter: blur(20px);
  z-index: 99; display: none;
  flex-direction: column;
  overflow: hidden;
}
.chat-panel.open { display: flex; }
.chat-head {
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.20), rgba(168, 85, 247, 0.20)) !important;
  color: var(--ink) !important;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.chat-head b { font-size: 14.5px; font-weight: 700; letter-spacing: 0.01em; }
.chat-close {
  margin-left: auto;
  background: none !important;
  border: none;
  color: var(--ink2) !important;
  font-size: 20px;
  cursor: pointer;
  opacity: 0.85;
  transition: color 160ms;
}
.chat-close:hover { color: var(--cyan); text-shadow: 0 0 8px var(--glow-cyan); }

.chat-body {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
  background: rgba(0, 0, 0, 0.18);
}
.msg {
  max-width: 86%; padding: 11px 15px;
  border-radius: 16px; font-size: 13px;
  line-height: 1.65; white-space: pre-wrap; word-break: break-word;
  font-family: "PingFang SC", "Inter", "Microsoft YaHei", sans-serif;
}
.msg.user {
  align-self: flex-end;
  background: var(--grad-primary) !important;
  color: var(--bg0) !important;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 14px rgba(0, 240, 255, 0.25);
  font-weight: 500;
}
.msg.ai {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--ink) !important;
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}
.msg.system {
  align-self: center;
  background: rgba(255, 209, 102, 0.08) !important;
  color: var(--gold) !important;
  font-size: 12px; max-width: 100%;
  border: 1px solid rgba(255, 209, 102, 0.22);
  text-align: center;
  font-family: var(--mono);
}
.msg.error {
  align-self: flex-start;
  background: rgba(255, 42, 140, 0.10) !important;
  color: var(--magenta) !important;
  border: 1px solid rgba(255, 42, 140, 0.30);
}
.msg .tick { font-size: 11px; color: var(--muted-strong); margin-top: 4px; display: block; font-family: var(--mono); }
.typing { align-self: flex-start; color: var(--muted-strong); font-size: 12px; padding: 4px 8px; font-family: var(--mono); }

.suggests { padding: 0 16px 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.suggests button {
  font-size: 12px; padding: 6px 12px; border-radius: 16px;
  border: 1px solid rgba(0, 240, 255, 0.30) !important;
  background: rgba(0, 240, 255, 0.06) !important;
  color: var(--cyan) !important;
  cursor: pointer; transition: all 160ms ease;
  font-family: "PingFang SC", "Inter", sans-serif;
}
.suggests button:hover {
  background: rgba(0, 240, 255, 0.14) !important;
  border-color: var(--cyan) !important;
  box-shadow: 0 0 12px var(--glow-cyan);
  transform: translateY(-1px);
}

.chat-input {
  padding: 12px 14px;
  border-top: 1px solid var(--line) !important;
  display: flex; gap: 8px;
  background: rgba(0, 0, 0, 0.20);
}
.chat-input textarea {
  flex: 1;
  border: 1px solid var(--line) !important;
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 13px; resize: none; height: 44px;
  outline: none;
  font-family: inherit;
  background: rgba(0, 0, 0, 0.30) !important;
  color: var(--ink) !important;
}
.chat-input textarea:focus {
  border-color: var(--cyan) !important;
  box-shadow: 0 0 14px var(--glow-cyan);
}
.chat-input textarea::placeholder { color: var(--muted); }
.chat-send {
  width: 64px; border: none;
  border-radius: 12px;
  background: var(--grad-primary) !important;
  color: var(--bg0) !important;
  font-size: 14px; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 14px var(--glow-cyan);
  transition: all 160ms ease;
}
.chat-send:hover { box-shadow: 0 0 22px var(--glow-cyan); transform: translateY(-1px); }
.chat-send:disabled { opacity: 0.5; cursor: not-allowed; }

.skill-select {
  padding: 10px 14px 0;
  display: flex; gap: 8px; align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}
.skill-select span { font-size: 12px; color: var(--muted-strong); font-family: var(--mono); }
.skill-select select {
  font-size: 12px; padding: 5px 9px; border-radius: 8px;
  border: 1px solid var(--line) !important;
  background: rgba(0, 0, 0, 0.30) !important;
  color: var(--ink) !important;
  outline: none;
}
.skill-select select:focus { border-color: var(--cyan) !important; }

footer {
  text-align: center;
  color: var(--muted-strong) !important;
  font-size: 12px; padding: 28px 0 100px;
  font-family: var(--mono);
  letter-spacing: 0.05em;
}
footer::before {
  content: ""; display: block; width: 60px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-bright), transparent);
  margin: 0 auto 14px;
}

/* ══════════ 模块页 mod-head ═════════ */
.mod-head {
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-soft) !important;
  backdrop-filter: blur(16px);
  padding: 26px 30px;
  display: flex; align-items: center; gap: 22px;
  border-left: 6px solid var(--cyan) !important;
  position: relative;
}
.mod-ic {
  width: 72px; height: 72px; border-radius: 18px;
  font-size: 38px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: rgba(0, 240, 255, 0.10) !important;
  border: 1px solid rgba(0, 240, 255, 0.22);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.12);
}
.mod-head h2 { font-size: 22px; font-weight: 700; color: var(--ink); }
.mod-head .sub { color: var(--muted-strong); font-size: 13px; margin-top: 6px; }
.p0-tag {
  display: inline-block; margin-top: 12px;
  font-size: 11px; font-weight: 700;
  color: var(--magenta) !important;
  background: rgba(255, 42, 140, 0.10) !important;
  border: 1px solid rgba(255, 42, 140, 0.30) !important;
  padding: 4px 10px; border-radius: 8px;
  font-family: var(--mono);
  box-shadow: 0 0 12px rgba(255, 42, 140, 0.18);
}
.stat-line {
  margin-left: auto; text-align: right;
  font-size: 12px; color: var(--muted-strong);
  white-space: nowrap;
  font-family: var(--mono);
}
.stat-line b {
  font-size: 22px; color: var(--cyan); font-weight: 800;
  font-family: "Inter", sans-serif;
}

/* ══════════ 工单实时表 live-block ═════════ */
.live-block {
  margin-top: 18px;
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-soft) !important;
  backdrop-filter: blur(16px);
  padding: 18px 22px;
  color: var(--ink);
}
.live-block h3 {
  font-size: 14px; margin-bottom: 12px;
  display: flex; gap: 10px; align-items: center;
  color: var(--ink2);
  font-family: var(--mono);
  letter-spacing: 0.04em;
}
.dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--green) !important;
  display: inline-block;
  animation: pulse-dot 1.4s ease-in-out infinite;
  box-shadow: 0 0 8px var(--green);
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.7); }
}

table { width: 100%; border-collapse: collapse; font-size: 13px; color: var(--ink2); }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); }
th {
  color: var(--muted-strong) !important;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.20) !important;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
tbody tr:hover { background: rgba(0, 240, 255, 0.04); }

/* ══════════ Skill 网格 ═════════ */
.sk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.sk-card {
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-soft) !important;
  backdrop-filter: blur(16px);
  padding: 20px 22px;
  position: relative;
  transition: all 240ms ease;
  cursor: pointer;
  color: var(--ink);
}
.sk-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-bright) !important;
  box-shadow: 0 24px 60px rgba(0,0,0,0.42), 0 0 24px var(--glow-cyan) !important;
}
.sk-card.off { cursor: default; opacity: 0.65; }
.sk-card.off:hover { transform: none; box-shadow: var(--shadow-soft); }
.sk-top { display: flex; align-items: center; gap: 8px; }
.sk-code {
  font-family: var(--mono); font-size: 11px;
  color: var(--cyan) !important;
  background: rgba(0, 240, 255, 0.08) !important;
  padding: 3px 9px; border-radius: 6px;
  border: 1px solid rgba(0, 240, 255, 0.22);
}
.sk-ic { margin-left: auto; font-size: 13px; opacity: 0.7; }
.sk-name { font-size: 15px; font-weight: 700; margin-top: 12px; display: flex; align-items: center; gap: 8px; color: var(--ink); }
.llm-badge, .llm-tag {
  font-size: 10px; color: var(--violet) !important;
  background: rgba(168, 85, 247, 0.10) !important;
  border: 1px solid rgba(168, 85, 247, 0.30) !important;
  padding: 2px 7px; border-radius: 6px; font-weight: 700;
  font-family: var(--mono);
  letter-spacing: 0.05em;
}
.sk-desc { font-size: 12px; color: var(--muted-strong); margin-top: 8px; line-height: 1.6; }
.sk-status {
  position: absolute; top: 18px; right: 18px;
  font-size: 11px; padding: 3px 9px; border-radius: 10px;
  font-family: var(--mono); font-weight: 700;
}
.st-ready {
  background: rgba(57, 255, 20, 0.10) !important;
  color: var(--green) !important;
  border: 1px solid rgba(57, 255, 20, 0.30);
  box-shadow: 0 0 8px rgba(57, 255, 20, 0.20);
}
.st-building {
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--muted-strong) !important;
  border: 1px solid var(--line);
}

.nav-back { margin-top: 30px; text-align: center; }
.nav-back a { color: var(--cyan) !important; font-size: 13px; font-family: var(--mono); }
.nav-back a:hover { color: var(--violet); text-shadow: 0 0 8px var(--glow-cyan); }

.back {
  font-size: 13px; color: var(--muted-strong) !important;
  padding: 7px 14px; border-radius: 10px;
  transition: all 160ms ease;
  border: 1px solid transparent;
}
.back:hover {
  background: rgba(0, 240, 255, 0.06) !important;
  color: var(--cyan) !important;
  border-color: rgba(0, 240, 255, 0.22);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.10);
}

/* ══════════ Skill 占位页 card / tag / btn ═════════ */
.crumb a { color: var(--cyan); font-family: var(--mono); }
.crumb a:hover { color: var(--violet); text-shadow: 0 0 8px var(--glow-cyan); }

.title-row h1 { font-size: 22px; color: var(--ink); }
.tag { font-size: 11px; padding: 4px 11px; border-radius: 8px; font-weight: 700; font-family: var(--mono); }
.tag.ready { background: rgba(57, 255, 20, 0.10) !important; color: var(--green) !important; border: 1px solid rgba(57, 255, 20, 0.30); }
.tag.llm { background: rgba(168, 85, 247, 0.10) !important; color: var(--violet) !important; border: 1px solid rgba(168, 85, 247, 0.30); }
.tag.p0 { background: rgba(255, 42, 140, 0.10) !important; color: var(--magenta) !important; border: 1px solid rgba(255, 42, 140, 0.30); }
.code {
  font-family: var(--mono); font-size: 12px;
  color: var(--cyan) !important;
  background: rgba(0, 240, 255, 0.08) !important;
  padding: 3px 10px; border-radius: 6px;
  border: 1px solid rgba(0, 240, 255, 0.22);
}
.desc { color: var(--muted-strong); font-size: 14px; margin-top: 16px; line-height: 1.75; }

.box {
  border: 1px dashed rgba(0, 240, 255, 0.30) !important;
  border-radius: 14px;
  padding: 20px 24px; margin-top: 26px;
  background: rgba(0, 240, 255, 0.04) !important;
  font-size: 13px;
  color: var(--ink2) !important;
  line-height: 1.85;
}
.box b { color: var(--cyan); }

.actions { margin-top: 24px; display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  padding: 11px 22px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 200ms ease;
  font-family: "PingFang SC", "Inter", sans-serif;
}
.btn-p {
  background: var(--grad-primary) !important;
  color: var(--bg0) !important;
  box-shadow: 0 6px 18px var(--glow-cyan);
}
.btn-p:hover { box-shadow: 0 8px 24px var(--glow-cyan); transform: translateY(-2px); }
.btn-g {
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--ink) !important;
  border: 1px solid var(--line) !important;
}
.btn-g:hover {
  border-color: var(--line-strong) !important;
  background: rgba(0, 240, 255, 0.06) !important;
  box-shadow: 0 0 14px var(--glow-cyan);
  transform: translateY(-2px);
}

.api-panel {
  margin-top: 16px;
  background: rgba(0, 0, 0, 0.50) !important;
  color: var(--ink2);
  border-radius: 14px;
  padding: 20px 24px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 2;
  display: none; overflow-x: auto;
  border: 1px solid var(--line);
}
.api-panel.show { display: block; }
.api-panel .k { color: var(--cyan); }
.api-panel .s { color: var(--violet); }

/* ══════════ 分析图表页 ctrl / KPI / charts ═════════ */
.ctrl {
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-soft) !important;
  backdrop-filter: blur(16px);
  padding: 16px 22px;
  display: flex; align-items: center; gap: 18px;
  flex-wrap: wrap;
  color: var(--ink);
}
.ctrl label { font-size: 13px; color: var(--muted-strong); font-family: var(--mono); }
.ctrl select {
  font-size: 13px; padding: 7px 11px; border-radius: 10px;
  border: 1px solid var(--line) !important;
  background: rgba(0, 0, 0, 0.30) !important;
  color: var(--ink) !important;
  margin-left: 6px; outline: none;
}
.ctrl select:focus { border-color: var(--cyan) !important; box-shadow: 0 0 10px var(--glow-cyan); }
.ai-btn {
  margin-left: auto;
  background: var(--grad-primary) !important;
  color: var(--bg0) !important;
  border: none;
  padding: 10px 22px;
  border-radius: 12px;
  font-size: 14px; font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 4px 14px var(--glow-cyan);
  transition: all 180ms ease;
}
.ai-btn:hover { box-shadow: 0 6px 22px var(--glow-cyan); transform: translateY(-2px); }
.ai-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 16px; }
.kpi {
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-soft) !important;
  backdrop-filter: blur(16px);
  padding: 18px 22px;
  transition: all 220ms ease;
}
.kpi:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong) !important;
  box-shadow: 0 12px 32px rgba(0,0,0,0.30), 0 0 16px var(--glow-cyan) !important;
}
.kpi .t { font-size: 12px; color: var(--muted-strong); font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.05em; }
.kpi .v { font-size: 26px; font-weight: 800; margin-top: 8px; font-variant-numeric: tabular-nums; color: var(--ink); }
.kpi .d { font-size: 12px; margin-top: 6px; color: var(--muted-strong); font-family: var(--mono); }

.v-red, .c-red { color: var(--magenta) !important; }
.v-green, .c-green { color: var(--green) !important; }
.v-blue, .c-blue { color: var(--cyan) !important; }
.v-orange { color: var(--gold) !important; }
.v-neutral { color: var(--muted-strong) !important; }

.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.charts.one { grid-template-columns: 1fr; }
.panel {
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-soft) !important;
  backdrop-filter: blur(16px);
  padding: 18px 20px;
  color: var(--ink);
}
.panel h3 {
  font-size: 14px; margin-bottom: 8px;
  display: flex; gap: 8px; align-items: center;
  color: var(--ink2);
  font-family: var(--mono);
  letter-spacing: 0.04em;
}
.legend {
  font-size: 11px; color: var(--muted-strong);
  display: flex; gap: 14px; margin-left: auto;
  flex-wrap: wrap;
  font-family: var(--mono);
}
.lg-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 3px;
  margin-right: 5px;
  vertical-align: -1px;
  box-shadow: 0 0 6px currentColor;
}
svg { width: 100%; height: auto; display: block; }
.axis { font-size: 10px; fill: var(--muted-strong); font-family: var(--mono); }

/* SVG 默认网格线（被内联 stroke 覆盖）*/
svg line[stroke="#eef1f6"], svg line[stroke="#e5e9f2"] {
  stroke: rgba(120, 180, 255, 0.10) !important;
}
svg text[fill="#6b7280"] { fill: var(--muted-strong) !important; }
svg text[fill="#1f2937"] { fill: var(--ink) !important; }
svg circle[fill="var(--card)"] { fill: var(--surface-strong) !important; }

.diff-table {
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-soft) !important;
  backdrop-filter: blur(16px);
  margin-top: 14px; padding: 18px 22px;
  color: var(--ink);
}
.diff-table h3 {
  font-size: 14px; margin-bottom: 12px;
  color: var(--ink2);
  font-family: var(--mono);
  letter-spacing: 0.04em;
}
.neg { color: var(--magenta); }
.pos { color: var(--green); }
.badge { font-size: 11px; padding: 3px 10px; border-radius: 9px; font-family: var(--mono); font-weight: 700; }
.b-warn { background: rgba(255, 42, 140, 0.10) !important; color: var(--magenta) !important; border: 1px solid rgba(255, 42, 140, 0.30); }
.b-ok { background: rgba(57, 255, 20, 0.10) !important; color: var(--green) !important; border: 1px solid rgba(57, 255, 20, 0.30); }
.b-neutral { background: rgba(255, 255, 255, 0.06) !important; color: var(--muted-strong) !important; border: 1px solid var(--line); }

/* ══════════ AI 结果面板 ═════════ */
.ai-result {
  margin-top: 14px;
  background: var(--surface) !important;
  border: 1px solid var(--line-bright) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-soft), 0 0 28px var(--glow-cyan) !important;
  backdrop-filter: blur(16px);
  display: none; overflow: hidden;
}
.ai-result.show { display: block; }
.ai-head {
  background: var(--grad-primary) !important;
  color: var(--bg0) !important;
  padding: 13px 20px;
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}
.ai-close {
  margin-left: auto;
  background: none !important;
  border: none;
  color: var(--bg0) !important;
  font-size: 18px;
  cursor: pointer;
  opacity: 0.85;
}
.ai-close:hover { opacity: 1; }
.ai-body {
  padding: 20px 24px;
  max-height: 460px; overflow-y: auto;
  font-size: 13.5px;
  line-height: 1.95;
  white-space: pre-wrap;
  color: var(--ink);
}
.ai-empty { color: var(--muted-strong); font-style: italic; }
.cursor-blink::after {
  content: '▋';
  color: var(--cyan);
  animation: blink 0.8s infinite;
  text-shadow: 0 0 8px var(--glow-cyan);
}
@keyframes blink { 50% { opacity: 0; } }

/* ══════════ 滚动条 ═════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--cyan), var(--violet));
  border-radius: 3px;
  box-shadow: 0 0 6px var(--glow-cyan);
}

/* ══════════ 响应式 ═════════ */
@media (max-width: 1024px) {
  .upper { grid-template-columns: 1fr; }
  .modules { grid-template-columns: repeat(2, 1fr); }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .charts { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sk-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .modules { grid-template-columns: 1fr; }
  .sk-grid { grid-template-columns: 1fr; }
  .chat-panel { width: calc(100vw - 24px); right: 12px; }
  main { padding: 0 16px; }
}