/* ============================================
   Warmpaper - A Claude-inspired Hexo Theme
   ============================================ */

/* --- CSS Variables --- */
:root {
  --color-bg: #FAF9F7;
  --color-surface: #FFFFFF;
  --color-surface-hover: #FDF8F4;
  --color-code-bg: #F0EBE3;
  --color-accent: #DA7756;
  --color-accent-hover: #C4684A;
  --color-text: #2D2B28;
  --color-text-secondary: #6B6560;
  --color-text-tertiary: #9B9490;
  --color-border: #E5E0D8;
  --color-border-light: #EEEAE4;
  --grid-color: rgba(218, 119, 86, 0.07);
  --grid-color-strong: rgba(218, 119, 86, 0.12);
  --grid-size: 24px;
  --content-width: 800px;
  --page-width: 1440px;
  --sidebar-width: 200px;
  --left-sidebar-width: 400px;
  --history-width: 380px;
  --header-height: 60px;
  --font-sans: 'LXGW WenKai GB', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-serif: 'LXGW WenKai GB', 'Georgia', 'Times New Roman', serif;
  --font-mono: 'SF Mono', SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
  --radius: 8px;
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.03);

  /* Syntax highlighting colors — "warm ink on paper" */
  --color-syntax-keyword: #A0522D;
  --color-syntax-string: #4E7A3E;
  --color-syntax-comment: #9B9490;
  --color-syntax-number: #2E7D6F;
  --color-syntax-function: #7B4B2A;
  --color-syntax-type: #7F5061;
  --color-syntax-operator: #6B6560;
  --color-syntax-attribute: #B5651D;
  --color-syntax-meta: #9C6B6B;
  --color-syntax-regexp: #C06040;
  --color-syntax-addition-text: #3C763D;
  --color-syntax-addition-bg: #DFF0D8;
  --color-syntax-deletion-text: #A94442;
  --color-syntax-deletion-bg: #F2DEDE;
}

/* --- Reset --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 1rem);
}

/* --- Base --- */
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px),
    linear-gradient(var(--grid-color-strong) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color-strong) 1px, transparent 1px);
  background-size:
    var(--grid-size) var(--grid-size),
    var(--grid-size) var(--grid-size),
    calc(var(--grid-size) * 4) calc(var(--grid-size) * 4),
    calc(var(--grid-size) * 4) calc(var(--grid-size) * 4);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--color-accent-hover);
}

img {
  max-width: 100%;
  height: auto;
}

/* --- Site Wrapper --- */
.site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
  width: 100%;
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(250, 249, 247, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border-light);
}

.header-inner {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-logo {
  width: 28px;
  height: 28px;
}

.site-title:hover {
  color: var(--color-accent);
}

.site-nav {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--color-accent);
}

/* --- Hamburger Toggle (hidden on desktop) --- */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 10;
}

.nav-toggle-icon,
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--color-text);
  border-radius: 1px;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle-icon {
  position: relative;
}

.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: '';
  position: absolute;
  left: 0;
}

.nav-toggle-icon::before {
  top: -6px;
}

.nav-toggle-icon::after {
  top: 6px;
}

/* Hamburger → X animation */
.nav-toggle[aria-expanded="true"] .nav-toggle-icon {
  background-color: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon::after {
  top: 0;
  transform: rotate(-45deg);
}

/* --- Profile Card (Homepage) --- */
.profile-card {
  max-width: var(--content-width);
  margin: 0 auto 2rem;
  text-align: center;
  padding: 2rem 1.5rem 1.75rem;
}

.profile-avatar {
  width: 88px;
  height: 88px;
  object-fit: contain;
  margin-bottom: 0.75rem;
}

.profile-name {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.35rem;
}

.profile-description {
  font-size: 0.92rem;
  color: var(--color-text-secondary);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.profile-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.profile-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: var(--color-text-tertiary);
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
  border: 1px solid var(--color-border-light);
  background: var(--color-surface);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.profile-link:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
  background: var(--color-surface-hover);
}

.profile-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* --- Post List (Homepage) --- */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: var(--content-width);
  margin: 0 auto;
}

/* --- Post Card --- */
.post-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--color-border-light);
  transition: box-shadow 0.25s, transform 0.25s;
}

.post-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.post-card-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.post-card-title a {
  color: var(--color-text);
}

.post-card-title a:hover {
  color: var(--color-accent);
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--color-text-tertiary);
  margin-bottom: 0.75rem;
}

.post-card-meta .separator {
  color: var(--color-border);
}

.post-card-excerpt {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.post-card-excerpt p {
  margin: 0;
}

.read-more {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--color-accent);
}

.read-more:hover {
  color: var(--color-accent-hover);
}

.post-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.post-card-tags a {
  font-size: 0.78rem;
  color: var(--color-text-tertiary);
  background: var(--color-bg);
  padding: 0.15rem 0.55rem;
  border-radius: 3px;
  transition: color 0.2s, background 0.2s;
}

.post-card-tags a:hover {
  color: var(--color-accent);
  background: var(--color-surface-hover);
}

/* --- Pagination --- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2.5rem;
  font-size: 0.9rem;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  border-radius: 4px;
  color: var(--color-text-secondary);
  transition: color 0.2s, background 0.2s;
}

.pagination a:hover {
  color: var(--color-accent);
  background: var(--color-surface);
}

.pagination .current {
  color: var(--color-surface);
  background: var(--color-accent);
  font-weight: 600;
}

.pagination .space {
  color: var(--color-text-tertiary);
}

/* --- Post Detail Page --- */
.post-header {
  max-width: var(--content-width);
  margin: 0 auto 2rem;
  text-align: center;
}

.post-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.post-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.88rem;
  color: var(--color-text-tertiary);
  flex-wrap: wrap;
}

.post-meta .separator {
  color: var(--color-border);
}

/* --- Post Body + TOC Layout --- */
.post-body-wrapper {
  position: relative;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, var(--content-width)) var(--sidebar-width);
  gap: 2rem;
  align-items: start;
  max-width: calc(var(--content-width) + (var(--sidebar-width) * 2) + 4rem);
  margin: 0 auto;
}

.post-body-wrapper.has-note-history {
  grid-template-columns: minmax(160px, var(--sidebar-width)) minmax(0, var(--content-width)) minmax(20rem, var(--history-width));
  max-width: calc(var(--content-width) + var(--sidebar-width) + var(--history-width) + 4rem);
}

.post-body-wrapper.has-left-dual {
  grid-template-columns: minmax(20rem, var(--left-sidebar-width)) minmax(0, var(--content-width)) var(--sidebar-width);
  max-width: calc(var(--content-width) + var(--left-sidebar-width) + var(--sidebar-width) + 4rem);
}

.post-body-wrapper.has-note-history.has-left-dual {
  grid-template-columns: minmax(20rem, var(--left-sidebar-width)) minmax(0, var(--content-width)) minmax(20rem, var(--history-width));
  max-width: calc(var(--content-width) + var(--left-sidebar-width) + var(--history-width) + 4rem);
}

/* --- Post Content Typography --- */
.post-content {
  grid-column: 2;
  min-width: 0;
  font-family: var(--font-serif);
  font-size: 1.06rem;
  line-height: 1.85;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  font-family: var(--font-serif);
  color: var(--color-text);
  font-weight: 700;
  line-height: 1.35;
  margin-top: 2em;
  margin-bottom: 0.75em;
}

.post-content h1 { font-size: 1.75rem; }
.post-content h2 { font-size: 1.45rem; }
.post-content h3 { font-size: 1.2rem; }
.post-content h4 { font-size: 1.05rem; }

.post-content p {
  margin-bottom: 1.25em;
}

.post-content a {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-color: rgba(218, 119, 86, 0.3);
  text-underline-offset: 2px;
  transition: text-decoration-color 0.2s;
}

.post-content a:hover {
  text-decoration-color: var(--color-accent);
}

