/* ============================================
   星演 StarShow — Minimalist Manga Design System
   Based on Stitch export: stitch_xingyan_minimalist_manga_ui
   ============================================ */

/* === CSS Variables === */
:root {
  --primary: #a53b29;
  --primary-container: #ff7e67;
  --primary-fixed: #ffdad4;
  --primary-fixed-dim: #ffb4a6;
  --on-primary: #ffffff;
  --on-primary-container: #731709;
  --on-primary-fixed: #3f0300;
  --on-primary-fixed-variant: #842415;
  --secondary: #76574e;
  --secondary-container: #fed4c8;
  --secondary-fixed: #ffdbd0;
  --on-secondary: #ffffff;
  --on-secondary-container: #795950;
  --tertiary: #5e5e5e;
  --tertiary-container: #a5a4a4;
  --tertiary-fixed: #e4e2e2;
  --on-tertiary: #ffffff;
  --on-tertiary-container: #3a3a3a;
  --surface: #f9f9f9;
  --surface-bright: #f9f9f9;
  --surface-dim: #dadada;
  --surface-container-lowest: #ffffff;
  --surface-container-low: #f3f3f3;
  --surface-container: #eeeeee;
  --surface-container-high: #e8e8e8;
  --surface-container-highest: #e2e2e2;
  --surface-variant: #e2e2e2;
  --background: #f9f9f9;
  --on-surface: #1a1c1c;
  --on-surface-variant: #57423e;
  --on-background: #1a1c1c;
  --outline: #8b716d;
  --outline-variant: #dec0ba;
  --error: #ba1a1a;
  --error-container: #ffdad6;
  --on-error: #ffffff;
  --on-error-container: #93000a;
  --inverse-surface: #2f3131;
  --inverse-primary: #ffb4a6;
  --inverse-on-surface: #f1f1f1;
  --ink-black: #1a1c1c;
  --coral: #a53b29;
  --coral-light: #ff7e67;
  --pale-pink: #fed4c8;
  --paper-white: #ffffff;
  --warm-gray: #f3f3f3;

  --sidebar-width: 288px;
  --topbar-height: 64px;
  --content-max: 1280px;
  --gutter: 24px;
  --unit: 8px;
}

/* === Base Reset === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  max-height: 100%;
  overflow: hidden; /* 只允许主内容区滚动，避免双滚动条 */
  font-family: 'Hanken Grotesk', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--on-background);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
}

/* === Typography === */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Bricolage Grotesque', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--on-surface);
  line-height: 1.2;
}

.display-lg { font-size: 48px; font-weight: 800; letter-spacing: -0.02em; }
.headline-lg { font-size: 32px; font-weight: 700; }
.headline-md { font-size: 24px; font-weight: 600; }
.body-lg { font-size: 18px; font-weight: 400; line-height: 1.6; }
.body-md { font-size: 16px; font-weight: 400; line-height: 1.5; }
.label-sm { font-family: 'Space Mono', 'Courier New', monospace; font-size: 12px; font-weight: 500; letter-spacing: 0.05em; line-height: 1; text-transform: uppercase; }

.text-primary { color: var(--primary); }
.text-on-surface { color: var(--on-surface); }
.text-on-surface-variant { color: var(--on-surface-variant); }

/* === Manga Components === */

/* Sketchy Border */
.sketchy-border {
  border: 1.5px solid var(--outline);
  border-radius: 6px 8px 4px 6px / 4px 6px 8px 4px;
}

.sketchy-border-b {
  border-bottom: 1.5px solid var(--outline);
}

.sketchy-border-r {
  border-right: 1.5px solid var(--outline);
}

/* Manga Card — organic feel with hover-lift shadow */
.manga-card {
  background: var(--surface-container-lowest);
  border: 1.5px solid var(--outline);
  border-radius: 6px 8px 4px 6px / 4px 6px 8px 4px;
  transition: all 0.2s ease-out;
  position: relative;
}

.manga-card:hover {
  transform: translate(-4px, -4px);
  box-shadow: 4px 4px 0 0 var(--ink-black);
}

.manga-card-primary:hover {
  box-shadow: 4px 4px 0 0 var(--primary);
}

/* Halftone texture background */
.halftone-bg {
  background-image: radial-gradient(var(--outline-variant) 10%, transparent 11%);
  background-size: 8px 8px;
  background-position: 0 0, 4px 4px;
}

/* Sketchy horizontal rule */
.sketchy-hr {
  height: 1.5px;
  background: var(--outline);
  border-radius: 50%;
  margin: 12px 0;
  width: 100%;
}

/* === Buttons === */
.btn-capsule-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 9999px;
  background: var(--primary);
  color: var(--on-primary);
  font-family: 'Space Mono', 'Courier New', monospace;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 24px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-capsule-primary:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 0 var(--ink-black);
  border-color: var(--ink-black);
}

.btn-capsule-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 9999px;
  background: transparent;
  color: var(--on-surface);
  border: 2px solid var(--ink-black);
  font-family: 'Space Mono', 'Courier New', monospace;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 24px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-capsule-secondary:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 0 var(--ink-black);
  background: var(--paper-white);
}

.btn-capsule-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 9999px;
  background: var(--error);
  color: var(--on-error);
  font-family: 'Courier New', 'Fira Code', monospace;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 24px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-capsule-danger:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 0 var(--ink-black);
}

.btn-capsule-success {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 9999px;
  background: #4caf50;
  color: #ffffff;
  font-family: 'Courier New', 'Fira Code', monospace;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 24px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-capsule-success:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 0 var(--ink-black);
}

/* === Form Elements === */
.manga-input {
  padding: 10px 16px;
  background: var(--surface-bright);
  border: 1.5px solid var(--outline);
  border-radius: 6px;
  font-family: -apple-system, 'PingFang SC', sans-serif;
  font-size: 16px;
  color: var(--on-surface);
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.manga-input:focus {
  border-color: var(--primary);
}

.manga-select {
  padding: 10px 16px;
  background: var(--surface-bright);
  border: 1.5px solid var(--outline);
  border-radius: 6px;
  font-family: -apple-system, 'PingFang SC', sans-serif;
  font-size: 16px;
  color: var(--on-surface);
  outline: none;
  cursor: pointer;
}

.manga-textarea {
  padding: 12px 16px;
  background: var(--surface-bright);
  border: 1.5px solid var(--outline);
  border-radius: 6px;
  font-family: -apple-system, 'PingFang SC', sans-serif;
  font-size: 16px;
  color: var(--on-surface);
  resize: vertical;
  min-height: 200px;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.manga-textarea:focus {
  border-color: var(--primary);
}

/* === Tags / Chips === */
.manga-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 9999px;
  background: var(--pale-pink);
  color: var(--primary);
  font-family: 'Courier New', 'Fira Code', monospace;
  font-size: 11px;
  border: 1px solid var(--outline-variant);
}

/* === Tabs === */
.manga-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-container);
  border-radius: 9999px;
  border: 1.5px solid var(--outline);
}

.manga-tab {
  padding: 8px 20px;
  border-radius: 9999px;
  font-family: 'Courier New', 'Fira Code', monospace;
  font-size: 12px;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--on-surface-variant);
  transition: all 0.2s;
}

.manga-tab.active {
  background: var(--primary);
  color: var(--on-primary);
}

/* === Badge / Status === */
.manga-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 9999px;
  font-family: 'Courier New', 'Fira Code', monospace;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid;
}

.manga-badge-success {
  background: #e8f5e9;
  color: #2e7d32;
  border-color: #a5d6a7;
}

.manga-badge-warning {
  background: #fff3e0;
  color: #e65100;
  border-color: #ffcc80;
}

.manga-badge-danger {
  background: var(--error-container);
  color: var(--on-error-container);
  border-color: #ef9a9a;
}

.manga-badge-info {
  background: var(--pale-pink);
  color: var(--primary);
  border-color: var(--outline-variant);
}

