/* 小沐写作 — Apple 风格视觉系统 */
:root {
  --bg: #f5f5f7;
  --card: #ffffff;
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --ink-3: #aeaeb2;
  --line: rgba(0, 0, 0, .08);
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --green: #34c759;
  --red: #ff3b30;
  --orange: #ff9500;
  --radius: 18px;
  --radius-s: 12px;
  --shadow: 0 4px 24px rgba(0, 0, 0, .06);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, .12);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { font-size: 16px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
               "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  min-height: 100vh;
}

::selection { background: rgba(0, 113, 227, .18); }

button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }

/* ---------------- 顶部导航（毛玻璃） ---------------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: rgba(255, 255, 255, .72);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 22px;
  height: 52px; display: flex; align-items: center; gap: 22px;
}
.nav-logo {
  font-size: 17px; font-weight: 700; letter-spacing: -.02em;
  display: flex; align-items: center; gap: 8px; cursor: pointer;
}
.nav-logo .dot {
  width: 22px; height: 22px; border-radius: 7px;
  background: linear-gradient(135deg, #0a84ff, #5e5ce6);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; font-weight: 800;
}
.nav-links { display: flex; gap: 4px; flex: 1; }
.nav-link {
  font-size: 14px; color: var(--ink-2); padding: 6px 12px;
  border-radius: 99px; transition: all .2s;
}
.nav-link:hover { color: var(--ink); background: rgba(0,0,0,.04); }
.nav-link.active { color: var(--ink); font-weight: 600; }
.balance-pill {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--accent);
  background: rgba(0, 113, 227, .08);
  padding: 6px 14px; border-radius: 99px; cursor: pointer;
  transition: all .2s;
}
.balance-pill:hover { background: rgba(0, 113, 227, .14); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #a2a2a7, #6e6e73);
  color: #fff; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; user-select: none;
}

/* ---------------- 通用容器 ---------------- */
.page { max-width: 1080px; margin: 0 auto; padding: 32px 22px 80px; }
.hidden { display: none !important; }

.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 28px;
}

h1.hero {
  font-size: clamp(32px, 5vw, 48px); font-weight: 700;
  letter-spacing: -.03em; line-height: 1.1; text-align: center;
}
.hero-sub {
  font-size: clamp(16px, 2.4vw, 20px); color: var(--ink-2);
  text-align: center; margin-top: 12px; font-weight: 400;
}

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 15px; font-weight: 500;
  padding: 11px 24px; border-radius: 99px;
  transition: all .22s cubic-bezier(.3,.7,.4,1);
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { background: #b8d4f1; cursor: not-allowed; }
.btn-ghost { background: rgba(0,0,0,.05); color: var(--ink); }
.btn-ghost:hover { background: rgba(0,0,0,.09); }
.btn-danger { color: var(--red); background: rgba(255,59,48,.08); }
.btn-danger:hover { background: rgba(255,59,48,.14); }
.btn-sm { font-size: 13px; padding: 7px 16px; }
.btn-lg { font-size: 17px; padding: 14px 32px; }
.btn-block { width: 100%; }

/* ---------------- 表单 ---------------- */
.field { margin-bottom: 18px; }
.field label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--ink-2); margin-bottom: 8px;
}
.input, textarea.input {
  width: 100%; font-size: 15px; color: var(--ink);
  background: rgba(0,0,0,.035); border: 1.5px solid transparent;
  border-radius: var(--radius-s); padding: 12px 16px;
  outline: none; transition: all .2s;
}
.input:focus {
  background: #fff; border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0,113,227,.12);
}
textarea.input { resize: vertical; min-height: 110px; line-height: 1.6; }