.post-content blockquote {
  border-left: 3px solid var(--color-accent);
  padding: 0.5em 1.25em;
  margin: 1.5em 0;
  color: var(--color-text-secondary);
  background: rgba(218, 119, 86, 0.04);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.post-content blockquote p:last-child {
  margin-bottom: 0;
}

.post-content ul,
.post-content ol {
  padding-left: 1.5em;
  margin-bottom: 1.25em;
}

.post-content li {
  margin-bottom: 0.35em;
}

.post-content code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--color-code-bg);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  color: var(--color-text);
}

.post-content pre {
  background: var(--color-code-bg);
  border-radius: var(--radius);
  padding: 1.25em;
  margin: 1.5em 0;
  overflow-x: auto;
  line-height: 1.55;
  border: 1px solid var(--color-border-light);
}

.post-content pre code {
  background: none;
  padding: 0;
  font-size: 0.88rem;
}

/* --- Hexo Highlight Code Blocks --- */
figure.highlight {
  background: var(--color-code-bg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius);
  margin: 1.5em 0;
  overflow: hidden;
}

figure.highlight table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin: 0;
}

figure.highlight td {
  padding: 0;
  border: none;
}

figure.highlight pre {
  margin: 0;
  padding: 0;
  background: none;
  border: none;
}

figure.highlight .gutter {
  width: 2.5em;
  vertical-align: top;
  user-select: none;
}

figure.highlight .gutter pre {
  padding: 1em 0.75em;
  text-align: right;
  color: var(--color-text-tertiary);
  border-right: 1px solid var(--color-border-light);
}

figure.highlight .code pre {
  padding: 1em 1.25em;
  overflow-x: auto;
}

figure.highlight .line {
  line-height: 1.55;
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

/* --- Syntax Highlighting: highlight.js tokens (hljs: false, Hexo default) --- */
figure.highlight .comment,
figure.highlight .meta {
  color: var(--color-syntax-comment);
  font-style: italic;
}

figure.highlight .keyword,
figure.highlight .selector-tag,
figure.highlight .tag .name {
  color: var(--color-syntax-keyword);
}

figure.highlight .string,
figure.highlight .symbol,
figure.highlight .bullet {
  color: var(--color-syntax-string);
}

figure.highlight .number,
figure.highlight .literal {
  color: var(--color-syntax-number);
}

figure.highlight .title,
figure.highlight .title.function_ {
  color: var(--color-syntax-function);
}

figure.highlight .built_in,
figure.highlight .type {
  color: var(--color-syntax-type);
}

figure.highlight .params {
  color: var(--color-syntax-operator);
}

figure.highlight .attr,
figure.highlight .attribute,
figure.highlight .tag .attr {
  color: var(--color-syntax-attribute);
}

figure.highlight .regexp,
figure.highlight .link {
  color: var(--color-syntax-regexp);
}

figure.highlight .selector-class,
figure.highlight .selector-id {
  color: var(--color-syntax-function);
}

figure.highlight .addition {
  color: var(--color-syntax-addition-text);
  background: var(--color-syntax-addition-bg);
}

figure.highlight .deletion {
  color: var(--color-syntax-deletion-text);
  background: var(--color-syntax-deletion-bg);
}

/* --- Syntax Highlighting: highlight.js tokens (hljs: true) --- */
figure.highlight .hljs-comment,
figure.highlight .hljs-quote {
  color: var(--color-syntax-comment);
  font-style: italic;
}

figure.highlight .hljs-keyword,
figure.highlight .hljs-selector-tag {
  color: var(--color-syntax-keyword);
}

figure.highlight .hljs-string,
figure.highlight .hljs-symbol,
figure.highlight .hljs-bullet {
  color: var(--color-syntax-string);
}

figure.highlight .hljs-number,
figure.highlight .hljs-literal {
  color: var(--color-syntax-number);
}

figure.highlight .hljs-title,
figure.highlight .hljs-function .hljs-title {
  color: var(--color-syntax-function);
}

figure.highlight .hljs-built_in,
figure.highlight .hljs-type {
  color: var(--color-syntax-type);
}

figure.highlight .hljs-params {
  color: var(--color-syntax-operator);
}

figure.highlight .hljs-attr,
figure.highlight .hljs-attribute {
  color: var(--color-syntax-attribute);
}

figure.highlight .hljs-meta {
  color: var(--color-syntax-meta);
}

figure.highlight .hljs-regexp,
figure.highlight .hljs-link {
  color: var(--color-syntax-regexp);
}

figure.highlight .hljs-selector-class,
figure.highlight .hljs-selector-id {
  color: var(--color-syntax-function);
}

figure.highlight .hljs-addition {
  color: var(--color-syntax-addition-text);
  background: var(--color-syntax-addition-bg);
}

figure.highlight .hljs-deletion {
  color: var(--color-syntax-deletion-text);
  background: var(--color-syntax-deletion-bg);
}

/* --- Syntax Highlighting: PrismJS tokens --- */
figure.highlight .token.comment,
figure.highlight .token.prolog,
figure.highlight .token.doctype,
figure.highlight .token.cdata {
  color: var(--color-syntax-comment);
  font-style: italic;
}

figure.highlight .token.keyword,
figure.highlight .token.tag {
  color: var(--color-syntax-keyword);
}

figure.highlight .token.string,
figure.highlight .token.char,
figure.highlight .token.template-string,
figure.highlight .token.attr-value {
  color: var(--color-syntax-string);
}

figure.highlight .token.number,
figure.highlight .token.boolean {
  color: var(--color-syntax-number);
}

figure.highlight .token.function {
  color: var(--color-syntax-function);
}

figure.highlight .token.class-name {
  color: var(--color-syntax-type);
}

figure.highlight .token.property,
figure.highlight .token.attr-name {
  color: var(--color-syntax-attribute);
}

figure.highlight .token.operator,
figure.highlight .token.punctuation {
  color: var(--color-syntax-operator);
}

figure.highlight .token.selector {
  color: var(--color-syntax-function);
}

figure.highlight .token.regex {
  color: var(--color-syntax-regexp);
}

figure.highlight .token.inserted {
  color: var(--color-syntax-addition-text);
  background: var(--color-syntax-addition-bg);
}

figure.highlight .token.deleted {
  color: var(--color-syntax-deletion-text);
  background: var(--color-syntax-deletion-bg);
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.95rem;
}

.post-content th,
.post-content td {
  padding: 0.6em 1em;
  border: 1px solid var(--color-border);
  text-align: left;
}

.post-content th {
  background: var(--color-code-bg);
  font-weight: 600;
}

.post-content tr:nth-child(even) {
  background: rgba(240, 235, 227, 0.3);
}

.post-content img {
  border-radius: var(--radius);
  margin: 1em 0;
}

.post-content hr {
  border: none;
  height: 1px;
  background: var(--color-border);
  margin: 2em 0;
}

/* --- Post Sidebars --- */
.post-left-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 2rem);
  grid-column: 1;
  grid-row: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.8rem;
  max-height: calc(100vh - var(--header-height) - 4rem);
  min-width: 0;
}

.post-body-wrapper.has-left-dual .post-left-sidebar {
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
}

.post-side-panel {
  min-width: 0;
  max-height: calc(100vh - var(--header-height) - 4rem);
  overflow-y: auto;
}

.post-left-sidebar .post-side-panel {
  padding-right: 0.8rem;
  border-right: 1px solid var(--color-border-light);
}

.related-notes-panel {
  order: 1;
}

.toc-sidebar {
  order: 2;
}

.post-side-panel::-webkit-scrollbar {
  width: 3px;
}

.post-side-panel::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}

.post-side-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.post-side-panel-title {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-tertiary);
  margin: 0;
}

.toc-panel-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.toc-depth-control {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  color: var(--color-text-tertiary);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  white-space: nowrap;
}

.toc-depth-control select {
  min-width: 3.2rem;
  border: 1px solid var(--color-border-light);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--color-text-secondary);
  font: inherit;
  padding: 0.16rem 0.28rem;
}

