:root {
  /* Amamitsuki (天三月) High-Key Optical Artbook Palette */
  --bg: #FFFFFF;
  --bg-elevated: #FFFFFF;
  --plate: #F7F7FB;
  --surface: #F5F6FA;
  --surface-hover: #ECEEF6;
  --border: rgba(20, 19, 23, 0.075);
  --border-strong: rgba(20, 19, 23, 0.145);

  --ink: #141317;
  --ink-2: #3A3842;
  --muted: #767480;
  --subtle: #A2A0AC;

  /* Smoky Burgundy-Rose Iris & Subsurface Blush Accent */
  --accent: #A6656C;
  --accent-hover: #8D4F56;
  --accent-soft: rgba(166, 101, 108, 0.10);
  --lavender-mist: rgba(216, 221, 242, 0.34);
  --blush-mist: rgba(244, 194, 188, 0.18);

  --shadow-sm: 0 2px 10px rgba(120, 124, 152, 0.06);
  --shadow-md: 0 14px 36px rgba(120, 124, 152, 0.12);
  --shadow-lg: 0 24px 60px rgba(20, 19, 23, 0.12);

  --radius-sm: 2px;
  --radius-md: 3px;
  --radius-lg: 4px;

  --font-serif: 'Newsreader', 'Noto Serif SC', 'Songti SC', 'STSong', Georgia, serif;
  --font-sans: 'Inter', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --reader-size: 18px;
}

html[data-theme="dark"] {
  /* Velvety Matte Ink-Black Hair & Soft Rose Glow */
  --bg: #121116;
  --bg-elevated: #18171E;
  --plate: #1E1D25;
  --surface: #1D1C24;
  --surface-hover: #262530;
  --border: rgba(238, 236, 242, 0.085);
  --border-strong: rgba(238, 236, 242, 0.17);

  --ink: #EEECF2;
  --ink-2: #CECCD6;
  --muted: #9390A0;
  --subtle: #6A6778;

  --accent: #D6929A;
  --accent-hover: #E5AAB1;
  --accent-soft: rgba(214, 146, 154, 0.14);
  --lavender-mist: rgba(126, 134, 178, 0.10);
  --blush-mist: rgba(214, 146, 154, 0.07);

  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 14px 36px rgba(0, 0, 0, 0.42);
  --shadow-lg: 0 26px 64px rgba(0, 0, 0, 0.62);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 68% 36% at 18% -6%, var(--lavender-mist), transparent 68%),
    radial-gradient(ellipse 56% 32% at 84% -8%, var(--blush-mist), transparent 66%);
  background-repeat: no-repeat;
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: clip;
  transition: background-color 280ms var(--ease), color 280ms var(--ease);
}

body.modal-open {
  overflow: hidden;
}

button, input {
  font-family: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

button:active:not(:disabled) {
  transform: scale(0.98);
}

button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 1.5px solid var(--accent);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

/* ── Top Navigation Bar: Optical Glass Hairline ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(20px) saturate(125%);
  -webkit-backdrop-filter: blur(20px) saturate(125%);
  border-bottom: 1px solid var(--border);
  transition: background-color 260ms var(--ease), border-color 260ms var(--ease);
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 36px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity 180ms var(--ease);
}

.brand-icon {
  width: 34px;
  height: 34px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.brand:hover {
  opacity: 0.72;
}

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

/* Primary Tabs: 小说 · 漫画 */
.nav-primary {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 100%;
}

.nav-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 100%;
  padding: 0 18px;
  font-size: 0.88rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--muted);
  transition: color 200ms var(--ease);
  white-space: nowrap;
}

.nav-tab:hover {
  color: var(--ink);
}

.nav-tab.active {
  color: var(--ink);
  font-weight: 500;
}

.nav-indicator {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--accent);
  transition:
    transform 300ms var(--ease),
    width 300ms var(--ease),
    opacity 200ms var(--ease);
  pointer-events: none;
}

.nav-utilities {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.nav-sep {
  width: 1px;
  height: 13px;
  background: var(--border-strong);
}

.icon-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 4px;
  border-radius: 0;
  font-size: 0.78rem;
  color: var(--muted);
  border: none;
  transition: color 180ms var(--ease);
}

.icon-pill:hover {
  background: transparent;
  color: var(--ink);
}

.theme-icon svg {
  width: 13px;
  height: 13px;
  display: block;
  transition: transform 360ms var(--ease-spring);
}

.icon-pill:hover .theme-icon svg {
  transform: rotate(-16deg);
}

.theme-link {
  font-size: 0.8rem;
  color: var(--muted);
  transition: color 180ms var(--ease);
}

.theme-link:hover {
  color: var(--ink);
}

/* Account Entry (Click goes straight to /user/<username>) */
.auth-dock {
  display: inline-flex;
  align-items: center;
}

.auth-trigger {
  height: 30px;
  padding: 0 6px;
  border-radius: 0;
  font-size: 0.8rem;
  color: var(--muted);
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  transition: border-color 180ms var(--ease), color 180ms var(--ease);
}

.auth-trigger:hover {
  background: transparent;
  border-bottom-color: var(--accent);
  color: var(--ink);
}

.account-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 4px;
  border-radius: 0;
  background: transparent;
  border: none;
  border-bottom: 1.5px solid transparent;
  font-size: 0.8rem;
  color: var(--ink-2);
  transition: border-color 180ms var(--ease), color 180ms var(--ease);
}

.account-pill:hover {
  background: transparent;
  color: var(--ink);
  border-bottom-color: var(--border-strong);
}

.account-pill.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
  background: transparent;
}

.account-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 0.84rem;
  font-weight: 500;
}

.account-name {
  max-width: 96px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Auth Modal */
.auth-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 130;
  background: rgba(20, 19, 23, 0.36);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms var(--ease);
}

