/* ================================================================== */
/* 都是作家 · 设计系统                                                  */
/* 文学纸感：暖纸、墨色、樱花粉、细线、衬线标题                          */
/* ================================================================== */

:root {
  --paper: #f5f1e7;
  --paper-2: #faf7f0;
  --card: #fffdf8;
  --card-2: #fbf8f1;
  --ink: #2b2925;
  --ink-2: #57534b;
  --ink-3: #8b8578;
  --line: #e6dfd1;
  --line-2: #d6cdbc;
  --sakura: #d98c95;
  --sakura-soft: #f7e4e5;
  --sakura-deep: #bf6f79;
  --blue: #54677a;
  --blue-soft: #e3e9ee;
  --gold: #b48a4c;
  --gold-soft: #f4ead7;
  --green: #5f7d68;
  --green-soft: #e4eee6;
  --red: #a85050;
  --red-soft: #f6e3e3;
  --shadow: 0 1px 2px rgba(66, 54, 35, 0.04), 0 10px 30px rgba(66, 54, 35, 0.06);
  --shadow-lg: 0 2px 6px rgba(66, 54, 35, 0.06), 0 24px 60px rgba(66, 54, 35, 0.1);
  --serif: "Songti SC", "Noto Serif SC", "STSong", "SimSun", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui,
    -apple-system, sans-serif;
  --r: 14px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1200px 700px at 12% -10%, #fffdf6 0%, transparent 60%),
    radial-gradient(900px 600px at 100% 0%, #f8eee9 0%, transparent 55%),
    radial-gradient(700px 500px at 50% 120%, #f1ede0 0%, transparent 60%);
}

button {
  font-family: inherit;
  color: inherit;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
}

h1,
h2,
h3,
h4 {
  font-family: var(--serif);
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.01em;
}

p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: var(--sakura-soft);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--sakura);
  outline-offset: 2px;
  border-radius: 6px;
}

.icon {
  display: inline-block;
  flex: none;
  vertical-align: -2px;
}

.muted {
  color: var(--ink-3);
}

.small {
  font-size: 12.5px;
}

.mb {
  margin-bottom: 10px;
}

.mt {
  margin-top: 16px;
}

.mono {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

.rot {
  transform: rotate(180deg);
}

/* ------------------------------------------------------------------ */
/* 按钮                                                                */
/* ------------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 17px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.18s var(--ease);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-primary {
  background: var(--ink);
  color: #fdfaf3;
  border-color: var(--ink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset;
}

.btn-primary:hover:not(:disabled) {
  background: #1e1c19;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(43, 41, 37, 0.18);
}

.btn-outline {
  background: var(--card);
  border-color: var(--line-2);
  color: var(--ink);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--ink-2);
  background: #fff;
}

.btn-quiet {
  background: transparent;
  color: var(--ink-2);
}

.btn-quiet:hover:not(:disabled) {
  background: rgba(43, 41, 37, 0.06);
  color: var(--ink);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-3);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--ink);
  background: rgba(43, 41, 37, 0.05);
}

.btn-danger {
  background: var(--card);
  border-color: #e7c4c4;
  color: var(--red);
}

.btn-danger:hover:not(:disabled) {
  background: var(--red-soft);
  border-color: #d9a8a8;
}

.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 12.5px;
  border-radius: 8px;
}

.btn-block {
  width: 100%;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--ink-3);
  font-size: 12.5px;
  transition: color 0.15s;
}

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

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--ink-3);
  transition: all 0.15s;
  flex: none;
}

.icon-btn:hover {
  background: rgba(43, 41, 37, 0.06);
  color: var(--ink);
}

/* ------------------------------------------------------------------ */
/* 标签 / 进度 / 圆环                                                   */
/* ------------------------------------------------------------------ */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  line-height: 1.6;
  white-space: nowrap;
  border: 1px solid transparent;
}

.tag-gray {
  background: #f1ede4;
  color: var(--ink-3);
  border-color: #e8e1d4;
}

.tag-sakura {
  background: var(--sakura-soft);
  color: var(--sakura-deep);
  border-color: #efd0d2;
}

.tag-blue {
  background: var(--blue-soft);
  color: var(--blue);
  border-color: #d3dde5;
}

.tag-gold {
  background: var(--gold-soft);
  color: #8f6a30;
  border-color: #ecdcbe;
}

.tag-green {
  background: var(--green-soft);
  color: var(--green);
  border-color: #d5e4d8;
}

.progress {
  height: 6px;
  border-radius: 999px;
  background: #ece6da;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--sakura), #e3b0a8);
  transition: width 0.5s var(--ease);
}

.ring {
  position: relative;
  display: grid;
  place-items: center;
}

.ring svg {
  position: absolute;
  inset: 0;
}

.ring-text {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
}

.ring-text b {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
}

.ring-text span {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 3px;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(140deg, #f0d9d5, #dcc5bb);
  color: #694f47;
  font-family: var(--serif);
  font-weight: 600;
  flex: none;
}

/* ------------------------------------------------------------------ */
/* 表单                                                                */
/* ------------------------------------------------------------------ */

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  letter-spacing: 0.02em;
}

.req {
  color: var(--sakura);
  font-style: normal;
  margin-left: 3px;
}

.hint {
  font-size: 11.8px;
  color: var(--ink-3);
  line-height: 1.55;
}

.input,
.editable {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 9px;
  padding: 10px 13px;
  font-size: 13.5px;
  font-family: var(--sans);
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  line-height: 1.6;
}

.input::placeholder,
.editable::placeholder {
  color: #b3ab9b;
}

.input:focus,
.editable:focus {
  outline: none;
  border-color: var(--sakura);
  box-shadow: 0 0 0 3px rgba(217, 140, 149, 0.13);
  background: #fff;
}

.textarea {
  resize: vertical;
  min-height: 76px;
}

.input-sm {
  padding: 7px 10px;
  font-size: 12.5px;
  border-radius: 8px;
}

.readonly {
  background: #f3eee3;
  color: var(--ink-3);
  display: flex;
  align-items: center;
}

.input-wrap {
  position: relative;
}

.input-wrap .input {
  padding-right: 42px;
}

.input-eye {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--ink-3);
}

.input-eye:hover {
  background: rgba(43, 41, 37, 0.06);
  color: var(--ink);
}

.editable {
  font-family: var(--serif);
  font-size: 14.5px;
  line-height: 1.85;
  resize: vertical;
  background: transparent;
  border-color: transparent;
  padding: 8px 10px;
  margin: -8px -10px;
}

.editable:hover {
  border-color: var(--line);
  background: var(--card);
}

.editable:focus {
  background: #fff;
}

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.form-error {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid #eccbcb;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 12.5px;
}

.seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: #efe9dd;
  border: 1px solid var(--line);
  gap: 2px;
}

.seg-item {
  padding: 6px 15px;
  border-radius: 8px;
  font-size: 12.8px;
  color: var(--ink-2);
  transition: all 0.15s;
}

.seg-item.on {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(66, 54, 35, 0.1);
  font-weight: 500;
}

.weekday-row {
  display: flex;
  gap: 6px;
}

.weekday {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 12.5px;
  color: var(--ink-2);
  transition: all 0.15s;
}

.weekday.on {
  background: var(--ink);
  border-color: var(--ink);
  color: #fdfaf3;
}

.range {
  width: 100%;
  accent-color: var(--sakura);
  height: 34px;
}

/* ------------------------------------------------------------------ */
/* 卡片 / 布局                                                          */
/* ------------------------------------------------------------------ */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}

.card-pad {
  padding: 24px;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.card-head h3 {
  font-size: 16.5px;
}

.card-title {
  font-size: 16px;
  margin-bottom: 14px;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 16px 0;
}

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 34px 32px 80px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  animation: fadeUp 0.4s var(--ease) both;
}

.page-wide {
  max-width: 1240px;
}

