:root {
  --bg: #FBF6EE;
  --card: #FFFDF8;
  --primary: #B3261E;
  --text: #33261A;
  --soft: #5A4A3A;
  --muted: #7D6A55;
  --rule: rgba(120, 90, 60, 0.22);
  --land: #DCD2C2;
  --heat-low: #EDA27E;
  --heat-high: #8E1410;
  --kai: "LXGW WenKai", "Kaiti SC", "STKaiti", "KaiTi", "楷体", "Songti SC", serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16191F; --card: #20242C; --primary: #EF6A66; --text: #E8E4DC;
    --soft: #C6C1B8; --muted: #9AA1AD; --rule: rgba(255, 255, 255, 0.13);
    --land: #363C47; --heat-low: #8A3B33; --heat-high: #FFB59E;
  }
}
:root[data-theme="dark"] {
  --bg: #16191F; --card: #20242C; --primary: #EF6A66; --text: #E8E4DC;
  --soft: #C6C1B8; --muted: #9AA1AD; --rule: rgba(255, 255, 255, 0.13);
    --land: #363C47; --heat-low: #8A3B33; --heat-high: #FFB59E;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 19px/2 var(--kai);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.page { max-width: 680px; margin: 0 auto; padding: 0 20px; }

/* 顶部 */
.top { display: flex; justify-content: space-between; align-items: baseline; padding: 24px 0 0; font-size: 17px; color: var(--muted); }
.top a { text-decoration: none; }
.top a:hover { color: var(--primary); }
/* 主页右上角的账号入口：醒目一点 */
.home-top { align-items: center; }
.top .account-link {
  padding: 4px 16px; border: 1.5px solid var(--primary); border-radius: 999px;
  color: var(--primary); font-size: 16px; line-height: 1.7; white-space: nowrap;
}
.top .account-link:hover { background: var(--primary); color: #FFF4E6; }
.top .account-link.signed-in::before { content: '◉ '; font-size: 12px; vertical-align: 1px; }

/* 印章 */
.seal {
  display: inline-grid; place-items: center;
  width: 46px; height: 46px; border-radius: 6px;
  background: var(--primary); color: #FFF4E6;
  font-size: 30px; line-height: 1;
  box-shadow: inset 0 0 0 2px var(--primary), inset 0 0 0 3px rgba(255, 244, 230, 0.8);
  transform: rotate(-3deg);
}

/* 列表页 */
.masthead { padding: 72px 0 44px; }
.masthead .seal { margin-bottom: 22px; }
.masthead h1 { margin: 0; font-size: 52px; line-height: 1.25; font-weight: 400; letter-spacing: 0.1em; }
.masthead p { margin: 10px 0 0; color: var(--muted); font-size: 20px; }
.year { margin: 0; padding: 0 0 8px; border-bottom: 1px solid var(--rule); color: var(--primary); font-size: 18px; font-weight: 400; letter-spacing: 0.16em; }
.entry { padding: 30px 0 32px; border-bottom: 1px solid var(--rule); }
.entry time { display: block; color: var(--muted); font-size: 16px; line-height: 1.6; letter-spacing: 0.06em; }
.entry h2 { margin: 6px 0 8px; font-size: 30px; line-height: 1.4; font-weight: 400; }
.entry h2 a { text-decoration: none; }
.entry h2 a:hover { color: var(--primary); }
.entry p { margin: 0; color: var(--soft); line-height: 1.85; }
.empty { color: var(--muted); padding: 32px 0; }
.empty a { color: var(--primary); }

/* 入口：主页和生活园的两扇门 */
.doors { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.door {
  display: flex; flex-direction: column; gap: 14px; padding: 24px 22px 26px;
  border: 1px solid var(--rule); border-radius: 14px; background: var(--card); text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
.door:hover { border-color: var(--primary); transform: translateY(-2px); }
.door.wide { grid-column: 1 / -1; }
.door .seal { width: 52px; height: 52px; font-size: 34px; }
.door-name { font-size: 30px; line-height: 1.3; }
.door-name small { margin-left: 10px; color: var(--muted); font-size: 16px; letter-spacing: 0.04em; }
.door-text { color: var(--soft); font-size: 17px; line-height: 1.7; }
@media (prefers-reduced-motion: reduce) {
  .door { transition: none; }
  .door:hover { transform: none; }
}

.section-title { margin: 0 0 16px; font-size: 26px; line-height: 1.4; font-weight: 400; }
.entry time a { text-decoration: none; }
.entry time a:hover, .meta a:hover { color: var(--primary); }
.meta a { text-decoration: none; }

/* 作者地图：比正文宽一些，手机上留 16px 边距 */
.globe-wrap { margin: 0 calc(50% - min(50vw - 16px, 480px)) 40px; }
.globe { position: relative; aspect-ratio: 144 / 57; }
.globe canvas { display: block; width: 100%; height: 100%; }
.bubbles { position: absolute; inset: 0; pointer-events: none; }
.globe-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-top: 10px; color: var(--muted); font-size: 15px; line-height: 1.7; }
.globe-foot p { margin: 0; min-height: 1.7em; }
.heat-key { flex: none; display: flex; align-items: center; gap: 8px; }
.heat-key i { width: 72px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--land), var(--heat-low), var(--heat-high)); }

/* 气泡的位置就是作者所在的点，卡片从点上方（或下方）冒出来 */
.bubble { position: absolute; width: 0; height: 0; color: var(--text); text-decoration: none; pointer-events: auto; }
.bubble::before {
  content: ""; position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--primary); box-shadow: 0 0 0 2px var(--bg);
}
.bubble-card {
  position: absolute; left: 0; bottom: 12px; width: max-content; max-width: 200px;
  display: block; padding: 7px 13px 8px; border: 1px solid var(--rule); border-radius: 14px;
  background: var(--card); box-shadow: 0 6px 18px rgba(60, 35, 15, 0.16);
  font-size: 15px; line-height: 1.5; transform: translateX(-50%); transform-origin: 50% 100%;
  animation: bubble-in 0.42s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.bubble-card strong { display: block; font-weight: 400; color: var(--primary); }
.bubble-card span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.bubble-card small { display: block; color: var(--muted); font-size: 13px; }
.bubble:hover .bubble-card { border-color: var(--primary); }
.bubble.from-left .bubble-card { --shift: -18%; transform: translateX(var(--shift)); }
.bubble.from-right .bubble-card { --shift: -82%; transform: translateX(var(--shift)); }
.bubble.below .bubble-card { bottom: auto; top: 12px; transform-origin: 50% 0; }
.bubble.leaving { pointer-events: none; }
.bubble.leaving .bubble-card, .bubble.leaving::before { opacity: 0; transition: opacity 0.3s; }
@keyframes bubble-in {
  from { opacity: 0; transform: translateX(var(--shift, -50%)) scale(0.6); }
  to { opacity: 1; transform: translateX(var(--shift, -50%)) scale(1); }
}
.globe { overflow: hidden; touch-action: pan-y; }
.globe.dragging { cursor: grabbing; }
.map-zoom { position: absolute; right: 8px; top: 8px; z-index: 6; display: flex; gap: 4px; }
.globe .map-zoom button {
  min-width: 30px; height: 30px; padding: 0 8px; border: 1px solid var(--rule); border-radius: 8px;
  background: var(--bg); color: var(--text); font: 16px/1 system-ui, -apple-system, sans-serif; cursor: pointer; box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
}
.globe .map-zoom button:hover { border-color: var(--primary); color: var(--primary); }
.globe .map-zoom button:disabled { opacity: .35; cursor: default; }
.globe .map-zoom button[hidden] { display: none; }
@media (max-width: 560px) {
  .map-zoom { right: 4px; top: 4px; gap: 3px; }
  .globe .map-zoom button { min-width: 26px; height: 26px; padding: 0 6px; font-size: 14px; }
}
.map-tip {
  position: absolute; z-index: 2; padding: 2px 10px; border-radius: 8px; background: var(--text); color: var(--bg);
  font-size: 14px; line-height: 1.7; white-space: nowrap; pointer-events: none; transform: translate(-50%, calc(-100% - 8px));
}
@media (prefers-reduced-motion: reduce) {
  .bubble-card { animation: none; }
  .bubble.leaving .bubble-card, .bubble.leaving::before { transition: none; }
}

/* 文章页 */
.head { padding: 68px 0 36px; text-align: center; }
.head h1 { margin: 0 0 16px; font-size: 40px; line-height: 1.4; font-weight: 400; letter-spacing: 0.04em; }
.meta { margin: 0; color: var(--muted); font-size: 16px; letter-spacing: 0.04em; line-height: 1.7; }
.meta span + span::before { content: "·"; margin: 0 0.6em; }
.body { font-size: 20px; line-height: 2.1; text-align: justify; line-break: strict; }
.body p { margin: 0 0 1.05em; text-indent: 2em; }
.body h2 { margin: 2.1em 0 0.7em; font-size: 26px; line-height: 1.5; font-weight: 400; color: var(--primary); text-align: left; }
.body blockquote { margin: 1.8em 0; padding: 2px 0 2px 1.1em; border-left: 3px solid var(--primary); color: var(--soft); text-align: left; }
.body blockquote p { margin: 0; text-indent: 0; }
.body hr { width: 7px; height: 7px; margin: 2.6em auto; border: 0; background: var(--primary); transform: rotate(45deg); }
.body img { display: block; max-width: 100%; height: auto; margin: 1.8em auto 0.6em; border-radius: 6px; }
.body .caption { margin: 0 0 1.8em; text-indent: 0; text-align: center; color: var(--muted); font-size: 16px; }
.body a { color: var(--primary); text-underline-offset: 3px; }
.body strong { font-weight: 400; color: var(--primary); }
.end { margin: 44px 0 0; text-align: right; }
.end .seal { width: 34px; height: 34px; font-size: 22px; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 44px; padding-top: 18px; border-top: 1px solid var(--rule); font-size: 17px; line-height: 1.6; }
.pager a { text-decoration: none; }
.pager a:hover { color: var(--primary); }
.pager small { display: block; color: var(--muted); font-size: 15px; }
.pager .next { grid-column: 2; text-align: right; }

.foot { margin-top: 72px; padding: 22px 0 44px; color: var(--muted); font-size: 15px; text-align: center; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--primary); }

