:root,
html[data-theme="blue"] {
  --theme-bg: #f3f8fb;
  --theme-card: #fffefa;
  --theme-field: #fffefa;
  --theme-ink: #20313d;
  --theme-muted: #6b7d89;
  --theme-line: #c5ddeb;
  --theme-soft: #e9f4f8;
  --theme-accent: #8abfd6;
  --theme-accent-dark: #35677c;
  --theme-accent-soft: #dceff6;
  --theme-accent-contrast: #ffffff;
  --theme-gold: #b98a36;
  --theme-danger: #c86b62;
  --theme-shadow: none;
  --bg: var(--theme-bg);
  --paper: var(--theme-card);
  --ink: var(--theme-ink);
  --muted: var(--theme-muted);
  --line: var(--theme-line);
  --soft: var(--theme-soft);
  --soft-blue: var(--theme-accent-soft);
  --soft-yellow: #fff7e6;
  --soft-rose: #fff1f0;
  --teal: var(--theme-accent);
  --teal-dark: var(--theme-accent-dark);
  --gold: var(--theme-gold);
  --rust: var(--theme-danger);
  --blue: var(--theme-accent);
  --shadow: var(--theme-shadow);
}

html[data-theme="mono"] {
  --theme-bg: #f4f4ef;
  --theme-card: #fffefa;
  --theme-field: #fffefa;
  --theme-ink: #20201d;
  --theme-muted: #71716a;
  --theme-line: #d8d8ce;
  --theme-soft: #ecece5;
  --theme-accent: #464640;
  --theme-accent-dark: #20201d;
  --theme-accent-soft: #e3e3dc;
  --theme-accent-contrast: #ffffff;
  --theme-gold: #4a4a4a;
  --theme-danger: #333333;
  --theme-shadow: none;
}

html[data-theme="night"] {
  color-scheme: dark;
  --theme-bg: #101820;
  --theme-card: #172330;
  --theme-field: #111b26;
  --theme-ink: #eef5f7;
  --theme-muted: #9cadaf;
  --theme-line: #2b3c4c;
  --theme-soft: #1f2d3a;
  --theme-accent: #79a8bf;
  --theme-accent-dark: #a8d0df;
  --theme-accent-soft: #213d4d;
  --theme-accent-contrast: #101820;
  --theme-gold: #d6b16d;
  --theme-danger: #df8b83;
  --theme-shadow: none;
}

body {
  background: var(--theme-bg);
  color: var(--theme-ink);
}

.site-nav {
  flex-wrap: wrap;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.site-nav .nav-meta,
.site-nav span,
.eyebrow,
.open {
  color: var(--theme-accent-dark);
}

.site-nav a,
.button,
.filter,
.copy-button,
.style-option,
.calendar-select,
.quick-nav a,
.pill {
  background: var(--theme-field);
  border-color: var(--theme-line);
  color: var(--theme-ink);
}

.site-nav a:hover,
.site-nav a.active,
.button:hover,
.filter:hover,
.copy-button:hover,
.style-option:hover,
.quick-nav a:hover {
  border-color: color-mix(in srgb, var(--theme-accent) 44%, var(--theme-line));
  background: var(--theme-accent-soft);
  color: var(--theme-accent-dark);
}

.button.primary,
.filter.active,
.style-option.active {
  background: var(--theme-accent);
  border-color: var(--theme-accent);
  color: var(--theme-accent-contrast);
}

.button.primary:hover,
.filter.active:hover,
.style-option.active:hover {
  background: var(--theme-accent-dark);
  border-color: var(--theme-accent-dark);
  color: var(--theme-accent-contrast);
}

.theme-switcher {
  min-height: 44px;
  border: 1px solid var(--theme-line);
  border-radius: 6px;
  background: var(--theme-card);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
}

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

.theme-toggle:hover {
  background: var(--theme-soft);
  color: var(--theme-ink);
}

.theme-toggle.active {
  background: var(--theme-accent);
  color: var(--theme-accent-contrast);
}

.card,
.tool-lane,
.search,
.brief,
.metric,
.day-placeholder {
  background: var(--theme-card);
  border-color: var(--theme-line);
  box-shadow: var(--theme-shadow);
}

.soft,
.soft-blue,
.soft-yellow,
.soft-rose,
.lane-head,
.mini-day.disabled,
.wechat-preview-shell,
.qr-box,
.take {
  background: var(--theme-soft);
}

.tool-card,
.mini-day {
  background: var(--theme-card);
  border-color: var(--theme-line);
  color: var(--theme-ink);
}

.tool-card:hover,
.card:hover {
  border-color: color-mix(in srgb, var(--theme-accent) 38%, var(--theme-line));
}

.mini-day:hover,
.mini-day.has-entry {
  background: var(--theme-accent-soft);
  border-color: color-mix(in srgb, var(--theme-accent) 54%, var(--theme-line));
  color: var(--theme-accent-dark);
}

.calendar-layout.calendar-only .mini-day.empty,
.mini-day.empty {
  background: var(--theme-soft);
  border-color: var(--theme-line);
}

.mini-day.has-holiday {
  background: color-mix(in srgb, var(--theme-card) 76%, var(--theme-danger));
  border-color: color-mix(in srgb, var(--theme-danger) 42%, var(--theme-line));
}

.mini-day.is-today {
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--theme-gold) 72%, transparent);
}

