:root {
  --bg: #f4f6f9; --card: #fff; --ink: #1f2733; --muted: #6b7684;
  --line: #e3e8ef; --brand: #d70c18; --brand-d: #a80911;
  --green: #1a9d54; --yellow: #d99413; --red: #d13b3b;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "PingFang TC","Microsoft JhengHei","Noto Sans TC",system-ui,sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.6; }
a { color: var(--brand); text-decoration: none; }
.topbar { background: var(--brand); color: #fff; padding: 14px 24px; display: flex;
  justify-content: space-between; align-items: center; }
.topbar .brand { font-weight: 700; font-size: 18px; letter-spacing: .5px; }
.topbar a { color: #cfe0f5; margin-left: 16px; font-size: 14px; }
.topbar-nav { display: flex; align-items: center; gap: 18px; }
.topbar-links { display: flex; align-items: center; gap: 8px; }
.topbar-links a { background: rgba(255,255,255,.14); color: #fff; margin-left: 0;
  padding: 6px 14px; border-radius: 20px; font-weight: 600; font-size: 13px; }
.topbar-links a:hover { background: rgba(255,255,255,.26); }
.topbar-links a.active { background: #fff; color: var(--brand); }
.topbar-user { display: flex; align-items: center; gap: 14px; padding-left: 18px;
  border-left: 1px solid rgba(255,255,255,.3); }
.topbar-user a { margin-left: 0; }
.wrap { max-width: 960px; margin: 0 auto; padding: 28px 20px; }
.wrap.narrow { max-width: 640px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 24px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(20,40,80,.04); }
h1 { font-size: 24px; margin: 0 0 6px; }
h2 { font-size: 18px; margin: 0 0 14px; }
.sub { color: var(--muted); margin: 0 0 22px; }
label { display: block; font-size: 14px; font-weight: 600; margin: 14px 0 4px; }
input, select, textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 15px; font-family: inherit; background: #fff; }
textarea { min-height: 120px; resize: vertical; }
.btn { display: inline-block; background: var(--brand); color: #fff; border: 0;
  padding: 11px 20px; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--brand-d); }
.btn.ghost { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.btn.sm { padding: 7px 14px; font-size: 13px; }
.btn.warn { background: var(--red); }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 200px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hero { text-align: center; padding: 40px 20px; }
.hero h1 { font-size: 30px; }
.cta { display: flex; gap: 18px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }
.cta a { min-width: 200px; padding: 22px; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; text-align: center; font-size: 17px; font-weight: 600; }
.cta a.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px; text-align: center; }
.stat .n { font-size: 26px; font-weight: 700; }
.stat .l { font-size: 13px; color: var(--muted); }
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
th { background: #f0f4f9; color: var(--muted); font-weight: 600; }
tr:hover td { background: #fafcff; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.dot.green { background: var(--green); } .dot.yellow { background: var(--yellow); }
.dot.red { background: var(--red); } .dot.done { background: #9aa7b5; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px;
  font-weight: 600; background: #fbe7e8; color: var(--brand); }
.pill.major { background: #fdeaea; color: var(--red); }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 16px 22px; border-left: 2px solid var(--line); }
.timeline li:last-child { border-left-color: transparent; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 4px; width: 12px;
  height: 12px; border-radius: 50%; background: var(--brand); }
.timeline .t { font-size: 12px; color: var(--muted); }
.timeline .a { font-weight: 600; }
.flow { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.flow .step { padding: 5px 12px; border-radius: 20px; font-size: 13px; background: #eef2f7; color: var(--muted); }
.flow .step.active { background: var(--brand); color: #fff; }
.flow .step.past { background: #f5d1d3; color: var(--brand); }
.err { background: #fdeaea; color: var(--red); padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; }
.ok { background: #e7f6ec; color: var(--green); padding: 14px; border-radius: 8px; }
.meta { color: var(--muted); font-size: 13px; }
.divider { border-top: 1px solid var(--line); margin: 20px 0; }
.filters a { font-size: 13px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 20px;
  margin-right: 6px; color: var(--muted); }
.filters a.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.barrow { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px; }
.barlabel { width: 92px; flex-shrink: 0; color: var(--muted); }
.bartrack { flex: 1; background: #eef2f7; border-radius: 6px; height: 14px; overflow: hidden; }
.barfill { background: var(--brand); height: 100%; border-radius: 6px; }
.barfill.warn { background: var(--red); }
.barnum { width: 32px; text-align: right; font-weight: 600; }
.trend { display: flex; align-items: flex-end; gap: 6px; height: 84px; margin-bottom: 10px; }
.trendcol { display: flex; flex-direction: column; align-items: center; flex: 1; }
.trendbars { display: flex; align-items: flex-end; gap: 2px; height: 60px; }
.tbar { width: 7px; border-radius: 2px 2px 0 0; background: var(--line); }
.tbar.new { background: var(--brand); }
.tbar.closed { background: var(--muted); }
.trendday { font-size: 11px; color: var(--muted); margin-top: 4px; }
@media (max-width: 640px){ .stats{grid-template-columns:repeat(2,1fr);} .grid2{grid-template-columns:1fr;} }