.auth-modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.auth-card {
  width: 100%;
  max-width: 368px;
  padding: 26px 26px 28px;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  transform: translateY(10px) scale(0.97);
  transition: transform 260ms var(--ease);
}

.auth-modal-backdrop.open .auth-card {
  transform: translateY(0) scale(1);
}

.auth-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.auth-mode-tabs {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
}

.auth-mode-tab {
  position: relative;
  padding: 6px 2px;
  border-radius: 0;
  font-size: 0.82rem;
  color: var(--muted);
  transition: color 180ms var(--ease);
}

.auth-mode-tab.active {
  background: transparent;
  color: var(--ink);
  font-weight: 500;
  box-shadow: none;
}

.auth-mode-tab.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1.5px;
  background: var(--accent);
}

.auth-close-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: background-color 160ms var(--ease), color 160ms var(--ease);
}

.auth-close-btn:hover {
  background: var(--surface);
  color: var(--ink);
}

.auth-close-btn svg {
  width: 15px;
  height: 15px;
}

.auth-title {
  font-family: var(--font-serif);
  font-size: 1.38rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.76rem;
  color: var(--muted);
}

.auth-field input {
  height: 38px;
  padding: 0 13px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.86rem;
  color: var(--ink);
  outline: none;
  transition: border-color 180ms var(--ease), background-color 180ms var(--ease), box-shadow 180ms var(--ease);
}

.auth-field input:focus {
  background: var(--bg-elevated);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.auth-error {
  font-size: 0.78rem;
  color: var(--accent);
  line-height: 1.4;
}

.auth-submit-btn {
  margin-top: 4px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--bg);
  font-size: 0.84rem;
  font-weight: 500;
  transition: opacity 180ms var(--ease);
}

.auth-submit-btn:hover {
  opacity: 0.86;
}

/* ── Main Container ── */
.page-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 36px 96px;
}

/* ── User / Creator Profile View (/user/xxx) ── */
.author-profile-view {
  margin-bottom: 40px;
  animation: viewFadeUp 360ms var(--ease) both;
}

.author-hero {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.author-banner {
  position: relative;
  height: 152px;
  overflow: hidden;
  background: linear-gradient(120deg, var(--surface) 0%, color-mix(in srgb, var(--accent-soft) 55%, var(--bg)) 100%);
}

.author-banner > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(4px) saturate(0.85) brightness(1.08);
  transform: scale(1.08);
  opacity: 0.58;
}

.author-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--bg) 14%, transparent) 0%,
    var(--bg) 100%
  );
}

.author-top-actions {
  position: absolute;
  top: 16px;
  left: 20px;
  right: 20px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.author-top-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.author-back-btn,
.author-logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 2px;
  border-radius: 0;
  background: transparent;
  border: none;
  font-size: 0.82rem;
  color: var(--muted);
  transition: color 180ms var(--ease), transform 180ms var(--ease);
}

.author-back-btn:hover {
  background: transparent;
  color: var(--ink);
  transform: translateX(-2px);
}

.author-logout-btn:hover {
  background: transparent;
  color: var(--accent);
}

.author-joined {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  padding: 2px 0;
  border-radius: 0;
  background: transparent;
  border: none;
}

.author-body {
  position: relative;
  padding: 0 32px 26px;
  margin-top: -50px;
  z-index: 2;
}

.author-identity-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.author-main-id {
  display: flex;
  align-items: flex-end;
  gap: 20px;
}

.author-avatar-ring {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  padding: 3px;
  background: var(--bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.author-avatar-ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.avatar-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--accent);
  font-family: var(--font-serif);
  font-weight: 500;
}

.author-avatar-ring .avatar-fallback {
  font-size: 1.65rem;
}

.author-chip .avatar-fallback {
  width: 24px;
  height: 24px;
  font-size: 0.74rem;
  flex-shrink: 0;
}

.author-name-wrap {
  padding-bottom: 4px;
}

.author-display-name {
  font-family: var(--font-serif);
  font-size: 1.68rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.author-signature {
  margin-top: 6px;
  font-family: var(--font-serif);
  font-size: 0.86rem;
  color: var(--muted);
}

.author-stats {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
}

.author-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 44px;
}

.author-stat-num {
  font-family: var(--font-serif);
  font-size: 1.18rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  line-height: 1.2;
}

.author-stat-label {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 2px;
}

/* ── Catalog Header: Title + Standalone Search ── */
.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 20px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.toolbar-title-group {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.section-heading {
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 2.8vw, 2.2rem);
  font-weight: 300;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--ink);
}

.section-count {
  font-size: 0.78rem;
  color: var(--subtle);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 244px;
  height: 34px;
  padding: 0 4px;
  border-radius: 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-strong);
  transition:
    width 260ms var(--ease),
    border-color 200ms var(--ease);
}

.search-box:focus-within {
  width: 288px;
  background: transparent;
  border-bottom-color: var(--accent);
  box-shadow: none;
}

.search-icon {
  width: 13px;
  height: 13px;
  color: var(--subtle);
  flex-shrink: 0;
  margin-right: 8px;
  transition: color 180ms var(--ease);
}

.search-box:focus-within .search-icon {
  color: var(--accent);
}

.search-box input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  font-size: 0.8rem;
  color: var(--ink);
}

.search-box input::placeholder {
  color: var(--subtle);
}

.search-box input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.search-clear {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: background-color 160ms var(--ease), color 160ms var(--ease);
}

.search-clear:hover {
  background: var(--surface-hover);
  color: var(--ink);
}

.search-clear svg {
  width: 11px;
  height: 11px;
}

.search-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 15px;
  margin-bottom: 24px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--ink-2);
  animation: viewFadeUp 220ms var(--ease) both;
}

.search-banner mark,
.work-title mark,
.lead-title mark {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0 3px;
  border-radius: 3px;
}

