:root {
  color-scheme: light;
  --ink: #18212b;
  --muted: #65717f;
  --line: #dce3e5;
  --paper: #f7f4ef;
  --surface: #ffffff;
  --teal: #1f766f;
  --navy: #17324d;
  --amber: #d98b20;
  --red: #b7484d;
  --shadow: 0 20px 60px rgba(24, 33, 43, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, "Noto Sans HK",
    sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(247, 244, 239, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  background: var(--navy);
  color: #fff;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
}

.brand-title,
.brand-subtitle {
  display: block;
}

.brand-title {
  font-size: 15px;
  font-weight: 800;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 12px;
}

.top-nav {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.top-nav a {
  text-decoration: none;
}

.top-nav a:hover {
  color: var(--ink);
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
  min-height: calc(100vh - 74px);
  padding: 44px 0 36px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 12px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(38px, 7vw, 78px);
  line-height: 0.95;
  letter-spacing: 0;
}

.lede {
  max-width: 680px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 20px;
}

.market-panel {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #17324d;
  box-shadow: var(--shadow);
}

.market-panel canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 7 / 4;
}

.panel-tape {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(16, 26, 36, 0.88);
  color: #f7f4ef;
  font-size: 11px;
  font-weight: 800;
}

.panel-tape span {
  padding: 12px 8px;
  text-align: center;
}

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 30px 0 16px;
  border-top: 1px solid var(--line);
}

.toolbar h2,
.focus-band h2,
.empty-state h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.05;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
  max-width: 900px;
}

.search-label,
.select-label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

input,
select {
  width: min(320px, 78vw);
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #cad5d8;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

select {
  cursor: pointer;
}

input[type="date"] {
  width: 158px;
}

.view-toggle {
  display: inline-flex;
  align-self: end;
  min-height: 42px;
  padding: 3px;
  border: 1px solid #cad5d8;
  border-radius: 8px;
  background: #fff;
}

.toggle-button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.toggle-button.is-active {
  background: var(--navy);
  color: #fff;
}

.status-row {
  min-height: 30px;
  color: var(--muted);
  font-size: 14px;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 12px 0 52px;
}

.archive-panel {
  padding: 12px 0 52px;
}

.archive-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.archive-panel table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 13px;
}

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

