/* =============================================================
   AIGC 检测平台 · Console UI（深色控制台 + 左侧导航）
   动画只使用 transform / opacity（合成层），保证流畅
   ============================================================= */
:root {
  --bg: #0e100f;
  --panel: #141715;
  --surface: #191d1b;
  --surface-2: #212522;
  --ink: #f2f2ef;
  --ink-2: #c3c2b7;
  --muted: #8a8983;
  --line: rgba(255, 255, 255, .07);
  --line-strong: rgba(255, 255, 255, .14);
  --accent: #3987e5;
  --accent-hi: #5f9fec;
  --accent-soft: rgba(57, 135, 229, .13);
  --ai: #e66767;
  --ai-soft: rgba(230, 103, 103, .13);
  --real: #0ca30c;
  --real-hi: #3dbb3d;
  --real-soft: rgba(12, 163, 12, .13);
  --paper: #fcfcfb;           /* 图表纸面画布 */
  --radius: 16px;
  --radius-s: 10px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; color-scheme: dark; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--ink);
  font-size: 14px; line-height: 1.6;
}
button { font: inherit; cursor: pointer; color: inherit; }
img { display: block; max-width: 100%; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 9px; }
::-webkit-scrollbar-track { background: transparent; }

/* =================== 左侧导航栏 =================== */
.side {
  position: fixed; inset: 0 auto 0 0; width: 224px; z-index: 40;
  background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 22px 14px 18px;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 2px 10px 22px; }
.side-brand .dot {
  width: 11px; height: 11px; border-radius: 4px; background: var(--accent);
  box-shadow: 0 0 14px rgba(57, 135, 229, .8);
}
.side-brand b { font-size: 16px; letter-spacing: .01em; }
.side-brand span { font-size: 11px; color: var(--muted); display: block; margin-top: -3px; }

.nav { position: relative; display: flex; flex-direction: column; gap: 2px; }
.nav-pill {
  position: absolute; left: 0; right: 0; height: 40px; border-radius: var(--radius-s);
  background: var(--accent-soft); border: 1px solid rgba(57, 135, 229, .25);
  transform: translateY(0); transition: transform .3s var(--ease);
  will-change: transform; pointer-events: none;
}
.nav button {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 11px;
  height: 40px; padding: 0 12px; border: none; background: none;
  border-radius: var(--radius-s); color: var(--muted); font-size: 13.5px; font-weight: 500;
  transition: color .18s var(--ease);
}
.nav button svg { width: 17px; height: 17px; flex: none; }
.nav button:hover { color: var(--ink); }
.nav button.on { color: var(--accent-hi); font-weight: 600; }

.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 14px 10px 0; }
.side-foot .row { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.side-foot .row + .row { margin-top: 6px; }
.side-foot .ok-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--real-hi); flex: none;
  box-shadow: 0 0 8px rgba(61, 187, 61, .7);
}
.side-foot b { color: var(--ink-2); font-weight: 600; }

/* =================== 内容区 =================== */
.main { margin-left: 224px; padding: 34px 42px 70px; max-width: 1280px; }
.view { display: none; }
.view.on { display: block; animation: viewIn .4s var(--ease) both; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(10px) scale(.996); }
  to   { opacity: 1; transform: none; }
}
.vhead { display: flex; align-items: baseline; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.vhead h1 { font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.vhead p { color: var(--muted); font-size: 13px; max-width: 760px; }

/* =================== 面板 =================== */
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px;
}
.panel + .panel { margin-top: 16px; }
.panel h3 {
  font-size: 11.5px; font-weight: 650; color: var(--muted);
  text-transform: uppercase; letter-spacing: .1em; margin-bottom: 13px;
}
.cols { display: grid; grid-template-columns: 380px 1fr; gap: 16px; align-items: start; }
.cols-single { display: grid; grid-template-columns: 1.2fr .9fr; gap: 16px; align-items: start; }
@media (max-width: 980px) {
  .side { position: static; width: auto; flex-direction: row; align-items: center; padding: 12px 16px; }
  .side .nav { flex-direction: row; overflow-x: auto; }
  .nav-pill { display: none; }
  .side-foot { display: none; }
  .main { margin: 0; padding: 20px; }
  .cols, .cols-single { grid-template-columns: 1fr; }
}

/* =================== 计分瓦片 =================== */
.stat-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 16px; }
@media (max-width: 1100px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }
.stat {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px 13px;
}
.stat .s-label { font-size: 11.5px; color: var(--muted); letter-spacing: .04em; }
.stat .s-val { font-size: 27px; font-weight: 700; letter-spacing: -.01em; margin-top: 3px; line-height: 1.15; }
.stat .s-val small { font-size: 13px; color: var(--muted); font-weight: 500; margin-left: 2px; }
.stat .s-sub { font-size: 11px; color: var(--muted); margin-top: 3px; }
.stat.hero { border-color: rgba(57, 135, 229, .35); background: linear-gradient(160deg, rgba(57,135,229,.10), transparent 55%), var(--surface); }
.stat.hero .s-val { color: var(--accent-hi); font-size: 30px; }
.stat .s-track {
  position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--surface-2);
}
.stat .s-fill {
  height: 100%; background: var(--accent);
  transform: scaleX(0); transform-origin: left; will-change: transform;
}
.stat.run .s-label::after {
  content: "●"; color: var(--accent-hi); font-size: 8px; margin-left: 7px;
  vertical-align: 1px; animation: blink 1.1s infinite;
}
@keyframes blink { 50% { opacity: .15; } }
.stat.over .s-val { color: var(--ai); }
.stat.over .s-fill { background: var(--ai); }
.flash { animation: statFlash .45s var(--ease); }
@keyframes statFlash { from { opacity: .25; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* =================== 按钮 =================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--radius-s); padding: 10px 18px; font-weight: 600; font-size: 13.5px;
  border: 1px solid transparent;
  transition: transform .15s var(--ease), box-shadow .2s var(--ease),
              background .2s var(--ease), border-color .2s var(--ease), opacity .2s;
  will-change: transform;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hi); transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(57, 135, 229, .35); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-hi); transform: translateY(-1px); }
