/* ==========================================================================
   Sxtx · 纸境工坊 · Studio Editorial Craft CSS
   Design Intelligence: Swiss Grid / Editorial Takeo Paper / No-AI-Slop
   ========================================================================== */

:root {
  --bg-paper: #fcfbf9;
  --bg-card: #ffffff;
  --bg-subtle: #f5f4ef;
  --bg-hover: #f0eee6;
  
  --border-line: rgba(225, 221, 212, 0.85);
  --border-subtle: rgba(235, 232, 226, 0.6);
  --border-focus: #18181b;

  --text-title: #18181b;
  --text-body: #3f3f46;
  --text-muted: #71717a;
  --text-faint: #a1a1aa;

  --brand-seal: #b91c1c;
  --brand-seal-bg: rgba(185, 28, 28, 0.05);
  --brand-emerald: #059669;
  --brand-emerald-bg: rgba(5, 150, 105, 0.08);

  --font-serif: 'Lora', 'Noto Serif SC', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;

  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 160ms var(--ease-spring);
  --transition-normal: 240ms var(--ease-spring);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-card: 0 2px 4px rgba(0, 0, 0, 0.02), 0 10px 24px -8px rgba(0, 0, 0, 0.04);
  --shadow-modal: 0 20px 40px -10px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.05);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--bg-paper);
  color: var(--text-body);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  line-height: 1.65;
  background-color: var(--bg-paper);
  color: var(--text-body);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Subtle Paper Texture Noise Overlay */
.paper-grain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Top Reading Progress Bar */
.read-progress-line {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--text-title);
  z-index: 1000;
  transition: width 0.1s linear;
}

/* SVG Icon Helper */
.svg-icon {
  width: 1.15rem;
  height: 1.15rem;
  display: inline-block;
  vertical-align: middle;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Floating Navigation Dock
   -------------------------------------------------------------------------- */
.nav-dock-container {
  position: fixed;
  top: 1rem;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 500;
  padding: 0 1rem;
  pointer-events: none;
}

.nav-dock {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: rgba(252, 251, 249, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-line);
  padding: 0.45rem 1.1rem;
  border-radius: 9999px;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.nav-dock:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  color: var(--text-title);
  font-weight: 600;
}

.brand-serif {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-sep {
  color: var(--border-line);
  font-weight: 300;
}

.brand-sub {
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.35rem 0.65rem;
  border-radius: 9999px;
  transition: all var(--transition-fast);
}

.nav-item .nav-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
}

.nav-item:hover {
  color: var(--text-title);
  background: var(--bg-hover);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding-left: 0.5rem;
  border-left: 1px solid var(--border-line);
}

.icon-btn {
  background: transparent;
  border: none;
  outline: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.35rem 0.5rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all var(--transition-fast);
  position: relative;
}

.icon-btn:hover {
  color: var(--text-title);
  background: var(--bg-hover);
}

.key-shortcut {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  border: 1px solid var(--border-line);
  border-radius: 4px;
  padding: 0.05rem 0.3rem;
  color: var(--text-faint);
  background: #ffffff;
}

.admin-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  background: var(--brand-emerald);
  border-radius: 50%;
}

/* --------------------------------------------------------------------------
   Page Container & Grid Layout
   -------------------------------------------------------------------------- */
.page-container {
  max-width: 920px;
  margin: 0 auto;
  padding: 7rem 1.5rem 5rem;
}

/* --------------------------------------------------------------------------
   Hero Section
   -------------------------------------------------------------------------- */
.hero-section {
  padding: 1.5rem 0 3.5rem;
  border-bottom: 1px solid var(--border-line);
}

.hero-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--brand-emerald-bg);
  border: 1px solid rgba(5, 150, 105, 0.18);
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--brand-emerald);
  margin-bottom: 1.75rem;
}

.pulse-indicator {
  position: relative;
  width: 8px;
  height: 8px;
  display: inline-flex;
}

