/* ============================================================
   人生游戏化 · 记录站
   设计令牌 1:1 复刻自 yryc.wang
   ============================================================ */

:root {
  --canvas: #10151c;
  --sidebar: #0c1117;
  --surface: #171d26;
  --surface-hover: #1b232d;
  --ink: #e8ebf2;
  --muted: #929ba8;
  --faint: #65707d;
  --line: rgb(255 255 255 / 8%);
  --line-strong: rgb(255 255 255 / 13%);
  --accent: #64adc1;
  --accent-soft: rgb(100 173 193 / 14%);
  --accent-hover: #7abdd0;
  --danger: #e4826c;
  --on-accent: #071116;
  --body-copy: #c8ced8;
  --body-copy-strong: #d6dbe3;
  --nav-hover: rgb(255 255 255 / 4%);
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sidebar-width: 12.5rem;
  --mobile-nav-height: 4rem;
  --mobile-page-gutter: 1.25rem;
  --content-width: 72rem;
  --reading: 48rem;
  color-scheme: dark;
}

html[data-theme="light"] {
  --canvas: #f4f5f6;
  --sidebar: #fff;
  --surface: #fff;
  --surface-hover: #f7f8f9;
  --ink: #1c2733;
  --muted: #5c6672;
  --faint: #7a838c;
  --line: #e2e4e7;
  --line-strong: #d4d7db;
  --accent: #135e6b;
  --accent-soft: rgb(19 94 107 / 10%);
  --accent-hover: #0f5260;
  --danger: #ad4937;
  --on-accent: #fff;
  --body-copy: #3e4954;
  --body-copy-strong: #2d3944;
  --nav-hover: rgb(19 94 107 / 6%);
  color-scheme: light;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  padding-inline-start: var(--sidebar-width);
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--sans);
  font-size: .9rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration-color: rgb(128 128 128 / 45%);
  text-underline-offset: .2em;
  text-decoration-thickness: .06em;
}
a:hover { color: var(--accent); }

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid rgb(100 173 193 / 48%);
  outline-offset: 3px;
}
html[data-theme="light"] a:focus-visible,
html[data-theme="light"] button:focus-visible,
html[data-theme="light"] input:focus-visible,
html[data-theme="light"] textarea:focus-visible {
  outline-color: rgb(19 94 107 / 45%);
}

::selection { color: var(--on-accent); background: var(--accent); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.shell {
  width: min(calc(100% - clamp(2rem, 6vw, 5rem)), var(--content-width));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: .75rem;
  left: .75rem;
  padding: .55rem .85rem;
  border-radius: .5rem;
  color: var(--canvas);
  background: var(--ink);
  transform: translateY(-160%);
  text-decoration: none;
}
.skip-link:focus { transform: translateY(0); }

/* ============ 左侧固定边栏 ============ */

.site-header {
  position: fixed;
  z-index: 20;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  border-right: 1px solid var(--line);
  background: var(--sidebar);
}

.header-inner.shell {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 1.7rem .85rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 1.5rem;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.brand-mark {
  color: var(--ink);
  font-size: .75rem;
  font-weight: 650;
  letter-spacing: .02em;
  line-height: 1.2;
  white-space: nowrap;
}
.brand-divider { color: var(--accent); }

.primary-nav {
  display: flex;
  flex-direction: column;
  gap: .22rem;
  padding-top: 1.15rem;
  font-size: .82rem;
}
.nav-section-label {
  margin: .8rem 0 .35rem;
  padding-inline: .65rem;
  color: var(--faint);
  font-size: .62rem;
  letter-spacing: .18em;
}
.primary-nav a {
  display: flex;
  min-height: 2.55rem;
  align-items: center;
  gap: .7rem;
  padding: .55rem .65rem;
  border-radius: .55rem;
  color: var(--muted);
  text-decoration: none;
}
.primary-nav a:hover { color: var(--ink); background: var(--nav-hover); }
.primary-nav a[aria-current="page"] { color: var(--ink); background: var(--accent-soft); }

.nav-icon {
  width: 1.2rem;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 1rem;
  line-height: 1;
  text-align: center;
}

.sidebar-footer {
  margin: auto .65rem 0;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.sidebar-note {
  margin: 0;
  color: var(--faint);
  font-size: .64rem;
  line-height: 1.7;
  letter-spacing: .08em;
}

/* ============ 主题切换器（侧边栏底部） ============ */

.theme-picker {
  display: flex;
  align-self: flex-start;
  gap: .18rem;
  padding: .22rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, var(--canvas));
}
.theme-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}
.theme-option:hover { color: var(--ink); background: var(--nav-hover); }
.theme-option[aria-checked="true"] { color: var(--accent); background: var(--accent-soft); }
.theme-icon {
  display: block;
  width: 1rem;
  height: 1rem;
  background: currentColor;
  -webkit-mask: center/contain no-repeat;
  mask: center/contain no-repeat;
}
/* 图标 = yryc.wang 原站同款 Lucide（月亮/显示器/太阳），内嵌 data-URI，不依赖服务器 svg MIME */
.theme-icon-dark {
  -webkit-mask-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3E %3Cpath d="M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401"/%3E %3C/svg%3E');
  mask-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3E %3Cpath d="M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401"/%3E %3C/svg%3E');
}
.theme-icon-auto {
  -webkit-mask-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3E %3Crect width="20" height="14" x="2" y="3" rx="2"/%3E %3Cline x1="8" x2="16" y1="21" y2="21"/%3E %3Cline x1="12" x2="12" y1="17" y2="21"/%3E %3C/svg%3E');
  mask-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3E %3Crect width="20" height="14" x="2" y="3" rx="2"/%3E %3Cline x1="8" x2="16" y1="21" y2="21"/%3E %3Cline x1="12" x2="12" y1="17" y2="21"/%3E %3C/svg%3E');
}
.theme-icon-light {
  -webkit-mask-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3E %3Ccircle cx="12" cy="12" r="4"/%3E %3Cpath d="M12 2v2"/%3E %3Cpath d="M12 20v2"/%3E %3Cpath d="m4.93 4.93 1.41 1.41"/%3E %3Cpath d="m17.66 17.66 1.41 1.41"/%3E %3Cpath d="M2 12h2"/%3E %3Cpath d="M20 12h2"/%3E %3Cpath d="m6.34 17.66-1.41 1.41"/%3E %3Cpath d="m19.07 4.93-1.41 1.41"/%3E %3C/svg%3E');
  mask-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3E %3Ccircle cx="12" cy="12" r="4"/%3E %3Cpath d="M12 2v2"/%3E %3Cpath d="M12 20v2"/%3E %3Cpath d="m4.93 4.93 1.41 1.41"/%3E %3Cpath d="m17.66 17.66 1.41 1.41"/%3E %3Cpath d="M2 12h2"/%3E %3Cpath d="M20 12h2"/%3E %3Cpath d="m6.34 17.66-1.41 1.41"/%3E %3Cpath d="m19.07 4.93-1.41 1.41"/%3E %3C/svg%3E');
}

/* ============ 首页 ============ */

.home-main { display: block; }

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, .46fr);
  gap: clamp(2rem, 4vw, 4rem);
  align-items: end;
  padding-block: clamp(2.3rem, 5vw, 4rem) 1.35rem;
  border-bottom: 1px solid var(--line);
}