/* === Modal === */
.manga-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 28, 28, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: none;
}

.manga-modal-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--outline-variant) 12%, transparent 13%);
  background-size: 8px 8px;
  opacity: 0.35;
  pointer-events: none;
}

.manga-modal {
  position: relative;
  background: var(--surface-container-lowest);
  border: 1.5px solid var(--outline);
  border-radius: 6px 10px 4px 8px / 8px 4px 10px 6px;
  padding: 32px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 6px 6px 0 0 var(--ink-black);
}

.manga-modal.hidden,
.manga-modal-overlay.hidden,
.manga-dialog-overlay.hidden { display: none !important; }

/* === In-app Dialog (manga) === */
.manga-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(26, 28, 28, 0.32);
}

.manga-dialog-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(222, 192, 186, 0.7) 12%, transparent 13%);
  background-size: 9px 9px;
  opacity: 0.45;
  pointer-events: none;
}

.manga-dialog {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 28px 24px 24px;
  background: var(--surface-container-lowest);
  box-shadow: 5px 5px 0 0 var(--ink-black);
  animation: fadeInUp 0.25s ease-out;
}

.manga-dialog:hover {
  transform: none;
  box-shadow: 5px 5px 0 0 var(--ink-black);
}

.manga-dialog-accent {
  position: absolute;
  top: -10px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--outline);
  background: var(--primary-fixed);
  box-shadow: 3px 3px 0 0 var(--ink-black);
}

.manga-dialog-accent::after {
  content: '✦';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 14px;
}

.manga-dialog-title {
  font-family: 'Bricolage Grotesque', 'PingFang SC', sans-serif;
  margin: 0 0 10px;
  color: var(--on-surface);
}

.manga-dialog-message {
  margin: 0 0 18px;
  white-space: pre-wrap;
}

.manga-dialog-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.manga-dialog-field { display: flex; flex-direction: column; gap: 6px; }

.manga-dialog-label {
  color: var(--on-surface-variant);
  text-transform: none;
  letter-spacing: 0.04em;
}

.manga-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

/* === Toast / Notification === */
.manga-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 220px;
  max-width: min(360px, calc(100vw - 32px));
  background: var(--surface-container-lowest);
  border: 1.5px solid var(--outline);
  border-radius: 6px 10px 4px 8px / 8px 4px 10px 6px;
  padding: 14px 16px;
  font-family: 'Space Mono', 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.45;
  color: var(--on-surface);
  z-index: 11000;
  opacity: 0;
  transform: translate(12px, -6px);
  transition: all 0.28s ease;
  pointer-events: none;
  box-shadow: 4px 4px 0 0 var(--ink-black);
}

.manga-toast-icon {
  font-size: 20px !important;
  line-height: 1;
  color: var(--primary);
  flex-shrink: 0;
}

.manga-toast-text {
  padding-top: 2px;
  word-break: break-word;
}

.manga-toast.show {
  opacity: 1;
  transform: translate(0, 0);
  pointer-events: auto;
}

.manga-toast.success {
  border-color: #2e7d32;
  background: #f1f8f2;
}
.manga-toast.success .manga-toast-icon { color: #2e7d32; }

.manga-toast.error {
  border-color: var(--error);
  background: var(--error-container);
  color: var(--on-error-container);
}
.manga-toast.error .manga-toast-icon { color: var(--error); }

.manga-toast.info {
  border-color: var(--primary);
  background: var(--primary-fixed);
}
.manga-toast.info .manga-toast-icon { color: var(--primary); }

.manga-toast.weather {
  border-color: #1565c0;
  background: #e8f1fb;
  max-width: min(420px, calc(100vw - 32px));
}
.manga-toast.weather .manga-toast-icon { color: #1565c0; }

.weather-chip-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: min(340px, 55vw);
}
.weather-chip-wrap[hidden] { display: none !important; }

.weather-chip {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  padding: 6px 10px;
  border: 1.5px solid var(--outline);
  border-radius: 999px;
  background: var(--surface-container-lowest);
  font-family: 'Space Mono', 'Courier New', monospace;
  font-size: 11px;
  line-height: 1.3;
  color: var(--on-surface-variant);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.weather-chip[hidden] { display: none !important; }

.weather-city-btn {
  flex-shrink: 0;
  border: 1.5px solid var(--outline);
  border-radius: 999px;
  background: var(--primary-fixed);
  color: var(--on-primary-fixed-variant);
  font-family: 'Space Mono', 'Courier New', monospace;
  font-size: 11px;
  line-height: 1;
  padding: 7px 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.weather-city-btn:active {
  transform: translateY(1px);
}

@media (max-width: 720px) {
  .weather-chip-wrap {
    max-width: min(220px, 48vw);
  }
  .weather-chip {
    font-size: 10px;
    padding: 6px 8px;
  }
  .topbar-user-name,
  .topbar-live-btn {
    display: none !important;
  }
}

.manga-spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 2px solid var(--outline-variant);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === Table === */
.manga-table {
  width: 100%;
  border-collapse: collapse;
}

.manga-table th {
  text-align: left;
  padding: 12px 16px;
  font-family: 'Courier New', 'Fira Code', monospace;
  font-size: 11px;
  font-weight: 500;
  color: var(--on-surface-variant);
  border-bottom: 1.5px solid var(--outline);
  background: var(--surface-container-low);
}

.manga-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--outline-variant);
  font-size: 14px;
}

.manga-table tr:hover td {
  background: var(--surface-container-low);
}

/* === Illustrations Grid === */
.illustration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.illustration-card {
  background: var(--surface-container-lowest);
  border: 1.5px solid var(--outline);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.illustration-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: 4px 4px 0 0 var(--ink-black);
}

.illustration-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-fixed-dim);
}

.illustration-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.illustration-card .card-footer {
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--on-surface-variant);
}

/* === Utility === */
.text-center { text-align: center; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }
.p-8 { padding: 32px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }
.mt-4 { margin-top: 16px; }
.mt-auto { margin-top: auto; }
.w-full { width: 100%; }
.rounded-full { border-radius: 9999px; }
.overflow-hidden { overflow: hidden; }
.cursor-pointer { cursor: pointer; }
.hidden { display: none !important; }
.relative { position: relative; }
.absolute { position: absolute; }
.sticky { position: sticky; }
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: 1fr; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* === Layout === */
.app-layout {
  display: flex;
  height: 100%;
  max-height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: var(--sidebar-width);
  height: 100%;
  max-height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  background: var(--surface);
  border-right: 1.5px solid var(--outline);
  display: flex;
  flex-direction: column;
  padding: var(--gutter);
  z-index: 50;
  overflow: hidden; /* 侧栏本身不滚，交给 nav */
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}

.sidebar-header .logo-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1.5px solid var(--outline);
  background: var(--surface-container);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar-header .logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-header .brand-name {
  font-family: 'Bricolage Grotesque', 'PingFang SC', sans-serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
}

.sidebar-header .brand-sub {
  font-family: 'Space Mono', 'Courier New', monospace;
  font-size: 12px;
  color: var(--on-surface-variant);
}

.sidebar-nav {
  flex-shrink: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 8px;
  margin-bottom: 10px;
}

