/* ==========================================================
   Skeuomorphic Notebook Blog Theme
   ========================================================== */

/* ── Root Variables ── */
:root {
  --paper:        #f5eedc;
  --paper-dark:   #ede0c5;
  --paper-line:   #ddd0b0;
  --ink:          #2c2416;
  --ink-mid:      #5a4e3a;
  --ink-soft:     #9a8c75;
  --ink-faint:    #c8baa0;
  --cover:        #1a1208;
  --accent:       #3d7fc1;
  --accent-soft:  rgba(61,127,193,0.12);
  --tag-bg:       rgba(90,78,58,0.09);
  --radius:       8px;
  --pad:          24px;
  --body-bg:      linear-gradient(to bottom, rgba(80,120,170,0.35) 0%, rgba(140,180,120,0.2) 60%, rgba(200,170,90,0.25) 100%), #7ba8c8;

  /* Legacy aliases so other pages don't break */
  --y2k-pink:   #ec4899;
  --y2k-cyan:   #06b6d4;
  --text:       var(--ink);
  --border:     var(--paper-line);
}

:root[data-theme="dark"] {
  --paper:        #1e1e1e;
  --paper-dark:   #121212;
  --paper-line:   #333333;
  --ink:          #e0e0e0;
  --ink-mid:      #b0b0b0;
  --ink-soft:     #888888;
  --ink-faint:    #555555;
  --cover:        #000000;
  --accent:       #4ca1f0;
  --accent-soft:  rgba(76,161,240,0.15);
  --tag-bg:       rgba(255,255,255,0.05);
  --body-bg:      #121212;
  
  --text:         var(--ink);
  --border:       var(--paper-line);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 14px; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--paper-dark); }
::-webkit-scrollbar-thumb { background: var(--ink-faint); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-soft); }

/* ── Body ── */
body {
  font-family: 'Noto Sans SC', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  min-height: 100vh;
  margin: 0;
  padding: 20px 12px;
  background: var(--body-bg);
}

/* ════════════════════════════════════════
   NOTEBOOK LAYOUT
════════════════════════════════════════ */
/* ════════════════════════════════════════
   HARDBACK OPEN NOTEBOOK
════════════════════════════════════════ */

/* ── Outer wrapper (THE COVER) ── */
.notebook-wrap {
  position: relative;
  max-width: 1220px;
  margin: 0 auto;
  
  /* Padding acts as the cover overhang + space for stacked pages.
     Top/Bottom: 12px/16px overhang.
     Left/Right: 24px (12px for page stack + 12px for cover overhang) */
  padding: 12px 24px 16px 24px;
  border-radius: 6px 12px 12px 6px;
  
  /* Leather cover gradient */
  background: linear-gradient(
    165deg,
    #4a2e10 0%,
    #2e1a08 18%,
    #1c1005 45%,
    #231408 72%,
    #160d04 100%
  );
  
  /* Book drop shadow & subtle highlight */
  box-shadow:
    0 50px 120px rgba(0,0,0,0.60),
    0 22px 55px  rgba(0,0,0,0.42),
    0  8px 18px  rgba(0,0,0,0.28),
    inset 0 1px 0 rgba(255,255,255,0.12);
}

/* ── INNER PAGES ── */
.notebook {
  position: relative;
  width: 100%;
  background: var(--paper);
  display: flex;
  border-radius: 3px;
  overflow: hidden; /* Clips the inner page scroll */

  /* Stacked pages on BOTH sides + ambient separation shadow */
  box-shadow:
    /* Right stacked pages */
    3px   2px 0 -1px #eee1c8,
    6px   4px 0 -2px #e8d9bc,
    9px   6px 0 -3px #e0d0b0,
    12px  8px 0 -4px #d8c8a5,
    
    /* Left stacked pages */
    -3px  2px 0 -1px #eee1c8,
    -6px  4px 0 -2px #e8d9bc,
    -9px  6px 0 -3px #e0d0b0,
    -12px 8px 0 -4px #d8c8a5,
    
    /* Ambient shadow to separate pages from the dark cover */
    0 0 10px rgba(0,0,0,0.6);
}