.pulse-ring {
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: var(--brand-emerald);
  opacity: 0.4;
  animation: pulse-ring 2s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

.pulse-core {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-emerald);
}

@keyframes pulse-ring {
  0% { transform: scale(0.9); opacity: 0.6; }
  70% { transform: scale(2.2); opacity: 0; }
  100% { transform: scale(2.2); opacity: 0; }
}

.hero-title {
  font-family: var(--font-serif);
  font-size: 2.35rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-title);
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}

.hero-bio {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-body);
  max-width: 780px;
  margin-bottom: 2rem;
}

.hero-bio strong {
  color: var(--text-title);
  font-weight: 600;
}

.hero-meta-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

/* Red Seal Stamp (Carved Chop Stamp) */
.seal-stamp {
  width: 68px;
  height: 68px;
  border: 2.5px solid var(--brand-seal);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-seal-bg);
  box-shadow: inset 0 0 0 1.5px rgba(185, 28, 28, 0.25), 0 2px 5px rgba(185, 28, 28, 0.1);
  transform: rotate(-2.5deg);
  user-select: none;
  transition: transform var(--transition-fast);
}

.seal-stamp:hover {
  transform: rotate(0deg) scale(1.05);
}

.seal-inner {
  color: var(--brand-seal);
  font-family: var(--font-serif);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  letter-spacing: 0.08em;
}

/* System Metrics Mini Console */
.sys-metrics-panel {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  padding: 0.65rem 1.15rem;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.metric-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.metric-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-faint);
}

.metric-val {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-title);
}

/* --------------------------------------------------------------------------
   Content Sections Common Header
   -------------------------------------------------------------------------- */
.content-section {
  padding: 4rem 0 2rem;
  border-bottom: 1px solid var(--border-line);
}

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

.sec-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.sec-num {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text-faint);
  font-weight: 500;
}

.sec-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-title);
  letter-spacing: -0.01em;
}

.sec-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}

.sec-note {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Category Filter Tabs */
.category-tabs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-subtle);
  padding: 0.25rem;
  border-radius: 9999px;
  border: 1px solid var(--border-subtle);
}

.cat-tab {
  background: transparent;
  border: none;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.3rem 0.8rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.cat-tab:hover {
  color: var(--text-title);
}

.cat-tab.active {
  background: var(--bg-card);
  color: var(--text-title);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* --------------------------------------------------------------------------
   SECTION 1: Essays Feed & Featured Slot
   -------------------------------------------------------------------------- */
/* Featured Essay Hero Card */
.featured-essay-card {
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  border-radius: 12px;
  padding: 2.25rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
  position: relative;
}

.featured-essay-card:hover {
  transform: translateY(-2px);
  border-color: var(--text-title);
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.07);
}

.featured-badge-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.pill-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  background: var(--bg-subtle);
  color: var(--text-title);
  border: 1px solid var(--border-subtle);
}

.featured-date {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.featured-title {
  font-family: var(--font-serif);
  font-size: 1.65rem;
  font-weight: 600;
  color: var(--text-title);
  line-height: 1.35;
  margin-bottom: 0.85rem;
  letter-spacing: -0.015em;
}

.featured-summary {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text-body);
  margin-bottom: 1.5rem;
}

.read-more-action {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-title);
  border-bottom: 1px solid transparent;
  transition: all var(--transition-fast);
}

.featured-essay-card:hover .read-more-action {
  border-bottom-color: var(--text-title);
}

.read-more-action svg {
  transition: transform var(--transition-fast);
}

.featured-essay-card:hover .read-more-action svg {
  transform: translateX(4px);
}

/* Essays Index Table of Contents */
.essays-feed {
  display: flex;
  flex-direction: column;
}

.essay-row-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.15rem 0.5rem;
  border-bottom: 1px dashed var(--border-line);
  cursor: pointer;
  transition: background var(--transition-fast), padding-left var(--transition-fast);
  border-radius: 6px;
}

.essay-row-item:hover {
  background: var(--bg-hover);
  padding-left: 0.85rem;
}

