/* 配色沿用第 4 小隊簡報的橄欖綠系 */
:root {
  --olive-900: #3f4129; --olive-700: #5d5f41; --olive-500: #83845f; --olive-300: #b1b28f; --olive-100: #e6e6d2;
  --cream: #f7f5ea; --card: #ffffff; --ink: #2b2c20; --muted: #6d6e5c; --line: #d9d9c4;
  --accent: #b8862b; --danger: #a8432f; --ok: #3d7a4a; --radius: 12px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 16px/1.65 "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif; }
a { color: var(--olive-700); }
h1 { font-size: 1.5rem; margin: 0 0 .75rem; } h2 { font-size: 1.15rem; margin: 1.25rem 0 .5rem; } h3 { font-size: 1rem; margin: 0 0 .35rem; }
p { margin: .4rem 0; }
.muted { color: var(--muted); } .small { font-size: .875rem; } .center { text-align: center; } .right { text-align: right; }
.num { font-variant-numeric: tabular-nums; }

#topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 1rem; padding: .6rem 1rem; background: var(--olive-700); color: #fff; flex-wrap: wrap; }
.brand { color: #fde9cf; font-weight: 700; text-decoration: none; font-size: 1.05rem; margin-right: auto; }
#nav { display: flex; gap: .25rem; flex-wrap: wrap; }
#nav a, #nav button { color: #fff; text-decoration: none; padding: .35rem .7rem; border-radius: 8px; font-size: .95rem; background: none; border: 0; cursor: pointer; font-family: inherit; }
#nav a.on, #nav a:hover, #nav button:hover { background: rgba(255,255,255,.18); }
.menu-btn { display: none; background: none; border: 0; color: #fff; font-size: 1.4rem; cursor: pointer; }
main { max-width: 1080px; margin: 0 auto; padding: 1.25rem 1rem 3rem; min-height: 70vh; }
footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 1rem; border-top: 1px solid var(--line); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: 1rem; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.cols { display: grid; gap: 1rem; grid-template-columns: 1.2fr 1fr; align-items: start; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.spread { display: flex; justify-content: space-between; gap: .75rem; align-items: center; flex-wrap: wrap; }

.item-card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; transition: transform .12s, box-shadow .12s; }
.item-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(63,65,41,.14); }
.item-card .body { padding: .7rem .8rem .8rem; }
.item-card h3 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb { aspect-ratio: 4/3; width: 100%; object-fit: cover; display: block; background: var(--olive-100); }
.thumb.ph { display: grid; place-items: center; font-size: 3rem; background: linear-gradient(135deg, var(--olive-300), var(--olive-100)); }
.price { color: var(--olive-900); font-weight: 700; font-size: 1.1rem; }

.badge { display: inline-block; padding: .05rem .55rem; border-radius: 999px; font-size: .78rem; background: var(--olive-100); color: var(--olive-900); white-space: nowrap; }
.badge.ok { background: #dcefe0; color: var(--ok); } .badge.warn { background: #f7e7c4; color: #7a5a12; } .badge.bad { background: #f5d9d2; color: var(--danger); } .badge.dark { background: var(--olive-700); color: #fff; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; margin: .6rem 0 1rem; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: .25rem .8rem; cursor: pointer; font: inherit; font-size: .9rem; color: var(--ink); }
.chip.on { background: var(--olive-700); border-color: var(--olive-700); color: #fff; }

label { display: block; font-size: .9rem; color: var(--muted); margin: .6rem 0 .2rem; }
input, select, textarea { width: 100%; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { min-height: 5rem; resize: vertical; }
input[type=checkbox] { width: auto; margin-right: .4rem; }
.check { display: flex; align-items: flex-start; color: var(--ink); }
.form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .8rem; }
.btn { display: inline-block; border: 0; border-radius: 8px; padding: .55rem 1.1rem; background: var(--olive-700); color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--olive-900); } .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--olive-700); border: 1px solid var(--olive-500); } .btn.ghost:hover { background: var(--olive-100); }
.btn.danger { background: var(--danger); } .btn.sm { padding: .3rem .7rem; font-size: .875rem; }
.msg { padding: .6rem .8rem; border-radius: 8px; margin: .6rem 0; background: #f7e7c4; color: #5c440d; font-size: .92rem; }
.msg.err { background: #f5d9d2; color: var(--danger); } .msg.ok { background: #dcefe0; color: #245231; }

table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: .45rem .5rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 600; white-space: nowrap; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-wrap { overflow-x: auto; }
.quote td { border: 0; padding: .2rem 0; } .quote tr.total td { border-top: 2px solid var(--olive-700); font-weight: 700; font-size: 1.1rem; padding-top: .5rem; }
.kpis { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 1rem; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; }
.kpi b { display: block; font-size: 1.5rem; color: var(--olive-900); font-variant-numeric: tabular-nums; } .kpi span { color: var(--muted); font-size: .85rem; }
.neg { color: var(--danger); } .pos { color: var(--ok); }

.timeline { list-style: none; margin: 0; padding: 0 0 0 1.1rem; border-left: 2px solid var(--olive-300); }
.timeline li { position: relative; padding: 0 0 .9rem .8rem; }
.timeline li::before { content: ""; position: absolute; left: -1.52rem; top: .45rem; width: .7rem; height: .7rem; border-radius: 50%; background: var(--olive-700); }
.steps { display: flex; gap: .25rem; flex-wrap: wrap; margin: .5rem 0 1rem; }
.steps span { padding: .15rem .6rem; border-radius: 999px; background: var(--olive-100); color: var(--muted); font-size: .8rem; }
.steps span.done { background: var(--olive-500); color: #fff; } .steps span.cur { background: var(--accent); color: #fff; font-weight: 700; }
.tabs { display: flex; gap: .3rem; border-bottom: 2px solid var(--line); margin-bottom: 1rem; flex-wrap: wrap; }
.tabs button { border: 0; background: none; padding: .5rem .9rem; font: inherit; cursor: pointer; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs button.on { color: var(--olive-900); font-weight: 700; border-bottom-color: var(--olive-700); }
.stars button { border: 0; background: none; font-size: 1.6rem; cursor: pointer; color: var(--line); padding: 0 .1rem; } .stars button.on { color: var(--accent); }
.auth { max-width: 420px; margin: 4vh auto 0; } .auth h1 { text-align: center; } .hero { text-align: center; color: var(--muted); margin-bottom: 1rem; }
.plan { text-align: center; } .plan b { font-size: 1.6rem; color: var(--olive-900); }
#toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); background: var(--olive-900); color: #fff; padding: .6rem 1.1rem; border-radius: 999px; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 90vw; z-index: 50; }
#toast.show { opacity: 1; }

@media (max-width: 760px) {
  .cols, .form-2 { grid-template-columns: 1fr; }
  .menu-btn { display: block; }
  #nav { display: none; width: 100%; flex-direction: column; } #nav.open { display: flex; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: .7rem; }
  h1 { font-size: 1.3rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
