:root {
  --bg: #f6f1e8; --card: #fffdf8; --line: #e4dccd;
  --ink: #22312e; --ink-soft: #4d5b57;
  --accent: #b5532f; --accent-ink: #ffffff; --accent-soft: #f3dfd3;
  --deep: #22312e; --deep-ink: #f6f1e8;
  --ok: #2f6b4f; --ok-bg: #e5f0e8; --warn: #9a3b1c; --warn-bg: #f8e3d8; --mid: #8a6d1f; --mid-bg: #f5ecd2;
  --radius: 14px;
  --font-body: "Noto Sans TC", "PingFang TC", "Heiti TC", sans-serif;
  --font-head: "Noto Serif TC", "Songti TC", serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.65; -webkit-text-size-adjust: 100%; }
main { max-width: 720px; margin: 0 auto; padding: 0 16px 48px; }
[hidden] { display: none !important; }
a { color: var(--ink); }
.topbar { max-width: 720px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--font-head); font-weight: 700; font-size: 1.1rem; text-decoration: none; }
.nav-user { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--ink-soft); }
.nav-user span { max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-btn { background: none; border: 0; padding: 6px 4px; font: 600 .9rem var(--font-body); color: var(--accent); cursor: pointer; text-decoration: underline; }
.hero { background: var(--deep); color: var(--deep-ink); border-radius: 22px; padding: 26px 20px 20px; display: grid; gap: 14px; overflow: hidden; }
.hero h1 { font-family: var(--font-head); font-size: 1.9rem; line-height: 1.3; margin: 0; }
.hero p { margin: 8px 0 0; color: #d9d3c6; }
.hero .art { width: 100%; max-width: 280px; justify-self: center; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 20px; font: 700 1.02rem var(--font-body); border: 0; border-radius: 12px; background: var(--accent); color: var(--accent-ink); cursor: pointer; text-decoration: none; }
.btn.block { display: flex; width: 100%; margin-top: 12px; }
.btn.ghost { background: transparent; color: var(--deep-ink); border: 1.5px solid #6b7a76; }
.btn.light { background: var(--card); color: var(--ink); border: 1.5px solid var(--line); }
.btn.small { padding: 8px 12px; font-size: .9rem; border-radius: 10px; }
.btn.danger { background: var(--warn-bg); color: var(--warn); }
.btn[disabled] { opacity: .5; cursor: default; }
.points { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.points li { display: flex; gap: 10px; align-items: flex-start; font-size: .93rem; color: #e8e2d4; }
.points svg { flex: 0 0 20px; margin-top: 3px; color: #e9a98b; }
@media (min-width: 640px) { .hero { grid-template-columns: 1.15fr 1fr; align-items: center; padding: 34px 30px; } .hero h1 { font-size: 2.3rem; } }
.disclaimer { margin: 16px 0; padding: 12px 14px; border: 1.5px solid var(--warn); background: var(--warn-bg); color: var(--warn); border-radius: var(--radius); font-size: .92rem; display: flex; gap: 10px; align-items: flex-start; }
.disclaimer svg { flex: 0 0 20px; margin-top: 2px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-top: 14px; }
h2.sec { font-family: var(--font-head); font-size: 1.3rem; margin: 26px 0 0; }
h3 { font-family: var(--font-head); margin: 0 0 6px; font-size: 1.1rem; }
.drop { display: block; border: 2px dashed var(--line); border-radius: var(--radius); padding: 22px 14px; text-align: center; cursor: pointer; background: var(--bg); }
.drop strong { display: block; font-size: 1.05rem; }
.drop span { color: var(--ink-soft); font-size: .9rem; }
.drop svg { display: block; margin: 0 auto 8px; color: var(--accent); }
#preview { display: none; width: 100%; border-radius: 10px; margin-top: 12px; max-height: 360px; object-fit: contain; background: #000; }
.tips { margin: 10px 0 0; padding-left: 1.2em; color: var(--ink-soft); font-size: .9rem; }
#status, .msg { margin-top: 10px; font-size: .95rem; color: var(--ink-soft); min-height: 1.4em; }
.msg.err { color: var(--warn); font-weight: 600; }
.spinner { width: 18px; height: 18px; border: 3px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
label.f { display: block; font-size: .9rem; font-weight: 600; margin-top: 10px; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  display: block; width: 100%; margin-top: 4px; padding: 10px 12px; font: 400 1rem var(--font-body);
  color: #111827; background: #fff; border: 1.5px solid var(--line); border-radius: 10px;
}
textarea { min-height: 64px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
input[type=file].hidden { position: absolute; left: -9999px; }
#result { display: none; }
.verdict { border-radius: var(--radius); padding: 16px; }
.verdict.ok { background: var(--ok-bg); color: var(--ok); }
.verdict.pain { background: var(--warn-bg); color: var(--warn); }
.verdict.bad { background: var(--mid-bg); color: var(--mid); }
.verdict .score { font-family: var(--font-head); font-size: 2.4rem; line-height: 1.1; font-weight: 700; }
.verdict .score small { font-size: 1rem; font-weight: 600; }
.verdict h2 { margin: 6px 0 4px; font-size: 1.15rem; }
.verdict p { margin: 4px 0 0; color: var(--ink); }
.units { list-style: none; margin: 0; padding: 0; }
.units li { padding: 12px 0; border-top: 1px solid var(--line); }
.units li:first-child { border-top: 0; }
.u-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 700; }
.dots { display: flex; gap: 4px; }
.dots i { width: 22px; height: 8px; border-radius: 4px; background: var(--line); display: block; }
.dots i.on { background: var(--accent); }
.u-score { min-width: 3.4em; text-align: right; font-variant-numeric: tabular-nums; }
.u-reason { margin: 4px 0 0; color: var(--ink-soft); font-size: .93rem; }
.na { color: var(--ink-soft); font-weight: 500; font-size: .9rem; }
.note { color: var(--ink-soft); font-size: .88rem; margin: 10px 0 0; }
details summary { cursor: pointer; font-weight: 700; }
details table { width: 100%; border-collapse: collapse; font-size: .88rem; margin-top: 8px; }
details th, details td { border-top: 1px solid var(--line); padding: 6px 4px; text-align: left; vertical-align: top; }
footer { margin-top: 24px; font-size: .82rem; color: var(--ink-soft); }
footer a { color: var(--ink); }
.tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.tab { flex: 1; padding: 10px; font: 700 .98rem var(--font-body); background: var(--bg); border: 1.5px solid var(--line); border-radius: 10px; color: var(--ink-soft); cursor: pointer; }
.tab.on { background: var(--deep); color: var(--deep-ink); border-color: var(--deep); }
.or { text-align: center; color: var(--ink-soft); font-size: .85rem; margin: 12px 0 0; }
.btn.line { background: #06c755; color: #fff; }
.petlist { display: grid; gap: 10px; margin-top: 10px; }
.petitem { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; width: 100%; text-align: left; font: inherit; color: inherit; }
.petitem b { display: block; font-size: 1.05rem; }
.petitem small { color: var(--ink-soft); }
.avatar { border-radius: 50%; object-fit: cover; flex: 0 0 auto; background: var(--accent-soft); }
.avatar.ph { display: inline-flex; align-items: center; justify-content: center; color: var(--accent); }
.pethead { display: flex; gap: 14px; align-items: center; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.trend { width: 100%; height: auto; display: block; }
.rec { display: grid; grid-template-columns: 84px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.rec:first-child { border-top: 0; }
.rec img.ph { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; background: #000; }
.rec .big { font-family: var(--font-head); font-weight: 700; font-size: 1.25rem; }
.rec .big.pain { color: var(--warn); }
.rec .big.ok { color: var(--ok); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--ok-bg); color: var(--ok); margin-left: 6px; vertical-align: middle; }
.rec .meta { color: var(--ink-soft); font-size: .85rem; }
.rec .units-line { color: var(--ink-soft); font-size: .82rem; }
.sharebox { background: var(--bg); border: 1px dashed var(--line); border-radius: 10px; padding: 10px; font-size: .9rem; word-break: break-all; margin-top: 8px; }
.sharerow { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); font-size: .9rem; }
.legal { font-size: .85rem; color: var(--ink-soft); }
.powered { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 28px auto 0; padding: 12px; width: fit-content; color: var(--ink-soft); font-size: .85rem; text-decoration: none; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.powered img { height: 32px; width: auto; display: block; }
@media print { .powered { display: none; } }
@media (max-width: 639px) { .hero .art { order: -1; max-width: 150px; } .hero { padding-top: 18px; } .hero h1 { font-size: 1.7rem; } }