.sidebar-cta {
  width: 100%;
  margin-bottom: 32px;
  flex-shrink: 0;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  color: var(--on-surface-variant);
  text-decoration: none;
  font-family: 'Space Mono', 'Courier New', monospace;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.sidebar-nav-item:hover {
  color: var(--primary);
  transform: translateY(-2px) translateX(-2px);
}

.sidebar-nav-item.active {
  background: var(--primary-fixed);
  color: var(--primary);
  font-weight: 700;
}

.sidebar-nav-item .nav-icon {
  font-size: 20px;
  width: 24px;
  text-align: center;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1.5px dashed var(--outline);
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.main-area {
  margin-left: var(--sidebar-width);
  margin-right: var(--cat-panel-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100vh;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.topbar {
  height: var(--topbar-height);
  flex-shrink: 0;
  background: var(--surface-container-lowest);
  border-bottom: 1.5px solid var(--outline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  position: relative;
  z-index: 40;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-search {
  padding: 8px 16px 8px 40px;
  background: var(--surface-bright);
  border: 1.5px solid var(--outline);
  border-radius: 6px;
  font-family: -apple-system, 'PingFang SC', sans-serif;
  font-size: 16px;
  color: var(--on-surface);
  width: 256px;
  outline: none;
}

.topbar-live-btn {
  display: none;
}

@media (min-width: 768px) {
  .topbar-live-btn {
    display: inline-flex;
  }
}

.topbar-search:focus {
  border-color: var(--primary);
}

.topbar-search-wrap {
  position: relative;
}

.topbar-search-wrap .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--on-surface-variant);
  font-size: 20px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.topbar-icon-btn {
  background: none;
  border: none;
  color: var(--on-surface-variant);
  cursor: pointer;
  font-size: 24px;
  padding: 4px;
}

.topbar-icon-btn:hover {
  color: var(--primary);
}

.content-area {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: var(--gutter);
  position: relative;
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}

.content-area::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 384px;
  height: 384px;
  background-image: radial-gradient(var(--outline-variant) 10%, transparent 11%);
  background-size: 8px 8px;
  opacity: 0.3;
  border-bottom-left-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.content-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  position: relative;
  z-index: 1;
  width: 100%;
  isolation: isolate;
}

.content-area.is-fullbleed {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.content-area.is-fullbleed::before {
  display: none;
}

.content-area.is-fullbleed .content-inner {
  max-width: none;
  margin: 0;
  flex: 1;
  min-height: 0;
  height: auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 全屏页根节点撑满，内部再自己滚 */
.content-area.is-fullbleed .content-inner > .create-page,
.content-area.is-fullbleed .content-inner > .chat-page,
.content-area.is-fullbleed .content-inner > .visual-page {
  flex: 1;
  min-height: 0;
  height: auto;
  max-height: 100%;
}

/* === Stitch utility aliases === */
.manga-border {
  border: 1.5px solid var(--ink-black);
  border-radius: 8px;
}

.manga-shadow {
  box-shadow: 4px 4px 0 0 var(--ink-black);
}

.manga-shadow-lg {
  box-shadow: 6px 6px 0 0 var(--ink-black);
}

.manga-shadow-primary {
  box-shadow: 4px 4px 0 0 var(--primary);
}

.manga-shadow-hover:hover {
  transform: translate(-4px, -4px);
  box-shadow: 4px 4px 0 0 var(--ink-black);
}

.sketchy-card {
  background: var(--surface-container-lowest);
  border: 1.5px solid var(--outline);
  border-radius: 6px 8px 4px 6px / 4px 6px 8px 4px;
  position: relative;
  transition: all 0.2s ease-out;
}

.sketchy-card:hover {
  transform: translate(-4px, -4px);
  box-shadow: 4px 4px 0 0 var(--ink-black);
}

.sketchy-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 9999px;
  background: var(--primary);
  color: var(--on-primary);
  border: 1.5px solid var(--ink-black);
  font-family: 'Courier New', 'Fira Code', monospace;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.sketchy-btn-primary:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 0 var(--ink-black);
}

.sketchy-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 9999px;
  background: transparent;
  color: var(--on-surface);
  border: 1.5px solid var(--ink-black);
  font-family: 'Courier New', 'Fira Code', monospace;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.sketchy-btn-secondary:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 0 var(--ink-black);
  background: var(--paper-white);
}

.sketchy-input {
  border: none;
  border-bottom: 1.5px solid var(--ink-black);
  background: transparent;
  outline: none;
  font-family: -apple-system, 'PingFang SC', sans-serif;
  color: var(--on-surface);
}

.sketchy-input:focus {
  border-bottom-color: var(--primary);
}

.sketchy-divider {
  height: 1.5px;
  background: var(--outline);
  border-radius: 50%;
}

.module-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  border: 1px solid var(--outline);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.metric-tag {
  font-family: 'Courier New', 'Fira Code', monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 9999px;
  border: 1px solid;
}

.metric-tag-primary {
  color: var(--primary);
  background: var(--primary-fixed);
  border-color: var(--primary);
}

.metric-tag-neutral {
  color: var(--on-surface);
  background: var(--surface-container-highest);
  border-color: var(--outline);
}

.hand-drawn-line {
  height: 2px;
  background: var(--outline-variant);
  border-radius: 50%;
  opacity: 0.6;
}

.bagua-line-solid {
  height: 3px;
  background: var(--ink-black);
  width: 100%;
}

.bagua-line-broken {
  height: 3px;
  background: transparent;
  border-top: 3px solid var(--ink-black);
  border-bottom: none;
  width: 100%;
  position: relative;
}

.bagua-line-broken::after {
  content: '';
  position: absolute;
  left: 38%;
  top: -3px;
  width: 24%;
  height: 3px;
  background: var(--surface-container-lowest);
}

.manga-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.space-y-12 > * + * { margin-top: 48px; }
.space-y-6 > * + * { margin-top: 24px; }
.space-y-4 > * + * { margin-top: 16px; }
.space-y-3 > * + * { margin-top: 12px; }
.gap-3 { gap: 12px; }
.justify-center { justify-content: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.self-end { align-self: flex-end; }
.flex-row-reverse { flex-direction: row-reverse; }
.flex-shrink-0 { flex-shrink: 0; }
.flex-wrap { flex-wrap: wrap; }
.line-clamp-1 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}
.line-clamp-2 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

@media (min-width: 640px) {
  .sm\\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .lg\\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .lg\\:grid-cols-12 { grid-template-columns: repeat(12, 1fr); }
  .lg\\:col-span-4 { grid-column: span 4; }
  .lg\\:col-span-5 { grid-column: span 5; }
  .lg\\:col-span-7 { grid-column: span 7; }
  .lg\\:col-span-8 { grid-column: span 8; }
  .lg\\:flex-row { flex-direction: row; }
}
@media (min-width: 1280px) {
  .xl\\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .xl\\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
  .xl\\:col-span-2 { grid-column: span 2; }
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--outline-variant); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--outline); }

/* === Page-specific: Create Engine === */
.create-page {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  position: relative;
  background: var(--surface);
  overflow: hidden;
}

.create-tabs-bar {
  height: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 40px;
  background: var(--surface-container-lowest);
  border-bottom: 1.5px solid var(--outline);
  flex-shrink: 0;
}

.create-tab-btn {
  height: 100%;
  display: flex;
  align-items: center;
  padding: 4px 0 0;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--on-surface-variant);
  cursor: pointer;
  transition: color 0.2s;
}

.create-tab-btn:hover { color: var(--primary); }
.create-tab-btn.active {
  color: var(--primary);
  font-weight: 700;
  border-bottom-color: var(--primary);
  opacity: 0.9;
}

.create-panes {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 24px;
  padding: 24px;
  padding-bottom: 96px;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.create-pane {
  background: var(--paper-white);
  border: 1.5px solid var(--outline);
  border-radius: 6px 8px 4px 6px / 4px 6px 8px 4px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.create-pane-left { width: 25%; min-width: 200px; min-height: 0; }
.create-pane-center { flex: 1; min-width: 0; min-height: 0; position: relative; }
.create-pane-right { width: 20%; min-width: 180px; min-height: 0; }

.create-pane-header {
  padding: 16px;
  border-bottom: 1.5px dashed var(--outline);
  background: var(--surface-bright);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.create-chapter-item {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--outline-variant);
  background: var(--surface-container-highest);
  cursor: pointer;
  transition: all 0.2s;
}

.create-chapter-item:hover {
  background: var(--surface-variant);
}

.create-chapter-item.active {
  background: var(--secondary-container);
  border: 1.5px solid var(--primary);
  transform: translate(-2px, -2px);
  box-shadow: 2px 2px 0 0 var(--primary);
}

.create-editor-title {
  width: 100%;
  background: transparent;
  border: none;
  font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--on-surface);
  outline: none;
  margin-bottom: 8px;
}

.create-editor-area {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 32px;
}

.create-editor-area textarea {
  width: 100%;
  height: 100%;
  min-height: 200px;
  resize: none;
  border: none;
  background: transparent;
  font-family: -apple-system, 'PingFang SC', sans-serif;
  font-size: 18px;
  line-height: 1.8;
  color: var(--on-surface);
  outline: none;
}

.create-toolbar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  flex-shrink: 0;
  background: var(--surface-container-lowest);
  border-top: 1.5px solid var(--outline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  z-index: 20;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
}

.create-char-card {
  border: 1.5px solid var(--outline);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface-container-lowest);
  cursor: pointer;
  transition: border-color 0.2s;
}

.create-char-card:hover {
  border-color: var(--primary);
}

.create-star-deco {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--inverse-primary);
  border: 1.5px solid var(--outline);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(12deg);
  z-index: 20;
  box-shadow: 2px 2px 0 0 var(--outline);
}