.essay-row-left {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  flex: 1;
}

.essay-date-col {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-faint);
  min-width: 95px;
}

.essay-title-col {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-title);
  line-height: 1.4;
  transition: color var(--transition-fast);
}

.essay-row-item:hover .essay-title-col {
  color: #000;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.essay-row-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.essay-cat-pill {
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.essay-readtime-pill {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-faint);
}

.essay-arrow-icon {
  color: var(--text-faint);
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.essay-row-item:hover .essay-arrow-icon {
  color: var(--text-title);
  transform: translate(2px, -2px);
}

/* --------------------------------------------------------------------------
   SECTION 2: Moments Vertical Timeline
   -------------------------------------------------------------------------- */
.moments-timeline {
  position: relative;
  padding-left: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.moments-timeline::before {
  content: '';
  position: absolute;
  top: 0.5rem;
  bottom: 0.5rem;
  left: 7px;
  width: 1px;
  background: var(--border-line);
}

.moment-entry {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.moment-entry:hover {
  border-color: rgba(0, 0, 0, 0.25);
  transform: translateX(2px);
}

.moment-dot {
  position: absolute;
  top: 1.5rem;
  left: -2rem;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--bg-paper);
  border: 2px solid var(--text-muted);
  transform: translateX(-50%);
}

.moment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.moment-tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-subtle);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.moment-time {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
}

.moment-text {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-body);
}

/* --------------------------------------------------------------------------
   SECTION 3: Artifacts Grid
   -------------------------------------------------------------------------- */
.artifacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.artifact-card {
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  border-radius: 10px;
  padding: 1.65rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: all var(--transition-fast);
}

.artifact-card:hover {
  transform: translateY(-2px);
  border-color: var(--text-title);
  box-shadow: var(--shadow-card);
}

.art-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.art-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-title);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  border: 1px solid transparent;
}

.status-badge.active {
  background: var(--brand-emerald-bg);
  color: var(--brand-emerald);
  border-color: rgba(5, 150, 105, 0.2);
}

.status-badge.current {
  background: rgba(30, 41, 59, 0.08);
  color: #1e293b;
  border-color: rgba(30, 41, 59, 0.2);
}

.mini-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.art-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-title);
  margin-bottom: 0.6rem;
}

.art-desc {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text-body);
  margin-bottom: 1.25rem;
  flex: 1;
}

.art-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tech-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   SECTION 4: Heatmap
   -------------------------------------------------------------------------- */
