/* 尚诚 · 医美舆情中台 — 暗色指挥中心 */
:root {
  --bg: #070b18;
  --bg-2: #0c1330;
  --panel: rgba(20, 32, 70, 0.55);
  --panel-2: rgba(13, 22, 50, 0.85);
  --line: rgba(96, 130, 220, 0.18);
  --line-strong: rgba(96, 130, 220, 0.35);
  --text: #e8edff;
  --text-2: #a4b1de;
  --text-3: #6c79a8;
  --pos: #22d3a5;
  --neu: #5e8cf2;
  --neg: #f5536b;
  --warn: #f5b94a;
  --accent: #7aa2ff;
  --accent-2: #c084fc;
  --grad-1: linear-gradient(135deg, #1f3a8a, #6d28d9);
  --grad-2: linear-gradient(135deg, #0f4d8c, #1d2454);
  --shadow: 0 12px 40px rgba(0,0,0,0.45);
  --r: 10px;
}
* { box-sizing: border-box; }
html, body, #root { height: 100%; }
body {
  margin: 0;
  font-family: "PingFang SC","HarmonyOS Sans","Helvetica Neue",Arial,sans-serif;
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(80,120,255,0.18), transparent 60%),
    radial-gradient(1000px 500px at 90% 110%, rgba(192,132,252,0.12), transparent 60%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.01em;
  overflow: hidden;
}
button { font-family: inherit; }

/* ----------- TopBar ----------- */
.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10,18,48,0.85), rgba(10,18,48,0.55));
  backdrop-filter: blur(8px);
  position: relative; z-index: 10;
}
.brand { display:flex; align-items:center; gap: 12px; font-size: 16px; font-weight: 600; letter-spacing: 0.04em; white-space: nowrap; flex-shrink: 0; }
.brand .mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--grad-1);
  display:flex; align-items:center; justify-content:center;
  font-weight: 700; font-size: 16px; color:#fff;
  box-shadow: 0 0 20px rgba(122,162,255,0.45);
}
.brand .sub { color: var(--text-3); font-weight: 400; font-size: 11px; margin-left:6px; letter-spacing: 0.1em; }
.nav { display:flex; gap: 2px; margin-left: 24px; flex-shrink: 0; }
.nav .item {
  padding: 8px 14px; border-radius: 8px; color: var(--text-2); cursor: pointer; font-size: 13px;
  display:flex; align-items:center; gap:6px; white-space: nowrap; flex-shrink: 0;
}
.nav .item:hover { color: var(--text); background: rgba(122,162,255,0.08); }
.nav .item.active { color: var(--text); background: rgba(122,162,255,0.16); box-shadow: inset 0 0 0 1px rgba(122,162,255,0.35); }
.tb-right { margin-left: auto; display:flex; align-items:center; gap: 10px; flex-shrink: 0; flex-wrap: nowrap; white-space: nowrap; }
.tb-right > * { flex-shrink: 0; }
.tb-clock {
  font-feature-settings: "tnum"; font-variant-numeric: tabular-nums;
  color: var(--text-2); font-size: 12px; padding: 6px 12px; border:1px solid var(--line); border-radius:8px;
  white-space: nowrap;
}
@media (max-width: 1280px) { .tb-clock { display: none; } }
@media (max-width: 1100px) { .nav { display: none; } }
.tb-btn {
  background: rgba(122,162,255,0.12); color:#cfe; border: 1px solid rgba(122,162,255,0.35);
  border-radius: 8px; padding: 7px 12px; font-size: 12.5px; cursor: pointer; display:flex; align-items:center; gap:6px;
  white-space: nowrap; flex-shrink: 0;
}
.tb-btn:hover { background: rgba(122,162,255,0.2); }
.tb-btn.primary { background: var(--grad-1); border-color: transparent; color:#fff; }
.tb-btn.primary:hover { filter: brightness(1.1); }
.tb-user { display:flex; align-items:center; gap:10px; padding-left: 8px; border-left:1px solid var(--line); }
.tb-user .avatar { width: 32px; height:32px; border-radius:50%; background: linear-gradient(135deg,#22d3a5,#5e8cf2); display:flex; align-items:center; justify-content:center; font-size:13px; font-weight:600;}
.tb-user .name { font-size: 13px; }
.tb-user .role { color: var(--text-3); font-size: 11px; }

/* ----------- Layout ----------- */
.shell { display:flex; height: calc(100vh - 64px); }
.side {
  width: 220px; flex-shrink: 0;
  border-right: 1px solid var(--line);
  padding: 16px 12px;
  background: rgba(8,14,36,0.5);
  overflow: auto;
}
.side .group { color: var(--text-3); font-size: 11px; letter-spacing: 0.18em; margin: 14px 12px 6px; }
.side .lk {
  display:flex; align-items:center; gap:10px; padding: 9px 12px; border-radius: 8px;
  color: var(--text-2); font-size: 13px; cursor: pointer; position: relative;
}
.side .lk:hover { background: rgba(122,162,255,0.08); color: var(--text); }
.side .lk.active { color: var(--text); background: rgba(122,162,255,0.14); }
.side .lk.active::before {
  content:''; position: absolute; left:0; top: 8px; bottom: 8px; width: 3px; border-radius: 2px;
  background: var(--accent);
}
.side .lk .ico { width: 18px; opacity: 0.8; flex-shrink:0; }
.side .pill { margin-left:auto; font-size: 10px; padding: 1px 6px; border-radius:8px; background: rgba(245,83,107,0.18); color: var(--neg); border:1px solid rgba(245,83,107,0.35); }
.side .scope {
  margin-top: 16px; padding: 12px; border:1px solid var(--line); border-radius:10px; background: var(--panel-2);
}
.side .scope .lab { font-size:11px; color: var(--text-3); letter-spacing:0.2em; }
.side .scope .name { font-size: 14px; font-weight: 600; margin-top:6px; display:flex; align-items:center; gap:6px; }
.side .scope .meta { font-size: 11px; color: var(--text-3); margin-top: 6px; line-height: 1.6; }
.side .scope .swap { margin-top:10px; font-size: 11px; color: var(--accent); cursor:pointer; }

/* ----------- Main ----------- */
.main { flex: 1; overflow: auto; padding: 16px; }
.toolbar { display:flex; align-items:center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.seg { display:flex; background: var(--panel-2); border:1px solid var(--line); border-radius: 8px; padding: 3px; }
.seg .s { padding: 6px 12px; border-radius: 6px; font-size: 12px; cursor:pointer; color: var(--text-2); }
.seg .s.active { background: rgba(122,162,255,0.2); color: var(--text); }
.chip {
  padding: 6px 10px; border-radius: 8px; font-size: 12px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text-2); cursor: pointer; display:flex; align-items:center; gap:6px;
}
.chip.on { background: rgba(122,162,255,0.18); color: var(--text); border-color: rgba(122,162,255,0.45); }
.chip:hover { color: var(--text); }
.tb-spacer { flex: 1; }

.tab-h {
  padding: 8px 16px; font-size: 13px; cursor: pointer; color: var(--text-3);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab-h.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 500; }
.tab-h:hover { color: var(--text-2); }

/* ----------- Card grid ----------- */
.row { display: grid; gap: 14px; }
.row.kpi { grid-template-columns: repeat(6, 1fr); }
.row.r2 { grid-template-columns: 1.4fr 1fr 1fr; margin-top: 14px; }
.row.r3 { grid-template-columns: 1.2fr 1fr 1fr; margin-top: 14px; }
.row.r4 { grid-template-columns: 1.6fr 1fr; margin-top: 14px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px;
  position: relative;
  backdrop-filter: blur(6px);
}
.card .h {
  display:flex; align-items:center; gap: 8px; margin-bottom: 10px;
}
.card .h .t { font-size: 14px; font-weight: 600; }
.card .h .sub { color: var(--text-3); font-size: 11px; margin-left: auto; }
.card .h .more { color: var(--text-3); font-size: 11px; cursor: pointer; }
.card .h .more:hover { color: var(--accent); }
.card .h .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent);
}

/* ----------- KPI ----------- */
.kpi-card {
  padding: 14px 16px; min-height: 96px; position: relative; overflow: hidden;
}
.kpi-card .lab { font-size: 12px; color: var(--text-2); display:flex; align-items:center; gap:6px;}
.kpi-card .v { font-size: 32px; font-weight: 700; margin-top: 8px; font-feature-settings:"tnum"; line-height: 1.0; letter-spacing: -0.01em; }
.kpi-card .u { font-size: 12px; color: var(--text-3); margin-left: 6px; }
.kpi-card .delta { font-size: 11px; margin-top: 8px; display:flex; align-items:center; gap: 4px; color: var(--text-3); }
.kpi-card .delta.up { color: var(--pos); }
.kpi-card .delta.down { color: var(--neg); }
.kpi-card .glow {
  position: absolute; right: -20px; top: -20px; width: 100px; height: 100px; border-radius: 50%;
  background: radial-gradient(circle, rgba(122,162,255,0.45), transparent 70%);
  filter: blur(20px); pointer-events: none;
}
.kpi-card.neg .glow { background: radial-gradient(circle, rgba(245,83,107,0.5), transparent 70%); }
.kpi-card.pos .glow { background: radial-gradient(circle, rgba(34,211,165,0.5), transparent 70%); }
.kpi-card.warn .glow { background: radial-gradient(circle, rgba(245,185,74,0.5), transparent 70%); }

/* ----------- Table ----------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl th { text-align: left; color: var(--text-3); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line); position:sticky; top:0; background: var(--panel-2); z-index: 1; font-size: 11px; letter-spacing: 0.06em; }
.tbl td { padding: 9px 10px; border-bottom: 1px dashed var(--line); color: var(--text); }
.tbl tr:hover td { background: rgba(122,162,255,0.05); cursor: pointer; }
.tbl .ttl { max-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl .tag {
  display:inline-block; padding: 1px 7px; border-radius: 10px; font-size: 10px; line-height: 16px;
  border:1px solid var(--line); color: var(--text-2);
}
.tag.pos { background: rgba(34,211,165,0.12); color: var(--pos); border-color: rgba(34,211,165,0.35); }
.tag.neg { background: rgba(245,83,107,0.12); color: var(--neg); border-color: rgba(245,83,107,0.35); }
.tag.neu { background: rgba(94,140,242,0.12); color: var(--neu); border-color: rgba(94,140,242,0.35); }
.tag.warn { background: rgba(245,185,74,0.12); color: var(--warn); border-color: rgba(245,185,74,0.35); }

/* ----------- Wordcloud ----------- */
.cloud { display:flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; padding: 4px 0; }
.cloud .w { color: var(--text); cursor: default; transition: opacity 0.15s; opacity: 0.85; }
.cloud .w:hover { opacity: 1; text-shadow: 0 0 12px currentColor; }

/* ----------- Bars ----------- */
.bar-row { display:flex; align-items:center; gap: 8px; padding: 5px 0; font-size: 12px; }
.bar-row .lab { width: 70px; color: var(--text-2); flex-shrink:0; }
.bar-row .bar-wrap { flex:1; height: 8px; background: rgba(122,162,255,0.08); border-radius: 6px; overflow: hidden; }
.bar-row .bar { height: 100%; background: linear-gradient(90deg, #5e8cf2, #c084fc); border-radius: 6px; }
.bar-row .num { color: var(--text-2); font-feature-settings:"tnum"; min-width: 36px; text-align: right; }

/* ----------- Compete ----------- */
.cmp-row {
  display:grid; grid-template-columns: 24px 1.3fr 0.8fr 0.8fr 0.8fr 1fr;
  gap: 8px; align-items:center; padding: 8px 6px; border-bottom: 1px dashed var(--line); font-size: 12px;
}
.cmp-row.head { color: var(--text-3); font-size: 11px; letter-spacing: 0.08em; border-bottom: 1px solid var(--line); }
.cmp-row .rk { color: var(--text-3); }
.cmp-row.main { background: linear-gradient(90deg, rgba(122,162,255,0.12), transparent); border-radius: 6px; }
.cmp-row .nm { font-weight: 600; }
.cmp-row .nm.you { color: var(--accent); }
.cmp-row .mini-bar { display:flex; align-items: center; gap: 4px; }
.cmp-row .mini-bar .v { font-feature-settings:"tnum"; min-width: 24px; }
.cmp-row .seg-bar { height: 6px; background: rgba(122,162,255,0.1); border-radius:4px; overflow:hidden; display:flex; min-width: 60px; }
.cmp-row .seg-bar .s { height: 100%; }

/* ----------- Deploy / Action lists ----------- */
.dep-row {
  display:grid; grid-template-columns: 1.2fr 80px 1fr 80px 70px 70px;
  gap: 8px; align-items:center; padding: 9px 6px; border-bottom: 1px dashed var(--line); font-size: 12px;
}
.dep-row.head { color: var(--text-3); font-size: 11px; letter-spacing: 0.08em; }
.progress { height: 6px; background: rgba(122,162,255,0.08); border-radius:4px; overflow:hidden; }
.progress .fill { height:100%; background: linear-gradient(90deg, #22d3a5, #5e8cf2); border-radius:4px; }
.progress.done .fill { background: var(--pos); }

/* ----------- Process flow ----------- */
.flow-cards { display:flex; gap: 8px; padding: 4px 0 8px; }
.flow-cards .fc {
  flex:1; padding: 10px 12px; border:1px solid var(--line); border-radius: 8px; background: var(--panel-2);
  position: relative;
}
.flow-cards .fc .lab { font-size: 11px; color: var(--text-3); letter-spacing: 0.1em; }
.flow-cards .fc .v { font-size: 22px; font-weight: 700; margin-top: 6px; font-feature-settings:"tnum"; }
.flow-cards .fc .u { font-size: 11px; color: var(--text-3); margin-left: 4px; }
.flow-cards .fc::after {
  content: '›'; position: absolute; right: -8px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); font-size: 18px; z-index: 1;
}
.flow-cards .fc:last-child::after { display: none; }
.flow-cards .fc.warn { border-color: rgba(245,185,74,0.35); }
.flow-cards .fc.warn .v { color: var(--warn); }
.flow-cards .fc.neg { border-color: rgba(245,83,107,0.35); }
.flow-cards .fc.neg .v { color: var(--neg); }
.flow-cards .fc.pos { border-color: rgba(34,211,165,0.35); }
.flow-cards .fc.pos .v { color: var(--pos); }

/* ----------- AI drawer ----------- */
.ai-fab {
  position: fixed; right: 24px; bottom: 24px;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--grad-1);
  display:flex; align-items:center; justify-content:center;
  box-shadow: 0 12px 30px rgba(80,120,255,0.5);
  cursor: pointer; z-index: 99;
  border: none; color: white; font-size: 22px;
}
.ai-fab::before {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid rgba(122,162,255,0.4); animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.4); opacity: 0; }
}
.drawer-bg { position: fixed; inset: 0; background: rgba(0,0,0,0.4); backdrop-filter: blur(4px); z-index: 100; }
.drawer {
  position: fixed; right: 0; top: 0; height: 100vh; width: 480px;
  background: linear-gradient(180deg, #0c1432, #070b18);
  border-left: 1px solid var(--line-strong); box-shadow: -20px 0 40px rgba(0,0,0,0.5);
  display: flex; flex-direction: column; z-index: 101;
}
.drawer.wide { width: 720px; }
.drawer .dh { padding: 18px 20px; border-bottom: 1px solid var(--line); display:flex; align-items:center; gap: 12px; }
.drawer .dh .ai-mark {
  width: 36px; height: 36px; border-radius: 10px; background: var(--grad-1);
  display:flex; align-items:center; justify-content:center; font-size: 16px; font-weight: 700;
  box-shadow: 0 0 16px rgba(122,162,255,0.6);
}
.drawer .dh .t { font-size: 16px; font-weight: 600; }
.drawer .dh .s { font-size: 11px; color: var(--text-3); }
.drawer .dh .x { margin-left:auto; cursor: pointer; color: var(--text-2); padding: 4px 8px; border-radius:6px; }
.drawer .dh .x:hover { background: rgba(255,255,255,0.06); color: white; }
.drawer .db { flex:1; overflow: auto; padding: 18px 20px; }
.drawer .df { padding: 14px 20px; border-top: 1px solid var(--line); display:flex; gap:8px; }
.drawer .ip { flex:1; background: var(--panel-2); border:1px solid var(--line); border-radius:8px; padding: 9px 12px; font-size: 13px; color: var(--text); outline: none; font-family: inherit; }
.drawer .ip:focus { border-color: var(--accent); }

.ai-msg { margin-bottom: 16px; }
.ai-msg .who { font-size: 11px; color: var(--text-3); margin-bottom: 4px; }
.ai-msg.user { text-align: right; }
.ai-msg .b {
  display:inline-block; max-width: 90%; padding: 10px 14px; border-radius: 10px;
  font-size: 13px; line-height: 1.7; text-align: left; white-space: pre-wrap;
  background: var(--panel-2); border:1px solid var(--line);
}
.ai-msg.user .b { background: rgba(122,162,255,0.2); border-color: rgba(122,162,255,0.4); }
.ai-msg.thinking .b::after {
  content: ''; display:inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); margin-left:6px; animation: blink 1s infinite;
}
@keyframes blink { 0%,100% {opacity:1;} 50%{opacity:0.3;} }
.ai-quick { display:flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.ai-quick .q {
  font-size: 11px; padding: 4px 10px; border-radius: 14px; border:1px solid var(--line);
  background: var(--panel-2); color: var(--text-2); cursor: pointer;
}
.ai-quick .q:hover { color: var(--text); border-color: var(--accent); }

/* Detail drawer (case) */
.case-section { margin-bottom: 18px; }
.case-section h4 { margin: 0 0 8px; font-size: 12px; color: var(--text-3); letter-spacing: 0.1em; font-weight: 500; }
.case-meta { display:grid; grid-template-columns: repeat(2, 1fr); gap: 6px 18px; font-size: 12px; }
.case-meta .k { color: var(--text-3); margin-right: 8px; }
.case-summary {
  font-size: 13px; line-height: 1.7; padding: 12px 14px; background: var(--panel-2); border-radius: 8px; border:1px solid var(--line);
}
.action-grid { display:grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.action-grid .ax {
  padding: 10px 12px; border:1px solid var(--line); border-radius: 8px; cursor: pointer;
  background: var(--panel-2); display:flex; align-items:center; gap: 10px;
}
.action-grid .ax:hover { border-color: var(--accent); background: rgba(122,162,255,0.1); }
.action-grid .ax .ico {
  width: 32px; height: 32px; border-radius:8px; background: rgba(122,162,255,0.18); display:flex; align-items:center; justify-content:center; font-size: 14px;
}
.action-grid .ax .lab { font-size: 13px; font-weight:500; }
.action-grid .ax .desc { font-size: 11px; color: var(--text-3); }

/* timeline */
.tl { padding-left: 14px; border-left: 1px dashed var(--line-strong); margin-left: 4px; }
.tl .e { position: relative; padding: 0 0 14px 14px; font-size: 12px; }
.tl .e::before { content:''; position:absolute; left: -19px; top: 4px; width: 8px; height: 8px; border-radius:50%; background: var(--accent); box-shadow: 0 0 6px var(--accent);}
.tl .e .when { color: var(--text-3); font-size: 11px; }
.tl .e .what { color: var(--text); margin-top: 2px; }
.tl .e .who { color: var(--text-2); font-size: 11px; margin-top: 2px; }
.tl .e.done::before { background: var(--pos); box-shadow: 0 0 6px var(--pos); }
.tl .e.warn::before { background: var(--warn); box-shadow: 0 0 6px var(--warn); }

/* misc */
.scroll-y { overflow-y: auto; }
.muted { color: var(--text-3); }
.row-flex { display:flex; align-items:center; gap: 10px; }
.dotsep { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); }
.spark-svg { display: block; }
.heat-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.heat-grid .cell { height: 22px; border-radius: 4px; background: rgba(122,162,255,0.08); position: relative; cursor: default; }
.heat-grid .cell .v { position: absolute; inset: 0; display:flex; align-items:center; justify-content:center; font-size: 10px; color: rgba(255,255,255,0.85); font-feature-settings:"tnum";}

/* Region list */
.reg-list .r { display:flex; align-items:center; gap: 8px; font-size: 12px; padding: 5px 0; }
.reg-list .r .n { color: var(--text-3); width: 18px; }
.reg-list .r .c { width: 70px; }
.reg-list .r .b { flex:1; height:6px; background: rgba(122,162,255,0.08); border-radius:4px; overflow:hidden; }
.reg-list .r .b .f { height:100%; background: linear-gradient(90deg, #5e8cf2, #c084fc); }
.reg-list .r .v { color: var(--text-2); font-feature-settings:"tnum"; min-width: 36px; text-align:right; }

/* Login */
.login-bg {
  position: fixed; inset: 0;
  background:
    radial-gradient(800px 400px at 30% 20%, rgba(80,120,255,0.25), transparent 60%),
    radial-gradient(700px 400px at 80% 80%, rgba(192,132,252,0.18), transparent 60%),
    var(--bg);
  display:flex; align-items:center; justify-content:center; z-index: 200;
}
.login-card {
  width: 380px; padding: 32px; background: var(--panel); border:1px solid var(--line-strong);
  border-radius: 14px; backdrop-filter: blur(10px); box-shadow: var(--shadow);
}
.login-card .logo { display:flex; align-items:center; gap: 12px; margin-bottom: 20px; }
.login-card .logo .mk { width: 44px; height: 44px; border-radius: 10px; background: var(--grad-1); display:flex; align-items:center; justify-content:center; font-weight: 700; font-size: 18px; color: white; }
.login-card .logo .nm { font-size: 18px; font-weight: 600; }
.login-card .logo .sub { font-size: 11px; color: var(--text-3); letter-spacing: 0.18em; }
.login-card label { display:block; font-size: 11px; color: var(--text-3); margin: 12px 0 6px; letter-spacing: 0.1em; }
.login-card input { width: 100%; padding: 11px 14px; border:1px solid var(--line); border-radius: 8px; background: var(--panel-2); color: var(--text); outline: none; font-size: 14px; font-family: inherit; }
.login-card input:focus { border-color: var(--accent); }
.login-card .go {
  width: 100%; margin-top: 18px; padding: 12px; border-radius: 8px; border: none; background: var(--grad-1);
  color: white; font-size: 14px; font-weight: 500; cursor: pointer;
}
.login-card .go:hover { filter: brightness(1.1); }
.login-card .hint { margin-top: 16px; font-size: 11px; color: var(--text-3); text-align: center; line-height: 1.6; }
