:root {
  color-scheme: light;
  --ink: #243034;
  --muted: #68777d;
  --line: #d9e1e4;
  --paper: #ffffff;
  --soft: #f4f7f6;
  --brand: #1f6f8b;
  --brand-dark: #144d61;
  --warm: #b85c38;
  --green: #3f7c53;
  --gold: #c6922e;
  --blue-soft: #e7f2f5;
  --warm-soft: #fff1ea;
  --green-soft: #edf6ef;
  --gold-soft: #fff7df;
  --danger: #9f3232;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--soft);
  font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  line-height: 1.65;
}

a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { letter-spacing: 0; margin-top: 0; }
h1 { color: var(--brand-dark); font-size: clamp(30px, 4vw, 44px); line-height: 1.15; margin-bottom: 8px; }
h2 { color: var(--brand-dark); font-size: 22px; margin-bottom: 12px; }
h3 { color: var(--ink); font-size: 18px; margin-bottom: 8px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
}

.side-nav {
  background: var(--brand-dark);
  color: #fff;
  padding: 26px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 900;
  margin-bottom: 28px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--brand-dark);
  font-weight: 900;
}

.side-nav a {
  display: flex;
  align-items: center;
  min-height: 40px;
  border-radius: 8px;
  padding: 8px 12px;
  color: #d7e7eb;
  margin-bottom: 7px;
}

.side-nav a.active,
.side-nav a:hover {
  color: #fff;
  background: var(--brand);
  text-decoration: none;
}

.main-area { min-width: 0; }

.public-topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}

.public-nav {
  max-width: 1120px;
  margin: 0 auto;
  min-height: 70px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.public-nav .brand { color: var(--brand-dark); margin: 0; }
.public-nav .brand-mark { background: var(--brand); color: #fff; }

.nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.nav-links a {
  min-height: 34px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 6px 10px;
}
.nav-links a.active { background: var(--blue-soft); color: var(--brand-dark); }

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 30px 20px 56px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 18px;
}

.notice {
  border: 1px solid #cfe1e7;
  background: var(--blue-soft);
  color: var(--brand-dark);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.grid.two { grid-template-columns: minmax(0, 1.15fr) minmax(330px, .85fr); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.section-row { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; margin-top: 22px; align-items: start; }

.panel,
.metric,
.list-card,
.source-card,
.article-shell,
.war-room-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.panel { padding: 18px; }

.metric {
  padding: 18px;
  min-height: 112px;
}
.metric strong { display: block; margin-top: 8px; color: var(--brand-dark); font-size: 42px; line-height: 1; }
.metric.warm { background: var(--warm-soft); }
.metric.green { background: var(--green-soft); }
.metric.gold { background: var(--gold-soft); }

.list { display: grid; gap: 12px; }
.list-card,
.source-card {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.source-card.compact { align-items: flex-start; }
.list-card p, .source-card p { color: var(--muted); margin-bottom: 0; }
.list-main { min-width: 0; }
.list-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.meta-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.tag,
.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 14px;
  padding: 4px 10px;
  font-size: 13px;
  background: var(--blue-soft);
  color: var(--brand-dark);
}
.tag.warm { background: var(--warm-soft); color: var(--warm); }
.status.draft { background: var(--warm-soft); color: var(--warm); }
.status.published { background: var(--green-soft); color: var(--green); }
.status.archived { background: #eceff1; color: #59656a; }

.button,
button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 8px 12px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}
.button.primary, button.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 800; }
.button.ghost, button.ghost { background: #fff; }
.button.danger, button.danger { border-color: #efc4c4; color: var(--danger); background: #fff7f7; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }

.empty { border: 1px dashed #c8d2d6; border-radius: 8px; padding: 18px; color: var(--muted); background: #fff; }

.review-top {
  background: var(--warm-soft);
  border: 1px solid #ffd6c3;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 18px;
}
.review-note {
  background: var(--warm-soft);
  border: 1px solid #ffd6c3;
  border-radius: 8px;
  padding: 12px;
  color: #744022;
  margin-bottom: 14px;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: grid; gap: 7px; margin-bottom: 14px; }
label { color: var(--brand-dark); font-size: 14px; font-weight: 800; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 10px 12px;
}
textarea { min-height: 92px; resize: vertical; }
textarea.body { min-height: 300px; }
textarea.post { min-height: 126px; }
textarea.panel-text { min-height: 90px; }

.share-block { display: grid; gap: 12px; }
.share-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.public-page { background: #fbfaf6; min-height: 100vh; }
.article-layout {
  max-width: 1120px;
  margin: 0 auto;
  padding: 42px 20px 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 28px;
  align-items: start;
}
.article-shell { padding: 38px 42px; }
.article-body { font-size: 17px; }
.article-body h2 { margin-top: 28px; }
.article-body ul { padding-left: 22px; }
.source-box {
  background: var(--warm-soft);
  border: 1px solid #ffd6c3;
  border-radius: 8px;
  padding: 14px;
  margin: 24px 0;
}
.reader-side { position: sticky; top: 92px; display: grid; gap: 14px; }
.reader-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.extension-section {
  margin-top: 28px;
  border-top: 1px solid var(--line);
  padding-top: 26px;
}
.section-title { display: flex; justify-content: space-between; gap: 14px; align-items: start; }
.comic-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.comic-panel {
  min-height: 145px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}
.comic-panel span {
  width: 28px;
  height: 28px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--brand);
  font-weight: 900;
  margin-bottom: 10px;
}
.comic-panel.gold { background: var(--gold-soft); }
.comic-panel.green { background: var(--green-soft); }
.comic-panel.blue { background: var(--blue-soft); }
.comic-panel.warm { background: var(--warm-soft); }
.joke-box {
  margin-top: 14px;
  background: var(--gold-soft);
  border: 1px solid #efd58e;
  border-radius: 8px;
  padding: 16px;
}

.footer { padding: 22px 20px; text-align: center; border-top: 1px solid var(--line); background: #fff; color: var(--muted); }

@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .side-nav { position: static; height: auto; display: block; }
  .side-nav a { display: inline-flex; margin-right: 6px; }
  .grid, .grid.two, .grid.three, .section-row, .form-grid, .article-layout, .comic-grid { grid-template-columns: 1fr; }
  .page-head, .list-card, .source-card { align-items: flex-start; flex-direction: column; }
  .article-shell { padding: 24px 18px; }
  .reader-side { position: static; }
}