/* chips 选择器 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 13.5px; padding: 7px 15px; border-radius: 99px;
  background: rgba(0,0,0,.045); color: var(--ink-2);
  transition: all .18s; border: 1.5px solid transparent;
}
.chip:hover { background: rgba(0,0,0,.08); color: var(--ink); }
.chip.on {
  background: rgba(0,113,227,.1); color: var(--accent);
  border-color: var(--accent); font-weight: 600;
}

/* 模型卡片 */
.model-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 10px;
}
.model-card {
  border: 1.5px solid var(--line); border-radius: var(--radius-s);
  padding: 12px 14px; cursor: pointer; transition: all .18s;
  background: #fff; text-align: left; position: relative;
}
.model-card:hover { border-color: rgba(0,113,227,.4); }
.model-card.on {
  border-color: var(--accent);
  box-shadow: 0 0 0 3.5px rgba(0,113,227,.12);
}
.model-card .m-name { font-size: 14px; font-weight: 600; }
.model-card .m-vendor { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.model-card .m-tag {
  position: absolute; top: -8px; right: 10px;
  font-size: 10.5px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, #ff9500, #ff3b30);
  padding: 2px 8px; border-radius: 99px;
}

/* 滑杆 */
.slider-row { display: flex; align-items: center; gap: 16px; }
.slider-row input[type=range] {
  flex: 1; -webkit-appearance: none; height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--accent) var(--pct, 20%), rgba(0,0,0,.1) var(--pct, 20%));
  outline: none;
}
.slider-row input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 6px rgba(0,0,0,.25); cursor: pointer;
}
.slider-val { font-size: 15px; font-weight: 600; min-width: 74px; text-align: right; }

/* ---------------- 登录页 ---------------- */
.auth-wrap {
  min-height: calc(100vh - 52px); display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 40px 22px;
}
.auth-card {
  width: 100%; max-width: 400px; margin-top: 44px;
  background: var(--card); border-radius: 24px;
  box-shadow: var(--shadow-lg); padding: 36px;
  animation: rise .5s cubic-bezier(.2,.8,.3,1);
}
.auth-tabs { display: flex; gap: 4px; background: rgba(0,0,0,.05); border-radius: 99px; padding: 4px; margin-bottom: 26px; }
.auth-tab {
  flex: 1; text-align: center; font-size: 14px; font-weight: 500;
  padding: 8px 0; border-radius: 99px; color: var(--ink-2); transition: all .25s;
}
.auth-tab.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.auth-gift {
  margin-top: 18px; text-align: center; font-size: 13px; color: var(--ink-2);
}
.auth-gift b { color: var(--accent); }

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

