:root {
  color-scheme: light;
  --paper: #f7f7f2;
  --white: #fff;
  --ink: #16251e;
  --muted: #52645a;
  --line: #d8e0d8;
  --green: #19543d;
  --green-dark: #103e2c;
  --quiet: #e9f1ea;
  --bad: #9b3327;
  font-family: "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
a { color: inherit; }
button, input, textarea { font: inherit; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
:focus-visible { outline: 3px solid #438065; outline-offset: 3px; }
.bar { background: var(--white); border-bottom: 1px solid var(--line); }
.bar-inner { min-height: 70px; max-width: 1150px; margin: auto; padding: 0 28px; display: flex; align-items: center; gap: 36px; }
.brand { display: inline-flex; gap: 9px; align-items: center; font-size: 22px; font-weight: 760; text-decoration: none; }
.mark { width: 30px; height: 30px; background: var(--green); color: white; border-radius: 8px; display: grid; place-items: center; line-height: 1; font-size: 21px; }
nav { display: flex; gap: 4px; }
nav a { padding: 10px 13px; text-decoration: none; font-size: 14px; border-radius: 8px; white-space: nowrap; }
nav a[aria-current="page"], nav a:hover { background: var(--quiet); color: var(--green-dark); }
.route { margin-left: auto; display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.route::before { content: ""; width: 8px; height: 8px; background: #818780; border-radius: 50%; }
.route[data-route="direct"]::before { background: #268053; }
.route[data-route="tunnel"]::before { background: #ad681e; }
main { max-width: 1150px; margin: auto; padding: clamp(32px, 7vw, 88px) 28px 60px; }
h1 { font-size: clamp(31px, 5vw, 53px); line-height: 1.12; margin: 0 0 15px; letter-spacing: -.045em; }
h2 { margin: 0 0 10px; font-size: 21px; }
p { color: var(--muted); line-height: 1.65; margin: 0 0 15px; }
.layout { display: grid; grid-template-columns: minmax(220px, .78fr) minmax(0, 1.2fr); gap: clamp(24px, 6vw, 82px); align-items: start; }
.intro { padding-top: 16px; }
.limits { margin: 30px 0 0; max-width: 300px; border-top: 1px solid var(--line); font-size: 14px; }
.limits div { display: flex; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.limits dt { color: var(--muted); }
.limits dd { margin: 0; font-variant-numeric: tabular-nums; }
.panel { background: var(--white); padding: clamp(18px, 4vw, 30px); border: 1px solid var(--line); border-radius: 17px; }
.field-label { display: block; font-size: 14px; font-weight: 660; margin-bottom: 8px; }
input:not([type="file"]), textarea { border: 1px solid #aebeb0; border-radius: 8px; padding: 11px 12px; background: #fff; color: var(--ink); width: 100%; font-size: 16px; }
textarea { display: block; min-height: 122px; resize: vertical; line-height: 1.5; }
.field-foot { text-align: right; margin: 7px 0 17px; color: var(--muted); font-size: 13px; }
.drop { border: 1px dashed #a2b4a6; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 9px; padding: 18px 12px; background: #f7faf7; border-radius: 12px; }
.drop[data-active="true"] { background: #ddece1; border-color: var(--green); }
.drop-help { color: var(--muted); font-size: 13px; }
.button { display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 8px; min-height: 42px; padding: 8px 14px; font-size: 14px; font-weight: 650; text-decoration: none; cursor: pointer; }
.button:disabled { opacity: .52; cursor: default; }
.primary { color: white; background: var(--green); }
.primary:hover:not(:disabled) { background: var(--green-dark); }
.secondary { background: var(--white); border-color: #aebeb0; color: var(--green-dark); }
.secondary:hover:not(:disabled) { background: var(--quiet); }
.file-button { position: relative; min-width: 127px; }
.file-button:focus-within { outline: 3px solid #438065; outline-offset: 3px; }
.file-button input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.queued { list-style: none; padding: 0; margin: 10px 0 0; }
.queued li { display: flex; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.queued strong { flex: 1; font-size: 14px; overflow-wrap: anywhere; }
.queued small { white-space: nowrap; color: var(--muted); }
.form-bottom { display: flex; align-items: center; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
#send-button { min-width: 100px; }
.progress-box { flex: 1; min-width: 140px; }
progress { display: block; width: 100%; height: 8px; margin-bottom: 4px; accent-color: var(--green); }
#progress-label { color: var(--muted); font-size: 13px; }
.feedback { margin: 10px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.feedback:empty { display: none; }
.feedback[data-tone="error"], .field-foot[data-tone="error"] { color: var(--bad); }
.feedback[data-tone="success"] { color: var(--green); }
.inbox-heading { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 18px; }
.auth-layout { display: flex; flex-wrap: wrap; gap: 15px; }
.auth-panel { flex: 1 1 280px; max-width: 480px; }
.auth-panel input { margin-bottom: 12px; }
.auth-panel .button { margin-right: 5px; margin-bottom: 5px; }
.pair-code { display: block; padding: 12px; text-align: center; font-size: clamp(18px, 5vw, 24px); letter-spacing: .07em; font-weight: 700; border-radius: 8px; background: var(--quiet); margin-bottom: 8px; }
.inventory:not([hidden]) { margin-top: 20px; }
.tools { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filters button { border-radius: 8px; min-height: 42px; border: 1px solid var(--line); padding: 7px 14px; background: white; color: var(--ink); cursor: pointer; }
.filters button[aria-pressed="true"] { border-color: var(--green); background: var(--green); color: white; }
.search { flex: 0 1 320px; }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.item { min-width: 0; background: white; border: 1px solid var(--line); border-radius: 12px; padding: 15px; display: flex; flex-direction: column; gap: 10px; }
.item h2, .preview h2 { font-size: 16px; margin: 0; overflow-wrap: anywhere; }
.item .meta { margin: 0; font-size: 13px; }
.item .excerpt { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; font-size: 14px; }
.item img { width: 100%; height: 156px; object-fit: contain; background: var(--paper); border-radius: 7px; }
.item-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; }
.more { margin-top: 14px; }
.preview { width: min(720px, calc(100% - 26px)); max-height: 90dvh; border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.preview::backdrop { background: #11291d9c; }
.preview-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 12px; }
.preview img { width: 100%; max-height: 68dvh; object-fit: contain; display: block; }
.preview pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; max-height: 68dvh; overflow: auto; margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 700px) {
  .layout { grid-template-columns: 1fr; gap: 22px; }
  .intro { padding-top: 0; }
  .limits { display: flex; flex-wrap: wrap; gap: 10px 14px; margin: 12px 0 0; max-width: none; border: 0; }
  .limits div { border: 0; padding: 0; gap: 5px; }
  .bar-inner, main { padding-left: 16px; padding-right: 16px; }
  .bar-inner { min-height: 64px; gap: 16px; }
  .search { flex: 1 1 220px; }
  .auth-panel { max-width: none; }
}
@media (max-width: 405px) {
  .bar-inner { padding-inline: 12px; gap: 8px; }
  .brand { font-size: 18px; gap: 6px; }
  .mark { width: 24px; height: 24px; font-size: 17px; }
  nav a { padding-inline: 7px; font-size: 13px; }
  .route { font-size: 12px; gap: 4px; }
}