.toc-depth-control select:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.side-panel-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 1.55rem;
  height: 1.55rem;
  border: 1px solid var(--color-border-light);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--color-text-tertiary);
  padding: 0;
  cursor: pointer;
  transition: border-color 0.18s, color 0.18s, background 0.18s;
}

.side-panel-toggle:hover {
  border-color: rgba(218, 119, 86, 0.36);
  color: var(--color-accent);
  background: var(--color-surface-hover);
}

.side-panel-toggle-icon {
  position: relative;
  display: block;
  width: 0.62rem;
  height: 0.62rem;
}

.side-panel-toggle-icon::before {
  content: '';
  position: absolute;
  inset: 0.11rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(225deg);
  transition: transform 0.18s;
}

.side-panel-toggle[aria-expanded="false"] .side-panel-toggle-icon::before {
  transform: rotate(45deg);
}

.post-side-panel.is-collapsed .post-side-panel-body {
  display: none;
}

.related-notes-list {
  display: grid;
  gap: 0.35rem;
}

.related-note-link {
  display: block;
  border-radius: 6px;
  color: var(--color-text-secondary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  line-height: 1.45;
  padding: 0.35rem 0.45rem;
  overflow-wrap: anywhere;
  transition: background 0.18s, color 0.18s;
}

.related-note-link:hover {
  color: var(--color-accent-hover);
  background: var(--color-surface-hover);
}

.toc {
  list-style: none;
  padding: 0;
}

.toc ol {
  list-style: none;
  padding-left: 0.85rem;
}

.toc li {
  margin-bottom: 0.25rem;
}

.toc li[hidden] {
  display: none;
}

.toc a {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  display: block;
  padding: 0.2rem 0;
  line-height: 1.45;
  transition: color 0.2s;
}

.toc a:hover {
  color: var(--color-text);
}

.toc a.active {
  color: var(--color-accent);
  font-weight: 500;
}

.note-history-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 2rem);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.95fr);
  gap: 0.8rem;
  grid-column: 3;
  grid-row: 1;
  max-height: calc(100vh - var(--header-height) - 4rem);
  min-width: 0;
}

.note-history-panel {
  padding-left: 0.8rem;
  border-left: 1px solid var(--color-border-light);
}

.note-history-list {
  display: grid;
  gap: 0.45rem;
}

.note-history-item {
  display: grid;
  gap: 0.12rem;
  width: 100%;
  border: 1px solid var(--color-border-light);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--color-text-secondary);
  font: inherit;
  padding: 0.55rem 0.65rem;
  text-align: left;
  cursor: pointer;
}

.note-history-item[hidden] {
  display: none;
}

.note-history-item span,
.note-history-item small {
  color: var(--color-text-tertiary);
  font-size: 0.72rem;
  line-height: 1.45;
}

.note-history-item strong {
  color: var(--color-text-secondary);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.note-history-item:hover,
.note-history-item.is-active {
  border-color: rgba(218, 119, 86, 0.42);
  background: var(--color-surface-hover);
}

.note-history-timeline {
  position: relative;
  display: grid;
  gap: 0.6rem;
  list-style: none;
  padding: 0 0 0 0.85rem;
}

.note-history-timeline::before {
  content: '';
  position: absolute;
  top: 0.45rem;
  bottom: 0.45rem;
  left: 0.22rem;
  width: 1px;
  background: var(--color-border-light);
}

.note-history-timeline li {
  position: relative;
}

.note-history-timeline li::before {
  content: '';
  position: absolute;
  top: 0.72rem;
  left: -0.77rem;
  width: 0.44rem;
  height: 0.44rem;
  border: 2px solid var(--color-bg);
  border-radius: 50%;
  background: var(--color-text-tertiary);
  box-shadow: 0 0 0 1px var(--color-border-light);
}

.note-history-time {
  display: grid;
  gap: 0.12rem;
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-secondary);
  font: inherit;
  padding: 0.35rem 0.45rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}

.note-history-time time,
.note-history-time small {
  color: var(--color-text-tertiary);
  font-size: 0.72rem;
  line-height: 1.45;
}

.note-history-time strong {
  color: var(--color-text-secondary);
  font-size: 0.8rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.note-history-time:hover,
.note-history-time.is-active {
  background: var(--color-surface-hover);
}

.note-history-time.is-active strong,
.note-history-time:hover strong {
  color: var(--color-accent-hover);
}

.note-history-timeline li:has(.note-history-time.is-active)::before {
  background: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(218, 119, 86, 0.13);
}

.post-content .note-history-highlight {
  border-radius: 4px;
  background: rgba(255, 231, 214, 0.72);
  box-shadow: 0 0 0 4px rgba(255, 231, 214, 0.72);
}

/* --- Post Footer --- */
.post-footer {
  max-width: var(--content-width);
  margin: 3rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border-light);
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.post-tags a {
  font-size: 0.82rem;
  color: var(--color-text-tertiary);
  background: var(--color-surface);
  padding: 0.2rem 0.65rem;
  border-radius: 3px;
  border: 1px solid var(--color-border-light);
  transition: color 0.2s, border-color 0.2s;
}

.post-tags a:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.post-nav a {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  max-width: 45%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-nav a:hover {
  color: var(--color-accent);
}

/* --- Page (static) --- */
.page-content {
  max-width: var(--content-width);
  margin: 0 auto;
}

.page-content h1 {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-align: center;
}

.page-content-wide {
  max-width: min(100%, 1120px);
}

/* --- Note Admin --- */
.note-admin {
  --note-card-bg: rgba(255, 253, 249, 0.9);
  --note-card-border: rgba(178, 159, 139, 0.3);
  --note-soft: rgba(253, 248, 244, 0.82);
  --note-accent-soft: rgba(218, 119, 86, 0.12);
  font-family: var(--font-sans);
  color: var(--color-text);
}

.note-admin-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
  padding: 0 0 1rem;
  border-bottom: 1px solid var(--color-border-light);
}

.note-admin-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-content .note-admin h1 {
  margin: 0;
  text-align: left;
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  line-height: 1.08;
}

.note-admin-state {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  max-width: 18rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid rgba(178, 159, 139, 0.22);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.72);
  color: var(--color-text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: right;
  overflow-wrap: anywhere;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.64);
}

.note-admin-state::before {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--color-text-tertiary);
  box-shadow: 0 0 0 3px rgba(122, 111, 100, 0.08);
}

.note-admin-state[data-tone="ok"] {
  border-color: rgba(218, 119, 86, 0.26);
  color: var(--color-accent-hover);
  background: rgba(253, 248, 244, 0.78);
}

.note-admin-state[data-tone="ok"]::before {
  background: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(218, 119, 86, 0.11);
}

.note-admin-state[data-tone="warn"] {
  border-color: rgba(169, 68, 66, 0.25);
  color: #A94442;
  background: rgba(242, 222, 222, 0.42);
}

.note-admin-state[data-tone="busy"] {
  border-color: rgba(218, 119, 86, 0.28);
  color: var(--color-accent-hover);
  background: rgba(253, 248, 244, 0.8);
}

.note-admin-gate,
.note-panel,
.note-preview {
  background: var(--note-card-bg);
  border: 1px solid var(--note-card-border);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(86, 68, 51, 0.08), inset 0 1px rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
}

.note-admin-gate {
  max-width: 28rem;
  margin: 3rem auto 0;
  padding: 1.25rem;
}

.note-login-form {
  display: grid;
  gap: 0.9rem;
}

.note-login-form label,
.note-field {
  display: grid;
  gap: 0.35rem;
}

.note-login-form span,
.note-field span {
  color: var(--color-text-secondary);
  font-size: 0.84rem;
  font-weight: 600;
}

