:root {
  color-scheme: light;
  --ink: #17372f;
  --muted: #677b74;
  --paper: #f1f6f3;
  --line: rgba(40, 83, 67, .12);
  --accent: #20725a;
  --accent-dark: #185541;
  --glass: rgba(255, 255, 255, .78);
  --shadow: 0 12px 42px rgba(35, 69, 53, .055);
  --radius: 22px;
}
* { box-sizing: border-box; }
html { min-width: 320px; scroll-padding-top: 110px; }
body { margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink); font: 15px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; -webkit-font-smoothing: antialiased; }
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse at 8% 4%, rgba(124, 197, 173, .28), transparent 45%), radial-gradient(ellipse at 96% 27%, rgba(176, 203, 233, .25), transparent 42%), radial-gradient(ellipse at 50% 96%, rgba(228, 212, 171, .16), transparent 50%), linear-gradient(135deg, #f2f7f3, #f7f9f7 55%, #edf3ef);
}
::selection { background: #c6e6d8; color: #163d30; }
a { color: var(--accent); text-underline-offset: 4px; }
a:hover { color: var(--accent-dark); }
.site-header {
  position: sticky; top: 16px; z-index: 20; display: flex; align-items: center; gap: 24px;
  max-width: 1240px; min-height: 76px; margin: 16px auto 0; padding: 14px 22px;
  border: 1px solid rgba(255, 255, 255, .94); border-radius: 24px; background: rgba(255, 255, 255, .86);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .7);
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; flex-shrink: 0; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: linear-gradient(145deg, #35876c, #1e5845); color: white; box-shadow: 0 6px 16px rgba(32, 114, 90, .17); }
.brand-mark svg { width: 25px; height: 25px; }
.brand-name { display: block; font-size: 21px; font-weight: 730; letter-spacing: -.7px; line-height: 1.25; }
.brand-caption { display: block; font-size: 10px; color: var(--muted); letter-spacing: 1.35px; margin-top: 3px; }
.site-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.site-nav a { display: flex; align-items: center; gap: 7px; padding: 9px 13px; border-radius: 11px; color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; transition: background .18s, color .18s; }
.site-nav a:hover { background: rgba(32, 114, 90, .055); color: var(--accent); }
.site-nav a[aria-current="page"] { background: #e1f0e8; color: #24664f; }
.site-nav svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.environment { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; padding: 5px 10px; border: 1px solid rgba(168, 128, 39, .18); border-radius: 8px; background: #fbf4df; color: #82641b; font: 10px/1.5 ui-monospace, monospace; font-weight: 650; letter-spacing: .55px; }
.environment::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.environment[data-environment="REAL"] { background: #e5f1eb; color: #24664f; border-color: #c4ded0; }
main { max-width: 1180px; margin: 48px auto 0; padding: 0 24px 28px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.eyebrow { margin: 0 0 9px; color: #779088; font-size: 10px; font-weight: 650; letter-spacing: 2.4px; }
h1 { margin: 0; font-size: clamp(27px, 3vw, 35px); font-weight: 650; line-height: 1.35; letter-spacing: -1px; overflow-wrap: anywhere; }
.page-description { color: var(--muted); font-size: 13px; margin: 10px 0 0; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 22px; }
.page-actions:empty, .sections:empty, .forms:empty { display: none; }
.sections, .forms { display: grid; gap: 22px; margin: 22px 0; min-width: 0; }
section { min-width: 0; padding: 28px; border: 1px solid rgba(255, 255, 255, .98); border-radius: var(--radius); background: var(--glass); box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .85); }
h2 { margin: 0 0 22px; font-size: 16px; font-weight: 650; line-height: 1.5; letter-spacing: -.2px; }
.form-card h2 { margin-bottom: 24px; }
.section-heading { display: flex; align-items: center; gap: 10px; }
.section-heading::before { content: ""; width: 3px; height: 16px; border-radius: 3px; background: #83b6a1; flex-shrink: 0; }
.notice, #global-feedback:not(:empty) { padding: 14px 18px; border: 1px solid #ecd9aa; border-radius: 14px; background: #fff8e7; color: #75551f; font-size: 13px; overflow-wrap: anywhere; }
.notice { margin: 0 0 22px; }
#global-feedback { max-width: 1132px; margin: 18px auto 0; }
#global-feedback:empty { display: none; }
#global-feedback a { color: inherit; font-weight: 650; }
.button, button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 19px; border: 1px solid transparent; border-radius: 12px; background: var(--accent); color: white; font: inherit; font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; box-shadow: 0 4px 12px rgba(32, 114, 90, .11); transition: background .18s, box-shadow .18s, transform .18s; }
.button:hover, button:hover { background: var(--accent-dark); color: white; box-shadow: 0 6px 18px rgba(32, 114, 90, .17); transform: translateY(-1px); }
.button:active, button:active { transform: translateY(0); }
.secondary { background: rgba(255, 255, 255, .7); color: var(--accent); border-color: var(--line); box-shadow: 0 3px 10px rgba(35, 69, 53, .025); }
.secondary:hover { background: #e7f2ec; color: var(--accent-dark); box-shadow: none; }
.form-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 24px; }
label { display: block; color: #576c63; font-size: 12px; font-weight: 550; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
input:not([type="hidden"]), select, textarea { display: block; width: 100%; min-height: 46px; padding: 11px 13px; margin-top: 8px; border: 1px solid rgba(56, 93, 75, .14); border-radius: 11px; background: rgba(255, 255, 255, .8); font: inherit; font-size: 14px; font-weight: 400; color: var(--ink); transition: border-color .18s, box-shadow .18s, background .18s; }
input:hover, select:hover, textarea:hover { border-color: #a7c4b4; }
input:focus, select:focus, textarea:focus { outline: none; background: #fff; border-color: #559b80; box-shadow: 0 0 0 3px rgba(69, 149, 114, .1); }
textarea { resize: vertical; min-height: 134px; line-height: 1.75; }
textarea[name="csv"], textarea[name="response"], textarea[name="positions"], textarea[name="replacement"] { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 12px; }
input[type="file"] { padding: 8px; font-size: 12px; }
input[type="file"]::file-selector-button { padding: 5px 10px; margin-right: 12px; border: 0; border-radius: 7px; background: #e7f2ec; color: var(--accent); cursor: pointer; }
form button { margin-top: 2px; }
.scroll { overflow-x: auto; max-width: 100%; border: 1px solid var(--line); border-radius: 13px; }
table { border-collapse: collapse; min-width: 100%; font-size: 13px; text-align: left; font-variant-numeric: tabular-nums; }
th, td { padding: 14px 17px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: #7b8b83; background: rgba(226, 236, 228, .46); font-size: 11px; font-weight: 600; white-space: nowrap; }
td { color: #3f554a; line-height: 1.7; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: rgba(223, 237, 228, .38); }
tbody tr:last-child td { border-bottom: 0; }
td a { font-weight: 550; text-decoration: none; }
td a:hover { text-decoration: underline; }
.status-pill { display: inline-block; padding: 3px 8px; border: 1px solid #d6e6dc; border-radius: 7px; background: #edf6f0; color: #337653; font: 10px/1.7 ui-monospace, monospace; white-space: nowrap; }
.status-pill[data-status="CURRENT"], .status-pill[data-status="HISTORICAL"] { background: #eaf1f9; border-color: #d5e1f0; color: #486b97; }
.status-pill[data-status="UNVERIFIED"], .status-pill[data-status="STALE"], .status-pill[data-status="OUTDATED"], .status-pill[data-status="UNKNOWN_COST"], .status-pill[data-status="MISSING_PRICE"], .status-pill[data-status="COVERAGE_BLOCKED"] { background: #fcf4e3; border-color: #eddcbb; color: #98742e; }
.status-pill[data-status="INVALID"], .status-pill[data-status="MISMATCH"], .status-pill[data-status="ORDER_UNRESOLVED"] { background: #faece9; border-color: #efd5ce; color: #a25b4d; }
pre { margin: 0; padding: 20px; max-height: 650px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; border: 1px solid var(--line); border-radius: 13px; background: rgba(235, 242, 237, .55); color: #4b675b; font: 12px/1.85 ui-monospace, "SFMono-Regular", Consolas, monospace; tab-size: 2; }
.site-footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 34px; padding: 22px 2px 0; border-top: 1px solid var(--line); color: #8a9a91; font-size: 11px; }
.footer-brand { color: #668173; font-weight: 650; letter-spacing: -.2px; }
.htmx-request { opacity: .65; }
button:focus-visible, a:focus-visible { outline: 3px solid #8fc3ad; outline-offset: 4px; }
.skip-link { position: fixed; top: -60px; left: 24px; z-index: 30; padding: 10px 18px; border-radius: 10px; background: #fff; }
.skip-link:focus { top: 20px; }
/* Readable translucent fallback when backdrop-filter is unavailable. */
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header { background: rgba(255, 255, 255, .66); -webkit-backdrop-filter: blur(24px) saturate(145%); backdrop-filter: blur(24px) saturate(145%); }
  section { background: rgba(255, 255, 255, .62); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
}
@media (min-width: 900px) {
  main[data-page="账户与日常记录"] .forms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  main[data-page="账户与日常记录"] .form-card[data-form="logout"] { grid-column: 1 / -1; padding: 20px 28px; }
  main[data-page="账户与日常记录"] .form-card[data-form="logout"] h2 { display: none; }
}
main[data-page="登录"] { max-width: 510px; margin-top: 70px; }
main[data-page="登录"] .page-heading { justify-content: center; text-align: center; }
main[data-page="登录"] h1 { font-size: 32px; }
main[data-page="登录"] .form-fields { grid-template-columns: 1fr; }
main[data-page="登录"] .form-card { padding: 34px; }
main[data-page="登录"] form button { width: 100%; }
main[data-page="登录"] .site-footer { justify-content: center; text-align: center; flex-direction: column; gap: 6px; border-top: 0; margin-top: 28px; }
@media (max-width: 1280px) {
  .site-header { margin: 16px 24px 0; }
  #global-feedback { margin-left: 24px; margin-right: 24px; }
}
@media (max-width: 900px) {
  .site-header { gap: 12px; padding: 12px 16px; flex-wrap: wrap; }
  .environment { margin-left: auto; }
  .site-nav { order: 3; width: 100%; margin-left: 0; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 10px; }
  .site-nav a { justify-content: center; padding: 8px 12px; }
  main { margin-top: 32px; }
}
@media (max-width: 600px) {
  .site-header { top: 8px; margin: 8px 12px 0; padding: 12px; border-radius: 18px; }
  .brand-mark { width: 35px; height: 35px; border-radius: 11px; }
  .brand-name { font-size: 19px; }
  .brand-caption { font-size: 8px; }
  .site-nav { gap: 2px; overflow-x: auto; justify-content: flex-start; }
  .site-nav a { flex: 1 0 auto; gap: 5px; padding: 8px 9px; font-size: 11px; }
  .site-nav svg { width: 14px; height: 14px; }
  main { padding: 0 16px 20px; margin-top: 28px; }
  main[data-page="登录"] { margin-top: 38px; }
  main[data-page="登录"] .form-card { padding: 24px; }
  .page-heading { margin-bottom: 20px; }
  section { padding: 20px; border-radius: 18px; }
  .sections, .forms { gap: 16px; margin: 16px 0; }
  .form-fields { grid-template-columns: 1fr; gap: 17px; }
  th, td { padding: 12px; }
  #global-feedback { margin-left: 16px; margin-right: 16px; }
  .site-footer { flex-direction: column; gap: 5px; }
  pre { padding: 14px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .site-header, section { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (forced-colors: active) {
  .brand-mark, section, .site-header, .status-pill, input, select, textarea { border: 1px solid CanvasText; }
  .site-nav a[aria-current="page"] { outline: 1px solid Highlight; }
}
@media print {
  body { background: #fff; }
  body::before, .site-header, .page-actions, .forms, #global-feedback, .skip-link { display: none; }
  main { max-width: none; margin: 0; padding: 0; }
  section { box-shadow: none; backdrop-filter: none; background: #fff; border: 1px solid #ccc; break-inside: avoid; }
  pre { max-height: none; overflow: visible; }
  .scroll { overflow: visible; }
}