/* ---------------- 创作台（新建） ---------------- */
.compose-head { margin-bottom: 26px; }
.compose-head h2 { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.compose-head p { color: var(--ink-2); margin-top: 4px; font-size: 15px; }

.section-label {
  font-size: 13px; font-weight: 700; color: var(--ink-2);
  text-transform: uppercase; letter-spacing: .04em; margin: 26px 0 10px;
}
.section-label:first-child { margin-top: 0; }

/* ---------------- 作品列表 ---------------- */
.works-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}
.work-card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px;
  cursor: pointer; transition: all .25s cubic-bezier(.3,.7,.4,1);
  display: flex; flex-direction: column; gap: 8px;
}
.work-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.work-card .w-title { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.work-card .w-meta { font-size: 13px; color: var(--ink-3); display: flex; gap: 10px; flex-wrap: wrap; }
.w-progress { height: 4px; background: rgba(0,0,0,.06); border-radius: 2px; overflow: hidden; margin-top: 6px; }
.w-progress i { display: block; height: 100%; background: var(--green); border-radius: 2px; transition: width .4s; }
.w-badge {
  align-self: flex-start; font-size: 11.5px; font-weight: 600;
  padding: 3px 10px; border-radius: 99px;
}
.w-badge.done { color: var(--green); background: rgba(52,199,89,.12); }
.w-badge.writing { color: var(--orange); background: rgba(255,149,0,.12); }
.w-badge.draft { color: var(--ink-2); background: rgba(0,0,0,.06); }

/* ---------------- 写作工作室 ---------------- */
.studio { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }
.studio-side {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; position: sticky; top: 72px;
  max-height: calc(100vh - 96px); overflow-y: auto;
}
.studio-side h3 { font-size: 15px; font-weight: 700; margin-bottom: 4px; letter-spacing: -.01em; }
.studio-side .s-sub { font-size: 12.5px; color: var(--ink-3); margin-bottom: 14px; }
.ch-list { display: flex; flex-direction: column; gap: 4px; }
.ch-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 10px; cursor: pointer;
  transition: background .15s; font-size: 13.5px;
}
.ch-item:hover { background: rgba(0,0,0,.04); }
.ch-item.on { background: rgba(0,113,227,.08); }
.ch-item .ch-no {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.06); color: var(--ink-2);
}
.ch-item.done .ch-no { background: var(--green); color: #fff; }
.ch-item.gen .ch-no { background: var(--accent); color: #fff; animation: pulse 1.2s infinite; }
.ch-item .ch-t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-item .ch-w { font-size: 11.5px; color: var(--ink-3); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }

.studio-main { min-width: 0; }
.studio-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.studio-toolbar .spacer { flex: 1; }
.reader {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 44px clamp(24px, 6vw, 64px); min-height: 420px;
}
.reader h2.r-title {
  font-size: 22px; font-weight: 700; letter-spacing: -.02em;
  margin-bottom: 22px; text-align: center;
}
.reader .r-body {
  font-size: 16.5px; line-height: 2.0; color: #2c2c2e;
  white-space: pre-wrap; word-break: break-word;
  font-family: "Songti SC", "Noto Serif SC", Georgia, serif;
}
.caret {
  display: inline-block; width: 2px; height: 1.1em; background: var(--accent);
  vertical-align: text-bottom; margin-left: 1px;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.plan-box {
  background: rgba(0,0,0,.035); border-radius: var(--radius-s);
  padding: 16px 18px; font-size: 13px; color: var(--ink-2);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  white-space: pre-wrap; max-height: 260px; overflow-y: auto;
  line-height: 1.7;
}
.thinking {
  display: inline-flex; gap: 5px; align-items: center;
  color: var(--accent); font-size: 14px; font-weight: 600;
}
.thinking i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  animation: bounce 1.2s infinite;
}
.thinking i:nth-child(2) { animation-delay: .15s; }
.thinking i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%,60%,100% { transform: none; opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }

/* ---------------- 钱包 ---------------- */
.wallet-hero {
  text-align: center; padding: 44px 20px 36px;
}
.wallet-hero .w-num {
  font-size: clamp(40px, 8vw, 64px); font-weight: 750; letter-spacing: -.03em;
  background: linear-gradient(135deg, #0a84ff, #5e5ce6);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.wallet-hero .w-unit { font-size: 15px; color: var(--ink-2); margin-top: 4px; }
.redeem-row { display: flex; gap: 10px; max-width: 460px; margin: 0 auto; }
.redeem-row .input { flex: 1; text-transform: uppercase; }
.price-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px; margin-top: 24px;
}
.price-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 24px; text-align: center;
}
.price-card .p-words { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.price-card .p-note { font-size: 13px; color: var(--ink-2); margin-top: 6px; }

/* ---------------- Toast ---------------- */
#toast-box {
  position: fixed; top: 66px; left: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  background: rgba(30,30,32,.92); color: #fff; font-size: 14px;
  padding: 11px 22px; border-radius: 99px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 30px rgba(0,0,0,.25);
  animation: toast-in .3s cubic-bezier(.2,.8,.3,1);
  max-width: 86vw;
}
.toast.err { background: rgba(215,45,40,.94); }
.toast.ok { background: rgba(40,165,80,.94); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px) scale(.94); } }