/* 左列：小字 + 大标题 + 一句副标（标题必须在最上方，别让它被网格挤到右列） */
.intro-copy { min-width: 0; }
.intro-copy .eyebrow { margin-bottom: .55rem; }
.intro-side { display: flex; flex-direction: column; gap: .8rem; min-width: 0; }

.eyebrow {
  margin: 0 0 .55rem;
  color: var(--accent);
  font-size: .68rem;
  font-weight: 650;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.intro-copy h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.7rem, 4vw, 2.35rem);
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -.01em;
}

.intro-note {
  margin: .8rem 0 0;
  max-width: 34rem;
  color: var(--muted);
  font-size: .86rem;
}

.intro-actions { display: flex; flex-direction: column; gap: .8rem; }

.search-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem .9rem;
  border: 1px solid var(--line-strong);
  border-radius: .6rem;
  color: var(--muted);
  background: var(--surface);
  font-size: .76rem;
  text-decoration: none;
  transition: border-color 150ms ease, color 150ms ease;
}
.search-link:hover { color: var(--accent); border-color: var(--accent); }

.timeline-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin: .75rem 0 0;
}
.timeline-stats div {
  padding: .7rem .8rem;
  border: 1px solid var(--line);
  border-radius: .6rem;
  background: var(--surface);
}
.timeline-stats dt { color: var(--faint); font-size: .64rem; letter-spacing: .1em; }
.timeline-stats dd { margin: .25rem 0 0; color: var(--ink); font-size: .95rem; font-weight: 650; }

/* 首页统计：右侧搜索框下面的一行紧凑小字（跟目标站一致） */
.intro-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .18rem .42rem;
  margin: 0;
  color: var(--faint);
  font-size: .7rem;
  line-height: 1.5;
}
.intro-meta b { color: var(--muted); font-weight: 650; font-family: var(--mono); }
.intro-meta .sep { color: var(--line-strong); }

/* ============ 时间线 ============ */

.timeline { padding-bottom: 3rem; }
.timeline-feed { display: block; }

.day-group {
  padding-block: 1.45rem 2.35rem;
  border-bottom: 1px solid var(--line);
}
.day-group:last-child { border-bottom: 0; }

.day-heading {
  display: flex;
  align-items: baseline;
  gap: .7rem;
  margin-bottom: .85rem;
  padding-inline: .45rem;
}
.day-date { color: var(--ink); font-size: .91rem; font-weight: 650; }
.day-weekday, .day-count { color: var(--muted); font-size: .7rem; }
.day-count { margin-inline-start: auto; }

.day-entries {
  position: relative;
  padding-inline-start: 1.3rem;
  border-inline-start: 1px solid var(--line);
  margin-inline-start: .1rem;
}

.timeline-entry { position: relative; scroll-margin-top: 1.5rem; margin-bottom: .7rem; }

.entry-rail {
  position: absolute;
  z-index: 2;
  top: 1.25rem;
  left: -1.53rem;
}
.entry-dot {
  display: block;
  width: .42rem;
  height: .42rem;
  border: 2px solid var(--canvas);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px rgb(100 173 193 / 66%);
}

.entry-content {
  position: relative;
  padding: 1.05rem 1.2rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: .8rem;
  background: var(--surface);
  transition: border-color 150ms ease, background 150ms ease;
}
.entry-content:hover { border-color: var(--line-strong); }

.entry-header {
  min-height: 1.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--faint);
  font-size: .66rem;
}
.entry-time { display: flex; align-items: center; gap: .75rem; margin: 0; font-family: var(--mono); }
.entry-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: .9rem; }

.copy-entry-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--faint);
  font: inherit;
  cursor: pointer;
  transition: color 140ms ease;
}
.copy-entry-button:hover { color: var(--accent); }

.permalink {
  color: var(--faint);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .2rem;
}
.permalink:hover { color: var(--accent); }

.entry-content h2 {
  margin: .5rem 0 .55rem;
  font-size: 1.02rem;
  font-weight: 650;
  line-height: 1.45;
}
.entry-content h2 a { text-decoration: none; }
.entry-content h2 a:hover { color: var(--accent); }