/* ── CENTER SPINE / FOLD RIDGE ── */
.notebook::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  pointer-events: none;
  z-index: 10;
  /* Soft inner shadow mimicking a realistic book fold */
  background: linear-gradient(to right,
    rgba(0,0,0,0) 0%,
    rgba(0,0,0,0.02) 25%,
    rgba(0,0,0,0.08) 47%,
    rgba(0,0,0,0.15) 50%,
    rgba(0,0,0,0.08) 53%,
    rgba(0,0,0,0.02) 75%,
    rgba(0,0,0,0) 100%
  );
}

/* No ::before needed — border handles the cover */

/* ── PAGES ── */
.page {
  flex: 1;
  width: 50%;
  padding: var(--pad);
  overflow-y: auto;
  max-height: 820px;
  position: relative;
  background: var(--paper);
}

/* Left page: shadow curls toward the spine (right edge of left page) */
.page-left {
  box-shadow: inset -30px 0 38px -18px rgba(0,0,0,0.22);
}

/* Right page: shadow curls toward the spine (left edge of right page) */
.page-right {
  box-shadow: inset 30px 0 38px -18px rgba(0,0,0,0.18);
}

/* ── Author Card ── */
.author-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.nb-avatar {
  width: 52px; height: 52px;
  border-radius: 8px;
  background: linear-gradient(135deg, #7fa8c8 0%, #a0c4e0 50%, #6e96b8 100%);
  border: 2px solid var(--paper-line);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Crimson Pro', serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff;
}
.author-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}
.author-desc {
  font-size: 0.73rem;
  color: var(--ink-soft);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Stats Row */
.stats-row {
  display: flex;
  border: 1px solid var(--paper-line);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(255,255,255,0.3);
}
.stat { flex: 1; text-align: center; padding: 10px 4px; }
.stat + .stat { border-left: 1px solid var(--paper-line); }
.stat-n { font-size: 1.05rem; font-weight: 700; color: var(--ink); display: block; }
.stat-l { font-size: 0.68rem; color: var(--ink-soft); margin-top: 2px; }

/* ── Sidebar sections ── */
.nb-section { margin-bottom: 20px; }

.nb-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nb-section-title::after { content:''; flex:1; height:1px; background:var(--paper-line); }

/* Search */
.nb-search {
  width: 100%;
  background: rgba(255,255,255,0.55);
  border: 1px solid var(--paper-line);
  border-radius: var(--radius);
  padding: 9px 14px;
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 0.82rem;
  color: var(--ink);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.nb-search::placeholder { color: var(--ink-soft); }
.nb-search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Tags */
.nb-tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.nb-tag {
  font-size: 0.75rem;
  color: var(--ink-mid);
  background: var(--tag-bg);
  border: 1px solid var(--paper-line);
  border-radius: 20px;
  padding: 3px 10px;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.nb-tag:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ── Activity Log Feed ── */
.nb-log-feed { display: flex; flex-direction: column; }
.nb-log-item { padding: 10px 0; border-bottom: 1px dashed var(--ink-faint); }
.nb-log-item:last-child { border-bottom: none; }
.nb-log-row { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.nb-log-icon {
  width: 26px; height: 26px;
  border-radius: 6px;
  background: linear-gradient(135deg,#3d7fc1,#5b9bd5);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 0.62rem; font-weight: 700; color: #fff;
}
.nb-log-user  { font-size: 0.80rem; font-weight: 600; color: var(--ink); flex: 1; }
.nb-log-time  { font-size: 0.68rem; color: var(--ink-soft); white-space: nowrap; }
.nb-log-sys   { font-size: 0.68rem; color: var(--ink-soft); padding-left: 34px; margin-bottom: 3px; }
.nb-log-sys span + span::before { content:' · '; opacity:.5; }
.nb-log-msg   { font-size: 0.78rem; color: var(--ink-mid); padding-left: 34px; line-height: 1.4; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }

/* ── Feed Item (Article) ── */
.nb-feed-item {
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px dashed var(--paper-line);
}
.nb-feed-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.nb-feed-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 16px;
  letter-spacing: 0.5px;
}
.nb-feed-title a { color: var(--ink); text-decoration: none; }
.nb-feed-title a:hover { color: var(--accent); }

.nb-feed-excerpt {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--ink-mid);
  margin-bottom: 16px;
  letter-spacing: 0.3px;
  text-align: justify;
}

.nb-feed-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--ink-soft);
  letter-spacing: 0.5px;
}
.nb-feed-cat {
  font-weight: 600;
  color: var(--ink-mid);
}

/* Spinner area */
.nb-card-visual {
  width: 100%;
  height: 155px;
  background: var(--paper-dark);
  border: 1px solid var(--paper-line);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}
.nb-card-visual::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 25%, rgba(255,255,255,0.45) 50%, transparent 75%);
  background-size: 200% 100%;
  animation: nb-shimmer 2.2s infinite;
}
@keyframes nb-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

