/* 灯下 — 素纸温度 × 骨线克制 × 灯下意象
   浅色：白天（6:00-18:00）暖纸底
   深色：夜晚（18:00-6:00）灯下暗底
   通过 JS 在 <html> 上切换 data-theme="dark"
*/

/* ── 浅色（白天）── */
:root {
  --bg: #f7f2e8;
  --bg-card: #f9f5ec;
  --bg-card-hover: #fdfaf3;
  --ink: #1a1814;
  --ink-light: #4a4638;
  --ink-muted: #7a7568;
  --ink-faint: #a8a294;
  --cyan: #3A7685;
  --cyan-light: #4e94a3;
  --rule: #e5e0d4;
  --code-bg: #efe9dc;
  --card-border: #ece7da;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.02);
  --card-shadow-hover: 0 4px 16px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
  --seal-opacity: 0.25;
  --blockquote-bg: transparent;
}

/* ── 深色（夜晚·灯下）── */
[data-theme="dark"] {
  --bg: #1a1218;
  --bg-card: #1f1820;
  --bg-card-hover: #281f28;
  --ink: #e8dfd2;
  --ink-light: #b8ad9e;
  --ink-muted: #8a8078;
  --ink-faint: #6a625a;
  --cyan: #5ab8c8;
  --cyan-light: #72d0e0;
  --rule: #302a30;
  --code-bg: #2a2228;
  --card-border: #2a222a;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.1);
  --card-shadow-hover: 0 4px 16px rgba(0,0,0,0.2), 0 1px 2px rgba(0,0,0,0.1);
  --seal-opacity: 0.35;
  --blockquote-bg: rgba(90,184,200,0.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 15px; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Noto Serif CJK SC', 'Noto Serif SC', Georgia, serif;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  transition: background 0.6s ease, color 0.4s ease;
}

/* ── Header ── */
header {
  max-width: 720px;
  margin: 0 auto;
  padding: 72px 32px 48px;
  position: relative;
}

header::after {
  content: '';
  display: block;
  width: 100%;
  height: 1px;
  background: var(--rule);
  margin-top: 40px;
}

.header-kicker {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--cyan);
  text-transform: uppercase;
  margin-bottom: 12px;
}

header h1 {
  font-size: 32px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 16px;
}

.header-desc {
  color: var(--ink-light);
  font-size: 14.5px;
  line-height: 1.8;
  max-width: 480px;
}

.seal {
  position: absolute;
  right: 32px;
  top: 68px;
  width: 56px;
  height: 56px;
  border: 1.5px solid var(--cyan);
  opacity: var(--seal-opacity);
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  font-family: 'Noto Serif SC', serif;
  font-size: 18px;
  color: var(--cyan);
  transition: opacity 0.4s ease, transform 0.2s ease;
  cursor: pointer;
  user-select: none;
}

.seal:hover {
  opacity: 0.7;
  transform: scale(1.08);
}

/* ── Main ── */
main {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 32px 120px;
}

/* ── 条目卡片 ── */
.entry {
  position: relative;
  padding: 20px 20px 20px 48px;
  margin-bottom: 32px;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  border: none;
  cursor: pointer;
  transition: background 0.4s ease;
}

.entry:hover {
  background: rgba(58,118,133,0.04);
}

[data-theme="dark"] .entry:hover {
  background: rgba(90,184,200,0.06);
}

.entry:active {
  background: rgba(58,118,133,0.07);
}

/* 时间线节点 */
.entry::before {
  content: '';
  position: absolute;
  left: 20px;
  top: 24px;
  width: 8px;
  height: 8px;
  border: 1.5px solid var(--cyan);
  background: var(--bg);
  z-index: 2;
  transition: background 0.2s, border-color 0.2s;
}

.entry:hover::before { background: var(--cyan); }

/* 时间线竖线 */
.entry::after {
  content: '';
  position: absolute;
  left: 23.5px;
  top: 0;
  bottom: -33px;
  width: 1px;
  background: var(--rule);
  z-index: 1;
}

.entry:first-child::after { top: 0; }
.entry:last-child::after { bottom: 0; }

.entry-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--cyan);
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.entry-title {
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
  margin-bottom: 8px;
  transition: color 0.2s;
}

.entry:hover .entry-title { color: var(--cyan-light); }

.entry-subtitle {
  font-size: 13.5px;
  color: var(--ink-muted);
  line-height: 1.6;
  margin-bottom: 10px;
}

.entry-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  padding: 2px 8px;
  border: 1px solid var(--rule);
  color: var(--ink-muted);
  border-radius: 0;
}

.toggle-hint {
  font-size: 13px;
  color: var(--cyan);
  opacity: 0.3;
  margin-top: 4px;
  letter-spacing: 0.06em;
  transition: opacity 0.2s;
}