.entry-excerpt { margin: 0; color: var(--body-copy); font-size: .84rem; line-height: 1.7; }
.entry-excerpt--clamped {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.entry-expand-actions { margin-top: .55rem; }
.entry-expand-toggle {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: .74rem;
  font-weight: 650;
  cursor: pointer;
}
.entry-expand-toggle:hover { color: var(--accent-hover); }

.entry-full { margin: .6rem 0 0; color: var(--body-copy); font-size: .84rem; line-height: 1.75; }
.entry-full p { margin: 0 0 .5rem; }
.entry-full p:last-child { margin-bottom: 0; }

/* ============ 标签 ============ */

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem .55rem;
  margin: .75rem 0 0;
  padding: 0;
  list-style: none;
}
.tag-list a {
  padding: .18rem .5rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .68rem;
  text-decoration: none;
  transition: background 140ms ease;
}
.tag-list a:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); }

/* ============ 留言区 ============ */

.entry-comment-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .55rem;
  margin-top: .85rem;
  padding-top: .8rem;
  border-top: 1px dashed var(--line);
  color: var(--faint);
  font-size: .7rem;
}
.entry-comment-hint { min-width: 0; }
/* 点赞 + 留言 靠右对齐（跟目标站一致） */
.entry-foot-actions { display: flex; align-items: center; gap: .4rem; margin-inline-start: auto; }

.entry-like-button {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .28rem .7rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .68rem;
  cursor: pointer;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
}
.entry-like-button:hover { color: var(--accent); border-color: var(--accent); }
.entry-like-button[data-liked="1"] { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.entry-like-count { font-family: var(--mono); }
.entry-like-count[hidden] { display: none; }
.entry-comment-button {
  padding: .28rem .7rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .68rem;
  cursor: pointer;
  transition: color 140ms ease, border-color 140ms ease;
}
.entry-comment-button:hover { color: var(--accent); border-color: var(--accent); }

/* ============ 通用页面头 ============ */

.page-intro {
  padding-block: clamp(2.3rem, 5vw, 3.6rem) 1.6rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.8rem;
}
.page-intro h1 {
  margin: 0;
  font-size: clamp(1.5rem, 3.6vw, 2rem);
  font-weight: 650;
  line-height: 1.3;
}
.page-intro p { margin: .7rem 0 0; color: var(--muted); font-size: .85rem; max-width: 38rem; }

/* ============ 搜索页 ============ */

.search-panel { max-width: var(--reading); }
.search-form label { display: block; margin-bottom: .5rem; color: var(--muted); font-size: .74rem; font-weight: 650; }
.search-control { display: flex; gap: .5rem; }
.search-control input {
  flex: 1;
  min-height: 2.7rem;
  padding: 0 .85rem;
  border: 1px solid var(--line-strong);
  border-radius: .55rem;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: .86rem;
}
.search-control input::placeholder { color: var(--faint); }
.search-control button {
  min-height: 2.7rem;
  padding: 0 1.1rem;
  border: 1px solid var(--accent);
  border-radius: .55rem;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-size: .8rem;
  font-weight: 650;
  cursor: pointer;
}
html[data-theme="light"] .search-control button { color: #fff; }
.search-help { margin: .55rem 0 0; color: var(--faint); font-size: .7rem; }
.search-status { margin: 1.4rem 0 .8rem; color: var(--muted); font-size: .78rem; }

.search-results { list-style: none; margin: 0; padding: 0; }
.search-results li {
  padding: .95rem 0;
  border-bottom: 1px solid var(--line);
}
.search-results h3 { margin: 0 0 .3rem; font-size: .92rem; font-weight: 650; }
.search-results h3 a { text-decoration: none; }
.search-results .meta { color: var(--faint); font-size: .68rem; }
.search-results p { margin: .35rem 0 0; color: var(--body-copy); font-size: .8rem; }

/* ============ 标签页 ============ */

.tag-index {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: .55rem;
  list-style: none;
  margin: 0;
  padding: 0 0 3rem;
}
.tag-index a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .8rem;
  padding: .8rem .95rem;
  border: 1px solid var(--line);
  border-radius: .6rem;
  background: var(--surface);
  text-decoration: none;
  transition: border-color 150ms ease;
}
.tag-index a:hover { border-color: var(--accent); }
.tag-index .t { color: var(--ink); font-size: .82rem; font-weight: 650; }
.tag-index .c { color: var(--faint); font-size: .68rem; font-family: var(--mono); }

/* ============ 整理页 ============ */

.daily-main { padding-bottom: 3rem; }
.daily-layout {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

.daily-browser {
  position: sticky;
  top: 2rem;
  padding: 1.1rem .9rem;
  border: 1px solid var(--line);
  border-radius: .8rem;
  background: var(--surface);
  max-height: calc(100vh - 4rem);
  overflow: auto;
}

.report-switcher { display: flex; gap: .3rem; margin-bottom: 1rem; }
.report-tab {
  padding: .3rem .6rem;
  border-radius: .45rem;
  color: var(--muted);
  font-size: .7rem;
  text-decoration: none;
}
.report-tab:hover { color: var(--ink); background: var(--nav-hover); }
.report-tab[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.report-tab-disabled { color: var(--faint); cursor: not-allowed; opacity: .6; }
.report-tab-disabled small { display: block; font-size: .58rem; }

.daily-browser-header { margin-bottom: .9rem; }
.daily-browser-header h2 { margin: 0; font-size: .95rem; font-weight: 650; }
.daily-browser-header p { margin: .3rem 0 0; color: var(--faint); font-size: .68rem; }

.daily-tree { display: flex; flex-direction: column; gap: .5rem; }
.daily-month summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  padding: .35rem .4rem;
  border-radius: .4rem;
  color: var(--muted);
  font-size: .7rem;
  cursor: pointer;
  list-style: none;
}
.daily-month summary::-webkit-details-marker { display: none; }
.daily-month summary:hover { color: var(--ink); background: var(--nav-hover); }
.daily-month summary span:last-child { color: var(--faint); font-size: .62rem; font-family: var(--mono); }
.daily-month ul { list-style: none; margin: .25rem 0 .4rem; padding: 0 0 0 .55rem; border-inline-start: 1px solid var(--line); }
.daily-month li { margin: .1rem 0; }
.daily-month li a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  padding: .3rem .45rem;
  border-radius: .4rem;
  color: var(--muted);
  font-size: .72rem;
  text-decoration: none;
}
.daily-month li a:hover { color: var(--ink); background: var(--nav-hover); }
.daily-month li a[aria-current="date"] { color: var(--accent); background: var(--accent-soft); }
.daily-weekday { color: var(--faint); font-size: .62rem; margin-inline-start: .3rem; }
.daily-entry-count { color: var(--faint); font-size: .62rem; font-family: var(--mono); }

/* ============ 单条详情页（一比一复刻 yryc.wang） ============ */

.single-main { max-width: 56rem; padding-block: 2rem 6rem; }

.breadcrumb { margin-bottom: 1.25rem; font-size: .72rem; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }

.single-thought {
  max-width: var(--reading);
  margin-inline: auto;
  padding: clamp(1.5rem, 4vw, 3rem);
  border: 1px solid var(--line);
  border-radius: .9rem;
  background: var(--surface);
}
.single-header { padding-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.single-date { margin: 0 0 .75rem; color: var(--accent); font-size: .68rem; font-weight: 600; letter-spacing: .04em; }
.single-header h1 { margin: 0; font-size: clamp(1.65rem, 4vw, 2.75rem); font-weight: 650; letter-spacing: -.04em; line-height: 1.32; text-wrap: balance; }
.single-empty { margin: 1rem 0 0; color: var(--muted); font-size: .86rem; }
.single-copy-actions { display: flex; align-items: center; gap: .5rem; margin-top: 1rem; }
.single-copy-actions .copy-entry-button {
  min-height: 2.5rem;
  padding-inline: .8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-hover);
  font-size: .72rem;
  color: var(--muted);
}
.single-copy-actions .copy-entry-button:hover { border-color: var(--accent); color: var(--accent); }

.single-body { padding-block: clamp(1.75rem, 5vw, 3rem); border-bottom: 1px solid var(--line); }
.single-body .thought-body { color: var(--body-copy-strong); font-size: clamp(1rem, 1.8vw, 1.1rem); line-height: 1.55; }
.single-body .media-thought-body p { margin: 0 0 1.35rem; white-space: pre-line; }
.single-body .media-thought-body p:last-child { margin-bottom: 0; }
.thought-body { color: var(--body-copy-strong); font-size: .92rem; line-height: 1.85; }
.thought-body p { margin: 0 0 .85rem; }
.thought-body p:last-child { margin-bottom: 0; }
.thought-body a { color: var(--accent); }

/* 点赞区 */
.article-like {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .8rem 1rem;
  padding-block: 1.25rem;
  border-bottom: 1px solid var(--line);
}
.article-like-copy p, .article-like-copy span, .article-like-status { margin: 0; }
.article-like-copy p { color: var(--ink); font-size: .82rem; font-weight: 650; }
.article-like-copy span { display: block; margin-top: .22rem; color: var(--faint); font-size: .68rem; }
.article-like-actions { display: flex; align-items: center; gap: .65rem; }
.article-like-button {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
  min-height: 2.5rem;
  padding: 0 .85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--canvas);
  color: var(--ink);
  font: inherit;
  font-size: .74rem;
  font-weight: 650;
  cursor: pointer;
}
.article-like-button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.article-like-button[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--accent) 72%, var(--line));
  background: color-mix(in srgb, var(--accent) 12%, var(--canvas));
  color: var(--accent);
}
.article-like-button:disabled { cursor: wait; opacity: .58; }
.article-like-heart { font-size: 1rem; line-height: 1; }
.article-like-count { color: var(--faint); font-size: .68rem; }
.article-like-status { grid-column: 1 / -1; min-height: 1em; color: var(--faint); font-size: .68rem; }
.article-like[data-like-state="ready"] .article-like-status:empty { display: none; }