.search-reset-link {
  font-size: 0.78rem;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Lead Feature Spread (Artbook Borderless Feature) ── */
.lead-section {
  margin-bottom: 52px;
  padding-bottom: 44px;
  border-bottom: 1px solid var(--border);
  animation: viewFadeUp 400ms var(--ease) both;
}

.daily-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.daily-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.76rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.daily-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.daily-date {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--subtle);
}

.daily-shuffle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 2px;
  border-radius: 0;
  border: none;
  background: transparent;
  font-size: 0.76rem;
  color: var(--muted);
  transition: color 180ms var(--ease);
}

.daily-shuffle:hover {
  color: var(--ink);
}

.daily-shuffle svg {
  width: 11px;
  height: 11px;
  transition: transform 360ms var(--ease);
}

.daily-shuffle:hover svg {
  transform: rotate(150deg);
}

.lead-spread {
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(0, 0.94fr);
  gap: 44px;
  align-items: center;
  cursor: pointer;
  transition: opacity 220ms var(--ease), transform 260ms var(--ease);
}

.lead-spread.swapping {
  opacity: 0;
  transform: translateY(5px);
}

.lead-plate {
  aspect-ratio: 4 / 3;
  background: var(--plate);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: box-shadow 320ms var(--ease), border-color 260ms var(--ease);
}

.lead-spread:hover .lead-plate {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.lead-plate img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 640ms var(--ease);
}

.lead-spread:hover .lead-plate img {
  transform: scale(1.028);
}

.lead-text {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lead-title {
  font-family: var(--font-serif);
  font-size: clamp(1.55rem, 2.5vw, 2.05rem);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--ink);
  transition: color 200ms var(--ease);
}

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

.lead-excerpt {
  font-family: var(--font-serif);
  font-size: 0.96rem;
  line-height: 1.85;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lead-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  gap: 16px;
}

.read-cue {
  font-size: 0.82rem;
  color: var(--ink-2);
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 2px;
  transition: color 180ms var(--ease), border-color 180ms var(--ease);
}

.lead-spread:hover .read-cue {
  color: var(--accent);
  border-color: var(--accent);
}

/* ── List Control Bar (Only 最新 / 最热) ── */
.list-control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}

.list-control-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.grid-label {
  font-size: 0.78rem;
  color: var(--subtle);
  letter-spacing: 0.08em;
}

.subfilter-bar {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.subfilter-chip {
  position: relative;
  padding: 4px 2px;
  border-radius: 0;
  font-size: 0.8rem;
  color: var(--subtle);
  background: transparent;
  border: none;
  transition: color 180ms var(--ease);
}

.subfilter-chip:hover {
  color: var(--ink);
}

.subfilter-chip.active {
  background: transparent;
  color: var(--ink);
  font-weight: 500;
}

.subfilter-chip.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1.5px;
  background: var(--accent);
}

.sort-tabs {
  display: inline-flex;
  align-items: center;
  gap: 20px;
}

.sort-tab {
  position: relative;
  font-size: 0.8rem;
  color: var(--subtle);
  padding: 4px 2px;
  transition: color 180ms var(--ease);
}

.sort-tab:hover {
  color: var(--ink);
}

.sort-tab.active {
  color: var(--ink);
  font-weight: 500;
}

.sort-tab.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1.5px;
  background: var(--accent);
}

/* ── Artbook Open Gallery Grid (No heavy card boxes) ── */
.work-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 44px 30px;
}

.work-card {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  animation: cardReveal 380ms var(--ease) both;
  animation-delay: calc(min(var(--i, 0), 9) * 28ms);
}

.work-cover {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--plate);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 300ms var(--ease), box-shadow 320ms var(--ease), border-color 240ms var(--ease);
}

.work-card.is-comic .work-cover {
  aspect-ratio: 3 / 4;
}

.work-card.is-comic .work-cover img {
  object-position: top center;
}

.work-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 580ms var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .work-card:hover .work-cover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
  }
  .work-card:hover .work-cover img {
    transform: scale(1.032);
  }
}

.work-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: rgba(20, 19, 23, 0.72);
  backdrop-filter: blur(8px);
  color: #FFFFFF;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

.work-badge.progress {
  background: color-mix(in srgb, var(--accent) 92%, #141317);
}

.work-body {
  padding: 14px 2px 0;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.work-title {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 400;
  line-height: 1.44;
  color: var(--ink);
  margin-bottom: 9px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 180ms var(--ease);
}

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

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.card-tag-btn {
  padding: 0;
  border-radius: 0;
  font-size: 0.72rem;
  color: var(--muted);
  background: transparent;
  border: none;
  transition: color 160ms var(--ease);
}

.card-tag-btn:hover {
  color: var(--accent);
  background: transparent;
}

.work-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 0.74rem;
  color: var(--muted);
}

.author-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
  border-radius: 0;
  font-size: 0.78rem;
  color: var(--ink-2);
  transition: color 160ms var(--ease), opacity 160ms var(--ease);
}

.author-chip:hover {
  background: transparent;
  color: var(--accent);
}

.author-chip img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.work-meta-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.work-duration {
  color: var(--subtle);
  font-size: 0.72rem;
}

.quiet-actions {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.quiet-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  color: var(--subtle);
  padding: 2px 3px;
  border-radius: 4px;
  transition: color 160ms var(--ease);
}

.quiet-btn:hover {
  color: var(--ink);
}

.quiet-btn.active {
  color: var(--accent);
}

.quiet-btn.pop svg {
  animation: popBounce 340ms var(--ease-spring);
}

.quiet-btn svg {
  width: 13px;
  height: 13px;
}

/* Empty State */
.empty-state {
  grid-column: 1 / -1;
  padding: 76px 24px;
  text-align: center;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-strong);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  animation: viewFadeUp 280ms var(--ease) both;
}

.empty-state-title {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 8px;
}

.empty-state-desc {
  font-size: 0.83rem;
  color: var(--muted);
  margin-bottom: 18px;
}