.heatmap-card {
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  border-radius: 10px;
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.heatmap-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.active-rate strong {
  color: var(--brand-emerald);
  font-family: var(--font-mono);
}

.heatmap-grid {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 12px);
  gap: 3px;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.heat-cell {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  transition: transform 0.1s ease;
}

.heat-cell:hover {
  transform: scale(1.3);
  z-index: 10;
}

.lvl-0 { background: #ebe9e1; }
.lvl-1 { background: #9be9a8; }
.lvl-2 { background: #40c463; }
.lvl-3 { background: #30a14e; }
.lvl-4 { background: #216e39; }

.heatmap-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-faint);
  margin-top: 1rem;
}

.legend {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.legend-cell {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

/* --------------------------------------------------------------------------
   SECTION 5: Guestbook & Inputs
   -------------------------------------------------------------------------- */
.guestbook-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.guestbook-form {
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  border-radius: 8px;
  padding: 1.15rem;
  box-shadow: var(--shadow-sm);
}

.form-inputs-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.paper-input, .paper-textarea, .paper-select {
  background: var(--bg-paper);
  border: 1px solid var(--border-line);
  border-radius: 6px;
  padding: 0.55rem 0.85rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text-title);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.paper-input:focus, .paper-textarea:focus, .paper-select:focus {
  border-color: var(--border-focus);
  background: #ffffff;
  box-shadow: 0 0 0 1px var(--border-focus);
}

.input-author {
  width: 180px;
}

.input-content {
  flex: 1;
  min-width: 220px;
}

.paper-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  outline: none;
  font-family: inherit;
}

.btn-primary {
  background: var(--text-title);
  color: #ffffff;
}

.btn-primary:hover {
  background: #000000;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-title);
  border-color: var(--border-line);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--text-title);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  color: var(--text-title);
  background: var(--bg-hover);
}

.btn-danger {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

.btn-danger:hover {
  background: #fecaca;
}

.messages-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.message-card {
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  border-radius: 8px;
  padding: 1.15rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.85rem;
}

.msg-body {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-title);
}

.msg-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px dashed var(--border-subtle);
  padding-top: 0.5rem;
}

.msg-author {
  font-weight: 600;
  color: var(--text-title);
}

.msg-time {
  font-family: var(--font-mono);
  color: var(--text-faint);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.page-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.powered {
  font-size: 0.75rem;
  color: var(--text-faint);
  margin-top: 0.25rem;
}

.footer-admin-btn {
  background: transparent;
  border: 1px solid var(--border-line);
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  transition: all var(--transition-fast);
}

.footer-admin-btn:hover {
  background: var(--bg-hover);
  color: var(--text-title);
  border-color: var(--text-title);
}

/* --------------------------------------------------------------------------
   MODALS & DRAWERS (Reader, Search, Studio)
   -------------------------------------------------------------------------- */
.modal-overlay, .drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(24, 24, 27, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Search Modal Box */
.search-modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  border-radius: 12px;
  width: 100%;
  max-width: 600px;
  box-shadow: var(--shadow-modal);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--border-line);
  gap: 0.75rem;
}

.search-lead-icon {
  color: var(--text-muted);
}

.search-input-wrap input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1.05rem;
  font-family: inherit;
  color: var(--text-title);
  background: transparent;
}

.search-results-list {
  max-height: 380px;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.search-hint {
  font-size: 0.85rem;
  color: var(--text-faint);
  text-align: center;
  padding: 2rem 1rem;
}

.search-result-item {
  padding: 0.65rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  transition: background var(--transition-fast);
}

.search-result-item:hover, .search-result-item.selected {
  background: var(--bg-hover);
}

.sr-title {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-title);
}

.sr-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.5rem;
}

/* Reader Drawer */
.reader-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 760px;
  background: var(--bg-paper);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  z-index: 1200;
  animation: slideInRight 0.25s var(--ease-spring);
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.drawer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-line);
  background: rgba(252, 251, 249, 0.9);
  backdrop-filter: blur(8px);
}

.drawer-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.drawer-cat-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-title);
}

.drawer-date, .drawer-read-time {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.drawer-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.font-zoom-ctrl {
  display: flex;
  border: 1px solid var(--border-line);
  border-radius: 6px;
  overflow: hidden;
}

.font-zoom-ctrl button {
  background: var(--bg-card);
  border: none;
  padding: 0.25rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
}

.font-zoom-ctrl button:hover {
  background: var(--bg-hover);
  color: var(--text-title);
}

.drawer-content-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 2.5rem 2.5rem 5rem;
}

.drawer-article-body {
  max-width: 650px;
  margin: 0 auto;
}

.drawer-title {
  font-family: var(--font-serif);
  font-size: 2.15rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-title);
  margin-bottom: 1rem;
}

.drawer-summary {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 1.5rem;
}

.drawer-divider {
  border: none;
  border-top: 1px solid var(--border-line);
  margin-bottom: 2rem;
}

.markdown-rendered-content {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text-body);
}

.markdown-rendered-content h2, 
.markdown-rendered-content h3 {
  font-family: var(--font-serif);
  color: var(--text-title);
  margin-top: 2rem;
  margin-bottom: 0.85rem;
}

.markdown-rendered-content p {
  margin-bottom: 1.35rem;
}

.markdown-rendered-content ul, 
.markdown-rendered-content ol {
  margin-bottom: 1.35rem;
  padding-left: 1.5rem;
}

.markdown-rendered-content li {
  margin-bottom: 0.4rem;
}