/* 标签行 */
.single-tags {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr);
  gap: .75rem;
  align-items: start;
  padding-block: 1.25rem;
  border-bottom: 1px solid var(--line);
}
.single-tags p { margin: .08rem 0 0; color: var(--faint); font-size: .66rem; }
.single-tags .tag-list { margin: 0; }
.single-tags .tag-list a {
  display: inline-block;
  padding: 0;
  background: none;
  color: var(--faint);
  font-size: .66rem;
  line-height: 1.6;
}
.single-tags .tag-list a:hover { background: none; color: var(--accent); }

/* 发布记录 */
.thought-record {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.25rem;
  color: var(--faint);
  font-size: .61rem;
}
.thought-record code { font-family: var(--mono); overflow-wrap: anywhere; }
.edit-entry { margin-inline-start: auto; color: var(--accent); white-space: nowrap; text-decoration: none; }
.edit-entry:hover { color: var(--accent-hover); }

/* 继续阅读 */
.single-after { max-width: var(--reading); margin: 1.5rem auto 0; }
.single-after a {
  display: flex;
  justify-content: space-between;
  padding: .9rem 1rem;
  border: 1px solid var(--line);
  border-radius: .7rem;
  color: var(--muted);
  font-size: .72rem;
  text-decoration: none;
}
.single-after a:hover { border-color: var(--accent); color: var(--accent); }

/* 站点页脚 */
.site-footer { border-top: 1px solid var(--line); margin-top: 2rem; }
.footer-inner {
  min-height: 5.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--faint);
  font-size: .67rem;
}
.footer-inner p { margin: 0; }
.footer-inner a { text-decoration: none; }
.footer-inner a:hover { color: var(--accent); }