/* Banner image mode — no shimmer, image fills the area */
.nb-card-visual--img {
  background: #000;
  padding: 0;
}
.nb-card-visual--img::before { display: none; }
.nb-card-banner {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 5px;
  display: block;
  transition: transform .3s;
}
.nb-card:hover .nb-card-banner { transform: scale(1.02); }

/* iOS-style CSS Spinner */
.nb-spinner { width: 42px; height: 42px; position: relative; z-index: 2; }
.nb-blade {
  position: absolute; top: 50%; left: 50%;
  width: 7%; height: 23%;
  border-radius: 3px;
  background: #afa090;
  transform-origin: center 115%;
  animation: nb-blade 1.2s linear infinite;
}
.nb-blade:nth-child(1)  { transform: rotate(0deg)   translateY(-120%); animation-delay: 0s; }
.nb-blade:nth-child(2)  { transform: rotate(30deg)  translateY(-120%); animation-delay: -.1s; }
.nb-blade:nth-child(3)  { transform: rotate(60deg)  translateY(-120%); animation-delay: -.2s; }
.nb-blade:nth-child(4)  { transform: rotate(90deg)  translateY(-120%); animation-delay: -.3s; }
.nb-blade:nth-child(5)  { transform: rotate(120deg) translateY(-120%); animation-delay: -.4s; }
.nb-blade:nth-child(6)  { transform: rotate(150deg) translateY(-120%); animation-delay: -.5s; }
.nb-blade:nth-child(7)  { transform: rotate(180deg) translateY(-120%); animation-delay: -.6s; }
.nb-blade:nth-child(8)  { transform: rotate(210deg) translateY(-120%); animation-delay: -.7s; }
.nb-blade:nth-child(9)  { transform: rotate(240deg) translateY(-120%); animation-delay: -.8s; }
.nb-blade:nth-child(10) { transform: rotate(270deg) translateY(-120%); animation-delay: -.9s; }
.nb-blade:nth-child(11) { transform: rotate(300deg) translateY(-120%); animation-delay: -1.0s; }
.nb-blade:nth-child(12) { transform: rotate(330deg) translateY(-120%); animation-delay: -1.1s; }
@keyframes nb-blade {
  0%, 39% { opacity: 0.1; }
  40%      { opacity: 1; }
  100%     { opacity: 0.1; }
}

/* Card meta */
.nb-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px dashed var(--ink-faint);
}
.nb-cat-badge {
  font-size: 0.72rem;
  color: var(--ink-soft);
  background: var(--tag-bg);
  border: 1px solid var(--paper-line);
  border-radius: 20px;
  padding: 2px 9px;
}
.nb-meta-info { display: flex; gap: 10px; font-size: 0.72rem; color: var(--ink-soft); }