.empty-action-btn {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--bg);
  font-size: 0.78rem;
  transition: opacity 180ms var(--ease);
}

.empty-action-btn:hover {
  opacity: 0.86;
}

/* ── Minimal Colophon Footer with Watermark ── */
.colophon {
  margin-top: 92px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.colophon-mark {
  font-family: var(--font-serif);
  font-size: 0.8rem;
  color: var(--muted);
}

.colophon-watermark {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--subtle);
  opacity: 0.72;
  user-select: none;
}

/* ── Community Tagging Panel (Threshold-Gated) ── */
.work-tags-panel {
  margin-bottom: 28px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
}

.tags-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.tags-panel-title {
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.tags-threshold-note {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--subtle);
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 9px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--ink-2);
  transition: border-color 160ms var(--ease), color 160ms var(--ease), background-color 160ms var(--ease);
}

.tag-pill:hover {
  border-color: var(--border-strong);
  color: var(--ink);
}

.tag-pill.voted {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--accent-soft);
  color: var(--accent);
}

.tag-pill.pending {
  border-style: dashed;
  color: var(--muted);
  background: transparent;
}

.tag-pill-count {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  opacity: 0.78;
}

.tag-pending-group {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.tag-pending-label {
  font-size: 0.7rem;
  color: var(--subtle);
  margin-bottom: 8px;
}

.tag-add-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.tag-add-input {
  height: 29px;
  width: 152px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 0.76rem;
  color: var(--ink);
  outline: none;
  transition: border-color 180ms var(--ease), width 220ms var(--ease);
}

.tag-add-input:focus {
  width: 184px;
  border-color: var(--accent);
}

.tag-add-input::placeholder {
  color: var(--subtle);
}

.tag-add-submit {
  height: 29px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--bg);
  font-size: 0.74rem;
  transition: opacity 160ms var(--ease);
}

.tag-add-submit:hover {
  opacity: 0.84;
}

/* ── Novel Immersive Reader (High-Key Editorial Paper) ── */
.reader-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: var(--bg);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 260ms var(--ease), transform 300ms var(--ease);
  display: flex;
  flex-direction: column;
}

.reader-overlay.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.progress-line {
  height: 1.5px;
  width: 0%;
  background: var(--accent);
  transition: width 80ms linear;
  flex-shrink: 0;
}

.reader-bar {
  height: 56px;
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(16px);
}

.reader-bar-inner {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.reader-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--muted);
  transition: color 160ms var(--ease), transform 180ms var(--ease);
}

.reader-back:hover {
  color: var(--ink);
  transform: translateX(-2px);
}

.reader-bar-center {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-width: 0;
}

.reader-running-title {
  font-family: var(--font-serif);
  font-size: 0.88rem;
  color: var(--muted);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 200ms var(--ease), transform 200ms var(--ease);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

.reader-running-title.visible {
  opacity: 1;
  transform: translateY(0);
}

.novel-toc-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.novel-toc-trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 4px;
  font-size: 0.8rem;
  color: var(--ink-2);
  border-bottom: 1px solid transparent;
  transition: color 160ms var(--ease), border-color 160ms var(--ease);
  white-space: nowrap;
}

.novel-toc-trigger:hover,
.novel-toc-trigger[aria-expanded="true"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.novel-toc-trigger[aria-expanded="true"] .comic-chevron {
  transform: rotate(180deg);
}

.novel-toc-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  left: auto;
  transform: none;
  width: 310px;
  max-width: calc(100vw - 32px);
  max-height: 60vh;
  overflow-y: auto;
  padding: 8px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 45;
  animation: viewFadeUp 160ms var(--ease) both;
}

.novel-toc-item {
  width: 100%;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  text-align: left;
  font-size: 0.82rem;
  color: var(--ink-2);
  transition: background-color 140ms var(--ease), color 140ms var(--ease);
}

.novel-toc-item:hover {
  background: var(--surface);
  color: var(--ink);
}

.novel-toc-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
}

.novel-toc-item-title {
  flex: 1;
  min-width: 0;
  font-family: var(--font-serif);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.novel-toc-item-meta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--subtle);
  flex-shrink: 0;
}

.article-chapter-sub {
  margin-top: 10px;
  font-family: var(--font-serif);
  font-size: 1.04rem;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.novel-inline-toc {
  margin: -8px 0 36px;
  padding: 16px 0 14px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.novel-inline-toc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.74rem;
  color: var(--subtle);
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.novel-inline-toc-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.novel-inline-toc-btn {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 7px 6px;
  text-align: left;
  font-size: 0.86rem;
  color: var(--ink-2);
  border-bottom: 1px dashed transparent;
  transition: color 160ms var(--ease), background-color 160ms var(--ease);
}

.novel-inline-toc-btn:hover {
  color: var(--ink);
  background: var(--surface);
}

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

.novel-inline-toc-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--subtle);
  width: 24px;
  flex-shrink: 0;
}

.novel-inline-toc-title {
  flex: 1;
  font-family: var(--font-serif);
}

.novel-inline-toc-time {
  font-size: 0.72rem;
  color: var(--subtle);
  flex-shrink: 0;
}

.reader-tools {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  font-size: 0.78rem;
  color: var(--muted);
}

.size-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.size-btn {
  font-size: 0.78rem;
  color: var(--subtle);
  padding: 2px 4px;
  transition: color 160ms var(--ease);
}

.size-btn:hover {
  color: var(--ink);
}

.size-btn.active {
  color: var(--ink);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--accent);
}

.reader-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 46px 28px 96px;
}

.article-shell {
  max-width: 640px;
  margin: 0 auto;
}

.article-plate {
  aspect-ratio: 4 / 3;
  background: var(--plate);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 36px;
  cursor: zoom-in;
}

.article-plate img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 480ms var(--ease);
}

.article-plate:hover img {
  transform: scale(1.015);
}

