/* 日知录 — 对齐易HS浅蓝 */
:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --accent: #1e86fc;
  --accent-soft: #e8f3ff;
  --tag: #1565c0;
  --brand-dark: #1565c0;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 820px; margin: 0 auto; padding: 0.35rem 1.25rem 2.5rem; }
header.site {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 0;
  margin-bottom: 0;
}
header.site .wrap {
  padding-top: 0; padding-bottom: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
}
header.site h1 { margin: 0; font-size: 1.3rem; font-weight: 700; }
.brand {
  color: inherit; text-decoration: none;
  display: inline-flex; align-items: center; gap: 0.55rem;
}
.brand-logo { display: block; border-radius: 6px; flex-shrink: 0; }

.brand:hover { text-decoration: none; }
.brand:hover h1 { color: var(--accent); }
.site-sub { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.85rem; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.search-wrap { display: flex; align-items: center; flex: 0 1 180px; min-width: 140px; max-width: 360px; }
.site-search {
  font: inherit;
  width: 100%;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  color: var(--text);
  outline: none;
}
.site-search::placeholder { color: var(--muted); }
.site-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(30, 134, 252, 0.15);
  background: var(--card);
}

.filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem;
  margin: 0.35rem 0 0.45rem;
}
.filters select {
  font: inherit; padding: 0.35rem 0.6rem;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--card); color: var(--text);
}
.table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
table.notes {
  width: 100%; border-collapse: collapse; font-size: 0.95rem;
}
table.notes th, table.notes td {
  padding: 0.7rem 0.9rem; text-align: left;
  border-bottom: 1px solid var(--border);
}
table.notes th {
  background: var(--accent-soft); color: var(--muted);
  font-weight: 600; font-size: 0.82rem;
}
table.notes tr:last-child td { border-bottom: none; }
table.notes tr.hidden { display: none; }
.chip {
  display: inline-block; padding: 0.1rem 0.45rem;
  border-radius: 999px; background: var(--accent-soft);
  color: var(--accent); font-size: 0.8rem;
}
.tag {
  display: inline-block; padding: 0.1rem 0.45rem;
  border-radius: 4px; background: var(--accent-soft); color: var(--tag); font-size: 0.8rem;
}
.empty-hint { display: none; color: var(--muted); margin-top: 1rem; }
.empty-hint.show { display: block; }

/* article page */
article.note {
  margin-top: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem 1.75rem 2rem;
}
article.note h1 { margin-top: 0; font-size: 1.55rem; line-height: 1.35; }
article.note h2 {
  margin-top: 1.75rem; padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  font-size: 1.2rem;
}
article.note h3 { font-size: 1.05rem; margin-top: 1.25rem; }
article.note p { margin: 0.75rem 0; }
article.note ul, article.note ol { padding-left: 1.4rem; }
article.note li { margin: 0.35rem 0; }
article.note strong { font-weight: 650; }
article.note hr {
  border: none; border-top: 1px solid var(--border); margin: 1.5rem 0;
}
.meta {
  color: var(--muted); font-size: 0.9rem;
  margin: 0.25rem 0 1.25rem;
}
.nav-back { font-size: 0.9rem; margin: 0.15rem 0 0.35rem; display: inline-block; }
.list-page ul { list-style: none; padding: 0; }
.list-page li {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.75rem 1rem; margin: 0.5rem 0;
}
footer.site {
  margin-top: 2rem; padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted); font-size: 0.82rem;
}
@media (max-width: 600px) {
  article.note { padding: 1rem 1.1rem 1.5rem; }
  /* Keep 日期 column visible on mobile */
  table.notes { font-size: 0.88rem; }
  table.notes th, table.notes td { padding: 0.45rem 0.4rem; }
  table.notes th:nth-child(3), table.notes td:nth-child(3) {
    display: table-cell !important;
    white-space: nowrap;
    width: 5.5rem;
  }
  .row-date { display: none !important; }
  .filters { width: 100%; }
  .search-wrap { flex: 1 1 100% !important; max-width: none !important; width: 100% !important; min-width: 0; }
  .site-search { width: 100% !important; box-sizing: border-box; }
  .site-sub { display: none; }
  header.site h1 { font-size: 1.15rem; }
}

/* brand row fix v3 */
.brand {
  color: inherit; text-decoration: none !important;
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 0.5rem !important;
}
.brand-logo {
  display: block !important;
  width: 32px !important; height: 32px !important;
  border-radius: 6px; flex: 0 0 32px !important;
}
.brand h1 {
  margin: 0 !important;
  font-size: 1.3rem !important;
  font-weight: 700;
  line-height: 1.2 !important;
  display: inline !important;
}
header.site { margin-bottom: 0 !important; padding: 0.4rem 0 !important; }
.filters { margin: 0.25rem 0 0.35rem !important; }
.wrap { padding-top: 0.25rem !important; }
.nav-back { margin: 0.1rem 0 0.3rem !important; }