.btn-row { display: flex; gap: 10px; margin-top: 14px; }
.btn-row .btn { flex: 1; }
.spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff;
  animation: spin .7s linear infinite; display: none;
}
.btn.loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* =================== 上传区 =================== */
.drop {
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius-s);
  background: var(--surface-2); text-align: center; padding: 30px 16px;
  color: var(--muted); font-size: 13px; cursor: pointer; overflow: hidden;
  transition: border-color .2s var(--ease), background .2s var(--ease), color .2s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-hi); }
.drop .drop-ico { font-size: 24px; line-height: 1; margin-bottom: 7px; opacity: .8; }
.drop input { display: none; }
.drop.has-img { padding: 0; border-style: solid; background: #000; }
.drop.has-img .drop-tip { display: none; }
.drop img.preview { width: 100%; max-height: 460px; object-fit: contain; margin: 0 auto; }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 10px; }

/* =================== 缩略图队列 =================== */
.thumbs {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 8px;
  max-height: 168px; overflow-y: auto; overscroll-behavior: contain; margin-top: 10px;
}
.thumbs:empty { display: none; }
.thumbs .th {
  position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--line); animation: pop .3s var(--ease) both;
}
@keyframes pop { from { opacity: 0; transform: scale(.88); } to { opacity: 1; transform: none; } }
.thumbs .th img { width: 100%; height: 100%; object-fit: cover; }
.thumbs .th i {
  position: absolute; left: 4px; bottom: 4px; font-style: normal;
  background: rgba(0, 0, 0, .65); color: #fff; border-radius: 5px;
  font-size: 10px; padding: 0 5px; line-height: 15px;
}

/* =================== 画廊 =================== */
.gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px;
  max-height: 350px; overflow-y: auto; overscroll-behavior: contain;
}
.gallery:empty::after {
  content: "完成检测后，带预测横幅的实测图将显示在这里。";
  color: var(--muted); font-size: 12.5px; grid-column: 1 / -1; text-align: center; padding: 28px 0;
}
.gallery figure { animation: pop .35s var(--ease) both; }
.gallery img {
  width: 100%; aspect-ratio: 1; object-fit: contain; background: #000;
  border: 1px solid var(--line); border-radius: 8px;
}
.gallery figcaption { font-size: 11px; color: var(--ink-2); margin-top: 4px; text-align: center; }