.article-header {
  margin-bottom: 36px;
}

.article-kicker {
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.article-title {
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 3.2vw, 2.15rem);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.article-rule {
  width: 32px;
  height: 1.5px;
  background: var(--accent);
  margin-top: 22px;
}

.article-body {
  font-family: var(--font-serif);
  font-size: var(--reader-size);
  line-height: 2.02;
  color: var(--ink);
  letter-spacing: 0.015em;
}

.article-body p {
  margin-bottom: 1.34em;
  text-align: justify;
}

.article-body p.dlg-line {
  margin-top: 1.42em;
  margin-bottom: 1.42em;
}

/* Inline Illustrations — Supports both Landscape (legacy) and Portrait (new Amamitsuki artbook plates) */
.story-figure {
  margin: 38px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.story-figure-plate {
  width: 100%;
  background: var(--plate);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: zoom-in;
  transition: box-shadow 260ms var(--ease);
}

.story-figure-plate:hover {
  box-shadow: var(--shadow-md);
}

.story-figure-plate.is-landscape {
  aspect-ratio: 4 / 3;
}

.story-figure-plate.is-portrait {
  max-width: 580px;
  aspect-ratio: 3 / 4;
  background: #FFFFFF;
}

.story-figure-plate img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 520ms var(--ease);
}

.story-figure-plate:hover img {
  transform: scale(1.018);
}

.story-figure figcaption {
  margin-top: 11px;
  text-align: center;
  font-family: var(--font-serif);
  font-size: 0.8rem;
  color: var(--subtle);
  letter-spacing: 0.03em;
}

.article-end-mark {
  text-align: center;
  font-family: var(--font-serif);
  font-size: 0.84rem;
  color: var(--subtle);
  letter-spacing: 0.28em;
  margin: 48px 0 30px;
}

.article-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding-bottom: 28px;
}

.text-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.84rem;
  color: var(--muted);
  padding: 6px 4px;
  border-radius: 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  transition: color 180ms var(--ease), border-color 180ms var(--ease);
}

.text-action:hover {
  color: var(--ink);
  border-bottom-color: var(--border-strong);
}

.text-action.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: transparent;
}

.text-action svg {
  width: 14px;
  height: 14px;
}

.article-author-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  margin-bottom: 28px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 200ms var(--ease);
}

.article-author-card:hover {
  border-color: var(--border-strong);
}

.article-author-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.article-author-left img,
.article-author-left .avatar-fallback {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.article-author-name {
  font-family: var(--font-serif);
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--ink);
}

.article-author-sub {
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 2px;
}

.article-author-cta {
  font-size: 0.76rem;
  color: var(--accent);
  white-space: nowrap;
}

.story-pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
}

.pager-btn {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: opacity 160ms var(--ease);
}

.pager-btn.next {
  text-align: right;
}

.pager-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.pager-dir {
  font-size: 0.72rem;
  color: var(--subtle);
}

.pager-title {
  font-family: var(--font-serif);
  font-size: 0.98rem;
  color: var(--ink);
  transition: color 160ms var(--ease);
}

.pager-btn:hover:not(:disabled) .pager-title {
  color: var(--accent);
}

/* ── Unified High-Key Minimalist Comic Reader ── */
.comic-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: var(--bg);
  color: var(--ink);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 240ms var(--ease), transform 280ms var(--ease), background-color 260ms var(--ease);
  display: flex;
  flex-direction: column;
  user-select: none;
}

.comic-overlay.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.comic-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 25;
  height: 54px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  transition: transform 240ms var(--ease), opacity 200ms var(--ease);
}

.comic-overlay.ui-hidden .comic-topbar {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

.comic-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.comic-bar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.comic-reader-title {
  font-family: var(--font-serif);
  font-size: 0.94rem;
  font-weight: 400;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.comic-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 30px;
  padding: 0 4px;
  border-radius: 0;
  font-size: 0.82rem;
  line-height: 1;
  color: var(--muted);
  background: transparent;
  border: none;
  transition: color 160ms var(--ease), transform 180ms var(--ease);
  white-space: nowrap;
  flex-shrink: 0;
}

.comic-btn:hover {
  background: transparent;
  color: var(--ink);
  transform: translateX(-2px);
}

.comic-btn.subtle {
  color: var(--muted);
  font-size: 0.78rem;
}

.comic-btn.subtle:hover {
  color: var(--ink);
  transform: none;
}

.comic-icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--muted);
  flex-shrink: 0;
  transition: color 160ms var(--ease);
}

.comic-icon-btn:hover {
  color: var(--ink);
  background: transparent;
}

.comic-icon-btn.active {
  color: var(--accent);
  background: transparent;
}

.comic-icon-btn svg {
  width: 14px;
  height: 14px;
}

.comic-chapter-picker {
  position: relative;
  display: inline-flex;
  justify-content: center;
}

.comic-chapter-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 30px;
  padding: 0 6px;
  border-radius: 0;
  background: transparent;
  border: none;
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1;
  max-width: 250px;
  transition: color 160ms var(--ease);
}

.comic-chapter-trigger:hover:not(:disabled) {
  background: transparent;
  color: var(--accent);
}

.comic-chapter-trigger:disabled {
  cursor: default;
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.comic-chapter-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.comic-chevron {
  width: 13px;
  height: 13px;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform 180ms var(--ease);
}

.comic-chapter-trigger[aria-expanded="true"] .comic-chevron {
  transform: rotate(180deg);
}

.comic-chapter-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 220px;
  max-width: 290px;
  padding: 6px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 40;
  animation: viewFadeUp 160ms var(--ease) both;
}

.comic-chapter-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 11px;
  border-radius: 6px;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: left;
  transition: background-color 140ms var(--ease), color 140ms var(--ease);
}

.comic-chapter-option:hover {
  background: var(--surface);
  color: var(--ink);
}

.comic-chapter-option.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
}