.page-mid {
  max-width: 860px;
}

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

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.eyebrow {
  font-size: 11.5px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.page-title {
  font-size: 30px;
  line-height: 1.3;
}

.page-sub {
  margin-top: 8px;
  color: var(--ink-3);
  font-size: 13px;
  max-width: 640px;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.section-title {
  font-size: 16px;
  margin-top: 4px;
}

/* ------------------------------------------------------------------ */
/* 登录 / 注册                                                         */
/* ------------------------------------------------------------------ */

.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}

.auth-art {
  position: relative;
  overflow: hidden;
  padding: 46px 58px;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(800px 500px at 10% 0%, #fffdf8 0%, transparent 55%),
    linear-gradient(160deg, #f8f1e6 0%, #f2e7e0 60%, #eee4d9 100%);
  border-right: 1px solid var(--line);
}

.auth-art::after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -140px;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  border: 1px solid rgba(191, 111, 121, 0.18);
  box-shadow: 0 0 0 60px rgba(191, 111, 121, 0.05),
    0 0 0 140px rgba(191, 111, 121, 0.035);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  position: relative;
  z-index: 2;
}

.brand-btn {
  padding: 4px 6px;
  border-radius: 8px;
}

.brand-btn:hover {
  background: rgba(43, 41, 37, 0.05);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--ink);
  color: #f6e9df;
  box-shadow: 0 2px 6px rgba(43, 41, 37, 0.2);
}

.brand-name {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.brand-beta {
  margin-left: 4px;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--sakura-deep);
  border: 1px solid #e5c3c5;
  border-radius: 999px;
  padding: 1px 8px;
  background: rgba(255, 255, 255, 0.5);
}

.auth-hero {
  margin-top: auto;
  margin-bottom: auto;
  position: relative;
  z-index: 2;
  padding: 40px 0;
}

.auth-hero h1 {
  font-size: clamp(34px, 3.6vw, 46px);
  line-height: 1.42;
  letter-spacing: 0.02em;
  margin: 16px 0 20px;
}

.auth-hero .eyebrow {
  color: var(--sakura-deep);
}

.auth-lead {
  color: var(--ink-2);
  font-size: 14px;
  line-height: 2;
}

.auth-points {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 2;
  margin-bottom: 34px;
}

.auth-points li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-2);
  font-size: 13px;
}

.auth-points .icon {
  color: var(--sakura-deep);
}

.auth-foot {
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  position: relative;
  z-index: 2;
}

.petals {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.petal {
  position: absolute;
  width: 9px;
  height: 7px;
  border-radius: 70% 30% 60% 40%;
  background: rgba(217, 140, 149, 0.35);
  animation: drift 16s linear infinite;
}

.petal-0 { left: 12%; top: -10%; animation-delay: 0s; }
.petal-1 { left: 28%; top: -10%; animation-delay: -3s; transform: scale(0.8); }
.petal-2 { left: 44%; top: -10%; animation-delay: -7s; }
.petal-3 { left: 61%; top: -10%; animation-delay: -2s; transform: scale(0.7); }
.petal-4 { left: 74%; top: -10%; animation-delay: -9s; }
.petal-5 { left: 86%; top: -10%; animation-delay: -5s; transform: scale(1.2); }
.petal-6 { left: 18%; top: -10%; animation-delay: -12s; transform: scale(0.6); }
.petal-7 { left: 52%; top: -10%; animation-delay: -14s; transform: scale(0.9); }
.petal-8 { left: 92%; top: -10%; animation-delay: -6s; transform: scale(0.8); }

@keyframes drift {
  0% {
    transform: translate3d(0, -5vh, 0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translate3d(40px, 108vh, 0) rotate(260deg);
    opacity: 0;
  }
}

.auth-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  gap: 18px;
}

.auth-card {
  width: min(400px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 30px 32px 26px;
  box-shadow: var(--shadow-lg);
}

.auth-tabs {
  display: flex;
  gap: 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}

.auth-tabs button {
  padding: 0 0 12px;
  font-size: 14px;
  color: var(--ink-3);
  position: relative;
  transition: color 0.15s;
}

.auth-tabs button.on {
  color: var(--ink);
  font-weight: 500;
}

.auth-tabs button.on::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--sakura);
}

.auth-card h2 {
  font-size: 24px;
  margin-bottom: 6px;
}

.auth-sub {
  color: var(--ink-3);
  font-size: 12.5px;
  margin-bottom: 22px;
}

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

.auth-form .btn {
  margin-top: 4px;
  height: 42px;
}

.auth-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 16px;
  color: var(--ink-3);
  font-size: 11.5px;
}

.auth-or::before,
.auth-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.auth-note {
  margin-top: 14px;
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.7;
  text-align: center;
}

.auth-legal {
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}

/* ------------------------------------------------------------------ */
/* 独立页外壳                                                           */
/* ------------------------------------------------------------------ */

.shell {
  min-height: 100vh;
}

.topnav {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 62px;
  display: flex;
  align-items: center;
  gap: 34px;
  padding: 0 30px;
  background: rgba(250, 247, 240, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.topnav-links {
  display: flex;
  gap: 4px;
}

.topnav-links button {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink-2);
  transition: all 0.15s;
}

.topnav-links button:hover {
  background: rgba(43, 41, 37, 0.05);
}

.topnav-links button.on {
  color: var(--ink);
  background: rgba(43, 41, 37, 0.07);
  font-weight: 500;
}

.topnav-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.topnav-name {
  font-size: 12.5px;
  color: var(--ink-2);
}

/* 首页 */
.home-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0 6px;
}

.home-title {
  font-size: 34px;
  line-height: 1.3;
}

.home-sub {
  margin-top: 8px;
  color: var(--ink-3);
  font-size: 13px;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow);
}

.stat-num {
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1.2;
}

.stat-label {
  font-size: 12px;
  color: var(--ink-3);
}

.proj-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 4px;
}

.proj-card {
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
  display: flex;
  flex-direction: column;
}

.proj-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.proj-cover {
  position: relative;
  height: 172px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}

.proj-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.9;
}

.tone-0::before {
  background:
    radial-gradient(300px 200px at 85% 10%, #f6dcda 0%, transparent 70%),
    linear-gradient(150deg, #fbf3ec, #f3e4dc);
}

.tone-1::before {
  background:
    radial-gradient(280px 200px at 10% 0%, #dfe6ea 0%, transparent 70%),
    linear-gradient(150deg, #f7f4ec, #e6e9e6);
}

.tone-2::before {
  background:
    radial-gradient(280px 200px at 90% 0%, #f3e6cd 0%, transparent 70%),
    linear-gradient(150deg, #fbf6ea, #efe6d3);
}

.tone-3::before {
  background:
    radial-gradient(280px 200px at 15% 0%, #e5e2ee 0%, transparent 70%),
    linear-gradient(150deg, #f8f4ed, #e9e4dd);
}

.proj-cover > * {
  position: relative;
}

.proj-genre {
  position: absolute;
  top: 18px;
  left: 22px;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  border: 1px solid rgba(107, 99, 85, 0.25);
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
}

.proj-cover h3 {
  font-size: 22px;
  line-height: 1.45;
  max-width: 88%;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

.proj-author {
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-2);
}

.proj-no {
  position: absolute;
  right: 18px;
  bottom: 10px;
  font-family: var(--serif);
  font-size: 54px;
  line-height: 1;
  color: rgba(43, 41, 37, 0.09);
}

.proj-body {
  padding: 16px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

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

.proj-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-3);
}

.proj-new {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 300px;
  border: 1.5px dashed var(--line-2);
  background: transparent;
  box-shadow: none;
  color: var(--ink-2);
  font-size: 14px;
}

.proj-new:hover {
  border-color: var(--sakura);
  background: rgba(255, 253, 248, 0.6);
  box-shadow: none;
}

.proj-new-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--sakura-soft);
  color: var(--sakura-deep);
  margin-bottom: 6px;
}

/* ------------------------------------------------------------------ */
/* 新建作品向导                                                         */
/* ------------------------------------------------------------------ */

.wizard-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wizard-head h1 {
  font-size: 30px;
}

.link-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--ink-3);
  margin-bottom: 6px;
  width: fit-content;
}

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

.wizard-steps {
  display: flex;
  gap: 10px;
}

.wizard-step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.55);
  border: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 12.5px;
}

.wizard-step.on {
  background: var(--card);
  border-color: var(--line-2);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.wizard-step.done {
  color: var(--ink-2);
}

.wizard-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11.5px;
  background: #efe9dd;
  color: var(--ink-3);
  flex: none;
}

.wizard-step.on .wizard-num {
  background: var(--ink);
  color: #fdfaf3;
}

.wizard-step.done .wizard-num {
  background: var(--green-soft);
  color: var(--green);
}

.wizard-card {
  padding: 30px 32px;
}

.wizard-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.plan-preview {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  background: var(--card-2);
}

.plan-preview-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--ink-2);
  margin-bottom: 12px;
}

.plan-preview-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plan-preview-item {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--line);
}

.plan-preview-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* ------------------------------------------------------------------ */
/* 应用外壳（项目内）                                                   */
/* ------------------------------------------------------------------ */