/* 写文章 */
.write-title { margin: 44px 0 20px; font-size: 34px; line-height: 1.4; font-weight: 400; }
.field {
  width: 100%; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 8px;
  background: var(--card); color: var(--text); font: 17px/1.6 var(--kai);
}
.field.title { font-size: 24px; margin-bottom: 12px; }
.field-row { display: grid; grid-template-columns: 180px 1fr; gap: 12px; margin-bottom: 12px; }
.field-row label { display: block; color: var(--muted); font-size: 15px; line-height: 1.8; }
textarea.field { display: block; resize: vertical; min-height: 340px; font-size: 19px; line-height: 1.9; }
.tools, .buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.tools { margin-bottom: 8px; }
.tools #preview-toggle { margin-left: auto; }
.page button {
  padding: 7px 14px; border: 1px solid var(--rule); border-radius: 8px; background: transparent;
  color: var(--soft); font: 16px/1.5 var(--kai); cursor: pointer;
}
.page button:hover { border-color: var(--primary); color: var(--primary); }
.page button.primary { padding: 8px 26px; border-color: var(--primary); background: var(--primary); color: #FFF4E6; }
.page button.primary:hover { color: #FFF4E6; filter: brightness(1.08); }
.page button.danger { margin-left: auto; color: var(--primary); }
.page button:disabled { opacity: 0.55; cursor: default; }
.preview { min-height: 340px; padding: 8px 12px; border: 1px dashed var(--rule); border-radius: 8px; }
.note { min-height: 1.8em; margin: 8px 0; color: var(--primary); font-size: 16px; line-height: 1.8; }
.check { display: flex; align-items: baseline; gap: 8px; margin: 10px 0 0; color: var(--soft); font-size: 16px; line-height: 1.7; cursor: pointer; }
.check input { accent-color: var(--primary); }
.rights-pick { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; color: var(--soft); font-size: 16px; }
.rights-pick .field { flex: 1; min-width: 0; width: auto; }
.rights { margin: 1.6em 0 0; padding: 12px 14px; border-left: 3px solid var(--primary); background: var(--card, transparent); color: var(--muted); font-size: 15px; line-height: 1.8; text-align: left; overflow-wrap: anywhere; }
.rights a { color: var(--primary); }
.hint { margin: 10px 0 0; color: var(--muted); font-size: 15px; line-height: 1.8; }
#quota { color: var(--primary); }
.all-posts { margin-top: 56px; }
.post-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--rule); text-decoration: none; line-height: 1.6; }
.post-row:hover { color: var(--primary); }
.post-row small { flex: none; color: var(--muted); font-size: 15px; }