.nb-empty {
  text-align: center;
  color: var(--ink-soft);
  padding: 30px 0;
  font-size: 0.9rem;
  border: 1px dashed var(--paper-line);
  border-radius: var(--radius);
}

/* ── Chatbox (Sidebar) ── */
.nb-chat-messages {
  height: 350px;
  overflow-y: auto;
  padding: 10px 4px;
  margin-bottom: 12px;
  /* Scrollbar styling for chat */
  scrollbar-width: thin;
  scrollbar-color: var(--ink-faint) transparent;
}
.nb-chat-messages::-webkit-scrollbar { width: 6px; }
.nb-chat-messages::-webkit-scrollbar-thumb { background: var(--ink-faint); border-radius: 4px; }

.nb-chat-form { 
  display: flex; 
  flex-direction: column; 
  gap: 8px; 
}
.nb-chat-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 2px dashed var(--paper-line);
  padding: 8px 4px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  color: var(--ink);
  outline: none;
}
.nb-chat-input:focus {
  border-bottom-color: var(--accent);
}
.nb-chat-send {
  background: var(--tag-bg);
  color: var(--ink);
  border: 1px solid var(--paper-line);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  transition: all .2s;
  align-self: flex-end; /* Align button to the right */
}
.nb-chat-send:hover { 
  background: var(--accent); 
  color: #fff; 
  border-color: var(--accent);
}
/* ── Footer ── */
.nb-footer {
  text-align: center;
  padding: 14px;
  font-size: 0.75rem;
  color: var(--ink-soft);
  max-width: 1180px;
  margin: 0 auto;
}
.nb-footer a { color: var(--ink-soft); text-decoration: underline; }

/* ── Responsive ── */
@media (max-width: 760px) {
  body {
    padding: 0;
  }
  .notebook-wrap {
    padding: 0;
    margin: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
  }
  .notebook { 
    flex-direction: column; 
    overflow: hidden; 
    box-shadow: none;
    border-radius: 0;
  }
  .notebook-wrap::after { display: none; }
  .notebook::after { display: none; }
  .page { width: 100%; max-height: none; }
  .page-left {
    order: 2;
    border-right: none;
    box-shadow: none;
  }
  .page-right { 
    order: 1;
    border-bottom: 4px solid var(--cover);
    box-shadow: none; 
  }
}

/* ────────────────────────────────────────────
   LEGACY / OTHER PAGE STYLES (kept below)
──────────────────────────────────────────── */


/* ══════════════════════════
   TOP HEADER BAR
══════════════════════════ */
.book-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 1px 6px rgba(40,30,20,0.10);
}

.book-header-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 18px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.book-site-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.3px;
  white-space: nowrap;
  flex-shrink: 0;
}

.book-site-title:hover { color: #6a5228; text-decoration: none; }

.book-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
}

.book-nav a {
  display: inline-block;
  padding: 4px 10px;
  color: var(--text-mid);
  font-size: 13px;
  font-weight: 400;
  text-decoration: none;
  border-radius: 5px;
  transition: background 0.15s, color 0.15s;
  position: relative;
  white-space: nowrap;
}

.book-nav a:hover {
  background: var(--tag-bg);
  color: var(--accent);
  text-decoration: none;
}

.book-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #d06060;
  color: #fff;
  border-radius: 9px;
  font-size: 10px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  margin-left: 2px;
  vertical-align: middle;
  line-height: 1;
}