.app {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 18px 14px 16px;
  background: linear-gradient(180deg, #f8f3e9, #f3ede1);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 8px 16px;
  border-radius: 9px;
}

.side-brand:hover {
  background: rgba(43, 41, 37, 0.04);
}

.side-project {
  padding: 12px 12px 16px;
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.7);
  border: 1px solid var(--line);
  margin-bottom: 14px;
}

.side-project-genre {
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}

.side-project-title {
  font-size: 16px;
  line-height: 1.45;
  margin: 5px 0 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.side-project-author {
  font-size: 11.5px;
  color: var(--ink-3);
}

.side-progress {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
}

.side-progress-bar {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: #e8e1d3;
  overflow: hidden;
}

.side-progress-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--sakura);
}

.side-progress-text {
  font-size: 10.5px;
  color: var(--ink-3);
  white-space: nowrap;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 9px;
  color: var(--ink-2);
  font-size: 13px;
  text-align: left;
  transition: all 0.15s;
  line-height: 1.4;
}

.side-link:hover {
  background: rgba(43, 41, 37, 0.05);
  color: var(--ink);
}

.side-link.on {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(66, 54, 35, 0.06);
  font-weight: 500;
}

.side-link .icon {
  color: var(--ink-3);
}

.side-link.on .icon {
  color: var(--sakura-deep);
}

.side-link-label {
  flex: 1;
}

.side-badge {
  font-size: 10.5px;
  color: var(--ink-3);
  background: #efe9dd;
  border-radius: 999px;
  padding: 1px 7px;
}

.side-done {
  color: var(--green);
}

.side-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  background: rgba(250, 247, 240, 0.8);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--ink-3);
}

.crumbs button:hover {
  color: var(--ink);
}

.crumb-strong {
  color: var(--ink-2);
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.save-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--ink-3);
}

.save-state i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(95, 125, 104, 0.14);
}

.content {
  flex: 1;
  min-height: 0;
}

/* ------------------------------------------------------------------ */
/* 总览                                                                */
/* ------------------------------------------------------------------ */

.overview-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 30px 34px;
  background:
    radial-gradient(500px 260px at 92% 0%, #f7e4e5 0%, transparent 65%),
    var(--card);
}

.hero-main h2 {
  font-size: 26px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-dot {
  color: var(--sakura);
  font-weight: 400;
}

.hero-soft {
  font-size: 17px;
  color: var(--ink-3);
  font-weight: 400;
}

.hero-desc {
  margin-top: 10px;
  color: var(--ink-3);
  font-size: 13px;
}

.hero-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.hero-side {
  display: flex;
  align-items: center;
  gap: 26px;
  flex: none;
}

.hero-facts {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hero-facts > div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.hero-facts b {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
}

.hero-facts span {
  font-size: 11.5px;
  color: var(--ink-3);
}

.stage-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stage-card {
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px 20px 20px;
  box-shadow: var(--shadow);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stage-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.stage-card.done {
  background: linear-gradient(160deg, #fffdf8, #f4f7f2);
}

.stage-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.stage-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #efe9dd;
  font-size: 12px;
  color: var(--ink-2);
}

.stage-card.done .stage-num {
  background: var(--green-soft);
  color: var(--green);
}

.stage-state {
  font-size: 10.5px;
  color: var(--ink-3);
  letter-spacing: 0.06em;
}

.stage-state.done {
  color: var(--green);
}

.stage-card h4 {
  font-size: 15.5px;
}

.stage-card p {
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.6;
  min-height: 38px;
}

.stage-meta {
  font-size: 11px;
  color: var(--ink-3);
  border-top: 1px dashed var(--line);
  padding-top: 9px;
  margin-top: 4px;
}

.overview-cols {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 18px;
}

.chapter-mini-list {
  display: flex;
  flex-direction: column;
}

.chapter-mini {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  transition: background 0.15s;
  border-radius: 6px;
}

.chapter-mini:last-child {
  border-bottom: none;
}

.chapter-mini:hover {
  background: rgba(217, 140, 149, 0.05);
}

.chapter-mini-no {
  font-family: var(--serif);
  font-size: 18px;
  color: var(--ink-3);
  width: 30px;
  flex: none;
}

.chapter-mini-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.chapter-mini-main b {
  font-weight: 500;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chapter-mini-main small {
  font-size: 11.5px;
  color: var(--ink-3);
}

.quote {
  margin: 0;
  padding: 14px 16px;
  border-left: 2px solid var(--sakura);
  background: var(--sakura-soft);
  border-radius: 0 10px 10px 0;
  font-family: var(--serif);
  font-size: 13.5px;
  line-height: 1.9;
  color: #6b4a4e;
}

.mini-stats {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
}

.mini-stats > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mini-stats span {
  font-size: 11.5px;
  color: var(--ink-3);
}

.mini-stats b {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 15px;
}

.next-plan {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-2);
}

.next-plan .icon {
  color: var(--sakura-deep);
}

.overview-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.chapter-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.chapter-dot {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 11.5px;
  color: var(--ink-3);
  background: #f1ece1;
  border: 1px solid transparent;
  transition: all 0.15s;
}

.chapter-dot.gray { background: #f1ece1; }
.chapter-dot.blue { background: var(--blue-soft); color: var(--blue); }
.chapter-dot.gold { background: var(--gold-soft); color: #8f6a30; }
.chapter-dot.sakura { background: var(--sakura-soft); color: var(--sakura-deep); }
.chapter-dot.green { background: var(--green-soft); color: var(--green); }

.chapter-dot:hover {
  transform: translateY(-2px);
  border-color: var(--line-2);
}

/* ------------------------------------------------------------------ */
/* 续写圣经                                                            */
/* ------------------------------------------------------------------ */

.bible-hero {
  display: flex;
  align-items: center;
  gap: 26px;
}

.bible-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
}

.bible-check {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--ink-3);
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px 5px 5px;
}

.bible-check.done {
  color: var(--ink-2);
  border-color: #cfe0d3;
  background: #f4f8f4;
}

.bible-check-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #ece5d7;
  font-size: 10.5px;
  color: var(--ink-3);
}

.bible-check.done .bible-check-icon {
  background: var(--green);
  color: #fff;
}

.bible-meter {
  width: 210px;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0;
  overflow-x: auto;
}

.tab {
  padding: 9px 16px 12px;
  font-size: 13px;
  color: var(--ink-3);
  position: relative;
  white-space: nowrap;
  transition: color 0.15s;
}

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

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

.tab.on::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--sakura);
}

.tab-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hint-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.hint-row .muted {
  max-width: 720px;
  font-size: 12.5px;
  line-height: 1.75;
}

.empty-inline {
  text-align: center;
  color: var(--ink-3);
  padding: 34px;
}

.sample-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.sample-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sample-head {
  display: flex;
  gap: 8px;
  align-items: center;
}

.sample-head .input {
  flex: 1;
  font-family: var(--serif);
  letter-spacing: 0.04em;
}

.char-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.char-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.char-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.char-fields {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.char-name {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  border-color: transparent;
  background: transparent;
  padding: 2px 6px;
  margin: -2px -6px;
}

.char-name:hover {
  border-color: var(--line);
  background: var(--card);
}

.char-line {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 8px 0;
  border-top: 1px dashed var(--line);
}

.char-label {
  flex: none;
  width: 78px;
  font-size: 11.5px;
  color: var(--ink-3);
  padding-top: 9px;
  letter-spacing: 0.02em;
}

.char-line .editable {
  flex: 1;
}

.char-line .never {
  background: rgba(217, 140, 149, 0.06);
  border-radius: 8px;
}

.world-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.world-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.world-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.world-title {
  flex: 1;
  font-weight: 500;
  border-color: transparent;
  background: transparent;
  padding: 4px 6px;
  margin: -4px -6px;
}

.world-title:hover {
  border-color: var(--line);
  background: var(--card);
}

.world-cat {
  width: auto;
  flex: none;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

.summary-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 560px;
  overflow-y: auto;
  padding-right: 4px;
}

.summary-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.summary-no {
  flex: none;
  width: 54px;
  font-size: 11.5px;
  color: var(--ink-3);
  padding-top: 9px;
}

.summary-row .editable {
  flex: 1;
}

.fores-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 560px;
  overflow-y: auto;
  padding-right: 4px;
}

.fores-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card-2);
}

.fores-row.done {
  opacity: 0.6;
  background: #f5f8f4;
}

.fores-dot {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  border: 1.5px solid var(--line-2);
  display: grid;
  place-items: center;
  flex: none;
  margin-top: 8px;
  color: #fff;
}

.fores-dot.done {
  background: var(--green);
  border-color: var(--green);
}

.fores-main {
  flex: 1;
  min-width: 0;
}

