/* 姜温智判 · 视觉增强层 */
:root {
  --r: 16px;
  --shadow-lg: 0 18px 50px rgba(74, 42, 14, .12), 0 4px 14px rgba(74, 42, 14, .06);
  --shadow-sm: 0 6px 18px rgba(74, 42, 14, .07);
  --gold: #c9a227;
}
body {
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(201, 162, 39, .10), transparent 60%),
    radial-gradient(900px 420px at 0% 0%, rgba(47, 125, 50, .07), transparent 55%),
    var(--bg);
}
.topbar { background: linear-gradient(100deg, #4a2107 0%, #7a3b12 55%, #8f4a1b 100%); }
.brand-mark { background: linear-gradient(140deg, rgba(255,255,255,.22), rgba(255,255,255,.08)); }
.nav a.active {
  background: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,.12));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.25), 0 4px 14px rgba(0,0,0,.18);
}
.nav a { transition: .18s ease; }
.nav a:hover { transform: translateY(-1px); }

.wrap { padding-top: 28px; }
.page-head h1 { font-size: 26px; letter-spacing: 1px; position: relative; display: inline-block; }
.page-head h1::after {
  content: ""; position: absolute; left: 0; right: -6px; bottom: -6px; height: 4px;
  border-radius: 3px; background: linear-gradient(90deg, var(--brown-2), rgba(201,162,39,.15));
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; letter-spacing: 2px; font-weight: 700; color: var(--brown-2);
  background: linear-gradient(90deg, rgba(122,59,18,.10), rgba(201,162,39,.10));
  border: 1px solid rgba(122,59,18,.15); border-radius: 999px; padding: 5px 12px;
}
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }

.card { border-radius: var(--r); box-shadow: var(--shadow-sm); transition: transform .22s ease, box-shadow .22s ease; }
.card:hover { box-shadow: var(--shadow-lg); }
.stat { border-radius: var(--r); box-shadow: var(--shadow-sm); transition: .22s ease; }
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--green), rgba(201,162,39,.6), transparent);
  opacity: .8;
}
.stat-ico { box-shadow: inset 0 0 0 1px rgba(47,125,50,.10); }
.btn { border-radius: 9px; letter-spacing: .5px; }
.btn-primary { background: linear-gradient(135deg, #8a4417, #6d3210); box-shadow: 0 6px 16px rgba(122,59,18,.22); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(122,59,18,.26); }
.btn-green { background: linear-gradient(135deg, #36963a, #256b28); box-shadow: 0 6px 16px rgba(47,125,50,.20); }
.btn-green:hover { transform: translateY(-1px); }
.card-hd h3::before { background: linear-gradient(180deg, var(--brown-2), var(--gold)); }
.tbl tr { transition: background .15s; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.card, .stat, .detect-hero, .tips-card { animation: fadeUp .5s ease both; }
.stat:nth-child(2) { animation-delay: .06s; }
.stat:nth-child(3) { animation-delay: .12s; }

/* 首页横幅 */
.home-hero {
  position: relative; overflow: hidden; border-radius: 22px; margin-bottom: 22px;
  padding: 34px 38px; color: #fff;
  background: linear-gradient(110deg, #3f1c06 0%, #6d3210 48%, #8a4417 100%);
  box-shadow: var(--shadow-lg);
}
.home-hero::after {
  content: ""; position: absolute; right: -80px; top: -120px; width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(201,162,39,.28), transparent 62%);
}
.home-hero h1 { margin: 10px 0 8px; font-size: 32px; letter-spacing: 2px; }
.home-hero p { margin: 0; color: rgba(255,255,255,.78); max-width: 640px; }
.home-hero .actions { display: flex; gap: 12px; margin-top: 20px; }
.home-hero .btn-ghost { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.28); color: #fff; }
.home-hero .btn-ghost:hover { background: rgba(255,255,255,.16); }
.home-hero .hero-tag { color: #f2d9a6; border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.10); }
.home-hero .hero-tag::before { background: #f2d9a6; }

/* 检测页 */
.detect-hero {
  display: grid; grid-template-columns: 1.08fr .92fr; gap: 26px; align-items: stretch; margin-bottom: 22px;
}
.hero-copy {
  padding: 34px 36px; border-radius: 22px; color: #fff;
  background: linear-gradient(115deg, #331705, #6d3210 55%, #8a4417);
  box-shadow: var(--shadow-lg); position: relative; overflow: hidden;
}
.hero-copy::after {
  content: ""; position: absolute; left: -60px; bottom: -110px; width: 300px; height: 300px;
  border-radius: 50%; background: radial-gradient(circle, rgba(47,125,50,.35), transparent 65%);
}
.hero-copy h1 { font-size: 34px; margin: 14px 0 10px; letter-spacing: 2px; }
.hero-copy p { color: rgba(255,255,255,.82); margin: 0 0 18px; max-width: 520px; line-height: 1.9; }
.hero-points { display: flex; gap: 18px; flex-wrap: wrap; }
.hero-points span { font-size: 12.5px; color: rgba(255,255,255,.72); display: flex; align-items: center; gap: 7px; }
.hero-points i {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.12); color: #f2d9a6; font-style: normal; font-size: 12px;
}
.upload-card { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.dropzone {
  position: relative; border: 1.5px dashed #d9c7ae; border-radius: 14px; background: #fdfaf4;
  min-height: 150px; display: grid; place-items: center; text-align: center; cursor: pointer;
  transition: .2s; overflow: hidden;
}
.dropzone:hover, .dropzone.drag { border-color: var(--brown-2); background: #fbf4e8; }
.dropzone .dz-ico {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 10px;
  background: linear-gradient(140deg, #f6e6cf, #efd7b6); color: var(--brown);
}
.dropzone b { display: block; font-size: 14px; color: #4a3423; }
.dropzone span { font-size: 12px; color: var(--muted); }
.preview-wrap { position: relative; border-radius: 14px; overflow: hidden; background: #1b1a16; }
.preview-wrap canvas { width: 100%; display: block; }
.preview-wrap .scan-overlay {
  position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .2s;
  background: linear-gradient(180deg, transparent 0%, rgba(76,197,110,.10) 48%, transparent 52%);
}
.preview-wrap.scanning .scan-overlay { opacity: 1; animation: scanMove 1.2s linear infinite; }
@keyframes scanMove {
  0% { background-position: 0 -100%; }
  100% { background-position: 0 100%; }
}
.preview-wrap.scanning .scan-overlay { background-size: 100% 220%; }
.btn-reset {
  position: absolute; right: 8px; top: 8px; width: 28px; height: 28px; border-radius: 50%;
  border: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 16px; line-height: 1;
}
.sample-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sample-row > span { font-size: 12px; color: var(--muted); }
.sample-row button {
  border: 1px solid #e6dccd; background: #fff; border-radius: 9px; padding: 4px; width: 54px;
  transition: .18s; overflow: hidden;
}
.sample-row button:hover { border-color: var(--brown-2); transform: translateY(-2px); }
.sample-row img { width: 100%; height: 38px; object-fit: cover; border-radius: 5px; display: block; }
.sample-row em { display: block; font-size: 10px; font-style: normal; color: var(--muted); margin-top: 3px; }
.btn-block { width: 100%; justify-content: center; padding: 12px; font-size: 14.5px; }
.btn-block:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.tiny { font-size: 11.5px; color: #a2958a; margin: 0; line-height: 1.6; }

.detect-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 18px; }
.result-card { min-height: 420px; }
.result-empty { display: grid; place-items: center; text-align: center; padding: 70px 20px; color: var(--muted); }
.result-empty .big { font-size: 42px; margin-bottom: 12px; opacity: .5; }
.result-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.result-head h2 { margin: 0; font-size: 26px; letter-spacing: 1px; }
.level-pill { border-radius: 999px; padding: 3px 11px; font-size: 12px; font-weight: 700; }
.level-red { background: #fbe9e7; color: #b03a2e; }
.level-amber { background: #fdf3df; color: #a86b12; }
.level-green { background: #e8f4e9; color: #2f7d32; }
.level-gray { background: #f0eeea; color: #7c7368; }
.result-body { display: grid; grid-template-columns: 128px 1fr; gap: 18px; align-items: center; margin: 14px 0 6px; }
.ring { position: relative; width: 128px; height: 128px; }
.ring svg { transform: rotate(-90deg); }
.ring .ring-txt { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .ring-txt b { font-size: 26px; color: var(--brown); line-height: 1; }
.ring .ring-txt span { font-size: 11px; color: var(--muted); }
.metrics { display: grid; gap: 9px; }
.metric-label { display: flex; justify-content: space-between; font-size: 12px; color: #6f6357; margin-bottom: 3px; }
.metric-bar { height: 7px; border-radius: 5px; background: #f1ece4; overflow: hidden; }
.metric-bar i { display: block; height: 100%; border-radius: 5px; transition: width .6s ease; }
.bar-green { background: linear-gradient(90deg, #5aa860, #2f7d32); }
.bar-yellow { background: linear-gradient(90deg, #e8c25a, #c99a1f); }
.bar-brown { background: linear-gradient(90deg, #b06a3a, #7c3d12); }
.bar-dark { background: linear-gradient(90deg, #7a7a7a, #3d3d3d); }
.advice { margin-top: 16px; padding: 14px 16px; border-radius: 12px; background: #fbf7ef; border-left: 3px solid #c9a06a; }
.advice h4 { margin: 0 0 8px; font-size: 13.5px; color: var(--brown); }
.advice ol { margin: 0; padding-left: 20px; color: #5c5147; }
.advice li { margin-bottom: 6px; font-size: 13px; }
.result-note { margin-top: 12px; font-size: 11.5px; color: #a2958a; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

.history-card .card-bd { padding-top: 8px; }
.hist { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed #f0e9df; font-size: 12.5px; }
.hist:last-child { border-bottom: 0; }
.hist .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.hist b { font-weight: 600; color: #403428; }
.hist time { margin-left: auto; color: #b3aa9f; font-size: 11.5px; white-space: nowrap; }
.hist-empty { color: var(--muted); font-size: 12.5px; padding: 16px 0; }

.tips-card { margin-top: 18px; }
.tips-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.tip { display: flex; gap: 10px; }
.tip i {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none;
  background: #f3f8f3; color: var(--green); font-style: normal; font-weight: 700;
}
.tip b { display: block; font-size: 13px; margin-bottom: 2px; }
.tip span { font-size: 12px; color: var(--muted); line-height: 1.7; }

@media (max-width: 1100px) {
  .detect-hero, .detect-grid { grid-template-columns: 1fr; }
  .tips-row { grid-template-columns: 1fr; }
}


/* ---------------- 检测页 v2 布局 ---------------- */
.detect-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 26px;
  padding: 24px 32px; border-radius: 20px; margin-bottom: 18px; color: #fff;
  background: linear-gradient(112deg, #3b1a06 0%, #6d3210 52%, #8a4417 100%);
  box-shadow: var(--shadow-lg); position: relative; overflow: hidden;
}
.detect-banner::after {
  content: ""; position: absolute; right: 120px; top: -90px; width: 260px; height: 260px;
  border-radius: 50%; background: radial-gradient(circle, rgba(201,162,39,.25), transparent 65%);
}
.banner-copy { position: relative; z-index: 1; }
.banner-copy h1 { margin: 8px 0 6px; font-size: 27px; letter-spacing: 2px; }
.banner-copy p { margin: 0; color: rgba(255,255,255,.8); font-size: 13.5px; }
.banner-points { display: flex; gap: 26px; position: relative; z-index: 1; }
.banner-points div { text-align: center; }
.banner-points b { display: block; font-size: 23px; color: #f2d9a6; letter-spacing: 1px; }
.banner-points span { font-size: 11.5px; color: rgba(255,255,255,.65); }

.detect-main { display: grid; grid-template-columns: .92fr 1.08fr; gap: 18px; align-items: stretch; }
.detect-bottom { display: grid; grid-template-columns: .92fr 1.08fr; gap: 18px; margin-top: 18px; }
.detect-main .upload-card .card-bd, .detect-main .result-card .card-bd { padding: 18px 20px; }
.detect-main .dropzone { min-height: 128px; }
.detect-main .preview-wrap { padding: 8px 0; }
.preview-wrap canvas {
  max-height: 320px; max-width: 100%; width: auto; height: auto;
  margin: 0 auto; display: block; border-radius: 10px;
}
.dropzone[hidden] { display: none; }
.sample-row button { width: 58px; }
.sample-row img { height: 34px; }
.result-card .card-bd { min-height: 360px; }
.result-empty { padding: 90px 20px; }
.detect-bottom .tips-row { grid-template-columns: 1fr; gap: 13px; }
.history-card .card-bd { padding-top: 6px; padding-bottom: 8px; }

@media (max-width: 1100px) {
  .detect-main, .detect-bottom { grid-template-columns: 1fr; }
  .detect-banner { flex-direction: column; align-items: flex-start; }
}


/* ---------------- 设置开关 ---------------- */
.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 0; border-bottom: 1px dashed #f0e9df;
}
.switch-row b { display: block; font-size: 13.5px; color: #403428; }
.switch-row div > span { font-size: 12px; color: var(--muted); }
.switch { position: relative; width: 44px; height: 24px; flex: none; cursor: pointer; }
.switch input { display: none; }
.switch span {
  position: absolute; inset: 0; background: #ddd3c4; border-radius: 999px; transition: .2s;
}
.switch span::after {
  content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.22);
}
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(20px); }
#setPanel .tbl th:first-child, #setPanel .tbl td:first-child { padding-left: 4px; }
#setPanel .tbl td { font-size: 13px; }


/* ---------------- 模型状态 ---------------- */
.model-chip {
  font-size: 11.5px; padding: 3px 10px; border-radius: 999px;
  background: #f2efe9; color: #7c7368; white-space: nowrap;
}
.model-chip.ok { background: #e8f4e9; color: #2f7d32; }
.model-chip.fail { background: #fbe9e7; color: #b03a2e; }
.model-line { margin-top: 8px; font-size: 11px; color: #a2958a; }