/* ══════════════════════════
   MAIN TWO-COLUMN LAYOUT
══════════════════════════ */
.book-content {
  max-width: 980px;
  margin: 18px auto 30px;
  padding: 0 14px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

/* ══════════════════════════
   LEFT PANEL (Main content)
══════════════════════════ */
.book-left {
  flex: 1;
  min-width: 0;
  background: var(--paper);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
  animation: panelFadeIn 0.3s ease;
}

/* ══════════════════════════
   RIGHT SIDEBAR
══════════════════════════ */
.book-sidebar {
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: panelFadeIn 0.3s ease 0.06s both;
}

/* ── Sidebar Card ── */
.sidebar-card {
  background: var(--paper);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
}

/* ── Author Info Card ── */
.author-card {
  padding: 18px 16px 14px;
}

.author-avatar-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.author-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--tag-bg);
  flex-shrink: 0;
}

.author-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}

.author-desc {
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.5;
}

/* ── Stats Row ── */
.author-stats {
  display: flex;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 10px 0;
  padding: 10px 0;
}

.stat-item {
  flex: 1;
  text-align: center;
}

.stat-num {
  display: block;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.stat-label {
  display: block;
  font-size: 11px;
  color: var(--text-soft);
  margin-top: 2px;
}

/* ── Sidebar Search ── */
.sidebar-search-wrap {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}

.sidebar-search {
  width: 100%;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: #fff;
  font-size: 13px;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.sidebar-search:focus { border-color: var(--accent); }

/* ── Sidebar Tags/Categories ── */
.sidebar-tags-wrap {
  padding: 10px 14px 14px;
}

.sidebar-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.sidebar-tag-link {
  display: inline-block;
  color: var(--text-mid);
  font-size: 12.5px;
  text-decoration: none;
  padding: 1px 0;
  margin-right: 8px;
  transition: color 0.15s;
}

.sidebar-tag-link:hover { color: var(--accent); text-decoration: none; }

/* ── Sidebar Section Title ── */
.sidebar-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-soft);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

/* ── Recent Comments Card ── */
.sidebar-comment-item {
  display: flex;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}

.sidebar-comment-item:last-child { border-bottom: none; }
.sidebar-comment-item:hover { background: var(--paper-alt); }

.comment-avatar {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--tag-bg);
  flex-shrink: 0;
}

.comment-body { flex: 1; min-width: 0; }

.comment-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 2px;
}

.comment-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.comment-time {
  font-size: 11px;
  color: var(--text-soft);
  white-space: nowrap;
}

.comment-device {
  font-size: 11px;
  color: var(--text-soft);
  margin-bottom: 3px;
}

.comment-text {
  font-size: 12.5px;
  color: var(--text-mid);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Sidebar User Info ── */
.sidebar-user-block {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-mid);
}

.sidebar-user-block b { color: var(--accent); font-weight: 700; }
.sidebar-user-block .coins { color: #b07830; font-weight: 600; }

/* ── Sidebar Quick Links ── */
.sidebar-links-wrap {
  padding: 10px 14px 14px;
}

.sidebar-links-list { display: flex; flex-direction: column; gap: 4px; }

.sidebar-links-list a {
  color: var(--text-mid);
  font-size: 13px;
  text-decoration: none;
  padding: 2px 0;
  transition: color 0.15s;
}

.sidebar-links-list a:hover { color: var(--accent); text-decoration: none; }

/* ══════════════════════════
   POST LIST (Left panel)
══════════════════════════ */

/* ── Section Title Bar ── */
.dreamy_title {
  background: var(--paper-alt);
  color: var(--text-mid);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.2px;
}

.dreamy_title a { color: var(--text-mid); text-decoration: none; }
.dreamy_title a:hover { color: var(--accent); }

/* ── Post Item in List ── */
.post-item {
  padding: 14px 16px;
  border-bottom: 1px dashed var(--border-dash);
  transition: background 0.12s;
}

.post-item:last-child { border-bottom: none; }
.post-item:hover { background: var(--paper-alt); }

/* ── Post with thumbnail ── */
.post-title-h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.4;
}

.post-title-h2 a { color: var(--text); text-decoration: none; }
.post-title-h2 a:hover { color: var(--link); text-decoration: none; }