.fores-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10.8px;
  color: var(--ink-3);
  margin-top: 6px;
  flex-wrap: wrap;
}

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

.callout {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 15px;
  border-radius: 10px;
  background: var(--gold-soft);
  border: 1px solid #ecd9b8;
  color: #7d5f2e;
  font-size: 12.5px;
  line-height: 1.7;
}

.callout .icon {
  margin-top: 2px;
}

.callout.warn {
  background: var(--red-soft);
  border-color: #eccbcb;
  color: #8d4242;
}

.callout.card {
  flex-direction: row;
  align-items: center;
  box-shadow: none;
}

.avoid-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ------------------------------------------------------------------ */
/* 幕与细纲                                                            */
/* ------------------------------------------------------------------ */

.act-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.act-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  background: var(--card-2);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

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

.act-no {
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--sakura-deep);
  font-weight: 600;
}

.act-range {
  font-size: 10.5px;
  color: var(--ink-3);
}

.act-card h4 {
  font-size: 15px;
}

.act-theme {
  font-size: 11.5px;
  color: var(--gold);
  letter-spacing: 0.06em;
}

.act-conflict {
  font-family: var(--serif);
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--ink-2);
  min-height: 44px;
}

.act-beats {
  display: flex;
  gap: 10px;
  font-size: 10.5px;
  color: var(--ink-3);
  border-top: 1px dashed var(--line);
  padding-top: 8px;
}

.act-changes {
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-top: 1px dashed var(--line);
  padding-top: 8px;
}

.act-changes li {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 11px;
  color: var(--ink-3);
  line-height: 1.55;
}

.act-changes b {
  color: var(--ink-2);
  font-weight: 500;
}

.batch-list {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-top: 20px;
}

.batch {
  border-top: 1px dashed var(--line);
  padding-top: 18px;
}

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

.batch-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
}

.batch-no {
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  background: #efe9dd;
  border-radius: 999px;
  padding: 2px 9px;
}

.batch-lock {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-3);
  padding: 6px 0;
}

.outline-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.outline-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  background: var(--card);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s;
}

.outline-card.approved {
  background: linear-gradient(150deg, #fffdf8, #f7faf6);
  border-color: #d3e2d6;
}

.outline-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.outline-no {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
  flex: none;
}

.outline-chars {
  display: flex;
  gap: 6px;
  flex: 1;
  flex-wrap: wrap;
}

.chip {
  font-size: 10.5px;
  padding: 1px 8px;
  border-radius: 999px;
  background: #f2ece0;
  color: var(--ink-2);
}

.outline-actions {
  flex: none;
}

.outline-event {
  font-size: 14.5px;
}

.outline-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.outline-grid p {
  font-size: 12.5px;
  color: var(--ink-2);
  margin-top: 3px;
  line-height: 1.7;
}

.mini-label {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  text-transform: uppercase;
}

.outline-hook {
  border-top: 1px dashed var(--line);
  padding-top: 9px;
}

.outline-hook .editable {
  font-family: var(--serif);
  font-size: 13.5px;
  color: var(--sakura-deep);
}

.banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 13px;
  margin-top: 22px;
}

.banner-ok {
  background: var(--green-soft);
  border: 1px solid #d3e3d6;
  color: #44604c;
}

.banner .btn {
  margin-left: auto;
}

.page-foot-note {
  text-align: center;
  padding: 4px 0 20px;
}

/* ------------------------------------------------------------------ */
/* 章节列表                                                            */
/* ------------------------------------------------------------------ */

.chapter-table {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.chapter-table-head,
.chapter-row {
  display: grid;
  grid-template-columns: 52px minmax(180px, 1fr) 96px 76px 120px 28px;
  gap: 12px;
  align-items: center;
  padding: 0 16px;
}

.chapter-table-head {
  height: 40px;
  background: var(--card-2);
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.06em;
}

.chapter-row {
  height: 62px;
  width: 100%;
  text-align: left;
  border-bottom: 1px solid var(--line);
  transition: background 0.14s;
  background: var(--card);
}

.chapter-row:last-child {
  border-bottom: none;
}

.chapter-row:hover {
  background: #fff;
}

.chapter-row.status-done {
  background: #fbfdf9;
}

.chapter-no {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--ink-3);
}

.chapter-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.chapter-name b {
  font-weight: 500;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chapter-name small {
  font-size: 11.5px;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chapter-words {
  font-size: 12.5px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.chapter-go {
  color: var(--ink-3);
  display: flex;
  justify-content: flex-end;
}

/* ------------------------------------------------------------------ */
/* 写作台                                                              */
/* ------------------------------------------------------------------ */

.studio {
  padding: 20px 28px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: fadeUp 0.35s var(--ease) both;
}

.studio-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.studio-title {
  flex: 1;
  min-width: 0;
}

.studio-title h2 {
  font-size: 22px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.studio-title .eyebrow {
  margin-bottom: 2px;
}

.studio-status {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
}

.studio-count {
  font-size: 12.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.studio-count b {
  color: var(--ink);
  font-size: 15px;
  font-family: var(--serif);
}

.studio-nav {
  display: flex;
  gap: 4px;
  flex: none;
}

.studio-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 372px;
  gap: 18px;
  align-items: start;
}

.studio-editor {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 190px);
  overflow: hidden;
}

.studio-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--card-2);
}

.toolbar-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-2);
}

.toolbar-hint .icon {
  color: var(--sakura-deep);
}

.toolbar-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.manuscript {
  flex: 1;
  width: 100%;
  min-height: 560px;
  border: none;
  outline: none;
  resize: none;
  background: #fffdf8;
  padding: 38px 46px;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 2.05;
  color: #33302a;
  letter-spacing: 0.015em;
}

.manuscript::placeholder {
  color: #b9b1a2;
}

.studio-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: var(--card-2);
}

.word-meter {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 420px;
}

.word-meter .progress {
  flex: 1;
}

.word-meter span {
  font-size: 11.5px;
  color: var(--ink-3);
  white-space: nowrap;
}

.word-meter span.ok {
  color: var(--green);
}

.studio-foot-actions {
  display: flex;
  gap: 8px;
}

.studio-rail {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rail-card {
  padding: 18px;
}

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

.rail-head h4 {
  font-size: 14px;
}

.ai-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  margin-bottom: 8px;
  transition: all 0.16s;
}

.ai-btn:hover:not(:disabled) {
  border-color: var(--sakura);
  background: #fff;
  transform: translateY(-1px);
}

.ai-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ai-btn.primary {
  background: linear-gradient(140deg, #2b2925, #3a362f);
  border-color: #2b2925;
  color: #f8f1e6;
}

.ai-btn.primary .icon {
  color: #e8b6bb;
}

.ai-btn.primary:hover:not(:disabled) {
  background: #1f1d1a;
  border-color: #1f1d1a;
}

.ai-btn .icon {
  color: var(--sakura-deep);
}

.ai-btn span {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.ai-btn b {
  font-size: 13px;
  font-weight: 500;
}

.ai-btn small {
  font-size: 11px;
  opacity: 0.7;
}

.rail-note {
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.7;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.scan-metrics {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 0 12px;
  border-bottom: 1px dashed var(--line);
  margin-bottom: 12px;
}

.scan-metrics span {
  font-size: 11.5px;
  color: var(--ink-3);
}

.scan-metrics b {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--ink);
  margin-right: 2px;
}

.issue-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.issue {
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--card-2);
  border: 1px solid var(--line);
}

.issue.high {
  border-color: #edc9c9;
  background: #fdf4f4;
}

.issue.mid {
  border-color: #ead9b9;
  background: #fdf9ef;
}

.issue-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.issue-head b {
  font-size: 12.5px;
  font-weight: 500;
}

.issue p {
  font-size: 11.8px;
  color: var(--ink-2);
  line-height: 1.7;
}

.issue blockquote {
  margin: 8px 0 0;
  padding: 6px 10px;
  border-left: 2px solid var(--line-2);
  font-family: var(--serif);
  font-size: 12px;
  color: var(--ink-3);
  background: rgba(255, 255, 255, 0.6);
  border-radius: 0 6px 6px 0;
}

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

.ctx-item {
  border-bottom: 1px solid var(--line);
}

.ctx-item:last-child {
  border-bottom: none;
}

.ctx-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
  text-align: left;
  font-size: 12.5px;
}

.ctx-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--gold-soft);
  color: #a37c3c;
  flex: none;
}

.ctx-item.ready .ctx-dot {
  background: var(--green-soft);
  color: var(--green);
}

.ctx-label {
  font-weight: 500;
  flex: none;
}