.comic-chapter-pages {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  opacity: 0.72;
  flex-shrink: 0;
}

.comic-seg {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 30px;
  padding: 0 2px;
  border-radius: 0;
  background: transparent;
  border: none;
  flex-shrink: 0;
}

.comic-seg-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 0 2px;
  border-radius: 0;
  font-size: 0.78rem;
  line-height: 1;
  color: var(--subtle);
  white-space: nowrap;
  transition: color 160ms var(--ease);
}

.comic-seg-btn:hover {
  color: var(--ink);
}

.comic-seg-btn.active {
  background: transparent;
  color: var(--ink);
  font-weight: 500;
  box-shadow: none;
}

.comic-seg-btn.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1.5px;
  background: var(--accent);
}

.comic-tag-popover {
  position: fixed;
  top: 62px;
  right: 24px;
  width: 336px;
  max-width: calc(100vw - 32px);
  z-index: 35;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  animation: viewFadeUp 160ms var(--ease) both;
}

.comic-stage {
  flex: 1;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
}

.comic-strip-container {
  max-width: 820px;
  margin: 0 auto;
  padding: 72px 16px 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.comic-strip-page {
  width: 100%;
}

.comic-strip-page img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.comic-strip-end {
  margin-top: 28px;
  padding: 24px;
  width: 100%;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: center;
}

.comic-strip-end p {
  font-family: var(--font-serif);
  font-size: 0.94rem;
  margin-bottom: 14px;
  color: var(--muted);
}

.comic-next-cta {
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--bg);
  font-size: 0.8rem;
  font-weight: 500;
}

.comic-paged-container {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 66px 20px 64px;
  overflow: hidden;
}

.comic-tap-zone {
  position: fixed;
  top: 54px;
  bottom: 52px;
  z-index: 8;
}

.comic-tap-zone.left {
  left: 0;
  width: 30%;
  cursor: w-resize;
}

.comic-tap-zone.center {
  left: 30%;
  width: 40%;
  cursor: pointer;
}

.comic-tap-zone.right {
  right: 0;
  width: 30%;
  cursor: e-resize;
}

.comic-spread {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
  animation: pageFade 200ms var(--ease) both;
}

.comic-spread img {
  display: block;
  max-height: calc(100vh - 134px);
  max-width: min(92vw, 880px);
  width: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  object-fit: contain;
}

/* Bottom Minimal Scrubber Bar with Hairline Custom Slider */
.comic-bottombar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  height: 52px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--border);
  transition: transform 240ms var(--ease), opacity 200ms var(--ease);
}

.comic-overlay.ui-hidden .comic-bottombar {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}

.comic-scrubber-wrap {
  flex: 1;
  max-width: 460px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.comic-page-counter {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  min-width: 52px;
}

.comic-range-shell {
  position: relative;
  flex: 1;
  height: 24px;
  display: flex;
  align-items: center;
}

.comic-range-track {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 999px;
  background: var(--border-strong);
  overflow: hidden;
  pointer-events: none;
}

.comic-range-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 100ms var(--ease);
}

.comic-scrubber {
  position: relative;
  width: 100%;
  height: 24px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.comic-scrubber::-webkit-slider-runnable-track {
  height: 2px;
  background: transparent;
}

.comic-scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-elevated);
  box-shadow: 0 1px 5px rgba(20, 19, 23, 0.2);
  margin-top: -4.5px;
  transition: transform 160ms var(--ease-spring);
}

.comic-scrubber:hover::-webkit-slider-thumb {
  transform: scale(1.22);
}

.comic-scrubber::-moz-range-track {
  height: 2px;
  background: transparent;
  border: none;
}

.comic-scrubber::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-elevated);
  box-shadow: 0 1px 5px rgba(20, 19, 23, 0.2);
}

.comic-step-btn {
  height: 28px;
  padding: 0 6px;
  border-radius: 0;
  background: transparent;
  border: none;
  font-size: 0.78rem;
  line-height: 1;
  color: var(--muted);
  white-space: nowrap;
  transition: color 160ms var(--ease);
}

.comic-step-btn:hover:not(:disabled) {
  color: var(--ink);
}

.comic-step-btn:disabled {
  opacity: 0.32;
  cursor: default;
}

/* ── Lightbox ── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(20, 19, 23, 0.88);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms var(--ease);
}

.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-plate {
  background: #FFFFFF;
  padding: 8px;
  border-radius: var(--radius-sm);
  max-width: min(92vw, 920px);
  max-height: 84vh;
  transform: scale(0.96);
  transition: transform 240ms var(--ease);
}

.lightbox.open .lightbox-plate {
  transform: scale(1);
}

.lightbox-plate img {
  max-width: 100%;
  max-height: calc(84vh - 16px);
  display: block;
}

.lightbox-caption {
  margin-top: 14px;
  font-family: var(--font-serif);
  font-size: 0.88rem;
  color: #E2E0E8;
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  font-size: 0.82rem;
  color: #E2E0E8;
  padding: 4px 6px;
  border-radius: 0;
  background: transparent;
}

.lightbox-close:hover {
  color: #FFFFFF;
  background: transparent;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  z-index: 150;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--bg);
  font-size: 0.8rem;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity 220ms var(--ease), transform 240ms var(--ease);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ── Keyframes ── */