.note-login-form input,
.note-field input,
.note-field textarea {
  width: 100%;
  min-height: 2.75rem;
  border: 1px solid rgba(178, 159, 139, 0.42);
  border-radius: 7px;
  background: rgba(255, 253, 249, 0.94);
  color: var(--color-text);
  font: inherit;
  padding: 0.55rem 0.75rem;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

.note-field textarea {
  min-height: 4.8rem;
  max-height: 7rem;
  resize: vertical;
  line-height: 1.55;
}

.note-field textarea[data-note-update-description] {
  min-height: 3.35rem;
  max-height: 4.8rem;
}

.note-login-form input:focus,
.note-field input:focus,
.note-field textarea:focus {
  outline: none;
  border-color: rgba(218, 119, 86, 0.62);
  background: rgba(255, 253, 249, 1);
  box-shadow: 0 0 0 4px rgba(218, 119, 86, 0.12), 0 10px 20px rgba(218, 119, 86, 0.06);
}

.note-upload-form {
  display: grid;
  gap: 1rem;
}

.note-workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.86fr) minmax(0, 1fr);
  gap: 1.15rem;
  align-items: stretch;
}

.note-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 1.05rem;
}

.note-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 1.65rem;
  margin-bottom: 0.9rem;
}

.post-content .note-panel h2,
.post-content .note-diff-block h3 {
  margin: 0;
  font-family: var(--font-sans);
}

.post-content .note-panel h2 {
  font-size: 0.96rem;
  letter-spacing: 0.02em;
}

.note-file-drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 8.75rem;
  margin-bottom: 0.85rem;
  border: 1px solid rgba(218, 119, 86, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 253, 249, 0.92), rgba(253, 248, 244, 0.78));
  cursor: pointer;
  text-align: center;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.72);
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s, transform 0.18s;
}

.note-file-drop:hover,
.note-file-drop:focus-within {
  border-color: rgba(218, 119, 86, 0.52);
  background:
    linear-gradient(180deg, rgba(255, 253, 249, 1), rgba(253, 248, 244, 0.9));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.8), 0 12px 28px rgba(218, 119, 86, 0.1);
  transform: translateY(-1px);
}

.note-file-drop.compact {
  min-height: 5.4rem;
  margin-bottom: 0;
}

.note-file-drop i {
  width: 2.3rem;
  height: 2.3rem;
  border: 1px solid rgba(218, 119, 86, 0.25);
  border-radius: 8px;
  background: rgba(218, 119, 86, 0.08);
  position: relative;
}

.note-file-drop i::before,
.note-file-drop i::after {
  content: '';
  position: absolute;
  left: 0.65rem;
  right: 0.65rem;
  border-radius: 1px;
  background: var(--color-accent);
}

.note-file-drop i::before {
  top: 0.75rem;
  height: 0.18rem;
}

.note-file-drop i::after {
  top: 1.08rem;
  height: 0.18rem;
}

.note-file-drop input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.note-file-drop span {
  max-width: calc(100% - 1.5rem);
  color: var(--color-text);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.note-file-drop small {
  color: var(--color-text-tertiary);
  font-size: 0.8rem;
}

.note-option-label {
  margin: 0.75rem 0 0.4rem;
  color: var(--color-text-tertiary);
  font-size: 0.76rem;
  font-weight: 700;
}

.note-panel-meta .note-field + .note-field,
.note-panel-taxonomy .note-field + .note-field {
  margin-top: 0.85rem;
}

.note-option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-height: 1.7rem;
  margin: 0.25rem 0 0.85rem;
}

.note-suggestion-row {
  min-height: 0;
  margin: 0.45rem 0 0;
}

.note-option-label:has(+ .note-option-row:empty) {
  display: none;
}

.note-option-label + .note-option-row:empty {
  min-height: 0;
  margin: 0;
}

.note-tag-input {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.75rem;
  padding: 0.38rem;
  border: 1px solid rgba(178, 159, 139, 0.42);
  border-radius: 7px;
  background: rgba(255, 253, 249, 0.94);
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

.note-panel-taxonomy .note-tag-input {
  min-height: 2.25rem;
  padding: 0.22rem 0.4rem;
}

.note-tag-input:focus-within {
  border-color: rgba(218, 119, 86, 0.62);
  background: rgba(255, 253, 249, 1);
  box-shadow: 0 0 0 4px rgba(218, 119, 86, 0.12);
}

.note-tag-input input {
  flex: 1 1 10rem;
  min-width: 8rem;
  min-height: 1.9rem;
  border: 0;
  border-radius: 5px;
  background: transparent;
  box-shadow: none;
  padding: 0.25rem 0.35rem;
}

.note-panel-taxonomy .note-tag-input input {
  min-height: 1.55rem;
  padding: 0.12rem 0.2rem;
  font-size: 0.92rem;
}

.note-tag-input input:focus {
  box-shadow: none;
}

.note-chip {
  border: 1px solid rgba(218, 119, 86, 0.18);
  border-radius: 999px;
  background: rgba(253, 248, 244, 0.78);
  color: var(--color-text-secondary);
  font: inherit;
  font-size: 0.78rem;
  line-height: 1;
  padding: 0.42rem 0.62rem;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, color 0.18s, transform 0.18s;
}

.note-chip:hover {
  border-color: rgba(218, 119, 86, 0.42);
  color: var(--color-accent);
  background: var(--color-surface-hover);
  transform: translateY(-1px);
}

.note-chip.is-selected {
  border-color: rgba(218, 119, 86, 0.38);
  background: rgba(218, 119, 86, 0.12);
  color: var(--color-accent-hover);
  font-weight: 700;
}

.note-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  min-height: 2.5rem;
  margin-top: 0.1rem;
  color: var(--color-text-secondary);
  font-size: 0.88rem;
  font-weight: 700;
}

.note-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.note-toggle span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.note-toggle span::after {
  content: '';
  width: 2.6rem;
  height: 1.42rem;
  border-radius: 999px;
  background:
    radial-gradient(circle at 0.72rem 50%, #fff 0.42rem, transparent 0.45rem),
    rgba(178, 159, 139, 0.42);
  box-shadow: inset 0 1px 3px rgba(66, 48, 35, 0.12);
  transition: background 0.2s;
}

.note-toggle input:checked + span::after {
  background:
    radial-gradient(circle at 1.88rem 50%, #fff 0.42rem, transparent 0.45rem),
    var(--color-accent);
}

.note-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(178, 159, 139, 0.24);
}

.note-login-form button,
.note-actions button {
  min-height: 2.75rem;
  border: 1px solid rgba(218, 119, 86, 0.35);
  border-radius: 7px;
  background: rgba(255, 253, 249, 0.9);
  color: var(--color-accent-hover);
  font: inherit;
  font-weight: 700;
  padding: 0.55rem 0.95rem;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, color 0.18s, box-shadow 0.18s, transform 0.18s;
}

.note-login-form button:hover,
.note-actions button:hover {
  border-color: rgba(218, 119, 86, 0.6);
  background: var(--color-surface-hover);
  transform: translateY(-1px);
}

.note-actions button.primary {
  background: var(--color-accent);
  color: #fff;
  box-shadow: 0 10px 20px rgba(218, 119, 86, 0.2);
}

.note-actions button.primary:hover {
  background: var(--color-accent-hover);
  box-shadow: 0 14px 26px rgba(218, 119, 86, 0.24);
}

.note-login-form button:disabled,
.note-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.note-actions button[hidden] {
  display: none;
}

.note-preview {
  margin-top: 1rem;
  padding: 1rem;
}

.note-preview-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.note-summary-item {
  min-width: 0;
  padding: 0.65rem;
  border: 1px solid var(--color-border-light);
  border-radius: 6px;
  background: rgba(250, 249, 247, 0.72);
}

.note-summary-item span {
  display: block;
  color: var(--color-text-tertiary);
  font-size: 0.76rem;
  font-weight: 700;
}

.note-summary-item strong {
  display: block;
  margin-top: 0.2rem;
  color: var(--color-text);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.note-warning-list ul {
  margin: 0 0 1rem;
  padding: 0.7rem 0.9rem 0.7rem 1.6rem;
  border: 1px solid rgba(218, 119, 86, 0.2);
  border-radius: 6px;
  background: rgba(253, 248, 244, 0.78);
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

.note-diff-layout {
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.note-timeline {
  position: sticky;
  top: calc(var(--header-height) + 1rem);
  display: grid;
  gap: 0.5rem;
  max-height: calc(100vh - var(--header-height) - 2rem);
  overflow: auto;
  padding-right: 0.25rem;
}

.note-timeline a {
  display: grid;
  gap: 0.12rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--color-border-light);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.78);
  text-decoration: none;
}

.note-timeline span,
.note-timeline small {
  color: var(--color-text-tertiary);
  font-size: 0.72rem;
}

.note-timeline strong {
  color: var(--color-text-secondary);
  font-size: 0.82rem;
}

.note-diff-list {
  display: grid;
  gap: 1rem;
}

.note-diff-block {
  scroll-margin-top: calc(var(--header-height) + 1rem);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius);
  background: rgba(255, 253, 249, 0.86);
  overflow: hidden;
}

.note-diff-block header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid var(--color-border-light);
  background: rgba(250, 249, 247, 0.8);
}