.ctx-detail {
  margin-left: auto;
  font-size: 10.8px;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 150px;
}

.ctx-body {
  margin: 0 0 10px;
  padding: 10px 12px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: var(--serif);
  font-size: 11.8px;
  line-height: 1.8;
  color: var(--ink-2);
  white-space: pre-wrap;
  max-height: 220px;
  overflow-y: auto;
}

.prompt-pre {
  margin: 0;
  max-height: 52vh;
  overflow-y: auto;
  padding: 18px;
  background: #faf6ec;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 11.8px;
  line-height: 1.85;
  white-space: pre-wrap;
  color: var(--ink-2);
}

.state-editor {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 54vh;
  overflow-y: auto;
}

.state-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--card-2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.state-row > b {
  font-family: var(--serif);
  font-size: 14px;
}

.state-field {
  display: flex;
  align-items: center;
  gap: 10px;
}

.state-field span {
  flex: none;
  width: 92px;
  font-size: 11.5px;
  color: var(--ink-3);
}

.outline-event-text {
  font-family: var(--serif);
  font-size: 13.5px;
  line-height: 1.8;
  margin-bottom: 12px;
}

/* ------------------------------------------------------------------ */
/* 统稿                                                                */
/* ------------------------------------------------------------------ */

.pass-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.pass-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card-2);
  text-align: left;
  transition: all 0.16s;
}

.pass-card:hover {
  border-color: var(--line-2);
  background: #fff;
}

.pass-card.done {
  background: #f5f9f4;
  border-color: #d3e2d6;
}

.pass-check {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #efe9dd;
  color: var(--ink-2);
  flex: none;
}

.pass-card.done .pass-check {
  background: var(--green);
  color: #fff;
}

.pass-num {
  font-family: var(--serif);
  font-size: 13px;
}

.pass-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pass-main b {
  font-size: 13.5px;
  font-weight: 500;
}

.pass-main small {
  font-size: 11.8px;
  color: var(--ink-3);
}

.pass-state {
  font-size: 11.5px;
  color: var(--ink-3);
}

.pass-card.done .pass-state {
  color: var(--green);
}

.health-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.health-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.health-item b {
  font-size: 12.5px;
  font-weight: 500;
}

.hook-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ending-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.ending-row {
  display: flex;
  gap: 10px;
  font-size: 11.8px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--line);
}

.ending-row:last-child {
  border-bottom: none;
}

.ending-no {
  flex: none;
  color: var(--ink-3);
  width: 56px;
}

.ending-text {
  color: var(--ink-2);
  font-family: var(--serif);
  line-height: 1.7;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-table {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.score-row {
  display: grid;
  grid-template-columns: 74px 140px 36px 1fr 82px;
  gap: 12px;
  align-items: center;
  padding: 9px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.score-row:last-child {
  border-bottom: none;
}

.score-ch {
  color: var(--ink-2);
}

.score-bar {
  height: 6px;
  border-radius: 999px;
  background: #ece6da;
  overflow: hidden;
}

.score-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.score-bar .good {
  background: var(--green);
}

.score-bar .mid {
  background: var(--gold);
}

.score-bar .bad {
  background: var(--sakura);
}

.score-num {
  font-family: var(--serif);
  font-size: 14px;
  text-align: right;
}

.score-issues {
  color: var(--ink-3);
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.export-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------------ */
/* 更新计划                                                            */
/* ------------------------------------------------------------------ */

.today-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 18px 0;
  color: var(--ink-2);
}

.today-empty .icon {
  color: var(--sakura);
}

.today-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.today-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--sakura-soft);
  text-align: left;
}

.today-item:hover {
  border-color: var(--sakura);
}

.today-no {
  font-family: var(--serif);
  font-size: 14px;
  color: var(--sakura-deep);
  flex: none;
}

.today-title {
  flex: 1;
  font-size: 13px;
}

.schedule-groups {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-top: 18px;
}

.schedule-group {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 18px;
}

.schedule-week {
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: 0.08em;
  padding-top: 10px;
}

.schedule-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.schedule-item {
  display: grid;
  grid-template-columns: 132px 74px 1fr 64px;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
  text-align: left;
  font-size: 12.5px;
  transition: all 0.15s;
}

.schedule-item:hover {
  border-color: var(--line-2);
  transform: translateX(2px);
}

.schedule-item.today {
  border-color: var(--sakura);
  background: #fdf5f5;
}

.schedule-item.done {
  background: #f8fbf7;
}

.sched-date {
  color: var(--ink-3);
  font-size: 11.5px;
}

.sched-ch {
  font-family: var(--serif);
}

.sched-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-2);
}

/* ------------------------------------------------------------------ */
/* 设置                                                                */
/* ------------------------------------------------------------------ */

.settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.settings-actions.left {
  justify-content: flex-start;
}

.account-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 14px;
}

.account-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.account-item span {
  font-size: 11.5px;
  color: var(--ink-3);
}

.account-item b {
  font-size: 13.5px;
  font-weight: 500;
}

.about-card p {
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.9;
  max-width: 720px;
}

.about-points {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 14px;
  color: var(--ink-3);
  font-size: 12px;
}

.about-points span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.about-points .icon {
  color: var(--sakura-deep);
}

/* ------------------------------------------------------------------ */
/* 空状态 / 弹层 / Toast / 其他                                         */
/* ------------------------------------------------------------------ */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 54px 24px;
  gap: 8px;
}

.empty-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--sakura-soft);
  color: var(--sakura-deep);
  margin-bottom: 6px;
}

.empty h4 {
  font-size: 16px;
}

.empty p {
  font-size: 12.5px;
  color: var(--ink-3);
  max-width: 380px;
  line-height: 1.7;
}

.empty-action {
  margin-top: 14px;
}

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(43, 39, 32, 0.34);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  animation: fadeIn 0.18s ease both;
}

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

.modal {
  background: var(--card);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(30, 26, 20, 0.3);
  max-width: 100%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalUp 0.24s var(--ease) both;
}

@keyframes modalUp {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 26px 14px;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  font-size: 18px;
}

.modal-head p {
  margin-top: 5px;
  font-size: 12px;
  color: var(--ink-3);
}

.modal-body {
  padding: 20px 26px;
  overflow-y: auto;
  min-height: 0;
}

.modal-foot {
  padding: 16px 26px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.toast-wrap {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  background: #2b2925;
  color: #f8f1e6;
  font-size: 12.5px;
  box-shadow: 0 12px 34px rgba(30, 26, 20, 0.28);
  animation: toastIn 0.26s var(--ease) both;
}

.toast-ok .icon {
  color: #b9d3bd;
}

.toast-warn .icon {
  color: #e8c98d;
}

.toast-error {
  background: #5c3333;
}

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

/* ------------------------------------------------------------------ */
/* 响应式                                                              */
/* ------------------------------------------------------------------ */

@media (max-width: 1280px) {
  .proj-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .act-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stage-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .studio-body {
    grid-template-columns: minmax(0, 1fr) 330px;
  }
}

@media (max-width: 1024px) {
  .auth {
    grid-template-columns: 1fr;
  }
  .auth-art {
    display: none;
  }
  .overview-cols,
  .two-col,
  .sample-grid,
  .char-grid {
    grid-template-columns: 1fr;
  }
  .overview-hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .studio-body {
    grid-template-columns: 1fr;
  }
  .studio-rail {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .app {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
}

@media (max-width: 760px) {
  .page,
  .studio {
    padding: 22px 18px 60px;
  }
  .home-title,
  .page-title {
    font-size: 25px;
  }
  .stats-row {
    grid-template-columns: 1fr 1fr;
  }
  .proj-grid {
    grid-template-columns: 1fr;
  }
  .stage-grid {
    grid-template-columns: 1fr;
  }
  .studio-rail {
    grid-template-columns: 1fr;
  }
  .chapter-table-head,
  .chapter-row {
    grid-template-columns: 40px 1fr 88px;
  }
  .chapter-table-head span:nth-child(4),
  .chapter-table-head span:nth-child(5),
  .chapter-row > span:nth-child(4),
  .chapter-row > span:nth-child(5),
  .chapter-row > span:nth-child(6) {
    display: none;
  }
  .schedule-group {
    grid-template-columns: 1fr;
  }
  .schedule-item {
    grid-template-columns: 1fr 68px;
  }
  .sched-date,
  .sched-title {
    display: none;
  }
  .score-row {
    grid-template-columns: 64px 1fr 32px;
  }
  .score-issues,
  .score-row .tag {
    display: none;
  }
}

/* ------------------------------------------------------------------ */
/* 后端状态 / 同步                                                       */
/* ------------------------------------------------------------------ */

.center-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--ink-2);
}

.center-screen .brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
}