/* === Page-specific: Chat === */
.chat-page {
  display: flex;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--surface-bright);
}

.chat-history-pane {
  width: 256px;
  border-right: 1.5px solid var(--outline);
  background: var(--surface-container-lowest);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  min-height: 0;
  overflow: hidden;
}

.chat-history-item {
  padding: 12px;
  border-radius: 8px;
  border: 1.5px solid var(--outline);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s;
}

.chat-history-item:hover {
  background: var(--secondary-container);
}

.chat-history-item.active {
  background: var(--secondary-container);
  border-color: var(--primary);
  box-shadow: 2px 2px 0 0 var(--primary);
}

.chat-main-pane {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background-image: radial-gradient(var(--outline-variant) 10%, transparent 11%);
  background-size: 8px 8px;
}

.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.chat-bubble-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  max-width: 48rem;
}

.chat-bubble-row.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--outline);
  background: var(--surface-container-highest);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.chat-bubble {
  padding: 16px;
  border: 1.5px solid var(--outline);
  border-radius: 16px;
  border-top-left-radius: 4px;
  background: var(--surface-container-lowest);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.chat-bubble-row.user .chat-bubble {
  background: var(--primary-container);
  color: var(--on-primary-container);
  border-color: var(--primary);
  border-top-left-radius: 16px;
  border-top-right-radius: 4px;
}

.chat-input-area {
  padding: 24px;
  background: var(--surface-container-lowest);
  border-top: 1.5px solid var(--outline);
  flex-shrink: 0;
}

.chat-input-wrap {
  max-width: 56rem;
  margin: 0 auto;
  position: relative;
}

.chat-input-wrap textarea {
  width: 100%;
  background: var(--surface-bright);
  border: 1.5px solid var(--outline);
  border-radius: 12px;
  padding: 16px 64px 16px 16px;
  font-family: -apple-system, 'PingFang SC', sans-serif;
  font-size: 16px;
  color: var(--on-surface);
  resize: none;
  outline: none;
}

.chat-input-wrap textarea:focus {
  border-color: var(--primary);
}

.chat-send-btn {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.chat-send-btn:hover {
  background: var(--on-primary-container);
}

.chat-quick-tags {
  max-width: 56rem;
  margin: 8px auto 0;
  display: flex;
  justify-content: center;
  gap: 8px;
}

/* === Page-specific: Visual Workshop === */
.visual-page {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.visual-body {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 24px;
  padding: 24px;
  overflow: hidden;
  background-image: radial-gradient(var(--outline-variant) 10%, transparent 11%);
  background-size: 8px 8px;
}

.visual-controls {
  width: 384px;
  max-width: 40%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
  min-height: 0;
}

.visual-gallery {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding-right: 8px;
  padding-bottom: 32px;
}

.visual-mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.visual-mode-btn {
  padding: 8px 12px;
}

.visual-mode-btn.active {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--ink-black);
}

.visual-result-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 24px;
}

@media (min-width: 768px) {
  .visual-result-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1280px) {
  .visual-result-grid { grid-template-columns: repeat(3, 1fr); }
}

.visual-result-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 1;
}

.visual-result-card.featured {
  aspect-ratio: 16 / 9;
}

@media (min-width: 768px) {
  .visual-result-card.featured { grid-column: span 2; }
}
@media (min-width: 1280px) {
  .visual-result-card.featured { grid-column: span 2; }
}

.visual-result-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.visual-result-card:hover img {
  transform: scale(1.05);
}

.visual-result-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px;
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
  opacity: 0;
  transition: opacity 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.visual-result-card:hover .visual-result-overlay {
  opacity: 1;
}

/* === Hot page === */
.hot-column {
  background: var(--surface-container-lowest);
  border: 1.5px solid var(--ink-black);
  border-radius: 8px;
  box-shadow: 4px 4px 0 0 var(--ink-black);
  padding: 24px;
  display: flex;
  flex-direction: column;
  height: auto;
  max-height: min(640px, calc(100vh - 220px));
  min-height: 320px;
}

.hot-column ul {
  min-height: 0;
}

.hot-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.hot-item:hover {
  background: var(--primary-fixed);
  transform: translate(-4px, -4px);
  box-shadow: 2px 2px 0 0 var(--ink-black);
  border-color: var(--ink-black);
}

.hot-rank {
  font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 24px;
  font-weight: 700;
  font-style: italic;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.hot-ai-card {
  background: var(--secondary-fixed);
  border: 3px solid var(--ink-black);
  border-radius: 16px;
  box-shadow: 6px 6px 0 0 var(--ink-black);
  padding: 24px;
  position: relative;
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.3s;
}

.hot-ai-card:hover {
  transform: translate(-8px, -8px);
}

/* ── 灵感收集板 ────────────────────────── */
.hot-inspire-card {
  background: var(--secondary-fixed);
  border: 3px solid var(--ink-black);
  border-radius: 16px;
  box-shadow: 6px 6px 0 0 var(--ink-black);
  padding: 24px;
  position: relative;
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.3s;
}

.hot-inspire-card:hover {
  transform: translate(-8px, -8px);
}

/* ── 热点详情浮层 ──────────────────────── */
.hot-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: hotFadeIn 0.15s ease-out;
}

.hot-detail-overlay.hidden {
  display: none;
}

@keyframes hotFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.hot-detail-card {
  background: var(--surface-container-lowest);
  border: 3px solid var(--ink-black);
  border-radius: 16px;
  box-shadow: 8px 8px 0 0 var(--ink-black);
  padding: 32px;
  max-width: 520px;
  width: calc(100% - 48px);
  position: relative;
  animation: hotCardIn 0.2s ease-out;
}