/* ---------------- 模态 ---------------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.35); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fade .2s;
}
.modal {
  background: var(--card); border-radius: 22px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 480px; padding: 30px;
  animation: rise .32s cubic-bezier(.2,.8,.3,1);
  max-height: 86vh; overflow-y: auto;
}
.modal h3 { font-size: 19px; font-weight: 700; margin-bottom: 18px; letter-spacing: -.01em; }
@keyframes fade { from { opacity: 0; } }

/* ---------------- 响应式 ---------------- */
@media (max-width: 860px) {
  .studio { grid-template-columns: 1fr; }
  .studio-side { position: static; max-height: 300px; }
  .nav-links { display: none; }
  .page { padding: 20px 16px 70px; }
  .card { padding: 20px; }
}

/* 空状态 */
.empty {
  text-align: center; color: var(--ink-3); padding: 60px 20px;
  font-size: 15px;
}
.empty .e-icon { font-size: 44px; margin-bottom: 12px; }

footer.foot {
  text-align: center; font-size: 12.5px; color: var(--ink-3);
  padding: 30px 0 40px;
}

/* ---------------- v2：节奏参数 ---------------- */
.pace-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}
.pace-item label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--ink-2); margin-bottom: 6px;
}
.toggle-row { display: flex; flex-direction: column; gap: 10px; }
.toggle {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; color: var(--ink); cursor: pointer; user-select: none;
}
.toggle input { display: none; }
.toggle i {
  width: 42px; height: 25px; border-radius: 99px; flex-shrink: 0;
  background: rgba(0,0,0,.15); position: relative; transition: background .25s;
}
.toggle i::after {
  content: ""; position: absolute; top: 2.5px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.25); transition: transform .25s cubic-bezier(.3,.7,.4,1);
}
.toggle input:checked + i { background: var(--green); }
.toggle input:checked + i::after { transform: translateX(16px); }

/* ---------------- v2：进度卡 ---------------- */
.prog-card {
  background: var(--card); border-radius: var(--radius-s);
  box-shadow: var(--shadow); padding: 14px 18px; margin-bottom: 16px;
  animation: rise .3s cubic-bezier(.2,.8,.3,1);
}
.prog-row {
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  font-size: 13px; color: var(--ink-2); font-weight: 500;
}