.entry:hover .toggle-hint {
  opacity: 0.6;
}

.entry.open .toggle-hint { display: none; }

/* ── 展开正文 ── */
.entry-body {
  display: none;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
}

.entry.open .entry-body { display: block; }

.entry-body h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  margin: 24px 0 8px;
}

.entry-body h3:first-child { margin-top: 0; }

.entry-body p {
  color: var(--ink-light);
  font-size: 14.5px;
  line-height: 1.85;
  margin-bottom: 12px;
}

.entry-body blockquote {
  border-left: 2px solid var(--cyan);
  padding: 10px 16px;
  margin: 16px 0;
  background: var(--blockquote-bg);
  color: var(--ink-light);
  font-style: italic;
  font-size: 14px;
}

.entry-body ol,
.entry-body ul {
  margin: 12px 0;
  padding-left: 20px;
  color: var(--ink-light);
  font-size: 14.5px;
  line-height: 1.85;
}

.entry-body li { margin-bottom: 8px; }
.entry-body li strong { color: var(--ink); font-weight: 600; }

.entry-body hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 24px 0;
}

.thought-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--cyan);
  letter-spacing: 0.04em;
  margin-bottom: 12px;
  display: block;
}

/* ── 单篇页 ── */
.post-single {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 32px;
}

.post-single .post-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--cyan);
  margin-bottom: 8px;
}

.post-single h1 {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 8px;
}

.post-single .post-subtitle {
  font-size: 14px;
  color: var(--ink-muted);
  line-height: 1.6;
  margin-bottom: 12px;
}

.post-single .post-tags {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
}

.post-single .post-body {
  border-top: 1px solid var(--rule);
  padding-top: 20px;
}

.post-single .post-body h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  margin: 24px 0 8px;
}

.post-single .post-body h3:first-child { margin-top: 0; }

.post-single .post-body p {
  color: var(--ink-light);
  font-size: 15px;
  line-height: 1.85;
  margin-bottom: 12px;
}

.post-single .post-body a {
  color: var(--cyan);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.15s;
}

.post-single .post-body a:hover { border-color: var(--cyan); }

.post-single .post-body blockquote {
  border-left: 2px solid var(--cyan);
  padding: 10px 16px;
  margin: 16px 0;
  background: var(--blockquote-bg);
  color: var(--ink-light);
  font-style: italic;
  font-size: 14px;
}

.post-single .post-body pre {
  background: var(--code-bg);
  padding: 1rem;
  border: 1px solid var(--rule);
  border-radius: 0;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.6;
  margin: 1rem 0;
}

.post-single .post-body code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 0.15em 0.35em;
  border-radius: 0;
}

.post-single .post-body pre code {
  background: none;
  padding: 0;
}

.post-single .post-body ol,
.post-single .post-body ul {
  margin: 12px 0;
  padding-left: 20px;
  color: var(--ink-light);
  font-size: 15px;
  line-height: 1.85;
}

.post-single .post-body li { margin-bottom: 8px; }
.post-single .post-body li strong { color: var(--ink); }

.post-single .post-body hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 24px 0;
}

.back {
  margin-top: 32px;
  font-size: 13px;
}

.back a {
  color: var(--ink-faint);
  text-decoration: none;
}

.back a:hover { color: var(--cyan); }

/* ── About / Tags ── */
.about-body, .tags-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 32px;
}

.about-body h3 { font-size: 16px; font-weight: 600; margin: 24px 0 8px; }
.about-body p { color: var(--ink-light); font-size: 15px; line-height: 1.85; margin-bottom: 12px; }

.tags-page h1 { font-size: 24px; font-weight: 600; margin-bottom: 20px; }
.tags-page ul { list-style: none; padding: 0; }
.tags-page li { margin-bottom: 8px; }
.tags-page li a { color: var(--cyan); text-decoration: none; }
.tags-page li a:hover { text-decoration: underline; }

/* ── Footer ── */
footer {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 32px 48px;
  border-top: 1px solid var(--rule);
  font-size: 12px;
  color: var(--ink-faint);
}

footer nav {
  display: flex;
  gap: 1rem;
  margin-top: 8px;
}

footer nav a {
  color: var(--ink-faint);
  text-decoration: none;
  font-size: 12px;
}

footer nav a:hover { color: var(--cyan); }

/* ── 响应式 ── */
@media (max-width: 640px) {
  html { font-size: 14px; }
  header, main, footer, .post-single, .about-body, .tags-page {
    padding-left: 20px;
    padding-right: 20px;
  }
  .entry { padding-left: 36px; }
  .entry::before { left: 14px; }
  .entry::after { left: 17.5px; }
  .seal { right: 20px; }
}
