:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --line: #e5e8ee;
  --text: #1b2430;
  --muted: #6b7684;
  --green: #16a34a;
  --green-soft: #e8f7ee;
  --red: #dc2626;
  --red-soft: #fdecec;
  --amber: #d97706;
  --accent: #e5533d;
  --shadow: 0 1px 2px rgba(20, 30, 50, .04), 0 8px 24px rgba(20, 30, 50, .06);
  --radius: 14px;
}

* { box-sizing: border-box; }

/* 关键: 作者样式的 display 会盖掉 hidden 属性自带的 display:none */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
               "PingFang SC", "Hiragino Sans GB", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------------- header ---------------- */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 28px 18px;
  max-width: 1180px;
  margin: 0 auto;
}

.brand { display: flex; align-items: center; gap: 14px; }

.logo {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  font-size: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

h1 { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: .2px; }

.sub { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

.chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
  box-shadow: var(--shadow);
}

/* ---------------- layout ---------------- */
.wrap {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px 12px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.panel h2 {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .6px;
  text-transform: uppercase;
}

/* ---------------- dropzone ---------------- */
.dropzone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 268px;
  padding: 18px;
  border: 1.5px dashed #cfd6e0;
  border-radius: 12px;
  background: #fbfcfe;
  cursor: pointer;
  transition: border-color .18s, background .18s, transform .18s;
  outline: none;
  overflow: hidden;
}

.dropzone:hover, .dropzone:focus-visible {
  border-color: var(--accent);
  background: #fff9f8;
}

.dropzone.drag {
  border-color: var(--accent);
  background: #fff3f1;
  transform: scale(.995);
}

.dz-empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
  color: var(--muted);
  pointer-events: none;
}

.dz-empty strong { color: var(--text); font-weight: 600; font-size: 15px; }
.dz-empty span { font-size: 12.5px; max-width: 320px; }
.dz-icon { font-size: 34px; line-height: 1; margin-bottom: 4px; }

#preview {
  max-width: 100%;
  max-height: 340px;
  border-radius: 10px;
  display: block;
}

/* ---------------- buttons ---------------- */
.actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 550;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .08s, box-shadow .15s;
}

.btn:hover { border-color: #c8d0da; background: #fafbfd; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(229, 83, 61, .25);
}

.btn.primary:hover { background: #d84a35; border-color: #d84a35; }
.btn.ghost { color: var(--muted); }
.btn.ghost:hover { color: var(--text); }

.hint { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); }

/* ---------------- empty state ---------------- */
.empty {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 54px 10px;
  color: var(--muted);
  text-align: center;
}

.empty-icon { font-size: 32px; opacity: .55; }
.empty p { margin: 6px 0 0; color: var(--text); font-weight: 550; }
.empty span { font-size: 12.5px; }

/* ---------------- verdict ---------------- */
.verdict {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--green-soft);
  border: 1px solid #cdebd8;
}

.verdict.bad {
  background: var(--red-soft);
  border-color: #f6cfcf;
}

.v-main { display: flex; align-items: center; gap: 12px; min-width: 0; }

.v-badge {
  font-size: 22px;
  font-weight: 700;
  color: var(--green);
  white-space: nowrap;
}

.verdict.bad .v-badge { color: var(--red); }

.v-class {
  font-size: 15px;
  font-weight: 600;
  color: #10261a;
  padding: 3px 10px;
  background: rgba(255, 255, 255, .7);
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, .05);
  overflow: hidden;
  text-overflow: ellipsis;
}

.v-conf { text-align: right; flex: 0 0 auto; }
.v-num {
  display: block;
  font-size: 26px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.v-label { font-size: 11.5px; color: var(--muted); }

.desc { margin: 12px 0 0; font-size: 13.5px; color: #41505f; }

/* ---------------- bars ---------------- */
.bars { margin-top: 16px; display: grid; gap: 9px; }

.bar-row { display: grid; grid-template-columns: 42px 1fr 46px; align-items: center; gap: 10px; }

.bar-name { font-size: 12.5px; color: var(--muted); }

.bar {
  height: 9px;
  background: #eef1f5;
  border-radius: 999px;
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  background: var(--green);
  border-radius: 999px;
  transition: width .5s cubic-bezier(.22, .61, .36, 1);
}

.bar i.red { background: var(--red); }

.bar-val {
  font-size: 12.5px;
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---------------- top3 ---------------- */
.sec {
  margin: 20px 0 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .4px;
}

.top3 { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }

.top3 li {
  display: grid;
  grid-template-columns: 20px 1fr 1fr 48px;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 6px 8px;
  border-radius: 8px;
}

.top3 li:first-child { background: #f7f9fc; font-weight: 600; }
.top3 .rank { color: var(--muted); font-size: 12px; }
.top3 .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top3 .mini { height: 7px; background: #eef1f5; border-radius: 999px; overflow: hidden; }
.top3 .mini i { display: block; height: 100%; background: #9bb4d0; border-radius: 999px; }
.top3 .pct { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------------- notes / truth ---------------- */
.notes { margin-top: 14px; display: grid; gap: 6px; }

.notes div {
  font-size: 12.5px;
  color: #7a4b12;
  background: #fff8ed;
  border: 1px solid #f6e2c0;
  border-radius: 9px;
  padding: 8px 10px;
}

.truth {
  margin-top: 14px;
  font-size: 12.5px;
  color: #2c4a63;
  background: #f1f7fc;
  border: 1px solid #d6e6f3;
  border-radius: 9px;
  padding: 9px 11px;
}

.truth b { font-weight: 650; }
.truth .ok { color: var(--green); font-weight: 650; }
.truth .no { color: var(--red); font-weight: 650; }

.footnote {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11.5px;
  color: var(--muted);
  flex-wrap: wrap;
}

/* ---------------- footer ---------------- */
.bottom {
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 28px 32px;
  font-size: 12px;
  color: var(--muted);
}

/* ---------------- loading ---------------- */
.busy .dz-empty, .busy #preview { opacity: .5; }

.dropzone::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, .55);
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}

.dropzone.busy::after { opacity: 1; }

.spinner {
  position: absolute;
  width: 26px; height: 26px;
  border: 3px solid #e3e8ef;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  z-index: 2;
  display: none;
}

.dropzone.busy .spinner { display: block; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- responsive ---------------- */
@media (max-width: 880px) {
  .wrap { grid-template-columns: 1fr; padding: 0 16px 12px; }
  .top { padding: 16px; flex-wrap: wrap; }
  .bottom { padding: 10px 16px 28px; }
  .chip { order: 3; }
  .verdict { flex-direction: column; align-items: flex-start; }
  .v-conf { text-align: left; }
}
