/* Editorial Deep Reading Design System */
:root,
[data-theme="paper"] {
  --bg: #FAF8F4;
  --surface: #FFFFFF;
  --surface-subtle: #F3EFE7;
  --text: #1E1D1A;
  --text-secondary: #625D54;
  --text-muted: #8C867B;
  --border: #E8E2D6;
  --border-strong: #D6CEBE;
  --accent: #B45309;
  --accent-soft: #FEF3C7;
  --accent-hover: #92400E;
  --shadow-sm: 0 1px 3px rgba(28, 25, 23, 0.05);
  --shadow-md: 0 8px 28px rgba(28, 25, 23, 0.08);
  --code-bg: #F3EFE7;
  --quote-bg: #F7F4EC;
  --cat-ai: #4338CA;
  --cat-business: #B45309;
  --cat-hr: #047857;
  --cat-finance: #9F1239;
  --theme-dot: #F5EFE6;
}

[data-theme="sepia"] {
  --bg: #F3EBD8;
  --surface: #FAF4E6;
  --surface-subtle: #EAE0C8;
  --text: #2B2318;
  --text-secondary: #6B5C47;
  --text-muted: #8E7D63;
  --border: #DFD2B6;
  --border-strong: #CAB998;
  --accent: #9A3412;
  --accent-soft: #FDE6CC;
  --accent-hover: #7C2D12;
  --shadow-sm: 0 1px 3px rgba(43, 35, 24, 0.06);
  --shadow-md: 0 8px 28px rgba(43, 35, 24, 0.1);
  --code-bg: #EAE0C8;
  --quote-bg: #EFE5CF;
  --cat-ai: #3730A3;
  --cat-business: #9A3412;
  --cat-hr: #065F46;
  --cat-finance: #881337;
  --theme-dot: #E5D4B3;
}

[data-theme="night"] {
  --bg: #121316;
  --surface: #1A1C20;
  --surface-subtle: #23262C;
  --text: #E5E1D8;
  --text-secondary: #A19C91;
  --text-muted: #76726A;
  --border: #2A2D34;
  --border-strong: #3B3F49;
  --accent: #E28B44;
  --accent-soft: rgba(226, 139, 68, 0.16);
  --accent-hover: #F09D58;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 12px 36px rgba(0, 0, 0, 0.55);
  --code-bg: #23262C;
  --quote-bg: #202228;
  --cat-ai: #818CF8;
  --cat-business: #F59E0B;
  --cat-hr: #34D399;
  --cat-finance: #FB7185;
  --theme-dot: #23262C;
}

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "SF Pro Text", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-serif: "Songti SC", "Noto Serif SC", "Source Han Serif CN", "STSong", Georgia, Cambria, serif;
  --reader-font: var(--font-serif);
  --reader-size: 18px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.hidden {
  display: none !important;
}

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

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}

/* Masthead */
.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.masthead-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  flex-shrink: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 19px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.02em;
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.02em;
}

.brand-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 1px;
}

.masthead-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: flex-end;
  min-width: 0;
}

.search-box {
  position: relative;
  width: 100%;
  max-width: 290px;
  min-width: 120px;
}

.search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  height: 36px;
  padding: 0 28px 0 33px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 17px;
  cursor: pointer;
  padding: 2px 6px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover {
  border-color: var(--border-strong);
  background: var(--surface-subtle);
}

.icon-btn.spinning .ico {
  animation: spin 0.9s linear infinite;
}

.ico {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.theme-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--theme-dot);
  border: 1.5px solid var(--text-secondary);
}

/* Category Navigation */
.cat-nav {
  border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}

.cat-nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.cat-nav-inner::-webkit-scrollbar {
  display: none;
}

.cat-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 12px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.cat-tab:hover {
  color: var(--text);
}

.cat-tab.active {
  color: var(--text);
  font-weight: 600;
}

.cat-tab.active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 2.5px;
  border-radius: 2px;
  background: var(--accent);
}

.cat-divider {
  width: 1px;
  height: 16px;
  background: var(--border);
  margin: 0 4px;
  flex-shrink: 0;
}

.tab-count {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.dot-ai { background: var(--cat-ai); }
.dot-business { background: var(--cat-business); }
.dot-hr { background: var(--cat-hr); }
.dot-finance { background: var(--cat-finance); }

/* Container */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 20px 64px;
}

/* Filter Bar */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.filter-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
}