@media (max-width: 48rem) {
  .single-main { padding: 1rem 0 3rem; }
  .single-thought { padding: 1.25rem 0; border-inline: 0; border-radius: 0; background: none; }
  .single-header h1 { font-size: 1.65rem; }
  .single-body .thought-body { font-size: 1.06rem; line-height: 1.7; }
  .single-tags { grid-template-columns: 1fr; }
  .thought-record { align-items: flex-start; flex-direction: column; }
  .article-like { grid-template-columns: 1fr; }
  .article-like-actions { justify-content: space-between; }
  .article-like-status { grid-column: auto; }
}

/* ============ 发布页 ============ */

.publish-main { padding-bottom: 4rem; }
.publish-intro { border-bottom: 1px solid var(--line); }
.publish-workspace { max-width: 46rem; }

.publish-form { display: flex; flex-direction: column; gap: 1.15rem; }
.publish-field label {
  display: block;
  margin-bottom: .5rem;
  color: var(--muted);
  font-size: .74rem;
  font-weight: 650;
}
.publish-field textarea {
  width: 100%;
  min-height: 13rem;
  padding: .9rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: .7rem;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: .88rem;
  line-height: 1.75;
  resize: vertical;
}
.publish-field textarea::placeholder { color: var(--faint); }

.field-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-top: .45rem;
  color: var(--faint);
  font-size: .68rem;
}
.field-meta p { margin: 0; }
.field-meta p:last-child { font-family: var(--mono); }

.credential-fieldset {
  margin: 0;
  padding: 1rem 1.1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: .7rem;
  background: var(--surface);
}
.credential-fieldset legend { padding: 0 .4rem; color: var(--muted); font-size: .68rem; font-weight: 650; letter-spacing: .08em; }
.credential-label { display: block; margin-bottom: .4rem; color: var(--muted); font-size: .72rem; }
.credential-fieldset input[type="password"],
.credential-fieldset input[type="text"] {
  width: 100%;
  min-height: 2.6rem;
  padding: 0 .8rem;
  border: 1px solid var(--line-strong);
  border-radius: .5rem;
  background: var(--canvas);
  color: var(--ink);
  font: inherit;
  font-size: .85rem;
}
.field-help { margin: .45rem 0 0; color: var(--faint); font-size: .66rem; }

.remember-control {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin-top: .8rem;
  color: var(--muted);
  font-size: .72rem;
  cursor: pointer;
}
.remember-control input { width: 1rem; height: 1rem; accent-color: var(--accent); }

.publish-status { margin: 0; min-height: 1.3em; color: var(--accent); font-size: .76rem; }
.publish-status[data-state="error"] { color: var(--danger); }

.primary-button {
  align-self: flex-start;
  min-height: 2.8rem;
  padding: 0 1.4rem;
  border: 1px solid var(--accent);
  border-radius: .6rem;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-size: .84rem;
  font-weight: 650;
  cursor: pointer;
  transition: background 150ms ease;
}
.primary-button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.primary-button:disabled { opacity: .5; cursor: wait; }
html[data-theme="light"] .primary-button { color: #fff; }

.quiet-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  min-height: 2.4rem;
  padding: .3rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: .55rem;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .78rem;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.quiet-button:hover { color: var(--ink); border-color: var(--accent); text-decoration: none; }
.quiet-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 复制结果提示条 */
.copy-toast {
  position: fixed;
  z-index: 90;
  left: 50%;
  bottom: 1.6rem;
  transform: translate(-50%, .6rem);
  padding: .55rem 1.1rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-raised, var(--surface));
  color: var(--ink);
  font-size: .8rem;
  box-shadow: 0 10px 30px rgb(0 0 0 / 28%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}
.copy-toast[data-show="1"] { opacity: 1; transform: translate(-50%, 0); }

.publish-confirmation {
  margin-top: 1.6rem;
  padding: 1.3rem 1.4rem;
  border: 1px solid var(--accent);
  border-radius: .8rem;
  background: var(--accent-soft);
}
.publish-confirmation h2 { margin: .2rem 0 .5rem; font-size: 1.05rem; font-weight: 650; }
.publish-confirmation p { margin: 0 0 .3rem; color: var(--body-copy); font-size: .8rem; }
.confirmation-preview {
  margin: .8rem 0 1rem;
  padding: .9rem 1rem;
  border: 1px solid var(--line);
  border-radius: .6rem;
  background: var(--surface);
  color: var(--body-copy-strong);
  font-size: .84rem;
  line-height: 1.7;
  max-height: 14rem;
  overflow: auto;
  white-space: pre-wrap;
}
.confirmation-actions { display: flex; gap: .6rem; }

.ai-hint {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0;
  color: var(--faint);
  font-size: .7rem;
}
.ai-hint .dot { width: .4rem; height: .4rem; border-radius: 50%; background: var(--accent); }

/* 语音输入 */
.voice-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.voice-button {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 2.4rem;
  padding: 0 .9rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: .76rem;
  cursor: pointer;
}
.voice-button:hover { color: var(--accent); border-color: var(--accent); }
.voice-button[data-listening="1"] { color: var(--danger); border-color: var(--danger); }
.voice-button .vicon { width: .55rem; height: .55rem; border-radius: 50%; background: currentColor; }
.voice-button[data-listening="1"] .vicon { animation: pulse 1.1s infinite ease-in-out; }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.75); } }
.voice-status { color: var(--faint); font-size: .68rem; }