@keyframes hotCardIn {
  from { transform: scale(0.92) translateY(16px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.hot-detail-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--ink-black);
  background: var(--surface-container);
  color: var(--on-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.hot-detail-close:hover {
  background: var(--error-container);
  color: var(--on-error-container);
}

.hot-detail-card .btn-capsule-primary,
.hot-detail-card .btn-capsule-secondary {
  font-size: 13px;
  padding: 6px 14px;
}

/* === Fortune page === */
.fortune-input-underline {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--ink-black);
  padding: 8px 0;
  font-size: 18px;
  font-family: -apple-system, 'PingFang SC', sans-serif;
  color: var(--on-surface);
  outline: none;
  appearance: none;
}

.fortune-input-underline:focus {
  border-bottom-color: var(--primary);
}

.bazi-pillar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.bazi-cell {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1.5px solid var(--ink-black);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 24px;
  font-weight: 700;
  background: var(--surface-container);
}

.bazi-cell.highlight {
  background: var(--primary-container);
  color: var(--on-primary-container);
}

.bazi-cell.day-master {
  width: 56px;
  height: 56px;
  border: 2px solid var(--primary);
  background: var(--surface-container-lowest);
  color: var(--primary);
  box-shadow: 4px 4px 0 0 var(--primary);
}

.fortune-ticket {
  width: 128px;
  height: 192px;
  flex-shrink: 0;
  background: var(--surface-container-lowest);
  border: 1.5px solid var(--outline);
  border-radius: 6px;
  box-shadow: 4px 4px 0 0 var(--ink-black);
  transform: rotate(-3deg);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
  z-index: 10;
}

/* === Data page chart helpers === */
.hand-drawn-line-svg {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stroke-primary { stroke: var(--primary); }
.stroke-secondary { stroke: var(--secondary); }
.stroke-tertiary { stroke: var(--tertiary); }
.stroke-stock-up { stroke: #e53935; }
.stroke-stock-down { stroke: #43a047; }
.fill-stock-up { fill: #e53935; }
.fill-stock-down { fill: #43a047; }

/* === Toast / Notification — superseded by manga toast block above === */
.manga-toast-legacy-removed { display: none; }

.manga-spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 2px solid var(--outline-variant);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1024px) {
  .sidebar { width: 72px; padding: 16px 8px; }
  .sidebar-header .brand-name,
  .sidebar-header .brand-sub,
  .sidebar-nav-item span:not(.nav-icon),
  .sidebar-footer span:not(.nav-icon),
  .sidebar-cta { display: none; }
  .sidebar-nav-item { justify-content: center; padding: 12px; }
  .sidebar-header { justify-content: center; }
  .main-area { margin-left: 72px; margin-right: 0; }
  .cat-panel { display: none; }
  :root { --sidebar-width: 72px; }
  .create-pane-left, .create-pane-right { display: none; }
  .chat-history-pane { display: none; }
  .visual-controls { width: 100%; max-width: none; max-height: 42%; }
  .visual-body { flex-direction: column; }
  .visual-gallery { min-height: 0; }
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 768px) {
  .metric-grid { grid-template-columns: 1fr; }
}

.metric-card {
  background: var(--surface-container-lowest);
  border: 1.5px solid var(--outline);
  border-radius: 6px 8px 4px 6px / 4px 6px 8px 4px;
  padding: 24px;
  transition: all 0.2s ease-out;
}
.metric-card:hover {
  transform: translate(-4px, -4px);
  box-shadow: 4px 4px 0 0 var(--ink-black);
}
.metric-card.manga-card-primary:hover {
  box-shadow: 4px 4px 0 0 var(--primary);
}
.metric-card .metric-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}
.metric-value {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--on-surface);
}
.metric-label {
  color: var(--on-surface-variant);
  font-size: 16px;
  margin-top: 4px;
}

.stock-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--outline-variant);
}
.stock-item:last-child { border-bottom: none; }
.stock-up { color: #e53935; }
.stock-down { color: #43a047; }

.admin-section {
  background: var(--surface-container-lowest);
  border: 1.5px solid var(--outline);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}
.admin-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1.5px dashed var(--outline);
}
.upload-zone {
  border: 2px dashed var(--outline);
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--on-surface-variant);
}
.upload-zone:hover {
  border-color: var(--primary);
  background: var(--primary-fixed);
  color: var(--primary);
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp 0.4s ease-out; }
.page-transition { animation: fadeInUp 0.3s ease-out; }

.manga-chip.active {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
}

/* === Auth page — Minimalist Manga (Stitch) === */
.auth-body {
  position: relative;
  overflow: auto;
  min-height: 100%;
  background: var(--background);
  font-family: 'Hanken Grotesk', 'PingFang SC', sans-serif;
}

.auth-bg-layer {
  position: fixed;
  inset: 0;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
  background-color: var(--secondary-container);
  background-image: radial-gradient(var(--outline-variant) 12%, transparent 13%);
  background-size: 10px 10px;
  transform: rotate(0deg);
}

.cute-auth-stickers {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  transition: transform 0.35s ease-out;
}

.auth-leaving .auth-stage {
  animation: authLeave 0.45s ease-in forwards;
}
.auth-leaving .cute-auth-stickers {
  animation: authLeaveStickers 0.45s ease-in forwards;
}
@keyframes authLeave {
  to { opacity: 0; transform: translateY(-18px) scale(0.98); }
}
@keyframes authLeaveStickers {
  to { opacity: 0; transform: scale(1.04); }
}

.auth-shell {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

.auth-stage {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  position: relative;
  z-index: 2;
  isolation: isolate;
}

.auth-stage--enter .auth-hero {
  animation: authHeroIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.auth-stage--enter .auth-panel--enter {
  animation: authPanelIn 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.18s both;
}
@keyframes authHeroIn {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
@keyframes authPanelIn {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: none; }
}

.auth-hero {
  text-align: center;
}

.auth-logo-mark {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 1.5px solid var(--outline);
  background: var(--surface-container-lowest);
  box-shadow: 4px 4px 0 0 var(--ink-black);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-logo-mark--pulse {
  animation: authLogoPulse 3.2s ease-in-out infinite;
}
@keyframes authLogoPulse {
  0%, 100% { transform: translateY(0) scale(1); box-shadow: 4px 4px 0 0 var(--ink-black); }
  50% { transform: translateY(-4px) scale(1.03); box-shadow: 5px 7px 0 0 var(--ink-black); }
}

.auth-logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.auth-brand-title {
  font-family: 'Bricolage Grotesque', 'PingFang SC', sans-serif;
  font-size: clamp(40px, 8vw, 56px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--primary);
  margin: 0 0 8px;
}

.auth-brand-sub {
  color: var(--on-surface-variant);
  margin-bottom: 12px;
}

.auth-lead {
  margin: 0;
  max-width: 28ch;
}

.auth-panel {
  width: 100%;
  padding: 28px 24px 32px;
  background: var(--surface-container-lowest);
  box-shadow: 4px 4px 0 0 var(--ink-black);
}

.auth-panel:hover {
  transform: none;
  box-shadow: 4px 4px 0 0 var(--ink-black);
}

.auth-tabs {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: none;
}

.auth-tab {
  min-width: 96px;
  border: 1.5px solid var(--outline);
  background: var(--surface-container-low);
  color: var(--on-surface-variant);
  cursor: pointer;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 8px 18px;
  border-radius: 9999px;
  transition: all 0.2s;
}

.auth-tab:hover {
  transform: translate(-2px, -2px);
  box-shadow: 3px 3px 0 0 var(--ink-black);
}

.auth-tab.active {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
  box-shadow: 3px 3px 0 0 var(--ink-black);
}

.auth-field {
  margin-bottom: 16px;
}

.auth-field label {
  display: block;
  color: var(--on-surface-variant);
  margin-bottom: 8px;
}

.auth-input-wrap {
  position: relative;
}

.auth-input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--outline);
  pointer-events: none;
}

.auth-input-wrap .manga-input {
  padding-left: 42px;
  width: 100%;
  border-radius: 6px 8px 4px 6px / 4px 6px 8px 4px;
}

.auth-hint {
  color: var(--outline);
  margin: 4px 0 16px;
  text-transform: none;
  letter-spacing: 0.02em;
}

.auth-error {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 13px;
  color: var(--on-error-container);
  background: var(--error-container);
  border: 1.5px solid var(--error);
  border-radius: 6px 8px 4px 6px / 4px 6px 8px 4px;
  padding: 10px 12px;
  margin-bottom: 14px;
}

.auth-submit {
  width: 100%;
  justify-content: center;
  padding: 12px 24px;
  font-size: 13px;
}

.topbar-user-name {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: var(--on-surface-variant);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .topbar-user-name { display: none; }
}

/* === Right Cat Panel（右侧猫窝面板） === */
:root {
  --cat-panel-width: 260px;
}

.cat-panel {
  width: var(--cat-panel-width);
  height: 100%;
  max-height: 100vh;
  position: fixed;
  right: 0;
  top: 0;
  background: var(--surface);
  border-left: 1.5px solid var(--outline);
  display: flex;
  flex-direction: column;
  padding: var(--gutter);
  padding-top: 16px;
  z-index: 50;
  overflow-y: auto;
  overflow-x: hidden;
}

.cat-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1.5px dashed var(--outline);
  flex-shrink: 0;
}

.cat-panel-star {
  font-size: 18px;
  color: var(--primary);
  line-height: 1;
}

.cat-panel-title {
  font-family: 'Bricolage Grotesque', 'PingFang SC', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--on-surface);
}

/* === Sidebar Cat Nest === */
.cat-buddy { display: none; }

.sidebar-cat-stage {
  flex-shrink: 0;
  height: 168px;
  min-height: 168px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  background: transparent;
  border: none;
  border-radius: 10px;
  margin-bottom: 10px;
  overflow: hidden;
  cursor: pointer;
}

.sidebar-cat-stage.is-nest .sidebar-cat-nest-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  opacity: 1;
  filter: none;
  pointer-events: none;
  user-select: none;
  image-rendering: auto;
  z-index: 0;
  border-radius: inherit;
}