.seg-btn {
  border: none;
  background: transparent;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.seg-btn.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.pill-toggle {
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12.5px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.pill-toggle:hover {
  border-color: var(--border-strong);
}

.pill-toggle.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.clean-select {
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12.5px;
  color: var(--text-secondary);
  outline: none;
  cursor: pointer;
}

/* Editorial Hero Shelf */
.hero-section {
  margin-bottom: 32px;
}

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

.section-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.section-desc {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.sync-badge {
  font-size: 11.5px;
  color: var(--cat-hr);
  background: color-mix(in srgb, var(--cat-hr) 11%, transparent);
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 500;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  box-shadow: var(--shadow-sm);
}

.hero-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.hero-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 8px;
}

.hero-card-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.42;
  margin: 0 0 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-card-excerpt {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  padding-top: 10px;
  border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}

/* Badges */
.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
}

.cat-pill-ai { color: var(--cat-ai); background: color-mix(in srgb, var(--cat-ai) 10%, transparent); }
.cat-pill-business { color: var(--cat-business); background: color-mix(in srgb, var(--cat-business) 10%, transparent); }
.cat-pill-hr { color: var(--cat-hr); background: color-mix(in srgb, var(--cat-hr) 10%, transparent); }
.cat-pill-finance { color: var(--cat-finance); background: color-mix(in srgb, var(--cat-finance) 10%, transparent); }

.mini-pill {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-weight: 500;
}

.mini-pill-en {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.mini-pill-full {
  color: var(--cat-hr);
  border-color: color-mix(in srgb, var(--cat-hr) 35%, transparent);
}

/* Stream */
.stream-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stream-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
}

.stream-meta {
  font-size: 12.5px;
  color: var(--text-muted);
}

.article-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: var(--shadow-sm);
}

.article-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.article-card.is-read .card-title {
  color: var(--text-secondary);
  font-weight: 600;
}

.article-card.is-read {
  background: color-mix(in srgb, var(--surface) 72%, var(--bg));
}

.card-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

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

.card-source {
  font-weight: 600;
  color: var(--text-secondary);
}

.card-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 18.5px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
}