/* topic tags: 创新 / 医疗 / 读书 三类 */
.tag {
  display: inline-block !important;
  padding: 0.12rem 0.5rem !important;
  border-radius: 999px !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  letter-spacing: 0.02em;
  background: #e8f3ff !important;
  color: #1565c0 !important;
}
tr[data-topic="创新"] .tag,
.tag[data-topic="创新"],
.tag-innovation {
  background: #ccfbf1 !important;
  color: #0f766e !important;
}
tr[data-topic="医疗"] .tag,
.tag[data-topic="医疗"],
.tag-medical {
  background: #ffe4e6 !important;
  color: #be123c !important;
}
/* 读书类（历史/传记/心理/哲学/经管/金融等）保持蓝 */
tr[data-topic="历史"] .tag,
tr[data-topic="传记"] .tag,
tr[data-topic="心理"] .tag,
tr[data-topic="哲学"] .tag,
tr[data-topic="经管"] .tag,
tr[data-topic="金融"] .tag,
.tag[data-topic="历史"],
.tag[data-topic="传记"],
.tag[data-topic="心理"],
.tag[data-topic="哲学"],
.tag[data-topic="经管"],
.tag[data-topic="金融"],
.tag-reading {
  background: #e8f3ff !important;
  color: #1565c0 !important;
}

/* article left accent by family */
article.note[data-topic="创新"] {
  border-left: 4px solid #0d9488;
}
article.note[data-topic="医疗"] {
  border-left: 4px solid #e11d48;
}
article.note[data-family="reading"],
article.note[data-topic]:not([data-topic="创新"]):not([data-topic="医疗"]) {
  border-left: 4px solid #1e86fc;
}
.meta .tag { margin: 0 0.15rem; vertical-align: baseline; }


/* red underline highlights */
.hl-red {
  text-decoration: underline;
  text-decoration-color: #e11d48;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  color: inherit;
}
.hl-menu {
  position: fixed;
  z-index: 9999;
  display: none;
  flex-direction: column;
  gap: 0;
  min-width: 8.5rem;
  padding: 0.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(26, 35, 50, 0.12);
  font-size: 0.88rem;
}
.hl-menu.show { display: flex; }
.hl-menu button {
  font: inherit;
  text-align: left;
  padding: 0.45rem 0.7rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.hl-menu button:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

/* comments */
.comments {
  margin: 1.25rem 0 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem 1.5rem;
}
.comments-title {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
}
.comments-hint {
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.comments-form textarea {
  width: 100%;
  font: inherit;
  line-height: 1.6;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  resize: vertical;
  min-height: 96px;
  background: #fff;
  color: var(--text);
}
.comments-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(30, 134, 252, 0.15);
}
.comments-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.55rem;
}
.comments-count { color: var(--muted); font-size: 0.85rem; }
.comments-submit {
  font: inherit;
  padding: 0.4rem 0.95rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
.comments-submit:hover { filter: brightness(1.05); }
.comments-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.comments-msg {
  margin: 0.5rem 0 0;
  font-size: 0.88rem;
  color: var(--accent);
}
.comments-msg.is-error { color: #c62828; }
.comments-list {
  list-style: none;
  padding: 0;
  margin: 1.1rem 0 0;
}
.comments-item {
  border-top: 1px solid var(--border);
  padding: 0.85rem 0;
}
.comments-item:first-child { border-top: none; padding-top: 0.2rem; }
.comments-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 0.35rem;
}
.comments-ip { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.comments-body { white-space: normal; line-height: 1.65; }
.comments-empty { color: var(--muted); font-size: 0.92rem; padding: 0.25rem 0; }
@media (max-width: 600px) {
  .comments { padding: 1rem 1.1rem 1.25rem; }
}


/* 今日三句话 */
.today-summary {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem 0.95rem;
  border-radius: 10px;
  background: #e8f3ff;
  border: 1px solid var(--border);
}
article.note[data-topic="创新"] .today-summary {
  background: #f0fdfa;
  border-color: #99f6e4;
}
article.note[data-topic="医疗"] .today-summary {
  background: #fff1f2;
  border-color: #fecdd3;
}
.today-summary-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.today-summary ol {
  margin: 0;
  padding-left: 1.15rem;
}
.today-summary li {
  margin: 0.25rem 0;
  line-height: 1.45;
  font-size: 0.95rem;
}
.row-summary {
  margin-top: 0.25rem;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
table.notes td:first-child {
  max-width: 28rem;
}

/* list title links: darker than accent buttons */
table.notes a,
.notes td a {
  color: var(--brand-dark);
}
table.notes a:hover,
.notes td a:hover {
  color: #0d4f9e;
}

/* mobile date under title — hidden on desktop (date column shows) */
.row-date {
  display: none;
  font-size: 0.75rem;
  line-height: 1.3;
  color: var(--muted);
  margin-top: 0.12rem;
}



/* share */
.share-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.25rem 0 0.5rem;
  align-items: center;
}
.share-btn {
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
.share-btn:hover { filter: brightness(1.05); }
.share-btn-ghost {
  background: var(--card);
  color: var(--accent);
}
.share-mask {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0; pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 40;
}
.share-mask.show { opacity: 1; pointer-events: auto; }
.share-panel {
  position: fixed;
  left: 50%; top: 50%;
  transform: translate(-50%, -48%);
  width: min(92vw, 340px);
  background: var(--card);
  border-radius: 14px;
  padding: 1.1rem 1.2rem 1.2rem;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
  z-index: 50;
  opacity: 0; pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.share-panel.show {
  opacity: 1; pointer-events: auto;
  transform: translate(-50%, -50%);
}
.share-panel h3 { margin: 0 0 0.35rem; font-size: 1.05rem; }
.share-panel-desc { margin: 0 0 0.75rem; color: var(--muted); font-size: 0.88rem; line-height: 1.45; }
.share-qr {
  display: block;
  margin: 0 auto 0.65rem;
  border-radius: 8px;
  background: #fff;
}
.share-url {
  font-size: 0.72rem;
  color: var(--muted);
  word-break: break-all;
  margin: 0 0 0.75rem;
  line-height: 1.35;
}
.share-panel-actions { display: flex; gap: 0.5rem; justify-content: center; }
.share-wechat-tip {
  position: fixed;
  top: 0.75rem; right: 0.75rem;
  left: auto;
  width: min(88vw, 280px);
  background: #111827;
  color: #f8fafc;
  border-radius: 12px;
  padding: 1rem 1rem 1.05rem;
  z-index: 50;
  opacity: 0; pointer-events: none;
  transition: opacity 0.15s ease;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}
.share-wechat-tip.show { opacity: 1; pointer-events: auto; }
.share-wechat-tip p { margin: 0.35rem 0; font-size: 0.9rem; line-height: 1.45; }
.share-wechat-tip .share-btn { margin-top: 0.55rem; width: 100%; justify-content: center; }
.share-wechat-arrow {
  position: absolute;
  top: -0.15rem; right: 0.85rem;
  font-size: 1.6rem;
  color: #f8fafc;
  animation: share-bounce 1.2s ease-in-out infinite;
}
@keyframes share-bounce {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(4px, -6px); }
}
.share-toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%) translateY(12px);
  background: #111827;
  color: #fff;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  font-size: 0.85rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 60;
  white-space: nowrap;
}
.share-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}