/* 配图选择 */
.publish-images .field-optional { margin-left: .3rem; color: var(--faint); font-weight: 400; }
.image-picker { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
/* 真的 file input 藏起来，用按钮接管，手机上才能稳定唤起相册和相机 */
.image-picker-input { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.image-picker-button {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 2.4rem;
  padding: 0 .95rem;
  border: 1px dashed var(--line-strong);
  border-radius: .6rem;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: .78rem;
  cursor: pointer;
}
.image-picker-button:hover { color: var(--accent); border-color: var(--accent); }
.image-picker-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .8rem;
  line-height: 1;
}
.image-picker-button .field-help { flex-basis: 100%; }

.image-picker-list {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin: .8rem 0 0;
  padding: 0;
  list-style: none;
}
.image-picker-item {
  position: relative;
  width: 5.2rem;
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: var(--surface);
  overflow: hidden;
}
.image-picker-thumb { display: block; width: 100%; aspect-ratio: 1 / 1; background: var(--canvas); }
.image-picker-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.image-picker-meta {
  display: block;
  padding: .3rem .4rem;
  color: var(--faint);
  font-family: var(--mono);
  font-size: .6rem;
  text-align: center;
}
.image-picker-remove {
  position: absolute;
  top: .25rem;
  right: .25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgb(0 0 0 / 62%);
  color: #fff;
  font: inherit;
  font-size: .85rem;
  line-height: 1;
  cursor: pointer;
}
.image-picker-remove:hover { background: var(--danger); }
.image-picker-status { margin: .55rem 0 0; min-height: 1.2em; color: var(--faint); font-size: .68rem; }
.image-picker-status[data-state="error"] { color: var(--danger); }

/* 详情页 / 列表里的配图 */
.media-picture { display: block; margin-block: 1.5rem; }
.media-picture img { display: block; width: 100%; height: auto; border-radius: .4rem; background: var(--canvas); }

.entry-media-note {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  margin-left: .5rem;
  padding: .1rem .45rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .62rem;
  white-space: nowrap;
}

/* 列表里的配图：直接把图显示出来，点一下进详情页看全部 */
.entry-media {
  position: relative;
  display: block;
  max-width: 34rem;
  margin: .7rem 0 1rem;
  border: 1px solid var(--line);
  border-radius: .8rem;
  overflow: hidden;
  background: var(--surface);
  line-height: 0;
}
.entry-media img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 24rem;
  object-fit: cover;
  object-position: center;
  transition: opacity .18s ease;
}
.entry-media:hover img,
.entry-media:focus-visible img {
  opacity: .92;
}
.entry-media-count {
  position: absolute;
  right: .6rem;
  bottom: .6rem;
  padding: .1rem .5rem;
  border-radius: 999px;
  background: rgb(0 0 0 / 58%);
  color: #fff;
  font-size: .62rem;
  line-height: 1.7;
}
@media (max-width: 640px) {
  .entry-media {
    max-width: 100%;
  }
  .entry-media img {
    max-height: 20rem;
  }
}

/* ============ 后台 ============ */

.admin-main { padding-bottom: 4rem; }
.admin-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}
.admin-bar .count { color: var(--faint); font-size: .72rem; font-family: var(--mono); }

.admin-table { width: 100%; border-collapse: collapse; font-size: .78rem; }
.admin-table th {
  text-align: left;
  padding: .55rem .6rem;
  border-bottom: 1px solid var(--line-strong);
  color: var(--faint);
  font-size: .66rem;
  font-weight: 650;
  letter-spacing: .06em;
}
.admin-table td { padding: .6rem; border-bottom: 1px solid var(--line); color: var(--body-copy); vertical-align: top; }
.admin-table tr:hover td { background: var(--nav-hover); }
.admin-table .t { color: var(--ink); font-weight: 650; }
.admin-table .m { color: var(--faint); font-size: .68rem; font-family: var(--mono); white-space: nowrap; }
.admin-table .acts { white-space: nowrap; }
.admin-table .acts a, .admin-table .acts button {
  margin-inline-end: .5rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: .72rem;
  cursor: pointer;
  text-decoration: none;
}
.admin-table .acts .del { color: var(--danger); }

.admin-form { max-width: 46rem; display: flex; flex-direction: column; gap: 1rem; }
.admin-form label { display: block; margin-bottom: .4rem; color: var(--muted); font-size: .74rem; font-weight: 650; }
.admin-form input[type="text"], .admin-form input[type="password"], .admin-form textarea {
  width: 100%;
  padding: .7rem .85rem;
  border: 1px solid var(--line-strong);
  border-radius: .55rem;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: .85rem;
}
.admin-form textarea { min-height: 12rem; line-height: 1.7; resize: vertical; }

.notice {
  padding: .8rem 1rem;
  border: 1px solid var(--accent);
  border-radius: .6rem;
  background: var(--accent-soft);
  color: var(--body-copy-strong);
  font-size: .78rem;
  margin-bottom: 1rem;
}
.notice[data-kind="error"] { border-color: var(--danger); background: rgb(228 130 108 / 12%); color: var(--danger); }

/* ============ 响应式 ============ */

@media (max-width: 60rem) {
  .intro { grid-template-columns: 1fr; align-items: start; }
  .daily-layout { grid-template-columns: 1fr; }
  .daily-browser { position: static; max-height: none; }
}