.card-excerpt {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.62;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-note-preview {
  font-size: 12.5px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 6px 10px;
  border-radius: 8px;
  line-height: 1.5;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.card-act-btn {
  border: none;
  background: transparent;
  padding: 3px 0;
  font-size: 12.5px;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s ease;
}

.card-act-btn:hover {
  color: var(--text);
}

.card-act-btn.active {
  color: var(--accent);
  font-weight: 600;
}

.card-thumb-wrap {
  width: 154px;
  height: 102px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface-subtle);
  align-self: center;
}

.card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Skeleton & Empty */
.skeleton-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton-card {
  height: 132px;
  border-radius: 14px;
  background: linear-gradient(90deg, var(--surface-subtle) 25%, var(--surface) 50%, var(--surface-subtle) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

.empty-state {
  text-align: center;
  padding: 56px 20px;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: 16px;
}

.empty-icon { font-size: 36px; margin-bottom: 10px; }
.empty-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.empty-desc { font-size: 13.5px; color: var(--text-muted); }

.load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 22px;
}

/* Buttons */
.btn-primary {
  border: none;
  background: var(--accent);
  color: #fff;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-secondary:hover { background: var(--surface-subtle); }
.btn-sm { padding: 7px 14px; font-size: 12.5px; }

/* Full-Screen Immersive Reader */
.reader-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.reader-progress-track {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  z-index: 120;
}

.reader-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.08s linear;
}

.reader-topbar {
  position: relative;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 95%, transparent);
  backdrop-filter: blur(12px);
  z-index: 110;
}

.reader-topbar-inner {
  max-width: 820px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.reader-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.reader-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.reader-btn:hover {
  background: var(--surface-subtle);
  border-color: var(--border-strong);
}

.reader-btn-accent {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.reader-btn.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* Typography Popover */
.typo-popover {
  position: absolute;
  right: max(16px, calc(50% - 394px));
  top: 56px;
  width: 290px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 130;
}

.typo-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.typo-label {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.theme-chips {
  display: flex;
  gap: 6px;
}

.theme-chip {
  flex: 1;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 12.5px;
  cursor: pointer;
}

.theme-chip.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.size-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.size-stepper button {
  border: none;
  background: var(--surface-subtle);
  padding: 6px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.size-stepper span {
  font-size: 13px;
  font-weight: 600;
}

/* Reader Scroll Area */
.reader-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 32px 20px 80px;
}

.reader-article {
  max-width: 700px;
  margin: 0 auto;
}

.reader-header {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.reader-meta-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

.reader-title {
  margin: 0;
  font-family: var(--reader-font);
  font-size: clamp(24px, 3.6vw, 32px);
  font-weight: 700;
  line-height: 1.32;
  letter-spacing: -0.01em;
}

.reader-title-zh {
  margin-top: 10px;
  font-family: var(--reader-font);
  font-size: clamp(18px, 2.5vw, 22px);
  font-weight: 600;
  color: var(--accent);
  line-height: 1.4;
}

.reader-meta-sub {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.reader-notice {
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--text);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 13px;
  margin-bottom: 20px;
  line-height: 1.55;
}

.reader-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 16px;
  color: var(--text-secondary);
  font-size: 14px;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Deep Reading Body Typography */
.reader-body {
  font-family: var(--reader-font);
  font-size: var(--reader-size);
  line-height: 1.88;
  color: var(--text);
  word-break: break-word;
}

.reader-body p {
  margin: 0 0 1.25em;
}

.reader-body h2 {
  font-size: 1.32em;
  line-height: 1.38;
  margin: 1.8em 0 0.7em;
  font-weight: 700;
}

.reader-body h3, .reader-body h4 {
  font-size: 1.15em;
  line-height: 1.42;
  margin: 1.5em 0 0.6em;
  font-weight: 700;
}

.reader-body blockquote {
  margin: 1.4em 0;
  padding: 12px 18px;
  border-left: 3.5px solid var(--accent);
  background: var(--quote-bg);
  border-radius: 0 10px 10px 0;
  color: var(--text-secondary);
}

.reader-body blockquote p:last-child {
  margin-bottom: 0;
}

.reader-body img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 1.2em auto;
  display: block;
}

.reader-body figure {
  margin: 1.4em 0;
  text-align: center;
}

.reader-body figcaption {
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 6px;
}

.reader-body ul, .reader-body ol {
  padding-left: 1.4em;
  margin: 0 0 1.25em;
}

.reader-body li {
  margin-bottom: 0.5em;
}

.reader-body pre {
  background: var(--code-bg);
  padding: 14px 16px;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 0.82em;
  line-height: 1.6;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.reader-body code {
  background: var(--code-bg);
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 0.86em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.reader-body pre code {
  background: transparent;
  padding: 0;
}

.reader-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.3em 0;
  font-size: 0.86em;
  display: block;
  overflow-x: auto;
}

.reader-body th, .reader-body td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
}

.reader-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}

/* Bilingual Blocks */
.bilingual-block {
  margin-bottom: 1.45em;
}

.bilingual-zh {
  color: var(--text);
  margin: 0 0 0.35em;
}

.bilingual-en {
  font-family: var(--font-sans);
  font-size: 0.84em;
  line-height: 1.62;
  color: var(--text-muted);
  margin: 0;
  padding-left: 11px;
  border-left: 2px solid var(--border-strong);
}

.bilingual-heading-zh {
  font-size: 1.28em;
  font-weight: 700;
  margin: 1.5em 0 0.25em;
  line-height: 1.38;
}

.bilingual-heading-en {
  font-family: var(--font-sans);
  font-size: 0.85em;
  color: var(--text-muted);
  margin: 0 0 0.8em;
}

/* Personal Notes Card */
.reader-notes-card {
  margin-top: 40px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.notes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.notes-title {
  font-size: 14.5px;
  font-weight: 700;
}

.notes-status {
  font-size: 12px;
  color: var(--text-muted);
}

.reader-notes-card textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  padding: 12px;
  font-size: 14.5px;
  line-height: 1.65;
  resize: vertical;
  outline: none;
}

.reader-notes-card textarea:focus {
  border-color: var(--accent);
}

.notes-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.notes-hint {
  font-size: 12px;
  color: var(--text-muted);
}

/* Reader Footer Nav */
.reader-footer {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* Sources Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(15, 15, 14, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  width: 100%;
  max-width: 720px;
  max-height: 86vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 19px;
}

.modal-subtitle {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--text-muted);
}

.icon-close {
  border: none;
  background: var(--surface-subtle);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 18px 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.add-source-form {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}

.form-title {
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr auto auto;
  gap: 8px;
}

.form-grid input, .form-grid select {
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  outline: none;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.form-msg {
  font-size: 12.5px;
  color: var(--accent);
}

.sources-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.src-group-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.src-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  margin-bottom: 7px;
}

.src-info { min-width: 0; flex: 1; }
.src-name-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.src-name { font-size: 14px; font-weight: 600; }
.src-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.src-stat { font-size: 11px; color: var(--cat-hr); }
.src-stat.err { color: var(--cat-finance); }

.src-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  inset: 0;
  background: var(--border-strong);
  border-radius: 999px;
  cursor: pointer;
  transition: 0.2s;
}
.slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(16px); }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  z-index: 200;
  box-shadow: var(--shadow-md);
  max-width: 90vw;
  text-align: center;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Responsive Breakpoints */
@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .masthead-inner {
    padding: 10px 14px;
    flex-wrap: wrap;
    row-gap: 10px;
  }
  .brand {
    flex: 1 1 100%;
    min-width: 0;
  }
  .brand-text {
    min-width: 0;
    flex: 1;
  }
  .brand-sub {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .masthead-actions {
    flex: 0 0 100%;
    width: 100%;
    order: 3;
    justify-content: space-between;
    gap: 6px;
  }
  .search-box {
    max-width: none;
    min-width: 0;
    flex: 1 1 auto;
  }
  .btn-label {
    display: none;
  }
  .icon-btn {
    padding: 0 10px;
  }
  .cat-nav-inner {
    padding: 0 12px;
  }
  .container {
    padding: 14px 14px 56px;
  }
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .article-card {
    padding: 14px 15px;
    gap: 12px;
  }
  .card-title {
    font-size: 16.5px;
  }
  .card-thumb-wrap {
    width: 96px;
    height: 76px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .reader-scroll {
    padding: 20px 16px 72px;
  }
  .reader-topbar-inner {
    padding: 8px 10px;
  }
  .reader-btn {
    padding: 0 9px;
    font-size: 12.5px;
  }
  .typo-popover {
    right: 12px;
    left: 12px;
    width: auto;
  }
  .reader-footer {
    justify-content: center;
  }
}