.offline-card {
  max-width: 430px;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 36px 30px;
  box-shadow: var(--shadow-lg);
}

.offline-card h3 {
  font-size: 19px;
  margin-bottom: 8px;
}

.offline-card p {
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--ink-3);
  margin-bottom: 18px;
}

.offline-card code {
  background: #f1ece1;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 11.5px;
}

.save-state i.busy {
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(180, 138, 76, 0.16);
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.4;
  }
}

.btn.active {
  background: var(--sakura-soft);
  color: var(--sakura-deep);
}

/* ------------------------------------------------------------------ */
/* 版本与 diff                                                         */
/* ------------------------------------------------------------------ */

.version-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 18px;
  min-height: 380px;
}

.version-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 56vh;
  overflow-y: auto;
  padding-right: 4px;
}

.version-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card-2);
  text-align: left;
  transition: all 0.15s;
}

.version-item:hover {
  border-color: var(--line-2);
  background: #fff;
}

.version-item.on {
  border-color: var(--sakura);
  background: #fdf5f5;
}

.version-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sakura);
  flex: none;
}

.version-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.version-main b {
  font-size: 12.5px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.version-main small {
  font-size: 10.8px;
  color: var(--ink-3);
}

.version-diff {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.diff-head {
  font-size: 12px;
  color: var(--ink-2);
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.diff-body {
  flex: 1;
  max-height: 56vh;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--card-2);
}

.diff-line {
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.9;
  padding: 4px 8px;
  border-radius: 5px;
  margin: 0 0 4px;
}

.diff-line.add {
  background: #eef7ee;
  color: #3f6148;
}

.diff-line.del {
  background: #fbeceb;
  color: #8d4242;
  text-decoration: line-through;
  text-decoration-color: rgba(141, 66, 66, 0.3);
}

.diff-line.same {
  color: var(--ink-2);
}

/* ------------------------------------------------------------------ */
/* 自动提取                                                            */
/* ------------------------------------------------------------------ */

.extract-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 44px 0;
  text-align: center;
}

.spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--sakura-soft);
  border-top-color: var(--sakura);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.extract-intro > p {
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 10px;
}

.extract-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.extract-list li {
  font-size: 12.5px;
  color: var(--ink-2);
  display: flex;
  gap: 10px;
  line-height: 1.7;
}

.extract-list b {
  color: var(--ink);
  font-weight: 500;
  flex: none;
}

.extract-counts {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 6px;
}

.extract-count {
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.extract-count b {
  font-family: var(--serif);
  font-size: 22px;
}

.extract-count span {
  font-size: 10.8px;
  color: var(--ink-3);
}

.extract-preview {
  border-top: 1px dashed var(--line);
  padding-top: 12px;
  margin-top: 12px;
}

.extract-preview p {
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.9;
  color: var(--ink-2);
  margin: 6px 0;
}

/* ------------------------------------------------------------------ */
/* 专注模式                                                            */
/* ------------------------------------------------------------------ */

body.zen-mode .sidebar,
body.zen-mode .topbar {
  display: none;
}

body.zen-mode .app {
  grid-template-columns: 1fr;
}

body.zen-mode .studio {
  max-width: 900px;
  margin: 0 auto;
  padding: 30px 24px 70px;
}

body.zen-mode .studio-rail {
  display: none;
}

body.zen-mode .studio-body {
  grid-template-columns: 1fr;
}

body.zen-mode .studio-head {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--paper);
  padding: 8px 0;
}

body.zen-mode .studio-editor {
  box-shadow: var(--shadow-lg);
}

body.zen-mode .manuscript {
  padding: 46px 58px;
  font-size: 17px;
  line-height: 2.15;
}

/* ------------------------------------------------------------------ */
/* 移动端导航                                                          */
/* ------------------------------------------------------------------ */

.mobile-only {
  display: none;
}

@media (max-width: 1024px) {
  .mobile-only {
    display: inline-flex;
  }

  .sidebar {
    display: flex;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 60;
    width: 268px;
    transform: translateX(-100%);
    transition: transform 0.25s var(--ease);
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    transform: none;
  }

  .sidebar-mask {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(43, 39, 32, 0.34);
    backdrop-filter: blur(3px);
  }

  .topbar {
    padding: 0 16px;
    gap: 10px;
  }

  .crumbs {
    overflow: hidden;
    white-space: nowrap;
  }

  .studio {
    padding: 16px 14px 50px;
  }

  .studio-head {
    flex-wrap: wrap;
    gap: 8px;
  }

  .studio-title h2 {
    font-size: 18px;
  }

  .studio-status {
    order: 3;
  }

  .studio-nav {
    order: 4;
  }

  .manuscript {
    padding: 22px 18px;
    font-size: 15.5px;
    line-height: 1.95;
  }

  .studio-toolbar {
    flex-wrap: wrap;
  }

  .toolbar-actions {
    margin-left: 0;
    width: 100%;
  }
}

.plan-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--card-2);
  border: 1px dashed var(--line);
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--ink-3);
}

.plan-note .icon {
  margin-top: 2px;
  color: var(--gold);
}

/* 移动端细节修正 */
@media (max-width: 760px) {
  .page-head,
  .home-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .page-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .save-state,
  .topnav-name {
    display: none;
  }

  .topbar {
    height: 54px;
  }

  .crumb-strong {
    max-width: 86px;
  }

  .studio-head {
    gap: 8px;
  }

  .studio-title {
    flex: 1 1 100%;
    order: 2;
  }

  .studio-title h2 {
    white-space: normal;
    font-size: 19px;
    line-height: 1.4;
  }

  .studio-title .eyebrow {
    white-space: normal;
  }

  .studio-status {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }

  .studio-nav {
    order: 4;
    margin-left: auto;
  }

  .studio-count {
    font-size: 12px;
  }

  .overview-hero {
    padding: 22px 18px;
  }

  .hero-side {
    width: 100%;
    justify-content: space-between;
  }

  .stage-grid {
    grid-template-columns: 1fr;
  }

  .manuscript {
    padding: 20px 16px;
  }

  .studio-toolbar {
    padding: 10px 12px;
    gap: 8px;
  }

  .toolbar-hint {
    display: none;
  }

  .studio-editor {
    min-height: auto;
  }
}

.row-gap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.danger-zone {
  border-color: #ecd2d2;
  background: #fffdfb;
}

.studio-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.title-edit-btn {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
}

.title-edit-btn:hover {
  background: rgba(43, 41, 37, 0.06);
  color: var(--ink);
}

.generating-hint {
  font-size: 11.5px;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.outline-frozen {
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.ai-mini {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid #e9cdd0;
  background: var(--sakura-soft);
  color: var(--sakura-deep);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  transition: all 0.15s;
  flex: none;
}

.ai-mini-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.ai-mini.polish {
  background: #eef4f6;
  border-color: #c8dce2;
  color: #3f6670;
}

.ai-mini.polish:hover:not(:disabled) {
  background: #e2eff3;
  border-color: #a9cad3;
}

.ai-mini:hover:not(:disabled) {
  background: #f3d6d8;
  border-color: var(--sakura);
}

.ai-mini:disabled {
  opacity: 0.6;
  cursor: wait;
}

.char-label .ai-mini {
  margin-top: 4px;
  height: 20px;
  font-size: 10px;
  padding: 0 6px;
}

.import-info {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--green-soft);
  border: 1px solid #d3e3d6;
  color: #44604c;
  font-size: 11.5px;
  margin-bottom: 8px;
}

.ai-mini.again {
  background: #fffdf8;
  border-color: #e2b7bb;
  color: var(--sakura-deep);
}

.chapter-preview {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card-2);
  padding: 8px 12px;
  max-height: 220px;
  overflow-y: auto;
}

.chapter-preview-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 12.5px;
}

.chapter-preview-row:last-child {
  border-bottom: none;
}

.chapter-preview-row b {
  flex: none;
  width: 64px;
  font-family: var(--serif);
  font-weight: 600;
}

.chapter-preview-row span:nth-child(2) {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 收集内容核对：可编辑章节标题/正文与原作参照条目 */
.review-box {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card-2);
  padding: 12px 14px;
}

.review-head b {
  font-family: var(--serif);
  font-size: 14px;
}

.review-head p {
  margin: 3px 0 0;
}

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

.review-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.review-group-head b {
  font-family: var(--serif);
}

.review-chapter {
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
}

.review-chapter:last-child {
  border-bottom: none;
}

.review-chapter-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}