@media (max-width: 48rem) {
  body { padding-inline-start: 0; padding-block-start: var(--mobile-nav-height); }
  .site-header {
    inset: 0 0 auto 0;
    width: 100%;
    height: var(--mobile-nav-height);
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .header-inner.shell {
    flex-direction: row;
    align-items: center;
    gap: .8rem;
    padding: 0 var(--mobile-page-gutter);
  }
  .brand { padding: 0; border-bottom: 0; }
  .brand-mark { font-size: .68rem; }
  .primary-nav {
    flex-direction: row;
    gap: .1rem;
    padding-top: 0;
    margin-inline-start: auto;
    font-size: .68rem;
    overflow-x: auto;
  }
  .nav-section-label, .sidebar-note { display: none; }
  .sidebar-footer { margin: 0; gap: 0; }
  /* 手机端顶部横条放不下切换器，改成右下角小悬浮钮 */
  .theme-picker {
    position: fixed;
    z-index: 22;
    bottom: 1rem;
    right: 1rem;
    padding: .18rem;
    box-shadow: 0 2px 10px rgb(0 0 0 / 18%);
  }
  .theme-option { width: 1.6rem; height: 1.6rem; }
  .theme-icon { width: .8rem; height: .8rem; }
  .primary-nav a {
    min-height: 2rem;
    flex-direction: column;
    gap: 0;
    padding: .3rem .45rem;
    border-radius: .4rem;
    white-space: nowrap;
  }
  .nav-icon { width: auto; font-size: .6rem; }

  .shell { width: calc(100% - var(--mobile-page-gutter) * 2); }
  .day-heading { flex-wrap: wrap; }
  .entry-header { flex-direction: column; align-items: flex-start; gap: .4rem; }
  .entry-actions { justify-content: flex-start; }
  .admin-table th:nth-child(3), .admin-table td:nth-child(3) { display: none; }
}

/* ============ 分页 / 周报 / 详情页补充 ============ */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  flex-wrap: wrap;
  margin-top: 1.8rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}
.pager .m, .pager span { color: var(--faint); font-size: .7rem; font-family: var(--mono); }
.pager .quiet-button { text-decoration: none; }

.daily-content { flex: 1 1 auto; min-width: 0; }
.daily-content > .intro-note { margin-top: 1.4rem; }

.week-list { list-style: none; margin: .25rem 0 .4rem; padding: 0 0 0 .55rem; border-inline-start: 1px solid var(--line); }
.week-list li { margin: .1rem 0; }
.week-list a { display: flex; align-items: baseline; gap: .4rem; padding: .22rem .35rem; border-radius: .3rem; color: var(--muted); font-size: .74rem; text-decoration: none; }
.week-list a:hover { color: var(--ink); background: var(--nav-hover); }
.week-list a[aria-current="date"] { color: var(--accent); background: var(--accent-soft); }

.week-summary { margin-bottom: 1.6rem; }
.week-summary .day-heading { border-bottom: 1px solid var(--line); }
.week-summary .tag-list { margin-top: .8rem; }
.week-summary .tag-list .c { color: var(--faint); font-size: .62rem; font-family: var(--mono); margin-inline-start: .15rem; }

.single-pager { margin-top: 2.2rem; }
.single-pager .quiet-button { text-decoration: none; max-width: 48%; }

.tags-main .tag-index { margin-top: 1.4rem; }
.search-main .search-results { margin-top: 1.2rem; }
.admin-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ============ 留言面板 ============ */

.comment-panel {
  margin-top: .55rem;
  padding: 1.15rem 1.2rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: .8rem;
  background: var(--surface-hover);
}
.comment-panel[hidden] { display: none; }

.comment-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.comment-panel-head > div { min-width: 0; }
.comment-panel-title { margin: .1rem 0 .35rem; color: var(--ink); font-size: 1.06rem; font-weight: 650; }
.comment-panel-subject { margin: 0 0 .45rem; color: var(--body-copy-strong); font-size: .82rem; }
.comment-panel-note { margin: 0; color: var(--muted); font-size: .74rem; line-height: 1.6; }
.comment-collapse { flex: 0 0 auto; }

/* ============ 留言：标题 / 游客卡 / 邮箱提示 ============ */

.comments-panel {
  max-width: var(--reading);
  margin: 2rem auto 0;
  padding: clamp(1.25rem, 4vw, 2rem);
  scroll-margin-top: 1.5rem;
  border: 1px solid var(--line);
  border-radius: .9rem;
  background: var(--surface);
}

.comments-heading { position: relative; padding-bottom: 1rem; }
.comments-heading .eyebrow { margin: 0 0 .45rem; color: var(--accent); }
.comments-heading h2 { margin: 0; font-size: clamp(1.2rem, 3vw, 1.65rem); letter-spacing: -.025em; line-height: 1.4; font-weight: 650; }
.comments-heading > p:last-of-type { margin: .65rem 0 0; color: var(--muted); font-size: .78rem; }
.comment-collapse { position: absolute; top: 0; right: 0; }

.visitor-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.25rem;
  margin: 1.5rem 0 1rem;
  padding: 1.15rem;
  border: 1px solid var(--line);
  border-radius: .8rem;
  background: color-mix(in srgb, var(--surface) 88%, var(--canvas));
}
.comment-panel .visitor-card { margin-top: 1rem; }
.visitor-label { display: block; margin-bottom: .4rem; color: var(--muted); font-size: .72rem; font-weight: 650; }
.visitor-copy { min-width: 0; }
.visitor-copy strong { display: block; color: var(--ink); font-size: 1.02rem; overflow-wrap: anywhere; }
.visitor-copy p { margin: .4rem 0 0; color: var(--muted); font-size: .78rem; line-height: 1.65; }
.visitor-actions { display: flex; flex-wrap: wrap; align-content: start; gap: .5rem; }

.comments-button {
  min-height: 2.5rem;
  padding: 0 .8rem;
  border: 1px solid var(--line);
  border-radius: .5rem;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: .78rem;
  font-weight: 650;
  cursor: pointer;
}
.comments-button:hover { border-color: var(--accent); color: var(--accent); }
.comments-button-primary { border-color: var(--accent); background: var(--accent); color: var(--canvas); }
.comments-button-primary:hover { background: var(--accent-hover); color: var(--canvas); }
.comments-button-quiet { color: var(--muted); border-color: transparent; }

