:root {
  --bg: #f6f2e8;
  --panel: #fffdf8;
  --line: #e8dcc8;
  --text: #1e1d19;
  --muted: #70695e;
  --brand: #0e6b5f;
  --brand-soft: #d8eee8;
  --accent: #bf6c2c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(14, 107, 95, 0.08), transparent 35%),
    linear-gradient(180deg, #fbf7f0 0%, var(--bg) 100%);
  color: var(--text);
}

a {
  color: var(--brand);
  text-decoration: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.35) 0, rgba(255, 255, 255, 0) 18%),
    radial-gradient(circle at 85% 12%, rgba(191, 108, 44, 0.08), transparent 18%);
}

.hero,
.panel,
.detail-page,
.top-nav-wrap,
.main-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
}

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

.main-shell {
  padding-bottom: 12px;
  position: relative;
  z-index: 1;
}

.hero {
  padding: 36px 0 24px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

h1, h2 {
  margin: 0;
}

.subtitle {
  color: var(--muted);
  max-width: 720px;
  line-height: 1.6;
}

.hero-metrics {
  display: flex;
  gap: 16px;
}

.metric,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(72, 53, 18, 0.05);
}

.metric {
  padding: 16px 18px;
  min-width: 160px;
}

.metric-label,
.meta-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.panel {
  padding: 18px;
  margin-bottom: 18px;
}

.top-nav {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  position: sticky;
  top: 12px;
  z-index: 5;
  backdrop-filter: blur(10px);
}

.top-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-weight: 600;
}

.top-nav-link.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.source-panel-head {
  margin-bottom: 18px;
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.source-group + .source-group {
  margin-top: 18px;
}

.source-group h3 {
  margin: 0 0 12px;
  font-size: 14px;
}

.source-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.8);
}

.source-card.active {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px rgba(14, 107, 95, 0.15);
}

.source-card-top,
.source-meta,
.source-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.source-meta {
  margin-top: 10px;
  align-items: start;
  flex-direction: column;
}

.source-actions {
  margin-top: 10px;
  justify-content: start;
  flex-wrap: wrap;
}

.source-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}

.source-status.green {
  background: var(--brand-soft);
  color: var(--brand);
}

.source-status.amber {
  background: #fff0df;
  color: var(--accent);
}

.source-status.muted {
  background: #efebe2;
  color: var(--muted);
}

.province-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f2ede2;
  color: #5e5649;
  font-size: 12px;
}

.filters,
.crawl-form,
.crawl-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: stretch;
}

input[type="text"],
input[type="number"],
select,
button,
.secondary,
.button-link {
  border-radius: 12px;
  border: 1px solid var(--line);
  min-height: 42px;
  padding: 0 14px;
  background: white;
  color: var(--text);
}

input[type="text"] {
  min-width: 280px;
  flex: 1 1 280px;
}

select {
  min-width: 148px;
  flex: 1 1 148px;
}

input[type="number"] {
  width: 110px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: end;
}

.filters input[type="text"] {
  grid-column: span 2;
}

.filters button,
.filters .secondary {
  justify-content: center;
  font-weight: 600;
}

button,
.button-link {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
  cursor: pointer;
}

.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f3efe6;
  color: var(--text);
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  min-height: 42px;
  padding: 0 4px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(232, 220, 200, 0.8);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1180px;
  table-layout: fixed;
}

.col-title {
  width: 37%;
}

.col-region {
  width: 10%;
}

.col-source {
  width: 8%;
}

.col-mode {
  width: 8%;
}

.col-review {
  width: 16%;
}

.col-status {
  width: 6%;
}

.col-publish,
.col-deadline {
  width: 10%;
}

.col-days,
.col-score,
.col-action {
  width: 4%;
}

th, td {
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  position: sticky;
  top: 0;
  background: #fbf7ef;
  z-index: 1;
}

.title-cell {
  min-width: 360px;
}

.region-cell,
.source-cell,
.mode-cell,
.status-cell,
.time-cell,
.days-cell,
.score-cell,
.action-cell {
  word-break: keep-all;
  overflow-wrap: normal;
}

.source-cell,
.mode-cell,
.status-cell,
.action-cell,
.days-cell,
.score-cell {
  text-align: center;
}

.mode-cell .tag,
.review-cell .tag,
.status-cell .tag {
  white-space: nowrap;
}

.mode-cell .muted-text,
.review-cell .muted-text,
.time-cell .muted-text {
  margin-top: 8px;
  line-height: 1.5;
}

.action-cell a {
  font-weight: 700;
  white-space: nowrap;
}

tbody tr:nth-child(odd) {
  background: rgba(255, 252, 245, 0.7);
}

tbody tr:hover {
  background: rgba(216, 238, 232, 0.35);
}

.title-cell a {
  display: inline-block;
  font-weight: 700;
  line-height: 1.5;
  color: #1f302d;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  margin-right: 6px;
}

.tag.amber {
  background: #fff0df;
  color: var(--accent);
}

.tag.green {
  background: var(--brand-soft);
  color: var(--brand);
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 32px 0;
}

.detail-page {
  padding: 24px 0 40px;
}

.back-link {
  display: inline-block;
  margin-bottom: 16px;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: start;
}

.detail-meta {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.meta-grid > div {
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(232, 220, 200, 0.9);
}

.content-box {
  margin: 0;
  line-height: 1.7;
  font-family: inherit;
  color: #352f27;
}

.rich-content p,
.rich-content ul,
.rich-content ol,
.rich-content table,
.rich-content blockquote,
.rich-content h1,
.rich-content h2,
.rich-content h3,
.rich-content h4 {
  margin: 0 0 14px;
}

.rich-content table {
  width: 100%;
  border-collapse: collapse;
}

.rich-content td,
.rich-content th {
  border: 1px solid var(--line);
  padding: 10px;
}

.rich-content ul,
.rich-content ol {
  padding-left: 22px;
}

.muted-text {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 900px) {
  .hero,
  .detail-header {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-metrics {
    width: 100%;
    flex-direction: column;
  }

  input[type="text"] {
    min-width: 100%;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .filters input[type="text"] {
    grid-column: span 1;
  }

  .top-nav {
    flex-direction: column;
    align-items: stretch;
    top: 0;
  }

  .top-nav-link {
    width: 100%;
  }

  .panel {
    padding: 14px;
  }

  th, td {
    font-size: 13px;
    padding: 12px 8px;
  }
}