@keyframes cardReveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes pageFade {
  from {
    opacity: 0.3;
    transform: scale(0.994);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes popBounce {
  0% { transform: scale(1); }
  45% { transform: scale(1.34); }
  100% { transform: scale(1); }
}

/* ── Responsive ── */
@media (max-width: 960px) {
  .topbar-inner {
    padding: 0 20px;
  }
  .lead-spread {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .work-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .comic-topbar {
    grid-template-columns: auto 1fr auto;
    padding: 0 14px;
  }
  .comic-reader-title {
    display: none;
  }
}

@media (max-width: 680px) {
  .topbar-inner {
    padding: 8px 16px;
    height: auto;
    flex-wrap: wrap;
    gap: 8px;
  }
  .nav-primary {
    order: 3;
    width: 100%;
    height: 40px;
    justify-content: space-around;
    border-top: 1px solid var(--border);
  }
  .theme-text {
    display: none;
  }
  .page-wrap {
    padding: 24px 16px 72px;
  }
  .search-box, .search-box:focus-within {
    width: 100%;
  }
  .work-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .author-body {
    padding: 0 18px 22px;
  }
  .story-figure-plate.is-portrait {
    max-width: 100%;
  }
  .comic-chapter-trigger {
    max-width: 150px;
    padding: 0 10px;
  }
  .story-pager {
    grid-template-columns: 1fr;
  }
  .pager-btn.next {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* ── Upload / Compose Sheet (Artbook Minimalist, Zero Pills) ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.upload-nav-btn {
  color: var(--ink-2);
}

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

.upload-backdrop {
  position: fixed;
  inset: 0;
  z-index: 125;
  background: rgba(20, 19, 23, 0.38);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms var(--ease);
}

.upload-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.upload-sheet {
  width: 100%;
  max-width: 740px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: translateY(10px);
  transition: transform 240ms var(--ease);
}

.upload-backdrop.open .upload-sheet {
  transform: translateY(0);
}

.upload-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.upload-type-tabs {
  display: inline-flex;
  align-items: center;
  gap: 20px;
}

.upload-body {
  padding: 22px 24px 24px;
  overflow-y: auto;
  flex: 1;
}

.upload-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.upload-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.upload-subtabs {
  display: inline-flex;
  align-items: center;
  gap: 18px;
}

.upload-inline-action {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  color: var(--accent);
  cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: border-color 160ms var(--ease), opacity 160ms var(--ease);
}

.upload-inline-action:hover {
  border-bottom-color: var(--accent);
}

.upload-grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 176px;
  gap: 20px;
  align-items: start;
}

.upload-fields-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.upload-form textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-family: var(--font-serif);
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--ink);
  resize: vertical;
  outline: none;
  transition: border-color 180ms var(--ease), background-color 180ms var(--ease);
}

.upload-form textarea:focus {
  background: var(--bg);
  border-color: var(--accent);
}

.upload-cover-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.upload-field-label {
  font-size: 0.76rem;
  color: var(--muted);
}

.upload-cover-box {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 180ms var(--ease);
}

.upload-cover-box.is-portrait {
  aspect-ratio: 3 / 4;
}

.upload-cover-box:hover {
  border-color: var(--accent);
}

.upload-cover-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.upload-cover-hint {
  font-size: 0.76rem;
  color: var(--muted);
}

.upload-chapters {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.upload-chapter-block {
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.upload-chapter-block:first-child {
  padding-top: 0;
  border-top: none;
}

.upload-chapter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.upload-ch-title-input {
  flex: 1;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-family: var(--font-serif);
  font-size: 0.9rem;
  color: var(--ink);
  outline: none;
}

.upload-ch-title-input:focus {
  border-color: var(--accent);
  background: var(--bg);
}

.upload-inline-imgs-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.upload-inline-imgs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upload-inline-img-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.upload-inline-img-item img {
  width: 48px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  background: #FFFFFF;
}

.upload-inline-img-meta {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.upload-mini-input {
  flex: 1;
  min-width: 140px;
  height: 30px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--ink);
  outline: none;
}

.upload-mini-input:focus {
  border-color: var(--accent);
}

.upload-pos-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  color: var(--muted);
}

.upload-pos-input {
  width: 52px;
  height: 28px;
  padding: 0 6px;
  text-align: center;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ink);
}

.upload-del-mini {
  font-size: 0.74rem;
  color: var(--muted);
  padding: 4px 6px;
  transition: color 160ms var(--ease);
}

.upload-del-mini:hover {
  color: var(--accent);
}

.upload-text-btn {
  font-size: 0.8rem;
  color: var(--accent);
  padding: 4px 0;
  border-bottom: 1px solid transparent;
}

.upload-text-btn:hover {
  border-bottom-color: var(--accent);
}

.upload-comic-pages-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.upload-pages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 10px;
}

.upload-pages-empty {
  grid-column: 1 / -1;
  padding: 28px 16px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
}

.upload-page-thumb {
  position: relative;
  aspect-ratio: 3 / 4;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
}

.upload-page-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.upload-page-num {
  position: absolute;
  left: 4px;
  bottom: 4px;
  padding: 1px 5px;
  background: rgba(20, 19, 23, 0.72);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 0.66rem;
}

.upload-page-del {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  background: rgba(20, 19, 23, 0.72);
  color: #FFFFFF;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.upload-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.upload-foot-note {
  font-size: 0.72rem;
  color: var(--subtle);
}

.upload-foot-actions {
  display: inline-flex;
  align-items: center;
  gap: 18px;
}

.upload-submit {
  margin-top: 0;
  padding: 0 22px;
}

@media (max-width: 680px) {
  .upload-grid-2 {
    grid-template-columns: 1fr;
  }
}


/* ── Streamlined Uploader Extras ── */
.upload-title-line {
  width: 100%;
  height: 40px;
  padding: 0 2px;
  border: none;
  border-bottom: 1px solid var(--border-strong);
  background: transparent;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--ink);
  outline: none;
  transition: border-color 180ms var(--ease);
}

.upload-title-line:focus {
  border-bottom-color: var(--accent);
}

.upload-title-line::placeholder {
  color: var(--subtle);
}

.upload-compact-actions {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.upload-compact-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.upload-cover-strip {
  width: 160px;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--plate);
}

.upload-cover-strip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Thread (帖子) Editorial Journal Feed ── */
.work-grid.is-thread-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  border-top: 1px solid var(--border);
}