.visitor-edit { grid-column: 1 / -1; padding-top: 1rem; border-top: 1px solid var(--line); }
.visitor-edit label { display: block; margin-bottom: .5rem; color: var(--ink); font-size: .82rem; font-weight: 650; }
.visitor-edit input {
  width: 100%;
  min-height: 2.8rem;
  padding: 0 .75rem;
  border: 1px solid var(--line);
  border-radius: .5rem;
  background: var(--canvas);
  color: var(--ink);
  font: inherit;
}
.visitor-edit > div { display: flex; gap: .5rem; margin-top: .65rem; }
.field-error { min-height: 1.4em; margin: .5rem 0 0; color: #d44; font-size: .76rem; }

.mail-note { margin: 0 0 1.25rem; color: var(--muted); font-size: .78rem; line-height: 1.65; }
.mail-note strong { color: var(--ink); }

.comment-form {
  margin-top: 1.5rem;
  border: 1px solid var(--line-strong);
  border-radius: .8rem;
  background: var(--surface);
  overflow: visible;
}
.comment-mail-row {
  padding: .72rem 1rem .42rem;
  border-bottom: 1px dashed var(--line-strong);
}
.comment-mail-input {
  width: 100%;
  padding: .22rem 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: .82rem;
  outline: none;
}
.comment-mail-input::placeholder { color: var(--muted); opacity: 1; font-weight: 600; }
.comment-textarea {
  display: block;
  width: 100%;
  min-height: 9.5rem;
  padding: 1rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: .84rem;
  line-height: 1.7;
  resize: vertical;
  outline: none;
}
.comment-textarea::placeholder { color: var(--faint); }
.comment-mail-input:focus-visible,
.comment-textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: .4rem; }
.comment-tools { display: flex; align-items: center; gap: .6rem; margin: 0; padding: .2rem 1rem .85rem; flex-wrap: wrap; }
.comment-tool-button {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .26rem .4rem;
  border: 1px solid transparent;
  border-radius: .45rem;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .76rem;
  cursor: pointer;
}
.comment-tool-button:hover { color: var(--accent); border-color: var(--line-strong); }
.comment-counter { margin-inline-start: auto; color: var(--faint); font-size: .7rem; font-family: var(--mono); }
.comment-counter[data-empty="1"] { color: var(--danger); }
.comment-submit { padding: .45rem 1.1rem; }
.comment-status { margin: 0; padding: 0 1rem .8rem; min-height: 1rem; color: var(--muted); font-size: .72rem; }
.comment-status:empty { display: none; }
.comment-status[data-state="error"] { color: var(--danger); }
.comment-status[data-state="ok"] { color: var(--accent); }

.comment-emoji { position: relative; }
.comment-emoji-pop {
  position: absolute;
  z-index: 6;
  bottom: calc(100% + .4rem);
  left: 0;
  display: grid;
  grid-template-columns: repeat(6, 1.9rem);
  gap: .12rem;
  padding: .4rem;
  border: 1px solid var(--line-strong);
  border-radius: .6rem;
  background: var(--surface);
  box-shadow: 0 10px 26px rgb(0 0 0 / 20%);
}
.comment-emoji-pop[hidden] { display: none; }
.comment-emoji-pop button {
  width: 1.9rem; height: 1.9rem;
  border: 0;
  border-radius: .35rem;
  background: transparent;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.comment-emoji-pop button:hover { background: var(--nav-hover); }

.comment-thread { margin-top: 1.45rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.comment-thread-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; }
.comment-thread-head h4 { margin: 0; color: var(--muted); font-size: .78rem; font-weight: 650; }
.comment-sort { display: flex; gap: .3rem; }
.comment-sort button {
  padding: .2rem .55rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--faint);
  font: inherit;
  font-size: .7rem;
  cursor: pointer;
  transition: color 140ms ease, background 140ms ease;
}
.comment-sort button:hover { color: var(--ink); }
.comment-sort button.is-active { background: var(--accent-soft); color: var(--accent); }

.comment-list { display: flex; flex-direction: column; gap: .55rem; margin-top: .7rem; }
.comment-empty { margin: 0; padding: 1.1rem 0; color: var(--faint); font-size: .76rem; text-align: center; }
.comment-item {
  padding: .75rem .85rem;
  border: 1px solid var(--line);
  border-radius: .6rem;
  background: var(--surface);
}
.comment-item-head { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; }
.comment-author { color: var(--ink); font-size: .78rem; font-weight: 650; word-break: break-word; }
.comment-time { flex: 0 0 auto; color: var(--faint); font-size: .64rem; font-family: var(--mono); }
.comment-pending-note {
  margin: .5rem 0 .1rem;
  padding: .42rem .7rem;
  border: 1px dashed rgba(214, 172, 96, .55);
  border-radius: .45rem;
  background: rgba(214, 172, 96, .10);
  color: #d8b06a;
  font-size: .74rem;
  line-height: 1.5;
}
html[data-theme="light"] .comment-pending-note {
  border-color: rgba(176, 132, 40, .45);
  background: rgba(214, 172, 96, .16);
  color: #8a6521;
}
.comment-body { margin: .35rem 0 0; color: var(--body-copy); font-size: .82rem; line-height: 1.72; word-break: break-word; }
.comment-item-foot { display: flex; justify-content: flex-end; margin-top: .45rem; }
.comment-like {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .16rem .5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--faint);
  font: inherit;
  font-size: .66rem;
  cursor: pointer;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
}
.comment-like:hover { color: var(--accent); border-color: var(--accent); }
.comment-like[data-liked="1"] { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.comment-item--new { animation: commentIn 1.4s ease; }
@keyframes commentIn {
  from { background: var(--accent-soft); }
  to { background: var(--surface); }
}

/* 详情页里的留言区宽一点，别再套一层卡片感 */
.single-main .comment-panel { margin-top: 1.5rem; }

@media (max-width: 48rem) {
  .comment-panel { padding: 1rem; }
  .visitor-card { flex-direction: column; }
  .comment-counter { margin-inline-start: 0; }
  .comment-tools { justify-content: space-between; }
  .comment-emoji-pop { grid-template-columns: repeat(6, 1.7rem); }
  .comment-emoji-pop button { width: 1.7rem; height: 1.7rem; }
}