/* pager — aligned with 每日研报, brand #1e86fc */
.pager-bar {
  width: 100%;
  margin-top: 1rem;
  display: flex;
  justify-content: flex-end;
}
.pager.ant-pager {
  display: inline-flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin: 0;
  font-size: 14px;
  color: #595959;
  white-space: nowrap;
}
.pager.ant-pager > * {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  vertical-align: middle;
}
.pager-total { white-space: nowrap; color: #595959; }
.pager-arrow, .pager-num {
  box-sizing: border-box;
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  margin: 0;
  border: 1px solid #d9d9d9;
  border-radius: 2px;
  background: #fff;
  color: #262626;
  font-size: 14px;
  line-height: 30px;
  text-align: center;
  cursor: pointer;
}
.pager-arrow:hover:not(:disabled), .pager-num:hover:not(.active) {
  border-color: #1e86fc; color: #1e86fc;
}
.pager-num.active { background: #1e86fc; border-color: #1e86fc; color: #fff; }
.pager-arrow:disabled { opacity: 0.4; cursor: not-allowed; color: #bfbfbf; }
.pager-pages {
  display: inline-flex !important;
  flex-direction: row !important;
  gap: 8px;
  align-items: center;
}
.pager-ellipsis { padding: 0 4px; color: #8c8c8c; }
.pager-jump {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.pager-jump input {
  box-sizing: border-box;
  width: 50px;
  height: 32px;
  margin: 0;
  padding: 0 4px;
  text-align: center;
  border: 1px solid #d9d9d9;
  border-radius: 2px;
  font-size: 14px;
}
.pager-size {
  box-sizing: border-box;
  height: 32px;
  padding: 0 8px;
  margin: 0;
  border: 1px solid #d9d9d9;
  border-radius: 2px;
  background: #fff;
  color: #262626;
  font-size: 14px;
  flex-shrink: 0;
}

/* 日知录 shell nav (injected by sync_reading_tab.py) */
.site-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem 0.85rem;
  flex-wrap: wrap;
  font-size: 0.88rem;
  font-weight: 600;
}
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.2rem 0.35rem;
  border-radius: 6px;
}
.site-nav a:hover {
  color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}
.site-nav a[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-soft);
}
@media (max-width: 640px) {
  .site-nav { gap: 0.2rem 0.45rem; font-size: 0.82rem; }
  .site-nav a { padding: 0.18rem 0.28rem; }
}