/* =================== 表格 =================== */
.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tbl th {
  text-align: left; font-size: 11px; color: var(--muted); font-weight: 650;
  text-transform: uppercase; letter-spacing: .07em;
  padding: 9px 10px; border-bottom: 1px solid var(--line-strong);
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.tbl td:first-child { color: var(--ink); }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl .num { text-align: right; }
.tbl-scroll { max-height: 420px; overflow: auto; overscroll-behavior: contain; }
.tbl .empty { color: var(--muted); text-align: center; padding: 26px 0 !important; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 1px 11px; font-size: 12px; font-weight: 650;
}
.pill.ai { background: var(--ai-soft); color: var(--ai); }
.pill.real { background: var(--real-soft); color: var(--real-hi); }
.pill.err { background: var(--surface-2); color: var(--muted); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* =================== 评审 =================== */
.judge-name { border-bottom: 1px dotted var(--line-strong); cursor: zoom-in; }
.judge-name:hover { color: var(--accent-hi); border-color: var(--accent); }
.jbtns { display: inline-flex; gap: 6px; }
.jbtn {
  border-radius: 7px; padding: 3px 12px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--line-strong); background: transparent; color: var(--muted);
  transition: all .16s var(--ease);
}
.jbtn.ok:hover, .jbtn.ok.on { background: var(--real-soft); border-color: var(--real-hi); color: var(--real-hi); }
.jbtn.no:hover, .jbtn.no.on { background: var(--ai-soft); border-color: var(--ai); color: var(--ai); }
.jbtn.on { box-shadow: inset 0 0 0 1px currentColor; }

#hoverPreview {
  position: fixed; display: none; z-index: 999; pointer-events: none;
  background: #fff; padding: 6px; border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
}
#hoverPreview img { width: 280px; max-height: 70vh; object-fit: contain; border-radius: 7px; }

/* =================== 单图检测 =================== */
.result-empty { color: var(--muted); text-align: center; padding: 46px 0; font-size: 13px; }
.verdict-col { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 8px 0 4px; }
.gauge { position: relative; width: 158px; height: 158px; }
.gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge .track { fill: none; stroke: var(--surface-2); stroke-width: 8; }
.gauge .arc {
  fill: none; stroke-width: 8; stroke-linecap: round;
  transition: stroke-dashoffset .9s var(--ease), stroke .3s;
}
.gauge-txt { position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; }
.gauge-txt b { font-size: 34px; font-weight: 700; letter-spacing: -.02em; }
.gauge-txt span { font-size: 11px; color: var(--muted); }
.verdict-col .pill { margin-top: 14px; font-size: 14px; padding: 4px 16px; }
.verdict-col .lvl { color: var(--ink-2); font-size: 13px; margin-top: 8px; }
.verdict-col .meta { color: var(--muted); font-size: 12px; margin-top: 6px; line-height: 1.8; }
.members { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 14px; }
.member { display: grid; grid-template-columns: 92px 1fr 52px; gap: 10px; align-items: center; margin-top: 9px; }
.member .m-name { font-size: 12px; color: var(--ink-2); }
.member .m-track { height: 7px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.member .m-fill {
  height: 100%; background: var(--accent); border-radius: 99px;
  transform: scaleX(0); transform-origin: left; transition: transform .8s var(--ease);
  will-change: transform;
}
.member .m-val { font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.examples { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.examples img {
  width: 82px; height: 82px; object-fit: cover; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--line);
  transition: transform .18s var(--ease), border-color .2s;
}
.examples img:hover { transform: translateY(-3px) scale(1.04); border-color: var(--accent); }

/* =================== 性能基准 =================== */
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg + h3 { margin-top: 18px; }
.seg button {
  border: 1px solid var(--line-strong); background: transparent; color: var(--ink-2);
  border-radius: 999px; padding: 5px 14px; font-size: 12.5px; font-weight: 500;
  transition: all .16s var(--ease);
}
.seg button:hover { border-color: var(--accent); color: var(--accent-hi); transform: translateY(-1px); }
.seg button.on {
  background: var(--accent-soft); border-color: var(--accent);
  color: var(--accent-hi); font-weight: 650;
}
.seg button .sw { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; }
/* 图表纸面画布：浅色底，沿用已验证的浅色分类色板 */
.paper {
  background: var(--paper); border-radius: 12px; padding: 14px 14px 8px; margin-top: 12px;
}
.paper .chart-scroll { overflow-x: auto; overscroll-behavior-x: contain; }
.paper .legend {
  display: flex; flex-wrap: wrap; gap: 14px; padding: 6px 4px 8px;
  font-size: 12px; color: #52514e;
}
#chartTip {
  position: fixed; display: none; z-index: 998; pointer-events: none;
  background: #0b0b0b; color: #fff; border-radius: 8px; padding: 7px 11px;
  font-size: 12px; line-height: 1.5; box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
}
#chartTip b { font-variant-numeric: tabular-nums; }

/* =================== 提示条 =================== */
#toast {
  position: fixed; left: 50%; bottom: 32px; z-index: 1000;
  transform: translate(-50%, 80px); opacity: 0;
  background: #f2f2ef; color: #0b0b0b; border-radius: 10px;
  padding: 10px 20px; font-size: 13px; font-weight: 500; pointer-events: none;
  transition: transform .3s var(--ease), opacity .3s var(--ease);
  max-width: 80vw; box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
}
#toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