.note-diff-block header span {
  border-radius: 4px;
  background: rgba(218, 119, 86, 0.12);
  color: var(--color-accent-hover);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
}

.note-diff-block header strong {
  min-width: 0;
  flex: 1;
  color: var(--color-text);
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.note-diff-block header em {
  color: var(--color-text-tertiary);
  font-style: normal;
  font-size: 0.78rem;
}

.note-diff-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(15rem, 0.58fr);
}

.note-diff-columns section,
.note-diff-columns aside {
  min-width: 0;
  padding: 0.8rem;
}

.note-diff-columns aside {
  border-left: 1px solid var(--color-border-light);
  background: rgba(240, 235, 227, 0.32);
}

.post-content .note-diff-block h3 {
  color: var(--color-text-tertiary);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.note-diff-block pre,
.note-build-output {
  margin: 0.55rem 0 0;
  padding: 0.75rem;
  border: 1px solid var(--color-border-light);
  border-radius: 6px;
  background: rgba(240, 235, 227, 0.55);
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.note-diff-empty {
  margin: 0.55rem 0 0;
  color: var(--color-text-tertiary);
  font-size: 0.88rem;
}

.note-diff-block.is-insert header span {
  background: rgba(78, 122, 62, 0.12);
  color: #4E7A3E;
}

.note-diff-block.is-delete header span {
  background: rgba(169, 68, 66, 0.12);
  color: #A94442;
}

/* --- About Page --- */
.about-page {
  --about-amber: #B98256;
  --about-amber-deep: #8E6143;
  --about-amber-soft: rgba(185, 130, 86, 0.14);
  --about-sage: #5F7D65;
  --about-ink-blue: #3E6270;
  --about-mulberry: #7F5061;
  --about-card-bg: rgba(255, 253, 249, 0.88);
  --about-card-border: rgba(178, 159, 139, 0.26);
  --about-paper-line: rgba(62, 98, 112, 0.1);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  position: relative;
  isolation: isolate;
}

.about-page::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(
      circle at var(--about-glow-x, 74%) var(--about-glow-y, 18%),
      rgba(185, 130, 86, 0.16),
      rgba(185, 130, 86, 0.06) 12rem,
      transparent 24rem
    );
  opacity: 0.78;
}

.about-page > * {
  position: relative;
  z-index: 1;
}

.post-content .about-page p,
.post-content .about-page h1,
.post-content .about-page h2,
.post-content .about-page h3 {
  margin: 0;
}

.about-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: center;
  gap: 4rem;
  padding: 2rem 0 4rem;
  border-bottom: 1px solid var(--color-border-light);
}

.about-kicker,
.about-section-label {
  color: var(--about-amber-deep);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.about-hero h1 {
  font-family: 'Noto Serif CJK SC', 'Source Han Serif SC', 'Songti SC', var(--font-serif);
  font-size: 4.7rem;
  font-weight: 800;
  line-height: 1.05;
  color: var(--color-text);
  margin-top: 0.55rem;
}

.about-lede {
  max-width: 39rem;
  color: var(--color-text-secondary);
  font-size: 1.12rem;
  margin-top: 1.15rem;
}

.about-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.8rem;
}

.post-content .about-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.65rem;
  border: 1px solid rgba(185, 130, 86, 0.34);
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(244, 226, 204, 0.94), rgba(232, 200, 166, 0.86));
  color: #6E472E;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 700;
  padding: 0.5rem 1.05rem;
  text-decoration: none;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.66), 0 8px 18px rgba(106, 74, 47, 0.08);
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.post-content .about-button:hover {
  background: linear-gradient(180deg, rgba(242, 219, 194, 0.98), rgba(224, 188, 151, 0.94));
  border-color: rgba(185, 130, 86, 0.56);
  color: #5F3B25;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.72), 0 12px 22px rgba(106, 74, 47, 0.12);
  transform: translateY(-2px);
}

.post-content .about-button-secondary {
  background: rgba(255, 253, 249, 0.58);
  color: var(--about-amber-deep);
  box-shadow: none;
}

.post-content .about-button-secondary:hover {
  background: rgba(255, 253, 249, 0.9);
  color: #735033;
}

.about-visual {
  position: relative;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.15rem;
  overflow: hidden;
  border: 1px solid var(--about-card-border);
  border-radius: var(--radius);
  background:
    linear-gradient(var(--about-paper-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--about-paper-line) 1px, transparent 1px),
    linear-gradient(135deg, rgba(255, 253, 249, 0.96), rgba(246, 238, 227, 0.86));
  background-size: 18px 18px;
  box-shadow: 0 16px 38px rgba(45, 43, 40, 0.08), var(--shadow-card);
  transform: rotate(0.6deg);
}

.about-visual::before {
  content: '';
  position: absolute;
  inset: 1rem;
  border: 1px solid rgba(218, 119, 86, 0.18);
  border-radius: calc(var(--radius) - 2px);
  pointer-events: none;
}

.about-visual::after {
  content: '';
  position: absolute;
  right: -3rem;
  bottom: -3rem;
  width: 9rem;
  height: 9rem;
  border-radius: 50%;
  background: rgba(95, 125, 101, 0.12);
  filter: blur(4px);
}

.about-logo-mark {
  width: 128px;
  height: 142px;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(45, 43, 40, 0.08));
  animation: about-float 6s ease-in-out infinite;
}

.about-visual figcaption {
  max-width: 13rem;
  color: var(--color-text-secondary);
  font-size: 0.82rem;
  line-height: 1.55;
  text-align: center;
}

.about-topic-icon svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.about-section {
  padding: 4.2rem 0 0;
}

.about-section-heading {
  margin-bottom: 1.25rem;
}

.about-section h2 {
  font-family: 'Noto Serif CJK SC', 'Source Han Serif SC', 'Songti SC', var(--font-serif);
  color: var(--color-text);
  font-size: 1.78rem;
  line-height: 1.3;
  margin-top: 0.32rem;
}

.about-section h3 {
  color: var(--color-text);
  font-family: var(--font-serif);
  font-size: 1.13rem;
  line-height: 1.35;
  margin-top: 0.85rem;
}

.about-section p {
  color: var(--color-text-secondary);
}

.about-intro {
  max-width: 760px;
}

.about-intro p:last-child {
  font-size: 1.04rem;
  margin-top: 1rem;
}

.about-topic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.15rem;
}

