:root {
  --bg: #0f1419; --panel: #1a2129; --panel2: #212a34; --line: #2e3a46;
  --txt: #e8eef4; --muted: #8fa1b3; --acc: #34c08b; --acc2: #2da876;
  --warn: #e8b339; --err: #e86a5a;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--txt); font: 14px/1.6 "Segoe UI", "Microsoft YaHei", sans-serif; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 12px; } .err { color: var(--err); min-height: 1.2em; }

header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;
  padding: 14px 28px; border-bottom: 1px solid var(--line); background: var(--panel); }
.logo { background: var(--acc); color: #06281a; font-weight: 800; padding: 3px 10px; border-radius: 6px; margin-right: 10px; }
.title { font-size: 18px; font-weight: 700; margin-right: 12px; }
.sub { color: var(--muted); font-size: 12px; }
nav { display: flex; gap: 8px; }
.tab-btn { background: var(--panel2); color: var(--muted); border: 1px solid var(--line);
  padding: 8px 18px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.tab-btn.active { background: var(--acc); color: #06281a; font-weight: 700; border-color: var(--acc); }

main { max-width: 1180px; margin: 0 auto; padding: 20px 16px 60px; }
.tab { display: none; } .tab.active { display: block; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin-bottom: 18px; }
h3 { margin-bottom: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
h4 { margin: 8px 0; color: var(--muted); }
.badge { font-size: 11px; background: #1d3a2e; color: var(--acc); padding: 2px 8px; border-radius: 10px; font-weight: 400; }
.badge.warn { background: #3a311d; color: var(--warn); }
.note { margin-top: 10px; color: var(--muted); font-size: 13px; border-left: 3px solid var(--acc); padding-left: 10px; }

label { display: block; margin: 8px 0; color: var(--muted); font-size: 13px; }
input, select, textarea { width: 100%; background: var(--panel2); color: var(--txt);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 14px; margin-top: 3px; }
textarea { resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 820px) { .grid2, .cols { grid-template-columns: 1fr; } }

.btn { background: var(--panel2); color: var(--txt); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 16px; cursor: pointer; font-size: 14px; text-decoration: none; display: inline-block; }
.btn:hover { border-color: var(--acc); }
.btn.primary { background: var(--acc); color: #06281a; font-weight: 700; border-color: var(--acc); }
.btn.primary:hover { background: var(--acc2); }
.btn.big { width: 100%; padding: 12px; font-size: 16px; margin-top: 12px; }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.progress { margin-top: 12px; padding: 10px 14px; background: var(--panel2); border-radius: 8px;
  color: var(--acc); font-size: 13px; border: 1px dashed var(--line); }
.progress.err { color: var(--err); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 600; background: var(--panel2); }
.kv td:first-child { color: var(--muted); width: 110px; white-space: nowrap; }
.range { color: var(--acc); font-variant-numeric: tabular-nums; }

.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.img-grid figure { background: var(--panel2); border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.img-grid img { width: 100%; display: block; aspect-ratio: 1; object-fit: cover; cursor: zoom-in; }
.img-grid figcaption { padding: 6px 10px; font-size: 12px; color: var(--muted); }

.sample-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 820px) { .sample-groups { grid-template-columns: 1fr; } }
.sample-card { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.sample-card .thumbs { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.sample-card .thumbs img { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; }
.upload-row { margin-top: 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.truth { margin: 14px 0; padding: 12px 14px; background: #16231d; border: 1px solid #29503e; border-radius: 10px; font-size: 13px; }
.truth b { color: var(--acc); }

.bom-part { margin-bottom: 14px; }
.bom-part h4 { color: var(--txt); }
.proc-chips { margin: 4px 0 8px; }
.proc-chips span { display: inline-block; background: var(--panel2); border: 1px solid var(--line);
  border-radius: 12px; padding: 1px 10px; margin: 2px 4px 2px 0; font-size: 12px; color: var(--muted); }

.overlay { position: fixed; inset: 0; background: rgba(10, 14, 18, .92); z-index: 50;
  display: flex; align-items: center; justify-content: center; }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 34px; width: 340px; text-align: center; }
.login-card input { margin: 14px 0; text-align: center; }
.login-card .btn { width: 100%; }

footer { text-align: center; color: var(--muted); font-size: 12px; padding: 20px; border-top: 1px solid var(--line); }

#lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.9); z-index: 60;
  display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
#lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 8px; }
