:root {
  color-scheme: light;
  --bg: #f6f1e9;
  --bg-deep: #eee6da;
  --surface: rgba(255, 252, 247, 0.9);
  --surface-solid: #fffdf9;
  --text: #24242a;
  --muted: #756f68;
  --line: rgba(58, 49, 40, 0.11);
  --accent: #e87b56;
  --accent-deep: #b95138;
  --amber: #f3b65f;
  --shadow: 0 18px 45px rgba(75, 53, 34, 0.09);
  --radius: 22px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #17181c;
  --bg-deep: #111216;
  --surface: rgba(35, 36, 41, 0.9);
  --surface-solid: #222329;
  --text: #f6f0e8;
  --muted: #aaa49d;
  --line: rgba(255, 255, 255, 0.09);
  --accent: #f08a63;
  --accent-deep: #ffaf78;
  --amber: #f2bd6c;
  --shadow: 0 20px 48px rgba(0, 0, 0, 0.24);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 3%, rgba(244, 180, 91, 0.15), transparent 25rem),
    radial-gradient(circle at 95% 22%, rgba(232, 123, 86, 0.12), transparent 28rem),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.65;
  min-height: 100vh;
  transition: background-color 180ms ease, color 180ms ease;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
img { display: block; max-width: 100%; }
.shell { width: min(1380px, calc(100% - 40px)); margin: 0 auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 18px; top: -80px; z-index: 100; padding: 10px 16px; border-radius: 10px; color: #fff; background: #24242a; transition: top 150ms ease; }
.skip-link:focus { top: 18px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(18px);
}
.header-inner { min-height: 78px; display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 12px; margin-right: auto; }
.brand-mark {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 14px;
  color: #231d19;
  font-family: Georgia, "Songti SC", serif;
  font-weight: 800;
  font-size: 22px;
  background: linear-gradient(145deg, #ffd574, #ee7858);
  box-shadow: 0 8px 22px rgba(232, 123, 86, 0.26);
}
.brand strong, .brand small { display: block; }
.brand strong { font-family: Georgia, "Songti SC", serif; font-size: 18px; letter-spacing: 0.08em; }
.brand small { color: var(--muted); font-size: 11px; letter-spacing: 0.08em; }
.site-nav { display: flex; align-items: center; gap: 6px; }
.site-nav a { padding: 9px 13px; border-radius: 10px; color: var(--muted); font-size: 14px; transition: 160ms ease; }
.site-nav a:hover, .site-nav a.active { color: var(--text); background: var(--surface); }
.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
}
.icon-button:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); transform: translateY(-1px); }