.sidebar-cat-stage.is-nest .cat-buddy-bubble {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  margin: 0;
}

.sidebar-cat-stage.is-nest .sidebar-cat-nest-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  width: 100%;
  margin: 0;
  padding: 18px 10px 8px;
  background: linear-gradient(to top, rgba(255, 248, 242, 0.88) 35%, rgba(255, 248, 242, 0));
  backdrop-filter: none;
  box-sizing: border-box;
}

.nest-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 8px;
}

.nest-pick-item {
  appearance: none;
  border: 1.5px solid var(--ink-black);
  border-radius: 8px;
  background: var(--surface-container-lowest);
  box-shadow: 2px 2px 0 0 var(--ink-black);
  padding: 8px 6px 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: transform 0.12s ease, background 0.12s ease;
}

.nest-pick-item:hover {
  transform: translate(-1px, -1px);
  background: var(--secondary-container);
}

.nest-pick-item.is-active {
  background: var(--primary-container);
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.nest-pick-item img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  pointer-events: none;
}

.nest-pick-item span {
  font-size: 11px;
  color: var(--on-surface);
  line-height: 1.2;
}

.manga-dialog:has(.nest-picker) {
  max-width: min(420px, 94vw);
}


.sidebar-cat-nest-hint {
  margin: 0;
  padding: 0 10px 8px;
  text-align: center;
  color: var(--on-surface-variant);
}

.sidebar-cat-stage canvas {
  display: none;
}

.cat-buddy-bubble {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  max-width: 90%;
  font-size: 11px;
  line-height: 1.35;
  color: var(--on-surface);
  background: var(--surface-container-lowest);
  border: 1.5px solid var(--outline);
  border-radius: 10px 10px 10px 4px;
  padding: 6px 8px;
  box-shadow: 2px 2px 0 0 var(--ink-black);
  z-index: 2;
}

/* === 全页活体猫层 === */
.page-cat-layer {
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
  overflow: hidden;
}

#page-cat-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.page-cat-cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 9001;
  font-size: 22px;
  line-height: 1;
  pointer-events: none;
  filter: drop-shadow(1px 1px 0 rgba(26,28,28,0.25));
  will-change: transform;
}

body.page-cat-toy-cursor {
  cursor: none !important;
}

.page-cat-float-bubble {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 9002;
  min-width: 80px;
  max-width: 160px;
  padding: 6px 10px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--on-surface);
  background: var(--surface-container-lowest);
  border: 1.5px solid var(--outline);
  border-radius: 10px 10px 10px 4px;
  box-shadow: 2px 2px 0 0 var(--ink-black);
  pointer-events: none;
  will-change: transform;
}

.sidebar-cat-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 14px;
  row-gap: 8px;
  margin-bottom: 10px;
  font-size: 12px;
  align-items: start;
}

.sidebar-cat-meta > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sidebar-cat-meta .label-sm {
  display: block;
  color: var(--outline);
  margin-bottom: 0;
  line-height: 1.2;
  text-transform: none;
}

.sidebar-cat-meta strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-cat-bars { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }

.cat-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--on-surface-variant);
}

.cat-bar > span { width: 28px; flex-shrink: 0; }

.cat-bar > i {
  display: block;
  height: 8px;
  width: 0%;
  border-radius: 999px;
  background: var(--primary);
  border: 1px solid var(--ink-black);
  transition: width 0.35s ease;
  flex: 1;
  max-width: 100%;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25);
}

.cat-bar:last-child > i { background: var(--primary-container); }

.sidebar-cat-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.sidebar-cat-actions .btn-capsule-primary,
.sidebar-cat-actions .btn-capsule-secondary {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  font-size: 11px;
}

.sidebar-cat-hint {
  color: var(--outline);
  text-transform: none;
  letter-spacing: 0.02em;
  line-height: 1.4;
  margin-bottom: 4px;
}

@media (max-width: 720px) {
  .sidebar-cat-stage { min-height: 140px; }
  .cat-panel { width: 200px; }
  :root { --cat-panel-width: 200px; }
}


.page-cat-anim {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 9000;
  width: 112px;
  height: 112px;
  object-fit: contain;
  pointer-events: none;
  will-change: transform;
  image-rendering: auto;
  transform-origin: 50% 70%;
}

.mobile-menu-btn,
.mobile-page-title-wrap,
.mobile-drawer,
.mobile-drawer-backdrop {
  display: none;
}

.mobile-page-title-wrap {
  min-width: 0;
}

.mobile-page-eyebrow {
  color: var(--outline);
  text-transform: none;
  margin-bottom: 2px;
}

.mobile-page-title {
  font-family: 'Bricolage Grotesque', 'PingFang SC', sans-serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 28, 28, 0.42);
  backdrop-filter: blur(3px);
  z-index: 9500;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.mobile-drawer-backdrop.show {
  opacity: 1;
}

.mobile-drawer {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(88vw, 360px);
  background: var(--surface-container-lowest);
  border-right: 1.5px solid var(--outline);
  box-shadow: 10px 0 0 0 var(--ink-black);
  z-index: 9501;
  transform: translateX(-104%);
  transition: transform 0.22s ease;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px 16px 18px;
  overflow-y: auto;
}

