:root {
  --red: #C00000;
  --red-soft: #FFF5F5;
  --ink: #171717;
  --grey: #5D6470;
  --line: #E6E6E6;
  --paper: #F7F4F0;
  --green: #2E7D4F;
  --amber: #B7791F;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "微软雅黑", sans-serif;
  color: var(--ink); background: var(--paper); line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 28px; }
.hidden { display: none !important; }
.muted { color: var(--grey); font-size: 14px; }

.topbar { background: #fff; border-bottom: 3px solid var(--red); position: sticky; top: 0; z-index: 20; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 16px; }
.brand img { height: 30px; }
.brand .name { font-size: 18px; font-weight: 800; border-left: 1px solid var(--line); padding-left: 16px; }
.buyer { font-size: 13px; color: var(--grey); }
.buyer b { color: var(--ink); }

.intro { padding: 34px 0 22px; }
.intro h1 { font-size: 26px; font-weight: 800; }
.intro p { margin-top: 8px; color: var(--grey); max-width: 860px; }

.card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 22px 24px; margin-bottom: 20px; }
.card h3 { font-size: 16px; margin-bottom: 12px; }
.grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; }

.drop {
  border: 2px dashed #d9b3b3; border-radius: 8px; background: var(--red-soft);
  padding: 30px 20px; text-align: center; transition: all .15s;
}
.drop.over { border-color: var(--red); background: #ffecec; }
.drop-ico { font-size: 34px; color: var(--red); line-height: 1; }
.drop-title { font-size: 17px; font-weight: 700; margin-top: 8px; }
.drop-sub { font-size: 13px; color: var(--grey); margin-top: 2px; }
.drop-btns { margin-top: 14px; display: flex; gap: 10px; justify-content: center; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 14px; font-weight: 600;
  padding: 8px 18px; border-radius: 6px; border: 1px solid var(--red); cursor: pointer; text-decoration: none;
}
.btn.primary { background: var(--red); color: #fff; }
.btn.primary:hover { background: #a00000; }
.btn.ghost { background: #fff; color: var(--red); }
.btn.ghost:hover { background: var(--red-soft); }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.file-list { list-style: none; margin-top: 14px; max-height: 260px; overflow: auto; }
.file-list li { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px solid #f1f1f1; font-size: 14px; }
.file-list .ext { font-size: 11px; font-weight: 800; color: #fff; border-radius: 3px; padding: 1px 6px; min-width: 42px; text-align: center; }
.ext.pdf { background: #C00000; } .ext.doc, .ext.docx { background: #2B579A; }
.ext.xls, .ext.xlsx, .ext.xlsm { background: #217346; } .ext.png, .ext.jpg, .ext.jpeg { background: #7A5AA6; }
.ext.bad { background: #999; }
.file-list .fname { flex: 1; word-break: break-all; }
.file-list .size { color: var(--grey); font-size: 12px; }
.file-list .rm { border: none; background: none; color: #999; cursor: pointer; font-size: 16px; }
.file-list .rm:hover { color: var(--red); }
.actions { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; }
.actions .btn + .btn { margin-left: 8px; }

.scope-list { list-style: none; }
.scope-list li { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.scope-list b { display: block; font-size: 15px; }
.scope-list span { font-size: 13px; color: var(--grey); }
.legend { margin-top: 14px; font-size: 13px; color: var(--grey); display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 3px; }
.tag.pass { background: #EAF5EE; color: var(--green); }
.tag.err { background: var(--red); color: #fff; }
.tag.ask { background: var(--red-soft); color: var(--red); border: 1px solid #f0c2c2; }

.progress .steps { display: flex; list-style: none; counter-reset: s; }
.steps li {
  flex: 1; position: relative; text-align: center; font-size: 14px; color: #aaa; counter-increment: s; padding-top: 36px;
}
.steps li::before {
  content: counter(s); position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 28px; height: 28px; border-radius: 50%; background: #eee; color: #999; line-height: 28px; font-weight: 700;
}
.steps li::after { content: ""; position: absolute; top: 14px; left: calc(50% + 18px); right: calc(-50% + 18px); height: 2px; background: #eee; }
.steps li:last-child::after { display: none; }
.steps li.done { color: var(--ink); }
.steps li.done::before { background: var(--red); color: #fff; content: "✓"; }
.steps li.done::after { background: var(--red); }
.steps li.cur { color: var(--red); font-weight: 700; }
.steps li.cur::before { background: #fff; border: 2px solid var(--red); color: var(--red); line-height: 24px; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(192,0,0,.12); } }
.prog-msg { text-align: center; margin-top: 16px; font-size: 14px; color: var(--grey); }

.res-head { display: flex; justify-content: space-between; align-items: flex-end; margin: 10px 0 16px; }
.res-head h2 { font-size: 22px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 16px 20px; border-top: 4px solid var(--ink); }
.stat .v { font-size: 34px; font-weight: 800; line-height: 1.1; }
.stat .k { color: var(--grey); font-size: 14px; }
.stat.pass { border-top-color: var(--green); } .stat.pass .v { color: var(--green); }
.stat.err { border-top-color: var(--red); } .stat.err .v { color: var(--red); }
.stat.ask { border-top-color: #E88; } .stat.ask .v { color: var(--red); font-weight: 600; }

.issues { border-left: 4px solid var(--red); }
.issues.ok { border-left-color: var(--green); }
.issues li { list-style: none; padding: 5px 0; font-size: 14px; }
.issues li.e { color: var(--red); font-weight: 700; }
.issues li.a { color: var(--red); }
.issues .rule { font-family: Menlo, Consolas, monospace; font-size: 13px; margin-right: 6px; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { border: 1px solid #ddd; padding: 7px 10px; text-align: left; vertical-align: top; }
th { background: var(--ink); color: #fff; font-weight: 600; white-space: nowrap; }
td { word-break: break-all; }
table.files td:nth-child(2) { white-space: nowrap; }
tr.r-err td { color: var(--red); font-weight: 700; background: #fff8f8; }
tr.r-ask td { color: var(--red); background: #fffafa; }
.link { color: var(--red); cursor: pointer; text-decoration: underline; font-size: 13px; background: none; border: none; font: inherit; }

.filter { margin: 4px 0 12px; font-size: 14px; }
.sec { background: #fff; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 16px; overflow: hidden; }
.sec-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; cursor: pointer; border-bottom: 1px solid var(--line); }
.sec-head h3 { font-size: 16px; color: var(--red); }
.sec-head .cnt { font-size: 13px; color: var(--grey); }
.sec-head .cnt b.e { color: var(--red); } .sec-head .cnt b.a { color: var(--red); font-weight: 500; }
.sec-files { font-size: 12px; color: var(--grey); padding: 8px 20px 0; }
.sec-body { padding: 12px 20px 18px; }
.sec.collapsed .sec-body, .sec.collapsed .sec-files { display: none; }
.sec table td:nth-child(1) { white-space: nowrap; font-family: Menlo, Consolas, monospace; font-size: 12.5px; }
.sec table td:nth-child(5) { white-space: nowrap; }

.history table td, .history table th { font-size: 13px; }
.history tr { cursor: pointer; }
.history tbody tr:hover td { background: var(--red-soft); }

dialog { border: none; border-radius: 8px; padding: 0; width: min(760px, 92vw); max-height: 80vh; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(0,0,0,.35); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; }
.kv { margin: 12px 18px 18px; width: calc(100% - 36px); }
.kv th { background: #f6f6f6; color: var(--ink); width: 170px; white-space: normal; }

.foot { display: flex; justify-content: space-between; padding: 24px 28px 40px; font-size: 13px; color: var(--grey); }

@media (max-width: 900px) {
  .grid, .stats { grid-template-columns: 1fr 1fr; }
  .grid { grid-template-columns: 1fr; }
  .buyer { display: none; }
}