.archive-panel th {
  background: #edf2ef;
  color: var(--navy);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.archive-panel td {
  color: var(--muted);
}

.archive-panel td:nth-child(2),
.archive-panel td:nth-child(3) {
  color: var(--ink);
  font-weight: 750;
}

.archive-panel a {
  color: var(--teal);
  text-decoration: none;
}

.archive-panel a:hover {
  text-decoration: underline;
}

.post-card {
  display: flex;
  min-height: 420px;
  flex-direction: column;
  gap: 16px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(24, 33, 43, 0.05);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.post-meta span,
.category-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid #d7dedf;
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.post-card h3 {
  margin: 0;
  font-size: 26px;
  line-height: 1.08;
}

.zh-title {
  margin: -6px 0 0;
  color: var(--teal);
  font-size: 18px;
  font-weight: 800;
}

.summary {
  margin: 0;
  color: #374452;
}

.zh-summary {
  color: var(--muted);
}

.takeaway-box {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  background: #f4f7f4;
  border-left: 4px solid var(--teal);
  border-radius: 8px;
}

.takeaway-box strong {
  color: var(--navy);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.takeaway-box p,
.disclaimer {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.disclaimer {
  padding-top: 4px;
  font-style: italic;
}

.insight-list {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 14px;
  margin: 0;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.insight-list dt {
  color: var(--navy);
  font-size: 12px;
  font-weight: 900;
}

.insight-list dd {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.post-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 16px;
}

.post-footer a {
  color: var(--teal);
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
}

.post-footer a:hover {
  text-decoration: underline;
}

.empty-state {
  margin: 20px 0 56px;
  padding: 42px;
  border: 1px dashed #b7c3c6;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
}

.empty-state p {
  color: var(--muted);
}

.focus-band {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.2fr);
  gap: 28px;
  padding: 44px 0;
  border-top: 1px solid var(--line);
}

.focus-grid {
  display: grid;
  gap: 12px;
}

.focus-grid article {
  padding: 18px;
  background: #ece8df;
  border-left: 5px solid var(--amber);
  border-radius: 8px;
}

.focus-grid article:nth-child(2) {
  border-left-color: var(--teal);
}

.focus-grid article:nth-child(3) {
  border-left-color: var(--red);
}

.focus-code {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.focus-grid h3 {
  margin: 4px 0 6px;
}

.focus-grid p,
.source-strip p {
  margin: 0;
  color: var(--muted);
}

.source-strip {
  padding: 20px 0 56px;
  border-top: 1px solid var(--line);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 22px clamp(18px, 4vw, 56px);
  background: var(--ink);
  color: #f7f4ef;
  font-size: 13px;
}

.site-footer p {
  margin: 0;
}

.admin-page {
  background: #eef2f1;
}

.admin-shell {
  width: min(1280px, calc(100% - 32px));
  padding: 34px 0 64px;
}

.admin-login,
.admin-workspace,
.queue-panel,
.editor-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(24, 33, 43, 0.05);
}

.admin-login {
  display: grid;
  gap: 16px;
  max-width: 520px;
  margin: 60px auto;
  padding: 26px;
}

.admin-login h1,
.admin-heading h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1;
}

.admin-login p {
  margin: 0;
  color: var(--muted);
}

.admin-login label,
.editor-panel label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

textarea {
  min-height: 90px;
  padding: 10px 12px;
  resize: vertical;
}

textarea,
.editor-panel input,
.editor-panel select,
.admin-login input {
  width: 100%;
  border: 1px solid #cad5d8;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.primary-button,
.secondary-button,
.danger-button,
.tab-button,
.queue-item {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.primary-button {
  background: var(--teal);
  color: #fff;
}

.secondary-button {
  background: #e8eeee;
  color: var(--ink);
  border-color: #c8d4d5;
}

.danger-button {
  background: #fff1f1;
  color: var(--red);
  border-color: #e4b8b8;
}

.form-message,
.status-line,
.muted {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.is-error {
  color: var(--red);
}

.admin-workspace {
  padding: clamp(18px, 3vw, 28px);
}

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

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.tab-button {
  padding: 0 14px;
  background: #fff;
  border-color: var(--line);
  color: var(--muted);
}

.tab-button.is-active {
  background: var(--navy);
  color: #fff;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.2fr);
  gap: 18px;
  align-items: start;
}

.queue-panel,
.editor-panel {
  padding: 18px;
}

.post-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.queue-item {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 13px;
  background: #f7f9f8;
  border-color: var(--line);
  color: var(--ink);
  text-align: left;
}

.queue-item span {
  color: var(--muted);
  font-size: 12px;
}

.queue-item.is-selected {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(31, 118, 111, 0.12);
}

.editor-panel form {
  display: grid;
  gap: 13px;
}

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.editor-actions button,
.admin-login button {
  padding: 0 16px;
}

@media (max-width: 860px) {
  .site-header,
  .toolbar,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .masthead,
  .focus-band {
    grid-template-columns: 1fr;
  }

  .masthead {
    min-height: auto;
  }

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

  .admin-heading,
  .admin-layout {
    grid-template-columns: 1fr;
  }

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

  .controls {
    width: 100%;
    justify-content: stretch;
  }

  .search-label,
  .select-label,
  input,
  select,
  input[type="date"],
  .view-toggle {
    width: 100%;
  }

  .toggle-button {
    flex: 1;
  }
}

@media (max-width: 560px) {
  main {
    width: min(100% - 24px, 1180px);
  }

  h1 {
    font-size: 42px;
  }

  .post-card {
    min-height: 0;
    padding: 18px;
  }

  .post-card h3 {
    font-size: 23px;
  }

  .insight-list {
    grid-template-columns: 1fr;
  }

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