.mobile-drawer.open {
  transform: translateX(0);
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mobile-drawer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mobile-drawer-logo {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.mobile-drawer-cta {
  width: 100%;
}

.mobile-drawer-nav,
.mobile-drawer-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-drawer-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1.5px dashed var(--outline);
}

.mobile-drawer-extra {
  display: none;
}

.mobile-nav-item {
  justify-content: flex-start;
  width: 100%;
  text-align: left;
}

.mobile-nav-item span:last-child {
  flex: 1;
}

body.mobile-drawer-open {
  overflow: hidden;
}

@media (max-width: 1024px) {
  html,
  body {
    overflow: auto;
    max-height: none;
  }

  .app-layout {
    min-height: 100vh;
  }

  .sidebar {
    display: none;
  }

  .mobile-menu-btn,
  .mobile-page-title-wrap,
  .mobile-drawer,
  .mobile-drawer-backdrop {
    display: flex;
  }

  .mobile-drawer.hidden,
  .mobile-drawer-backdrop.hidden {
    display: none;
  }

  .cat-panel {
    display: none;
  }

  .mobile-drawer-extra {
    display: block;
    margin-bottom: 12px;
  }

  .mobile-drawer-extra .cat-panel {
    display: block;
    position: static;
    width: 100%;
    height: auto;
    min-height: 0;
    border-left: none;
    box-shadow: none;
    padding: 0;
    background: transparent;
  }

  .mobile-drawer-extra .cat-panel-header {
    display: flex;
    margin-bottom: 10px;
  }

  .mobile-drawer-extra .sidebar-cat-stage {
    height: 148px;
    min-height: 148px;
  }

  .main-area {
    margin-left: 0;
    margin-right: 0;
    min-height: 100vh;
    max-height: none;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 120;
    padding: 0 14px;
    gap: 12px;
  }

  .topbar-left,
  .topbar-right {
    min-width: 0;
    gap: 10px;
  }

  .topbar-left {
    flex: 1;
  }

  .topbar-search-wrap {
    flex: 1;
    min-width: 0;
  }

  .topbar-search {
    width: 100%;
    min-width: 0;
  }

  .topbar-user-name,
  .topbar-live-btn {
    display: none !important;
  }

  .content-area {
    padding: 16px;
    overflow-x: hidden;
    overflow-y: visible;
  }

  .content-area::before {
    width: 220px;
    height: 220px;
    opacity: 0.22;
  }

  .content-inner {
    max-width: 100%;
  }

  .content-area.is-fullbleed {
    overflow: visible;
  }

  .content-area.is-fullbleed .content-inner {
    overflow: visible;
  }

  .content-area.is-fullbleed .content-inner > .create-page,
  .content-area.is-fullbleed .content-inner > .chat-page,
  .content-area.is-fullbleed .content-inner > .visual-page {
    max-height: none;
    min-height: auto;
  }

  .create-page,
  .chat-page,
  .visual-page {
    min-height: calc(100vh - var(--topbar-height));
  }

  .create-panes,
  .visual-body {
    flex-direction: column;
  }

  .create-pane,
  .create-pane-center,
  .chat-main-pane,
  .visual-controls,
  .visual-gallery {
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  .create-pane-center {
    min-height: 52vh;
  }

  .create-panes {
    gap: 12px;
    padding: 12px;
  }

  .create-pane-left,
  .create-pane-right {
    display: flex;
    width: 100%;
    min-width: 0;
    min-height: 0;
    border-radius: 14px;
  }

  .create-pane-center { order: 1; }
  .create-pane-left { order: 2; }
  .create-pane-right { order: 3; }

  .create-toolbar {
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 16px;
  }

  .create-toolbar > div {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .chat-page {
    flex-direction: column;
  }

  .chat-history-pane {
    display: flex;
    width: 100%;
    min-width: 0;
    max-height: 220px;
    border-right: none;
    border-bottom: 1.5px solid var(--outline);
    order: 2;
  }

  .chat-main-pane { order: 1; }

  .chat-messages {
    padding: 16px;
  }

  .chat-input-area {
    padding: 12px;
  }

  .chat-quick-tags {
    gap: 6px;
  }

  .visual-controls {
    width: 100%;
    max-height: none;
  }

  .visual-gallery {
    min-height: auto;
  }

  .metric-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .hot-column {
    min-height: 0;
    max-height: none;
    height: auto;
  }

  .manga-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
  }

  .manga-table thead,
  .manga-table tbody,
  .manga-table tr {
    width: max-content;
    min-width: 100%;
  }
}

@media (max-width: 768px) {
  :root {
    --topbar-height: 60px;
    --gutter: 14px;
  }

  .topbar {
    padding: 0 12px;
  }

  .topbar-search-wrap {
    display: none;
  }

  .topbar-right {
    gap: 6px;
  }

  .topbar-icon-btn {
    padding: 6px;
  }

  .content-area {
    padding: 12px;
  }

  .content-area.is-fullbleed {
    padding: 0;
  }

  .create-tabs-bar,
  .visual-page > div:first-child {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  .create-tabs-bar > div,
  #visual-modes {
    flex-wrap: wrap;
  }

  .create-tab-btn,
  .visual-mode-btn {
    flex: 1 1 calc(50% - 6px);
  }

  .create-pane-center > div:first-child {
    padding: 18px 16px !important;
  }

  .create-panes {
    padding: 10px;
    gap: 10px;
  }

  .create-pane-left,
  .create-pane-right {
    max-height: 260px;
  }

  .create-editor-title {
    font-size: 24px;
  }

  .create-editor-area {
    min-height: 44vh;
  }

  .chat-messages {
    padding: 14px 12px;
  }

  .chat-history-pane {
    max-height: 180px;
  }

  .chat-input-wrap {
    flex-direction: column;
    align-items: stretch;
  }

  .chat-send-btn {
    width: 100%;
    border-radius: 999px;
    min-height: 44px;
  }

  .visual-body,
  .admin-section,
  .hot-column,
  .sketchy-card {
    gap: 14px;
  }

  #fortune-output {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  #data-bento .grid[style*='repeat(3,1fr)'],
  #data-bento .grid[style*='repeat(3, 1fr)'] {
    grid-template-columns: 1fr !important;
  }

  .admin-section-header,
  .flex.items-center.justify-between,
  .flex.justify-between.items-end {
    flex-wrap: wrap;
    gap: 10px;
  }

  .page-cat-layer,
  .page-cat-anim,
  .page-cat-float-bubble,
  .page-cat-cursor {
    display: none !important;
  }

  #module-grid,
  #hot-grid,
  #publish-layout,
  #data-bento,
  #fortune-bento {
    gap: 14px !important;
  }

  #data-bento > div:first-child > .grid:first-child {
    grid-template-columns: 1fr !important;
  }

  #fortune-output {
    gap: 10px !important;
  }

  #fortune-daily {
    gap: 18px !important;
    padding: 18px !important;
  }

  #fortune-daily .display-lg {
    font-size: 22px !important;
  }

  #publish-layout .sketchy-card,
  #data-bento .sketchy-card,
  #fortune-bento .sketchy-card,
  #hot-grid .hot-column,
  #hot-grid .hot-inspire-card,
  .admin-section {
    padding: 16px !important;
  }

  #publish-layout .flex.justify-between.items-center,
  #hot-grid .flex.items-center.justify-between,
  #fortune-bento .flex.justify-between.items-center,
  .admin-section .admin-section-header {
    align-items: flex-start;
  }

  #douyin-qrcode-img {
    max-width: 100% !important;
    width: min(220px, 100%);
  }

  #publish-btn {
    font-size: 20px !important;
    padding: 14px !important;
  }

  #hot-saved-section {
    padding-bottom: 18px !important;
  }

  .hot-detail-card {
    width: min(94vw, 540px) !important;
    max-height: 82vh;
    overflow-y: auto;
  }

  #data-bento .sketchy-card[style*='height:400px'] {
    height: auto !important;
    min-height: 320px;
  }

  #trend-chart {
    min-height: 220px;
  }

  #stock-list {
    overflow-x: auto;
  }

  #fortune-bento form.flex {
    flex-direction: column;
    align-items: stretch !important;
    gap: 14px !important;
  }

  #fortune-bento form.flex > div,
  #fortune-bento form.flex > button {
    width: 100%;
  }

  .illustration-grid {
    grid-template-columns: 1fr !important;
  }

  #user-table,
  #content-stats-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}


/* === Cute stickers (global) === */
.cute-ico {
  width: 1.15em;
  height: 1.15em;
  object-fit: contain;
  display: inline-block;
  vertical-align: -0.18em;
  flex-shrink: 0;
  pointer-events: none;
  user-select: none;
}

.cute-ico.lg { width: 28px; height: 28px; }
.cute-ico.xl { width: 40px; height: 40px; }

.cute-face {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--ink-black);
  background: var(--primary-fixed) url('../assets/cute/cat-expressions.png?v=3') no-repeat;
  background-size: 800% 100%;
  background-position: 0% 50%;
  display: inline-block;
  flex-shrink: 0;
  box-shadow: 2px 2px 0 0 var(--ink-black);
}

.cute-face--happy { background-position: 0% 50%; }
.cute-face--thinking { background-position: 14.2857% 50%; }
.cute-face--sleepy { background-position: 28.5714% 50%; }
.cute-face--excited { background-position: 42.8571% 50%; }
.cute-face--eating { background-position: 57.1429% 50%; }
.cute-face--love { background-position: 71.4286% 50%; }
.cute-face--surprised { background-position: 85.7143% 50%; }
.cute-face--proud { background-position: 100% 50%; }