a:focus-visible, button:focus-visible, .field:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 2px; }

@media (max-width: 560px) {
  body { font-size: 18px; }
  .masthead { padding: 48px 0 32px; }
  .masthead h1 { font-size: 42px; }
  .entry h2 { font-size: 26px; }
  .head { padding: 44px 0 26px; }
  .head h1 { font-size: 31px; }
  .body { font-size: 19px; line-height: 2; }
  .body h2 { font-size: 24px; }
  .field-row { grid-template-columns: 1fr; }
  .doors { grid-template-columns: 1fr; }
  .bubble-card { max-width: 150px; padding: 5px 10px 6px; font-size: 14px; }
  .bubble-card small { font-size: 12px; }
  .globe-foot { flex-direction: column; gap: 4px; }
  .write-title { margin-top: 28px; }
}

/* 私人园的园地 */
.gardens { margin-bottom: 56px; }
.posts-title { margin-top: 8px; }
.garden-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.garden-card {
  display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px;
  border: 1px solid var(--rule); border-radius: 12px; background: var(--card); text-decoration: none; color: var(--text);
}
a.garden-card:hover { border-color: var(--primary); }
.garden-card .seal { flex: none; }
.garden-card > span { min-width: 0; }
.garden-card strong { display: block; font-weight: 400; font-size: 20px; line-height: 1.5; overflow-wrap: anywhere; }
.garden-card small { display: block; color: var(--muted); font-size: 14px; line-height: 1.7; }
.garden-card.invite { margin-bottom: 12px; border-color: var(--primary); }
.garden-card.invite p { margin: 6px 0 10px; color: var(--soft); font-size: 16px; }
.garden-card.invite .buttons { align-items: center; }
.garden-card.invite .buttons a { color: var(--primary); font-size: 16px; }
.new-garden, .settings { margin-top: 18px; border-top: 1px solid var(--rule); padding-top: 14px; }
.new-garden summary, .settings summary { cursor: pointer; color: var(--primary); font-size: 18px; line-height: 1.8; }
.new-garden form, .settings form { margin-top: 14px; }
.kind-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 0 0 12px; padding: 0; border: 0; }
.kind-pick legend { margin-bottom: 8px; color: var(--muted); font-size: 15px; }
.kind-pick label {
  display: block; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 10px; background: var(--card); cursor: pointer;
}
.kind-pick label:has(input:checked) { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.kind-pick input { position: absolute; opacity: 0; pointer-events: none; }
.kind-pick label:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.kind-pick b { display: block; font-weight: 400; font-size: 18px; }
.kind-pick small { display: block; margin-top: 2px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.new-garden .field, .settings .field { margin-bottom: 10px; }

.garden-head { padding-bottom: 32px; }
.garden-head h1 { overflow-wrap: anywhere; }
.garden-head .meta a { color: inherit; }
#badge { font-size: 15px; }
.invite-bar { margin-bottom: 28px; padding: 16px 18px; border: 1px solid var(--primary); border-radius: 12px; background: var(--card); }
.invite-bar p { margin: 0 0 10px; }
.progress { margin: 0 0 8px; color: var(--primary); font-size: 17px; letter-spacing: 0.04em; }
.link-button { padding: 2px 0 !important; border: 0 !important; color: var(--muted) !important; font-size: 15px !important; }
.link-button:hover { color: var(--primary) !important; }

.wish { display: flex; align-items: flex-start; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.wish input { flex: none; width: 20px; height: 20px; margin: 6px 0 0; accent-color: var(--primary); cursor: pointer; }
.wish-text { flex: 1; min-width: 0; }
.wish-text strong { display: block; font-weight: 400; font-size: 20px; line-height: 1.6; overflow-wrap: anywhere; }
.wish-text p { margin: 2px 0 0; color: var(--soft); font-size: 16px; line-height: 1.8; white-space: pre-line; }
.wish-text small { display: block; color: var(--muted); font-size: 14px; line-height: 1.7; }
.wish.done strong { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--primary); }

.trip-map { cursor: default; }
.trip-map.picking { cursor: crosshair; }
.trip-map canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.pins { position: absolute; inset: 0; }
.pin, .pick-mark { position: absolute; width: 0; height: 0; padding: 0 !important; border: 0 !important; }
.pin::before {
  content: ''; position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--primary); box-shadow: 0 0 0 2px var(--bg);
}
.pin::after { content: ''; position: absolute; left: -16px; top: -16px; width: 32px; height: 32px; }
.pin:hover::before, .pin:focus-visible::before { transform: scale(1.3); }
.pick-mark::before {
  content: ''; position: absolute; left: -11px; top: -11px; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--primary); background: transparent;
}
.trip { scroll-margin-top: 16px; }
.trip .body { font-size: 18px; line-height: 2; }