.about-topic-card {
  position: relative;
  min-width: 0;
  min-height: 190px;
  border: 1px solid var(--about-card-border);
  border-radius: var(--radius);
  background: var(--about-card-bg);
  padding: 1.25rem 1.2rem 1.35rem;
  box-shadow: 0 10px 24px rgba(45, 43, 40, 0.045), var(--shadow-card);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.about-topic-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(185, 130, 86, 0.09), transparent 42%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.about-topic-card:hover {
  transform: translateY(-4px);
  border-color: rgba(185, 130, 86, 0.42);
  background: rgba(255, 253, 249, 0.96);
  box-shadow: 0 16px 34px rgba(45, 43, 40, 0.08), var(--shadow-card);
}

.about-topic-card:hover::after {
  opacity: 1;
}

.about-topic-card:nth-child(2) .about-topic-index {
  color: var(--about-sage);
}

.about-topic-card:nth-child(3) .about-topic-index {
  color: var(--about-mulberry);
}

.about-topic-index {
  position: absolute;
  top: 1.15rem;
  right: 1.15rem;
  color: var(--about-ink-blue);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  opacity: 0.72;
}

.about-topic-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.55rem;
  height: 2.55rem;
  border: 1px solid rgba(62, 98, 112, 0.18);
  border-radius: 50%;
  background: rgba(62, 98, 112, 0.08);
  color: var(--about-ink-blue);
}

.about-topic-card:nth-child(2) .about-topic-icon {
  border-color: rgba(95, 125, 101, 0.2);
  background: rgba(95, 125, 101, 0.08);
  color: var(--about-sage);
}

.about-topic-card:nth-child(3) .about-topic-icon {
  border-color: rgba(127, 80, 97, 0.2);
  background: rgba(127, 80, 97, 0.08);
  color: var(--about-mulberry);
}

.about-topic-card p {
  font-size: 0.92rem;
  margin-top: 0.6rem;
}

.about-fragments {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(300px, 1fr);
  gap: 2.4rem;
  align-items: center;
}

.about-fragments > div > p:last-child {
  margin-top: 1rem;
}

.about-fragment-stack {
  position: relative;
  min-height: 295px;
}

.about-fragment {
  position: absolute;
  margin: 0;
  border: 1px solid var(--about-card-border);
  border-radius: 6px;
  background: rgba(255, 253, 249, 0.94);
  box-shadow: 0 18px 34px rgba(45, 43, 40, 0.09), var(--shadow-card);
}

.about-fragment-main {
  left: 0.25rem;
  top: 0.4rem;
  width: 66%;
  min-height: 225px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
  transform: rotate(-2.2deg);
}

.about-fragment-main img {
  width: 94px;
  height: 104px;
  object-fit: contain;
}

.about-fragment-note {
  right: 0.25rem;
  bottom: 0.65rem;
  width: 55%;
  min-height: 172px;
  overflow: hidden;
  padding: 1rem;
  transform: rotate(2.4deg);
}

.about-fragment-pin {
  position: absolute;
  top: 0.55rem;
  left: 50%;
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 50%;
  background: var(--about-amber);
  box-shadow: 0 0 0 4px rgba(185, 130, 86, 0.12);
  transform: translateX(-50%);
}

.about-fragment-lines {
  display: block;
  min-height: 112px;
  border-radius: 4px;
  background:
    linear-gradient(rgba(62, 98, 112, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(62, 98, 112, 0.08) 1px, transparent 1px),
    linear-gradient(135deg, rgba(95, 125, 101, 0.12), rgba(185, 130, 86, 0.1));
  background-size: 18px 18px, 18px 18px, 100% 100%;
}

.about-fragment figcaption {
  color: var(--color-text-secondary);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  margin-top: 0.8rem;
  text-align: center;
}

.about-split,
.about-contact {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(280px, 1fr);
  gap: 2.6rem;
  align-items: start;
}

.about-split > div > p:last-child,
.about-contact > div > p:last-child {
  margin-top: 0.85rem;
}

.about-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid rgba(185, 130, 86, 0.28);
}

.post-content .about-timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr);
  gap: 0.8rem;
  margin: 0;
  padding: 0 0 1.2rem 1rem;
}

.post-content .about-timeline li:last-child {
  padding-bottom: 0;
}

.about-timeline li::before {
  content: '';
  position: absolute;
  top: 0.35rem;
  left: -0.35rem;
  width: 0.65rem;
  height: 0.65rem;
  border: 2px solid var(--color-bg);
  border-radius: 50%;
  background: var(--about-amber);
  box-shadow: 0 0 0 1px var(--about-amber);
}

.about-timeline span {
  color: var(--color-text-tertiary);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
}

.about-timeline p {
  color: var(--color-text);
  font-size: 0.95rem;
}

.about-contact {
  padding-bottom: 0.5rem;
}

.about-link-list {
  display: grid;
  gap: 0.75rem;
}

.post-content .about-link-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-width: 0;
  border: 1px solid var(--about-card-border);
  border-radius: var(--radius);
  background: var(--about-card-bg);
  color: var(--color-text);
  padding: 1rem 1.1rem;
  text-decoration: none;
  box-shadow: 0 9px 22px rgba(45, 43, 40, 0.04), var(--shadow-card);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s, background 0.2s;
}

.post-content .about-link-list a:hover {
  border-color: rgba(185, 130, 86, 0.45);
  background: rgba(255, 253, 249, 0.96);
  box-shadow: 0 14px 28px rgba(45, 43, 40, 0.08), var(--shadow-card);
  transform: translateY(-3px);
}

.about-link-list span {
  color: var(--color-text-tertiary);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.about-link-list strong {
  color: var(--color-text);
  font-size: 0.95rem;
  text-align: right;
}

@keyframes about-float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-7px);
  }
}

/* --- Archive --- */
.archive {
  max-width: var(--content-width);
  margin: 0 auto;
}

.archive-title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 2rem;
  text-align: center;
}

.archive-year {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border-light);
}

.archive-post {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.5rem 0;
}

.archive-post-date {
  font-size: 0.85rem;
  color: var(--color-text-tertiary);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.archive-post-title a {
  font-size: 1rem;
  color: var(--color-text);
}

.archive-post-title a:hover {
  color: var(--color-accent);
}

/* --- Category / Tag Header --- */
.category-title,
.tag-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 2rem;
}

.category-title span,
.tag-title span {
  color: var(--color-accent);
}

/* --- Tags Index (cloud) --- */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 1rem;
}

.tag-cloud-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  background: var(--color-surface);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--color-border-light);
  box-shadow: var(--shadow-card);
  transition: color 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.tag-cloud-item:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-1px);
}

.tag-cloud-count {
  font-size: 0.75rem;
  color: var(--color-text-tertiary);
  background: var(--color-bg);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  min-width: 1.4em;
  text-align: center;
}

/* --- Categories Index (list) --- */
.category-list {
  display: flex;
  flex-direction: column;
}

.category-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--color-border-light);
  color: var(--color-text);
  transition: color 0.2s;
}

.category-list-item:first-child {
  border-top: 1px solid var(--color-border-light);
}

.category-list-item:hover {
  color: var(--color-accent);
}

.category-list-name {
  font-size: 1rem;
}

.category-list-count {
  font-size: 0.82rem;
  color: var(--color-text-tertiary);
  background: var(--color-bg);
  padding: 0.15rem 0.55rem;
  border-radius: 3px;
  min-width: 1.8em;
  text-align: center;
}

/* --- Shared empty state --- */
.no-data {
  text-align: center;
  color: var(--color-text-tertiary);
  font-size: 0.95rem;
  margin-top: 2rem;
}

/* --- Footer --- */
.site-footer {
  margin-top: 3rem;
  padding: 1.5rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--color-text-tertiary);
  border-top: 1px solid var(--color-border-light);
}

.site-footer p {
  margin: 0.25rem 0;
}

.site-footer a {
  color: var(--color-text-secondary);
}

.site-footer a:hover {
  color: var(--color-accent);
}

/* --- Comments --- */
.comments {
  max-width: var(--content-width);
  margin: 3rem auto 0;
  padding-top: 2rem;
  padding-bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--color-border-light);
}

.comments-placeholder,
.comments-notice,
.comments-empty,
.comments-message {
  color: var(--color-text-tertiary);
  font-size: 0.92rem;
}

