* { box-sizing: border-box; }
:root {
  --primary: #1f6feb;
  --bg: #f6f8fa;
  --card: #ffffff;
  --text: #1f2328;
  --muted: #656d76;
  --border: #d0d7de;
  --ok: #1a7f37;
  --warn: #bf8700;
  --err: #cf222e;
}
html, body { margin: 0; padding: 0; height: 100%; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Microsoft JhengHei", sans-serif; background: var(--bg); color: var(--text); }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar h1 { margin: 0; font-size: 18px; }
.status { font-size: 12px; color: var(--muted); }
.tabs { display: flex; background: var(--card); border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab { flex: 1; min-width: 80px; padding: 12px 8px; border: none; background: none; font-size: 14px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
main { padding: 16px; max-width: 720px; margin: 0 auto; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }
.hint { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.capture-card { display: block; border: 2px dashed var(--primary); border-radius: 12px; padding: 32px 16px; text-align: center; background: var(--card); cursor: pointer; }
.capture-card input[type=file] { display: none; }
.capture-icon { font-size: 48px; }
.capture-text { margin-top: 8px; color: var(--primary); font-weight: 600; }
.preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-top: 12px; }
.preview-grid img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.form-row { margin: 12px 0; }
.form-row label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.form-row input, .form-row select { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; }
.inline { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline input { flex: 1; min-width: 80px; }
.primary-btn { width: 100%; margin-top: 12px; padding: 12px; background: var(--primary); color: #fff; border: none; border-radius: 8px; font-size: 16px; cursor: pointer; }
.primary-btn:disabled { background: #94a3b8; cursor: not-allowed; }
button { padding: 8px 12px; border: 1px solid var(--border); background: var(--card); border-radius: 6px; cursor: pointer; font-size: 14px; }
button:hover:not(:disabled) { background: #f0f3f6; }
.progress { font-size: 13px; color: var(--muted); margin-top: 8px; min-height: 18px; }
.empty { padding: 32px; text-align: center; color: var(--muted); background: var(--card); border: 1px dashed var(--border); border-radius: 8px; }
.preview-pane { margin-top: 16px; background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 16px; font-size: 14px; white-space: pre-wrap; }
.entry-card { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-bottom: 12px; }
.entry-card h3 { margin: 0 0 8px; font-size: 15px; }
.entry-row { display: grid; grid-template-columns: 90px 1fr; gap: 4px 8px; font-size: 13px; margin-bottom: 6px; }
.entry-row label { color: var(--muted); }
.entry-row input { padding: 4px 6px; border: 1px solid var(--border); border-radius: 4px; font-size: 13px; }
.muted { color: var(--muted); font-size: 12px; margin-top: 4px; }
.result { background: #0d1117; color: #c9d1d9; padding: 8px; border-radius: 6px; font-size: 12px; min-height: 18px; }
code { background: #eef0f3; padding: 2px 6px; border-radius: 4px; font-size: 13px; }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 24px 16px; }
.confidence-low { background: #fff8c5; }
.confidence-medium { background: #fff8c5; opacity: 0.5; }
