:root {
  --teal: #42bbc6; --teal-d: #2a9aa5; --teal-l: #e3f4f6;
  --orange: #f0591b; --orange-l: #fde9df;
  --green: #90c115; --green-l: #eef6d9;
  --gold: #ffc000; --gold-l: #fff4cc;
  --dk: #393939; --grey: #737373; --lgrey: #afafaf; --xlgrey: #e7e7e7; --bg: #f4f4f4; --white: #fff;
  --radius: 12px; --shadow: 0 2px 10px rgba(0,0,0,.06);
  font-family: -apple-system, "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--dk); font-family: inherit; font-size: 15px; line-height: 1.5; }
a { color: var(--teal-d); text-decoration: none; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.3; }
h1 { font-size: 22px; } h2 { font-size: 17px; color: var(--teal-d); } h3 { font-size: 15px; }
p { margin: 0 0 .6rem; }
.muted { color: var(--grey); font-size: 13px; }
.small { font-size: 12px; }
.todo { color: var(--orange); font-weight: 700; }
.topbar { background: var(--white); border-bottom: 1px solid var(--xlgrey); padding: 10px 18px; display: flex; align-items: center; gap: 14px; position: sticky; top: 0; z-index: 10; }
.topbar .brand { font-weight: 800; color: var(--teal-d); font-size: 16px; }
.topbar nav a { margin-right: 14px; font-size: 14px; color: var(--grey); }
.topbar nav a.active { color: var(--teal-d); font-weight: 700; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 18px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .g2, .g3, .g4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } .wrap { padding: 12px; } }
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card.pale { background: var(--teal-l); box-shadow: none; }
.card.warn { background: var(--gold-l); box-shadow: none; }
.tile { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.tile .v { font-size: 30px; font-weight: 800; color: var(--dk); line-height: 1.1; }
.tile .l { font-size: 12px; color: var(--grey); margin-top: 4px; }
.tile .d { font-size: 12px; margin-top: 6px; }
.up { color: var(--green); font-weight: 700; } .down { color: var(--orange); font-weight: 700; }
.btn { display: inline-block; border: 0; border-radius: 10px; padding: 9px 16px; font-size: 14px; font-weight: 700; cursor: pointer; background: var(--teal); color: #fff; font-family: inherit; }
.btn.orange { background: var(--orange); } .btn.green { background: var(--green); } .btn.grey { background: var(--xlgrey); color: var(--dk); } .btn.ghost { background: transparent; color: var(--teal-d); border: 1px solid var(--teal); }
.btn.sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.btn:disabled { opacity: .45; cursor: default; }
.pill { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; }
.pill.new { background: var(--orange-l); color: var(--orange); } .pill.accepted { background: var(--gold-l); color: #9a7200; } .pill.done { background: var(--green-l); color: #5c8000; } .pill.esc { background: #ffd9d9; color: #b00020; }
.pill.teal { background: var(--teal-l); color: var(--teal-d); } .pill.grey { background: var(--xlgrey); color: var(--grey); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--xlgrey); vertical-align: top; }
th { background: var(--dk); color: #fff; font-weight: 700; font-size: 12px; }
tr:hover td { background: #fafafa; }
input, select, textarea { font-family: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--xlgrey); border-radius: 8px; background: #fff; color: var(--dk); }
input[type=number] { width: 110px; }
label { font-size: 13px; color: var(--grey); display: block; margin-bottom: 3px; }
.field { margin-bottom: 10px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.bars { display: flex; flex-direction: column; gap: 6px; }
.bar { display: grid; grid-template-columns: 110px 1fr 40px; align-items: center; gap: 8px; font-size: 13px; }
.bar i { display: block; height: 14px; border-radius: 6px; background: var(--teal); min-width: 2px; }
.bar.o i { background: var(--orange); } .bar.g i { background: var(--green); } .bar.y i { background: var(--gold); } .bar.grey i { background: var(--lgrey); }
.hbars { display: flex; align-items: flex-end; gap: 3px; height: 90px; }
.hbars b { flex: 1; background: var(--teal); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.hbars b.hot { background: var(--orange); }
.hlabels { display: flex; gap: 3px; font-size: 9px; color: var(--grey); }
.hlabels span { flex: 1; text-align: center; }
.toast { position: fixed; right: 16px; bottom: 16px; background: var(--dk); color: #fff; padding: 12px 16px; border-radius: 10px; font-size: 13px; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: 340px; z-index: 50; opacity: 0; transform: translateY(10px); transition: .25s; }
.toast.show { opacity: 1; transform: none; }
.toast.esc { background: #b00020; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 4px 10px; font-size: 13px; }
.kv b { color: var(--grey); font-weight: 600; }
code { background: var(--bg); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.step { background: var(--teal-l); border-radius: 10px; padding: 12px; font-size: 13px; }
.step b { display: block; color: var(--teal-d); margin-bottom: 4px; }
@media (max-width: 700px) { .steps { grid-template-columns: 1fr 1fr; } }