/* ── Post author row ── */
.po-cmt {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}

.po-avt {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--tag-bg);
  flex-shrink: 0;
}

.po-hd { flex: 1; min-width: 0; }

.po-name {
  font-size: 12.5px;
  color: var(--text-mid);
  margin-bottom: 3px;
}

.po-name a { color: var(--text-mid); text-decoration: none; font-weight: 500; }
.po-name a:hover { color: var(--accent); }

.po-time {
  font-size: 11.5px;
  color: var(--text-soft);
  margin-left: 6px;
}

/* ── Post tags ── */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 4px;
}

.post-tag {
  display: inline-block;
  background: var(--tag-bg);
  color: var(--text-soft);
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 3px;
  text-decoration: none;
  transition: background 0.12s;
}

.post-tag:hover { background: var(--tag-hover); color: var(--text-mid); text-decoration: none; }

/* ── Post excerpt ── */
.post-excerpt {
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.65;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Post info bar ── */
.post-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: var(--text-soft);
  margin-top: 6px;
}

.post-info a { color: var(--link); font-size: 11.5px; text-decoration: none; }
.post-info a:hover { text-decoration: underline; }

.post-sep { margin: 0 4px; color: var(--border); }

.post-meta-right { display: flex; gap: 3px; align-items: center; }

/* ── Slider / Featured post ── */
.post-item-featured {
  padding: 14px 16px;
  border-bottom: 1px dashed var(--border-dash);
  display: flex;
  gap: 12px;
  transition: background 0.12s;
}

.post-item-featured:hover { background: var(--paper-alt); }

.post-thumb {
  width: 110px;
  height: 75px;
  border-radius: 5px;
  object-fit: cover;
  background: var(--tag-bg);
  flex-shrink: 0;
}

.post-feat-body { flex: 1; min-width: 0; }

.post-feat-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.4;
  text-decoration: none;
  display: block;
}

.post-feat-title:hover { color: var(--link); text-decoration: none; }

/* ── Dreamy foot ── */
.dreamy_foot {
  background: var(--paper-alt);
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  text-align: center;
  font-size: 12px;
  color: var(--text-soft);
}

.dreamy_foot a { color: var(--link); text-decoration: none; }
.dreamy_foot a:hover { color: var(--accent); }

/* ══════════════════════════
   LEGACY COMPATIBILITY
   (keep old class names working)
══════════════════════════ */

/* Old dreamy_body inside book-left */
.dreamy_body { background: transparent; border: none; }

/* Old dreamy_box */
.dreamy_box { padding: 5px 12px; }

/* Old dreamy_list */
.dreamy_list {
  background: var(--paper);
  border-bottom: 1px dashed var(--border-dash);
  padding: 8px 14px;
  transition: background 0.12s;
}
.dreamy_list:hover { background: var(--paper-alt); }

/* Old menu tables */
table { border-collapse: collapse; width: 100%; }

tr.menu {
  background: var(--paper-alt);
  border-bottom: 1px solid var(--border);
}

tr.menu1 {
  background: var(--paper-alt);
  border-bottom: 1px solid var(--border);
}

tr.menu td, tr.menu1 td {
  text-align: center;
  padding: 7px 6px;
  border-right: 1px solid var(--border);
}

tr.menu td:last-child, tr.menu1 td:last-child { border-right: none; }

tr.menu td a, tr.menu td,
tr.menu1 td a, tr.menu1 td {
  color: var(--text-mid) !important;
  text-decoration: none;
  font-size: 13px;
  font-weight: 400;
  background: transparent;
  transition: color 0.15s;
  border: none;
}

tr.menu td a:hover, tr.menu1 td a:hover {
  color: var(--accent) !important;
  text-decoration: none;
}

td#selected { background: rgba(100,160,100,0.12); }

/* ── Links ── */
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--accent); text-decoration: underline; }