.items-dates { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.items-dates .empty { grid-column: 1 / -1; }
.date-card { display: flex; flex-direction: column; padding: 18px 20px 14px; border: 1px solid var(--rule); border-radius: 12px; background: var(--card); }
.date-card h2 { margin: 0; font-size: 20px; font-weight: 400; line-height: 1.5; overflow-wrap: anywhere; }
.date-count { margin: 10px 0 0; color: var(--soft); font-size: 17px; }
.date-count b { color: var(--primary); font-size: 34px; font-weight: 400; font-variant-numeric: tabular-nums; }
.date-next { margin: 2px 0 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.date-note { margin: 10px 0 0; color: var(--soft); font-size: 16px; line-height: 1.8; white-space: pre-line; }
.date-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: auto; padding-top: 10px; }
.date-foot small { color: var(--muted); font-size: 14px; }
.date-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; }
.date-tag { padding: 0 8px; border: 1px solid var(--rule); border-radius: 999px; color: var(--muted); font-size: 12px; line-height: 20px; }
.date-tag.remind { border-color: var(--primary); color: var(--primary); }
.date-extra { margin: 0 0 12px; }
.choice-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0 0 10px; color: var(--soft); font-size: 16px; }
.choice-row label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.choice-row input[type=radio] { accent-color: var(--primary); }
.choice-label { min-width: 4.5em; color: var(--muted); font-size: 15px; }
.item-form .choice-row .field.short { width: auto; min-width: 5.5em; margin: 0; padding: 6px 8px; }
.choice-row .hint { margin: 0; font-size: 13px; }
.choice-row input[type=checkbox] { accent-color: var(--primary); }
.remind-hint { margin: -4px 0 12px; font-size: 13px; }

