:root {
  --blue: #1668a7;
  --blue-light: #eaf3fa;
  --red: #c0392b;
  --green: #1e8449;
  --border: #d9dee3;
  --text: #23303b;
  --muted: #7a8791;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  font-family: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", sans-serif;
  color: var(--text);
  background: #f5f7f9;
}
header {
  display: flex; align-items: center; gap: 24px;
  background: var(--blue); color: #fff; padding: 10px 20px;
}
.brand { font-size: 20px; font-weight: 700; }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav a {
  color: #eaf3fa; text-decoration: none; padding: 6px 14px; border-radius: 6px;
  font-size: 15px;
}
nav a:hover, nav a.active { background: rgba(255,255,255,.18); color: #fff; }
main { max-width: 1200px; margin: 18px auto; padding: 0 16px; }
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 24px 0; }

.alert-banner {
  background: var(--red); color: #fff; padding: 10px 20px;
  display: flex; justify-content: space-between; align-items: center;
}
.alert-banner a { color: #fff; font-weight: 700; }

.card {
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 18px; margin-bottom: 16px;
}
h1 { font-size: 22px; margin: 4px 0 14px; }
h2 { font-size: 17px; margin: 0 0 10px; }

.search-row { display: flex; gap: 8px; flex-wrap: wrap; }
.search-row input[type="text"] {
  flex: 1; min-width: 240px; font-size: 17px; padding: 10px 14px;
  border: 2px solid var(--blue); border-radius: 8px;
}
button, .btn {
  font-size: 15px; padding: 9px 18px; border: 0; border-radius: 8px;
  background: var(--blue); color: #fff; cursor: pointer; text-decoration: none;
  display: inline-block;
}
button:hover, .btn:hover { filter: brightness(1.1); }
button.secondary, .btn.secondary { background: #5d6d7a; }
button.small { padding: 4px 10px; font-size: 13px; }
.hint { color: var(--muted); font-size: 13px; margin-top: 6px; }

.parsed-echo {
  margin-top: 10px; font-size: 14px; color: var(--muted);
}
.parsed-echo b { color: var(--blue); }

.stats-strip { display: flex; gap: 12px; flex-wrap: wrap; margin: 12px 0; }
.stat-box {
  background: var(--blue-light); border-radius: 8px; padding: 10px 16px;
  text-align: center; min-width: 110px;
}
.stat-box .num { font-size: 20px; font-weight: 700; color: var(--blue); }
.stat-box .lbl { font-size: 12px; color: var(--muted); }

table { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; }
th, td { border-bottom: 1px solid var(--border); padding: 8px 10px; text-align: left; }
th { background: var(--blue-light); white-space: nowrap; }
tr:hover td { background: #f2f8fd; }
td.num, th.num { text-align: right; white-space: nowrap; }
.price { color: var(--red); font-weight: 700; white-space: nowrap; }
.orig-price { color: var(--muted); text-decoration: line-through; font-size: 12px; }
.badge {
  display: inline-block; font-size: 12px; border-radius: 10px; padding: 1px 8px;
  background: #f39c12; color: #fff; margin-left: 4px; white-space: nowrap;
}
.badge.source { background: #7f8c9b; }
.badge.classic { background: #8e44ad; }
.badge.sold { background: var(--red); }
.badge.removed { background: #95a5a6; }
.muted { color: var(--muted); }
.desc-cell { max-width: 380px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.status-ok { color: var(--green); font-weight: 700; }
.status-bad { color: var(--red); font-weight: 700; }
.loading { color: var(--muted); padding: 18px; }
.pager { display: flex; gap: 8px; align-items: center; margin: 12px 0; }
input.inline { padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; }
form.inline-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
@media (max-width: 720px) {
  .desc-cell { max-width: 160px; }
  header { flex-direction: column; gap: 8px; }
}