/* ── HR ── */
hr { border: none; border-top: 1px dashed var(--border-dash); margin: 6px 0; }

/* ── Images ── */
img { max-width: 100%; height: auto; }

/* ── Code ── */
code {
  font-family: 'Courier New', monospace;
  font-size: 11.5px;
  background: var(--tag-bg);
  padding: 1px 5px;
  border-radius: 3px;
  color: #7a4a1a;
}

/* ── Form elements ── */
textarea,
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
select {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 13px;
  transition: border-color 0.2s;
}

textarea { width: 99%; resize: vertical; }

textarea:focus, input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}

/* ── Buttons ── */
button, input[type="submit"] {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 16px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.18s, transform 0.1s;
}

button:hover, input[type="submit"]:hover {
  background: #7a5c28;
  transform: translateY(-1px);
}

/* ── Utility colors ── */
.green { color: #4a7a4a; }
.grey  { color: var(--text-soft); }
.red   { color: #8a3a3a; }

/* ── Quote ── */
.quote {
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 6px 10px;
  margin: 5px 0;
  font-style: italic;
  font-size: 12.5px;
  background: #faf5ec;
  color: var(--text-mid);
}

.quote .user {
  border-bottom: 1px solid var(--border);
  font-style: normal;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 3px;
  padding-bottom: 2px;
}

/* ── Pagination ── */
.currentpage {
  display: inline-block;
  font-size: 11.5px;
  color: #fff;
  background: var(--accent);
  border-radius: 4px;
  padding: 2px 8px;
  margin: 1px;
  font-weight: bold;
}

a.pagenav {
  display: inline-block;
  font-size: 11.5px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  margin: 1px;
  font-weight: 500;
  color: var(--link);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

a.pagenav:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── Box utility ── */
.box {
  background: var(--paper);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  max-width: 600px;
}

/* ── Forum/Post styles ── */
td.current-post, td.current-top {
  border: 1px solid var(--border);
  padding: 5px 8px;
  position: relative;
  background: var(--paper);
  border-radius: 5px;
}

td.current-top { background: #fff8f0; }

.post_nick, .post_nick_top {
  padding: 2px 0;
  color: var(--text-soft);
  border-bottom: 1px solid var(--border);
}

.post_nick_top { background: #fff8f0; }

.post_time, .post_timex, .post_mota {
  font-size: 11.5px;
  color: var(--text-soft);
  padding: 2px 6px;
}

.post_timex, .post_mota { text-align: center; }

.post_menu {
  background: var(--paper-alt);
  padding: 3px 8px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
}

.post_menu_comment {
  background: #ede9de;
  border-top: 1px dashed var(--border);
  font-size: 11.5px;
  padding: 3px 8px;
  margin: 4px 6px 6px;
}

.post_menu_comment a { color: var(--link); }

.post_table { table-layout: fixed; word-wrap: break-word; width: 100%; }
.post_table_td { vertical-align: top; width: 48px; }
.post_text { color: var(--text); overflow: hidden; background: var(--paper); border-bottom: 1px solid var(--border); }
.post_baiviet { color: var(--text); padding: 3px 8px; }
.post_list { vertical-align: top; }
.list_post { vertical-align: top; }
.baigui { font-size: 11px; text-align: center; color: var(--text-soft); padding-top: 2px; }
.text { border-top: 1px solid var(--border); padding-top: 3px; width: 100%; }

.info { border: 1px solid var(--border); border-bottom: none; }
td.left { vertical-align: bottom; padding: 3px 7px 3px 4px; width: 70px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
td.right { border-width: 0 0 1px 0; padding: 3px 0 3px 4px; border-style: solid; border-color: var(--border); }

img.avatar-post { background: #fff; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-right: 6px; width: 45px; float: left; border-radius: 50%; }

#images, #images_post { padding: 2px; border: 1px solid var(--border); border-radius: 4px; }
#images { width: 50px; }
#images_post { width: 100px; }
#images_post_full { padding: 2px; border: 1px solid var(--border); text-align: center; }

/* ── homeforum / gmenu ── */
.homeforum {
  padding: 6px 12px;
  font-weight: 600;
  color: var(--accent);
  font-size: 13.5px;
  border-bottom: 1px solid var(--border);
}
.homeforum a { color: var(--accent); text-decoration: none; }
.homeforum a:hover { text-decoration: underline; }

.gmenu {
  color: var(--accent);
  background: var(--tag-bg);
  padding: 4px;
  border: 1px solid var(--border);
  margin: 1px 0;
}

/* ── Dreamy_head hidden (replaced by book-header) ── */
.dreamy_head { display: none; }
.dreamy_box-shadow { /* legacy wrapper, do nothing */ }

/* ── Announcement bar ── */
.shunjian {
  background: #faf5ec;
  border-bottom: 1px solid var(--border);
  padding: 8px 14px;
  font-size: 12.5px;
  color: var(--text-mid);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

/* ══════════════════════════
   ANIMATIONS
══════════════════════════ */
@keyframes panelFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════
   SCROLLBAR
══════════════════════════ */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c8c0b0; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ══════════════════════════
   RESPONSIVE
══════════════════════════ */
@media (max-width: 720px) {
  .book-content { flex-direction: column; padding: 0 8px 16px; }
  .book-sidebar { width: 100%; }
  .book-header-inner { padding: 0 12px; }
  .book-nav a { padding: 4px 6px; font-size: 12px; }
}

/* ── Topic View ── */
.nb-topic-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--ink);
  line-height: 1.4;
  letter-spacing: 0.5px;
}
.nb-topic-main {
  padding-bottom: 24px;
  border-bottom: 1px dashed var(--paper-line);
  margin-bottom: 24px;
}
.nb-post-content {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--ink-mid);
  text-align: justify;
  letter-spacing: 0.3px;
}
.nb-post-content h2, .nb-post-content h3 {
  color: #ff708a;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  margin-bottom: 12px;
  font-size: 1.1rem;
}
.nb-post-content h2::before, .nb-post-content h3::before {
  content: "🌸";
  font-size: 0.8em;
}
.nb-post-quote {
  position: relative;
  border: 2px solid #ff708a;
  background: rgba(255, 112, 138, 0.05);
  border-radius: 6px;
  padding: 24px 20px 20px 20px;
  margin: 32px 0 24px 0;
  color: var(--ink-mid);
  font-size: 0.95rem;
}
.nb-post-quote::before {
  content: "引";
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  background: #ff708a;
  color: white;
  font-size: 0.85rem;
  font-weight: bold;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(255,112,138,0.3);
}
.nb-post-img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 12px 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.nb-post-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.nb-post-link:hover { text-decoration: underline; }
.nb-post-pre {
  background: rgba(255, 255, 255, 0.4);
  color: var(--ink);
  padding: 16px;
  border-radius: 6px;
  border: 1px dashed var(--paper-line);
  overflow-x: auto;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.85rem;
  margin: 16px 0;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.02);
}
.nb-post-hr {
  border: none;
  border-top: 1px dashed var(--paper-line);
  margin: 24px 0;
}
.nb-post-ul, .nb-post-ol {
  margin: 12px 0 12px 24px;
}
.nb-post-ul { list-style-type: disc; }
.nb-post-ol { list-style-type: decimal; }
.nb-post-ul li, .nb-post-ol li { margin-bottom: 6px; }

/* ── Alert / Warning Box ── */
.nb-alert {
  border: 1px solid #d1d5db;
  background: rgba(255,255,255,0.4);
  border-radius: 6px;
  padding: 16px 20px;
  margin: 24px 0;
}
.nb-alert-title {
  color: #e74c3c;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nb-alert-title::before {
  content: "🔔";
}