/* ---------------- v2：创作日志 ---------------- */
.console-wrap {
  margin-top: 16px; background: var(--card); border-radius: var(--radius-s);
  box-shadow: var(--shadow); overflow: hidden;
}
.console-head {
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  padding: 11px 18px; cursor: pointer; user-select: none;
  display: flex; gap: 8px; align-items: baseline;
}
.console-head span { font-weight: 400; font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.console {
  display: none; max-height: 240px; overflow-y: auto;
  padding: 6px 18px 14px; font-size: 12px; line-height: 1.8;
  color: var(--ink-2); font-family: ui-monospace, "SF Mono", Menlo, monospace;
  border-top: 1px solid var(--line);
}
.console-wrap.open .console { display: block; }

/* ---------------- v2：编辑与审阅 ---------------- */
textarea.r-edit {
  width: 100%; min-height: 420px; font-size: 15.5px; line-height: 1.9;
  font-family: "Songti SC", "Noto Serif SC", Georgia, serif;
}
.modal.modal-wide { max-width: 720px; }
.input-mini {
  width: 74px; display: inline-block; padding: 7px 10px; font-size: 13px;
  text-align: center; vertical-align: middle;
}
.w-badge.review { color: #af52de; background: rgba(175,82,222,.12); }
.w-badge.error { color: var(--red); background: rgba(255,59,48,.1); }

/* ---------------- v2：消费明细表 ---------------- */
.cost-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.cost-table th {
  text-align: left; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .04em; color: var(--ink-3); font-weight: 600;
  padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.cost-table td {
  padding: 10px 12px; border-bottom: 1px solid rgba(0,0,0,.04);
  color: var(--ink-2);
}
.cost-table tr:last-child td { border-bottom: none; }
.cost-table tbody tr:hover td { background: rgba(0,0,0,.02); }
@media (max-width: 700px) {
  .cost-table th:nth-child(3), .cost-table td:nth-child(3),
  .cost-table th:nth-child(4), .cost-table td:nth-child(4),
  .cost-table th:nth-child(5), .cost-table td:nth-child(5) { display: none; }
}

/* ================= v3：产品化改版 ================= */

/* 渐变主按钮 */
.btn-hero {
  background: linear-gradient(135deg, #0a84ff 0%, #5e5ce6 100%);
  color: #fff; border: none;
  box-shadow: 0 8px 24px rgba(60, 90, 230, .35);
  transition: all .25s cubic-bezier(.3,.7,.4,1);
}
.btn-hero:hover { box-shadow: 0 10px 32px rgba(60, 90, 230, .48); transform: translateY(-1px); }
.btn-hero:active { transform: scale(.97); }
.btn-hero:disabled { opacity: .5; box-shadow: none; cursor: not-allowed; }

/* 主页问候 */
.greet {
  text-align: center; margin: 34px 0 26px;
  animation: rise .5s cubic-bezier(.2,.8,.3,1);
}
.greet h2 {
  font-size: clamp(26px, 4.5vw, 38px); font-weight: 750; letter-spacing: -.03em;
  background: linear-gradient(120deg, #1d1d1f 30%, #5e5ce6 85%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.greet p { color: var(--ink-2); margin-top: 8px; font-size: 15px; }

/* 对话式创意输入 */
.composer {
  background: var(--card); border-radius: 26px;
  box-shadow: 0 10px 40px rgba(0,0,0,.09), 0 0 0 1px rgba(0,0,0,.03);
  padding: 20px 22px 14px; position: relative;
  transition: box-shadow .3s;
  animation: rise .55s cubic-bezier(.2,.8,.3,1);
}
.composer:focus-within {
  box-shadow: 0 12px 48px rgba(60,90,230,.16), 0 0 0 2px rgba(90,92,230,.35);
}
.composer textarea {
  width: 100%; border: none; outline: none; resize: none; background: transparent;
  font-family: inherit; font-size: 16.5px; line-height: 1.75; color: var(--ink);
  min-height: 92px; max-height: 40vh;
}
.composer textarea::placeholder { color: var(--ink-3); transition: opacity .4s; }
.composer-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding-top: 12px; border-top: 1px solid rgba(0,0,0,.05);
}
.composer-bar .spacer { flex: 1; }
.pill-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500; color: var(--ink-2);
  background: rgba(0,0,0,.045); padding: 8px 14px; border-radius: 99px;
  transition: all .18s; white-space: nowrap;
}
.pill-btn:hover { background: rgba(0,0,0,.08); color: var(--ink); }
.pill-btn b { color: var(--ink); font-weight: 600; }
.pill-btn .chev { font-size: 10px; color: var(--ink-3); transition: transform .25s; }
.pill-btn.open .chev { transform: rotate(180deg); }

/* 灵感卡片 */
.spark-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px; margin-top: 16px;
}
.spark {
  text-align: left; background: rgba(255,255,255,.7); border: 1px solid rgba(0,0,0,.05);
  border-radius: 16px; padding: 14px 16px; cursor: pointer;
  transition: all .22s cubic-bezier(.3,.7,.4,1);
}
.spark:hover { transform: translateY(-2px); background: #fff; box-shadow: var(--shadow); }
.spark .sp-tag { font-size: 11px; font-weight: 700; color: var(--accent); letter-spacing: .03em; }
.spark .sp-text {
  font-size: 12.5px; color: var(--ink-2); margin-top: 5px; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* 浮层选择器（类型/模型） */
.pop-mask { position: fixed; inset: 0; z-index: 90; }
.popover {
  position: absolute; z-index: 95; min-width: 300px; max-width: min(460px, 92vw);
  background: rgba(255,255,255,.88);
  backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-radius: 18px; box-shadow: 0 16px 56px rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.05);
  padding: 16px; animation: pop-in .22s cubic-bezier(.2,.9,.3,1.2);
  max-height: 60vh; overflow-y: auto;
}
@keyframes pop-in { from { opacity: 0; transform: translateY(6px) scale(.96); } }

/* 折叠的创作节奏 */
.accordion { overflow: hidden; max-height: 0; opacity: 0; transition: max-height .35s cubic-bezier(.3,.7,.3,1), opacity .3s, margin .3s; }
.accordion.open { max-height: 460px; opacity: 1; margin-top: 14px; }

/* ---------- 生成动效 ---------- */
.live-hero {
  position: relative; overflow: hidden;
  background: var(--card); border-radius: 22px;
  padding: 30px clamp(20px, 5vw, 44px);
  box-shadow: var(--shadow); margin-bottom: 16px;
  animation: rise .4s cubic-bezier(.2,.8,.3,1);
}
.live-hero::before {
  content: ""; position: absolute; inset: -60% -20%;
  background: conic-gradient(from 0deg, transparent 60%, rgba(10,132,255,.10), rgba(94,92,230,.14), transparent 90%);
  animation: spin 7s linear infinite; pointer-events: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
.live-inner { position: relative; display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.live-pen {
  width: 76px; height: 76px; border-radius: 24px; flex-shrink: 0;
  background: linear-gradient(135deg, #0a84ff, #5e5ce6);
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; box-shadow: 0 10px 28px rgba(60,90,230,.4);
  animation: float 2.6s ease-in-out infinite;
}
@keyframes float {
  0%,100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-8px) rotate(3deg); }
}
.live-info { flex: 1; min-width: 220px; }
.live-status {
  font-size: 16px; font-weight: 650; letter-spacing: -.01em; min-height: 24px;
}
.live-status.fade { animation: msg-fade .5s; }
@keyframes msg-fade { from { opacity: 0; transform: translateY(5px); } }
.live-sub { font-size: 13px; color: var(--ink-2); margin-top: 5px; }
.live-cloud {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--green); font-weight: 600;
  background: rgba(52,199,89,.1); padding: 4px 12px; border-radius: 99px; margin-top: 10px;
}
.live-nums { display: flex; gap: 26px; margin-top: 14px; flex-wrap: wrap; }
.live-num .n {
  font-size: 24px; font-weight: 750; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.live-num .l { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }

/* 进度环 */
.ring { position: relative; width: 84px; height: 84px; flex-shrink: 0; }
.ring svg { transform: rotate(-90deg); }
.ring .bg { stroke: rgba(0,0,0,.07); }
.ring .fg {
  stroke: url(#ringGrad); stroke-linecap: round;
  transition: stroke-dashoffset .8s cubic-bezier(.3,.7,.3,1);
}
.ring .pct {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums;
}

/* 章节列表进场 */
.ch-item.pop { animation: ch-pop .45s cubic-bezier(.2,.9,.3,1.25); }
@keyframes ch-pop { from { opacity: 0; transform: translateX(-10px) scale(.96); } }

/* 打字机披露光标 */
.reveal-caret {
  display: inline-block; width: 2px; height: 1.05em; background: var(--accent);
  vertical-align: text-bottom; margin-left: 1px; animation: blink 0.9s steps(1) infinite;
}

/* ---------- 现代编辑器 ---------- */
.editor-wrap { position: relative; }
.editor-area {
  width: 100%; border: none; outline: none; background: transparent; resize: none;
  font-family: "Songti SC", "Noto Serif SC", Georgia, serif;
  font-size: 16.5px; line-height: 2.0; color: #2c2c2e; min-height: 50vh;
}
.editor-bar {
  position: sticky; bottom: 16px; z-index: 5;
  display: flex; align-items: center; gap: 12px; justify-content: center;
  background: rgba(255,255,255,.8);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-radius: 99px; padding: 8px 10px 8px 20px; margin-top: 18px;
  box-shadow: 0 8px 32px rgba(0,0,0,.14), 0 0 0 1px rgba(0,0,0,.05);
  width: fit-content; margin-left: auto; margin-right: auto;
  animation: rise .3s cubic-bezier(.2,.8,.3,1);
}
.editor-bar .ed-count { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* 导出菜单 */
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 95; min-width: 190px;
  background: rgba(255,255,255,.9); backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-radius: 14px; box-shadow: 0 16px 48px rgba(0,0,0,.16), 0 0 0 1px rgba(0,0,0,.05);
  padding: 6px; animation: pop-in .2s cubic-bezier(.2,.9,.3,1.2);
}
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  font-size: 13.5px; color: var(--ink); padding: 9px 12px; border-radius: 9px;
  transition: background .15s; text-align: left;
}
.menu-item:hover { background: rgba(0,113,227,.08); }
.menu-item .mi-sub { font-size: 11px; color: var(--ink-3); margin-left: auto; }

/* ---------- 站内充值 ---------- */
.topup-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px; margin: 18px 0;
}
.topup-card {
  border: 1.5px solid var(--line); border-radius: 14px; padding: 14px 10px;
  text-align: center; cursor: pointer; transition: all .18s; background: #fff;
  position: relative;
}
.topup-card:hover { border-color: rgba(0,113,227,.4); }
.topup-card.on { border-color: var(--accent); box-shadow: 0 0 0 3.5px rgba(0,113,227,.12); }
.topup-card .t-cny { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.topup-card .t-quota { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.topup-card .t-off {
  position: absolute; top: -9px; right: 8px; font-size: 10px; font-weight: 700;
  color: #fff; background: linear-gradient(135deg, #ff9500, #ff3b30);
  padding: 2px 8px; border-radius: 99px;
}
.method-seg {
  display: flex; gap: 4px; background: rgba(0,0,0,.05); border-radius: 99px; padding: 4px;
}
.method-seg button {
  flex: 1; font-size: 13.5px; font-weight: 500; padding: 8px 0; border-radius: 99px;
  color: var(--ink-2); transition: all .22s; display: flex; align-items: center;
  justify-content: center; gap: 6px;
}
.method-seg button.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.1); }

/* ---------------- 品牌 logo ---------------- */
.logo-img {
  width: 30px; height: 30px; border-radius: 50%;
  object-fit: cover; box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.auth-logo {
  width: 88px; height: 88px; border-radius: 50%;
  object-fit: cover; box-shadow: 0 10px 32px rgba(0,0,0,.28);
  margin-bottom: 22px;
  animation: rise .5s cubic-bezier(.2,.8,.3,1);
}

/* ---------------- 灵感滚动橱窗 ---------------- */
.marquee-wrap { margin-top: 20px; overflow: hidden; position: relative; }
.marquee-wrap::before, .marquee-wrap::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 56px; z-index: 2;
  pointer-events: none;
}
.marquee-wrap::before { left: 0; background: linear-gradient(90deg, var(--bg), transparent); }
.marquee-wrap::after { right: 0; background: linear-gradient(-90deg, var(--bg), transparent); }
.marquee-row {
  display: flex; gap: 12px; width: max-content;
  padding: 6px 0;
  animation: marquee var(--dur, 60s) linear infinite;
}
.marquee-row.rev { animation-direction: reverse; }
.marquee-wrap:hover .marquee-row { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
.spark {
  width: 250px; flex-shrink: 0;
}
.spark .sp-text { -webkit-line-clamp: 3; }

/* 整本花费预估 */
.est-line {
  text-align: right; font-size: 12px; color: var(--ink-3);
  padding: 8px 4px 0;
}
.est-line b { color: var(--ink-2); }

/* ---------------- 书架 v2 ---------------- */
.shelf-head {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.shelf-stats { font-size: 13px; color: var(--ink-3); }
.shelf-filters { display: flex; gap: 6px; margin-left: auto; }

.shelf-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  gap: 22px 18px;
}
.book {
  position: relative; cursor: pointer;
  transition: transform .25s cubic-bezier(.3,.7,.4,1);
}
.book:hover { transform: translateY(-4px); }
.book-cover {
  position: relative; aspect-ratio: 3 / 4.1; border-radius: 8px 14px 14px 8px;
  padding: 16px 14px; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: 0 10px 24px rgba(0,0,0,.16), inset 6px 0 10px -6px rgba(255,255,255,.5),
              inset -2px 0 6px rgba(0,0,0,.12);
}
.book-cover::before {  /* 书脊 */
  content: ""; position: absolute; left: 7px; top: 0; bottom: 0; width: 1px;
  background: rgba(255,255,255,.35);
}
.book-cover .bc-genre {
  font-size: 10px; font-weight: 700; letter-spacing: .12em;
  color: rgba(255,255,255,.85); text-transform: uppercase;
}
.book-cover .bc-title {
  font-family: "Songti SC", "Noto Serif SC", serif;
  font-size: 19px; font-weight: 700; color: #fff; line-height: 1.45;
  letter-spacing: .04em; text-shadow: 0 1px 3px rgba(0,0,0,.25);
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
  word-break: break-all;
}
.book-cover .bc-brand {
  font-size: 9.5px; color: rgba(255,255,255,.6); letter-spacing: .1em;
  display: flex; align-items: center; gap: 5px;
}
.book-cover .bc-brand img { width: 14px; height: 14px; border-radius: 50%; opacity: .9; }
.book .w-badge {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  backdrop-filter: blur(6px);
}
.book-info { padding: 10px 2px 0; }
.book-info .bi-title {
  font-size: 13.5px; font-weight: 650; letter-spacing: -.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.book-info .bi-meta {
  font-size: 11.5px; color: var(--ink-3); margin-top: 3px;
  display: flex; gap: 8px; align-items: center;
}
.book-info .w-progress { margin-top: 7px; }
.book-more {
  position: absolute; right: 4px; bottom: 2px; z-index: 3;
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3); font-size: 16px; font-weight: 700;
  transition: all .15s;
}
.book-more:hover { background: rgba(0,0,0,.07); color: var(--ink); }
.book .menu { top: auto; bottom: 30px; right: 0; }

/* 工作室书名可编辑 */
.title-edit {
  cursor: pointer; border-radius: 6px; padding: 0 4px; margin-left: -4px;
}
.title-edit:hover { background: rgba(0,113,227,.08); }
.title-edit .pen { font-size: 12px; color: var(--ink-3); margin-left: 4px; opacity: 0; transition: opacity .15s; }
.title-edit:hover .pen { opacity: 1; }

/* 游客锁定的模型卡 */
.model-card.locked { opacity: .55; }
.model-card.locked:hover { border-color: var(--line); }
.btn-link { cursor: pointer; }
.btn-link:hover { text-decoration: underline; }

/* 骨架屏 */
.skel { border-radius: 10px; background: linear-gradient(90deg, rgba(0,0,0,.05) 25%, rgba(0,0,0,.09) 37%, rgba(0,0,0,.05) 63%); background-size: 400% 100%; animation: skel 1.2s ease infinite; }
@keyframes skel { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* 试用提示条 */
.trial-tip {
  margin-top: 10px; padding: 9px 14px; border-radius: 12px;
  font-size: 12.5px; color: var(--ink-2);
  background: linear-gradient(90deg, rgba(10,132,255,.07), rgba(94,92,230,.07));
}
.trial-tip a { color: var(--accent); font-weight: 600; cursor: pointer; }
.trial-tip a:hover { text-decoration: underline; }
