:root {
  color-scheme: light;
  --ink: #182c28;
  --muted: #536762;
  --accent: #126950;
  --deep: #163e36;
  --soft: #e7f1ed;
  --line: #d4dfd8;
  --paper: #fff;
  --bg: #f4f6f1;
  --warn: #87410d;
  --danger: #a83428;
  --radius: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 "Inter","Segoe UI","Microsoft YaHei",Arial,sans-serif; }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, select, summary { cursor: pointer; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #cf8c27; outline-offset: 3px; }
button:disabled { cursor: wait; opacity: .55; }
button, a { touch-action: manipulation; }
button { color: inherit; }
button[hidden], [hidden] { display: none !important; }
form, p, h1, h2, h3, dl, dd, figure { margin: 0; }
h1, h2, h3, strong { font-weight: 650; }
h1 { font-size: clamp(26px,4.4vw,36px); letter-spacing: -.045em; line-height: 1.2; overflow-wrap: anywhere; }
h2 { font-size: 20px; line-height: 1.35; letter-spacing: -.025em; }
h3 { font-size: 16px; }
.muted, .meta, .help { color: var(--muted); }
.meta, .help { font-size: .88rem; overflow-wrap: anywhere; }
.topbar { background: var(--deep); color: white; }
.topbar-inner, .workspace { width: min(100%, 1016px); margin-inline: auto; padding-inline: 28px; }
.topbar-inner { min-height: 62px; display: flex; align-items: center; gap: 38px; }
.brand, .top-tools, .main-nav, .head-actions, .actions, .chips, .line, .pager, .photo-actions { display: flex; align-items: center; }
.brand { color: white; gap: 9px; font-size: 15px; font-weight: 700; letter-spacing: .08em; white-space: nowrap; }
.brand-glyph { display: grid; place-items: center; height: 29px; width: 29px; font-weight: 750; font-size: 19px; line-height: 1; color: var(--deep); background: #d5e9cc; border-radius: 8px; }
.main-nav { align-self: stretch; gap: 20px; }
.main-nav a { display: flex; align-items: center; padding: 4px 2px 1px; color: #d2e2dc; font-size: 14px; border-bottom: 3px solid transparent; }
.main-nav a[aria-current="page"] { color: white; border-color: #acd19d; font-weight: 650; }
.top-tools { gap: 10px; margin-left: auto; }
.plain { border: 0; background: transparent; padding: 0; }
.head-tool { padding: 8px 6px; min-height: 44px; color: #ebf2ef; font-size: 14px; }
.workspace { padding-block: 36px max(48px,env(safe-area-inset-bottom)); outline: 0; }
.workspace > * + * { margin-top: 20px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.page-head .meta { margin-top: 6px; }
.narrow { max-width: 700px; margin-inline: auto; }
.narrow > * + * { margin-top: 18px; }
.panel, .record-list, .search-box { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.panel { padding: 22px; }
.panel > * + * { margin-top: 15px; }
.btn, .back, .filter, .row, .chipbtn { display: inline-flex; align-items: center; justify-content: center; }
.btn { gap: 8px; min-height: 44px; border: 1px solid transparent; border-radius: 9px; padding: 9px 16px; font-weight: 600; font-size: .94rem; line-height: 1.35; text-align: center; }
.primary { background: var(--accent); color: #fff; }
.primary:hover { background: #0c5742; }
.secondary { color: var(--ink); background: white; border-color: #b8c9be; }
.secondary:hover, .filter:hover, .row:hover { background: #f2f7f3; }
.subtle { background: var(--soft); color: var(--accent); }
.danger { color: var(--danger); background: white; border-color: #dfc5be; }
.back { min-height: 42px; justify-content: flex-start; gap: 7px; color: var(--muted); font-weight: 550; font-size: .93rem; }
.back span { font-size: 1.25rem; }
.source-link { display: flex; overflow-wrap: anywhere; color: var(--accent); }
.plus { font-size: 1.25rem; font-weight: 400; line-height: 1; }
.search-box { overflow: hidden; }
.search-top { padding: 18px 20px 12px; }
.search-field { display: flex; align-items: center; gap: 10px; border: 1px solid #b9c9bd; padding-left: 15px; border-radius: 10px; }
.search-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--soft); }
.search-icon { height: 16px; width: 16px; flex: 0 0 auto; border: 2px solid #60786c; border-radius: 50%; position: relative; margin-right: 4px; }
.search-icon::after { position: absolute; content: ""; width: 8px; height: 2px; background: #60786c; right: -6px; bottom: -3px; transform: rotate(45deg); border-radius: 2px; }
.search-field input { margin: 0; flex: 1; border: 0; background: transparent; min-width: 0; border-radius: 10px; min-height: 48px; padding: 8px 10px 8px 0; outline: 0; color: var(--ink); }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding: 0 20px 12px; }
.filter { padding: 8px 12px; min-height: 40px; border: 0; background: transparent; border-radius: 8px; color: var(--muted); font-size: .9rem; }
.filter[aria-pressed="true"] { background: var(--soft); color: #15553f; font-weight: 650; }
.list-caption,.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.list-caption { margin: 24px 2px 10px; }
.row { width: 100%; color: var(--ink); gap: 14px; text-align: left; justify-content: flex-start; padding: 14px 18px; background: none; border: 0; }
.row + .row,.batch-item + .batch-item,.choice + .choice { border-top: 1px solid var(--line); }
.record-list { overflow: hidden; }
.mark { flex: 0 0 auto; border-radius: 10px; height: 38px; min-width: 38px; display: grid; place-items: center; font-weight: 700; font-size: .92rem; background: #e4efeb; color: #276350; }
.mark.candidate { background: #f3ebe0; color: #795026; }
.row-body { min-width: 0; flex: 1; }
.row-title { font-weight: 650; overflow-wrap: anywhere; }
.row .meta { margin-top: 3px; line-height: 1.4; }
.row-tail { color: var(--muted); font-size: 20px; }
.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 5px; padding: 3px 8px; color: #2b604e; background: var(--soft); font-size: .79rem; font-weight: 650; flex-shrink: 0; }
.pill.warn { color: #734f25; background: #f3ebe0; }
.chips, .actions, .head-actions, .photo-actions { flex-wrap: wrap; gap: 9px; }
.pager { justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 15px; color: var(--muted); font-size: .9rem; }
.pager .btn { padding-inline: 12px; }
.empty { padding: 26px 16px; text-align: center; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; color: var(--ink); font-size: .92rem; font-weight: 600; }
.field input,.field select,.field textarea { border: 1px solid #b7c7bc; border-radius: 8px; min-height: 46px; background: #fff; width: 100%; min-width: 0; padding: 9px 11px; font-size: 16px; font-weight: 400; color: var(--ink); }
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus,.field textarea:focus,.field select:focus { outline: 2px solid #78aa97; outline-offset: 0; }
.span-all { grid-column: 1/-1; }
.details { padding: 0; }
.details > summary { padding: 15px 20px; min-height: 46px; font-weight: 600; }
.details > div { padding: 0 20px 20px; margin-top: 2px; }
.notice,.inline-error { padding: 10px 13px; border-radius: 8px; overflow-wrap: anywhere; font-size: .92rem; }
.notice { background: #f6f0e4; color: #674b21; }
.inline-error { background: #f9e9e3; color: #8f2e20; }
.facts { display: grid; grid-template-columns: minmax(84px, .42fr) minmax(0,1fr); gap: 10px 18px; }
.facts dt { color: var(--muted); }.facts dd { overflow-wrap: anywhere; white-space: pre-line; }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.thumb { width: 88px; overflow-wrap: anywhere; }
.thumb img { display: block; width: 88px; height: 78px; object-fit: cover; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); }
.thumb button { min-height: 37px; width: 100%; font-size: .86rem; color: var(--danger); }
.photo-view { border: 0; border-radius: 12px; padding: 12px; max-width: min(94vw,860px); width: max-content; color: var(--ink); }
.photo-view::backdrop { background: #0b1c18c9; }
.photo-view img { display: block; object-fit: contain; max-width: 100%; max-height: 72dvh; margin: 0 auto 8px; }
.photo-view form { text-align: end; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.save-bar { padding-block: 12px; background: var(--bg); }
.wide { width: 100%; }
.choice { display: flex; align-items: center; gap: 12px; min-height: 55px; padding: 10px 5px; cursor: pointer; }
.choice input { width: 20px; height: 20px; accent-color: var(--accent); flex: 0 0 auto; }
.choice strong { overflow-wrap: anywhere; }
.pending-asset + .pending-asset { border-top: 1px solid var(--line); }
.card-match { margin: 0 0 10px 33px; padding: 7px 11px; background: #f6f0e4; border-radius: 7px; font-size: .88rem; color: #674b21; }
.card-match a { align-items: center; min-height: 40px; }
.batch-item { padding-block: 16px; }.batch-item:first-child { padding-top: 0; }.batch-item:last-child { padding-bottom: 0; }
.batch-item > * + *, .stack > * + * { margin-top: 12px; }
.history { margin: 0; padding: 0; list-style: none; }
.history li { padding-block: 8px; border-bottom: 1px solid var(--line); }.history li:last-child { border: 0; }
.toast { position: fixed; z-index: 10; left: 50%; transform: translateX(-50%); bottom: max(22px,env(safe-area-inset-bottom)); max-width: calc(100% - 28px); width: max-content; padding: 11px 17px; color: white; background: var(--deep); border-radius: 9px; box-shadow: 0 5px 18px #0e271d2b; }
.login-wrap { max-width: 450px; margin: clamp(50px,12vh,115px) auto; padding: 0 16px; }
.login-panel { padding: clamp(24px,5vw,40px); background: white; border: 1px solid var(--line); border-radius: 17px; }
.login-rule { width: 38px; height: 5px; background: var(--accent); border-radius: 10px; margin-bottom: 22px; }
.login-desc { margin: 12px 0 23px; }
.login-panel form > * + * { margin-top: 18px; }
@media(max-width:620px) {
 .topbar-inner { padding-inline: 14px; min-height: 54px; gap: 12px; }
 .brand { font-size: 12px; gap: 5px; letter-spacing: .025em; }
 .brand-glyph { height: 24px; width: 24px; font-size: 16px; border-radius: 6px; }
 .main-nav { gap: 7px; }.main-nav a,.head-tool { font-size: 13px; }
 .top-tools { gap: 2px; }.head-tool { padding-inline: 4px; }
 .workspace { padding: 23px 14px max(30px,env(safe-area-inset-bottom)); }
 .workspace > * + *, .narrow > * + * { margin-top: 14px; }
 .page-head { gap: 10px; }.page-head h1 { font-size: 26px; }
 .panel { padding: 16px; }
 .details { padding: 0; }.details > summary { padding: 14px; }.details > div { padding: 0 14px 14px; }
 .search-top { padding: 12px 12px 9px; }.filters { padding: 0 10px 9px; gap: 2px; }.filter { padding-inline: 9px; }
 .row { padding: 12px; gap: 9px; }.row .pill { display: none; }
 .grid { grid-template-columns: minmax(0,1fr); gap: 13px; }
 .save-bar { padding: 8px 0; }.save-bar .btn { width: 100%; min-height: 48px; }
}
@media(max-width:355px) {
 .topbar-inner { padding-inline: 9px; gap: 8px; }.brand-glyph { display:none; }
 .head-tool,.main-nav a { font-size: 12px; }
 .mark { min-width: 32px; height: 32px; }
}
