:root {
  color-scheme: light;
  --canvas: #eff3f1;
  --ink: #172c28;
  --mute: #50645f;
  --line: #dce5e1;
  --green: #145a4b;
  --dark: #123730;
  --white: #fff;
  font-family: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--canvas); line-height: 1.55; }
.shell { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.topbar { background: var(--white); border-bottom: 1px solid var(--line); }
.top-inner { height: 66px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand, .internal, .top-actions { display: flex; align-items: center; gap: 11px; }
.brand { font-weight: 700; }
.brand-mark, .file-icon { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; }
.brand-mark { color: #fff; background: var(--green); }
.brand-mark svg, .file-icon svg { width: 22px; height: 22px; }
.divider { width: 1px; height: 18px; background: var(--line); margin-inline: 3px; }
.workspace, .internal { color: var(--mute); font-size: .875rem; }
.workspace { font-weight: 500; }
.internal svg, .quiet svg { width: 18px; height: 18px; }
.internal { gap: 5px; }
.hero {
  min-height: 194px; margin-top: 29px; padding: 29px 34px; border-radius: 18px;
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  color: white; background-color: var(--dark);
  background-image: radial-gradient(ellipse at 100% 0%, #287461a3, transparent 60%),
    repeating-linear-gradient(115deg, transparent 0 29px, #d0efdf0e 30px 31px);
}
.eyebrow { color: #b9dcd1; font-size: .875rem; font-weight: 700; letter-spacing: .05em; }
h1, h2, h3, p { margin: 0; }
h1 { margin-top: 5px; font-size: clamp(2rem, 4vw, 2.8rem); line-height: 1.25; font-weight: 750; }
.hero p { margin-top: 11px; color: #d5e8e1; }
.hero-stat { flex: 0 0 172px; display: grid; gap: 3px; padding: 15px 18px; background: #ffffff10; border: 1px solid #bdf1de48; border-radius: 12px; }
.hero-stat span, .hero-stat small { color: #d2ebe2; font-size: .875rem; }
.hero-stat strong { font-size: 1.85rem; font-variant-numeric: tabular-nums; line-height: 1.35; }
.section { margin-top: 29px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
h2 { font-size: 1.26rem; line-height: 1.4; }
.section-head p { margin-top: 3px; }
.section-head p, .reference-card p { color: var(--mute); font-size: .91rem; }
.reference-grid, .order-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 3px 12px #15352906; }
.reference-card, .order-card { padding: 17px 20px; }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.file-icon { background: #e9f4ef; color: var(--green); }
.badge { flex: none; padding: 4px 10px; color: #495b57; background: #edf2ef; border-radius: 100px; font-size: .875rem; font-weight: 650; }
.badge.ready { color: #15584a; background: #e3f4ea; }
.rule-log { margin-top: 16px; }
.rule-log summary { padding: 11px 16px; color: var(--green); font-weight: 700; cursor: pointer; }
.rule-log summary .badge { margin-inline-start: 7px; }
.rule-log-body { padding: 0 16px 14px; color: var(--mute); font-size: .875rem; }
.rule-entries { margin: 0; list-style: none; }
.rule-entry { padding: 10px 0; border-top: 1px solid var(--line); }
.rule-entry strong { color: var(--ink); }
.rule-entry time { margin-inline-start: 10px; white-space: nowrap; }
.rule-entry ul { margin: 4px 0 0; padding-inline-start: 20px; }
h3 { font-size: 1.05rem; }
.file-meta { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 49px; margin-top: 11px; color: var(--mute); font-size: .875rem; overflow-wrap: anywhere; }
.file-meta strong { color: var(--ink); }
.file-meta small { font-size: .82rem; }
.file-actions { display: flex; align-items: center; gap: 9px; min-width: 0; margin-top: 8px; }
.file-selection { flex: 1; min-width: 0; color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .875rem; }
button, .pick span, select, input[type=date] { font: inherit; font-size: .875rem; border-radius: 8px; }
button, .pick span { min-height: 38px; padding: 7px 12px; white-space: nowrap; cursor: pointer; }
button:disabled { opacity: .52; cursor: not-allowed; }
.outline, .pick span, select, input[type=date] { color: var(--ink); background: white; border: 1px solid #cbd9d3; }
.outline, .primary { font-weight: 700; }
.outline { color: var(--green); }
.quiet { display: inline-flex; gap: 5px; align-items: center; color: var(--green); font-weight: 700; background: transparent; border: 1px solid transparent; }
.outline:hover:not(:disabled), .quiet:hover:not(:disabled), .pick:hover span { background: #ecf6f0; }
.primary { color: #fff; background: var(--green); border: 1px solid var(--green); padding-inline: 22px; }
.primary:hover:not(:disabled) { background: #0e4639; }
.pick { position: relative; }
.pick span { display: grid; align-items: center; }
.pick input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
:focus-visible, .pick:focus-within span { outline: 2px solid #267d68; outline-offset: 3px; }
.order-settings { display: flex; gap: 13px; align-items: center; margin-bottom: 14px; }
.order-settings label, .mode > span { font-size: .875rem; font-weight: 700; }
.order-settings label span { color: var(--mute); font-weight: 400; margin-left: 4px; }
input[type=date] { min-height: 38px; padding: 5px 9px; }
.order-file { min-width: 0; padding: 12px 14px; border-radius: 10px; border: 1px dashed #c7d7d0; background: #f8faf9; }
.order-file .file-meta { margin-top: 3px; min-height: 31px; }
.order-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 13px; color: var(--mute); font-size: .875rem; }
.upload-progress { margin-top: 10px; color: var(--green); font-size: .875rem; }
.run-bar { padding: 16px 20px; display: flex; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); }
.run-info { margin-right: auto; display: grid; }
.run-info span { color: var(--mute); font-size: .875rem; }
.mode { display: flex; align-items: center; gap: 9px; }
select { appearance: none; min-height: 38px; padding: 7px 32px 7px 10px; background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%233d5b51' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 8px center / 16px; }
.empty { padding: 25px 20px; text-align: center; color: var(--mute); font-size: .91rem; }
.notice { margin-top: 16px; padding: 10px 15px; color: #155145; background: #e0f4e9; border: 1px solid #a9d6c7; border-radius: 8px; }
.notice button { margin: 4px 0 4px 8px; }
.notice.error, .warn { color: #8a3c09; background: #fff3e2; border-color: #eacda8; }
.report-info { padding: 13px 20px; color: var(--mute); font-size: .875rem; overflow-wrap: anywhere; }
.report-info.warn { color: #8a3c09; }
.metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 0 20px; }
.metric { margin: 0; padding: 10px 13px; border: 1px solid var(--line); border-radius: 9px; background: #f7faf8; }
.metric.warn { background: #fff3e2; border-color: #eacda8; }
.metric dt { font-size: .875rem; }
.metric dd { margin: 0; font-size: 1.45rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.order-summary { margin: 13px 20px; color: var(--mute); font-size: .875rem; }
.rate-summary { margin: 13px 20px; }
.table-wrap { overflow: auto; margin: 0 20px 20px; border: 1px solid var(--line); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: .875rem; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
th { background: #eff6f2; white-space: nowrap; }
td { overflow-wrap: anywhere; }
footer { color: var(--mute); padding: 20px 0 29px; font-size: .875rem; }
.login-shell { width: min(450px, calc(100% - 32px)); margin: clamp(25px, 8vh, 90px) auto; }
.login-intro { padding: 22px 24px; border-radius: 14px 14px 0 0; background: var(--dark); color: white; }
.login-intro h1 { margin: 5px 0 8px; font-size: 2rem; }
.login-intro p { color: #d5e8e1; }
.login-card { padding: 23px 24px; border-radius: 0 0 14px 14px; }
.login-card > p { color: var(--mute); font-size: .91rem; }
.login-card form { display: grid; gap: 7px; margin-top: 17px; }
.login-card label { font-weight: 700; font-size: .875rem; }
.login-card input {
  width: 100%; min-height: 43px; padding: 7px 10px; margin-bottom: 7px;
  border: 1px solid #cbd9d3; border-radius: 8px; color: var(--ink); font: inherit;
}
.login-card .primary { margin-top: 5px; min-height: 44px; }
.login-card .notice { margin-top: 0; font-size: .875rem; }
.login-help { margin-top: 15px; }
@media (max-width: 780px) {
  .reference-grid { grid-template-columns: minmax(0, 1fr); }
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .run-bar { flex-wrap: wrap; }
  .run-info { width: 100%; }
}
@media (max-width: 530px) {
  .shell { width: calc(100% - 24px); }
  .workspace, .divider { display: none; }
  .top-actions { gap: 4px; }
  .hero { padding: 19px; margin-top: 16px; gap: 14px; align-items: stretch; flex-direction: column; }
  .hero-stat { flex: auto; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
  .hero-stat strong { font-size: 1rem; }
  .order-grid, .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .order-grid { grid-template-columns: minmax(0, 1fr); }
  .order-settings { flex-wrap: wrap; }
  .order-footer { align-items: flex-start; }
  .reference-card, .order-card, .run-bar { padding-inline: 12px; }
}