.day-number,
.list-row strong,
.tool-card h3,
.lane-head h2,
.metric strong,
h1,
h2,
h3 {
  color: var(--theme-ink);
}

.lede,
.bio,
.tool-card p,
.list-row span,
.copy-status,
.calendar-caption,
.subtitle,
.note,
.source,
.take,
.brand span,
.tag,
.site-footer,
.site-footer a {
  color: var(--theme-muted);
}

.search input,
.field,
.md-input,
textarea,
input,
select {
  background: var(--theme-field);
  border-color: var(--theme-line);
  color: var(--theme-ink);
}

.day-chip {
  background: var(--theme-soft);
  color: var(--theme-muted);
}

.day-chip.holiday {
  background: color-mix(in srgb, var(--theme-danger) 18%, var(--theme-card));
  color: var(--theme-danger);
}

.day-chip.briefing {
  background: var(--theme-accent-soft);
  color: var(--theme-accent-dark);
}

.day-chip.daily {
  background: var(--theme-soft);
  color: var(--theme-muted);
}

.day-chip.briefing.book {
  background: color-mix(in srgb, var(--theme-gold) 18%, var(--theme-card));
  color: color-mix(in srgb, var(--theme-gold) 76%, var(--theme-ink));
}

.day-chip.briefing.tech {
  background: var(--theme-accent-soft);
  color: var(--theme-accent-dark);
}

.holiday-legend span {
  background: var(--theme-field);
  border-color: var(--theme-line);
  color: var(--theme-muted);
}

.legend-dot.holiday { background: var(--theme-danger); }
.legend-dot.briefing { background: var(--theme-accent); }
.legend-dot.briefing.tech { background: var(--theme-accent); }
.legend-dot.briefing.book { background: var(--theme-gold); }
.legend-dot.today { background: var(--theme-gold); }

.tech-calendar-page .mini-weekdays .week-col,
.mini-week-number {
  color: var(--theme-accent-dark);
}

.mini-week-number {
  background: color-mix(in srgb, var(--theme-accent) 16%, var(--theme-card));
  border-color: color-mix(in srgb, var(--theme-accent) 38%, var(--theme-line));
}

.site-footer,
.page-head,
header,
.source,
.list-row {
  border-color: var(--theme-line);
}

a {
  color: var(--theme-accent-dark);
}

html[data-theme="night"] .wechat-preview {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .05);
}

html[data-theme="blue"] .site-nav a.active,
html[data-theme="blue"] .site-nav a:hover {
  background: var(--theme-accent);
  border-color: var(--theme-accent);
  color: #20313d;
}

html[data-theme="blue"] .page-head {
  border: 1px solid var(--theme-line);
  border-left: 12px solid var(--theme-accent);
  border-radius: 10px;
  background: #fffefa;
  color: var(--theme-ink);
  padding: 28px 30px;
  box-shadow: none;
}

html[data-theme="blue"] .page-head h1,
html[data-theme="blue"] .page-head .eyebrow,
html[data-theme="blue"] .page-head .lede {
  color: var(--theme-ink);
}