.markdown-rendered-content code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  padding: 0.15em 0.35em;
  border-radius: 4px;
}

.markdown-rendered-content pre {
  background: #18181b;
  color: #f4f4f5;
  padding: 1.25rem;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.markdown-rendered-content pre code {
  background: transparent;
  border: none;
  color: inherit;
  padding: 0;
}

.markdown-rendered-content blockquote {
  border-left: 3px solid var(--text-title);
  padding-left: 1rem;
  color: var(--text-muted);
  margin-bottom: 1.35rem;
}

/* --------------------------------------------------------------------------
   ADMIN STUDIO MODAL (Modern Studio Workbench)
   -------------------------------------------------------------------------- */
.admin-studio-box {
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  border-radius: 12px;
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  box-shadow: var(--shadow-modal);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.studio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-line);
  background: var(--bg-subtle);
}

.studio-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-title);
}

.studio-title-wrap h3 {
  font-size: 1.05rem;
  font-weight: 600;
}

.studio-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.login-card {
  max-width: 380px;
  margin: 3rem auto;
  text-align: center;
}

.login-tip {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-error-msg {
  color: #dc2626;
  font-size: 0.85rem;
  margin-top: 0.75rem;
}

/* Studio Tabs */
.studio-tabs {
  display: flex;
  gap: 0.35rem;
  border-bottom: 1px solid var(--border-line);
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.studio-tab {
  background: transparent;
  border: none;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.studio-tab:hover {
  color: var(--text-title);
  background: var(--bg-hover);
}

.studio-tab.active {
  background: var(--bg-hover);
  color: var(--text-title);
  font-weight: 600;
}

.studio-pane {
  display: none;
}

.studio-pane.active {
  display: block;
}

/* Editor Form */
.editor-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-row-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.field-wrap.flex-2 {
  grid-column: span 2;
}

.field-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field-wrap label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.label-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.editor-word-count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-faint);
}

.mono-text {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.6;
}

.editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.action-align-end {
  display: flex;
  align-items: flex-end;
}

/* Studio Lists (Articles, Moments, Messages) */
.studio-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.studio-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-line);
  border-radius: 6px;
}

.studio-item-left {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}

.sir-title {
  font-weight: 600;
  color: var(--text-title);
  font-size: 0.95rem;
}

.sir-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.studio-item-actions {
  display: flex;
  gap: 0.5rem;
}

.action-btn-sm {
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  padding: 0.25rem 0.55rem;
  font-size: 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.action-btn-sm:hover {
  color: var(--text-title);
  border-color: var(--text-title);
}

.action-btn-sm.delete:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

/* Settings Grid */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.settings-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-line);
  border-radius: 8px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settings-box h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-title);
  border-bottom: 1px solid var(--border-line);
  padding-bottom: 0.5rem;
}

.logout-wrap {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--border-line);
  padding-top: 1rem;
}

.form-feedback {
  font-size: 0.8rem;
  color: var(--brand-emerald);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 2000;
  pointer-events: none;
}

.toast {
  background: #18181b;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.55rem 1.1rem;
  border-radius: 9999px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: toastIn 0.25s var(--ease-spring);
}

@keyframes toastIn {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Loading skeleton */
.loading-skeleton {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--text-faint);
  font-size: 0.9rem;
}

/* --------------------------------------------------------------------------
   Mobile & Responsive Queries
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .nav-dock {
    gap: 0.75rem;
    padding: 0.4rem 0.8rem;
  }
  .nav-item span.nav-num {
    display: none;
  }
  .hero-title {
    font-size: 1.85rem;
  }
  .hero-meta-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .reader-drawer {
    max-width: 100%;
  }
  .drawer-content-scroll {
    padding: 1.5rem 1.25rem 4rem;
  }
  .field-wrap.flex-2 {
    grid-column: span 1;
  }
}


.hero-subnote {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  box-shadow: var(--shadow-sm);
}

.subnote-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-emerald);
}