.comments-message {
  margin: -0.45rem 0 1rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--color-border-light);
  border-radius: 4px;
  background: var(--color-surface-hover);
  color: var(--color-text-secondary);
}

.comments-message.is-floating {
  position: fixed;
  left: 50%;
  bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px));
  z-index: 121;
  width: min(calc(100% - 3rem), var(--content-width));
  margin: 0;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: comments-rise 0.16s ease-out;
}

.comments-message[hidden] {
  display: none;
}

.comments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.comments-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 0.15rem;
}

.comments-count {
  margin: 0;
  font-size: 0.82rem;
  color: var(--color-text-tertiary);
}

.comments-user,
.comment-meta,
.comment-actions,
.comments-auth-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.comments-user {
  color: var(--color-text-secondary);
  font-size: 0.88rem;
  flex: 0 1 auto;
  min-width: 0;
  justify-content: flex-end;
}

.comments-profile-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  max-width: min(18rem, 48vw);
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  font: inherit;
  padding: 0.15rem 0.2rem 0.15rem 0.15rem;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.comments-profile-trigger:hover,
.comments-profile-trigger:focus-visible {
  background: var(--color-surface-hover);
  color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(218, 119, 86, 0.1);
  outline: none;
}

.comments-user-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comment-avatar-upload {
  position: relative;
  display: inline-flex;
  width: 38px;
  height: 38px;
}

.comment-avatar-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: var(--color-surface);
  box-shadow: inset 0 0 0 1px var(--color-border-light);
  padding: 1px;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.2s, background 0.2s;
}

.comment-avatar-button::after {
  content: '+';
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 15px;
  height: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-surface);
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-surface);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.2s, transform 0.2s;
}

.comment-avatar-button:hover,
.comment-avatar-button:focus-visible {
  background: var(--color-surface-hover);
  box-shadow: inset 0 0 0 1px var(--color-accent), 0 0 0 3px rgba(218, 119, 86, 0.12);
  transform: translateY(-1px);
}

.comment-avatar-button:hover::after,
.comment-avatar-button:focus-visible::after {
  opacity: 1;
  transform: scale(1);
}

.comment-avatar-input {
  display: none;
}

.comments-auth-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(45, 43, 40, 0.28);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.comments-auth {
  width: min(100%, 420px);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: 0 18px 40px rgba(45, 43, 40, 0.16), var(--shadow-card);
  animation: comments-dialog-rise 0.18s ease-out;
}

.comments-auth-header {
  justify-content: space-between;
  margin-bottom: 0.9rem;
}

.comments-auth h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--color-text);
}

.comments-auth-close {
  border: 0;
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  font: inherit;
  font-size: 1.15rem;
  line-height: 1;
  padding: 0.25rem;
}

.comments-auth-close:hover {
  color: var(--color-accent);
}

.comments-auth-message {
  margin: -0.15rem 0 0.85rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--color-border-light);
  border-radius: 4px;
  background: var(--color-surface-hover);
  color: var(--color-text-secondary);
  font-size: 0.86rem;
  line-height: 1.55;
}

.comments-auth-switch {
  margin: 0.9rem 0 0;
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 0.86rem;
}

.comments-auth-switch button {
  border: 0;
  background: transparent;
  color: var(--color-accent);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  padding: 0.1rem 0.15rem;
}

.comments-auth-switch button:hover {
  color: var(--color-accent-hover);
}

.comments-profile {
  width: min(100%, 420px);
}

.comments-profile-summary {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.15rem 0 0.25rem;
}

.comments-profile-meta {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  min-width: 0;
  line-height: 1.45;
}

.comments-profile-avatar-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  overflow: hidden;
  border: 0;
  border-radius: 50%;
  background: var(--color-code-bg);
  cursor: pointer;
  padding: 0;
}

.comments-profile-avatar-button:disabled {
  cursor: wait;
}

.comments-profile-avatar-overlay {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(45, 43, 40, 0.52);
  color: var(--color-surface);
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.18s;
}

.comments-profile-avatar-button:hover .comments-profile-avatar-overlay,
.comments-profile-avatar-button:focus-visible .comments-profile-avatar-overlay,
.comments-profile-avatar-button:disabled .comments-profile-avatar-overlay {
  opacity: 1;
}

.comments-profile-name-button {
  align-self: flex-start;
  max-width: 100%;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-align: left;
}

.comments-profile-name-button:hover,
.comments-profile-name-button:focus-visible {
  color: var(--color-accent);
  outline: none;
}

.comments-profile-meta strong {
  font-weight: 700;
  font-size: 1.05rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comments-profile-meta span {
  color: var(--color-text-tertiary);
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comments-profile-meta small {
  color: var(--color-text-tertiary);
  font-size: 0.76rem;
  line-height: 1.45;
}

.comments-profile-inline-form {
  display: flex;
  align-items: stretch;
  gap: 0.45rem;
  width: 100%;
}

.comments-profile-inline-form input {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: 0.95rem;
  padding: 0.45rem 0.6rem;
  outline: none;
}

.comments-profile-inline-form input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(218, 119, 86, 0.12);
}

.comments-profile-save {
  flex: 0 0 auto;
  min-width: 4.15rem;
  padding-inline: 0.65rem;
  white-space: nowrap;
}

.comments-profile-cancel {
  flex: 0 0 auto;
  min-width: 3.4rem;
  padding-inline: 0.55rem;
  white-space: nowrap;
}

.comments-profile-footer {
  margin-top: 1.05rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--color-border-light);
}

.comments-profile-logout {
  width: 100%;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.comment-form.compact {
  margin-bottom: 0;
}

.comment-form.reply {
  margin: 0.75rem 0 0;
}

.comment-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--color-text-secondary);
}

.comment-field input,
.comment-form textarea {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: 0.95rem;
  padding: 0.65rem 0.75rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.comment-field input:focus,
.comment-form textarea:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(218, 119, 86, 0.12);
}

.comment-form textarea {
  resize: vertical;
  min-height: 6rem;
}

.comment-form.reply textarea {
  min-height: 4.5rem;
}

.comment-composer-anchor {
  position: relative;
  height: var(--comment-composer-space, 4rem);
  margin: 0.35rem 0 var(--comment-composer-gap, 1.35rem);
  transition: height 0.14s ease-out, margin-bottom 0.14s ease-out;
}