html[data-theme="blue"] .page-head .button,
html[data-theme="blue"] .page-head .copy-button {
  background: var(--theme-accent-soft);
  border-color: var(--theme-line);
  color: var(--theme-accent-dark);
}

html[data-theme="blue"] .card,
html[data-theme="blue"] .tool-lane,
html[data-theme="blue"] .brief {
  border-color: var(--theme-line);
}

html[data-theme="blue"] .lane-head,
html[data-theme="blue"] .calendar-top {
  border: 1px solid var(--theme-line);
  border-left: 10px solid var(--theme-accent);
  border-radius: 10px;
  background: #fffefa;
  color: var(--theme-ink);
  padding: 20px;
  box-shadow: none;
}

html[data-theme="blue"] .lane-head h2,
html[data-theme="blue"] .lane-head span,
html[data-theme="blue"] .calendar-top h1,
html[data-theme="blue"] .calendar-top h2,
html[data-theme="blue"] .calendar-top .eyebrow,
html[data-theme="blue"] .calendar-caption {
  color: var(--theme-ink);
}

html[data-theme="blue"] .calendar-top .button,
html[data-theme="blue"] .calendar-top .calendar-select {
  background: var(--theme-field);
  border-color: var(--theme-line);
  color: var(--theme-ink);
}

html[data-theme="blue"] .calendar-top .button.primary {
  background: var(--theme-accent-dark);
  border-color: var(--theme-accent-dark);
  color: #fffefa;
}

html[data-theme="blue"] .style-card {
  border-color: var(--theme-line);
  box-shadow: none;
}

html[data-theme="blue"] .style-option.active,
html[data-theme="blue"] .button.primary,
html[data-theme="blue"] .theme-toggle.active {
  background: var(--theme-accent);
  border-color: var(--theme-accent);
  color: #20313d;
}

html[data-theme="blue"] .tool-card {
  border-left-color: var(--theme-accent);
}

html[data-theme="blue"] .metric strong,
html[data-theme="blue"] .surname,
html[data-theme="blue"] .brand-mark,
html[data-theme="blue"] .open,
html[data-theme="blue"] .eyebrow {
  color: var(--theme-accent-dark);
}

html[data-theme="blue"] .theme-switcher {
  background: var(--theme-soft);
  border-color: var(--theme-line);
}

html[data-theme="blue"] .card,
html[data-theme="blue"] .tool-lane {
  border: 1px solid var(--theme-line);
  border-top: 4px solid var(--theme-accent);
  border-radius: 10px;
  box-shadow: none;
}

html[data-theme="blue"] .metric,
html[data-theme="blue"] .mini-day,
html[data-theme="blue"] .tool-card {
  border-radius: 8px;
}

html[data-theme="blue"] .site-nav a,
html[data-theme="blue"] .button,
html[data-theme="blue"] .copy-button,
html[data-theme="blue"] .style-option,
html[data-theme="blue"] .calendar-select,
html[data-theme="blue"] .pill,
html[data-theme="blue"] .mini-day,
html[data-theme="blue"] .theme-switcher,
html[data-theme="blue"] .holiday-legend span {
  border-width: 1px;
  border-radius: 8px;
}

html[data-theme="blue"] .soft,
html[data-theme="blue"] .soft-blue,
html[data-theme="blue"] .soft-yellow,
html[data-theme="blue"] .soft-rose,
html[data-theme="blue"] .wechat-preview-shell,
html[data-theme="blue"] .qr-box,
html[data-theme="blue"] .take {
  background: var(--theme-soft);
}

html[data-theme="blue"] .metric,
html[data-theme="blue"] .mini-day.empty {
  background: var(--theme-soft);
}

html[data-theme="blue"] .mini-day.has-entry {
  background: var(--theme-accent-soft);
  border-color: #d7a642;
}

html[data-theme="blue"] .mini-day.has-holiday {
  background: #fff0ee;
  border-color: var(--theme-danger);
}

html[data-theme="blue"] .day-chip.briefing {
  background: #eef8fc;
  color: var(--theme-accent-dark);
}

html[data-theme="blue"] .day-chip.holiday {
  background: #fff0ee;
  color: #a84b44;
}

@media (max-width: 720px) {
  .theme-switcher {
    width: 100%;
    justify-content: space-between;
  }

  .theme-toggle {
    flex: 1;
  }
}
