:root {
  --bg: #fbfcfe;
  --surface: #ffffff;
  --surface-soft: #f6f8fc;
  --surface-blue: #f4f8ff;
  --text: #151922;
  --text-soft: #303846;
  --muted: #727b8b;
  --muted-light: #9aa3b2;
  --line: #e8edf4;
  --line-strong: #d8e0eb;
  --blue: #2f6fed;
  --blue-soft: #eaf2ff;
  --blue-text: #2258c7;
  --amber: #d88a17;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.page-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 26px 24px 64px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: #0f172a;
}

.brand-mark {
  display: block;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: cover;
}

.brand-name {
  font-size: 18px;
  font-weight: 760;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
}

.topnav a {
  border-radius: 999px;
  padding: 7px 12px;
}

.topnav a:hover {
  color: var(--blue-text);
  background: var(--surface-blue);
}

.layout {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.feed {
  min-width: 0;
}

.history-panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 16px 12px;
}

.history-panel-desktop {
  position: sticky;
  top: 24px;
}

.history-panel-mobile {
  display: none;
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 7px 12px;
}

.history-head strong {
  font-size: 15px;
}

.history-head span {
  color: var(--muted-light);
  font-size: 11px;
}

.history-group + .history-group {
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px solid var(--line);
}

.history-month {
  margin: 0 7px 5px;
  color: var(--muted-light);
  font-size: 11px;
  font-weight: 720;
}

.history-date-list {
  display: grid;
  gap: 2px;
}

.history-date {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 8px;
  color: var(--text-soft);
  font-size: 13px;
}

.history-date:hover {
  background: var(--surface-soft);
}

.history-date.active {
  background: var(--blue-soft);
  color: var(--blue-text);
  font-weight: 740;
}

.history-date small {
  color: inherit;
  font-size: 10px;
}

.history-more {
  display: inline-flex;
  margin: 12px 7px 0;
  color: var(--blue-text);
  font-size: 12px;
  font-weight: 720;
}

.hero-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 20px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue-text);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 3.2vw, 46px);
  line-height: 1.08;
  font-weight: 780;
  letter-spacing: 0;
}

.muted {
  color: var(--muted);
  line-height: 1.75;
}

.ghost-button,
.primary-button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 17px;
  border: 0;
  border-radius: 10px;
  background: var(--blue);
  color: white;
  font-weight: 720;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.ghost-button {
  background: var(--surface);
  color: var(--text-soft);
  border: 1px solid var(--line-strong);
}

.ghost-button:hover,
.primary-button:hover,
button:hover {
  transform: translateY(-1px);
}

.date-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.date-form label span {
  color: var(--muted);
  font-size: 12px;
}

.date-form input {
  width: 150px;
  min-height: 42px;
  background: var(--surface);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  font-weight: 680;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.filter-chip.active {
  background: var(--blue-soft);
  border-color: #c8dcff;
  color: var(--blue-text);
}

.filter-chip:hover {
  background: var(--surface);
  color: var(--text-soft);
}

.news-list {
  display: grid;
  gap: 12px;
}

.news-card,
.auth-card,
.table-card,
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.news-card {
  padding: 24px 26px 23px;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.news-card:hover {
  border-color: #cad6e6;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}

.card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 12px;
}

.category-badge {
  display: inline-flex;
  align-items: center;
  height: 23px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-blue);
  color: var(--blue-text);
  font-weight: 740;
}

.heat {
  color: var(--amber);
  font-weight: 740;
}

.news-card h2 {
  margin: 0 0 12px;
  font-size: 22px;
  line-height: 1.35;
  font-weight: 760;
  color: #101624;
}

.news-card p {
  margin: 0;
  max-width: 78ch;
  color: #3d4654;
  line-height: 1.85;
  font-size: 15.5px;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
  font-size: 14px;
  font-weight: 720;
  color: var(--blue-text);
}

.soft-link {
  color: var(--muted);
}

.auth-card {
  padding: 22px;
}

.stack {
  display: grid;
  gap: 14px;
}

label span {
  display: block;
  margin-bottom: 8px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 13px;
  background: var(--surface-soft);
  color: var(--text);
}

input:disabled {
  background: #f8fafc;
  color: #717b8a;
  opacity: 1;
}

input:focus {
  outline: 2px solid var(--blue-soft);
  border-color: #93c5fd;
}

.switch-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.switch-line input {
  width: 18px;
  min-height: 18px;
}

.switch-line span {
  margin: 0;
}

.login-link {
  display: inline-flex;
  margin-top: 16px;
  color: var(--blue-text);
  font-weight: 720;
}

.center-page {
  display: grid;
  place-items: center;
  min-height: 68vh;
}

.auth-card {
  width: min(480px, 100%);
}

.auth-card.wide {
  width: min(620px, 100%);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

button.secondary {
  background: var(--surface);
  color: var(--blue-text);
  border: 1px solid #c8dcff;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.hidden {
  display: none !important;
}

.subscribe-page {
  min-height: 72vh;
}

.subscribe-flow-card {
  max-width: 620px;
}

.subscribe-steps {
  display: flex;
  align-items: center;
  margin: 22px 0;
}

.subscribe-steps span {
  display: grid;
  place-items: center;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--muted-light);
  font-size: 12px;
  font-weight: 760;
}

.subscribe-steps span.active,
.subscribe-steps span.complete {
  background: var(--blue);
  color: white;
}

.subscribe-steps i {
  height: 2px;
  flex: 1;
  background: var(--line);
}

.verified-email {
  color: var(--muted);
  font-weight: 680;
}

.trust-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 20px;
  padding-top: 18px;
  margin-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.form-message {
  min-height: 24px;
  color: var(--blue-text);
  font-weight: 700;
}

.empty-state {
  padding: 32px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: var(--surface);
}

.admin-page {
  display: grid;
  gap: 20px;
}

.admin-access-page {
  min-height: 68vh;
}

.admin-access-card h1 {
  font-size: clamp(30px, 4vw, 40px);
}

.admin-access-card .muted {
  margin: 18px 0 24px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.stat-card {
  padding: 20px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.stat-card strong {
  font-size: 30px;
}

.table-card {
  padding: 20px;
  overflow-x: auto;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

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

th {
  color: var(--muted);
  font-weight: 800;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .history-panel-desktop {
    display: none;
  }

  .history-panel-mobile {
    display: block;
    padding: 12px;
    margin-bottom: 18px;
  }

  .history-panel-mobile .history-head {
    padding-bottom: 9px;
  }

  .history-panel-mobile .history-groups {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    padding-bottom: 4px;
  }

  .history-panel-mobile .history-group,
  .history-panel-mobile .history-date-list {
    display: contents;
  }

  .history-panel-mobile .history-month {
    display: none;
  }

  .history-panel-mobile .history-date {
    flex: 0 0 auto;
    min-height: 32px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 10px;
  }

  .history-panel-mobile .history-more {
    flex: 0 0 auto;
    margin: 0;
    white-space: nowrap;
  }

  .hero-row {
    display: grid;
  }

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

@media (max-width: 560px) {
  .page-shell {
    padding: 18px 14px 42px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topnav {
    width: 100%;
    justify-content: space-between;
  }

  h1 {
    font-size: 34px;
  }

  .news-card {
    padding: 20px;
  }

  .news-card h2 {
    font-size: 20px;
  }
}