.page-grid { display: grid; grid-template-columns: 238px minmax(0, 1fr) 250px; gap: 24px; align-items: start; padding-top: 32px; padding-bottom: 70px; }
.sidebar { display: grid; gap: 18px; position: sticky; top: 110px; }
.card, .welcome-card, .post-card, .archive-block, .article-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.card { padding: 20px; }
.profile-card { text-align: center; padding-top: 26px; overflow: hidden; position: relative; }
.profile-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 74px; background: linear-gradient(120deg, rgba(243, 182, 95, .42), rgba(232, 123, 86, .35)); z-index: -1; }
.avatar { width: 106px; height: 106px; margin: 0 auto 14px; border-radius: 50%; object-fit: cover; border: 5px solid var(--surface-solid); box-shadow: 0 10px 24px rgba(39, 31, 27, .18); }
.eyebrow { margin: 0 0 4px; color: var(--accent-deep); font-size: 11px; font-weight: 800; letter-spacing: .18em; }
.profile-card h1 { margin: 2px 0 0; font-family: Georgia, "Songti SC", serif; font-size: 24px; }
.handle { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.bio { margin: 0; color: var(--muted); font-size: 14px; }
.profile-links { display: flex; gap: 8px; margin-top: 18px; }
.profile-links a { flex: 1; padding: 8px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; }
.profile-links a:first-child { color: #fff; border-color: transparent; background: #26262b; }
[data-theme="dark"] .profile-links a:first-child { color: #1b1b1e; background: #faf2e8; }
.stats-card { display: grid; grid-template-columns: repeat(3, 1fr); padding: 16px 10px; }
.stats-card div { text-align: center; border-right: 1px solid var(--line); }
.stats-card div:last-child { border: 0; }
.stats-card strong, .stats-card span { display: block; }
.stats-card strong { font-family: Georgia, serif; font-size: 20px; }
.stats-card span { color: var(--muted); font-size: 11px; }
.quote-card { position: relative; overflow: hidden; color: var(--muted); font-family: Georgia, "Songti SC", serif; font-size: 14px; }
.quote-card p { margin: 0; position: relative; }
.quote-mark { position: absolute; right: 12px; top: -22px; color: rgba(232, 123, 86, .14); font: 90px Georgia, serif; }

.content-column { min-width: 0; }
.welcome-card { min-height: 178px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 32px 34px; overflow: hidden; position: relative; background: linear-gradient(130deg, color-mix(in srgb, var(--surface-solid) 92%, #ffd374), color-mix(in srgb, var(--surface-solid) 86%, #ed7e5b)); }
.welcome-card h2 { margin: 2px 0 8px; font: 700 clamp(25px, 4vw, 36px)/1.25 Georgia, "Songti SC", serif; }
.welcome-card p:last-child { max-width: 580px; margin: 0; color: var(--muted); }
.sun-orbit { width: 112px; height: 112px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid rgba(232, 123, 86, .28); border-radius: 50%; }
.sun-orbit::before, .sun-orbit::after { content: ""; position: absolute; border: 1px solid rgba(232, 123, 86, .15); border-radius: 50%; }
.sun-orbit::before { width: 150px; height: 150px; }
.sun-orbit::after { width: 190px; height: 190px; }
.sun-orbit i { width: 66px; height: 66px; border-radius: 50%; background: linear-gradient(145deg, #ffd36b, #ed7659); box-shadow: 0 0 38px rgba(240, 133, 79, .42); }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 34px 2px 16px; }
.section-heading h2 { margin: 0; font: 700 27px/1.2 Georgia, "Songti SC", serif; }
.section-heading.compact { margin-top: 0; }
.section-heading.compact > span { color: var(--muted); font-size: 13px; }
.search-box { width: min(230px, 44%); display: flex; align-items: center; gap: 8px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--muted); }
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232, 123, 86, .1); }
.search-box input { width: 100%; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 13px; }
.search-box input::placeholder { color: var(--muted); }
.post-list { display: grid; gap: 16px; }
.post-card { display: grid; grid-template-columns: 182px minmax(0, 1fr); min-height: 184px; overflow: hidden; transition: transform 180ms ease, box-shadow 180ms ease; }
.post-card:hover { transform: translateY(-3px); box-shadow: 0 24px 55px rgba(75, 53, 34, .13); }
.post-card[hidden] { display: none; }
.post-visual { position: relative; overflow: hidden; display: flex; align-items: flex-end; padding: 16px; color: rgba(255, 255, 255, .82); font: 700 13px Georgia, serif; letter-spacing: .2em; }
.post-visual::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(12, 13, 17, .42), transparent 64%); }
.post-visual span { position: relative; z-index: 1; }
.post-visual i { position: absolute; width: 86px; height: 86px; right: -17px; top: 28px; border: 1px solid rgba(255,255,255,.36); border-radius: 50%; box-shadow: 0 0 0 22px rgba(255,255,255,.08), 0 0 0 46px rgba(255,255,255,.05); }
.tone-sunset { background: linear-gradient(145deg, #342a37 10%, #e56f55 62%, #f4bd65); }
.tone-night { background: linear-gradient(145deg, #161b29, #36435b 54%, #d17c63); }
.tone-amber { background: linear-gradient(145deg, #64432f, #d99252 55%, #f2c46f); }
.post-body { padding: 24px 26px 20px; }
.post-meta { display: flex; flex-wrap: wrap; gap: 7px 14px; color: var(--muted); font-size: 12px; }
.post-meta span { position: relative; }
.post-meta span::before { content: "·"; position: absolute; left: -9px; }
.post-body h3 { margin: 7px 0 6px; font: 700 23px/1.35 Georgia, "Songti SC", serif; }
.post-body h3 a:hover { color: var(--accent-deep); }
.post-body > p { margin: 0; color: var(--muted); font-size: 14px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.tag-row > * { padding: 3px 9px; border-radius: 999px; color: var(--muted); background: color-mix(in srgb, var(--bg-deep) 70%, transparent); font-size: 11px; }
.tag-row a { color: var(--accent-deep); }
.empty-state { padding: 45px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }
.archive-block { margin-top: 28px; padding: 27px 30px 30px; }
.timeline { border-left: 1px solid var(--line); margin-left: 14px; padding-left: 24px; }
.timeline-year { display: flex; align-items: center; gap: 10px; margin: 5px 0 10px; }
.timeline-year::before { content: ""; width: 11px; height: 11px; margin-left: -30px; border: 3px solid var(--surface-solid); border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.timeline-year strong { font: 700 23px Georgia, serif; }
.timeline-year span { color: var(--muted); font-size: 12px; }
.timeline > a { display: grid; grid-template-columns: 58px 1fr; gap: 12px; padding: 9px 0; color: var(--muted); font-size: 14px; }
.timeline > a:hover span { color: var(--accent-deep); }
.timeline time { font-family: Georgia, serif; font-size: 12px; }

.card-title { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.card-title > span { color: var(--accent-deep); }
.card-title h2 { margin: 0; font: 700 16px Georgia, "Songti SC", serif; }
.notice-card { background: linear-gradient(150deg, color-mix(in srgb, var(--surface-solid) 92%, #ffd474), var(--surface)); }
.notice-card p { margin: 0; color: var(--muted); font-size: 13px; }
.category-list { list-style: none; padding: 0; margin: 0; }
.category-list a { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.category-list li:last-child a { border: 0; }
.category-list b { min-width: 25px; padding: 2px 8px; text-align: center; border-radius: 999px; color: var(--muted); background: var(--bg-deep); font-size: 10px; }
.category-list a:hover span { color: var(--accent-deep); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-cloud a { padding: 5px 9px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); font-size: 12px; }
.tag-cloud a:nth-child(3n + 1) { color: var(--accent-deep); }
.tag-cloud a:hover { border-color: var(--accent); transform: translateY(-1px); }
.contact-card p { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.contact-card a { color: var(--accent-deep); font-size: 12px; overflow-wrap: anywhere; }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.site-footer .shell { min-height: 86px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.site-footer a:hover { color: var(--accent-deep); }

.article-shell { max-width: 920px; padding-top: 44px; padding-bottom: 72px; }
.article-card { overflow: hidden; padding: 36px clamp(24px, 6vw, 68px) 46px; }
.back-link { color: var(--muted); font-size: 13px; }
.back-link:hover { color: var(--accent-deep); }
.article-header { max-width: 700px; margin: 42px auto 28px; text-align: center; }
.article-header h1 { margin: 6px 0 14px; font: 700 clamp(34px, 6vw, 52px)/1.2 Georgia, "Songti SC", serif; }
.article-header .post-meta { justify-content: center; }
.article-cover { min-height: 270px; display: grid; place-items: center; margin: 0 calc(clamp(24px, 6vw, 68px) * -1) 38px; color: rgba(255,255,255,.9); background: radial-gradient(circle at 72% 35%, #f5be68 0 8%, transparent 9%), linear-gradient(145deg, #25232d 5%, #9d4f48 48%, #ed885c 76%, #f7c96f); overflow: hidden; position: relative; }
.article-cover::before, .article-cover::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; }
.article-cover::before { width: 170px; height: 170px; right: 8%; top: -30px; }
.article-cover::after { width: 260px; height: 260px; left: -70px; bottom: -120px; }
.article-cover span { position: relative; z-index: 1; font: 700 clamp(21px, 4vw, 30px) Georgia, "Songti SC", serif; letter-spacing: .18em; }
.article-content { max-width: 690px; margin: 0 auto; font-family: Georgia, "Songti SC", serif; font-size: 17px; line-height: 1.95; }
.article-content .lead { font-size: 20px; color: var(--muted); }
.article-content h2 { margin: 2.2em 0 .7em; font-size: 28px; line-height: 1.35; }
.article-content h3 { margin-top: 2em; font-size: 22px; }
.article-content blockquote { margin: 1.8em 0; padding: 16px 20px; border-left: 4px solid var(--accent); color: var(--muted); background: var(--bg-deep); }
.article-content pre { padding: 18px 20px; border-radius: 14px; overflow-x: auto; color: #f7eee8; background: #24242a; font: 13px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; }
.article-footer { max-width: 690px; margin: 42px auto 0; padding-top: 20px; border-top: 1px solid var(--line); display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.article-footer > a { color: var(--accent-deep); font-size: 13px; }

.not-found-page { display: grid; place-items: center; padding: 24px; }
.not-found-card { width: min(520px, 100%); padding: 54px 34px; text-align: center; border: 1px solid var(--line); border-radius: 28px; background: var(--surface); box-shadow: var(--shadow); }
.not-found-card .brand-mark { margin: 0 auto 22px; }
.not-found-card h1 { margin: 8px 0; font: 700 34px Georgia, "Songti SC", serif; }
.not-found-card p:not(.eyebrow) { color: var(--muted); }
.primary-button { display: inline-block; margin-top: 18px; padding: 10px 22px; border-radius: 12px; color: #fff; background: var(--accent); }

@media (max-width: 1120px) {
  .page-grid { grid-template-columns: 220px minmax(0, 1fr); }
  .sidebar-right { position: static; grid-column: 1 / -1; grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 820px) {
  .shell { width: min(100% - 26px, 720px); }
  .header-inner { min-height: 70px; gap: 10px; }
  .brand small { display: none; }
  .site-nav { position: fixed; left: 13px; right: 13px; bottom: 12px; z-index: 30; justify-content: space-around; padding: 7px; border: 1px solid var(--line); border-radius: 16px; background: color-mix(in srgb, var(--surface-solid) 92%, transparent); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
  .site-nav a { flex: 1; text-align: center; }
  .page-grid { grid-template-columns: 1fr; padding-top: 20px; }
  .sidebar { position: static; }
  .sidebar-left { grid-template-columns: 1fr 1fr; }
  .profile-card { grid-row: span 2; }
  .sidebar-right { grid-template-columns: 1fr 1fr; }
  .site-footer { padding-bottom: 75px; }
}

@media (max-width: 590px) {
  .brand strong { font-size: 16px; }
  .brand-mark { width: 40px; height: 40px; border-radius: 12px; }
  .page-grid { gap: 18px; }
  .sidebar-left, .sidebar-right { grid-template-columns: 1fr; }
  .profile-card { grid-row: auto; }
  .quote-card { display: none; }
  .welcome-card { min-height: 180px; padding: 25px; }
  .welcome-card h2 { font-size: 27px; }
  .sun-orbit { position: absolute; width: 80px; height: 80px; right: -18px; bottom: -16px; opacity: .7; }
  .sun-orbit::before { width: 120px; height: 120px; }
  .sun-orbit::after { display: none; }
  .sun-orbit i { width: 48px; height: 48px; }
  .section-heading { align-items: stretch; flex-direction: column; gap: 12px; }
  .search-box { width: 100%; }
  .post-card { grid-template-columns: 1fr; }
  .post-visual { min-height: 150px; }
  .post-body { padding: 20px; }
  .post-body h3 { font-size: 21px; }
  .archive-block { padding: 23px 20px; }
  .site-footer .shell { align-items: flex-start; flex-direction: column; justify-content: center; gap: 2px; }
  .article-shell { padding-top: 20px; }
  .article-card { padding: 24px 19px 34px; }
  .article-header { margin-top: 34px; }
  .article-cover { min-height: 210px; margin-left: -19px; margin-right: -19px; }
  .article-content { font-size: 16px; }
  .article-footer { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