.cute-decorated { position: relative; }
.cute-deco {
  position: absolute;
  width: 28px;
  height: 28px;
  object-fit: contain;
  pointer-events: none;
  z-index: 2;
  filter: drop-shadow(1px 1px 0 rgba(0,0,0,0.12));
}
.cute-deco--tr { top: -8px; right: 10px; }
.cute-deco--tl { top: -8px; left: 10px; }
.cute-deco--br { bottom: 6px; right: 8px; width: 22px; height: 22px; opacity: 0.85; }
.cute-deco--bl { bottom: 6px; left: 8px; width: 22px; height: 22px; opacity: 0.85; }

.manga-toast.has-cute-face { align-items: center; }
.manga-toast-face {
  width: 34px;
  height: 34px;
  margin-right: 2px;
}

.manga-dialog-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.manga-dialog-face {
  width: 32px;
  height: 32px;
}
.manga-dialog-accent.is-cute {
  background: transparent;
  border: none;
  box-shadow: none;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.manga-dialog-accent.is-cute::after { display: none; }
.manga-dialog-accent-ico {
  width: 36px !important;
  height: 36px !important;
}

.cat-panel-star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  line-height: 1;
}
.cat-panel-star-ico {
  width: 26px !important;
  height: 26px !important;
}

.sidebar-cat-stage.cute-decorated .cute-deco--br {
  bottom: 10px;
  right: 10px;
}

/* === Global cute stickers (behind content, never block UI) === */
.cute-page-stickers {
  position: absolute;
  inset: 0;
  pointer-events: none !important;
  z-index: 0;
  overflow: hidden;
}

.cute-page-stickers * {
  pointer-events: none !important;
}

.cute-sticker {
  position: absolute;
  object-fit: contain;
  pointer-events: none !important;
  user-select: none;
  opacity: 0.55;
  filter: drop-shadow(1px 1px 0 rgba(26, 28, 28, 0.1));
  will-change: transform;
}

.cute-sticker-corner {
  transform: translate(0, 0) rotate(var(--cute-rot, 0deg));
}
.cute-sticker-corner--tr { top: 10px; right: 10px; left: auto; }
.cute-sticker-corner--tl { top: 10px; left: 10px; right: auto; }
.cute-sticker-corner--br { bottom: 14px; right: 10px; left: auto; top: auto; }
.cute-sticker-corner--bl { bottom: 14px; left: 10px; right: auto; top: auto; }

.cute-sticker--sm { width: 24px; height: 24px; }
.cute-sticker--md { width: 34px; height: 34px; }
.cute-sticker--lg { width: 44px; height: 44px; }

.cute-sticker--still { animation: none; }

.cute-sticker--float {
  animation: cuteFloat 4.8s ease-in-out infinite;
}
.cute-sticker--bob {
  animation: cuteBob 3.6s ease-in-out infinite;
}
.cute-sticker--wiggle {
  animation: cuteWiggle 5.2s ease-in-out infinite;
}
.cute-sticker--spinsoft {
  animation: cuteSpinSoft 7s ease-in-out infinite;
}

.cute-sticker-corner.cute-sticker--float {
  animation-name: cuteCornerFloat;
}
.cute-sticker-corner.cute-sticker--bob {
  animation-name: cuteCornerBob;
}
.cute-sticker-corner.cute-sticker--wiggle {
  animation-name: cuteCornerWiggle;
}
.cute-sticker-corner.cute-sticker--spinsoft {
  animation-name: cuteCornerSpin;
}

@keyframes cuteFloat {
  0%, 100% { transform: translate(-50%, -50%) translateY(0) rotate(var(--cute-rot, 0deg)); }
  50% { transform: translate(-50%, -50%) translateY(-8px) rotate(var(--cute-rot, 0deg)); }
}
@keyframes cuteBob {
  0%, 100% { transform: translate(-50%, -50%) translateY(0) scale(1) rotate(var(--cute-rot, 0deg)); }
  50% { transform: translate(-50%, -50%) translateY(-5px) scale(1.03) rotate(var(--cute-rot, 0deg)); }
}
@keyframes cuteWiggle {
  0%, 100% { transform: translate(-50%, -50%) rotate(var(--cute-rot, 0deg)); }
  33% { transform: translate(-50%, -50%) rotate(calc(var(--cute-rot, 0deg) + 5deg)); }
  66% { transform: translate(-50%, -50%) rotate(calc(var(--cute-rot, 0deg) - 4deg)); }
}
@keyframes cuteSpinSoft {
  0%, 100% { transform: translate(-50%, -50%) rotate(var(--cute-rot, 0deg)); }
  50% { transform: translate(-50%, -50%) rotate(calc(var(--cute-rot, 0deg) + 12deg)); }
}
@keyframes cuteCornerFloat {
  0%, 100% { transform: translateY(0) rotate(var(--cute-rot, 0deg)); }
  50% { transform: translateY(-6px) rotate(var(--cute-rot, 0deg)); }
}
@keyframes cuteCornerBob {
  0%, 100% { transform: translateY(0) scale(1) rotate(var(--cute-rot, 0deg)); }
  50% { transform: translateY(-4px) scale(1.03) rotate(var(--cute-rot, 0deg)); }
}
@keyframes cuteCornerWiggle {
  0%, 100% { transform: rotate(var(--cute-rot, 0deg)); }
  33% { transform: rotate(calc(var(--cute-rot, 0deg) + 5deg)); }
  66% { transform: rotate(calc(var(--cute-rot, 0deg) - 4deg)); }
}
@keyframes cuteCornerSpin {
  0%, 100% { transform: rotate(var(--cute-rot, 0deg)); }
  50% { transform: rotate(calc(var(--cute-rot, 0deg) + 12deg)); }
}

.cute-auth-stickers {
  pointer-events: none !important;
  z-index: 1;
}
.cute-auth-stickers * {
  pointer-events: none !important;
}
.auth-shell {
  position: relative;
  z-index: 2;
}

.cute-auth-stickers .cute-sticker {
  opacity: 0;
  animation: cuteAuthPop 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.cute-auth-stickers.is-ready .cute-sticker--float {
  opacity: 0.7;
  animation: cuteFloat 4.8s ease-in-out infinite;
}
.cute-auth-stickers.is-ready .cute-sticker--bob {
  opacity: 0.7;
  animation: cuteBob 3.6s ease-in-out infinite;
}
.cute-auth-stickers.is-ready .cute-sticker--wiggle {
  opacity: 0.7;
  animation: cuteWiggle 5.2s ease-in-out infinite;
}
.cute-auth-stickers.is-ready .cute-sticker--spinsoft {
  opacity: 0.7;
  animation: cuteSpinSoft 7s ease-in-out infinite;
}
.cute-auth-stickers.is-ready .cute-sticker--still {
  opacity: 0.65;
  animation: none;
}
@keyframes cuteAuthPop {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.6) rotate(var(--cute-rot, 0deg)); }
  to { opacity: 0.7; transform: translate(-50%, -50%) scale(1) rotate(var(--cute-rot, 0deg)); }
}

.module-cute-ico {
  width: 28px !important;
  height: 28px !important;
  object-fit: contain;
  pointer-events: none;
}

.cute-deco {
  pointer-events: none !important;
}

@media (max-width: 900px) {
  .cute-page-stickers { display: none; }
}

@media (max-width: 720px) {
  .cute-auth-stickers .cute-sticker--md,
  .cute-auth-stickers .cute-sticker--lg { width: 28px; height: 28px; }
  .cute-auth-stickers .cute-sticker:nth-child(n+4) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .cute-sticker,
  .auth-logo-mark--pulse,
  .auth-stage--enter .auth-hero,
  .auth-stage--enter .auth-panel--enter,
  .cute-auth-stickers .cute-sticker {
    animation: none !important;
    opacity: 0.55;
  }
  .cute-auth-stickers { transition: none; }
}