.review-chapter-head b {
  flex: none;
  min-width: 62px;
  font-family: var(--serif);
  font-weight: 600;
}

.review-chapter-head .input {
  flex: 1;
  min-width: 0;
}

.review-chapter .textarea {
  margin-top: 8px;
}

.review-entry {
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}

.review-entry:last-child {
  border-bottom: none;
}

.review-entry-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.review-entry-head select {
  width: 92px;
  flex: none;
}

.review-entry-head input {
  flex: 1;
  min-width: 0;
}

.review-entry .textarea {
  margin-top: 6px;
  min-height: 64px;
}

.export-source-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 12px;
  font-size: 13px;
  cursor: pointer;
}

.export-source-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--sakura);
}

.export-chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

.export-chapter-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  font-size: 12.5px;
  cursor: pointer;
}

.export-chapter-item.on {
  border-color: var(--sakura);
  background: var(--sakura-soft);
}

.export-chapter-item.blank {
  opacity: 0.55;
  cursor: default;
}

.export-chapter-item.blank input {
  cursor: default;
}

.export-chapter-item input {
  width: 14px;
  height: 14px;
  accent-color: var(--sakura);
}

.export-chapter-item span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.export-chapter-item small {
  color: var(--ink-3);
  font-size: 11px;
}

.origin-full-card {
  margin-bottom: 12px;
}

.origin-full-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.origin-full-head b {
  font-family: var(--serif);
}

.origin-full-head p {
  margin: 3px 0 0;
}

.origin-full-head select {
  width: 240px;
  flex: none;
}

.origin-full-text {
  margin-top: 10px;
  max-height: 420px;
  overflow-y: auto;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
  white-space: pre-wrap;
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.95;
  color: var(--ink-2);
}

@media (max-width: 720px) {
  .origin-full-head {
    flex-direction: column;
  }
  .origin-full-head select {
    width: 100%;
  }
}

.review-gate-hint {
  margin: 10px 0 0;
  text-align: right;
  font-size: 12.5px;
  color: var(--red);
}

.review-confirm {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  cursor: pointer;
}

.review-confirm input {
  width: 16px;
  height: 16px;
  accent-color: var(--sakura);
}

.link-btn.danger {
  color: var(--red);
}

.link-btn.danger:hover {
  color: #7d3636;
}

.timeline-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timeline-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 150px auto 32px;
  gap: 8px;
  align-items: start;
}

.decision-card {
  border-color: #d9e2e6;
}

.decision-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.decision-row {
  display: grid;
  grid-template-columns: 220px 180px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--line);
}

.decision-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.decision-q {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12.5px;
}

.decision-q small {
  color: var(--ink-3);
  font-size: 10.8px;
}

@media (max-width: 1024px) {
  .decision-row {
    grid-template-columns: 1fr;
  }
}

.lockable.is-locked {
  position: relative;
  opacity: 0.82;
}

.lock-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px dashed #d8b3b6;
  background: transparent;
  color: var(--sakura-deep);
  font-size: 11px;
  transition: all 0.15s;
}

.lock-btn:hover {
  background: var(--sakura-soft);
  border-style: solid;
}

.lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f3ece2;
  border: 1px solid #e2d6c4;
  color: #8a6a3f;
  font-size: 11px;
}

.lock-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  border: 1px dashed var(--line-2);
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.6);
  font-size: 12px;
  color: var(--ink-2);
}

.lock-bar .lock-badge {
  height: 26px;
}

.variation-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 2px 10px;
  border-bottom: 1px dashed var(--line);
  margin-bottom: 8px;
}

.variation-row .input {
  flex: 1;
  height: 30px;
  padding: 4px 8px;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.mode-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 22px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  text-align: left;
  transition: all 0.18s;
  min-height: 170px;
}

.mode-card:hover {
  border-color: var(--sakura);
  transform: translateY(-2px);
}

.mode-card.on {
  border-color: var(--sakura-deep);
  background: linear-gradient(180deg, #fffaf6, #fff);
  box-shadow: 0 10px 26px -18px rgba(165, 96, 104, 0.5);
}

.mode-card b {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
}

.mode-card small {
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.7;
}

.mode-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--sakura-soft);
  color: var(--sakura-deep);
}

.upload-box {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.url-row {
  display: flex;
  gap: 8px;
}

.url-row .input {
  flex: 1;
}

.input.readonly {
  display: flex;
  align-items: center;
  background: var(--card-2);
  color: var(--ink-2);
}

@media (max-width: 1024px) {
  .mode-grid {
    grid-template-columns: 1fr;
  }
}

.act-card.frozen {
  border-color: #cdd9cf;
  background: #fbfdf9;
}

.act-fieldset {
  border: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.act-name-input {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
}

.act-edit-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.act-edit-grid label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 10.5px;
  color: var(--ink-3);
}

.act-changes-edit {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.act-change-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) 28px;
  gap: 5px;
  align-items: center;
}

.act-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.entry-grid {
  max-width: 1060px;
  margin: 0 auto;
}

.entry-card {
  min-height: 210px;
  padding: 26px 22px;
}

.entry-card b {
  font-size: 18px;
}

.provider-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.provider-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  text-align: left;
  transition: all 0.15s;
}

.provider-card:hover {
  border-color: var(--sakura);
}

.provider-card.on {
  border-color: var(--sakura-deep);
  background: #fffaf6;
  box-shadow: 0 6px 18px -14px rgba(165, 96, 104, 0.55);
}

.provider-card b {
  font-family: var(--serif);
  font-size: 13.5px;
  font-weight: 600;
}

.provider-card small {
  color: var(--ink-3);
  font-size: 10.8px;
}

.ai-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 22px;
  background: #fdf4e8;
  border-bottom: 1px solid #f0ddc4;
  color: #8a5a20;
  font-size: 12.5px;
  position: sticky;
  top: 64px;
  z-index: 40;
}

.ai-banner .link-btn {
  margin-left: auto;
  color: var(--sakura-deep);
  font-weight: 600;
  text-decoration: underline;
}

.ai-banner .link-btn:hover {
  color: var(--ink);
}

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

/* ------------------------------------------------------------------ */
/* 都是作家：账号、收藏、阅读器、新手指南                                  */
/* ------------------------------------------------------------------ */

.user-entry {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 10px 3px 3px;
  border-radius: 999px;
  transition: background 0.15s;
}

.user-entry:hover {
  background: rgba(43, 41, 37, 0.06);
}

.side-switch {
  margin: 0 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.side-switch-label {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  text-transform: uppercase;
}

.side-switch-select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 12.5px;
  font-family: var(--sans);
}

.account-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 0 16px;
}

.account-profile b {
  font-family: var(--serif);
  font-size: 18px;
}

/* 收藏 */
.fav-section {
  margin-top: 22px;
}

.fav-section-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.fav-section-head h3 {
  font-family: var(--serif);
  font-size: 18px;
}

.fav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}

