:root { --red:#851116; --ink:#1A1A1A; --line:#e4e0dc; --bg:#f6f4f1; font-family: -apple-system, "PingFang TC", "Noto Sans TC", sans-serif; color:var(--ink); }
* { box-sizing:border-box; -webkit-tap-highlight-color: transparent; }
html,body { margin:0; background:var(--bg); }
body { padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
button, input, a.btn { font: inherit; }
.topbar { position:sticky; top:0; z-index:5; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 20px; background:#fff; border-bottom:1px solid var(--line); }
.topbar h1 { font-size:22px; margin:0; letter-spacing:.05em; }
.topbar h1::before { content:""; display:inline-block; width:6px; height:22px; background:var(--red); margin-right:10px; vertical-align:-3px; }
.actions { display:flex; gap:10px; }
.btn { min-height:52px; padding:0 20px; border-radius:12px; border:1.5px solid #cfc8c2; background:#fff; color:var(--ink); font-size:18px; display:inline-flex; align-items:center; justify-content:center; text-decoration:none; cursor:pointer; touch-action:manipulation; }
.btn:active { transform: scale(.97); }
.btn.primary { background:var(--red); border-color:var(--red); color:#fff; font-weight:600; }
.btn.ghost { background:transparent; }
.btn.danger { color:var(--red); border-color:#e1b8ba; }
.btn.small { min-height:48px; padding:0 14px; font-size:17px; }
.btn:disabled { opacity:.5; }
.layout { display:grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap:20px; padding:20px; align-items:start; }
.preview-pane { position:sticky; top:96px; }
.paper { background:#fff; box-shadow:0 2px 14px rgba(0,0,0,.12); border-radius:4px; overflow:hidden; }
#preview { width:100%; height:auto; display:block; aspect-ratio: 210 / 277; }
.hint { color:#7a716b; font-size:14px; margin:8px 2px; }
.warn { background:#fff3f3; border:1.5px solid var(--red); color:var(--red); padding:10px 14px; border-radius:10px; margin-bottom:10px; font-size:16px; }
.list-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.list-head h2 { margin:0; font-size:20px; }
#count { color:#7a716b; font-weight:400; font-size:16px; }
.list { list-style:none; padding:0; margin:0 0 16px; display:flex; flex-direction:column; gap:10px; }
.card { background:#fff; border:1px solid var(--line); border-radius:14px; display:flex; align-items:stretch; overflow:hidden; }
.card.flash { outline: 3px solid var(--red); }
.card .main { flex:1; min-width:0; padding:12px 14px; text-align:left; background:none; border:0; cursor:pointer; min-height:72px; }
.card .zh { font-size:17px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.card .sub { font-size:14px; color:#6d655f; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:3px; }
.card .src { font-size:13px; color:var(--red); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:2px; }
.card .price { font-variant-numeric: tabular-nums; font-size:17px; padding:0 8px; display:flex; flex-direction:column; justify-content:center; align-items:flex-end; color:var(--ink); min-width:64px; }
.card .price small { font-size:13px; color:#6d655f; }
.card .tools { display:flex; border-left:1px solid var(--line); }
.card .tools button { width:56px; border:0; border-left:1px solid var(--line); background:#faf8f6; font-size:22px; cursor:pointer; color:var(--ink); }
.card .tools button:first-child { border-left:0; }
.card .tools button:disabled { color:#ccc; }
.card .tools .del { color:var(--red); font-size:18px; }
.sheet { position:fixed; top:0; right:0; width:min(620px, 58vw); z-index:20; background:#fff; border-radius:0 0 0 18px; box-shadow:0 8px 30px rgba(0,0,0,.25); display:flex; flex-direction:column; max-height:100vh; }
.sheet[hidden] { display:none; }
.sheet-head { display:flex; align-items:center; gap:8px; padding:10px 12px; border-bottom:1px solid var(--line); }
.sheet-head strong { flex:1; text-align:center; font-size:18px; }
.sheet-body { overflow:auto; padding:12px 16px 18px; display:flex; flex-direction:column; gap:12px; overscroll-behavior:contain; }
.sheet-body label { display:flex; flex-direction:column; gap:6px; font-size:15px; color:#5b534d; }
.sheet-body input { font-size:19px; min-height:54px; padding:0 14px; border:1.5px solid #cfc8c2; border-radius:10px; color:var(--ink); background:#fff; width:100%; scroll-margin: 16px; }
.sheet-body input:focus { outline:none; border-color:var(--red); box-shadow:0 0 0 3px rgba(133,17,22,.15); }
.red-label { color:var(--red) !important; }
.row2 { display:grid; grid-template-columns: 1fr 1fr; gap:12px; }
.chips { display:flex; flex-wrap:wrap; gap:8px; margin-top:-4px; }
.chips button { min-height:46px; padding:0 16px; border-radius:23px; border:1.5px solid #cfc8c2; background:#fff; font-size:17px; cursor:pointer; }
.chips button.on { background:var(--red); color:#fff; border-color:var(--red); }
.modal { position:fixed; inset:0; z-index:30; background:rgba(0,0,0,.45); display:flex; align-items:center; justify-content:center; padding:20px; }
.modal[hidden] { display:none; }
.modal-card { background:#fff; border-radius:18px; padding:20px; width:min(520px, 100%); text-align:center; }
.modal-card h3 { margin:0 0 12px; }
.modal-card img { max-width:100%; max-height:50vh; box-shadow:0 1px 8px rgba(0,0,0,.2); }
.modal-actions { display:flex; flex-direction:column; gap:10px; margin-top:12px; }
.loading { position:fixed; left:50%; bottom:24px; transform:translateX(-50%); background:#333; color:#fff; padding:12px 20px; border-radius:24px; font-size:16px; z-index:40; }
.loading[hidden] { display:none; }
@media (max-width: 760px) { .layout { grid-template-columns: 1fr; } .preview-pane { position:static; } .sheet { width:100vw; border-radius:0 0 18px 18px; } }