.item-form { margin-top: 44px; }
.item-form .field { margin-bottom: 10px; }
.item-form .field-row { align-items: end; }
.item-form .field-row .check, .item-form .field-row .hint { margin: 0 0 10px; }
.settings h3 { margin: 24px 0 6px; font-size: 18px; font-weight: 400; color: var(--primary); }
.member { display: flex; align-items: baseline; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.member small { color: var(--muted); font-size: 14px; }
.member .link-button { margin-left: auto; }
.invite-form { display: flex; gap: 8px; margin-top: 12px !important; }
.invite-form .field { margin: 0 !important; }
.leave { margin-top: 32px; }

@media (max-width: 560px) {
  .kind-pick { grid-template-columns: 1fr; }
  .item-form .field-row { grid-template-columns: 1fr; }
}
.settings textarea.field { min-height: 0; font-size: 17px; }
.item-form textarea.field { min-height: 140px; font-size: 17px; }
.trip { padding: 24px 0 20px; }
.trip h2 { margin: 4px 0 6px; font-size: 26px; }
.page .trip-title {
  font-size: inherit; letter-spacing: inherit;
  padding: 0 !important; border: 0 !important; background: none; color: inherit !important;
  font: inherit; text-align: left; line-height: inherit; cursor: pointer;
}
.page .trip-title:hover:not(:disabled) { color: var(--primary) !important; }
.trip-title:disabled { cursor: default; }
.trip-summary { font-size: 17px; }
.trip .body { margin-top: 8px; }
.trip-actions { display: flex; gap: 18px; margin-top: 6px; }
.place-search { margin-bottom: 14px; }
.search-row { display: flex; gap: 8px; }
.search-row .field { margin: 0 !important; }
.place-results { display: grid; gap: 6px; margin-top: 8px; }
.page .place-choice { display: block; width: 100%; padding: 8px 12px; text-align: left; background: var(--card); }
.place-choice strong { display: block; font-weight: 400; font-size: 17px; color: var(--text); }
.place-choice small { display: block; color: var(--muted); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.place-search .hint { margin-top: 6px; font-size: 14px; }
.search-row button, .invite-form button { flex: none; white-space: nowrap; }

/* 园中园 */
.masthead .crumbs { margin: 0 0 4px; color: var(--muted); font-size: 15px; line-height: 1.7; overflow-wrap: anywhere; }
.masthead .crumbs a { color: var(--muted); }
.masthead .crumbs a:hover { color: var(--primary); }
.children { margin: 28px 0 8px; }
.children .new-garden { margin-top: 12px; }

/* 首页「装到手机」 */
.install { margin: 0 0 8px; color: var(--muted); font-size: 16px; line-height: 1.8; text-align: center; }
.install button { margin-left: 6px; }

/* 数学公式（KaTeX 排版） */
.math.display { display: block; margin: 1.1em 0; text-align: center; overflow-x: auto; overflow-y: hidden; padding: 2px 0; }
.math .katex { font-size: 1.08em; }
.math.display .katex-display { margin: 0; }
.math-help { margin: 4px 0 12px; color: var(--muted); font-size: 15px; line-height: 1.8; }
.math-help summary { cursor: pointer; color: var(--primary); }
.math-help p { margin: 6px 0; }
.math-help code { padding: 0 4px; border-radius: 4px; background: rgba(120, 90, 60, .1); font-size: 14px; }

/* 导航右边的几个链接；评论消息的未读数 */
.top-links { display: flex; gap: 18px; align-items: baseline; }
.badge { display: inline-block; min-width: 20px; margin-left: 4px; padding: 0 6px; border-radius: 10px; background: var(--primary); color: #FFF4E6; font: 13px/20px system-ui, sans-serif; text-align: center; }

/* 评论区 */
.comments { margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--rule); }
.comments-title { margin: 0 0 12px; font-size: 22px; font-weight: 400; }
.comments-title small { color: var(--muted); font-size: 16px; }
.comment-admin { margin: 0 0 12px; color: var(--muted); font-size: 15px; line-height: 1.8; }
.comment-form textarea { resize: vertical; min-height: 4.5em; font-size: 17px; line-height: 1.7; }
.comment-send { display: flex; justify-content: flex-end; align-items: center; gap: 14px; margin-top: 8px; }
.comment-send .count { margin-right: auto; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.comment-list { margin-top: 18px; }
.thread { padding: 16px 0; border-bottom: 1px solid var(--rule); }
.thread:last-child { border-bottom: 0; }
.comment header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; color: var(--muted); font-size: 15px; line-height: 1.7; }
.comment-author { color: var(--text); text-decoration: none; font-size: 16px; }
.comment-author:hover { color: var(--primary); }
.comment-body { margin: 4px 0 0; font-size: 17px; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-gone { margin: 0; color: var(--muted); font-size: 15px; font-style: italic; }
.comment-tools { display: flex; gap: 16px; margin-top: 4px; font-size: 14px; }
.comment-tools .muted, .comment .muted { color: var(--muted); font-size: 14px; }
.comment.pending .comment-body { color: var(--soft); }
.tag { display: inline-block; padding: 0 7px; border: 1px solid var(--primary); border-radius: 4px; color: var(--primary); font-size: 12px; line-height: 18px; }
.tag.wait { border-style: dashed; border-color: var(--muted); color: var(--muted); }
.replies { margin: 10px 0 0 22px; padding-left: 14px; border-left: 2px solid var(--rule); }
.replies .comment { padding: 8px 0; }
.replies .comment-form { margin: 8px 0 4px; }
@media (max-width: 560px) {
  .replies { margin-left: 4px; padding-left: 12px; }
}

/* 搜索框（首页、阅读园、研究园）：普通表单，不用 JavaScript，Kindle 也能用 */
.site-search { display: flex; gap: 8px; margin: 0 0 28px; }
.site-search input[type=search] { flex: 1; min-width: 0; padding: 9px 12px; border: 1px solid var(--rule); border-radius: 8px;
  background: var(--card); color: var(--text); font: 17px/1.5 var(--kai); }
.page .site-search button { flex: none; padding: 8px 18px; border-color: var(--primary); background: var(--primary); color: #FFF4E6; }

/* 经期记录：日历上的「来了 / 预计 / 易孕期 / 排卵日」除了颜色还有实线、虚线、点线、★ 区分，黑白屏和色弱也分得清 */
.cycle { margin: 8px 0 24px; }
.cycle-now { padding: 18px 20px; border: 1px solid var(--rule); border-radius: 14px; background: var(--card, var(--bg)); }
.cycle-big { margin: 0; font-size: 22px; color: var(--text); }
.cycle-big b { color: var(--primary); font-size: 40px; font-weight: 400; font-variant-numeric: tabular-nums; margin: 0 4px; }
.cycle-small { margin: 6px 0 0; color: var(--soft); font-size: 15px; line-height: 1.8; }
.cycle-quick { margin: 12px 0 20px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-head b { font-size: 18px; font-weight: 400; }
.page .cal-head button { padding: 2px 14px; font-size: 20px; }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-week span { text-align: center; color: var(--muted); font-size: 13px; }
.page .cal-day {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  min-height: 48px; padding: 2px 0; border: 1px solid var(--rule); border-radius: 8px; background: var(--card, var(--bg));
  color: var(--text); font: 16px/1.2 system-ui, -apple-system, sans-serif;
}
.page .cal-day.future { cursor: default; color: var(--muted); }
.page .cal-day.future:hover { border-color: var(--rule); color: var(--muted); }
.cal-day .m { font-size: 9px; letter-spacing: -1px; line-height: 1; min-height: 9px; }
.page .cal-day.period { background: var(--primary); border-color: var(--primary); color: #FFF4E6; }
.page .cal-day.predicted { border: 2px dashed var(--primary); }
.page .cal-day.fertile { border: 2px dotted var(--soft); background: rgba(120, 90, 60, .07); }
.page .cal-day.ovulation { border: 2px dotted var(--soft); background: rgba(120, 90, 60, .14); }
.page .cal-day.today { outline: 2px solid var(--text); outline-offset: 1px; }
.page .cal-day.selected { box-shadow: 0 0 0 3px var(--primary); }
.cal-key { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 2; }
.cal-key .k { display: inline-flex; align-items: center; gap: 4px; margin-right: 10px; }
.cal-key .k::before { content: ''; width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--rule); }
.cal-key .period::before { background: var(--primary); border-color: var(--primary); }
.cal-key .predicted::before { border: 2px dashed var(--primary); }
.cal-key .fertile::before { border: 2px dotted var(--soft); background: rgba(120, 90, 60, .07); }
.cal-key .ovulation::before { content: '★'; width: auto; height: auto; border: 0; font-size: 12px; }
.cycle-day { margin: 18px 0; padding: 16px 18px; border: 1px solid var(--rule); border-radius: 12px; }
.cycle-day h3 { margin: 0 0 10px; font-size: 18px; font-weight: 400; }
.cycle-stats h3 { margin: 18px 0 6px; font-size: 17px; font-weight: 400; }
.cycle-line { margin: 14px 0 0; color: var(--soft); font-size: 15px; line-height: 1.8; }
.cycle-history { margin: 0; padding-left: 1.2em; color: var(--soft); font-size: 15px; line-height: 1.9; }
.cycle #cycle-remind { margin-top: 20px; }
.cycle-privacy { margin-top: 14px; font-size: 13px; line-height: 1.8; }