.thread-card {
  position: relative;
  padding: 15px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: background-color 200ms var(--ease), border-color 200ms var(--ease);
}

.thread-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 2px;
  background: var(--accent);
  opacity: 0;
  transform: scaleY(0.5);
  transition: opacity 200ms var(--ease), transform 220ms var(--ease);
}

.thread-card:hover {
  background: color-mix(in srgb, var(--surface) 72%, transparent);
}

.thread-card:hover::before {
  opacity: 1;
  transform: scaleY(1);
}

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

.thread-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.thread-card-author-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--muted);
}

.thread-card-date {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--subtle);
}

.thread-card-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.thread-card-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.thread-card-title {
  font-family: var(--font-serif);
  font-size: 1.04rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.38;
  transition: color 180ms var(--ease);
}

.thread-card-excerpt {
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.58;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.thread-card-media {
  position: relative;
  width: 112px;
  aspect-ratio: 4 / 3;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--plate);
}

.thread-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 420ms var(--ease);
}

.thread-card:hover .thread-card-media img {
  transform: scale(1.035);
}

.thread-media-count {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 2px 6px;
  background: rgba(20, 19, 23, 0.72);
  backdrop-filter: blur(6px);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  border-radius: var(--radius-sm);
}

.thread-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2px;
  font-size: 0.74rem;
  color: var(--muted);
}

.thread-card-stats {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.thread-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  color: var(--subtle);
}

.thread-stat-chip svg {
  width: 13px;
  height: 13px;
}

/* Thread Detail Multi-Image Gallery */
.thread-gallery {
  margin: 26px 0 12px;
  display: grid;
  gap: 12px;
}

.thread-gallery.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.thread-gallery.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.thread-gallery-item {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--plate);
  cursor: zoom-in;
}

.thread-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 380ms var(--ease);
}

.thread-gallery-item:hover img {
  transform: scale(1.03);
}

.article-body.is-thread-body {
  font-family: var(--font-sans);
  font-size: calc(var(--reader-size) - 1.5px);
  line-height: 1.88;
}

@media (max-width: 680px) {
  .thread-card {
    padding: 20px 12px;
  }
  .thread-card-main {
    flex-direction: column;
    gap: 14px;
  }
  .thread-card-media {
    width: 100%;
    max-width: 280px;
  }
  .thread-gallery.cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ── Cloud Comments Section (Zero Pills, Artbook Minimalist) ── */
.work-comments-panel {
  margin-bottom: 28px;
  padding: 20px 0 8px;
  border-top: 1px solid var(--border);
}

.comments-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.comments-title {
  font-family: var(--font-serif);
  font-size: 0.96rem;
  font-weight: 400;
  color: var(--ink);
}

.comments-count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--subtle);
}

.comments-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.comments-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-family: var(--font-sans);
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--ink);
  resize: vertical;
  outline: none;
  transition: border-color 180ms var(--ease), background-color 180ms var(--ease);
}

.comments-input:focus {
  background: var(--bg);
  border-color: var(--accent);
}

.comments-form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.comments-hint {
  font-size: 0.74rem;
  color: var(--subtle);
}

.comments-submit {
  height: 30px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--bg);
  font-size: 0.78rem;
  transition: opacity 160ms var(--ease);
}

.comments-submit:hover:not(:disabled) {
  opacity: 0.84;
}

.comments-submit:disabled {
  opacity: 0.45;
  cursor: default;
}

.comments-list {
  display: flex;
  flex-direction: column;
}

.comments-empty {
  padding: 18px 0;
  font-size: 0.82rem;
  color: var(--subtle);
}

.comment-item {
  padding: 13px 0;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.comment-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.76rem;
  color: var(--muted);
}

.comment-meta-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.comment-time {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--subtle);
}

.comment-body {
  font-size: 0.88rem;
  line-height: 1.72;
  color: var(--ink-2);
  white-space: pre-wrap;
  word-break: break-word;
}

.comment-del-btn {
  font-size: 0.72rem;
  color: var(--subtle);
  transition: color 160ms var(--ease);
}

.comment-del-btn:hover {
  color: var(--accent);
}


/* ── Thread Cards inside Mixed Grids (Profile / Tag / Saved) ── */
.work-grid:not(.is-thread-feed) .thread-card {
  grid-column: 1 / -1;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.thread-kicker-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--accent);
  letter-spacing: 0.06em;
}


/* ── Comment Replies ── */
.comment-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.comment-reply-btn {
  font-size: 0.72rem;
  color: var(--subtle);
  transition: color 160ms var(--ease);
}

.comment-reply-btn:hover {
  color: var(--ink);
}

.comment-reply-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--surface);
  border-left: 2px solid var(--accent);
  font-size: 0.76rem;
  color: var(--muted);
}

.comment-reply-bar strong {
  color: var(--accent);
  font-weight: 500;
}

.comment-reply-cancel {
  font-size: 0.72rem;
  color: var(--subtle);
}

.comment-reply-cancel:hover {
  color: var(--ink);
}

.comment-reply-mention {
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 500;
  margin-right: 4px;
}

.comment-reply-mention:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.comment-item.is-reply {
  padding-left: 14px;
  border-left: 1.5px solid var(--border);
}


/* ── Profile Edit Modal & Account Avatar Image ── */
.account-avatar {
  overflow: hidden;
}

.account-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-modal-card {
  max-width: 440px;
}

.profile-modal-heading {
  margin-bottom: 0;
  font-size: 1.2rem;
}

.profile-edit-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-avatar-preview {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 1.3rem;
  flex-shrink: 0;
}

.profile-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-edit-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.profile-banner-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-banner-preview {
  width: 100%;
  height: 92px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: linear-gradient(120deg, var(--surface) 0%, color-mix(in srgb, var(--accent-soft) 55%, var(--bg)) 100%);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.74rem;
  color: var(--subtle);
}

.profile-banner-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