.fav-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.fav-cover {
  padding: 18px 16px 16px;
  background: linear-gradient(135deg, #f6ede8, #f2f0e9 60%, #eef2f1);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 130px;
}

.fav-cover h4 {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.35;
  margin-top: auto;
}

.fav-body {
  padding: 12px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fav-actions {
  display: flex;
  gap: 8px;
}

/* 阅读器 */
.reader {
  min-height: 100vh;
  background: #f7f2e8;
  color: #2b2925;
  display: flex;
  flex-direction: column;
}

.reader.dark {
  background: #171511;
  color: #e8e2d6;
}

.reader-head {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  background: inherit;
  border-bottom: 1px solid rgba(120, 110, 90, 0.18);
}

.reader-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: inherit;
  opacity: 0.8;
}

.reader-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.reader-title b {
  font-family: var(--serif);
}

.reader-title span {
  font-size: 11.5px;
  opacity: 0.65;
}

.reader-tools {
  display: flex;
  gap: 6px;
}

.reader-tools button {
  min-width: 34px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid rgba(120, 110, 90, 0.25);
  border-radius: 8px;
  color: inherit;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.reader-tools button:hover {
  background: rgba(120, 110, 90, 0.12);
}

.reader-progress {
  max-width: 760px;
  width: 100%;
  margin: 14px auto 0;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  opacity: 0.7;
}

.reader-progress select {
  width: auto;
  max-width: 320px;
  margin-left: auto;
}

.reader-page {
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 24px 48px;
  font-family: var(--serif);
  line-height: 2.05;
  animation: pageIn 0.25s ease;
}

.reader-page h1 {
  font-size: 1.5em;
  margin-bottom: 1.4em;
  font-weight: 600;
}

.reader-page p {
  margin: 0 0 0.95em;
  text-indent: 2em;
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.reader-foot {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: 12px 24px 20px;
  background: inherit;
}

.reader-empty {
  max-width: 520px;
  margin: 80px auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

/* 新手指南 */
.guide-card h3,
.guide-step h4 {
  font-family: var(--serif);
}

.guide-stages {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 14px 0;
}

.guide-stage {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: var(--card-2);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.guide-stage b {
  color: var(--sakura-deep);
  font-family: var(--serif);
}

.guide-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0;
}

.guide-step {
  display: flex;
  align-items: center;
  gap: 16px;
}

.guide-step > div {
  flex: 1;
}

.guide-no {
  font-family: var(--serif);
  font-size: 24px;
  color: var(--sakura);
  opacity: 0.7;
}

.guide-tips {
  margin: 10px 0 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-2);
}

.export-dir-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.export-dir-name {
  font-size: 12.5px;
  color: var(--ink-3);
}

@media (max-width: 720px) {
  .guide-stages {
    grid-template-columns: repeat(2, 1fr);
  }
  .guide-step {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .reader-head {
    padding: 10px 12px;
  }
  .reader-title {
    display: none;
  }
}

/* 首页收录偏好 + 首次使用引导 */
.proj-card {
  text-align: left;
  cursor: pointer;
}

.fav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 22px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10.5px;
  color: var(--ink-3);
  background: var(--card);
  flex: none;
}

.fav-toggle:hover {
  border-color: var(--sakura);
  color: var(--sakura-deep);
}

.fav-toggle.on {
  border-color: var(--sakura);
  background: var(--sakura-soft);
  color: var(--sakura-deep);
}

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

.onboard-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.onboard-head h3 {
  font-family: var(--serif);
  font-size: 22px;
  margin-bottom: 6px;
}

.onboard-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.onboard-steps > div {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card-2);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.onboard-steps b {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--sakura-soft);
  color: var(--sakura-deep);
  font-family: var(--serif);
  margin-bottom: 4px;
}

.onboard-steps span {
  font-weight: 600;
}

.onboard-steps small {
  color: var(--ink-3);
  font-size: 12px;
}

.onboard-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.export-format {
  width: auto;
  max-width: 170px;
  height: 32px;
  padding: 0 8px;
  font-size: 12px;
}

@media (max-width: 720px) {
  .onboard-steps {
    grid-template-columns: 1fr;
  }
}

/* 收藏页：紧凑书卡（小封面 + 信息） */
.fav-grid {
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 10px;
}

.fav-card {
  flex-direction: row;
  align-items: stretch;
  gap: 12px;
  padding: 10px;
  border-radius: 10px;
}

.fav-thumb {
  width: 64px;
  flex: none;
  border-radius: 6px;
  padding: 7px 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(120, 100, 80, 0.08);
}

.fav-thumb.project {
  background: linear-gradient(150deg, #f3d9d6, #efe8dc 60%, #e7ece9);
}

.fav-thumb.book {
  background: linear-gradient(150deg, #e3ecf2, #eee9dd 60%, #e9efe4);
}

.fav-thumb span {
  font-size: 8px;
  color: var(--ink-3);
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fav-thumb b {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.1;
  color: var(--ink-2);
  letter-spacing: 0.02em;
}

.fav-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fav-info h4 {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.35;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fav-info p {
  margin: 0;
  font-size: 12px;
}

.fav-info .fav-actions {
  margin-top: auto;
  padding-top: 6px;
  gap: 6px;
}

.fav-info .btn-sm {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

@media (max-width: 720px) {
  .fav-grid {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------------------------------------------ */
/* 移动端防拥挤 / 防覆盖                                                */
/* ------------------------------------------------------------------ */

.bible-check {
  flex: none;
  white-space: nowrap;
}

.pass-check {
  width: 46px;
  height: 46px;
  border-radius: 14px;
}

.pass-num {
  white-space: nowrap;
  font-size: 10px;
  line-height: 1.15;
}

@media (max-width: 760px) {
  /* 顶部导航改成两行：品牌 + 头像在第一行，导航第二行横向滚动 */
  .topnav {
    height: auto;
    min-height: 56px;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 14px;
  }
  .topnav .brand {
    flex: 0 0 auto;
    min-width: 0;
    gap: 8px;
  }
  .topnav .brand-name {
    font-size: 16px;
    white-space: nowrap;
  }
  .topnav .brand-beta {
    display: none;
  }
  .topnav-links {
    order: 3;
    width: 100%;
    overflow-x: auto;
    gap: 2px;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .topnav-links::-webkit-scrollbar {
    display: none;
  }
  .topnav-links button {
    flex: none;
    white-space: nowrap;
    padding: 6px 10px;
    font-size: 12.5px;
  }
  .topnav-user {
    margin-left: auto;
  }
  .topnav-user .user-entry {
    padding: 2px;
    gap: 6px;
  }

  .ai-banner {
    position: static;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 14px;
    line-height: 1.6;
  }
  .ai-banner span {
    flex: 1 1 100%;
  }
  .ai-banner .link-btn {
    margin-left: 0;
    white-space: nowrap;
  }

  /* 表单/卡片内的多列一律改成单列 */
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .card-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .card-head .row-gap {
    flex-wrap: wrap;
    width: 100%;
  }
  .card-head .tag {
    align-self: flex-start;
  }
  .row-gap {
    flex-wrap: wrap;
  }
  .settings-actions,
  .export-row {
    flex-wrap: wrap;
  }

  /* 首页卡片 */
  .proj-meta,
  .proj-foot {
    flex-wrap: wrap;
    gap: 6px;
  }
  .fav-section-head {
    flex-wrap: wrap;
  }
  .fav-grid {
    grid-template-columns: 1fr;
  }
  .fav-card {
    min-width: 0;
  }
  .fav-info h4 {
    font-size: 15px;
  }

  /* 标题目录 / 编辑区 */
  .timeline-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .timeline-row .icon-btn {
    justify-self: end;
  }
  .char-line {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .world-head {
    flex-wrap: wrap;
  }
  .world-title,
  .world-cat {
    min-width: 0;
  }
  .sample-head {
    flex-wrap: wrap;
  }
  .review-chapter-head,
  .review-entry-head {
    flex-wrap: wrap;
  }
  .review-chapter-head b {
    width: 100%;
  }
  .review-entry-head select {
    width: 100%;
    flex: 1 1 100%;
  }
  .review-chapter-head .input,
  .review-entry-head input {
    flex: 1 1 100%;
  }

  /* 写作台工具栏 */
  .studio-toolbar {
    flex-wrap: wrap;
  }
  .toolbar-actions {
    width: 100%;
    flex-wrap: wrap;
    margin-left: 0;
    justify-content: flex-start;
  }
  .studio-status,
  .studio-nav {
    flex-wrap: wrap;
  }
  .export-format {
    max-width: 100%;
  }

  /* 导出章节网格 */
  .export-chapter-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    max-height: 42vh;
  }
  .origin-full-head {
    flex-direction: column;
  }
  .origin-full-head select {
    width: 100%;
  }
  .review-confirm {
    align-items: flex-start;
  }

  /* 阅读器 */
  .reader-head {
    gap: 8px;
  }
  .reader-tools button {
    min-width: 30px;
    height: 28px;
  }
  .reader-progress {
    padding: 0 14px;
    flex-wrap: wrap;
  }
  .reader-progress select {
    max-width: 100%;
    margin-left: 0;
    width: 100%;
  }
  .reader-page {
    padding: 22px 18px 40px;
  }
  .reader-foot {
    padding: 10px 14px 16px;
  }

  /* 弹层不要超出手机宽度 */
  .modal {
    max-width: calc(100vw - 24px);
  }
  .modal-foot {
    flex-wrap: wrap;
  }
}

/* 更窄的屏幕 */
@media (max-width: 420px) {
  .studio-status {
    gap: 6px;
  }
  .studio-count {
    flex: 1 1 100%;
  }
  .fav-thumb {
    width: 56px;
  }
  .reader-foot .btn {
    padding: 0 10px;
  }
}

@media (max-width: 760px) {
  .bible-hero {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .bible-checks {
    width: 100%;
  }
  .bible-meter {
    width: 100%;
  }
  .lock-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .lock-btn {
    align-self: flex-end;
    white-space: nowrap;
    flex: none;
  }
}

/* 刷新恢复相关 */
.wizard-topline {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.restored-tip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--green-soft);
  border: 1px solid #d3e3d6;
  color: #44604c;
  font-size: 10.5px;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .wizard-topline {
    flex-wrap: wrap;
  }
}
