* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: #f4f5fb; color: #1f2937; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; font-size: 14px; line-height: 1.5; }
body { padding-bottom: 76px; min-height: 100vh; }
#app { max-width: 680px; margin: 0 auto; padding: 0 14px; position: relative; min-height: 100vh; }

/* ============ 顶部栏 ============ */
.topbar { position: sticky; top: 0; z-index: 50; display: flex; justify-content: space-between; align-items: center; gap: 10px; background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%); color: #fff; margin: 0 -14px; padding: 12px 16px; border-radius: 0 0 18px 18px; box-shadow: 0 4px 16px rgba(99,102,241,.28); }
.tb-left { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.logo { font-size: 18px; font-weight: 800; letter-spacing: 1px; }
.logo-dot { font-size: 10px; font-weight: 500; opacity: .8; background: rgba(255,255,255,.18); padding: 2px 7px; border-radius: 8px; white-space: nowrap; }
.tb-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.tb-balance { border: none; cursor: pointer; background: rgba(255,255,255,.2); color: #fff; font-size: 12px; padding: 6px 11px; border-radius: 20px; backdrop-filter: blur(4px); }
.tb-balance b { font-size: 13px; }
.tb-avatar { width: 32px; height: 32px; border-radius: 50%; border: 2px solid rgba(255,255,255,.65); padding: 0; overflow: hidden; background: rgba(255,255,255,.25); color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.tb-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ============ 通用 ============ */
.page { padding: 14px 0 8px; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.page-header h2 { margin: 0; font-size: 17px; font-weight: 700; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin: 18px 2px 10px; }
.section-head h3 { margin: 0; font-size: 15px; font-weight: 700; color: #111827; }
.section-count { font-size: 12px; color: #9ca3af; }
.card { background: #fff; border-radius: 16px; padding: 14px; box-shadow: 0 2px 12px rgba(17,24,39,.04); border: 1px solid #f1f2f7; margin-bottom: 12px; }
.card-title { font-size: 13px; font-weight: 700; color: #374151; margin-bottom: 10px; }

.btn-primary, .btn-outline, .btn-ghost { border: none; border-radius: 12px; padding: 11px 18px; font-size: 14px; cursor: pointer; font-weight: 600; transition: all .15s; font-family: inherit; }
.btn-primary { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; box-shadow: 0 4px 14px rgba(99,102,241,.32); }
.btn-primary:active { transform: scale(.97); }
.btn-outline { background: #fff; color: #6366f1; border: 1px solid #c7d2fe; }
.btn-ghost { background: rgba(99,102,241,.08); color: #6366f1; border: none; padding: 7px 13px; font-size: 13px; }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 10px; }
.btn-danger { background: #fef2f2; color: #ef4444; border: 1px solid #fecaca; }
.danger { background: #ef4444; color: #fff; border: none; padding: 8px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.danger:active { opacity: .85; }

/* ============ 作品页 ============ */
.hero-card { position: relative; overflow: hidden; background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #a855f7 100%); color: #fff; border-radius: 20px; padding: 18px; box-shadow: 0 8px 24px rgba(79,70,229,.28); }
.hero-card::after { content: ''; position: absolute; width: 150px; height: 150px; right: -50px; top: -50px; border-radius: 50%; background: rgba(255,255,255,.12); }
.hero-card::before { content: ''; position: absolute; width: 90px; height: 90px; right: 40px; bottom: -50px; border-radius: 50%; background: rgba(255,255,255,.08); }
.hero-row { display: flex; justify-content: space-between; align-items: flex-start; position: relative; z-index: 1; }
.hero-title { font-size: 19px; font-weight: 800; letter-spacing: .3px; }
.hero-sub { font-size: 12px; opacity: .82; margin-top: 3px; }
.hero-chip { font-size: 12px; font-weight: 600; background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.25); padding: 6px 11px; border-radius: 20px; white-space: nowrap; }
.hero-stats { display: flex; gap: 8px; margin: 16px 0 14px; position: relative; z-index: 1; }
.hs-item { flex: 1; background: rgba(255,255,255,.14); border-radius: 12px; padding: 8px 10px; text-align: center; }
.hs-item b { display: block; font-size: 16px; font-weight: 800; }
.hs-item span { font-size: 11px; opacity: .8; }
.hero-cta { position: relative; z-index: 1; width: 100%; border: none; cursor: pointer; background: #fff; color: #4f46e5; font-weight: 700; font-size: 14px; padding: 12px; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,.12); font-family: inherit; }
.hero-cta:active { transform: scale(.99); }

.work-list { display: flex; flex-direction: column; gap: 10px; }
.work-card { display: flex; gap: 12px; background: #fff; border-radius: 16px; padding: 12px; box-shadow: 0 2px 10px rgba(17,24,39,.04); cursor: pointer; border: 1px solid #f1f2f7; transition: transform .12s; }
.work-card:active { transform: scale(.99); }
.wc-cover { width: 58px; height: 76px; border-radius: 10px; flex-shrink: 0; color: #fff; font-size: 22px; font-weight: 800; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 10px rgba(99,102,241,.22); }
.wc-body { flex: 1; min-width: 0; }
.work-card h3 { margin: 0 0 5px; font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.work-meta { display: flex; gap: 8px; font-size: 11px; color: #6b7280; align-items: center; flex-wrap: wrap; }
.work-meta .badge { background: #eef2ff; color: #6366f1; padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: 600; }
.wc-progress { height: 4px; background: #eef0f6; border-radius: 4px; margin: 8px 0 4px; overflow: hidden; }
.wc-progress i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #6366f1, #a855f7); }
.wc-time { font-size: 10px; color: #b3b8c4; }
.work-actions { display: flex; gap: 6px; margin-top: 8px; }
.work-actions button { padding: 5px 10px; font-size: 11px; border-radius: 8px; border: none; background: #f3f4f6; color: #374151; cursor: pointer; font-family: inherit; }
.work-actions button.danger { background: #fef2f2; color: #ef4444; }

.empty-hint { text-align: center; padding: 46px 20px; color: #9ca3af; font-size: 13px; line-height: 1.8; }

/* ============ 创作页 ============ */
.create-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.create-title { font-size: 18px; font-weight: 800; }
.create-sub { font-size: 12px; color: #9ca3af; margin-top: 2px; }
.stage-progress { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.stage-progress-bar { flex: 1; height: 6px; background: #e8eaf3; border-radius: 6px; overflow: hidden; }
.stage-progress-bar i { display: block; height: 100%; width: 14.28%; border-radius: 6px; background: linear-gradient(90deg, #6366f1, #a855f7); transition: width .25s; }
.stage-progress-label { font-size: 11px; color: #6b7280; white-space: nowrap; }

.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 6px; }
.form-row input, .form-row textarea, .form-row select { width: 100%; padding: 11px 12px; border: 1px solid #e5e7eb; border-radius: 12px; background: #fff; font-size: 14px; font-family: inherit; resize: vertical; transition: border-color .15s; }
.form-row input:focus, .form-row textarea:focus, .form-row select:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.13); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.form-hint { font-size: 12px; color: #6b7280; background: #eef2ff; padding: 9px 12px; border-radius: 10px; margin-bottom: 12px; border-left: 3px solid #6366f1; }
.form-actions { display: flex; gap: 8px; margin: 12px 0; flex-wrap: wrap; }

.outline-box { margin-top: 14px; }
.outline-title { font-size: 13px; font-weight: 700; color: #374151; margin-bottom: 6px; }
.outline-box textarea { width: 100%; padding: 12px; border: 1px solid #e5e7eb; border-radius: 12px; background: #fff; font-family: inherit; font-size: 13px; line-height: 1.7; resize: vertical; }

.stage-bar { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 2px 12px; margin-bottom: 6px; }
.stage { flex-shrink: 0; padding: 8px 12px; border-radius: 20px; font-size: 12px; background: #fff; color: #6b7280; cursor: pointer; white-space: nowrap; font-weight: 600; transition: all .15s; border: 1px solid #eceef5; }
.stage.active { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; box-shadow: 0 4px 10px rgba(99,102,241,.28); border-color: transparent; }

.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button { width: 38px; height: 38px; border-radius: 10px; border: 1px solid #e5e7eb; background: #fff; font-size: 15px; cursor: pointer; color: #374151; }
.stepper input { width: 90px; text-align: center; padding: 8px; border: 1px solid #e5e7eb; border-radius: 10px; font-size: 14px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 7px 14px; border-radius: 20px; background: #fff; color: #374151; font-size: 12px; cursor: pointer; border: 1px solid #e5e7eb; transition: all .15s; }
.chip:hover { background: #eef2ff; color: #6366f1; border-color: #c7d2fe; }
.chip.active { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; border-color: transparent; }

.chapter-list { display: flex; flex-direction: column; gap: 8px; max-height: 55vh; overflow-y: auto; padding-right: 4px; }
.chapter-item { background: #fff; border-radius: 12px; padding: 10px 12px; border: 1px solid #f1f2f7; }
.chapter-head { display: flex; gap: 8px; align-items: center; }
.chapter-head .idx { width: 28px; height: 28px; border-radius: 50%; background: #eef2ff; color: #6366f1; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.chapter-head input { flex: 1; padding: 7px 10px; border: 1px solid #e5e7eb; border-radius: 8px; font-size: 13px; }
.chapter-item textarea { width: 100%; margin-top: 6px; padding: 7px 10px; border: 1px solid #e5e7eb; border-radius: 8px; font-size: 12px; resize: vertical; min-height: 34px; }

.chapter-editor { max-height: 62vh; overflow-y: auto; }
.ch-editor-block { background: #fff; border-radius: 14px; padding: 12px; margin-bottom: 10px; border: 1px solid #f1f2f7; }
.ch-editor-block .ch-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ch-editor-block .ch-head h4 { margin: 0; font-size: 14px; color: #1f2937; flex: 1; }
.ch-select { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: #6b7280; flex-shrink: 0; }
.ch-select input { width: 16px; height: 16px; accent-color: #6366f1; }
.ch-editor-block .ch-stat { font-size: 11px; color: #6b7280; margin-bottom: 8px; }
.ch-editor-block textarea { width: 100%; min-height: 200px; padding: 10px; border: 1px solid #e5e7eb; border-radius: 10px; font-family: inherit; font-size: 13px; line-height: 1.7; resize: vertical; margin-bottom: 8px; }
.ch-editor-block .row { display: flex; gap: 6px; flex-wrap: wrap; }
.ch-editor-block .row button { flex: 1; min-width: 100px; padding: 8px; font-size: 13px; border-radius: 10px; border: none; cursor: pointer; font-family: inherit; }
.ch-editor-block .gen-btn { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; }
.ch-editor-block .title-btn { background: #fff; color: #6366f1; border: 1px solid #c7d2fe; }
.ch-editor-block .copy-btn { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.ch-editor-block .jump-btn { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; font-size: 13px; padding: 9px 15px; border-radius: 9px; cursor: pointer; font-family: inherit; min-height: 38px; }
.ch-editor-block .jump-btn:active { background: #fef3c7; }

.batch-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #fff; border: 1px solid #eef0f8; border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.batch-all { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: #374151; }
.batch-all input { width: 16px; height: 16px; accent-color: #6366f1; }
.batch-info { font-size: 12px; color: #6b7280; margin-left: auto; }

.finish-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #f0fdf4; border: 1px solid #dcfce7; border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; font-size: 12px; color: #166534; }
.finish-bar button { margin-left: auto; }
.finish-bar button:disabled { opacity: .5; cursor: not-allowed; }
.badge-done { background: #dcfce7 !important; color: #15803d !important; }

/* ============ 书城页 ============ */
.books-hero { background: linear-gradient(135deg, #0f172a 0%, #312e81 60%, #6d28d9 100%); }
.books-actions { display: flex; gap: 8px; margin-top: 16px; position: relative; z-index: 1; }
.books-actions button { flex: 1; border: none; cursor: pointer; padding: 10px; border-radius: 12px; font-size: 13px; font-weight: 700; font-family: inherit; }
.btn-white { background: #fff; color: #4338ca; }
.btn-gold { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #78350f; }

.book-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.book-card { position: relative; background: #fff; border-radius: 16px; padding: 10px; border: 1px solid #f1f2f7; cursor: pointer; box-shadow: 0 2px 10px rgba(17,24,39,.04); }
.book-card .cover { width: 100%; aspect-ratio: 3/4; border-radius: 10px; background: linear-gradient(135deg, #eef2ff, #fce7f3); margin-bottom: 8px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.book-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.book-card .cover-title { font-size: 34px; font-weight: 800; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.2); }
.book-tags { position: absolute; top: 16px; left: 16px; display: flex; gap: 4px; }
.book-tag { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 8px; }
.book-tag.trial { background: rgba(251,191,36,.95); color: #78350f; }
.book-tag.free { background: rgba(16,185,129,.95); color: #fff; }
.book-tag.done { background: rgba(99,102,241,.95); color: #fff; }
.bfoot .book-price { color: #dc2626; font-weight: 800; font-size: 13px; }
.vl-price { margin: 10px 0 14px; font-size: 15px; font-weight: 800; color: #dc2626; }
.btitle { font-size: 14px; font-weight: 700; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bmeta { font-size: 11px; color: #6b7280; }
.bmeta2 { font-size: 11px; color: #9ca3af; margin-top: 4px; height: 32px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bfoot { display: flex; justify-content: space-between; margin-top: 6px; font-size: 10px; color: #9ca3af; border-top: 1px dashed #f1f2f7; padding-top: 6px; }

.book-viewer { position: fixed; inset: 0; z-index: 220; background: #fbfbfd; overflow-y: auto; display: flex; flex-direction: column; }
.book-viewer header { position: sticky; top: 0; z-index: 2; padding: 12px 16px; background: rgba(255,255,255,.96); backdrop-filter: blur(6px); border-bottom: 1px solid #eef0f6; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.viewer-close { border: none; background: #f3f4f6; padding: 7px 14px; border-radius: 10px; cursor: pointer; font-size: 13px; flex-shrink: 0; font-family: inherit; }
.viewer-copy { border: none; background: #eef2ff; color: #4338ca; padding: 7px 14px; border-radius: 10px; cursor: pointer; font-size: 13px; flex-shrink: 0; font-family: inherit; margin-left: auto; margin-right: 8px; }
.book-viewer main { padding: 20px; flex: 1; max-width: 680px; margin: 0 auto; width: 100%; }
.book-viewer .content { font-size: 15px; line-height: 2; color: #1f2937; }
.viewer-lock { margin-top: 24px; background: linear-gradient(135deg, #eef2ff, #faf5ff); border: 1px solid #ddd6fe; border-radius: 16px; padding: 18px; text-align: center; }
.vl-title { font-size: 15px; font-weight: 800; color: #4338ca; }
.vl-sub { font-size: 12px; color: #6b7280; margin: 4px 0 12px; }
.vl-row { display: flex; gap: 8px; }
.vl-row input { flex: 1; padding: 10px 12px; border: 1px solid #c7d2fe; border-radius: 10px; font-size: 13px; }
.vl-row button { border: none; background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; padding: 0 16px; border-radius: 10px; font-weight: 700; cursor: pointer; font-family: inherit; }
.vl-tip { font-size: 11px; color: #9ca3af; margin-top: 10px; }

/* ============ 我的页 ============ */
.me-header { border-radius: 20px; padding: 18px; background: linear-gradient(135deg, #1e1b4b 0%, #4338ca 55%, #7c3aed 100%); color: #fff; box-shadow: 0 8px 24px rgba(67,56,202,.28); margin-bottom: 14px; }
.me-profile { display: flex; align-items: center; gap: 12px; }
.me-avatar { position: relative; width: 60px; height: 60px; border-radius: 50%; background: rgba(255,255,255,.22); border: 2px solid rgba(255,255,255,.6); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800; overflow: hidden; cursor: pointer; flex-shrink: 0; }
.me-avatar img { width: 100%; height: 100%; object-fit: cover; }
.me-avatar-edit { position: absolute; bottom: 0; right: 0; width: 20px; height: 20px; background: #fff; color: #4338ca; border-radius: 50%; font-size: 10px; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.me-info { flex: 1; min-width: 0; }
.me-name { font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.me-edit { border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.14); color: #fff; font-size: 11px; padding: 3px 8px; border-radius: 10px; cursor: pointer; font-family: inherit; }
.me-id { font-size: 11px; opacity: .78; margin-top: 3px; }
.me-id-row { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.me-id-row .me-id { margin-top: 0; font-weight: 600; letter-spacing: .3px; }
.me-copy-id { font-size: 10px; line-height: 1; padding: 3px 8px; border-radius: 999px; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.12); color: #fff; cursor: pointer; font-family: inherit; }
.me-copy-id:active { background: rgba(255,255,255,.22); }
.me-vip { display: inline-block; font-size: 11px; background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #78350f; font-weight: 700; padding: 2px 8px; border-radius: 10px; margin-top: 5px; }
.me-balance-card { margin-top: 16px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.16); border-radius: 16px; padding: 12px 14px; }
.mb-label { font-size: 11px; opacity: .75; }
.me-balance { font-size: 30px; font-weight: 800; letter-spacing: -1px; margin: 2px 0 10px; }
.me-balance .unit { font-size: 13px; font-weight: 500; opacity: .8; margin-left: 4px; }
.me-balance .vip-tag { display: inline-block; background: #fbbf24; color: #78350f; font-size: 10px; padding: 2px 8px; border-radius: 10px; margin-left: 8px; vertical-align: middle; font-weight: 700; letter-spacing: 0; }
.me-balance-hint { font-size: 11px; opacity: .72; margin: -6px 0 10px; letter-spacing: .2px; }

/* ============ 创作流程与细节打磨 ============ */
.step-tip {
  position: relative;
  font-size: 12px;
  line-height: 1.65;
  color: #4b5563;
  background: linear-gradient(90deg, #f5f6ff, #fff);
  border: 1px solid #e8eaff;
  border-left: 3px solid #6366f1;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.step-tip b { color: #4338ca; margin-right: 6px; font-weight: 800; }

.section-head h3 { position: relative; padding-left: 10px; }
.section-head h3::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 14px;
  border-radius: 3px;
  background: linear-gradient(180deg, #6366f1, #a855f7);
}
.btn-primary { transition: transform .12s, box-shadow .12s, filter .12s; }
.btn-primary:active { transform: translateY(1px) scale(.995); filter: brightness(.97); }
.btn-outline, .btn-ghost { transition: background .15s, transform .12s; }
.btn-outline:active, .btn-ghost:active { transform: translateY(1px); }

.me-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.me-actions button { flex: 1 1 40%; min-width: 78px; padding: 9px 6px; font-size: 12px; border-radius: 10px; border: none; cursor: pointer; font-weight: 700; font-family: inherit; }
.me-actions .recharge { background: #fff; color: #4338ca; }
.me-actions .signin { background: rgba(255,255,255,.2); color: #fff; border: 1px solid rgba(255,255,255,.28); }
.me-actions .signin.done { background: rgba(255,255,255,.38); }
.me-actions .card { background: rgba(255,255,255,.2); color: #fff; border: 1px solid rgba(255,255,255,.28); }
.me-actions .admin { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #78350f; }
.me-bottom-bar { display: flex; gap: 10px; margin: 18px 0 8px; padding-top: 14px; border-top: 1px solid #eef0f6; }
.me-bottom-bar .me-logout { flex: 1; margin: 0; padding: 10px; font-size: 13px; background: #fff; color: #6b7280; border: 1px solid #e5e7eb; }
.me-bottom-bar .me-logout.danger { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.me-logout { background: rgba(255,255,255,.14); color: rgba(255,255,255,.9); border: 1px solid rgba(255,255,255,.22); padding: 7px 20px; border-radius: 20px; font-size: 12px; cursor: pointer; font-family: inherit; margin: 0 4px; }
.me-logout.danger { background: rgba(239,68,68,.18); border-color: rgba(239,68,68,.5); color: #ffd9d9; }
.me-logout.danger:hover { background: rgba(239,68,68,.3); }
.contract-preview { max-height: 260px; overflow-y: auto; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 10px; padding: 12px; font-size: 12px; line-height: 1.75; white-space: pre-wrap; font-family: inherit; color: #374151; margin: 8px 0 12px; text-align: left; }
.contract-agree { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: #374151; margin: 10px 0 4px; cursor: pointer; line-height: 1.6; }
.contract-agree input { margin-top: 2px; flex: none; }
.field-err { color: #ef4444; font-size: 12px; margin-top: 6px; line-height: 1.5; }

.me-segment { display: flex; background: #fff; border-radius: 14px; padding: 4px; margin-bottom: 14px; box-shadow: 0 2px 10px rgba(17,24,39,.05); }
.me-segment .seg { flex: 1; padding: 9px 4px; border: none; background: transparent; border-radius: 10px; font-size: 12px; cursor: pointer; color: #6b7280; transition: all .15s; font-weight: 600; font-family: inherit; }
.me-segment .seg.active { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; box-shadow: 0 3px 10px rgba(99,102,241,.28); }

/* 使用说明 */
.help-wrap { display: flex; flex-direction: column; gap: 10px; }
.help-card { background: #fff; border-radius: 16px; padding: 14px 16px; border: 1px solid #f1f2f7; box-shadow: 0 2px 10px rgba(17,24,39,.04); }
.help-card > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 0; }
.help-card > summary::-webkit-details-marker { display: none; }
.help-card > summary::after { content: '展开'; font-size: 12px; font-weight: 500; color: #9ca3af; flex: none; }
.help-card[open] > summary { margin-bottom: 8px; }
.help-card[open] > summary::after { content: '收起'; }
.help-title { font-size: 14px; font-weight: 800; margin-bottom: 8px; color: #111827; }
.help-list { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.85; color: #374151; }
.help-list li { margin-bottom: 4px; }
.help-list b { color: #4338ca; }
.help-step { border-left: 4px solid #6366f1; }
.help-intro { border-left: 4px solid #10b981; }
.help-note { border-left: 4px solid #f59e0b; background: #fff; }

/* ============ 底部导航 ============ */
.bottom-nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 680px; display: flex; background: rgba(255,255,255,.97); backdrop-filter: blur(10px); border-top: 1px solid #eef0f6; box-shadow: 0 -6px 20px rgba(17,24,39,.07); z-index: 100; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; }
.nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 4px 0 6px; border: none; background: none; color: #9ca3af; font-size: 11px; cursor: pointer; transition: color .15s; font-family: inherit; position: relative; }
.nav-item.active { color: #4f46e5; }
.nav-item.active .ni-ic { transform: translateY(-1px); }
.ni-ic { font-size: 20px; line-height: 1; margin-bottom: 3px; transition: transform .15s; filter: grayscale(.25); }
.nav-item.active .ni-ic { filter: none; }
.ni-lb { font-size: 11px; font-weight: 600; }
.nav-create .ni-ic { width: 46px; height: 46px; margin-top: -20px; margin-bottom: 2px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #a855f7); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 16px rgba(99,102,241,.45); border: 3px solid #fff; font-size: 19px; filter: none; }
.nav-create.active .ni-ic { box-shadow: 0 8px 20px rgba(99,102,241,.55); }
.nav-create .ni-lb { margin-top: 1px; }

/* ============ 弹窗 / 提示 ============ */
.modal { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; }
.modal[hidden] { display: none !important; }
.modal-bg { position: absolute; inset: 0; background: rgba(15,23,42,.55); backdrop-filter: blur(2px); }
.modal-body { position: relative; background: #fff; border-radius: 20px; padding: 20px; max-width: 92vw; max-height: 85vh; overflow-y: auto; width: 430px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal-title { font-size: 16px; font-weight: 800; margin-bottom: 14px; }
.modal-close { position: absolute; top: 12px; right: 12px; background: none; border: none; font-size: 20px; cursor: pointer; color: #9ca3af; }
.modal-actions { display: flex; gap: 8px; margin-top: 16px; justify-content: flex-end; flex-wrap: wrap; }
.modal-actions button { padding: 9px 18px; border-radius: 10px; border: none; cursor: pointer; font-size: 13px; font-weight: 600; font-family: inherit; }
.modal-actions .ok { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; }
.modal-actions .cancel { background: #f3f4f6; color: #374151; }
.modal-actions .danger { background: #ef4444; color: #fff; }

.profile-edit-avatar { display: flex; align-items: center; gap: 12px; padding: 12px; background: #f9fafb; border-radius: 12px; margin-bottom: 14px; cursor: pointer; font-size: 12px; color: #6b7280; }
.profile-edit-avatar .me-avatar { width: 52px; height: 52px; background: linear-gradient(135deg, #6366f1, #a855f7); border: none; font-size: 20px; }
.profile-edit-avatar img { width: 100%; height: 100%; object-fit: cover; }
.account-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #f3f4f6; font-size: 13px; color: #6b7280; }
.account-row b { color: #111827; }

.loader { position: fixed; inset: 0; z-index: 400; background: rgba(255,255,255,.88); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; }
.loader[hidden] { display: none !important; }
.loader-card { width: 78%; max-width: 320px; background: #fff; border-radius: 16px; padding: 20px 18px 16px; box-shadow: 0 12px 32px rgba(79,70,229,.16); }
.loader-bar { height: 10px; border-radius: 999px; background: #eef0f8; overflow: hidden; }
.loader-bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #6366f1, #a855f7); transition: width .35s ease; }
.loader-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.loader-text { font-size: 13px; color: #374151; flex: 1; }
.loader-pct { font-size: 12px; font-weight: 700; color: #6366f1; }

.alert { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 500; padding: 11px 20px; border-radius: 12px; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.15); max-width: 85vw; text-align: center; }
.alert-ok { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.alert-err { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-info { background: #e0e7ff; color: #3730a3; border: 1px solid #a5b4fc; }

/* ============ 充值 / 管理后台 ============ */
.pay-tab { background: #f3f4f6; color: #374151; border: none; padding: 7px 13px; border-radius: 10px; font-size: 12px; cursor: pointer; font-weight: 600; font-family: inherit; }
.pay-tab.active { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; }
.packs-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.pack-item { position: relative; padding: 14px 10px; border: 2px solid #e5e7eb; border-radius: 14px; cursor: pointer; text-align: center; transition: all .15s; background: #fff; }
.pack-item.selected { border-color: #6366f1; background: #eef2ff; }
.pack-item.best { border-color: #fbbf24; background: linear-gradient(180deg, #fffdf5, #fff); }
.pack-best { position: absolute; top: -9px; right: 10px; font-size: 10px; font-weight: 700; background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #78350f; padding: 2px 8px; border-radius: 10px; }
.pack-save { position: absolute; top: -9px; left: 10px; font-size: 10px; font-weight: 800; background: linear-gradient(135deg, #f43f5e, #ef4444); color: #fff; padding: 2px 8px; border-radius: 10px; }
.pack-item.selected .pack-save { background: linear-gradient(135deg, #6366f1, #8b5cf6); }

.filter-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip { flex-shrink: 0; font-size: 12px; font-weight: 600; color: #6b7280; background: #fff; border: 1px solid #e8eaf3; border-radius: 999px; padding: 6px 14px; cursor: pointer; transition: all .15s; }
.filter-chip.active { color: #fff; background: linear-gradient(135deg, #6366f1, #8b5cf6); border-color: transparent; box-shadow: 0 4px 12px rgba(99,102,241,.25); }

.pack-name { font-size: 11px; color: #6b7280; font-weight: 600; }
.pack-price { font-size: 24px; font-weight: 800; color: #ef4444; line-height: 1.3; }
.pack-price-pay { cursor: pointer; }
.pack-price-pay:active { opacity: .7; }
.pack-price-pay .pay-jump { display: inline-block; font-size: 10px; font-weight: 600; color: #fff; background: #1677ff; border-radius: 999px; padding: 2px 7px; vertical-align: middle; margin-left: 2px; }
.pack-words { font-size: 13px; font-weight: 700; color: #111827; margin-top: 2px; }
.pack-unit { font-size: 10px; color: #9ca3af; margin-top: 3px; }
.pack-bonus { font-size: 11px; color: #f59e0b; margin-top: 2px; }

.admin-panel { position: fixed; inset: 0; z-index: 250; background: #f4f5fb; display: flex; flex-direction: column; }
.admin-panel header { display: flex; justify-content: space-between; padding: 12px 16px; background: #fff; border-bottom: 1px solid #e5e7eb; align-items: center; }
.admin-panel header h2 { margin: 0; font-size: 16px; }
.admin-panel main { flex: 1; overflow-y: auto; padding: 12px; }
.admin-tabs { display: flex; gap: 4px; padding: 8px; background: #fff; border-radius: 10px; margin-bottom: 12px; }
.admin-tabs button { flex: 1; padding: 8px; border: none; background: transparent; border-radius: 8px; font-size: 13px; cursor: pointer; }
.admin-tabs button.active { background: #6366f1; color: #fff; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.admin-table th, .admin-table td { padding: 8px 6px; border-bottom: 1px solid #f3f4f6; text-align: left; }
.admin-table th { font-weight: 600; color: #6b7280; background: #f9fafb; }
.admin-panel tr:hover { background: #f9fafb; }
.admin-panel .btn { padding: 4px 10px; font-size: 11px; border-radius: 4px; border: none; cursor: pointer; }
.admin-panel .btn-primary { background: #6366f1; color: #fff; }
.admin-panel .btn-danger { background: #ef4444; color: #fff; }
.card-gen-bar { display: flex; gap: 8px; margin-bottom: 12px; align-items: center; }
.card-gen-bar input { width: 60px; padding: 6px; border: 1px solid #e5e7eb; border-radius: 6px; }

/* ============ 活动页 ============ */
.act-hero { background: linear-gradient(135deg, #6366f1, #a855f7); color: #fff; border-radius: 18px; padding: 20px 18px; margin-bottom: 14px; }
.act-hero h2 { font-size: 20px; margin-bottom: 6px; }
.act-hero p { font-size: 12px; opacity: .9; }
.act-card { background: #fff; border: 1px solid #eef0f8; border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.act-card h3 { font-size: 15px; margin-bottom: 6px; color: #1f2937; }
.act-tag { display: inline-block; font-size: 11px; font-weight: 700; color: #4f46e5; background: #eef2ff; border-radius: 999px; padding: 2px 8px; margin-bottom: 8px; }
.act-desc { font-size: 13px; color: #4b5563; line-height: 1.7; }
.act-note { font-size: 11px; color: #9ca3af; line-height: 1.6; margin-top: 8px; }
.act-btn { margin-top: 10px; width: 100%; }
.act-btn:disabled { opacity: .5; cursor: not-allowed; }
.hoard-wrap { margin-top: 10px; }
.hoard-bar { height: 8px; background: #eef0f8; border-radius: 999px; overflow: hidden; }
.hoard-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #6366f1, #a855f7); transition: width .3s; }
.hoard-text { font-size: 11px; color: #6b7280; margin-top: 6px; }
.coupon-list { display: flex; flex-direction: column; gap: 8px; }
.coupon { display: flex; align-items: center; gap: 12px; background: linear-gradient(90deg, #fff7ed, #fffbeb); border: 1px dashed #fdba74; border-radius: 12px; padding: 10px 12px; }
.cp-val { font-size: 18px; font-weight: 800; color: #ea580c; min-width: 48px; text-align: center; }
.cp-info { display: flex; flex-direction: column; font-size: 11px; color: #9a3412; gap: 2px; }
.cp-info b { font-size: 13px; }
.coupon-box { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; padding: 9px 12px; background: #fffbeb; border: 1px dashed #fcd34d; border-radius: 10px; font-size: 12px; color: #92400e; flex-wrap: wrap; }
.cp-use { font-weight: 700; }
.cp-pay b { color: #dc2626; font-size: 14px; }
.cp-none { color: #9ca3af; }
.act-tool { margin-top: 10px; }
.act-textarea { width: 100%; box-sizing: border-box; border: 1px solid #e5e7eb; border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.7; color: #1f2937; font-family: inherit; resize: vertical; background: #fbfbfd; }
.act-textarea:focus { outline: none; border-color: #a5b4fc; background: #fff; }
.act-tool-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.act-counter { font-size: 11px; color: #9ca3af; }
.act-result { margin-top: 10px; border: 1px solid #eef0f8; border-radius: 10px; overflow: hidden; }
.act-result-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background: #f5f3ff; font-size: 12px; font-weight: 600; color: #4c1d95; }
.act-result-body { padding: 12px; font-size: 13px; line-height: 1.8; color: #374151; white-space: pre-wrap; word-break: break-word; max-height: 320px; overflow-y: auto; }
.act-specs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.act-specs span { font-size: 11px; font-weight: 600; color: #4f46e5; background: #eef2ff; border-radius: 999px; padding: 3px 9px; }

/* ============ 卖点与转化（重设计） ============ */
.hero-glow { position: absolute; width: 220px; height: 220px; right: -70px; bottom: -90px; border-radius: 50%; background: radial-gradient(circle, rgba(251,191,36,.55), transparent 70%); pointer-events: none; }
.hero-kicker { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .5px; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.3); padding: 3px 9px; border-radius: 999px; margin-bottom: 7px; position: relative; z-index: 1; }
.hero-points { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; position: relative; z-index: 1; }
.hero-points span { font-size: 10px; font-weight: 600; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.22); padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.hero-foot { position: relative; z-index: 1; margin-top: 9px; font-size: 10px; text-align: center; opacity: .82; letter-spacing: .2px; }

.feature-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 4px; }
.feature-item { background: #fff; border: 1px solid #eef0f8; border-radius: 14px; padding: 12px 9px; text-align: center; box-shadow: 0 2px 10px rgba(17,24,39,.04); }
.feature-item .fi-ic { font-size: 18px; line-height: 1; margin-bottom: 6px; }
.feature-item b { display: block; font-size: 11px; color: #1f2937; line-height: 1.35; margin-bottom: 4px; }
.feature-item span { display: block; font-size: 10px; color: #9ca3af; line-height: 1.5; }

.empty-hint { text-align: center; padding: 36px 20px; color: #9ca3af; font-size: 13px; line-height: 1.8; background: #fff; border: 1px dashed #e2e5f0; border-radius: 18px; }
.empty-hint .eh-ic { font-size: 34px; margin-bottom: 10px; }
.empty-hint .eh-title { font-size: 15px; font-weight: 700; color: #374151; margin-bottom: 6px; }
.empty-hint .eh-sub { font-size: 12px; color: #9ca3af; margin-bottom: 14px; }
.empty-hint .eh-btn { border: none; cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 700; color: #fff; padding: 10px 22px; border-radius: 12px; background: linear-gradient(135deg, #6366f1, #8b5cf6); box-shadow: 0 6px 16px rgba(99,102,241,.3); }

.book-card { transition: transform .15s, box-shadow .15s; }
.book-card:active { transform: scale(.99); }
.book-card .cover { box-shadow: inset 0 0 0 1px rgba(255,255,255,.22); }

.act-hero { position: relative; overflow: hidden; padding: 20px 18px 16px; }
.act-hero::after { content: ''; position: absolute; width: 180px; height: 180px; right: -60px; top: -70px; border-radius: 50%; background: rgba(251,191,36,.3); filter: blur(10px); }
.act-hero-tag { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: 1px; background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #78350f; padding: 3px 10px; border-radius: 999px; margin-bottom: 8px; position: relative; z-index: 1; }
.act-hero h2 { position: relative; z-index: 1; margin: 0 0 5px; font-size: 21px; font-weight: 800; }
.act-hero p { position: relative; z-index: 1; font-size: 12px; opacity: .9; margin: 0; }
.act-hero-stats { display: flex; gap: 8px; margin-top: 14px; position: relative; z-index: 1; }
.act-hero-stats > div { flex: 1; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.2); border-radius: 12px; padding: 8px 6px; text-align: center; }
.act-hero-stats b { display: block; font-size: 15px; font-weight: 800; }
.act-hero-stats span { font-size: 10px; opacity: .82; }

.act-card { position: relative; }
.act-card-free { border: 1px solid #d1fae5; background: linear-gradient(180deg, #f0fdf4, #fff 45%); }
.act-card-hot { border: 2px solid #fbbf24; background: linear-gradient(180deg, #fffdf5, #fff 40%); box-shadow: 0 8px 24px rgba(251,191,36,.18); }
.act-ribbon { position: absolute; top: -10px; right: 12px; background: linear-gradient(135deg, #f43f5e, #f59e0b); color: #fff; font-size: 10px; font-weight: 800; padding: 3px 10px; border-radius: 999px; box-shadow: 0 4px 10px rgba(244,63,94,.3); }
.act-price { display: flex; align-items: baseline; gap: 6px; margin: 6px 0 8px; flex-wrap: wrap; }
.act-price .ap-cur { font-size: 14px; font-weight: 800; color: #ef4444; }
.act-price .ap-num { font-size: 32px; font-weight: 900; color: #ef4444; line-height: 1; letter-spacing: -1px; }
.act-price .ap-old { font-size: 11px; color: #9ca3af; text-decoration: line-through; margin-left: 4px; }
.act-price .ap-off { font-size: 10px; font-weight: 700; color: #fff; background: #ef4444; padding: 2px 8px; border-radius: 999px; }
.act-btn-lg { font-size: 15px; padding: 13px; border-radius: 14px; }
.act-desc b { color: #dc2626; }

.act-trust { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0 10px; }
.at-item { background: #fff; border: 1px solid #eef0f8; border-radius: 12px; padding: 10px 4px; text-align: center; }
.at-item b { display: block; font-size: 16px; margin-bottom: 3px; }
.at-item span { font-size: 10px; color: #6b7280; }
.act-disclaimer { font-size: 11px; color: #b45309; background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: 9px 12px; line-height: 1.6; }

@media (max-width: 380px) {
  .feature-row { grid-template-columns: 1fr; }
  .feature-item { display: flex; align-items: center; gap: 10px; text-align: left; }
  .feature-item .fi-ic { margin-bottom: 0; }
  .feature-item b { margin-bottom: 1px; }
  .act-trust { grid-template-columns: repeat(2, 1fr); }
}

/* ============ 正式版质感层（统一表面 / 收敛色彩 / 精细描边） ============ */
:root {
  --ink: #101828;
  --ink-2: #344054;
  --muted: #667085;
  --line: #e7e9ee;
  --surface: #ffffff;
  --canvas: #f6f7f9;
  --brand: #4f46e5;
  --brand-ink: #3730a3;
  --radius: 14px;
}
html, body { background: var(--canvas); color: var(--ink); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
#app { padding: 0 16px; }

/* 顶部栏：白底细线，去掉彩色渐变与投影 */
.topbar { background: rgba(255,255,255,.92); backdrop-filter: saturate(1.6) blur(12px); color: var(--ink); margin: 0 -16px; padding: 11px 16px; border-radius: 0; box-shadow: none; border-bottom: 1px solid var(--line); }
.logo { font-size: 17px; font-weight: 800; letter-spacing: .2px; color: var(--ink); }
.logo-dot { background: #f2f4f7; color: var(--muted); font-weight: 600; border: 1px solid var(--line); }
.tb-balance { background: #f2f4f7; color: var(--ink); border: 1px solid var(--line); backdrop-filter: none; font-weight: 600; }
.tb-balance b { color: var(--brand-ink); }
.tb-avatar { border: 1px solid var(--line); background: #eef0f4; color: var(--ink-2); }

/* 卡片：统一细描边 + 轻投影 */
.card, .work-card, .book-card, .help-card, .act-card, .feature-item, .at-item, .chapter-item, .ch-editor-block, .batch-bar {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.card { padding: 16px; margin-bottom: 12px; }
.section-head { margin: 20px 2px 10px; }
.section-head h3 { font-size: 15px; letter-spacing: .1px; }
.section-head h3::before { width: 2px; height: 13px; background: var(--brand); }
.card-title { font-size: 13px; color: var(--ink-2); }

/* 主色调收敛为单色品牌蓝 */
.btn-primary, .hero-cta, .stage.active, .chip.active, .filter-chip.active, .me-segment .seg.active,
.pack-item.selected, .nav-create .ni-ic, .act-btn, .modal-actions .ok, .empty-hint .eh-btn {
  background: var(--brand);
  background-image: none;
  box-shadow: none;
}
.btn-primary { background: var(--brand); color: #fff; border-radius: 12px; font-weight: 600; }
.btn-primary:active { filter: brightness(.94); transform: none; }
.btn-outline { border-color: #d7d9e4; color: var(--ink-2); background: var(--surface); }
.btn-ghost { background: #f2f4f7; color: var(--brand-ink); }
.chip.active, .filter-chip.active, .stage.active { color: #fff; }
.stage { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.chip { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.chip:hover { border-color: #c9ccf0; color: var(--brand-ink); background: #f7f7ff; }
.btn-white { background: #fff; color: var(--brand-ink); }
.btn-gold { background: #f5c451; color: #4a2c00; }

/* 头图：深墨色，去掉紫色霓虹 */
.hero-card, .me-header, .books-hero {
  background: linear-gradient(150deg, #171a21 0%, #232734 62%, #2c3040 100%);
  box-shadow: 0 10px 28px rgba(16,24,40,.16);
  border-radius: 18px;
}
.hero-card::after { background: radial-gradient(circle, rgba(245,196,81,.22), transparent 70%); width: 190px; height: 190px; right: -60px; top: -60px; }
.hero-card::before { background: rgba(255,255,255,.05); }
.hero-chip, .hero-points span, .hero-kicker { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.16); }
.hero-cta { background: #fff; color: var(--ink); font-weight: 700; box-shadow: 0 6px 16px rgba(0,0,0,.18); border-radius: 12px; }
.hs-item, .act-hero-stats > div { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); }
.me-balance-card { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.12); }
.me-actions .recharge { background: #fff; color: var(--ink); }
.me-actions .signin, .me-actions .card { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.18); }
.act-hero { background: linear-gradient(150deg, #171a21 0%, #232734 62%, #2c3040 100%); border-radius: 18px; }
.act-hero-tag { background: #f5c451; color: #4a2c00; }
.act-hero::after { background: rgba(245,196,81,.18); }
.books-hero .btn-gold, .act-hero .btn-gold { background: #f5c451; color: #3f2700; }
.books-hero .btn-white { background: #fff; color: var(--ink); }

/* 底部导航：白底发丝线 + 线性图标 */
.bottom-nav { background: rgba(255,255,255,.96); backdrop-filter: saturate(1.8) blur(14px); border-top: 1px solid var(--line); box-shadow: 0 -1px 0 rgba(16,24,40,.03); border-radius: 0; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); }
.nav-item { color: #98a2b3; padding: 2px 0 4px; }
.nav-item.active { color: var(--brand); }
.ni-ic { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; margin-bottom: 4px; filter: none; }
.ni-ic svg { width: 22px; height: 22px; }
.ni-lb { font-size: 10px; font-weight: 600; letter-spacing: .2px; }
.nav-item.active .ni-ic { transform: none; }
.nav-create .ni-ic { width: 44px; height: 44px; margin-top: -18px; background: var(--brand); border: 3px solid #fff; box-shadow: 0 4px 12px rgba(79,70,229,.28); }
.nav-create .ni-ic svg { width: 20px; height: 20px; }
.nav-create.active .ni-ic { box-shadow: 0 6px 14px rgba(79,70,229,.34); }

/* 表单与输入 */
.form-row label { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.form-row input, .form-row textarea, .form-row select, .stepper input, .chapter-head input, .chapter-item textarea, .ch-editor-block textarea, .act-textarea {
  background: #fbfbfd; border-color: var(--line); border-radius: 10px; font-size: 14px;
}
.form-row input:focus, .form-row textarea:focus, .form-row select:focus, .act-textarea:focus {
  border-color: #b4b0f5; box-shadow: 0 0 0 3px rgba(79,70,229,.1); background: #fff;
}
.form-hint, .step-tip { background: #f7f8fb; border: 1px solid var(--line); border-left: 3px solid var(--brand); color: var(--muted); border-radius: 10px; }
.step-tip b { color: var(--brand-ink); }
.stepper button { background: var(--surface); border-color: var(--line); border-radius: 10px; color: var(--ink-2); }

/* 进度与数字 */
.wc-progress, .stage-progress-bar, .hoard-bar { background: #eceef3; }
.wc-progress i, .stage-progress-bar i, .hoard-bar i, .loader-bar i { background: var(--brand); background-image: none; }
.loader-card { border-radius: 16px; box-shadow: 0 16px 40px rgba(16,24,40,.18); }
.loader-pct { color: var(--brand); }

/* 弹窗 */
.modal-body { border-radius: 16px; box-shadow: 0 24px 64px rgba(16,24,40,.28); padding: 20px; }
.modal-title { font-size: 16px; font-weight: 700; }
.modal-actions button { border-radius: 10px; }

/* 书城卡片细节 */
.book-card { padding: 9px; }
.book-card .cover { border-radius: 8px; }
.bfoot { border-top-color: var(--line); }
.book-tag { border-radius: 4px; letter-spacing: .2px; }
.book-tag.trial { background: rgba(245,196,81,.95); color: #3f2700; }
.book-viewer { background: #fafafa; }
.book-viewer .content { font-size: 15.5px; line-height: 2.05; color: #1a1d24; }
.viewer-lock { background: #f7f8fb; border-color: var(--line); }

/* 功能图标块化，弱化 emoji 廉价感 */
.feature-item .fi-ic, .empty-hint .eh-ic {
  width: 32px; height: 32px; margin: 0 auto 8px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: #f2f4f7; border: 1px solid var(--line); font-size: 16px;
}
.empty-hint .eh-ic { width: 44px; height: 44px; font-size: 22px; margin-bottom: 12px; }
.empty-hint .eh-btn { border-radius: 10px; }

/* 活动卡克制化 */
.act-card-hot { border: 1px solid #e9c46a; box-shadow: 0 6px 18px rgba(16,24,40,.06); background: #fffdf6; }
.act-ribbon { background: #f5c451; color: #3f2700; box-shadow: none; }
.act-price .ap-num, .act-price .ap-cur { color: #d92d20; }
.pack-price { color: #d92d20; }
.pack-item.best { border-color: #e9c46a; background: #fffdf6; }
.pack-best { background: #f5c451; color: #3f2700; }
.pack-save, .pack-item.selected .pack-save { background: #d92d20; }
.pack-item.selected { border-color: var(--brand); background: #f5f5ff; }
.act-disclaimer { background: #fffaeb; border-color: #f3e0b5; color: #8a5a00; }

/* 使用说明 */
.help-card { padding: 14px 16px; }
.help-step { border-left: 3px solid var(--brand); }
.help-intro { border-left: 3px solid #12b76a; }
.help-note { border-left: 3px solid #f5c451; }
.help-title { font-size: 14px; }

/* 细节：滚动条与点击反馈 */
* { scrollbar-width: thin; scrollbar-color: #d5d8e0 transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #d5d8e0; border-radius: 999px; }
button { transition: opacity .12s, background-color .12s, border-color .12s, transform .12s; }
button:active { opacity: .88; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ============ 全局排版统一层（字号阶梯 / 间距节奏） ============ */
/* 统一字号阶梯：11 / 12 / 12.5 / 13 / 14 / 15 / 17 / 18 / 24 / 32，避免 9.5px、10px 这类过小字 */
html, body { font-size: 14px; line-height: 1.6; }

/* 页面纵向节奏 */
.page { padding: 16px 0 12px; }
.page-header { margin-bottom: 14px; }
.page-header h2 { font-size: 18px; line-height: 1.4; }
.section-head { margin: 20px 2px 10px; }
.section-head h3 { font-size: 15px; line-height: 1.4; }
.section-count { font-size: 12px; }

/* 卡片 */
.card { padding: 16px; margin-bottom: 12px; }
.card-title { font-size: 13px; line-height: 1.4; margin-bottom: 12px; }

/* 按钮：统一高度与字号，保证手指可点 */
.btn-primary, .btn-outline { min-height: 42px; font-size: 14px; line-height: 1.4; padding: 11px 18px; }
.btn-ghost, .btn-sm { min-height: 34px; font-size: 12.5px; padding: 7px 13px; }
.hero-cta { min-height: 44px; font-size: 14px; padding: 12px; }
.form-actions { gap: 8px; margin: 14px 0; }
.form-actions button { min-height: 42px; }

/* 头图区 */
.hero-card { padding: 18px; }
.hero-title { font-size: 18px; line-height: 1.35; }
.hero-sub { font-size: 12.5px; line-height: 1.5; margin-top: 4px; }
.hero-kicker { font-size: 10.5px; padding: 3px 9px; margin-bottom: 8px; }
.hero-chip { font-size: 12px; padding: 5px 10px; }
.hero-points { gap: 6px; margin-top: 10px; }
.hero-points span { font-size: 11px; line-height: 1.4; padding: 4px 9px; }
.hero-stats { gap: 8px; margin: 14px 0; }
.hs-item { padding: 9px 8px; }
.hs-item b { font-size: 17px; line-height: 1.3; }
.hs-item span { font-size: 11px; }
.hero-foot { font-size: 11px; line-height: 1.6; }

/* 空状态 */
.empty-hint { padding: 40px 20px; font-size: 13px; line-height: 1.7; }
.empty-hint .eh-title { font-size: 15px; line-height: 1.4; }
.empty-hint .eh-sub { font-size: 12.5px; line-height: 1.6; }
.empty-hint .eh-btn { min-height: 42px; font-size: 13.5px; }

/* 作品卡 */
.work-list { gap: 10px; }
.work-card { padding: 12px; gap: 12px; }
.work-card h3 { font-size: 15px; line-height: 1.4; margin-bottom: 6px; }
.work-meta { font-size: 11.5px; gap: 8px; }
.work-meta .badge { font-size: 10.5px; }
.wc-time { font-size: 11px; }
.work-actions { gap: 8px; margin-top: 10px; }
.work-actions button { font-size: 12px; padding: 6px 12px; }

/* 创作台 */
.create-title { font-size: 18px; line-height: 1.4; }
.create-sub { font-size: 12px; margin-top: 3px; }
.stage-progress { margin-bottom: 12px; }
.stage-progress-label { font-size: 11.5px; }
.stage-bar { gap: 6px; padding: 4px 0 12px; }
.stage { font-size: 12.5px; padding: 8px 12px; }
.form-row { margin-bottom: 14px; }
.form-row label { font-size: 12.5px; margin-bottom: 6px; }
.form-row input, .form-row textarea, .form-row select { font-size: 14px; padding: 11px 12px; line-height: 1.5; }
.form-hint { font-size: 12.5px; line-height: 1.6; padding: 10px 12px; }
.step-tip { font-size: 12.5px; line-height: 1.7; padding: 11px 12px; }
.outline-box { margin-top: 14px; }
.outline-title { font-size: 13px; margin-bottom: 8px; }
.outline-box textarea { font-size: 13.5px; line-height: 1.8; }
.stepper input { font-size: 14px; }
.chip { font-size: 12.5px; padding: 8px 14px; }
.ch-editor-block .ch-head h4 { font-size: 14.5px; }
.ch-editor-block .ch-stat { font-size: 11.5px; }
.ch-editor-block textarea { font-size: 13.5px; line-height: 1.8; }
.batch-all { font-size: 12.5px; }
.batch-info { font-size: 12px; }
.finish-bar { font-size: 12.5px; line-height: 1.6; }

/* 书城与阅读器 */
.books-actions { margin-top: 14px; }
.books-actions button { font-size: 13.5px; padding: 11px; }
.book-grid { gap: 10px; }
.book-card { padding: 10px; }
.book-card .cover-title { font-size: 32px; }
.btitle { font-size: 14px; line-height: 1.4; }
.bmeta { font-size: 11.5px; }
.bmeta2 { font-size: 11.5px; line-height: 1.5; }
.bfoot { font-size: 11px; }
.filter-chip { font-size: 12.5px; padding: 7px 14px; }
.book-viewer .content { font-size: 16px; line-height: 2.05; }
.viewer-lock { padding: 20px 16px; }
.vl-title { font-size: 16px; line-height: 1.4; }
.vl-sub { font-size: 12.5px; line-height: 1.6; margin: 6px 0 14px; }
.vl-tip { font-size: 11.5px; }

/* 我的 */
.me-header { padding: 18px; margin-bottom: 14px; }
.me-name { font-size: 17px; line-height: 1.4; }
.me-id { font-size: 11.5px; }
.me-balance-card { padding: 14px 16px; margin-top: 16px; }
.mb-label { font-size: 11.5px; }
.me-balance { font-size: 32px; line-height: 1.2; margin: 4px 0 12px; }
.me-balance-hint { font-size: 11.5px; line-height: 1.6; }
.me-actions { gap: 8px; }
.me-actions button { font-size: 12.5px; padding: 10px 6px; }
.me-segment { margin-bottom: 14px; }
.me-segment .seg { font-size: 12.5px; padding: 10px 4px; }
.help-wrap { gap: 10px; }
.help-card { padding: 14px 16px; }
.help-title { font-size: 14.5px; line-height: 1.4; }
.help-list { font-size: 13.5px; line-height: 1.9; padding-left: 18px; }
.help-list li { margin-bottom: 6px; }
.account-row { font-size: 13.5px; padding: 11px 0; }
.contract-preview { font-size: 12.5px; line-height: 1.8; }
.contract-agree { font-size: 12.5px; line-height: 1.6; }

/* 活动 */
.act-hero { padding: 20px 18px 16px; }
.act-hero h2 { font-size: 20px; line-height: 1.35; }
.act-hero p { font-size: 12.5px; line-height: 1.6; }
.act-hero-tag { font-size: 10.5px; }
.act-hero-stats { gap: 8px; margin-top: 14px; }
.act-hero-stats > div { padding: 9px 6px; }
.act-hero-stats b { font-size: 15px; line-height: 1.3; }
.act-hero-stats span { font-size: 10.5px; }
.act-card { padding: 16px; margin-bottom: 12px; }
.act-card h3 { font-size: 15px; line-height: 1.4; margin-bottom: 8px; }
.act-tag { font-size: 11px; }
.act-desc { font-size: 13px; line-height: 1.75; }
.act-note { font-size: 11.5px; line-height: 1.65; }
.act-specs span { font-size: 11.5px; }
.act-price { margin: 8px 0 10px; }
.act-price .ap-num { font-size: 32px; }
.act-price .ap-old { font-size: 11.5px; }
.act-btn-lg { font-size: 15px; min-height: 46px; padding: 13px; }
.act-trust { gap: 8px; margin: 16px 0 10px; }
.at-item { padding: 12px 4px; }
.at-item b { font-size: 17px; line-height: 1.3; }
.at-item span { font-size: 11px; }
.act-disclaimer { font-size: 11.5px; line-height: 1.7; padding: 10px 12px; }
.coupon { padding: 12px; }
.cp-info { font-size: 11.5px; line-height: 1.5; }
.coupon-box { font-size: 12.5px; }

/* 弹窗 / 充值 / 后台 */
.modal-body { padding: 20px; }
.modal-title { font-size: 16px; line-height: 1.4; margin-bottom: 14px; }
.modal-actions { gap: 8px; margin-top: 18px; }
.modal-actions button { font-size: 13.5px; min-height: 40px; padding: 9px 18px; }
.packs-grid { gap: 10px; }
.pack-item { padding: 14px 10px; }
.pack-name { font-size: 11.5px; }
.pack-price { font-size: 24px; line-height: 1.3; }
.pack-words { font-size: 13.5px; }
.pack-unit { font-size: 11px; }
.pack-bonus { font-size: 11.5px; }
.loader-text { font-size: 13.5px; line-height: 1.5; }
.loader-pct { font-size: 12.5px; }
.alert { font-size: 13.5px; padding: 11px 18px; line-height: 1.5; }
.account-row:last-child { border-bottom: none; }

/* 底部导航 */
.ni-lb { font-size: 10.5px; }

/* ============ 手机适配（小屏重排 / 防横向溢出） ============ */
html, body { max-width: 100%; overflow-x: hidden; -webkit-text-size-adjust: 100%; }
#app { width: 100%; padding: 0 14px; }
.page, .page > *, .hero-card, .act-hero, .me-header, .card, .work-card, .book-card { min-width: 0; }
.hs-item, .at-item, .pack-item, .nav-item, .me-actions button, .act-hero-stats > div, .me-profile > * { min-width: 0; }
img, video { max-width: 100%; height: auto; }
.modal-body, .alert, .act-result-body, .contract-preview { overflow-wrap: break-word; word-break: break-word; }

/* 头图标题与右侧标签：窄屏自动换行，不让标签把标题挤出屏幕 */
.hero-row { gap: 8px; flex-wrap: wrap; }
.hero-row > div:first-child { flex: 1 1 auto; min-width: 0; }
.hero-chip { flex: none; }

@media (max-width: 480px) {
  /* 输入框统一 16px：避免 iOS 聚焦时自动放大整页（放大后会像内容溢出屏幕） */
  .form-row input, .form-row textarea, .form-row select,
  .stepper input, .chapter-head input, .chapter-item textarea,
  .ch-editor-block textarea, .outline-box textarea, .act-textarea,
  .vl-row input, .card-gen-bar input { font-size: 16px; }

  /* 顶栏 */
  .topbar { gap: 8px; padding: 9px 12px; margin: 0 -14px; }
  .logo { font-size: 16px; letter-spacing: .2px; }
  .logo-dot { display: none; }
  .tb-right { gap: 6px; }
  .tb-balance { padding: 5px 9px; font-size: 11px; }
  .tb-balance b { font-size: 12px; }
  .tb-avatar { width: 30px; height: 30px; font-size: 12px; }

  /* 作品页头图 */
  .hero-card, .act-hero { padding: 16px 14px; border-radius: 16px; }
  .hero-title { font-size: 17px; line-height: 1.4; }
  .hero-sub { font-size: 11.5px; }
  .hero-chip { font-size: 11px; padding: 5px 9px; }
  .hero-points { gap: 5px; margin-top: 8px; }
  .hero-points span { font-size: 10.5px; padding: 4px 8px; }
  .hero-stats { gap: 6px; margin: 12px 0; }
  .hs-item { padding: 8px 5px; }
  .hs-item b { font-size: 15px; }
  .hs-item span { font-size: 10.5px; }
  .hero-cta { padding: 11px; font-size: 13.5px; }
  .hero-foot { font-size: 10.5px; line-height: 1.6; }

  /* 三栏卖点改为横向列表，文字不再被挤成细条 */
  .feature-row { grid-template-columns: 1fr; gap: 8px; }
  .feature-item { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; }
  .feature-item .fi-ic { margin: 0; flex: none; }
  .feature-item b { font-size: 12px; margin-bottom: 1px; }
  .feature-item span { font-size: 11px; }

  .card { padding: 14px 12px; }
  .section-head { margin: 16px 2px 8px; }

  /* 活动页 */
  .act-hero h2 { font-size: 18px; }
  .act-hero-stats { gap: 6px; margin-top: 12px; }
  .act-hero-stats > div { padding: 7px 4px; }
  .act-hero-stats b { font-size: 13.5px; }
  .act-hero-stats span { font-size: 10.5px; }
  .act-trust { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .act-price .ap-num { font-size: 28px; }
  .act-btn-lg { font-size: 14px; padding: 12px; }

  /* 我的页 */
  .me-header { padding: 16px 14px; border-radius: 16px; }
  .me-profile { gap: 10px; }
  .me-avatar { width: 52px; height: 52px; font-size: 20px; }
  .me-name { font-size: 16px; gap: 6px; }
  .me-balance { font-size: 26px; }
  .me-actions { gap: 6px; }
  .me-actions button { min-width: 0; font-size: 12px; padding: 8px 4px; }
  .me-segment .seg { font-size: 12px; padding: 9px 2px; }
  .me-bottom-bar { gap: 8px; }

  /* 创作台 */
  .create-title { font-size: 17px; }
  .stage-bar { gap: 5px; }
  .stage { padding: 8px 10px; font-size: 12px; }
  .ch-editor-block { padding: 10px; }
  .ch-editor-block .row button { min-width: 0; flex: 1 1 45%; }
  .batch-bar { gap: 8px; padding: 9px 10px; }
  .batch-info { width: 100%; margin-left: 0; }
  .finish-bar button { margin-left: 0; width: 100%; }

  /* 书城与阅读器 */
  .book-grid { gap: 8px; }
  .book-card { padding: 8px; }
  .book-card .cover-title { font-size: 26px; }
  .book-viewer header { padding: 10px 12px; }
  .book-viewer main { padding: 16px 14px; }
  .book-viewer .content { font-size: 15px; line-height: 1.95; }
  .vl-row { flex-wrap: wrap; }
  .vl-row input { flex: 1 1 100%; }
  .vl-row button { padding: 10px 16px; }

  /* 弹窗 / 充值 / 底部导航 */
  .modal-body { width: auto; max-width: calc(100% - 24px); padding: 16px; max-height: 88vh; }
  .modal-title { font-size: 15.5px; }
  .packs-grid { gap: 8px; }
  .pack-item { padding: 12px 8px; }
  .pack-price { font-size: 20px; }
  .ni-lb { font-size: 10.5px; }
  body { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
}

@media (max-width: 360px) {
  #app { padding: 0 10px; }
  .topbar { margin: 0 -10px; padding: 9px 10px; }
  .form-grid { grid-template-columns: 1fr; }
  .packs-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 16px; }
  .me-balance { font-size: 22px; }
  .me-actions button { font-size: 11px; }
}

/* ============ 章节标题就地编辑 ============ */
.ch-head h4 { display: flex; align-items: center; gap: 4px; min-width: 0; }
.ch-title-input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-weight: 600;
  color: #101828;
  background: transparent;
  border: 0;
  border-bottom: 1px dashed rgba(16, 24, 40, .18);
  border-radius: 0;
  padding: 2px 2px 3px;
  outline: none;
}
.ch-title-input:focus { border-bottom-color: #4f46e5; }
.ch-title-input::placeholder { color: #98a2b3; font-weight: 400; }
@media (max-width: 480px) {
  .ch-head input { font-size: 16px; }
}