.comment-composer {
  position: relative;
  width: 100%;
  flex-direction: row;
  align-items: stretch;
  gap: 0.55rem;
  margin: 0;
  padding: 0.55rem;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.comment-composer.is-floating {
  position: fixed;
  left: 50%;
  bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
  z-index: 120;
  width: var(--comment-composer-width, var(--content-width));
  max-width: min(calc(100% - 3rem), var(--content-width));
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 28px rgba(45, 43, 40, 0.12), var(--shadow-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: comments-rise 0.16s ease-out;
}

.comment-composer textarea {
  flex: 1 1 auto;
  min-width: 0;
  height: 2.75rem;
  min-height: 2.75rem;
  max-height: 2.75rem;
  resize: none;
  line-height: 1.35;
  overflow-y: auto;
}

.comment-composer-actions {
  flex: 0 0 auto;
}

.comment-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  border: 1px solid var(--color-accent);
  border-radius: 4px;
  background: var(--color-accent);
  color: var(--color-surface);
  cursor: pointer;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  min-height: 2.35rem;
  padding: 0.45rem 0.85rem;
  text-align: center;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.comment-composer .comment-button {
  align-self: stretch;
  height: 2.75rem;
  white-space: nowrap;
}

.comments-auth .comment-button {
  align-self: stretch;
}

.comment-button:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

.comment-button:disabled,
.comment-button:disabled:hover {
  background: var(--color-code-bg);
  border-color: var(--color-border);
  color: var(--color-text-tertiary);
  cursor: not-allowed;
}

.comment-button-ghost {
  background: transparent;
  color: var(--color-accent);
}

.comment-button-ghost:hover {
  background: var(--color-surface-hover);
  color: var(--color-accent-hover);
}

.comment-button-ghost:disabled,
.comment-button-ghost:disabled:hover {
  background: var(--color-surface-hover);
  color: var(--color-text-tertiary);
  cursor: not-allowed;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.comment-item {
  display: flex;
  gap: 0.75rem;
}

.comment-item.is-deleted .comment-body {
  background: var(--color-surface-hover);
}

.comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 36px;
  background: var(--color-code-bg);
}

.comment-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
  font-weight: 700;
}

.comments-user-avatar {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
}

.comments-profile .comments-profile-avatar {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  box-shadow: 0 0 0 1px var(--color-border-light);
}

.comment-body {
  min-width: 0;
  flex: 1;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
}

.comment-meta {
  justify-content: space-between;
  margin-bottom: 0.35rem;
  color: var(--color-text-secondary);
  font-size: 0.85rem;
}

.comment-author-line {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.comment-meta strong {
  color: var(--color-text);
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comment-own-badge,
.comment-owner-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 1.35rem;
  padding: 0.08rem 0.42rem;
  border: 1px solid rgba(218, 119, 86, 0.22);
  border-radius: 999px;
  background: rgba(218, 119, 86, 0.1);
  color: var(--color-accent);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
}

.comment-owner-badge {
  border-color: rgba(60, 118, 61, 0.22);
  background: rgba(60, 118, 61, 0.08);
  color: var(--color-syntax-addition-text);
}

.comment-meta time {
  color: var(--color-text-tertiary);
  font-size: 0.78rem;
}

.comment-content {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--color-text);
  line-height: 1.7;
}

.comment-content.is-deleted {
  color: var(--color-text-tertiary);
  font-style: italic;
}

.comment-item-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.comment-link-button {
  border: 0;
  background: transparent;
  color: var(--color-accent);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  padding: 0.45rem 0 0;
}

.comment-link-button:hover {
  color: var(--color-accent-hover);
}

.comment-link-button:disabled,
.comment-link-button:disabled:hover {
  color: var(--color-text-tertiary);
  cursor: wait;
}

.comment-delete-button {
  color: var(--color-text-tertiary);
}

.comment-delete-button:hover {
  color: var(--color-syntax-deletion-text);
}

.comment-replies {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.85rem;
  padding-left: 1rem;
  border-left: 2px solid var(--color-border-light);
}

@keyframes comments-rise {
  from {
    opacity: 0;
    transform: translate(-50%, 12px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes comments-dialog-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Responsive --- */
@media (max-width: 1320px) {
  .post-body-wrapper.has-left-dual {
    display: block;
    max-width: var(--content-width);
  }

  .post-body-wrapper.has-left-dual .post-left-sidebar,
  .post-body-wrapper.has-left-dual .note-history-sidebar {
    display: none;
  }
}

@media (max-width: 1100px) {
  .post-body-wrapper {
    display: block;
    max-width: var(--content-width);
  }

  .post-left-sidebar,
  .note-history-sidebar {
    display: none;
  }

  .note-diff-layout {
    grid-template-columns: 1fr;
  }

  .note-timeline {
    position: static;
    grid-auto-flow: column;
    grid-auto-columns: minmax(10rem, 13rem);
    overflow-x: auto;
    max-height: none;
    padding: 0 0 0.35rem;
  }
}

@media (max-width: 900px) {
  .note-workspace-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .note-panel-files {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 52px;
  }

  body {
    font-size: 15px;
  }

  .main-content {
    padding: 1.5rem 1rem;
  }

  .header-inner {
    padding: 0 1rem;
    flex-wrap: wrap;
  }

  .nav-toggle {
    display: block;
  }

  .site-nav {
    display: none;
    flex-direction: column;
    width: 100%;
    padding: 0.5rem 0 0.75rem;
    gap: 0;
    border-top: 1px solid var(--color-border-light);
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav .nav-link {
    padding: 0.6rem 0;
    font-size: 0.95rem;
  }

  .post-title {
    font-size: 1.5rem;
  }

  .post-card {
    padding: 1.25rem;
  }

  .post-card-title {
    font-size: 1.15rem;
  }

  .post-content {
    font-size: 1rem;
  }

  .post-nav {
    flex-direction: column;
  }

  .post-nav a {
    max-width: 100%;
  }

  .note-admin-head {
    align-items: stretch;
    flex-direction: column;
    gap: 0.75rem;
  }

  .page-content .note-admin h1 {
    font-size: 1.55rem;
  }

  .note-admin-state {
    width: 100%;
    justify-content: flex-start;
  }

  .note-panel,
  .note-preview,
  .note-admin-gate {
    padding: 0.85rem;
  }

  .note-workspace-grid {
    grid-template-columns: 1fr;
  }

  .note-panel-files {
    grid-column: auto;
  }

  .note-preview-summary {
    grid-template-columns: 1fr 1fr;
  }

  .note-actions {
    grid-template-columns: 1fr;
  }

  .note-actions button {
    width: 100%;
  }

  .note-diff-columns {
    grid-template-columns: 1fr;
  }

  .note-diff-columns aside {
    border-left: 0;
    border-top: 1px solid var(--color-border-light);
  }

  .comments-header {
    align-items: flex-start;
    flex-direction: row;
    gap: 0.75rem;
  }

  .comments-header > div:first-child {
    flex: 0 0 auto;
  }

  .comments-user {
    justify-content: flex-end;
    margin-left: auto;
    gap: 0.45rem;
  }

  .comments-profile-trigger {
    gap: 0.4rem;
    max-width: 54vw;
    padding-right: 0.1rem;
  }

  .comments-user .comment-avatar-upload,
  .comments-user .comment-avatar-button {
    width: 34px;
    height: 34px;
  }

  .comments-user .comment-avatar {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

  .comments {
    padding-bottom: calc(6.5rem + env(safe-area-inset-bottom, 0px));
  }

  .comments-message.is-floating {
    width: calc(100% - 2rem);
  }

  .comments-message.is-floating {
    bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
  }

  .comment-composer {
    gap: 0.45rem;
    padding: 0.45rem;
  }

  .comment-composer.is-floating {
    bottom: max(0.5rem, env(safe-area-inset-bottom, 0px));
    max-width: calc(100% - 2rem);
  }

  .comment-composer .comment-button {
    padding: 0.45rem 0.65rem;
  }

  .comments-auth-backdrop {
    padding: 0.75rem;
  }

  .comments-auth {
    max-height: calc(100vh - 1.5rem);
  }

  .comments-profile-inline-form {
    gap: 0.5rem;
  }

  .comments-profile-save,
  .comments-profile-cancel {
    min-width: auto;
    padding-inline: 0.7rem;
  }

  .comment-replies {
    padding-left: 0.65rem;
  }

  .about-hero,
  .about-fragments,
  .about-split,
  .about-contact {
    grid-template-columns: 1fr;
    gap: 1.65rem;
  }

  .about-hero {
    padding-top: 0.5rem;
    padding-bottom: 2.5rem;
  }

  .about-hero h1 {
    font-size: 2.65rem;
  }

  .about-lede {
    font-size: 1rem;
  }

  .about-visual {
    min-height: 224px;
    transform: none;
  }

  .about-logo-mark {
    width: 104px;
    height: 115px;
  }

  .about-topic-grid {
    grid-template-columns: 1fr;
  }

  .about-section {
    padding-top: 3rem;
  }

  .about-section-heading {
    display: block;
  }

  .about-section h2 {
    font-size: 1.48rem;
  }

  .about-fragment-stack {
    min-height: 410px;
  }

  .about-fragment-main {
    left: 0;
    width: 78%;
    min-height: 220px;
  }

  .about-fragment-note {
    right: 0;
    top: 205px;
    bottom: auto;
    width: 72%;
  }

  .about-topic-card {
    min-height: 0;
  }

  .post-content .about-link-list a {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
  }

  .about-link-list strong {
    text-align: left;
  }
}
