:root {
  --ink: #0b1020;
  --ink-2: #11182b;
  --ink-3: #182138;
  --paper: #f7f3ea;
  --paper-2: #fffdf8;
  --text: #172033;
  --muted: #6f7788;
  --line: rgba(24, 32, 54, .12);
  --line-dark: rgba(255, 255, 255, .1);
  --accent: #ff5f3d;
  --accent-2: #ffb24a;
  --teal: #27c3b2;
  --success: #35b877;
  --danger: #e14b4b;
  --shadow: 0 22px 65px rgba(16, 23, 42, .13);
  --shadow-dark: 0 24px 80px rgba(2, 7, 18, .35);
  --radius: 24px;
  --radius-sm: 15px;
  --shell: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 0%, rgba(255, 178, 74, .11), transparent 31rem),
    radial-gradient(circle at 90% 8%, rgba(39, 195, 178, .10), transparent 28rem),
    #f4f1e9;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
::selection { color: #fff; background: var(--accent); }
.ambient {
  position: fixed;
  z-index: -2;
  border-radius: 50%;
  filter: blur(1px);
  pointer-events: none;
}
.ambient-a { width: 38rem; height: 38rem; top: -18rem; left: -12rem; background: radial-gradient(circle, rgba(255, 95, 61, .15), transparent 67%); }
.ambient-b { width: 44rem; height: 44rem; right: -18rem; top: 20rem; background: radial-gradient(circle, rgba(39, 195, 178, .12), transparent 68%); }
.noise { position: fixed; inset: 0; z-index: -1; opacity: .025; pointer-events: none; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E"); }
.shell { width: min(calc(100% - 40px), var(--shell)); margin-inline: auto; }
.app-main { padding-bottom: 100px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 80;
  border-bottom: 1px solid rgba(15, 22, 40, .07);
  background: rgba(247, 244, 237, .82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.topbar-inner { min-height: 72px; display: flex; align-items: center; gap: 34px; }
.brand { display: flex; align-items: center; gap: 11px; border: 0; background: transparent; padding: 6px 0; }
.brand-seal {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px 12px 12px 4px;
  color: #fff; background: linear-gradient(145deg, var(--accent), #d94a2e); font: 700 23px/1 "STKaiti", "KaiTi", serif;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25), 0 9px 22px rgba(255, 95, 61, .28);
}
.brand-copy { display: grid; text-align: left; line-height: 1; }
.brand-copy strong { letter-spacing: .12em; font-family: "STKaiti", "KaiTi", serif; font-size: 22px; }
.brand-copy small { margin-top: 6px; color: var(--muted); font-size: 8px; letter-spacing: .18em; }
.desktop-nav { display: flex; align-items: center; gap: 4px; margin-right: auto; }
.nav-link {
  padding: 10px 16px; border: 0; border-radius: 999px; color: #566071; background: transparent; font-weight: 600; font-size: 14px;
  transition: .2s ease;
}
.nav-link:hover { color: var(--text); background: rgba(255, 255, 255, .75); }
.nav-link.active { color: #fff; background: var(--ink); box-shadow: 0 8px 18px rgba(11, 16, 32, .17); }
.top-actions { display: flex; align-items: center; gap: 9px; }
.quota-chip {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 9px 13px;
  color: #4c5566; background: rgba(255, 255, 255, .62); font-size: 12px; font-weight: 700;
}
.quota-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(53, 184, 119, .12); }
.quota-chip.exhausted .quota-dot { background: var(--accent); box-shadow: 0 0 0 4px rgba(255, 95, 61, .12); }
.account-button { display: flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; background: transparent; padding: 5px 9px 5px 5px; color: #394254; font-weight: 700; font-size: 13px; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; background: linear-gradient(145deg, #283552, #11182b); font-family: "STKaiti", "KaiTi", serif; }
.account-button.member .avatar { background: linear-gradient(145deg, var(--accent-2), var(--accent)); }

.view { display: none; animation: viewIn .42s cubic-bezier(.2, .75, .25, 1); }
.view.active { display: block; }
@keyframes viewIn { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
.hero-grid { min-height: 650px; display: grid; grid-template-columns: 1.08fr .92fr; align-items: center; gap: 70px; padding: 78px 0 62px; }
.eyebrow { display: flex; align-items: center; gap: 9px; color: #7b8393; font-size: 11px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.eyebrow > span { width: 25px; height: 2px; background: var(--accent); }
.hero-copy h1 { margin: 20px 0 22px; font-family: "STKaiti", "KaiTi", "Songti SC", serif; font-size: clamp(48px, 5.4vw, 72px); line-height: 1.08; letter-spacing: -.055em; font-weight: 700; }
.hero-copy h1 em { color: var(--accent); font-style: normal; position: relative; }
.hero-copy h1 em::after { content: ""; position: absolute; z-index: -1; left: -2%; right: -2%; bottom: 4px; height: 13px; background: rgba(255, 178, 74, .25); transform: rotate(-1deg); }
.hero-lead { max-width: 630px; margin: 0; color: #636c7c; font-size: 17px; line-height: 1.95; }
.hero-actions { display: flex; align-items: center; gap: 12px; margin-top: 34px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid transparent; border-radius: 13px;
  padding: 12px 18px; font-weight: 800; font-size: 13px; transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.button:hover { transform: translateY(-2px); }
.button:active { transform: translateY(0); }
.button.large { min-height: 52px; padding-inline: 24px; border-radius: 15px; }
.button.primary { color: #fff; background: linear-gradient(135deg, var(--accent), #f04728); box-shadow: 0 13px 28px rgba(255, 95, 61, .26); }
.button.primary:hover { box-shadow: 0 17px 34px rgba(255, 95, 61, .34); }
.button.ghost { color: #253047; border-color: var(--line); background: rgba(255, 255, 255, .64); }
.button.light { color: var(--ink); background: #fff; box-shadow: 0 12px 28px rgba(0, 0, 0, .12); }
.button.full { width: 100%; }
.button:disabled { opacity: .55; cursor: not-allowed; transform: none !important; box-shadow: none; }
.free-offer { display: flex; align-items: center; gap: 12px; margin-top: 24px; color: var(--muted); font-size: 12px; }
.free-offer strong { color: #30394b; background: rgba(255, 255, 255, .7); border: 1px solid var(--line); border-radius: 999px; padding: 7px 11px; }
.hero-visual { position: relative; height: 490px; display: grid; place-items: center; }
.book-stack { position: relative; width: 330px; height: 390px; transform: rotate(3deg); }
.book-card { position: absolute; inset: 0; border-radius: 21px 21px 21px 7px; padding: 31px; box-shadow: var(--shadow-dark); }
.book-back { transform: translate(-30px, 13px) rotate(-8deg); color: rgba(255,255,255,.54); background: #283654; }
.book-mid { transform: translate(-12px, 7px) rotate(-3deg); color: rgba(255,255,255,.68); background: #18233a; }
.book-front { z-index: 2; color: #fff; background: linear-gradient(160deg, #161d32 0%, #0b1020 64%, #17172a 100%); border: 1px solid rgba(255, 255, 255, .11); overflow: hidden; }
.book-front::before { content: ""; position: absolute; width: 220px; height: 220px; right: -95px; top: -90px; border: 40px solid rgba(255, 95, 61, .18); border-radius: 50%; }
.book-card > span { position: absolute; top: 24px; right: 27px; color: rgba(255,255,255,.25); font-size: 9px; letter-spacing: .18em; }
.book-card > b { display: block; margin-top: 38px; font-family: "STKaiti", "KaiTi", serif; font-size: 27px; }
.book-card > i { display: block; width: 65%; height: 6px; margin-top: 12px; border-radius: 99px; background: rgba(255,255,255,.08); }
.book-card > i + i { width: 85%; margin-top: 8px; }
.book-status { display: flex; align-items: center; gap: 7px; color: #8de5d9; font-size: 9px; letter-spacing: .14em; }
.book-status span { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 5px rgba(39, 195, 178, .1); }
.book-quote { margin: 80px 0 22px; color: rgba(255,255,255,.82); font: italic 19px/1.6 Georgia, serif; }
.book-progress { height: 5px; border-radius: 99px; background: rgba(255,255,255,.1); }
.book-progress span { display: block; width: 67%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.book-front small { display: block; margin-top: 15px; color: rgba(255,255,255,.36); }
.floating-chip { position: absolute; z-index: 4; display: grid; gap: 3px; padding: 14px 17px; border: 1px solid rgba(255,255,255,.7); border-radius: 15px; background: rgba(255, 253, 248, .86); box-shadow: 0 17px 40px rgba(17, 25, 45, .17); backdrop-filter: blur(15px); }
.floating-chip b { font-size: 18px; }
.floating-chip span { color: var(--muted); font-size: 10px; }
.chip-a { left: -8px; top: 110px; animation: float 5s ease-in-out infinite; }
.chip-b { right: -8px; bottom: 76px; animation: float 5s ease-in-out .8s infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 36px 0 88px; }
.feature-card { position: relative; min-height: 235px; padding: 29px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255, 253, 248, .72); overflow: hidden; transition: .25s ease; }
.feature-card:hover { transform: translateY(-5px); background: #fffdf8; box-shadow: var(--shadow); }
.feature-index { position: absolute; right: 21px; top: 18px; color: #dfe1e4; font: 700 34px/1 Georgia, serif; }
.feature-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; color: #fff; background: var(--ink); font-family: "STKaiti", "KaiTi", serif; font-size: 22px; }
.feature-card:nth-child(2) .feature-icon { background: var(--accent); }
.feature-card:nth-child(3) .feature-icon { background: #288d83; }
.feature-card h3 { margin: 25px 0 11px; font-size: 18px; }
.feature-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.85; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 25px; }
.section-heading h2 { margin: 12px 0 0; font: 700 clamp(28px, 3vw, 40px)/1.2 "STKaiti", "KaiTi", serif; }
.text-button { border: 0; padding: 10px; color: var(--accent); background: transparent; font-weight: 800; }
.steps-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step-card { padding: 28px; border-top: 1px solid var(--line); }
.step-card b { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--accent); background: rgba(255, 95, 61, .08); }
.step-card h4 { margin: 19px 0 8px; font-size: 16px; }
.step-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.75; }
.cta-panel { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin: 80px 0 20px; padding: 42px 46px; border-radius: 29px; color: #fff; background: linear-gradient(118deg, #11182b, #0a0f1d 66%, #34211d); box-shadow: var(--shadow-dark); overflow: hidden; position: relative; }
.cta-panel::after { content: "译"; position: absolute; right: 13%; top: -66px; color: rgba(255,255,255,.035); font: 700 220px/1 "STKaiti", "KaiTi", serif; }
.cta-panel > * { position: relative; z-index: 1; }
.cta-panel span { color: var(--accent-2); font-size: 11px; letter-spacing: .18em; font-weight: 800; }
.cta-panel h2 { margin: 9px 0 8px; font: 700 32px/1.25 "STKaiti", "KaiTi", serif; }
.cta-panel p { margin: 0; color: rgba(255,255,255,.54); font-size: 13px; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; padding: 56px 0 34px; }
.page-heading h1 { margin: 13px 0 8px; font: 700 clamp(34px, 4vw, 52px)/1.15 "STKaiti", "KaiTi", serif; letter-spacing: -.03em; }
.page-heading p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.75; }
.center-heading { justify-content: center; text-align: center; }
.center-heading .eyebrow { justify-content: center; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255, 253, 248, .82); box-shadow: 0 10px 34px rgba(22, 28, 46, .045); }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 18px; align-items: start; }
.workspace-main { padding: 27px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.panel-head h2 { margin: 0 0 6px; font-size: 18px; }
.panel-head small { color: var(--muted); font-size: 11px; }
.icon-button { border: 0; border-radius: 10px; padding: 9px 11px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 700; }
.icon-button:hover { color: var(--danger); background: rgba(225, 75, 75, .07); }
.field { display: grid; gap: 8px; min-width: 0; }
.field > span { color: #5d6678; font-size: 11px; font-weight: 800; }
.field input, .field select, .field textarea, .search-box input, .inline-field input {
  width: 100%; border: 1px solid rgba(28, 38, 61, .13); border-radius: 12px; outline: none; color: #20293b; background: rgba(255,255,255,.78);
  transition: border .2s ease, box-shadow .2s ease, background .2s ease;
}
.field input, .field select { height: 45px; padding: 0 13px; }
.field textarea { min-height: 110px; padding: 13px; resize: vertical; line-height: 1.7; }
.field input:focus, .field select:focus, .field textarea:focus, .search-box input:focus, .inline-field input:focus {
  border-color: rgba(255, 95, 61, .55); background: #fff; box-shadow: 0 0 0 4px rgba(255, 95, 61, .08);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 15px; }
.field-row.two-one { grid-template-columns: 1.55fr .75fr; }
.field-swap-wrap { max-width: 54px; justify-self: center; }
.swap-button { width: 42px; height: 42px; margin-top: 27px; border: 1px solid var(--line); border-radius: 50%; color: #4d586c; background: #fff; font-size: 18px; transition: .2s ease; }
.swap-button:hover { color: #fff; background: var(--ink); transform: rotate(180deg); }
#sourceText { min-height: 330px; font-family: "Songti SC", "SimSun", serif; font-size: 15px; }
.editor-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 10px; }
.editor-tools { display: flex; align-items: center; gap: 13px; }
.file-button { display: inline-flex; align-items: center; min-height: 34px; border: 1px solid var(--line); border-radius: 10px; padding: 0 11px; color: #455066; background: #fff; font-size: 11px; font-weight: 800; cursor: pointer; }
.editor-hint { color: #9aa0ac; font-size: 10px; }
.char-counter { display: flex; align-items: center; gap: 5px; color: #9097a4; font-size: 10px; }
.char-counter b { color: #384257; font-size: 12px; }
.char-counter i { width: 1px; height: 13px; margin: 0 5px; background: var(--line); }
.glossary-box { margin-top: 20px; border: 1px solid var(--line); border-radius: 15px; background: rgba(247, 244, 237, .54); }
.glossary-box summary { display: flex; align-items: center; justify-content: space-between; padding: 15px 17px; list-style: none; cursor: pointer; }
.glossary-box summary::-webkit-details-marker { display: none; }
.glossary-box summary span { display: flex; align-items: center; gap: 9px; font-size: 12px; font-weight: 800; }
.glossary-box summary small { color: #9ba1ad; font-weight: 400; }
.glossary-box summary b { color: var(--accent); font-size: 10px; }
.glossary-box[open] summary { border-bottom: 1px solid var(--line); }
.glossary-box .field { padding: 16px; }
.glossary-box textarea { min-height: 130px; font-family: Consolas, monospace; font-size: 12px; }
.submit-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 22px; padding-top: 21px; border-top: 1px solid var(--line); }
.quota-notice { color: var(--muted); font-size: 11px; line-height: 1.6; }
.quota-notice strong { color: var(--accent); }
.workspace-side { display: grid; gap: 14px; }
.side-card { padding: 23px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255, 253, 248, .7); }
.dark-card { color: #fff; border-color: transparent; background: linear-gradient(150deg, #151d31, #0b1020); box-shadow: var(--shadow-dark); }
.side-label { color: #8a92a2; font-size: 9px; font-weight: 800; letter-spacing: .2em; }
.dark-card .side-label { color: var(--accent-2); }
.side-card h3 { margin: 10px 0 17px; font-size: 15px; }
.rule-list { display: grid; gap: 17px; margin: 0; padding: 0; list-style: none; }
.rule-list li { display: grid; gap: 4px; padding-left: 14px; border-left: 2px solid rgba(255,95,61,.5); }
.rule-list b { font-size: 12px; }
.rule-list span { color: rgba(255,255,255,.48); font-size: 10px; line-height: 1.55; }
.check-list { display: grid; gap: 11px; }
.check-list p { display: flex; align-items: center; gap: 9px; margin: 0; color: #596274; font-size: 11px; }
.check-list i { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: #fff; background: var(--teal); font-size: 10px; font-style: normal; }
.tip-card { border-color: rgba(255,178,74,.28); background: rgba(255,178,74,.08); }
.tip-card > span { color: #b66b10; font-size: 10px; font-weight: 800; letter-spacing: .1em; }
.tip-card p { margin: 8px 0 0; color: #7b664c; font-size: 11px; line-height: 1.75; }

.stats-strip { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 18px; border: 1px solid var(--line); border-radius: 19px; background: rgba(255, 253, 248, .68); overflow: hidden; }
.stats-strip > div { display: grid; gap: 3px; padding: 20px 24px; border-right: 1px solid var(--line); }
.stats-strip > div:last-child { border-right: 0; }
.stats-strip b { font: 700 23px/1 Georgia, serif; }
.stats-strip span { color: var(--muted); font-size: 10px; }
.library-toolbar { display: flex; justify-content: space-between; gap: 14px; margin: 22px 0; }
.search-box { position: relative; flex: 1; max-width: 430px; }
.search-box span { position: absolute; left: 14px; top: 50%; color: #9299a7; transform: translateY(-50%); }
.search-box input { height: 43px; padding: 0 14px 0 39px; background: rgba(255,255,255,.68); }
.library-toolbar select { min-width: 145px; border: 1px solid var(--line); border-radius: 12px; padding: 0 13px; color: #4f596c; background: rgba(255,255,255,.68); outline: none; }
.book-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.book-item { position: relative; min-height: 240px; padding: 24px; border: 1px solid var(--line); border-radius: 21px; background: rgba(255,253,248,.8); cursor: pointer; overflow: hidden; transition: .25s ease; }
.book-item:hover { transform: translateY(-4px); border-color: rgba(255,95,61,.27); box-shadow: var(--shadow); }
.book-item::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 4px; background: #d6d9df; }
.book-item.completed::before { background: var(--success); }
.book-item.running::before { background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent)); background-size: 200% 100%; animation: shimmer 1.8s linear infinite; }
.book-item.failed::before, .book-item.partial_failed::before { background: var(--danger); }
@keyframes shimmer { to { background-position: -200% 0; } }
.book-item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.book-monogram { display: grid; place-items: center; width: 47px; height: 57px; flex: 0 0 auto; border-radius: 8px 8px 8px 2px; color: #fff; background: linear-gradient(145deg, #263450, #11182b); font: 700 20px/1 "STKaiti", "KaiTi", serif; box-shadow: 5px 7px 16px rgba(17,24,43,.14); }
.book-item h3 { margin: 3px 0 7px; font-size: 16px; line-height: 1.45; }
.book-item .book-langs { color: #8b93a1; font-size: 10px; }
.status-badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 5px 8px; color: #5f6879; background: #edf0f3; font-size: 9px; font-weight: 800; white-space: nowrap; }
.status-badge.completed { color: #1f8453; background: rgba(53,184,119,.12); }
.status-badge.running { color: #b94b31; background: rgba(255,95,61,.11); }
.status-badge.failed, .status-badge.partial_failed { color: #b73d3d; background: rgba(225,75,75,.1); }
.book-item .book-meta { display: flex; gap: 15px; margin-top: 20px; color: #858d9b; font-size: 10px; }
.book-progress-line { height: 7px; margin-top: 17px; border-radius: 99px; background: #e9ebed; overflow: hidden; }
.book-progress-line span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .4s ease; }
.book-item-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 13px; color: #848c9a; font-size: 10px; }
.book-item-footer b { color: #414b5f; }
.empty-state { grid-column: 1 / -1; display: grid; place-items: center; min-height: 330px; padding: 50px; border: 1px dashed rgba(28,38,61,.17); border-radius: 24px; text-align: center; color: var(--muted); }
.empty-state .empty-icon { display: grid; place-items: center; width: 62px; height: 62px; margin-bottom: 17px; border-radius: 20px; color: var(--accent); background: rgba(255,95,61,.08); font: 700 29px/1 "STKaiti", "KaiTi", serif; }
.empty-state h3 { margin: 0 0 8px; color: #394357; }
.empty-state p { max-width: 400px; margin: 0 0 20px; font-size: 12px; line-height: 1.8; }

.reader-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 38px 0 20px; }
.reader-actions { display: flex; align-items: center; gap: 10px; }
.back-button { border: 0; padding: 10px 0; color: #5f6879; background: transparent; font-size: 12px; font-weight: 800; }
.reader-hero { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 31px 35px; }
.reader-hero h1 { margin: 10px 0 7px; font: 700 32px/1.25 "STKaiti", "KaiTi", serif; }
.reader-hero p { margin: 0; color: var(--muted); font-size: 12px; }
.reader-progress-ring { --progress: 0; display: grid; place-items: center; align-content: center; width: 83px; height: 83px; flex: 0 0 auto; border-radius: 50%; background: radial-gradient(closest-side, var(--paper-2) 76%, transparent 78% 99%), conic-gradient(var(--accent) calc(var(--progress) * 1%), #e7e8e9 0); }
.reader-progress-ring b { font-size: 18px; }
.reader-progress-ring span { color: var(--muted); font-size: 9px; }
.reader-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 17px; align-items: start; margin-top: 17px; }
.segment-nav { position: sticky; top: 92px; max-height: calc(100vh - 120px); padding: 19px; overflow: auto; }
.segment-nav h3 { margin: 0 0 13px; font-size: 13px; }
.segment-nav a, .segment-nav .chapter-nav-item { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 9px; color: #6d7585; font-size: 10px; line-height: 1.35; }
.segment-nav a, .segment-nav .chapter-nav-item:hover, .segment-nav a, .segment-nav .chapter-nav-item.active { color: #293348; background: rgba(255,95,61,.07); }
.segment-nav a, .segment-nav .chapter-nav-item i { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: #c6cbd3; }
.segment-nav a, .segment-nav .chapter-nav-item.completed i { background: var(--success); }
.segment-nav a, .segment-nav .chapter-nav-item.running i { background: var(--accent); animation: pulse 1.3s infinite; }
.segment-nav a, .segment-nav .chapter-nav-item.failed i { background: var(--danger); }
.segment-list { display: grid; gap: 14px; }
.segment-card { border: 1px solid var(--line); border-radius: 20px; background: rgba(255,253,248,.82); overflow: hidden; scroll-margin-top: 90px; }
.segment-card-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.segment-card-head h3 { margin: 0; font-size: 12px; }
.segment-meta { display: flex; align-items: center; gap: 8px; color: #9299a5; font-size: 9px; }
.segment-body { display: grid; grid-template-columns: 1fr 1fr; min-height: 170px; }
.segment-source, .segment-translation { padding: 22px; font: 15px/1.95 "Songti SC", "SimSun", serif; white-space: pre-wrap; word-break: break-word; }
.segment-source { color: #787f8c; border-right: 1px solid var(--line); background: rgba(246,244,238,.45); }
.segment-translation { color: #20293b; background: rgba(255,255,255,.43); }
.segment-translation.pending { display: grid; place-items: center; color: #9ba1ad; font-family: inherit; font-size: 11px; text-align: center; }
.segment-loading { display: inline-flex; align-items: center; gap: 8px; }
.segment-loading::before { content: ""; width: 14px; height: 14px; border: 2px solid #e5e7e9; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.segment-actions { display: flex; gap: 7px; padding: 11px 18px; border-top: 1px solid var(--line); }
.mini-button { border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; color: #596274; background: #fff; font-size: 9px; font-weight: 700; }
.mini-button.danger { color: var(--danger); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .25; } }

.membership-status { display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 999px; padding: 11px 15px; color: #586172; background: rgba(255,255,255,.65); font-size: 11px; }
.membership-status > span { width: 8px; height: 8px; border-radius: 50%; background: #aeb4bf; }
.membership-status.active { color: #1e7c4e; background: rgba(53,184,119,.09); border-color: rgba(53,184,119,.18); }
.membership-status.active > span { background: var(--success); box-shadow: 0 0 0 5px rgba(53,184,119,.11); }
.billing-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.plan-card { position: relative; display: flex; flex-direction: column; min-height: 350px; padding: 26px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,253,248,.82); transition: .25s ease; }
.plan-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.plan-card.featured { color: #fff; border-color: transparent; background: linear-gradient(155deg, #172038, #0b1020); box-shadow: var(--shadow-dark); }
.plan-card.featured::before { content: "推荐"; position: absolute; top: 0; right: 22px; padding: 6px 10px; border-radius: 0 0 9px 9px; color: #fff; background: var(--accent); font-size: 9px; font-weight: 800; }
.plan-name { color: #838b99; font-size: 11px; font-weight: 800; }
.featured .plan-name { color: var(--accent-2); }
.plan-price { margin: 29px 0 4px; font: 700 38px/1 Georgia, serif; }
.plan-price small { font-size: 13px; }
.plan-period { color: #8f96a2; font-size: 10px; }
.featured .plan-period { color: rgba(255,255,255,.43); }
.plan-quota { display: flex; flex-direction: column; align-self: stretch; width: 100%; box-sizing: border-box; gap: 3px; margin-top: 15px; padding: 13px 14px; border-radius: 13px; background: rgba(255,95,61,.07); border: 1px solid rgba(255,95,61,.16); }
.plan-quota b { color: #a94828; font: 700 25px/1.05 Georgia, serif; }
.plan-quota span { color: #8a685d; font-size: 10px; font-weight: 700; }
.featured .plan-quota { background: rgba(255,255,255,.07); border-color: rgba(255,196,95,.22); }
.featured .plan-quota b { color: #ffc45f; }
.featured .plan-quota span { color: rgba(255,255,255,.56); }
.plan-description { min-height: 56px; margin: 20px 0; color: #6f7787; font-size: 11px; line-height: 1.75; }
.featured .plan-description { color: rgba(255,255,255,.56); }
.plan-benefits { display: grid; gap: 10px; margin-bottom: 25px; }
.plan-benefits span { display: flex; align-items: center; gap: 8px; color: #505a6d; font-size: 10px; }
.plan-benefits i { color: var(--teal); font-style: normal; }
.featured .plan-benefits span { color: rgba(255,255,255,.72); }
.quota-pack-section { margin-top: 18px; padding: 22px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,253,248,.72); }
.quota-pack-heading h2 { margin: 8px 0 7px; font-size: 20px; }
.quota-pack-heading p { max-width: 760px; margin: 0 0 16px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.quota-pack-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.quota-pack-card { display: flex; flex-direction: column; min-width: 0; padding: 17px; border: 1px solid rgba(31,43,68,.1); border-radius: 17px; background: #fffdf8; }
.quota-pack-card-head { display: flex; flex-direction: column; gap: 5px; }
.quota-pack-card-head span { color: #9a7569; font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.quota-pack-card-head b { font-size: 14px; }
.quota-pack-price { margin: 13px 0 8px; color: #a94828; font: 700 28px/1 Georgia, serif; }
.quota-pack-amount { display: flex; align-items: baseline; gap: 6px; margin-bottom: 9px; }
.quota-pack-amount strong { color: var(--ink); font-size: 17px; }
.quota-pack-amount span { color: var(--muted); font-size: 10px; }
.quota-pack-card p { flex: 1; margin: 0 0 14px; color: var(--muted); font-size: 10px; line-height: 1.65; }
.quota-pack-card .button { min-height: 40px; }
.plan-card .button { margin-top: auto; }
.billing-note { margin-top: 15px; padding: 18px 21px; }
.billing-note b { font-size: 11px; }
.billing-note p { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.7; }
.billing-side { display: grid; gap: 14px; }
.account-card, .redeem-card, .order-card { padding: 22px; }
.account-card h3, .redeem-card h3, .order-card h3 { margin: 8px 0 7px; font-size: 15px; }
.account-card p, .redeem-card p { margin: 0 0 17px; color: var(--muted); font-size: 10px; line-height: 1.7; }
.inline-field { display: flex; gap: 7px; }
.inline-field input { min-width: 0; height: 39px; padding: 0 10px; font-size: 11px; }
.inline-field button { border: 0; border-radius: 10px; padding: 0 13px; color: #fff; background: var(--ink); font-size: 10px; font-weight: 800; }
.order-list { display: grid; gap: 8px; }
.order-row { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 10px; }
.order-row:last-child { border-bottom: 0; }
.order-row span { color: var(--muted); }
.empty-mini { color: #9ca2ad; font-size: 10px; }

.guide-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
.guide-grid article { min-height: 235px; padding: 27px; border: 1px solid var(--line); border-radius: 21px; background: rgba(255,253,248,.72); }
.guide-grid article > b { color: var(--accent); font: 700 24px/1 Georgia, serif; }
.guide-grid h3 { margin: 45px 0 11px; font-size: 15px; }
.guide-grid p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.85; }
.faq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 42px; }
.faq-item { border: 1px solid var(--line); border-radius: 17px; background: rgba(255,253,248,.7); overflow: hidden; }
.faq-item button { display: flex; align-items: center; justify-content: space-between; width: 100%; border: 0; padding: 19px 20px; color: #364054; background: transparent; text-align: left; font-size: 12px; font-weight: 800; }
.faq-item button span { color: var(--accent); font-size: 17px; transition: .2s ease; }
.faq-item.open button span { transform: rotate(45deg); }
.faq-item > div { display: none; padding: 0 20px 20px; }
.faq-item.open > div { display: block; }
.faq-item p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.85; }

.modal { width: min(calc(100% - 30px), 460px); border: 0; border-radius: 25px; padding: 0; background: transparent; box-shadow: 0 35px 100px rgba(5,10,23,.4); }
.modal::backdrop { background: rgba(7, 11, 22, .64); backdrop-filter: blur(7px); }
.modal-card { position: relative; padding: 34px; border-radius: 25px; background: var(--paper-2); }
.compact-modal { max-width: 420px; }
.modal-close { position: absolute; right: 17px; top: 17px; display: grid; place-items: center; width: 31px; height: 31px; border: 0; border-radius: 50%; color: #777f8e; background: #f0efeb; font-size: 19px; }
.auth-mark { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 18px; border-radius: 15px 15px 15px 5px; color: #fff; background: var(--accent); font: 700 25px/1 "STKaiti", "KaiTi", serif; }
.modal-card h2 { margin: 0 0 7px; font: 700 27px/1.25 "STKaiti", "KaiTi", serif; }
.modal-card > p { margin: 0 0 23px; color: var(--muted); font-size: 11px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 19px; padding: 4px; border-radius: 12px; background: #eeece6; }
.auth-tabs button { border: 0; border-radius: 9px; padding: 9px; color: #7b8290; background: transparent; font-size: 11px; font-weight: 800; }
.auth-tabs button.active { color: #fff; background: var(--ink); box-shadow: 0 5px 12px rgba(11,16,32,.15); }
.auth-modal .field { margin-bottom: 14px; }
.auth-error { margin-bottom: 14px; border-radius: 10px; padding: 10px 12px; color: #a33b3b; background: rgba(225,75,75,.08); font-size: 10px; line-height: 1.5; }
.auth-tip { display: block; margin-top: 15px; color: #959ca8; text-align: center; font-size: 9px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 25px; }
.toast-stack { position: fixed; right: 22px; bottom: 25px; z-index: 200; display: grid; gap: 9px; pointer-events: none; }
.toast { min-width: 260px; max-width: 380px; padding: 14px 16px; border: 1px solid rgba(255,255,255,.09); border-radius: 14px; color: #fff; background: rgba(17,24,43,.95); box-shadow: 0 17px 45px rgba(5,10,22,.28); font-size: 11px; line-height: 1.55; animation: toastIn .3s ease; backdrop-filter: blur(15px); }
.toast.error { background: rgba(145,44,44,.96); }
.toast.success { background: rgba(24,111,72,.96); }
@keyframes toastIn { from { opacity: 0; transform: translateY(9px); } }
.offline-banner { position: fixed; left: 50%; top: 82px; z-index: 130; display: none; transform: translateX(-50%); border-radius: 999px; padding: 9px 14px; color: #fff; background: #9b4a36; font-size: 10px; box-shadow: var(--shadow); }
.offline-banner.show { display: block; }
.install-banner { position: fixed; right: 22px; bottom: 25px; z-index: 120; display: flex; align-items: center; gap: 16px; border: 0; border-radius: 14px; padding: 13px 15px; color: #fff; background: var(--ink); box-shadow: var(--shadow-dark); font-size: 11px; }
.install-banner b { color: var(--accent-2); }
.mobile-nav { display: none; }

@media (max-width: 1050px) {
  .hero-grid { gap: 35px; }
  .hero-copy h1 { font-size: 52px; }
  .workspace-grid { grid-template-columns: minmax(0, 1fr) 270px; }
  .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guide-grid { grid-template-columns: repeat(2, 1fr); }
  .plan-grid { grid-template-columns: 1fr; }
  .plan-card { min-height: auto; }
  .plan-description { min-height: 0; }
}

@media (max-width: 820px) {
  .shell { width: min(calc(100% - 28px), var(--shell)); }
  .topbar-inner { min-height: 64px; }
  .desktop-nav { display: none; }
  .top-actions { margin-left: auto; }
  .quota-chip { padding: 8px 10px; }
  .account-label { display: none; }
  .hero-grid { min-height: auto; grid-template-columns: 1fr; padding: 52px 0 25px; }
  .hero-copy h1 { font-size: clamp(42px, 12vw, 58px); }
  .hero-visual { height: 410px; }
  .feature-grid, .steps-row { grid-template-columns: 1fr; }
  .feature-grid { margin-bottom: 65px; }
  .feature-card { min-height: 180px; }
  .section-heading { align-items: flex-start; }
  .cta-panel { align-items: flex-start; flex-direction: column; padding: 33px 29px; }
  .workspace-grid, .billing-layout, .reader-layout { grid-template-columns: 1fr; }
  .workspace-side { grid-template-columns: 1fr 1fr; }
  .workspace-side .tip-card { grid-column: 1 / -1; }
  .segment-nav { display: none; }
  .segment-body { grid-template-columns: 1fr; }
  .segment-source { border-right: 0; border-bottom: 1px solid var(--line); }
  .billing-side { grid-template-columns: 1fr 1fr; }
  .order-card { grid-column: 1 / -1; }
  .faq-grid { grid-template-columns: 1fr; }
  .page-heading { align-items: flex-start; flex-direction: column; padding-top: 42px; }
  .page-heading .button { align-self: flex-start; }
  .stats-strip { grid-template-columns: 1fr 1fr; }
  .stats-strip > div:nth-child(2) { border-right: 0; }
  .stats-strip > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .reader-hero { align-items: flex-start; }
}

@media (max-width: 600px) {
  body { padding-bottom: env(safe-area-inset-bottom); }
  .app-main { padding-bottom: 105px; }
  .topbar { background: rgba(247,244,237,.93); }
  .brand-copy small { display: none; }
  .quota-chip { font-size: 10px; }
  .quota-chip #quotaChipText { max-width: 82px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .account-button { padding-right: 3px; }
  .hero-grid { padding-top: 40px; }
  .hero-copy h1 { margin-top: 16px; letter-spacing: -.04em; }
  .hero-lead { font-size: 14px; line-height: 1.85; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .hero-actions .button { width: 100%; }
  .free-offer { align-items: flex-start; flex-direction: column; gap: 8px; }
  .hero-visual { height: 350px; transform: scale(.82); margin: -15px -30px; }
  .floating-chip { display: none; }
  .book-stack { transform: scale(.83) rotate(3deg); }
  .feature-grid { gap: 10px; }
  .feature-card { min-height: 200px; padding: 23px; }
  .section-heading h2 { font-size: 27px; }
  .section-heading .text-button { display: none; }
  .steps-row { gap: 5px; }
  .step-card { padding: 22px 2px; }
  .cta-panel { margin-top: 55px; border-radius: 23px; }
  .cta-panel h2 { font-size: 26px; }
  .page-heading { padding: 35px 0 24px; }
  .page-heading h1 { font-size: 36px; }
  .workspace-main { padding: 18px; border-radius: 19px; }
  .field-row, .field-row.two-one { grid-template-columns: 1fr; gap: 12px; }
  .field-swap-wrap { display: none; }
  #sourceText { min-height: 280px; font-size: 14px; }
  .editor-toolbar { align-items: flex-start; flex-direction: column; }
  .editor-hint { display: none; }
  .glossary-box summary small { display: none; }
  .submit-row { align-items: stretch; flex-direction: column; }
  .submit-row .button { width: 100%; }
  .workspace-side { grid-template-columns: 1fr; }
  .workspace-side .tip-card { grid-column: auto; }
  .stats-strip b { font-size: 19px; }
  .stats-strip > div { padding: 16px; }
  .library-toolbar { flex-direction: column; }
  .search-box { max-width: none; }
  .book-grid { grid-template-columns: 1fr; }
  .book-item { min-height: 220px; }
  .reader-head { align-items: flex-start; flex-direction: column; }
  .reader-actions { width: 100%; }
  .reader-actions .button, .reader-actions a { flex: 1; }
  .reader-hero { padding: 24px 21px; border-radius: 19px; }
  .reader-hero h1 { font-size: 25px; }
  .reader-progress-ring { width: 70px; height: 70px; }
  .segment-source, .segment-translation { padding: 18px; font-size: 14px; }
  .billing-side { grid-template-columns: 1fr; }
  .order-card { grid-column: auto; }
  .guide-grid { grid-template-columns: 1fr; }
  .guide-grid article { min-height: 190px; }
  .guide-grid h3 { margin-top: 31px; }
  .modal-card { padding: 28px 23px; border-radius: 22px; }
  .toast-stack { left: 14px; right: 14px; bottom: 87px; }
  .toast { min-width: 0; max-width: none; }
  .install-banner { left: 14px; right: 14px; bottom: 80px; justify-content: space-between; }
  .mobile-nav {
    position: fixed; z-index: 100; left: 10px; right: 10px; bottom: calc(8px + env(safe-area-inset-bottom));
    display: grid; grid-template-columns: repeat(5, 1fr); padding: 7px; border: 1px solid rgba(255,255,255,.09);
    border-radius: 20px; background: rgba(11,16,32,.94); box-shadow: 0 18px 50px rgba(4,8,18,.34); backdrop-filter: blur(18px);
  }
  .mobile-nav button { display: grid; place-items: center; gap: 3px; min-height: 48px; border: 0; border-radius: 14px; color: rgba(255,255,255,.53); background: transparent; }
  .mobile-nav button.active { color: #fff; background: rgba(255,255,255,.09); }
  .mobile-nav button span { font-size: 16px; line-height: 1; }
  .mobile-nav button small { font-size: 8px; }
  .offline-banner { top: 72px; width: max-content; max-width: calc(100% - 28px); text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.translate-gate {
  display: grid;
  place-items: center;
  min-height: 520px;
  padding: 60px 28px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 253, 248, .78);
  box-shadow: var(--shadow);
  text-align: center;
}
.translate-gate[hidden] { display: none; }
.translate-gate .gate-seal {
  display: grid; place-items: center; width: 72px; height: 72px; margin-bottom: 22px; border-radius: 23px 23px 23px 7px;
  color: #fff; background: linear-gradient(145deg, var(--accent), #d94a2e); box-shadow: 0 18px 40px rgba(255,95,61,.25);
  font: 700 30px/1 "STKaiti", "KaiTi", serif;
}
.translate-gate .eyebrow { justify-content: center; }
.translate-gate h2 { margin: 16px 0 10px; font: 700 clamp(30px, 4vw, 44px)/1.2 "STKaiti", "KaiTi", serif; }
.translate-gate p { max-width: 580px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.9; }
.gate-actions { display: flex; gap: 12px; margin-top: 27px; }
.page-auth-card { max-width: 470px; padding: 35px; }
.page-auth-card h2 { margin: 0 0 8px; font: 700 30px/1.2 "STKaiti", "KaiTi", serif; }
.page-auth-card > p { margin: 0 0 22px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.page-auth-card form { display: grid; gap: 14px; }
.auth-page-grid { min-height: calc(100vh - 150px); display: grid; grid-template-columns: 1.08fr .92fr; align-items: center; gap: 70px; padding: 60px 0 80px; }
.auth-page-copy h1 { margin: 20px 0 22px; font: 700 clamp(43px, 5vw, 66px)/1.12 "STKaiti", "KaiTi", serif; letter-spacing: -.045em; }
.auth-page-copy > p { max-width: 620px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.9; }
.auth-benefits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 34px; }
.auth-benefits > div { padding: 17px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.55); }
.auth-benefits b { display: block; color: var(--accent); font: 700 20px/1 Georgia, serif; }
.auth-benefits span { display: block; margin-top: 7px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.auth-quote { margin-top: 28px; padding-left: 17px; border-left: 3px solid var(--accent); color: #718096; font: 14px/1.8 "STKaiti", "KaiTi", serif; }
@media (max-width: 820px) {
  .auth-page-grid { grid-template-columns: 1fr; gap: 35px; padding-top: 35px; }
  .auth-page-copy h1 { font-size: clamp(38px, 10vw, 52px); }
  .page-auth-card { max-width: none; }
}
@media (max-width: 600px) {
  .translate-gate { min-height: 460px; padding: 42px 19px; border-radius: 20px; }
  .gate-actions { width: 100%; flex-direction: column; }
  .gate-actions .button { width: 100%; }
  .auth-benefits { grid-template-columns: 1fr; }
  .page-auth-card { padding: 25px 21px; border-radius: 20px; }
}

.submit-actions, .heading-actions { display: flex; align-items: center; gap: 10px; }
.button.danger-outline { color: var(--danger); border-color: rgba(225,75,75,.25); background: rgba(225,75,75,.05); }
.draft-notice { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; padding: 18px 22px; }
.draft-notice b { color: #b66b10; }
.draft-notice p { margin: 0; color: var(--muted); font-size: 11px; }
.draft-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.draft-item { padding: 22px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,253,248,.78); box-shadow: 0 10px 30px rgba(16,23,42,.05); }
.draft-item-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.draft-item-head b { color: var(--accent); font-size: 10px; }
.draft-item h3 { margin: 18px 0 8px; font-size: 16px; }
.draft-item p { margin: 0; color: var(--muted); font-size: 10px; }
.draft-actions { display: flex; gap: 9px; margin-top: 22px; }
@media (max-width: 900px) { .draft-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .submit-actions, .heading-actions { width: 100%; flex-direction: column; align-items: stretch; }
  .submit-actions .button, .heading-actions .button { width: 100%; }
  .draft-notice { align-items: flex-start; flex-direction: column; }
  .draft-grid { grid-template-columns: 1fr; }
}

[hidden] { display: none !important; }
.quick-chapter-list { display: grid; gap: 8px; margin: 12px 0 15px; }
.quick-chapter { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.55); }
.quick-chapter b { display: block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.quick-chapter small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; }

.page-auth-card { position: relative; }
.page-auth-close { position: absolute; top: 16px; right: 16px; display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; color: #687184; background: #f0efeb; font-size: 21px; line-height: 1; }
.page-auth-close:hover { color: #fff; background: var(--accent); }
.page-auth-back { justify-self: center; margin-top: 2px; }

.chapter-editor-modal { width: min(calc(100% - 30px), 920px); }
.chapter-editor-card { padding: 30px; }
.chapter-editor-card h2 { margin: 8px 0 7px; font: 700 30px/1.2 "STKaiti", "KaiTi", serif; }
.chapter-editor-card > p { margin: 0 0 20px; color: var(--muted); font-size: 11px; }
.chapter-editor-card textarea { min-height: 360px; font: 15px/1.9 "Songti SC", "SimSun", serif; }
.drawer-editor-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 18px; padding-top: 17px; border-top: 1px solid var(--line); }
.drawer-editor-footer > div:first-child { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.drawer-editor-footer i { width: 1px; height: 13px; margin: 0 6px; background: var(--line); }
.drawer-actions { display: flex; gap: 9px; }
@media (max-width: 600px) {
  .chapter-editor-card { padding: 23px 18px; }
  .chapter-editor-card textarea { min-height: 300px; }
  .drawer-editor-footer { align-items: stretch; flex-direction: column; }
  .drawer-actions { width: 100%; flex-direction: column; }
  .drawer-actions .button { width: 100%; }
}

.segment-nav .chapter-nav-item { width: 100%; border: 0; text-align: left; cursor: pointer; }


/* ===== Visual refresh 2026: literary editorial workspace ===== */
:root {
  --ink: #111726;
  --ink-2: #1a2234;
  --ink-3: #253149;
  --paper: #f4efe5;
  --paper-2: #fffdf8;
  --text: #182033;
  --muted: #707887;
  --line: rgba(24, 32, 54, .11);
  --accent: #eb5b38;
  --accent-2: #e8b05d;
  --teal: #2fa99b;
  --success: #35a96d;
  --shadow: 0 26px 70px rgba(24, 26, 38, .11);
  --shadow-dark: 0 28px 90px rgba(4, 9, 20, .27);
  --radius: 22px;
}
body {
  background:
    radial-gradient(circle at 8% -4%, rgba(232,176,93,.20), transparent 30rem),
    radial-gradient(circle at 96% 5%, rgba(47,169,155,.13), transparent 28rem),
    radial-gradient(circle at 45% 72%, rgba(235,91,56,.06), transparent 35rem),
    linear-gradient(180deg, #f6f1e8 0%, #f1ebdf 100%);
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(rgba(25,31,46,.018) 1px, transparent 1px);
  background-size: 100% 34px;
  mask-image: linear-gradient(to bottom, transparent, #000 15%, #000 85%, transparent);
}
.topbar {
  background: rgba(248, 244, 236, .78);
  border-bottom: 1px solid rgba(24,32,54,.08);
  box-shadow: 0 8px 35px rgba(25,31,46,.045);
}
.topbar-inner { min-height: 76px; }
.brand-seal {
  width: 44px; height: 44px; border-radius: 14px 14px 14px 5px;
  background: linear-gradient(145deg, #f1744e, #d74928);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.26), 0 10px 25px rgba(235,91,56,.25);
}
.brand-copy strong { font-size: 23px; letter-spacing: .14em; }
.nav-link { padding: 9px 14px; font-size: 13px; }
.nav-link.active { background: linear-gradient(145deg, #1b2437, #101624); }
.quota-chip, .account-button { transition: transform .2s ease, background .2s ease; }
.quota-chip:hover, .account-button:hover { transform: translateY(-1px); }

.hero-grid { min-height: 690px; padding-top: 92px; gap: 86px; }
.eyebrow { letter-spacing: .2em; color: #7a7f89; }
.eyebrow > span { width: 34px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.hero-copy h1 {
  margin: 24px 0 24px;
  font-size: clamp(52px, 5.8vw, 78px);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -.06em;
  color: #111827;
}
.hero-copy h1 em { color: #d94f2d; }
.hero-copy h1 em::after { height: 14px; bottom: 3px; background: linear-gradient(90deg, rgba(232,176,93,.34), rgba(235,91,56,.16)); }
.hero-lead { font-size: 17px; line-height: 2; color: #626a78; max-width: 650px; }
.button {
  border-radius: 13px;
  padding: 12px 19px;
  letter-spacing: .01em;
  box-shadow: 0 1px 0 rgba(255,255,255,.35) inset;
}
.button.primary {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #ef6843 0%, #dc4a28 100%);
  box-shadow: 0 14px 32px rgba(220,74,40,.25), inset 0 1px 0 rgba(255,255,255,.22);
}
.button.primary::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 20%, rgba(255,255,255,.18) 48%, transparent 72%);
  transform: translateX(-130%); transition: transform .55s ease;
}
.button.primary:hover::after { transform: translateX(130%); }
.button.light { box-shadow: 0 16px 35px rgba(5,10,20,.18); }
.book-card { border-radius: 24px 24px 24px 8px; }
.book-front {
  background: linear-gradient(155deg, #1d2940, #101624 58%, #201a1d);
  box-shadow: 0 34px 80px rgba(11,16,32,.32);
}
.floating-chip { border-radius: 14px; box-shadow: 0 18px 45px rgba(17,25,45,.13); }

.feature-grid { gap: 18px; margin-top: 44px; }
.feature-card, .step-card, .guide-grid article, .book-item, .side-card, .panel, .plan-card {
  border-color: rgba(24,32,54,.09);
}
.feature-card {
  background: linear-gradient(155deg, rgba(255,255,255,.82), rgba(250,246,238,.66));
  box-shadow: 0 12px 36px rgba(25,31,46,.045);
}
.feature-card:hover { transform: translateY(-6px); box-shadow: 0 24px 55px rgba(25,31,46,.11); }
.feature-index { color: rgba(24,32,54,.10); }
.feature-icon { border-radius: 14px; box-shadow: 0 10px 23px rgba(19,25,40,.14); }
.cta-panel {
  border: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(118deg, #172036, #101624 62%, #35221e);
  box-shadow: 0 34px 85px rgba(6,11,22,.25);
}

.panel, .workspace-main {
  background: rgba(255,253,248,.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 18px 52px rgba(25,31,46,.065);
}
.field input, .field select, .field textarea, .search-box input, .inline-field input {
  border-color: rgba(29,39,61,.12);
  background: rgba(255,255,255,.74);
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: rgba(235,91,56,.5);
  box-shadow: 0 0 0 4px rgba(235,91,56,.075), 0 8px 20px rgba(235,91,56,.05);
}
#sourceText, .chapter-editor-card textarea {
  background: linear-gradient(180deg, #fffefb, #fdfaf4);
  line-height: 1.95;
}
.stats-strip {
  border-color: rgba(24,32,54,.09);
  background: rgba(255,253,248,.72);
  box-shadow: 0 14px 36px rgba(25,31,46,.045);
}
.book-item {
  background: linear-gradient(155deg, rgba(255,255,255,.86), rgba(252,248,240,.72));
}
.book-item:hover { border-color: rgba(235,91,56,.22); box-shadow: 0 22px 55px rgba(25,31,46,.11); }
.book-monogram { border-radius: 10px 10px 10px 3px; background: linear-gradient(145deg, #34415d, #151d2e); }

.segment-nav {
  background: rgba(255,253,248,.78);
  backdrop-filter: blur(18px);
}
.chapter-nav-item { transition: color .2s ease, background .2s ease, transform .2s ease; }
.chapter-nav-item:hover { transform: translateX(2px); }
.segment-card {
  background: rgba(255,253,248,.88);
  box-shadow: 0 12px 38px rgba(25,31,46,.05);
}
.segment-card-head { background: linear-gradient(180deg, rgba(255,255,255,.72), rgba(252,249,242,.36)); }
.segment-source { background: linear-gradient(180deg, rgba(245,241,232,.7), rgba(249,246,239,.5)); }
.segment-translation { background: linear-gradient(180deg, rgba(255,255,255,.65), rgba(255,253,248,.48)); }
.segment-actions { background: rgba(252,249,243,.62); }
.mini-button { border-radius: 9px; transition: transform .18s ease, background .18s ease; }
.mini-button:hover { transform: translateY(-1px); background: #fff; }

.plan-card { background: linear-gradient(155deg, rgba(255,255,255,.86), rgba(250,246,238,.72)); }
.plan-card:hover { transform: translateY(-5px); }
.plan-card.featured { background: linear-gradient(155deg, #202b43, #111726 66%, #211b22); }
.page-auth-card {
  background: linear-gradient(155deg, rgba(255,255,255,.92), rgba(250,245,236,.86));
  box-shadow: 0 32px 90px rgba(20,25,38,.14);
}
.auth-page-copy h1 { color: #111827; }
.auth-benefits > div { background: rgba(255,255,255,.68); box-shadow: 0 10px 25px rgba(25,31,46,.04); }

.modal-card {
  border: 1px solid rgba(255,255,255,.45);
  background: linear-gradient(155deg, #fffefb, #f8f3ea);
  box-shadow: 0 38px 110px rgba(4,8,18,.38);
}
.item-preview, .quick-chapter { transition: transform .2s ease, border-color .2s ease, background .2s ease; }
.quick-chapter:hover { transform: translateY(-1px); border-color: rgba(235,91,56,.2); background: #fff; }

@media (max-width: 820px) {
  .topbar { background: rgba(248,244,236,.92); }
  .hero-grid { padding-top: 58px; }
  .hero-copy h1 { font-size: clamp(44px, 12.5vw, 64px); }
}
@media (max-width: 600px) {
  body { background: linear-gradient(180deg, #f7f3eb, #f0e9dc); }
  .topbar-inner { min-height: 64px; }
  .hero-visual { margin-top: -10px; }
  .panel, .workspace-main { backdrop-filter: none; box-shadow: 0 12px 35px rgba(25,31,46,.06); }
  .modal-card { background: #fffdf8; }
}

.segment-editable-body { align-items: stretch; }
.segment-editor {
  width: 100%; min-height: 260px; border: 0; outline: none; resize: vertical;
  padding: 22px; white-space: pre-wrap; overflow: auto;
  font: 15px/1.95 "Songti SC", "SimSun", serif; color: #20293b;
}
.segment-source-editor { color: #697180; border-right: 1px solid var(--line); background: rgba(246,244,238,.48); }
.segment-translation-editor { background: rgba(255,255,255,.48); }
.segment-editor:focus { box-shadow: inset 0 0 0 2px rgba(235,91,56,.12); background: #fffefa; }
.segment-editor[readonly] { cursor: wait; opacity: .78; }
.segment-save-state { margin-right: auto; color: #8b93a1; font-size: 9px; align-self: center; }
@media (max-width: 820px) {
  .segment-source-editor { border-right: 0; border-bottom: 1px solid var(--line); }
  .segment-editor { min-height: 220px; }
}

.history-modal { width: min(calc(100% - 30px), 1120px); }
.history-card { padding: 30px; }
.history-card h2 { margin: 8px 0 7px; font: 700 30px/1.2 "STKaiti", "KaiTi", serif; }
.history-card > p { margin: 0 0 20px; color: var(--muted); font-size: 11px; }
.history-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; min-height: 520px; }
.history-list { display: grid; align-content: start; gap: 9px; max-height: 600px; overflow: auto; padding-right: 4px; }
.history-item { padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.58); }
.history-item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 9px; }
.history-item-head b { color: var(--accent); }
.history-item h4 { margin: 9px 0 5px; font-size: 12px; }
.history-item p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; color: #737b89; font-size: 10px; line-height: 1.5; }
.history-item small { display: block; margin-top: 8px; color: #9aa0aa; font-size: 9px; }
.history-item-actions { display: flex; gap: 7px; margin-top: 10px; }
.history-preview { max-height: 600px; overflow: auto; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.54); }
.history-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; color: var(--muted); font-size: 10px; }
.history-preview h3 { margin: 14px 0 18px; font: 700 24px/1.35 "STKaiti", "KaiTi", serif; }
.history-preview h4 { margin: 18px 0 8px; color: var(--accent); font-size: 11px; }
.history-text { white-space: pre-wrap; word-break: break-word; color: #343d50; font: 14px/1.9 "Songti SC", "SimSun", serif; }
@media (max-width: 820px) {
  .history-layout { grid-template-columns: 1fr; min-height: 0; }
  .history-list, .history-preview { max-height: 340px; }
}

.chapter-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto 28px; align-items: center; gap: 16px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,253,248,.86); cursor: pointer; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.chapter-row:hover { transform: translateY(-2px); border-color: rgba(235,91,56,.24); box-shadow: 0 16px 42px rgba(25,31,46,.08); }
.chapter-row-index { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: #fff; background: linear-gradient(145deg, #34415d, #151d2e); font: 700 13px/1 Georgia, serif; }
.chapter-row-main h3 { margin: 0 0 5px; font-size: 15px; }
.chapter-row-main p { margin: 0; color: var(--muted); font-size: 9px; }
.chapter-row-state { display: grid; justify-items: end; gap: 5px; }
.chapter-row-state small { color: #939aa6; font-size: 8px; }
.chapter-row-arrow { color: #a2a8b2; font-size: 18px; }
.drawer-title-grid, .drawer-text-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.drawer-text-grid { margin-top: 14px; }
.drawer-text-grid textarea { min-height: 360px; }
.drawer-actions { flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 820px) {
  .drawer-title-grid, .drawer-text-grid { grid-template-columns: 1fr; }
  .drawer-text-grid textarea { min-height: 260px; }
  .chapter-row { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 11px; padding: 14px; }
  .chapter-row-index { width: 36px; height: 36px; }
  .chapter-row-arrow { display: none; }
  .chapter-row-state small { display: none; }
}

/* ================================================================
 * 手机 App 端布局（≤820px）
 * 目标：像原生 App，而不是把电脑网页拉长
 * 新增于 2026-10-10
 * ================================================================ */
@media (max-width: 820px) {

  /* ---------- 全局：App 式基调 ---------- */
  html { background: #f2efe8; }
  body {
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
  }
  .shell { width: 100%; padding-inline: 0; }
  main.shell { padding-bottom: 0; }
  .view { padding: 0 0 10px; }
  .panel { box-shadow: none; }

  /* ---------- 顶部栏：紧凑吸顶 ---------- */
  .site-header {
    position: sticky; top: 0; z-index: 60;
    background: rgba(252,250,246,.94);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
  }
  .site-header .shell { padding-inline: 14px; }
  .site-header .links > a:not(.btn-demo):not([data-route="login"]) { display: none; }
  .site-header .links { gap: 8px; }
  .desktop-nav { display: none !important; }

  /* ---------- 首页：砍掉营销长文，改成 App 首页 ---------- */
  .hero-grid { display: block; min-height: 0; padding: 20px 16px 6px; gap: 0; }
  .hero-copy h1 { font-size: 28px; line-height: 1.3; letter-spacing: -.02em; margin: 10px 0 10px; }
  .hero-copy h1 br { display: none; }
  .hero-copy h1 em::after { display: none; }
  .hero-lead { font-size: 14.5px; line-height: 1.8; }
  .hero-actions { display: grid; gap: 10px; margin-top: 18px; }
  .hero-actions .button { width: 100%; }
  .free-offer { margin-top: 14px; padding: 12px 14px; border-radius: 14px; }
  .hero-visual,
  .feature-grid,
  .section-heading,
  .steps-row,
  .cta-panel { display: none !important; }

  /* ---------- 页面标题：紧凑 ---------- */
  .page-heading {
    display: block; padding: 16px 16px 4px; gap: 0;
    align-items: flex-start;
  }
  .page-heading h1 { font-size: 21px; margin: 0 0 5px; letter-spacing: -.01em; }
  .page-heading p { font-size: 13px; line-height: 1.65; }
  .page-heading .eyebrow { display: none; }
  .heading-actions { display: flex; gap: 8px; margin-top: 12px; }
  .heading-actions .button { flex: 1; padding: 11px 12px; font-size: 14px; }

  /* ---------- 翻译台：主界面极简 ---------- */
  .workspace-grid { display: block; padding: 0; gap: 0; }
  .workspace-side { display: none !important; }
  .workspace-main.panel {
    margin: 8px 12px 14px; padding: 16px 14px;
    border-radius: 18px; background: #fff; border-color: #ecebe6;
  }
  .panel-head { margin-bottom: 16px; align-items: center; }
  .panel-head h2 { font-size: 16px; margin: 0; }
  .panel-head small { display: none; }
  .panel-head .icon-button { font-size: 12px; padding: 7px 11px; border-radius: 10px; }

  .field-row { display: block !important; margin: 0 !important; }
  .field { display: block; margin-bottom: 14px; }
  .field > span {
    display: block; font-size: 12.5px; margin-bottom: 6px;
    color: var(--muted); font-weight: 600;
  }
  .field input, .field select, .field textarea {
    width: 100%; font-size: 16px; padding: 13px 14px;
    border-radius: 12px; border: 1px solid #e7e4dd; background: #faf9f6;
  }
  .field input:focus, .field select:focus, .field textarea:focus {
    background: #fff; border-color: var(--accent);
  }
  .field textarea { min-height: 170px; line-height: 1.75; }
  .field-swap-wrap { display: none !important; }

  .editor-toolbar {
    display: block; padding: 0; margin: 2px 0 14px;
    border: 0; background: transparent;
  }
  .editor-tools { margin-bottom: 8px; }
  .file-button {
    display: inline-block; padding: 10px 16px; border-radius: 11px;
    font-size: 14px; background: #f2efe8;
  }
  .char-counter { justify-content: flex-start; font-size: 12.5px; }
  .editor-hint { display: none; }

  .glossary-box { margin-bottom: 14px; border-radius: 14px; overflow: hidden; }
  .glossary-box summary { padding: 13px 14px; font-size: 14px; }

  .submit-row { display: block; }
  .quota-notice { margin-bottom: 12px; font-size: 13px; padding: 10px 12px; border-radius: 11px; }
  .submit-actions { display: grid; gap: 9px; }
  .submit-actions .button { width: 100%; }
  .submit-actions .button.primary { order: 1; padding: 16px; font-size: 16px; font-weight: 700; }
  .submit-actions .button.ghost { order: 2; padding: 12px; font-size: 14px; }

  /* 登录门 */
  .translate-gate { margin: 20px 12px; padding: 20px 16px; border-radius: 18px; }
  .gate-seal { width: 52px; height: 52px; font-size: 22px; }
  .gate-actions { display: grid; gap: 10px; }
  .gate-actions .button { width: 100%; }

  /* ---------- 书架 ---------- */
  .library-toolbar { display: block; padding: 0 12px; }
  .library-toolbar > * { width: 100%; margin-bottom: 10px; }
  .stats-strip {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 1px; margin: 8px 12px 14px; border-radius: 16px; overflow: hidden;
  }
  .book-grid, .draft-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 11px; padding: 0 12px;
  }
  .book-card, .draft-card { border-radius: 16px; padding: 16px; }

  /* ---------- 会员 ---------- */
  .membership-status { margin: 8px 12px 14px; border-radius: 16px; }
  .plan-grid { display: grid !important; grid-template-columns: 1fr !important; gap: 11px; padding: 0 12px; }
  .plan-card { border-radius: 16px; padding: 18px 16px; }
  .order-card, .redeem-card { margin: 10px 12px; border-radius: 16px; }

  /* ---------- 帮助 ---------- */
  .guide-grid { display: none !important; }
  .faq-grid { display: grid; gap: 10px; padding: 0 12px; }
  .faq-item { border-radius: 14px; }

  /* ---------- 登录页 ---------- */
  .auth-page-grid { display: block; padding: 0; }
  .auth-page-copy { display: none !important; }
  .page-auth-card { margin: 14px 12px; border-radius: 18px; padding: 20px 16px; }

  /* ---------- 阅读/编辑页 ---------- */
  .reader-hero { margin: 0 12px 12px; border-radius: 16px; padding: 16px; }
  .drawer-text-grid, .drawer-title-grid { display: block !important; gap: 0; }
  .segment-nav { padding: 0 12px; }

  /* ---------- 通用控件 ---------- */
  .button { border-radius: 12px; }
  .button.large { padding: 14px 18px; font-size: 15.5px; }
  .quota-chip { font-size: 12px; padding: 6px 10px; }
  .account-button { padding: 5px 10px; }
  .install-banner { display: none !important; }
  .offline-banner { top: 60px; font-size: 13px; }
}

/* ---------- 手机端：书架 / 会员 进一步压缩（2026-10-10） ---------- */
@media (max-width: 820px) {

  /* 书架卡片 */
  .book-item { padding: 15px 14px !important; border-radius: 16px !important; }
  .book-item .book-item-head { margin-bottom: 8px; }
  .book-monogram { width: 38px; height: 38px; font-size: 17px; border-radius: 11px; }
  .book-item h3 { font-size: 16.5px; margin: 0 0 5px; line-height: 1.35; }
  .book-langs { font-size: 12.5px; margin-bottom: 5px; }
  .book-meta { font-size: 12.5px; gap: 10px; margin-bottom: 9px; }
  .book-progress-line { height: 5px; margin-bottom: 8px; }
  .book-item-footer { font-size: 12px; }
  .status-badge { font-size: 11px; padding: 3px 8px; }
  .stats-strip { margin: 6px 12px 12px; border-radius: 14px; }
  .stats-strip > * { padding: 12px 10px !important; }
  .library-toolbar { margin-bottom: 4px; }
  .library-toolbar .search-box input,
  .library-toolbar select { font-size: 15px; padding: 11px 13px; }

  /* 会员套餐卡片 */
  .plan-card { padding: 16px 14px !important; border-radius: 16px !important; }
  .plan-name { font-size: 13px; }
  .plan-price { font-size: 27px !important; margin: 3px 0 2px !important; line-height: 1.15; }
  .plan-price small { font-size: 12px; }
  .plan-period { font-size: 12.5px; }
  .plan-description { font-size: 13px !important; margin: 7px 0 9px !important; line-height: 1.6; }
  .plan-benefits { gap: 5px !important; margin-bottom: 11px !important; }
  .plan-benefits span { font-size: 12.5px; }
  /* 手机端每个套餐只展示前 3 条权益，减少滚动 */
  .plan-benefits span:nth-child(n+4) { display: none; }
  .plan-card .button { padding: 13px !important; font-size: 15px; }

  /* 会员状态条 */
  .membership-status { padding: 14px !important; }
  .membership-status h3 { font-size: 15px; }

  /* 订单 / 兑换卡 */
  .order-card, .redeem-card { padding: 14px !important; }
  .payment-note, #paymentModeNote { font-size: 12.5px; line-height: 1.6; }
}

/* ---------- 手机端：触控目标补足（≥44px） ---------- */
@media (max-width: 820px) {
  .panel-head .icon-button { min-height: 44px; padding: 10px 14px; display: inline-flex; align-items: center; }
  #redeemCode, #redeemButton { min-height: 44px; font-size: 15px; }
  .redeem-card form, .redeem-card .inline-field { display: grid; gap: 9px; }
  .redeem-card .inline-field { grid-template-columns: 1fr auto; align-items: center; }
  .back-button, .page-auth-back, .page-auth-close { min-height: 44px; }
  .text-button { min-height: 40px; display: inline-flex; align-items: center; }
}

/* ================================================================
 * 【最终版】手机 App 骨架 —— 参考识卡 App
 * 顶栏固定 52px + 中间独立滚动 + 底栏固定
 * 修复：顶栏类名是 .topbar（之前误写成 .site-header）
 * ================================================================ */
@media (max-width: 820px) {

  /* ---------- 1. 外壳：锁定视口，禁止整页滚动 ---------- */
  html, body { height: 100%; overflow: hidden; }
  body { padding-bottom: 0 !important; background: #f3f1ec; }
  .ambient, .noise { display: none !important; }

  /* ---------- 2. 顶栏：固定 52px ---------- */
  .topbar {
    position: fixed !important; top: 0; left: 0; right: 0; z-index: 60;
    height: 52px; margin: 0 !important;
    background: rgba(252,250,246,.97);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    border-bottom: 1px solid #e8e5de;
  }
  .topbar .shell, .topbar-inner {
    height: 52px !important; width: 100% !important;
    padding: 0 14px !important; margin: 0 !important;
    display: flex !important; align-items: center; justify-content: space-between; gap: 8px;
  }
  .brand { gap: 8px !important; padding: 0 !important; }
  .brand-seal { width: 30px !important; height: 30px !important; font-size: 15px !important; border-radius: 9px !important; }
  .brand-copy { line-height: 1 !important; }
  .brand-copy strong { font-size: 17px !important; letter-spacing: .06em !important; }
  .brand-copy small { display: none !important; }
  .desktop-nav { display: none !important; }
  .top-actions { gap: 6px !important; }
  .quota-chip { font-size: 11.5px !important; padding: 5px 9px !important; border-radius: 999px !important; }
  .account-button { padding: 4px 8px 4px 4px !important; font-size: 12px !important; }
  .account-button .avatar { width: 26px !important; height: 26px !important; font-size: 12px !important; }

  /* ---------- 3. 中间滚动区：独立滚动 ---------- */
  main.app-main, main.shell.app-main {
    position: fixed !important;
    left: 0 !important; right: 0 !important; top: 52px !important;
    bottom: calc(76px + env(safe-area-inset-bottom)) !important;
    width: 100% !important; max-width: none !important;
    padding: 0 !important; margin: 0 !important;
    overflow-y: auto !important; overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  main.app-main::-webkit-scrollbar { display: none; }
  main.app-main { scrollbar-width: none; }
  .view { padding: 6px 0 18px !important; }

  /* ---------- 4. 底栏：固定，全宽 ---------- */
  .mobile-nav {
    position: fixed !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    margin: 0 !important; border-radius: 0 !important;
    border: 0 !important; border-top: 1px solid rgba(255,255,255,.10) !important;
    padding: 7px 4px calc(7px + env(safe-area-inset-bottom)) !important;
    background: rgba(11,16,32,.97) !important;
    -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    box-shadow: 0 -6px 24px rgba(4,8,18,.22) !important;
    display: grid !important;
  }
  .mobile-nav button { min-height: 46px !important; }
  .mobile-nav button span { font-size: 17px !important; }
  .mobile-nav button small { font-size: 10px !important; }

  /* ---------- 5. 各页面：紧凑卡片式排版 ---------- */

  /* 页面标题：小一号，去掉英文 eyebrow 和长描述 */
  .page-heading {
    display: block !important; padding: 12px 16px 6px !important; gap: 0 !important;
  }
  .page-heading .eyebrow { display: none !important; }
  .page-heading h1 { font-size: 19px !important; margin: 0 0 3px !important; line-height: 1.3 !important; letter-spacing: 0 !important; }
  .page-heading p { font-size: 12.5px !important; line-height: 1.55 !important; color: #7b8496 !important; }
  .heading-actions { display: flex !important; gap: 8px !important; margin-top: 9px !important; }
  .heading-actions .button { flex: 1; padding: 10px !important; font-size: 13px !important; border-radius: 10px !important; }

  /* 卡片统一 */
  .panel, .workspace-main.panel {
    margin: 6px 12px 12px !important; padding: 14px !important;
    border-radius: 16px !important; background: #fff !important; border: 1px solid #eceae4 !important;
  }
  .panel-head { margin-bottom: 13px !important; }
  .panel-head h2 { font-size: 15.5px !important; }

  /* 表单更紧凑 */
  .field { margin-bottom: 11px !important; }
  .field > span { font-size: 12px !important; margin-bottom: 5px !important; }
  .field input, .field select, .field textarea {
    font-size: 15.5px !important; padding: 11px 13px !important; border-radius: 11px !important;
  }
  .field textarea { min-height: 140px !important; }
  .editor-toolbar { margin: 0 0 10px !important; }
  .submit-actions { gap: 8px !important; }
  .submit-actions .button.primary { padding: 15px !important; font-size: 16px !important; border-radius: 13px !important; }

  /* 首页：极简欢迎页 */
  .hero-grid { padding: 14px 16px 0 !important; }
  .hero-copy h1 { font-size: 25px !important; line-height: 1.3 !important; margin: 6px 0 8px !important; }
  .hero-lead { font-size: 14px !important; line-height: 1.7 !important; }
  .hero-actions { gap: 9px !important; margin-top: 16px !important; }
  .free-offer { margin-top: 12px !important; padding: 11px 13px !important; border-radius: 13px !important; font-size: 13px !important; }

  /* 书架 / 会员 / 订单 卡片 */
  .book-item { padding: 13px !important; border-radius: 15px !important; margin-bottom: 0 !important; }
  .book-item h3 { font-size: 16px !important; margin: 0 0 4px !important; }
  .book-monogram { width: 36px !important; height: 36px !important; font-size: 16px !important; border-radius: 10px !important; }
  .book-langs, .book-meta, .book-item-footer { font-size: 12px !important; }
  .book-progress-line { height: 4px !important; margin: 7px 0 !important; }
  .stats-strip { margin: 4px 12px 10px !important; border-radius: 14px !important; }
  .stats-strip > * { padding: 10px 8px !important; }
  .library-toolbar { padding: 0 12px !important; margin-bottom: 8px !important; }

  .plan-card { padding: 15px 14px !important; border-radius: 15px !important; }
  .plan-price { font-size: 25px !important; }
  .plan-description { margin: 6px 0 8px !important; font-size: 12.5px !important; }
  .plan-benefits { margin-bottom: 10px !important; gap: 4px !important; }
  .plan-benefits span { font-size: 12px !important; }
  .plan-benefits span:nth-child(n+4) { display: none !important; }
  .membership-status { margin: 4px 12px 10px !important; padding: 13px !important; border-radius: 15px !important; }
  .order-card, .redeem-card { margin: 8px 12px !important; padding: 13px !important; border-radius: 15px !important; }

  /* 帮助 / FAQ */
  .faq-grid { padding: 0 12px !important; gap: 9px !important; }
  .faq-item { border-radius: 13px !important; }

  /* 登录页 */
  .page-auth-card { margin: 10px 12px !important; padding: 18px 15px !important; border-radius: 16px !important; }
  .page-auth-card h1 { font-size: 20px !important; }
  .page-auth-card .field input { font-size: 16px !important; }
}

/* ================================================================
 * 【压缩版】卡片重排 —— 把"网页式竖排"改成"App 式横排"
 * ================================================================ */
@media (max-width: 820px) {

  /* ---------- 书架卡片：重排成网格 ---------- */
  .book-item {
    display: grid !important;
    grid-template-columns: 36px 1fr auto !important;
    grid-template-areas:
      "mono title badge"
      "mono langs langs"
      "meta meta meta"
      "prog prog prog"
      "foot foot foot" !important;
    gap: 3px 10px !important;
    align-items: center !important;
    padding: 13px !important;
  }
  .book-item .book-item-head { display: contents !important; }
  .book-monogram { grid-area: mono !important; align-self: center !important; }
  .book-item .status-badge { grid-area: badge !important; }
  .book-item h3 { grid-area: title !important; margin: 0 !important; font-size: 15.5px !important; line-height: 1.3 !important; }
  .book-item .book-langs { grid-area: langs !important; margin: 1px 0 0 !important; font-size: 11.5px !important; }
  .book-item .book-meta { grid-area: meta !important; margin: 5px 0 0 !important; font-size: 11.5px !important; }
  .book-item .book-progress-line { grid-area: prog !important; margin: 6px 0 4px !important; height: 4px !important; }
  .book-item .book-item-footer { grid-area: foot !important; font-size: 11.5px !important; }
  .book-grid, .draft-grid { gap: 9px !important; }

  /* ---------- 会员套餐卡：价格右移，横排节省高度 ---------- */
  .plan-card {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    gap: 2px 10px !important;
    align-items: baseline !important;
    padding: 14px !important;
  }
  .plan-card .plan-name { grid-column: 1; grid-row: 1; font-size: 12.5px !important; }
  .plan-card .plan-price { grid-column: 2; grid-row: 1 / span 2; font-size: 24px !important; margin: 0 !important; align-self: center; }
  .plan-card .plan-period { grid-column: 1; grid-row: 2; font-size: 11.5px !important; }
  .plan-card .plan-description {
    grid-column: 1 / -1; margin: 7px 0 8px !important; font-size: 12px !important;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .plan-card .plan-benefits {
    grid-column: 1 / -1; display: flex !important; flex-wrap: wrap !important;
    gap: 4px 12px !important; margin: 0 0 10px !important;
  }
  .plan-card .plan-benefits span { font-size: 11.5px !important; }
  .plan-card .plan-benefits span:nth-child(n+4) { display: none !important; }
  .plan-card .button { grid-column: 1 / -1; padding: 12px !important; font-size: 14.5px !important; }

  /* ---------- 会员状态条：横排一行 ---------- */
  .membership-status { display: flex !important; align-items: center; justify-content: space-between !important; gap: 10px !important; padding: 12px 14px !important; }
  .membership-status h3 { margin: 0 !important; font-size: 14.5px !important; }
  .membership-status p { margin: 0 !important; font-size: 12px !important; }

  /* ---------- 顶部统计条：更扁 ---------- */
  .stats-strip { grid-template-columns: repeat(4, 1fr) !important; }
  .stats-strip > * { padding: 9px 4px !important; }
  .stats-strip strong, .stats-strip b { font-size: 16px !important; }
  .stats-strip small, .stats-strip span { font-size: 10.5px !important; }

  /* ---------- 翻译台：进一步压扁 ---------- */
  .workspace-main.panel { margin: 4px 12px 10px !important; padding: 13px !important; }
  .field textarea { min-height: 120px !important; }
  .field { margin-bottom: 10px !important; }
  .panel-head { margin-bottom: 11px !important; }
  .glossary-box { margin-bottom: 11px !important; }
  .submit-actions .button.primary { padding: 14px !important; }
  .submit-actions .button.ghost { padding: 11px !important; font-size: 13.5px !important; }
}

/* ---------- 手机端：解除卡片最小高度强制（这是页面变长的真正原因） ---------- */
@media (max-width: 820px) {
  .book-item { min-height: 0 !important; }
  .plan-card { min-height: 0 !important; }
  .draft-card { min-height: 0 !important; }
  .book-item::before { height: 3px !important; }
  .book-item { padding-top: 14px !important; }
}

/* ---------- 手机端：会员页精简 ---------- */
@media (max-width: 820px) {
  /* 演示支付长说明：手机端收起（上线后如有必要再放回帮助页） */
  .billing-note { display: none !important; }
  /* 账号卡：顶栏已经显示账号，手机端不再重复 */
  .account-card { display: none !important; }
  .billing-layout { display: block !important; padding: 0 !important; gap: 0 !important; }
  .billing-side { display: block !important; padding: 0 !important; margin: 0 !important; gap: 0 !important; }
  .redeem-card, .order-card { margin: 8px 12px 0 !important; padding: 12px 14px !important; }
  .redeem-card h3, .order-card h3 { font-size: 14.5px !important; margin: 0 0 4px !important; }
  .redeem-card p { font-size: 12px !important; margin: 0 0 8px !important; }
  .redeem-card .inline-field { display: grid !important; grid-template-columns: 1fr auto !important; gap: 8px !important; }
  .redeem-card input { font-size: 15px !important; padding: 10px 12px !important; }
  .redeem-card button { padding: 0 16px !important; font-size: 14px !important; }
  .order-card { margin-bottom: 12px !important; }
  .side-label { font-size: 9.5px !important; }
}

/* 手机端：顶部操作按钮补足 44px */
@media (max-width: 820px) {
  .heading-actions .button,
  .library-toolbar .button,
  .page-heading .button { min-height: 44px !important; display: inline-flex !important; align-items: center !important; justify-content: center !important; }
}


/* ================================================================
 * 手机端「我的」页（新增）
 * ================================================================ */
.mine-card { display: flex; align-items: center; gap: 14px; margin: 8px 12px 10px; padding: 16px !important; border-radius: 16px !important; }
.mine-avatar { width: 54px; height: 54px; border-radius: 17px; flex: none; display: grid; place-items: center;
  background: linear-gradient(145deg, #263450, #11182b); color: #f6f1e6; font: 700 22px/1 "STKaiti","KaiTi",serif; }
.mine-intro { min-width: 0; }
.mine-intro h3 { margin: 0 0 4px; font-size: 17px; }
.mine-intro p { margin: 0; font-size: 12.5px; color: #8b93a1; word-break: break-all; }

.mine-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0 12px 10px; padding: 0 !important; overflow: hidden; border-radius: 16px !important; }
.mine-stat { padding: 14px; background: #fff; text-align: center; }
.mine-stat .ms-label { display: block; font-size: 11.5px; color: #8b93a1; margin-bottom: 5px; }
.mine-stat b { font-size: 20px; color: #1f2937; }
.mine-stat small { font-size: 11.5px; color: #8b93a1; margin-left: 3px; }

.mine-menu { margin: 0 12px 10px; padding: 0 !important; overflow: hidden; border-radius: 16px !important; }
.mine-item { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 50px; padding: 0 14px;
  border: 0; border-bottom: 1px solid #f1efea; background: #fff; color: #1f2937; font-size: 15px;
  text-align: left; text-decoration: none; cursor: pointer; }
.mine-item:last-child { border-bottom: 0; }
.mine-item:active { background: #faf9f6; }
.mi-ico { width: 26px; height: 26px; border-radius: 8px; flex: none; display: grid; place-items: center;
  background: #f2efe8; font-size: 13px; color: #5b6675; }
.mi-txt { flex: 1; }
.mi-tip { font-size: 12px; color: #c2603a; margin-right: 4px; }
.mine-item b { color: #c4c9d2; font-weight: 400; font-size: 17px; }
.mine-login, .mine-logout { margin: 0 12px 12px !important; }
.mine-login { display: block; }
.mine-logout { color: #c2402d !important; border-color: #f0d9d4 !important; }

@media (max-width: 820px) {
  .mine-login, .mine-logout { width: calc(100% - 24px) !important; min-height: 46px; }
}


/* ================================================================
 * 登录页：全屏，不显示底部导航（2026-10-10）
 * ================================================================ */
body.auth-mode .mobile-nav { display: none !important; }
body.auth-mode main.app-main,
body.auth-mode main.shell.app-main { bottom: 0 !important; }

@media (max-width: 820px) {
  /* 登录页在手机端铺满整屏 */
  body.auth-mode .topbar { display: none !important; }
  body.auth-mode main.app-main { top: 0 !important; bottom: 0 !important; }
  body.auth-mode .page-auth-card { margin: 22px 16px !important; }
  body.auth-mode #pageAuthClose,
  body.auth-mode #pageAuthBack { display: none !important; }
}


/* 底部导航为空时（未登录）整体隐藏 */
.mobile-nav.nav-empty { display: none !important; }


/* ================================================================
 * 登录界面：底部导航 + 顶栏 一律不显示（CSS 保险，不依赖 JS）
 * ================================================================ */
body.auth-mode .mobile-nav,
body:has(#view-auth.active) .mobile-nav,
body.auth-mode .topbar,
body:has(#view-auth.active) .topbar { display: none !important; }

body.auth-mode main.app-main,
body:has(#view-auth.active) main.app-main { top: 0 !important; bottom: 0 !important; }


/* ================================================================
 * 登录界面：极简 —— 屏幕中间只留一个登录框
 * 去掉：左侧营销文案、副标题、关闭按钮、返回按钮、多余装饰
 * ================================================================ */
@media (max-width: 820px) {
  /* 登录页居中 */
  body.auth-mode main.app-main,
  body:has(#view-auth.active) main.app-main {
    display: flex !important; align-items: center; justify-content: center;
    padding: 0 !important;
  }
  body.auth-mode .auth-page-grid,
  body:has(#view-auth.active) .auth-page-grid {
    display: block !important; width: 100% !important; padding: 0 !important; gap: 0 !important;
  }
  /* 左侧营销区：完全去掉 */
  body.auth-mode .auth-page-copy,
  body:has(#view-auth.active) .auth-page-copy { display: none !important; }

  /* 登录卡片：居中、干净 */
  body.auth-mode .page-auth-card,
  body:has(#view-auth.active) .page-auth-card {
    width: auto !important; max-width: none !important;
    margin: 0 22px !important; padding: 26px 20px 20px !important;
    border-radius: 20px !important; box-shadow: 0 16px 44px rgba(22,28,46,.10) !important;
  }
  /* 去掉副标题、关闭、返回 */
  body.auth-mode #pageAuthSubtitle,
  body:has(#view-auth.active) #pageAuthSubtitle,
  body.auth-mode #pageAuthClose,
  body:has(#view-auth.active) #pageAuthClose,
  body.auth-mode #pageAuthBack,
  body:has(#view-auth.active) #pageAuthBack { display: none !important; }

  /* 品牌标记居中 */
  body.auth-mode .auth-mark,
  body:has(#view-auth.active) .auth-mark { margin: 0 auto 14px !important; }
  body.auth-mode #pageAuthTitle,
  body:has(#view-auth.active) #pageAuthTitle { text-align: center !important; margin: 0 0 16px !important; font-size: 19px !important; }

  /* 表单紧凑 */
  body.auth-mode .auth-tabs,
  body:has(#view-auth.active) .auth-tabs { margin-bottom: 16px !important; }
  body.auth-mode .page-auth-card .field,
  body:has(#view-auth.active) .page-auth-card .field { margin-bottom: 12px !important; }
  body.auth-mode .page-auth-card .field input,
  body:has(#view-auth.active) .page-auth-card .field input { font-size: 16px !important; padding: 13px 14px !important; }
  body.auth-mode #pageAuthSubmit,
  body:has(#view-auth.active) #pageAuthSubmit { margin-top: 4px !important; min-height: 48px; }
  body.auth-mode .auth-tip,
  body:has(#view-auth.active) .auth-tip { display: block; margin-top: 14px !important; text-align: center; font-size: 11.5px; line-height: 1.65; }
}


/* ================================================================
 * 登录界面 · 仿识卡版（2026-10-10）
 * 白底 + 顶部品牌区(13vh) + 底部大按钮 + 极简
 * ================================================================ */
@media (max-width: 820px) {
  body.auth-mode,
  body:has(#view-auth.active) { background: linear-gradient(180deg, #ffffff 0%, #f7f3ea 100%) !important; }

  body.auth-mode main.app-main,
  body:has(#view-auth.active) main.app-main {
    display: flex !important; flex-direction: column !important;
    align-items: stretch !important; justify-content: flex-start !important;
    padding: 0 !important;
    background: linear-gradient(180deg, #ffffff 0%, #f7f3ea 100%) !important;
  }
  body.auth-mode .auth-page-grid,
  body:has(#view-auth.active) .auth-page-grid {
    display: flex !important; flex-direction: column !important;
    width: 100% !important; height: 100% !important;
    padding: 0 !important; gap: 0 !important;
  }
  body.auth-mode .auth-page-copy,
  body:has(#view-auth.active) .auth-page-copy { display: none !important; }

  /* 卡片外壳去掉，变成整页表单 */
  body.auth-mode .page-auth-card,
  body:has(#view-auth.active) .page-auth-card {
    flex: 1 1 auto !important; display: flex !important; flex-direction: column !important;
    width: 100% !important; max-width: none !important; height: 100% !important;
    margin: 0 !important; padding: 0 30px 34px !important;
    border: 0 !important; border-radius: 0 !important;
    box-shadow: none !important; background: transparent !important;
  }

  /* 顶部品牌区 */
  body.auth-mode .auth-mark,
  body:has(#view-auth.active) .auth-mark {
    width: 68px !important; height: 68px !important; flex: none;
    margin: 12vh auto 16px !important;
    border-radius: 21px !important;
    display: grid !important; place-items: center;
    background: linear-gradient(135deg, #ffc366, #ff5f3d) !important;
    color: #2b1608 !important; font-size: 36px !important; font-weight: 700;
    box-shadow: 0 12px 28px rgba(255,95,61,.28) !important;
  }
  body.auth-mode #pageAuthTitle,
  body:has(#view-auth.active) #pageAuthTitle {
    text-align: center !important; margin: 0 0 8px !important;
    font-size: 28px !important; font-weight: 800 !important; letter-spacing: 3px !important;
    color: #111827 !important;
  }
  /* 副标题当标语用 */
  body.auth-mode #pageAuthSubtitle,
  body:has(#view-auth.active) #pageAuthSubtitle {
    display: block !important; text-align: center !important;
    font-size: 13px !important; color: #7b8496 !important;
    margin: 0 0 auto !important;                 /* 把下面的表单推到底部 */
  }

  /* 表单区贴底 */
  body.auth-mode .auth-tabs,
  body:has(#view-auth.active) .auth-tabs {
    display: grid !important; grid-template-columns: 1fr 1fr;
    gap: 0 !important; padding: 4px !important;
    background: #f1eee7 !important; border-radius: 14px !important;
    margin: 0 0 18px !important; border: 0 !important;
  }
  body.auth-mode .auth-tabs button,
  body:has(#view-auth.active) .auth-tabs button {
    min-height: 42px !important; border-radius: 11px !important;
    font-size: 15px !important; font-weight: 700 !important;
  }
  body.auth-mode .auth-tabs button.active,
  body:has(#view-auth.active) .auth-tabs button.active {
    background: #fff !important; color: #1f2937 !important;
    box-shadow: 0 2px 8px rgba(15,23,42,.08) !important;
  }

  /* 输入框 */
  body.auth-mode .page-auth-card .field,
  body:has(#view-auth.active) .page-auth-card .field { margin: 0 0 12px !important; }
  body.auth-mode .page-auth-card .field > span,
  body:has(#view-auth.active) .page-auth-card .field > span { display: none !important; }
  body.auth-mode .page-auth-card .field input,
  body:has(#view-auth.active) .page-auth-card .field input {
    width: 100% !important; height: 50px !important;
    padding: 0 16px !important; font-size: 16px !important;
    border-radius: 15px !important; border: 1px solid #e7e4dd !important;
    background: #faf9f6 !important;
  }
  body.auth-mode .page-auth-card .field input:focus,
  body:has(#view-auth.active) .page-auth-card .field input:focus {
    background: #fff !important; border-color: #c2603a !important;
  }

  /* 主按钮 */
  body.auth-mode #pageAuthSubmit,
  body:has(#view-auth.active) #pageAuthSubmit {
    width: 100% !important; height: 50px !important;
    margin: 6px 0 0 !important; border-radius: 16px !important;
    font-size: 16px !important; font-weight: 700 !important;
    background: linear-gradient(135deg, #ffb24a, #ff5f3d) !important;
    box-shadow: 0 8px 20px rgba(255,95,61,.28) !important;
  }
  body.auth-mode #pageAuthSubmit:active,
  body:has(#view-auth.active) #pageAuthSubmit:active { transform: scale(.985); }

  /* 协议：11px 居中 */
  body.auth-mode .auth-tip,
  body:has(#view-auth.active) .auth-tip {
    display: block !important; text-align: center !important;
    font-size: 11px !important; color: #9ca3af !important;
    line-height: 1.7 !important; margin: 14px 0 0 !important;
  }
  body.auth-mode .auth-tip a,
  body:has(#view-auth.active) .auth-tip a { color: #c2603a !important; }

  /* 错误提示 */
  body.auth-mode .auth-error,
  body:has(#view-auth.active) .auth-error {
    margin: 0 0 10px !important; padding: 10px 12px !important;
    border-radius: 11px !important; font-size: 13px !important;
  }
}


/* ================================================================
 * 手机端：彻底去掉底部导航栏
 * 导航改由顶部栏承担：译境 logo → 首页 / 右上角头像 → 我的
 * ================================================================ */
@media (max-width: 820px) {

  /* 内容区铺到底部（原来给底栏留了 76px） */
  main.app-main,
  main.shell.app-main { bottom: 0 !important; }

  /* 顶部栏：让 logo 和头像更好点 */
  .topbar .brand { min-height: 44px; }
  .topbar .account-button { min-height: 40px; }
  .topbar .quota-chip { min-height: 34px; display: inline-flex; align-items: center; }
}


/* ================================================================
 * 译境 · 完全对齐识卡的视觉体系（2026-10-10）
 * 浅灰底 + 白卡片 + 18px 大圆角 + 柔和阴影 + 白色底部导航
 * ================================================================ */
@media (max-width: 820px) {

  /* ---------- 1. 配色体系对齐识卡 ---------- */
  html, body { background: #f2f2f7 !important; }
  body {
    --bg: #f2f2f7;
    --card: #ffffff;
    --line: #f1f5f9;
    --text: #111827;
    --text-2: #6b7280;
    --text-3: #9ca3af;
  }
  main.app-main { background: #f2f2f7 !important; }

  /* ---------- 2. 顶栏：白底 + 细分割线（识卡同款） ---------- */
  .topbar {
    height: 56px !important;
    background: rgba(255,255,255,.94) !important;
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border-bottom: 1px solid #f1f5f9 !important;
  }
  .topbar .shell, .topbar-inner { height: 56px !important; padding: 0 18px !important; }

  /* 品牌：38px 渐变圆角块 + 19px 加粗名 */
  .brand { gap: 9px !important; }
  .brand-seal {
    width: 38px !important; height: 38px !important;
    border-radius: 12px !important; font-size: 19px !important;
    background: linear-gradient(135deg, #ffb24a, #ff5f3d) !important;
    color: #2b1608 !important; font-weight: 700 !important;
    box-shadow: 0 6px 14px rgba(255,95,61,.30) !important;
  }
  .brand-copy strong { font-size: 19px !important; font-weight: 800 !important; letter-spacing: .5px !important; }

  /* 右上角胶囊（识卡同款 pill） */
  .quota-chip {
    background: #fff !important; border: 1px solid #f1f5f9 !important;
    border-radius: 999px !important; padding: 7px 12px !important;
    font-size: 13px !important; font-weight: 700 !important;
    box-shadow: 0 2px 8px rgba(15,23,42,.06) !important;
    height: 34px; display: inline-flex; align-items: center;
  }
  .account-button {
    background: #fff !important; border: 1px solid #f1f5f9 !important;
    border-radius: 999px !important; padding: 4px 12px 4px 4px !important;
    box-shadow: 0 2px 8px rgba(15,23,42,.06) !important;
    height: 34px;
  }
  .account-button .avatar {
    width: 26px !important; height: 26px !important; border-radius: 50% !important;
    background: linear-gradient(135deg, #ffb24a, #ff5f3d) !important; color: #2b1608 !important;
    font-size: 12px !important; font-weight: 700;
  }
  .account-button .account-label { font-size: 13px !important; font-weight: 700 !important; }

  /* ---------- 3. 内容区滚动位置 ---------- */
  main.app-main, main.shell.app-main { top: 56px !important; }

  /* ---------- 4. 卡片：白底 18px 圆角 + 柔和阴影（识卡同款） ---------- */
  .panel, .workspace-main.panel, .mine-card, .mine-stats, .mine-menu,
  .membership-status, .redeem-card, .order-card, .reader-hero, .page-auth-card {
    background: #fff !important;
    border: 1px solid rgba(255,255,255,.6) !important;
    border-radius: 18px !important;
    box-shadow: 0 2px 10px rgba(15,23,42,.05) !important;
  }
  .book-item, .plan-card, .feature-card, .step-card {
    background: #fff !important;
    border: 1px solid rgba(255,255,255,.6) !important;
    border-radius: 18px !important;
    box-shadow: 0 2px 10px rgba(15,23,42,.05) !important;
  }
  .panel { margin-left: 16px !important; margin-right: 16px !important; }
  .view { padding: 10px 0 26px !important; }

  /* ---------- 5. 底部导航：白色 + 毛玻璃（识卡同款，不再是深色） ---------- */
  .mobile-nav {
    background: rgba(255,255,255,.94) !important;
    -webkit-backdrop-filter: blur(14px) !important; backdrop-filter: blur(14px) !important;
    border-top: 1px solid #f1f5f9 !important;
    border-bottom: 0 !important;
    box-shadow: none !important;
    padding: 10px 20px calc(10px + env(safe-area-inset-bottom)) !important;
    height: auto !important;
  }
  .mobile-nav button {
    color: #9ca3af !important;
    background: transparent !important;
    font-weight: 600 !important;
    min-height: 44px !important;
  }
  .mobile-nav button span { font-size: 22px !important; filter: grayscale(.8); opacity: .85; }
  .mobile-nav button small { font-size: 11px !important; margin-top: 3px; }
  .mobile-nav button.active { color: #c2603a !important; background: transparent !important; }
  .mobile-nav button.active span { filter: none; opacity: 1; }

  /* ---------- 6. 页面标题：识卡式小组件 ---------- */
  .page-heading h1 { font-size: 20px !important; font-weight: 800 !important; }
  .page-heading p { font-size: 12.5px !important; color: #9ca3af !important; }

  /* ---------- 7. 统计条：白底。分隔线化 ---------- */
  .stats-strip, .mine-stats { background: #fff !important; }
  .stats-strip > *, .mine-stat { background: #fff !important; border-right: 1px solid #f1f5f9; }

  /* ---------- 8. 按钮圆角统一 16px ---------- */
  .button { border-radius: 16px !important; }
  .submit-actions .button.primary { border-radius: 16px !important; }

  /* ---------- 9. 输入框：浅灰底 + 16px 圆角（识卡同款 auth-input） ---------- */
  .field input, .field select, .field textarea {
    border-radius: 16px !important;
    border: 1px solid #e5e7eb !important;
    background: #f9fafb !important;
    font-size: 16px !important;
  }
  .field input:focus, .field select:focus, .field textarea:focus {
    background: #fff !important; border-color: #c2603a !important;
  }
}


/* ================================================================
 * 首页重排：完全照识卡的结构（大卡片 + 信息卡片流）
 * ================================================================ */
@media (max-width: 820px) {

  /* ---------- 核心入口大卡片（对应识卡的拍照框） ---------- */
  .hero-card {
    position: relative; overflow: hidden;
    border-radius: 28px; margin: 0 16px 16px;
    padding: 34px 20px 26px; text-align: center;
    background: linear-gradient(150deg, #7c2d12, #c2410c 55%, #ea580c);
    box-shadow: 0 18px 36px rgba(194,65,12,.32);
    color: #fff; cursor: pointer;
  }
  .hero-card:active { transform: scale(.985); }
  .hero-glow {
    position: absolute; width: 280px; height: 280px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.24), transparent 65%);
    top: -120px; left: 50%; transform: translateX(-50%);
  }
  .hero-icon {
    position: relative;
    width: 92px; height: 92px; margin: 0 auto 14px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 38px; font-weight: 700; color: #fff;
    background: rgba(255,255,255,.22); border: 2px solid rgba(255,255,255,.5);
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  }
  .hero-title { position: relative; font-size: 24px; font-weight: 800; letter-spacing: 1px; }
  .hero-sub { position: relative; font-size: 13px; opacity: .9; margin-top: 7px; line-height: 1.6; }
  .hero-tags { position: relative; display: flex; justify-content: center; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
  .hero-card .tag {
    background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.35);
    padding: 5px 12px; border-radius: 999px; font-size: 12.5px; color: #fff;
  }
  .hero-hint { position: relative; font-size: 11.5px; opacity: .8; margin-top: 16px; }

  /* ---------- 信息卡片流（识卡同款） ---------- */
  .home-card { margin: 0 16px 14px !important; padding: 16px !important; }
  .hc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
  .hc-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
  .hc-more { border: 0; background: transparent; color: #c2603a; font-size: 13px; font-weight: 600; }

  /* 最近作品列表 */
  .home-books { display: grid; gap: 10px; }
  .home-book {
    display: flex; align-items: center; gap: 11px;
    padding: 11px 12px; border-radius: 14px; background: #f9fafb; cursor: pointer;
  }
  .home-book .hb-mono {
    width: 36px; height: 36px; border-radius: 11px; flex: none;
    display: grid; place-items: center; font-size: 16px; font-weight: 700;
    background: linear-gradient(145deg, #ffb24a, #ff5f3d); color: #2b1608;
  }
  .home-book .hb-main { flex: 1; min-width: 0; }
  .home-book .hb-title { font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .home-book .hb-meta { font-size: 11.5px; color: #9ca3af; margin-top: 2px; }
  .home-book .hb-go { color: #c4c9d2; font-size: 17px; }

  /* 使用情况三格 */
  .home-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: #f1f5f9; border-radius: 14px; overflow: hidden; }
  .home-stats > div { background: #fff; padding: 14px 6px; text-align: center; }
  .home-stats b { display: block; font-size: 20px; font-weight: 800; color: #111827; }
  .home-stats span { font-size: 11.5px; color: #9ca3af; }

  /* 快捷入口行 */
  .home-row {
    display: flex; align-items: center; gap: 11px; width: 100%;
    min-height: 50px; padding: 0; border: 0; background: transparent;
    border-bottom: 1px solid #f1f5f9; font-size: 15px; color: #1f2937; text-align: left; cursor: pointer;
  }
  .home-card .home-row:last-child { border-bottom: 0; }
  .home-row:active { background: #fafafa; }
  .home-row .hr-ico {
    width: 26px; height: 26px; border-radius: 8px; flex: none; display: grid; place-items: center;
    background: #f2efe8; font-size: 13px; color: #5b6675;
  }
  .home-row b { margin-left: auto; color: #c4c9d2; font-weight: 400; font-size: 17px; }

  /* 隐藏旧的首页元素 */
  .hero-grid, .feature-grid, .section-heading, .steps-row, .cta-panel, .free-offer { display: none !important; }
}


/* 登录页左上角返回按钮 */
.auth-back-top {
  display: none;
  position: fixed; top: 14px; left: 16px; z-index: 90;
  align-items: center; gap: 4px;
  padding: 9px 14px 9px 10px;
  border: 0; border-radius: 999px;
  background: rgba(255,255,255,.9);
  color: #374151; font-size: 14px; font-weight: 600;
  box-shadow: 0 2px 10px rgba(15,23,42,.08);
  cursor: pointer;
}
.auth-back-top:active { transform: scale(.96); }
@media (max-width: 820px) {
  body.auth-mode .auth-back-top,
  body:has(#view-auth.active) .auth-back-top { display: inline-flex; }
}


/* 顶栏左上角返回按钮 */
.nav-back {
  display: none;
  align-items: center; justify-content: center;
  width: 36px; height: 36px; flex: none;
  margin-right: 2px;
  border: 0; border-radius: 50%;
  background: rgba(15,23,42,.05);
  color: #374151; font-size: 24px; font-weight: 600; line-height: 1;
  padding-bottom: 3px; cursor: pointer;
}
.nav-back.show { display: inline-flex; }
.nav-back:active { background: rgba(15,23,42,.11); transform: scale(.94); }
@media (max-width: 820px) {
  .topbar .shell, .topbar-inner { gap: 6px !important; }
  .topbar .brand { flex: 1; min-width: 0; }
}


/* ================================================================
 * 底部导航：登录后显示「翻译 / 作品」；未登录和登录页隐藏
 * ================================================================ */
@media (max-width: 820px) {
  .mobile-nav {
    position: fixed !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    margin: 0 !important; border-radius: 0 !important;
    display: grid !important; grid-template-columns: repeat(3, 1fr) !important; gap: 0 !important;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom)) !important;
    background: rgba(255,255,255,.94) !important;
    -webkit-backdrop-filter: blur(14px) !important; backdrop-filter: blur(14px) !important;
    border-top: 1px solid #f1f5f9 !important; border-bottom: 0 !important; box-shadow: none !important;
  }
  .mobile-nav button {
    display: flex !important; flex-direction: column !important;
    align-items: center !important; justify-content: center !important; gap: 3px !important;
    min-height: 46px !important; border: 0 !important; border-radius: 12px !important;
    background: transparent !important; color: #9ca3af !important;
    font-weight: 600 !important; font-size: 11px !important;
  }
  .mobile-nav button span { font-size: 22px !important; line-height: 1 !important; }
  .mobile-nav button small { font-size: 11px !important; }
  .mobile-nav button.active { color: #c2603a !important; }

  .mobile-nav.nav-empty { display: none !important; }
  body.auth-mode .mobile-nav,
  body:has(#view-auth.active) .mobile-nav { display: none !important; }

  main.app-main, main.shell.app-main { bottom: 0 !important; }
  body:has(.mobile-nav:not(.nav-empty):not(.auth-mode)) main.app-main,
  body:not(.auth-mode):has(.mobile-nav:not(.nav-empty)) main.app-main {
    bottom: calc(78px + env(safe-area-inset-bottom)) !important;
  }
  body.auth-mode main.app-main,
  body:has(#view-auth.active) main.app-main { bottom: 0 !important; }
}


/* ============ 手机号验证码 / Apple 登录（2026-10-11）============ */
.auth-code-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; margin-bottom: 12px; }
.auth-code-row input { height: 50px; width: 100%; padding: 0 16px; font-size: 16px;
  border-radius: 15px; border: 1px solid #e7e4dd; background: #faf9f6; outline: none; }
.auth-code-row input:focus { background: #fff; border-color: #c2603a; }
.auth-code-btn { flex: none; height: 50px; padding: 0 14px; border: 1px solid #f0d9d4; border-radius: 15px;
  background: #fff6f2; color: #c2603a; font-size: 14px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.auth-code-btn:disabled { opacity: .55; }
.auth-mini { font-size: 11.5px; color: #9ca3af; text-align: center; margin: 8px 0 0; }
.auth-switch { display: block; margin: 12px auto 0; font-size: 13.5px; color: #c2603a; }
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 18px 0 12px; color: #b9bfc9; font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: #f1f5f9; }
.auth-apple { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 50px;
  border: 1px solid #e7e4dd; border-radius: 16px; background: #111827; color: #fff;
  font-size: 15.5px; font-weight: 700; cursor: pointer; }
.auth-apple:active { transform: scale(.985); }

@media (max-width: 820px) {
  body.auth-mode .page-auth-card, body:has(#view-auth.active) .page-auth-card { padding-bottom: 28px !important; }
  .auth-switch { min-height: 38px; }
}


/* 新建作品对话框 */
#workEditorDialog .modal-card { max-width: 460px; }
#workEditorDialog h2 { margin: 4px 0 6px; font-size: 20px; }
#workEditorDialog p { color: #6b7280; font-size: 13px; margin: 0 0 16px; line-height: 1.7; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .button { flex: 1; }
@media (max-width: 820px) {
  #workEditorDialog .modal-card { margin: 0 12px; border-radius: 18px; }
  #workEditorDialog .drawer-title-grid { display: block; }
}


/* 每个作品的草稿箱入口（作品详情页） */
#readerDrafts { position: relative; }
.draft-book-tag { display: inline-block; margin-left: 4px; padding: 1px 6px; border-radius: 999px;
  background: #fff6f2; color: #c2603a; font-size: 11px; font-weight: 700; }
@media (max-width: 820px) {
  #view-drafts .page-heading { padding-top: 10px !important; }
  #view-drafts .draft-notice { margin: 0 12px 10px !important; }
  #view-drafts .draft-grid { padding: 0 12px !important; }
}


/* 章节行：译文预览（2026-10-11） */
.chapter-trans-preview { display: flex; gap: 6px; align-items: flex-start; margin-top: 7px;
  padding: 8px 10px; border-radius: 10px; background: #f7faf8; font-size: 12.5px; line-height: 1.6; color: #374151; }
.chapter-trans-preview b { flex: none; width: 16px; height: 16px; border-radius: 5px; background: #e8f5ee; color: #1f8453;
  font-size: 10px; display: grid; place-items: center; margin-top: 2px; }
.chapter-trans-preview span { flex: 1; min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chapter-trans-preview.pending b { background: #fef3c7; color: #b45309; }
.chapter-trans-preview.pending span { color: #b45309; }
.chapter-trans-preview.failed b { background: #fee2e2; color: #b91c1c; }
.chapter-trans-preview.failed span { color: #b91c1c; }
.chapter-row-meta { margin: 2px 0 0 !important; }
@media (max-width: 820px) {
  .chapter-row { padding: 12px !important; }
  .chapter-row h3 { font-size: 15px !important; }
  .chapter-trans-preview { font-size: 12px; padding: 7px 9px; }
}


/* 删除作品按钮 */
.book-item { position: relative; }
.book-del { position: absolute; top: 10px; right: 10px; z-index: 3;
  width: 30px; height: 30px; border: 0; border-radius: 50%;
  background: rgba(15,23,42,.05); color: #6b7280; font-size: 17px; line-height: 1;
  display: grid; place-items: center; cursor: pointer; padding-bottom: 8px; }
.book-del:active { background: rgba(239,68,68,.14); color: #dc2626; }
.book-item .status-badge { margin-right: 30px; }
.button.danger-text { color: #dc2626 !important; border-color: #f3d6d2 !important; }
.button.danger-text:active { background: #fef2f2 !important; }
@media (max-width: 820px) {
  .book-del { width: 34px; height: 34px; top: 8px; right: 8px; }
  .reader-actions { flex-wrap: wrap; }
}


/* 作品卡片：明确的「删除」按钮 */
.book-del {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  height: 26px; padding: 0 10px; border: 1px solid #f3d6d2; border-radius: 999px;
  background: #fff; color: #dc2626; font-size: 12px; font-weight: 600;
  display: inline-flex; align-items: center; cursor: pointer;
}
.book-del:active { background: #fef2f2; }
.book-item .status-badge { margin-right: 52px; }

/* 作品详情页底部操作栏 */
.reader-actions-bar { display: flex; gap: 10px; margin: 12px 0 4px; }
.reader-actions-bar .button { flex: 1; }
.button.danger-outline { color: #dc2626 !important; border: 1px solid #f3d6d2 !important; background: #fff !important; }
.button.danger-outline:active { background: #fef2f2 !important; }
@media (max-width: 820px) {
  .book-del { height: 28px; font-size: 12.5px; padding: 0 11px; top: 9px; right: 9px; }
  .reader-actions-bar { margin: 10px 12px 6px; }
}


/* 作品卡片更多按钮（三点） */
.book-del {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  width: 32px; height: 32px; padding: 0 0 10px 0; border: 0; border-radius: 50%;
  background: rgba(15,23,42,.05); color: #6b7280;
  font-size: 20px; line-height: 1; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  writing-mode: horizontal-tb; white-space: nowrap; cursor: pointer;
}
.book-del:active { background: rgba(15,23,42,.12); }
.book-item .status-badge { margin-right: 38px; }

/* 作品操作面板（底部弹出） */
.sheet-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.42);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  display: none; align-items: flex-end; justify-content: center; z-index: 200; }
.sheet-overlay.show { display: flex; }
.book-sheet { width: 100%; max-width: 520px; background: #fff; border-radius: 22px 22px 0 0;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  animation: bsUp .22s cubic-bezier(.2,.8,.2,1); }
@keyframes bsUp { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.book-sheet .sheet-title { text-align: center; font-size: 13px; color: #6b7280; padding: 6px 0 12px;
  border-bottom: 1px solid #f1f5f9; margin-bottom: 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.book-sheet .sheet-btn { display: block; width: 100%; min-height: 50px; border: 0; background: #fff;
  border-radius: 14px; font-size: 16px; color: #1f2937; font-weight: 600; cursor: pointer;
  writing-mode: horizontal-tb; white-space: nowrap; }
.book-sheet .sheet-btn:active { background: #f7f7f8; }
.book-sheet .sheet-btn.danger { color: #dc2626; }
.book-sheet .sheet-btn.cancel { margin-top: 8px; border-top: 1px solid #f1f5f9; border-radius: 0 0 14px 14px; color: #6b7280; font-weight: 500; }


/* ================================================================
 * 视觉优化（2026-10-11）
 * 统一间距 / 层级 / 圆角 / 阴影，提升精致度
 * ================================================================ */
@media (max-width: 820px) {

  /* ---------- 1. 统一间距节奏 ---------- */
  .view { padding: 10px 0 30px !important; }
  .panel, .workspace-main.panel, .home-card, .mine-card, .mine-menu, .mine-stats,
  .membership-status, .redeem-card, .order-card, .reader-hero, .draft-notice {
    margin-left: 16px !important; margin-right: 16px !important; margin-bottom: 12px !important;
  }

  /* ---------- 2. 作品卡片：更像书架 ---------- */
  .book-item {
    padding: 16px !important; border-radius: 18px !important;
    border: 1px solid #eef0f3 !important;
  }
  .book-item h3 {
    font-size: 17px !important; font-weight: 700 !important;
    letter-spacing: -.01em; line-height: 1.35 !important;
  }
  .book-monogram {
    width: 44px !important; height: 44px !important; border-radius: 13px !important;
    font-size: 19px !important; font-weight: 700;
    background: linear-gradient(145deg, #ffb24a, #ff5f3d) !important; color: #2b1608 !important;
    box-shadow: 0 4px 12px rgba(255,95,61,.22) !important;
  }
  .book-langs { font-size: 12px !important; color: #9ca3af !important; }
  .book-meta { font-size: 12px !important; color: #6b7280 !important; gap: 12px !important; }
  .book-progress-line { height: 6px !important; border-radius: 3px !important; background: #f1f5f9 !important; }
  .book-progress-line > span { border-radius: 3px !important; background: linear-gradient(90deg,#ffb24a,#ff5f3d) !important; }
  .book-item-footer { font-size: 12px !important; color: #9ca3af !important; }
  .book-item-footer b { color: #1f2937 !important; font-weight: 700; }
  .status-badge { font-size: 11px !important; padding: 4px 9px !important; font-weight: 700 !important; }
  .book-grid, .draft-grid { gap: 11px !important; padding: 0 16px !important; }

  /* ---------- 3. 顶部统计条：精致化 ---------- */
  .stats-strip {
    margin: 6px 16px 14px !important; border-radius: 16px !important;
    border: 1px solid #eef0f3 !important; background: #fff !important;
  }
  .stats-strip > * { padding: 13px 6px !important; background: #fff !important; }
  .stats-strip b, .stats-strip strong { font-size: 19px !important; font-weight: 800 !important; color: #111827 !important; letter-spacing: -.02em; }
  .stats-strip span, .stats-strip small { font-size: 11px !important; color: #9ca3af !important; }

  /* ---------- 4. 页面标题区 ---------- */
  .page-heading { padding: 14px 16px 8px !important; }
  .page-heading h1 { font-size: 22px !important; font-weight: 800 !important; letter-spacing: -.02em; margin: 0 0 4px !important; }
  .page-heading p { font-size: 12.5px !important; color: #9ca3af !important; line-height: 1.6 !important; }

  /* ---------- 5. 主按钮：加渐变 + 阴影 ---------- */
  .button.primary {
    background: linear-gradient(135deg, #ffb24a, #ff5f3d) !important;
    border: 0 !important; color: #fff !important; font-weight: 700 !important;
    box-shadow: 0 6px 16px rgba(255,95,61,.24) !important;
  }
  .button.primary:active { transform: scale(.985); box-shadow: 0 3px 10px rgba(255,95,61,.2) !important; }
  .button.ghost { background: #fff !important; border: 1px solid #e7e4dd !important; color: #4b5563 !important; font-weight: 600 !important; }

  /* ---------- 6. 首页大卡片：更精致 ---------- */
  .hero-card { margin: 4px 16px 16px !important; border-radius: 24px !important; padding: 32px 20px 26px !important; }
  .hero-icon { width: 84px !important; height: 84px !important; font-size: 34px !important; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
  .hero-title { font-size: 23px !important; font-weight: 800 !important; }
  .hero-sub { font-size: 12.5px !important; opacity: .88 !important; }
  .hero-card .tag { font-size: 11.5px !important; padding: 5px 11px !important; }

  /* ---------- 7. 我的页 ---------- */
  .mine-avatar { width: 58px !important; height: 58px !important; border-radius: 18px !important; font-size: 23px !important; }
  .mine-intro h3 { font-size: 18px !important; font-weight: 700 !important; }
  .mine-stat b { font-size: 22px !important; font-weight: 800 !important; letter-spacing: -.02em; }
  .mine-item { font-size: 15px !important; min-height: 52px !important; }
  .mi-ico { width: 28px !important; height: 28px !important; border-radius: 9px !important; font-size: 14px !important; }

  /* ---------- 8. 会员套餐卡 ---------- */
  .plan-card { padding: 16px !important; border-radius: 18px !important; border: 1px solid #eef0f3 !important; }
  .plan-card.featured { border: 0 !important; box-shadow: 0 10px 26px rgba(11,16,32,.28) !important; }
  .plan-price { font-weight: 800 !important; letter-spacing: -.03em !important; }

  /* ---------- 9. 空状态 ---------- */
  .empty-state { padding: 40px 20px !important; }
  .empty-icon { width: 64px !important; height: 64px !important; border-radius: 20px !important; font-size: 26px !important;
    background: linear-gradient(145deg,#f7f4ee,#efeae0) !important; color: #b9b1a2 !important; }
  .empty-state h3 { font-size: 16px !important; font-weight: 700 !important; margin: 12px 0 6px !important; }
  .empty-state p { font-size: 13px !important; color: #9ca3af !important; }

  /* ---------- 10. 章节行 ---------- */
  .chapter-row { padding: 14px !important; border-radius: 16px !important; border: 1px solid #eef0f3 !important; }
  .chapter-row h3 { font-size: 15.5px !important; font-weight: 700 !important; }
  .chapter-row-index { width: 34px !important; height: 34px !important; border-radius: 11px !important;
    background: #f7f4ee !important; color: #8b93a1 !important; font-weight: 700 !important; }

  /* ---------- 11. 触控尺寸补足 ---------- */
  .book-del { width: 40px !important; height: 40px !important; top: 8px !important; right: 8px !important; }
  .book-item .status-badge { margin-right: 44px !important; }

  /* ---------- 12. 输入框统一 ---------- */
  .field input, .field select, .field textarea {
    border-radius: 13px !important; border: 1px solid #e7e4dd !important;
    background: #faf9f6 !important; font-size: 15.5px !important;
  }
  .field input:focus, .field select:focus, .field textarea:focus {
    background: #fff !important; border-color: #ff5f3d !important;
    box-shadow: 0 0 0 3px rgba(255,95,61,.10) !important;
  }
}


/* ================================================================
 * 临时翻译界面（替代原翻译台，2026-10-11）
 * ================================================================ */
@media (max-width: 820px) {
  /* 隐藏原来的翻译台工作区 */
  #translateWorkspace, #translateGate { display: none !important; }
}

.quick-wrap { max-width: 760px; margin: 0 auto; padding: 12px 16px 24px; }
.quick-card { background: #fff; border: 1px solid #eef0f3; border-radius: 18px;
  padding: 14px; margin-bottom: 12px; box-shadow: 0 2px 10px rgba(15,23,42,.04); }
.quick-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.quick-badge { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px;
  background: #fff4ef; color: #c2603a; font-size: 12px; font-weight: 700; }
.quick-badge.done { background: #e8f5ee; color: #1f8453; }
.quick-hint { font-size: 12px; color: #9ca3af; }
.quick-input { width: 100%; min-height: 190px; border: 0; outline: none; resize: vertical;
  font-size: 16px; line-height: 1.75; color: #111827; font-family: inherit; background: transparent; }
.quick-input::placeholder { color: #c4c9d2; }
.quick-bar { display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid #f4f5f7; padding-top: 10px; margin-top: 4px; }
.quick-count { font-size: 12px; color: #9ca3af; }
.quick-count b { color: #6b7280; font-weight: 700; }
.quick-clear { border: 0; background: transparent; color: #9ca3af; font-size: 13px; cursor: pointer; }
.quick-clear:active { color: #c2603a; }

.quick-langs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 8px; padding: 12px 14px; }
.quick-field { display: block; }
.quick-field > span { display: block; font-size: 11.5px; color: #9ca3af; margin-bottom: 5px; }
.quick-field select { width: 100%; height: 42px; border: 1px solid #e7e4dd; border-radius: 12px;
  background: #faf9f6; font-size: 15px; color: #1f2937; padding: 0 10px; outline: none; }
.quick-swap { width: 40px; height: 42px; border: 0; border-radius: 12px; background: #f4f5f7;
  color: #6b7280; font-size: 18px; cursor: pointer; }
.quick-swap:active { background: #e9ebef; }

.quick-go { display: block; width: 100%; height: 52px; border: 0; border-radius: 16px;
  background: linear-gradient(135deg, #ffb24a, #ff5f3d); color: #fff;
  font-size: 17px; font-weight: 700; letter-spacing: 1px; cursor: pointer;
  box-shadow: 0 8px 20px rgba(255,95,61,.26); margin-bottom: 12px; }
.quick-go:active { transform: scale(.985); box-shadow: 0 4px 12px rgba(255,95,61,.22); }
.quick-go:disabled { opacity: .7; }

.quick-copy { border: 1px solid #e7e4dd; border-radius: 999px; background: #fff; color: #6b7280;
  font-size: 12px; padding: 5px 12px; cursor: pointer; }
.quick-copy:active { background: #f7f7f8; }
.quick-output { font-size: 16px; line-height: 1.85; color: #111827; white-space: pre-wrap;
  word-break: break-word; min-height: 90px; }
.quick-note { font-size: 12px; color: #9ca3af; text-align: center; line-height: 1.7; margin: 14px 4px 0; }


/* 作品页：非会员引导条 */
.member-tip { display: flex; align-items: center; gap: 12px; margin: 0 16px 12px;
  padding: 14px; border-radius: 16px; background: linear-gradient(135deg,#fff7f2,#fff1ea);
  border: 1px solid #fbe3d8; }
.member-tip .mt-main { flex: 1; min-width: 0; }
.member-tip b { display: block; font-size: 14.5px; color: #b45309; margin-bottom: 3px; }
.member-tip span { display: block; font-size: 12px; color: #9a6b4a; line-height: 1.6; }
.member-tip .mt-btn { flex: none; height: 38px; padding: 0 14px; border: 0; border-radius: 999px;
  background: linear-gradient(135deg,#ffb24a,#ff5f3d); color: #fff; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.member-tip .mt-btn:active { transform: scale(.96); }


/* 离线翻译模式切换 */
.quick-mode { border: 1px solid #e7e4dd; border-radius: 999px; background: #fff;
  color: #6b7280; font-size: 11.5px; padding: 5px 11px; cursor: pointer; }
.quick-mode:active { background: #f7f7f8; }
.quick-badge.offline { background: #eef2ff; color: #4f46e5; }

/* ===== 章节正文/译文放大编辑（2026-10-11） ===== */
.field-title { display: flex !important; align-items: center; justify-content: space-between; gap: 10px; }
.field-expand { min-height: 32px; border: 0; border-radius: 999px; padding: 6px 10px; color: #c2603a; background: rgba(235,91,56,.09); font-size: 11px; font-weight: 700; cursor: pointer; }
.field-expand:hover { color: #fff; background: var(--accent); }
.focus-editor-modal { position: fixed; inset: 0; z-index: 10000; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; border: 0; padding: 16px; background: transparent; overflow: visible; }
.focus-editor-modal[open] { display: grid; place-items: center; }
.focus-editor-modal::backdrop { background: rgba(8,13,24,.58); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.focus-editor-card { width: min(100%, 980px); height: min(94vh, 900px); display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(255,255,255,.28); border-radius: 20px; background: #fffdf8; box-shadow: 0 28px 90px rgba(0,0,0,.3); }
.focus-editor-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; border-bottom: 1px solid var(--line); }
.focus-editor-head h2 { margin: 5px 0 0; font: 700 23px/1.2 "STKaiti", "KaiTi", serif; }
.focus-editor-close { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; color: #687184; background: #f0efeb; font-size: 22px; line-height: 1; cursor: pointer; }
.focus-editor-close:hover { color: #fff; background: var(--accent); }
#focusEditorText { flex: 1; width: 100%; min-height: 0; padding: 22px; border: 0; outline: 0; resize: none; color: var(--text); background: linear-gradient(180deg, #fffefb, #fdfaf4); font: 16px/2 "Songti SC", "SimSun", serif; }
.focus-editor-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.focus-editor-actions { display: flex; gap: 9px; }
@media (max-width: 600px) {
  .focus-editor-modal { padding: 0; }
  .focus-editor-card { width: 100%; height: 100dvh; border-radius: 0; border: 0; }
  .focus-editor-head { padding: 15px 16px 10px; }
  #focusEditorText { padding: 16px 17px; font-size: 16px; }
  .focus-editor-foot { padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); }
  .focus-editor-actions .button { padding: 11px 14px; }
}
@media (max-width: 600px) { .field-expand { min-height: 40px; padding: 8px 12px; font-size: 12px; } }
body.focus-editor-open { overflow: hidden; }
/* ===== 历史版本弹窗：手机端可退出与滚动（2026-10-11） ===== */
.history-footer { display: flex; justify-content: flex-end; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.history-footer .button { min-width: 120px; }
@media (max-width: 820px) {
  .history-modal { width: 100%; height: 100%; max-width: none; margin: 0; border-radius: 0; }
  .history-card { display: flex; flex-direction: column; height: 100dvh; max-height: 100dvh; overflow: hidden; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); border-radius: 0; }
  .history-card > p { margin-bottom: 12px; }
  .history-layout { flex: 1; min-height: 0; overflow: hidden; grid-template-columns: 1fr; grid-template-rows: minmax(120px, 42%) minmax(0, 1fr); }
  .history-list, .history-preview { min-height: 0; max-height: none; overflow: auto; }
  .history-footer { flex: none; }
}
/* ===== 作品详情页：阅读模式，只保留左上角返回键 ===== */
body.reader-mode .brand,
body.reader-mode .desktop-nav,
body.reader-mode .top-actions { display: none !important; }
body.reader-mode .topbar-inner { justify-content: flex-start !important; gap: 0 !important; }
body.reader-mode .nav-back.show { display: inline-flex !important; }
/* ===== 全局极简顶栏：不显示品牌和会员信息 ===== */
body .brand,
body .desktop-nav,
body .top-actions { display: none !important; }
body:not(.has-nav-back) .topbar { display: none !important; }
body:not(.has-nav-back) main.app-main,
body:not(.has-nav-back) main.shell.app-main { top: 0 !important; }
body.has-nav-back .topbar-inner { justify-content: flex-start !important; gap: 0 !important; }
body.has-nav-back .nav-back.show { display: inline-flex !important; }
/* ===== 我的：资料编辑与手机号换绑（2026-10-11） ===== */
.mine-card { cursor: pointer; }
.mine-card:active { transform: scale(.995); }
.mine-edit-tip { position: absolute; right: 16px; top: 16px; color: #c2603a; font-size: 11px; font-weight: 700; }
.mine-identity { margin-top: 5px !important; color: #9ca3af !important; font-size: 11px !important; }
.profile-card .field, .phone-card .field { margin-top: 13px; }
.phone-current { margin: -5px 0 10px !important; color: #c2603a !important; font-size: 12px !important; }
@media (max-width: 820px) { .mine-edit-tip { right: 14px; top: 14px; } }
/* 我的页面整体下移，避免内容贴顶 */
#view-mine { padding-top: 48px !important; }
#view-mine .mine-card { margin-top: 18px !important; }
@media (max-width: 820px) {
  #view-mine { padding-top: 42px !important; }
  #view-mine .mine-card { margin-top: 16px !important; }
}
/* 全屏编辑底部操作区重新排版（2026-10-11） */
.focus-editor-foot { flex-direction: column; align-items: stretch; gap: 10px; }
.focus-editor-foot > span { text-align: center; line-height: 1.5; }
.focus-editor-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: min(100%, 460px); margin: 0 auto; }
.focus-editor-actions .button { width: 100%; min-height: 44px; }
@media (max-width: 600px) {
  .focus-editor-foot { padding-top: 11px; }
  .focus-editor-actions { width: 100%; }
  .focus-editor-actions .button { min-height: 48px; font-size: 15px; }
}
/* 章节行右上角更多按钮（2026-10-11） */
.chapter-row { position: relative; }
.chapter-more { position: absolute; top: 10px; right: 10px; z-index: 3; display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 10px; color: #6b7280; background: #f6f3ed; font-size: 22px; line-height: 1; cursor: pointer; }
.chapter-more:active { background: #eee7dc; transform: scale(.96); }
.chapter-row-main { padding-right: 34px; }
@media (max-width: 820px) {
  .chapter-more { top: 8px; right: 8px; width: 40px; height: 40px; font-size: 24px; }
  .chapter-row-main { padding-right: 38px; }
  .chapter-row-state { padding-right: 26px; }
}
/* 章节状态与更多按钮同一行排列（2026-10-11） */
.chapter-row { grid-template-columns: 48px minmax(0, 1fr) auto; }
.chapter-row-right { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.chapter-row-state { display: flex; align-items: center; justify-items: initial; padding-right: 0; }
.chapter-more { position: static; flex: none; width: 34px; height: 34px; }
.chapter-row-main { padding-right: 8px; }
@media (max-width: 820px) {
  .chapter-row { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .chapter-row-right { gap: 7px; }
  .chapter-more { width: 40px; height: 40px; }
  .chapter-row-main { padding-right: 0; }
  .chapter-row-state { padding-right: 0; }
}
/* 新建/编辑章节：手机端全屏编辑，保存并自动翻译（2026-10-14） */
@media (max-width: 820px) {
  .chapter-editor-modal { width: 100%; height: 100%; max-width: none; margin: 0; border-radius: 0; }
  .chapter-editor-card { height: 100dvh; max-height: 100dvh; overflow: auto; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); border-radius: 0; }
  .chapter-editor-card .drawer-text-grid textarea { min-height: 220px; }
}
/* 语言切换模式选择 */
.language-mode-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 4px; }
.language-mode-row label { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; border: 1px solid var(--line); border-radius: 13px; background: #faf9f6; color: #566071; font-size: 12px; font-weight: 700; }
.language-mode-row input { accent-color: var(--accent); }

/* 修复推荐套餐卡被通用卡片样式覆盖，导致白字白底 */
.plan-card.featured { color: #fff !important; border-color: transparent !important; background: linear-gradient(155deg, #202b43, #111726 66%, #211b22) !important; box-shadow: var(--shadow-dark) !important; }
.plan-card.featured .plan-name { color: var(--accent-2) !important; }
.plan-card.featured .plan-period { color: rgba(255,255,255,.48) !important; }
.plan-card.featured .plan-description { color: rgba(255,255,255,.62) !important; }
.plan-card.featured .plan-benefits span { color: rgba(255,255,255,.78) !important; }

/* 桌面网页端保留登录/退出入口；手机 App 仍保持极简 */
@media (min-width: 821px) {
  body:not(.has-nav-back) .topbar { display: block !important; }
  body .topbar .top-actions { display: flex !important; margin-left: auto; }
  body .topbar .top-actions .quota-chip { display: none !important; }
  body .topbar .account-button { display: flex !important; }
  .logout-button {
    min-height: 38px; padding: 0 15px; border: 1px solid rgba(220,38,38,.18);
    border-radius: 999px; color: #c2402d; background: #fff7f5; font-size: 12px; font-weight: 700; cursor: pointer;
  }
  .logout-button:active { transform: scale(.97); background: #fef2f2; }
}
/* 临时翻译页只显示新版界面，全局隐藏旧翻译台 */
#translateWorkspace, #translateGate { display: none !important; }
/* 首页极简入口 */
.home-clean{min-height:calc(100vh - 90px);display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:30px 20px}
.home-clean-seal{display:grid;place-items:center;width:78px;height:78px;margin-bottom:18px;border-radius:24px;background:linear-gradient(145deg,#ffb24a,#ff5f3d);color:#fff;font:700 39px/1 Georgia,serif;box-shadow:0 14px 34px rgba(255,95,61,.26)}
.home-clean h1{margin:0;font:700 36px/1.2 "STKaiti","KaiTi",serif}.home-clean p{margin:10px 0 28px;color:#8b93a1;font-size:14px}
.home-clean-main,.home-clean-link{display:flex;align-items:center;justify-content:center;width:min(100%,420px);height:54px;border-radius:16px;font-size:16px;font-weight:800;text-decoration:none;margin-bottom:12px}
.home-clean-main{border:0;background:linear-gradient(135deg,#ffb24a,#ff5f3d);color:#fff;box-shadow:0 9px 22px rgba(255,95,61,.24)}
.home-clean-link{border:1px solid #e7e4dd;background:#fff;color:#596274}
/* 会员中心 · 字数权益 */
.word-benefits{margin-bottom:15px;padding:18px 21px}.wb-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}.wb-head h3{margin:0;font-size:16px}.wb-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.wb-grid>div{display:flex;flex-direction:column;align-items:center;gap:5px;padding:12px 8px;border-radius:14px;background:#faf8f4;text-align:center}.wb-grid b{color:#c2603a;font-size:22px}.wb-grid span{color:#8b93a1;font-size:11px;line-height:1.45}@media(max-width:600px){.wb-grid{grid-template-columns:1fr;}.wb-grid>div{flex-direction:row;justify-content:space-between;padding:10px 12px}.wb-grid b{font-size:18px}}
/* ================================================================
 * 网页版登录页 2.0（2026-10-14）
 * ================================================================ */
body.auth-mode,
body:has(#view-auth.active) {
  background:
    radial-gradient(circle at 8% 12%, rgba(255, 95, 61, .15), transparent 31rem),
    radial-gradient(circle at 92% 86%, rgba(39, 195, 178, .13), transparent 33rem),
    linear-gradient(145deg, #fbf7f0 0%, #f4f0e8 48%, #fffaf4 100%);
}
body.auth-mode .app-main,
body:has(#view-auth.active) .app-main { min-height: 100vh; padding-bottom: 0; }
#view-auth.active { display: block !important; }
.auth-page-grid {
  width: 100%; max-width: 1180px; min-height: 100vh; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, 500px);
  align-items: center; gap: clamp(44px, 7vw, 90px); padding: 48px 0 56px;
}
.auth-page-copy { align-self: center; }
.auth-page-copy .eyebrow { margin-bottom: 0; }
.auth-page-copy h1 {
  max-width: 640px; margin: 20px 0 20px;
  font-size: clamp(48px, 5.1vw, 68px); line-height: 1.08; letter-spacing: -.055em;
}
.auth-page-copy > p { max-width: 590px; color: #697283; font-size: 16px; line-height: 1.9; }
.auth-flow-preview {
  display: grid; grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr); align-items: center; gap: 10px;
  max-width: 610px; margin-top: 30px; padding: 15px; border: 1px solid rgba(255,255,255,.55); border-radius: 21px;
  color: #fff; background: linear-gradient(150deg, #1a2338, #0d1424 76%);
  box-shadow: 0 24px 60px rgba(15, 23, 42, .18);
}
.auth-flow-pane { min-width: 0; min-height: 94px; padding: 14px 15px; border: 1px solid rgba(255,255,255,.09); border-radius: 15px; background: rgba(255,255,255,.055); }
.auth-flow-pane.translated { border-color: rgba(255,178,74,.28); background: linear-gradient(145deg, rgba(255,95,61,.14), rgba(255,178,74,.06)); }
.auth-flow-pane span { display: block; color: rgba(255,255,255,.46); font-size: 9px; font-weight: 800; letter-spacing: .15em; }
.auth-flow-pane p { margin: 11px 0 0; color: rgba(255,255,255,.86); font-size: 12px; line-height: 1.65; }
.auth-flow-pane.translated p { color: #fff3e8; }
.auth-flow-arrow { color: var(--accent-2); text-align: center; font-size: 22px; }
.auth-benefits { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.auth-benefits > div { min-height: 88px; padding: 16px; border-color: rgba(28, 36, 55, .09); border-radius: 17px; background: rgba(255,255,255,.66); box-shadow: 0 10px 28px rgba(27, 35, 54, .04); }
.auth-benefits b { color: #dc5437; font-size: 19px; }
.auth-benefits span { margin-top: 6px; font-size: 10.5px; }
.page-auth-card {
  position: relative; width: 100%; max-width: 500px; padding: 36px 38px 34px;
  border: 1px solid rgba(26, 34, 53, .09); border-radius: 28px;
  background: rgba(255,255,255,.9); box-shadow: 0 30px 85px rgba(28, 35, 53, .14);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); overflow: hidden;
}
.page-auth-card::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 4px;
  background: linear-gradient(90deg, #ff5f3d, #ffb24a 48%, #27c3b2);
}
.auth-card-head { display: flex; align-items: center; gap: 15px; margin-bottom: 24px; }
.auth-card-head .auth-mark {
  width: 54px; height: 54px; margin: 0; flex: none; border-radius: 17px 17px 17px 6px;
  background: linear-gradient(145deg, #ffb24a, #ff5f3d); box-shadow: 0 12px 28px rgba(255,95,61,.25);
  font-size: 27px;
}
.auth-card-head h2 { margin: 0; font-size: 28px; line-height: 1.15; }
.auth-card-head p { margin: 6px 0 0; color: #7a8291; font-size: 12px; line-height: 1.55; }
.auth-method-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin: 0 0 22px; padding: 4px;
  border: 1px solid rgba(28,35,54,.07); border-radius: 14px; background: #f3f1ec;
}
.auth-method-tabs button {
  min-height: 40px; border: 0; border-radius: 10px; color: #7a8291; background: transparent;
  font-size: 13px; font-weight: 800; transition: .2s ease;
}
.auth-method-tabs button.active { color: #fff; background: #142036; box-shadow: 0 8px 18px rgba(20,32,54,.16); }
.page-auth-card .field { margin-bottom: 14px; }
.page-auth-card .field > span { margin-bottom: 7px; color: #5f6878; font-size: 11px; font-weight: 800; letter-spacing: .03em; }
.page-auth-card .field input,
.page-auth-card .auth-code-row input {
  height: 51px; border-color: #e7e3da; border-radius: 14px; background: #faf9f6;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
.page-auth-card input:focus { border-color: rgba(255,95,61,.72) !important; box-shadow: 0 0 0 4px rgba(255,95,61,.08) !important; background: #fff !important; }
.auth-code-row { grid-template-columns: minmax(0, 1fr) 118px; gap: 9px; }
.auth-code-row input { margin: 0; }
.auth-code-btn { height: 51px; border-radius: 14px; background: #fff4ef; }
#authPhoneSubmit, #pageAuthSubmit { min-height: 54px; margin-top: 4px; border-radius: 15px; font-size: 14px; }
.auth-mini { margin-top: 10px; color: #939aa7; font-size: 11px; }
.auth-tabs { margin-bottom: 18px; background: #f3f1ec; border-radius: 13px; }
.auth-tabs button { min-height: 38px; font-size: 12px; }
.auth-divider { margin: 21px 0 13px; }
.auth-apple { min-height: 51px; border-radius: 15px; background: #111827; }
.auth-apple:hover { background: #1f2937; }
.auth-tip { margin-top: 16px; line-height: 1.7; }

.auth-alt-entry {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  min-height: 38px; margin-top: 10px; color: #8b929e; font-size: 13px;
}
.auth-alt-entry button {
  min-height: 36px; padding: 5px 3px; border: 0; background: transparent;
  color: #c2603a; font-size: 13px; font-weight: 800;
}
.auth-alt-entry button:hover { color: #dd5437; }
.auth-alt-entry button:active { transform: scale(.98); }

@media (max-width: 1050px) {
  .auth-page-grid { grid-template-columns: minmax(0, 1fr) minmax(390px, 450px); gap: 42px; }
  .auth-page-copy h1 { font-size: clamp(43px, 5vw, 56px); }
  .auth-flow-pane { padding: 12px; }
}
@media (max-width: 820px) {
  body.auth-mode .app-main,
  body:has(#view-auth.active) .app-main { min-height: 100dvh; }
  .auth-page-grid { display: block; min-height: 0; padding: 24px 0 36px; }
  .auth-page-copy { display: none; }
  .page-auth-card { max-width: 500px; margin: 0 auto; padding: 28px 22px 26px; border-radius: 24px; }
  .auth-card-head { margin-bottom: 21px; }
  .auth-card-head .auth-mark { width: 50px; height: 50px; border-radius: 16px 16px 16px 6px; font-size: 25px; }
  .auth-card-head h2 { font-size: 25px; }
}
@media (max-width: 430px) {
  .auth-page-grid { padding: 18px 0 28px; }
  .page-auth-card { padding: 25px 18px 23px; border-radius: 22px; }
  .auth-card-head { gap: 12px; }
  .auth-card-head .auth-mark { width: 46px; height: 46px; font-size: 23px; }
  .auth-card-head h2 { font-size: 23px; }
  .auth-card-head p { font-size: 11px; }
  .auth-code-row { grid-template-columns: minmax(0, 1fr) 104px; }
  .auth-code-btn { padding: 0 10px; font-size: 13px; }
}

/* 登录页 2.0 · 手机边距 */

@media (max-width: 820px) {
  body.auth-mode main.app-main,
  body:has(#view-auth.active) main.app-main { padding-left: 12px !important; padding-right: 12px !important; }
  .auth-page-grid { padding-top: 24px; }
}

/* APP 会员套餐 · 单章字数 */
body.app-mode .word-benefits { display: none !important; }

/* 自动续费卡片 · 网页版整齐排版 */
.subscription-card { display: grid; gap: 14px; padding: 22px; }
.subscription-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.subscription-head .side-label { display: block; margin-bottom: 8px; }
.subscription-head h3 { margin: 0; font-size: 15px; line-height: 1.2; }
.subscription-badge { flex: none; min-width: 52px; padding: 6px 9px; border-radius: 999px; color: #7b8493; background: #f1eee8; text-align: center; font-size: 10px; font-weight: 800; }
.subscription-badge.on { color: #1b7f51; background: rgba(53,184,119,.11); }
.subscription-next { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; min-height: 46px; padding: 11px 12px; border: 1px solid rgba(28,35,54,.07); border-radius: 13px; background: #f9f7f3; }
.subscription-next span { color: #8d95a3; font-size: 10px; font-weight: 700; }
.subscription-next b { max-width: 150px; color: #303a4d; font-size: 10.5px; line-height: 1.45; text-align: right; overflow-wrap: anywhere; }
.subscription-hint { min-height: 32px; margin: 0 !important; color: #7c8492 !important; font-size: 10px !important; line-height: 1.6 !important; }
.subscription-card > .button { width: 100%; min-height: 40px; margin-top: 0; }
@media (max-width: 820px) {
  .subscription-card { gap: 12px; padding: 18px; }
  .subscription-next { min-height: 44px; }
}


/* 章节编辑器 v2：新建时仅显示原文，底部三按钮固定为主操作 */
#chapterEditorDialog .drawer-title-grid,
#chapterEditorDialog .drawer-text-grid { grid-template-columns: 1fr; }
#chapterEditorDialog .drawer-title-grid.translation-visible,
#chapterEditorDialog .drawer-text-grid.translation-visible { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
#chapterEditorDialog .drawer-translation-field { min-width: 0; }
#chapterEditorDialog .chapter-editor-footer-v2 { flex-direction: column; align-items: stretch; gap: 10px; }
#chapterEditorDialog .chapter-editor-status { justify-content: flex-end; }
#chapterEditorDialog .drawer-primary-actions { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
#chapterEditorDialog .drawer-primary-actions .button { width: 100%; min-height: 46px; padding: 10px 8px; white-space: nowrap; font-size: 14px; }
@media (max-width: 420px) {
  #chapterEditorDialog .drawer-title-grid.translation-visible,
  #chapterEditorDialog .drawer-text-grid.translation-visible { grid-template-columns: 1fr; }
  #chapterEditorDialog .drawer-primary-actions .button { font-size: 13px; padding-inline: 5px; }
}

#chapterEditorDialog .drawer-primary-actions .button.secondary { color:#7c3aed; border:1px solid #d8c7ff; background:#f7f2ff; }
#chapterEditorDialog .drawer-primary-actions .button.secondary:active { background:#ede4ff; }


/* iOS App：作品/翻译/阅读页整体避开状态栏和灵动岛 */
@media (max-width: 820px) {
  .topbar {
    top: 0 !important;
    height: calc(56px + env(safe-area-inset-top, 0px)) !important;
    padding-top: env(safe-area-inset-top, 0px) !important;
  }
  .topbar .shell, .topbar-inner { height: 56px !important; }
  main.app-main, main.shell.app-main {
    top: calc(56px + env(safe-area-inset-top, 0px)) !important;
  }
  #view-library, #view-translate, #view-reader { padding-top: 18px !important; }
  .chapter-editor-card { padding-top: calc(18px + env(safe-area-inset-top, 0px)) !important; }
}


/* iOS App：用户确认后再下移一档 */
@media (max-width: 820px) {
  .topbar { height: calc(80px + env(safe-area-inset-top, 0px)) !important; }
  .topbar .shell, .topbar-inner { height: 80px !important; }
  main.app-main, main.shell.app-main { top: calc(80px + env(safe-area-inset-top, 0px)) !important; }
  #view-library, #view-translate, #view-reader { padding-top: 24px !important; }
}


/* iOS App：第三次下移，顶栏再增加 24px */
@media (max-width: 820px) {
  .topbar { height: calc(104px + env(safe-area-inset-top, 0px)) !important; }
  .topbar .shell, .topbar-inner { height: 104px !important; }
  main.app-main, main.shell.app-main { top: calc(104px + env(safe-area-inset-top, 0px)) !important; }
  #view-library, #view-translate, #view-reader { padding-top: 30px !important; }
}


/* 章节编辑器关闭按钮：固定在右上角，始终可点击 */
#chapterEditorDialog .modal-close {
  position: fixed !important;
  top: calc(14px + env(safe-area-inset-top, 0px)) !important;
  right: 14px !important;
  width: 48px !important;
  height: 48px !important;
  display: grid !important;
  place-items: center !important;
  z-index: 2147483647 !important;
  padding: 0 !important;
  border: 1px solid #e7e4dd !important;
  border-radius: 50% !important;
  background: #ffffff !important;
  color: #555d6d !important;
  box-shadow: 0 6px 20px rgba(15,23,42,.16) !important;
  font-size: 26px !important;
  line-height: 1 !important;
  pointer-events: auto !important;
  touch-action: manipulation !important;
}
#chapterEditorDialog .chapter-editor-card { padding-top: env(safe-area-inset-top, 0px) !important; }


/* 手机端触控提速：消除双击缩放等待，减少重动画和模糊开销 */
html { -webkit-text-size-adjust: 100%; }
button, a, [role="button"], [data-route], [data-go], [data-tab], select, input, textarea, label {
  touch-action: manipulation;
}
button, a, [role="button"], [data-route], [data-go], [data-tab], .book-item, .chapter-row {
  -webkit-tap-highlight-color: transparent;
}
@media (max-width: 820px) {
  .topbar, .mobile-nav { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  .button, .book-item, .chapter-row, .quick-pkg, .pkg, .tab, .account-button, .quota-chip, .nav-back, .modal-close {
    transition-duration: .06s !important;
  }
  .button:active, .book-item:active, .chapter-row:active, .tab:active,
  .account-button:active, .quota-chip:active, .nav-back:active, .modal-close:active {
    transform: scale(.97) !important;
  }
}


/* 所有二级页面统一顶部留白，避免标题贴在状态栏/顶栏下 */
@media (max-width: 820px) {
  #view-mine,
  #view-billing,
  #view-translate,
  #view-library,
  #view-reader,
  #view-drafts {
    padding-top: 54px !important;
  }
  #view-billing .page-heading,
  #view-translate .page-heading,
  #view-library .page-heading,
  #view-drafts .page-heading {
    padding-top: 10px !important;
  }
}


/* 新建章节：只保留原文标题、原文正文和底部三个操作按钮 */
#chapterEditorDialog #drawerBookTitle,
#chapterEditorDialog #drawerDialogTitle,
#chapterEditorDialog #drawerDialogHint {
  display: none !important;
}


/* 新建章节全页编辑：正文区独立滚动，底部三按钮固定 */
@media (max-width: 820px) {
  #chapterEditorDialog.chapter-editor-modal {
    width: 100% !important; height: 100dvh !important; max-width: none !important;
    margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important;
  }
  #chapterEditorDialog .chapter-editor-card {
    width: 100% !important; height: 100dvh !important; max-height: 100dvh !important;
    display: flex !important; flex-direction: column !important; overflow: hidden !important;
    padding: env(safe-area-inset-top, 0px) 16px 0 !important;
    border-radius: 0 !important;
  }
  #chapterEditorDialog .chapter-editor-body {
    flex: 1 1 auto !important; min-height: 0 !important; overflow-y: auto !important; overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 0 2px 16px !important;
  }
  #chapterEditorDialog .chapter-editor-body::-webkit-scrollbar { display: none; }
  #chapterEditorDialog .chapter-editor-body { scrollbar-width: none; }
  #chapterEditorDialog .chapter-editor-body .field-expand { display: none !important; }
  #chapterEditorDialog .drawer-title-grid textarea,
  #chapterEditorDialog .drawer-text-grid textarea {
    min-height: clamp(300px, 48dvh, 560px) !important;
    max-height: none !important;
  }
  #chapterEditorDialog .chapter-editor-footer-v2 {
    flex: 0 0 auto !important;
    margin: 0 -16px !important;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    border-top: 1px solid #e8e5de !important;
    background: #fffdf8 !important;
    box-shadow: 0 -8px 24px rgba(15,23,42,.08) !important;
    position: relative !important;
    z-index: 50 !important;
  }
  #chapterEditorDialog .drawer-primary-actions {
    display: grid !important; grid-template-columns: repeat(2, minmax(0,1fr)) !important; gap: 8px !important;
  }
  #chapterEditorDialog .drawer-primary-actions .button { min-height: 48px !important; }
}


/* 番茄小说式章节编辑：单一全页输入区，无标题/正文字段框 */
@media (max-width: 820px) {
  #chapterEditorDialog .chapter-editor-body { display: flex !important; flex-direction: column !important; }
  #chapterEditorDialog .chapter-document-input {
    display: block !important;
    width: 100% !important;
    flex: 1 1 auto !important;
    min-height: calc(100dvh - 250px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) !important;
    margin: 0 !important;
    padding: 4px 2px 24px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    resize: none !important;
    outline: none !important;
    color: #1f2937 !important;
    font: 18px/1.9 "Songti SC", "SimSun", serif !important;
    touch-action: pan-y !important;
  }
  #chapterEditorDialog .chapter-document-input::placeholder { color: #a8afbb; }
  #chapterEditorDialog .drawer-title-grid,
  #chapterEditorDialog .drawer-text-grid { display: none !important; }
}


/* 番茄式：可编辑标题 + 实线分隔 + 整页正文 */
@media (max-width: 820px) {
  #chapterEditorDialog .chapter-document-input { display: none !important; }
  #chapterEditorDialog .chapter-title-inline {
    display: block !important; width: 100% !important; height: auto !important;
    margin: 4px 0 0 !important; padding: 2px 2px 13px !important;
    border: 0 !important; border-bottom: 1.5px solid #cfc8bc !important;
    border-radius: 0 !important; outline: none !important; background: transparent !important;
    box-shadow: none !important; color: #1f2937 !important;
    font: 700 24px/1.45 "STKaiti", "KaiTi", serif !important;
    touch-action: manipulation !important;
  }
  #chapterEditorDialog .chapter-title-inline::placeholder { color: #a8afbb; font-weight: 600; }
  #chapterEditorDialog .chapter-body-inline {
    display: block !important; width: 100% !important;
    flex: 1 1 auto !important; min-height: calc(100dvh - 280px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) !important;
    margin: 14px 0 0 !important; padding: 0 2px 24px !important;
    border: 0 !important; border-radius: 0 !important; outline: none !important;
    background: transparent !important; box-shadow: none !important; resize: none !important;
    color: #1f2937 !important; font: 18px/1.9 "Songti SC", "SimSun", serif !important;
    touch-action: pan-y !important;
  }
  #chapterEditorDialog .chapter-body-inline::placeholder { color: #a8afbb; }
}


/* 作品页：4 个操作按钮在手机上排成两行，避免挤压 */
@media (max-width: 520px) {
  .reader-actions-bar { display: grid !important; grid-template-columns: repeat(2, minmax(0,1fr)) !important; gap: 8px !important; }
  .reader-actions-bar .button { width: 100% !important; min-height: 44px !important; padding: 9px 8px !important; font-size: 13px !important; }
}


/* 章节原文/译文双入口与译文窗口 */
.chapter-entry-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 9px; }
.chapter-entry-button { min-height: 38px; border-radius: 11px; border: 1px solid #e2ded5; background: #fff; color: #4b5563; font-size: 12.5px; font-weight: 700; touch-action: manipulation; }
.chapter-entry-button.original { color: #9a4f2f; background: #fff7f1; border-color: #f1d8c9; }
.chapter-entry-button.translation { color: #1f8453; background: #f1faf5; border-color: #cfe9da; }
.chapter-entry-button:active { transform: scale(.97); }
.chapter-translation-card { width: min(calc(100% - 28px), 760px); position: relative; }
.chapter-translation-content { min-height: 220px; max-height: 58vh; overflow-y: auto; white-space: pre-wrap; word-break: break-word; font: 16px/1.9 "Songti SC", "SimSun", serif; color: #1f2937; background: #fffdf8; border: 1px solid #eee8de; border-radius: 14px; padding: 16px; }
.chapter-translation-content.empty { display: grid; place-items: center; color: #8b93a1; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif; font-size: 13px; text-align: center; }
.chapter-translation-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 14px; }
.chapter-translation-actions .button:disabled { opacity: .45; }
@media (max-width: 820px) {
  .chapter-translation-modal { width: 100%; height: 100%; max-width: none; margin: 0; border-radius: 0; }
  .chapter-translation-card { width: 100%; height: 100dvh; max-height: 100dvh; overflow-y: auto; border-radius: 0; padding: env(safe-area-inset-top, 0px) 16px calc(18px + env(safe-area-inset-bottom, 0px)); }
  .chapter-translation-modal .modal-close { position: fixed !important; top: calc(14px + env(safe-area-inset-top, 0px)) !important; right: 14px !important; width: 48px !important; height: 48px !important; display: grid !important; place-items: center !important; z-index: 1000 !important; }
  .chapter-translation-content { max-height: none; min-height: calc(100dvh - 290px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); }
  .chapter-translation-actions { position: sticky; bottom: 0; background: #fff; padding-top: 10px; }
  .chapter-entry-button { min-height: 42px; }
}


/* 作品页：作品名与四个操作按钮整体吸顶 */
@media (max-width: 820px) {
  #view-reader .reader-sticky-head {
    position: sticky !important;
    top: 0 !important;
    z-index: 55 !important;
    background: #f2f2f7 !important;
    padding: 10px 0 6px !important;
    margin: 0 !important;
  }
  #view-reader .reader-sticky-head .reader-hero {
    margin: 0 12px 8px !important;
  }
  #view-reader .reader-sticky-head .reader-actions-bar {
    display: flex !important;
    grid-template-columns: none !important;
    gap: 8px !important;
    overflow-x: auto !important;
    margin: 0 !important;
    padding: 0 12px 2px !important;
    background: #f2f2f7 !important;
    scrollbar-width: none;
  }
  #view-reader .reader-sticky-head .reader-actions-bar::-webkit-scrollbar { display: none; }
  #view-reader .reader-sticky-head .reader-actions-bar .button {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 88px !important;
    min-height: 42px !important;
  }
}


/* 正序/倒序双段开关 */
.chapter-sort-toggle { display: inline-flex !important; align-items: center !important; padding: 3px !important; gap: 2px !important; }
.chapter-sort-toggle span { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; padding: 7px 8px; border-radius: 9px; color: #8b93a1; font-size: 12px; font-weight: 700; transition: background .06s, color .06s; }
.chapter-sort-toggle span.active { color: #b95530; background: #fff1e8; box-shadow: inset 0 0 0 1px #f3d2c1; }
@media (max-width: 820px) {
  #view-reader .reader-sticky-head .reader-actions-bar .chapter-sort-toggle { min-width: 108px !important; }
}


/* 我的翻译书库：标题和新建按钮吸顶 */
@media (max-width: 820px) {
  #view-library .library-heading {
    position: sticky !important;
    top: 0 !important;
    z-index: 55 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    margin: 0 !important;
    padding: 12px 16px 13px !important;
    background: #f2f2f7 !important;
    border-bottom: 1px solid #e7e4dd !important;
  }
  #view-library .library-heading h1 { margin: 0 !important; font-size: 21px !important; line-height: 1.25 !important; }
  #view-library .library-heading .heading-actions { flex: 0 0 auto !important; margin: 0 !important; display: block !important; }
  #view-library .library-heading .heading-actions .button { min-height: 42px !important; padding: 9px 14px !important; white-space: nowrap !important; }
}


/* 作品页顶部文字排版修复：长标题与进度圈不再互相挤压 */
@media (max-width: 820px) {
  #view-reader .reader-sticky-head .reader-hero {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 54px !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 12px 14px !important;
  }
  #view-reader .reader-sticky-head .reader-hero > div:first-child {
    min-width: 0 !important;
    overflow: hidden !important;
  }
  #view-reader #readerMeta {
    display: block !important;
    max-width: 100% !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
  }
  #view-reader #readerTitle {
    margin: 6px 0 4px !important;
    max-width: 100% !important;
    font-size: 21px !important;
    line-height: 1.3 !important;
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow-wrap: anywhere !important;
  }
  #view-reader #readerSubtitle {
    max-width: 100% !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    font-size: 11px !important;
  }
  #view-reader .reader-progress-ring {
    width: 54px !important;
    height: 54px !important;
    justify-self: end !important;
  }
  #view-reader .reader-progress-ring b { font-size: 14px !important; }
  #view-reader .reader-progress-ring span { font-size: 8px !important; }
}


/* 我的翻译书库：标题在上，新建作品按钮在下并限制在屏幕内 */
@media (max-width: 820px) {
  #view-library .library-heading {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 9px !important;
    overflow: hidden !important;
  }
  #view-library .library-heading > div:first-child { width: 100% !important; min-width: 0 !important; }
  #view-library .library-heading h1 {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  #view-library .library-heading .heading-actions {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    display: block !important;
  }
  #view-library .library-heading .heading-actions .button {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }
}


/* 作品页：作品名和整排按钮从顶部开始并固定 */
@media (max-width: 820px) {
  #view-reader {
    padding-top: 0 !important;
  }
  #view-reader .reader-sticky-head {
    position: sticky !important;
    top: 0 !important;
    z-index: 55 !important;
    padding: 8px 0 6px !important;
    background: #f2f2f7 !important;
  }
}


/* 作品页操作栏：四个按钮全部收进一屏，正序/倒序用下划线表示当前项 */
@media (max-width: 820px) {
  #view-reader .reader-sticky-head .reader-actions-bar {
    width: 100% !important;
    max-width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 6px !important;
    padding: 0 10px 3px !important;
    overflow: hidden !important;
  }
  #view-reader .reader-sticky-head .reader-actions-bar .button {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
    min-height: 40px !important;
    padding: 7px 3px !important;
    font-size: 12px !important;
    white-space: nowrap !important;
  }
  #view-reader .reader-sticky-head .reader-actions-bar .chapter-sort-toggle {
    min-width: 0 !important;
    padding: 0 2px !important;
    gap: 3px !important;
    justify-content: center !important;
  }
  #view-reader .reader-sticky-head .reader-actions-bar .chapter-sort-toggle span {
    min-width: 0 !important;
    padding: 8px 2px !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 11.5px !important;
    text-decoration: none !important;
  }
  #view-reader .reader-sticky-head .reader-actions-bar .chapter-sort-toggle span.active {
    color: #b95530 !important;
    background: transparent !important;
    box-shadow: none !important;
    text-decoration: underline !important;
    text-underline-offset: 4px !important;
  }
  #view-reader .reader-sticky-head .reader-actions-bar .chapter-sort-toggle span + span {
    position: relative !important;
  }
  #view-reader .reader-sticky-head .reader-actions-bar .chapter-sort-toggle span + span::before {
    content: "" !important;
    position: absolute !important;
    left: -3px !important;
    top: 50% !important;
    width: 1px !important;
    height: 13px !important;
    transform: translateY(-50%) !important;
    background: #d7d2c9 !important;
  }
}


/* 作品页单独上移返回键和内容 */
@media (max-width: 820px) {
  body.reader-mode .topbar {
    height: calc(64px + env(safe-area-inset-top, 0px)) !important;
  }
  body.reader-mode .topbar .shell,
  body.reader-mode .topbar-inner {
    height: 64px !important;
    padding-top: 0 !important;
  }
  body.reader-mode main.app-main,
  body.reader-mode main.shell.app-main {
    top: calc(64px + env(safe-area-inset-top, 0px)) !important;
  }
}


/* 作品页滚动折叠头：大标题和按钮随内容滑出，顶部切换为返回键+作品名 */
@media (max-width: 820px) {
  body.reader-mode .topbar { height: calc(56px + env(safe-area-inset-top, 0px)) !important; }
  body.reader-mode .topbar .shell, body.reader-mode .topbar-inner { height: 56px !important; }
  body.reader-mode main.app-main, body.reader-mode main.shell.app-main { top: calc(56px + env(safe-area-inset-top, 0px)) !important; }
  #view-reader .reader-sticky-head { position: relative !important; top: auto !important; }
  .reader-top-title { display: none; }
  body.reader-mode.reader-head-collapsed .reader-top-title {
    display: block !important;
    position: absolute !important;
    left: 58px !important;
    right: 58px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    text-align: center !important;
    color: #1f2937 !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    pointer-events: none !important;
  }
  body.reader-mode .topbar-inner { position: relative !important; }
}


/* 独立订单记录页 */
@media (max-width: 820px) {
  #view-orders { padding-top: 54px !important; }
  #view-orders .orders-heading { display: block !important; margin: 0 !important; padding: 10px 16px 12px !important; }
  #view-orders .orders-heading h1 { margin: 0 0 4px !important; font-size: 22px !important; }
  #view-orders .orders-heading p { margin: 0 !important; }
  #view-orders .orders-page-card { margin: 0 12px 18px !important; padding: 15px !important; background: #fff !important; border-radius: 16px !important; }
  #view-orders .order-row { padding: 12px 2px !important; }
}


/* 我的翻译书库：标题和新建作品使用真正固定栏 */
@media (max-width: 820px) {
  #view-library {
    padding-top: 118px !important;
  }
  #view-library .library-heading {
    position: fixed !important;
    top: calc(104px + env(safe-area-inset-top, 0px)) !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 54 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 9px !important;
    margin: 0 !important;
    padding: 12px 16px 13px !important;
    background: #f2f2f7 !important;
    border-bottom: 1px solid #e7e4dd !important;
    box-shadow: 0 5px 14px rgba(15,23,42,.04) !important;
  }
}

/* 2026-11-07 真机修复：禁用书库页面入场 transform，避免 fixed 固定栏被祖先容器带走 */
@media (max-width: 820px) {
  #view-library {
    animation: none !important;
  }
}

/* 2026-11-07 真机修复：订单记录返回键与作品页处于同一垂直位置 */
@media (max-width: 820px) {
  body.orders-mode .topbar {
    height: calc(56px + env(safe-area-inset-top, 0px)) !important;
  }
  body.orders-mode .topbar .shell,
  body.orders-mode .topbar-inner {
    height: 56px !important;
    padding-top: 0 !important;
  }
  body.orders-mode main.app-main,
  body.orders-mode main.shell.app-main {
    top: calc(56px + env(safe-area-inset-top, 0px)) !important;
  }
}

/* 2026-11-07 真机二次修复：书库固定栏贴顶，作品列表从栏下开始，不再与标题栏重叠 */
@media (max-width: 820px) {
  #view-library {
    padding-top: calc(112px + env(safe-area-inset-top, 0px)) !important;
  }
  #view-library .library-heading {
    top: 0 !important;
    padding-top: calc(12px + env(safe-area-inset-top, 0px)) !important;
    padding-bottom: 13px !important;
    background: #f2f2f7 !important;
    z-index: 70 !important;
  }
  #view-library #bookGrid {
    position: relative !important;
    z-index: 1 !important;
    margin-top: 0 !important;
  }
}

/* 2026-11-07 作品页：右下角写作悬浮按钮，新建章节从这里进入 */
.reader-write-fab {
  display: none;
}
@media (max-width: 820px) {
  body.reader-mode .reader-write-fab {
    position: fixed;
    right: max(18px, calc(16.6667% - 19px));
    bottom: calc(103px + env(safe-area-inset-bottom, 0px));
    z-index: 109;
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    padding: 0;
    border: 1px solid rgba(255,255,255,.6);
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(145deg, #d56b42, #a94527);
    box-shadow: 0 12px 30px rgba(130, 53, 31, .34), 0 3px 10px rgba(15,23,42,.2);
    -webkit-tap-highlight-color: transparent;
    transition: transform .08s ease, box-shadow .08s ease;
  }
  body.reader-mode .reader-write-fab svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
  }
  body.reader-mode .reader-write-fab:active {
    transform: scale(.94);
    box-shadow: 0 6px 18px rgba(130, 53, 31, .3);
  }
}

/* 2026-11-07 草稿箱：添加与作品页一致的左上角返回键 */
@media (max-width: 820px) {
  body.drafts-mode .topbar {
    height: calc(56px + env(safe-area-inset-top, 0px)) !important;
  }
  body.drafts-mode .topbar .shell,
  body.drafts-mode .topbar-inner {
    height: 56px !important;
    padding-top: 0 !important;
  }
  body.drafts-mode main.app-main,
  body.drafts-mode main.shell.app-main {
    top: calc(56px + env(safe-area-inset-top, 0px)) !important;
  }
  body.drafts-mode #view-drafts {
    padding-top: 12px !important;
  }
  body.drafts-mode #view-drafts .page-heading {
    padding-top: 10px !important;
  }
}

/* 2026-11-07 草稿箱只保留左上角返回键，不再显示内容区“返回作品库” */
#view-drafts .page-heading > .button[data-route="library"] {
  display: none !important;
}

/* 2026-11-07 章节译文：底部“查看原文 / 复制译文”改为等宽双栏，与原文编辑页按钮排列一致 */
.chapter-translation-actions {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  width: 100% !important;
  justify-content: stretch !important;
  gap: 9px !important;
}
.chapter-translation-actions .button {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 46px !important;
  padding: 10px 8px !important;
  white-space: nowrap !important;
}

/* 2026-11-07 章节译文：点击“编辑译文”后才允许在当前页面直接修改 */
#chapterTranslationContent[contenteditable="true"],
#chapterTranslationContent.editing {
  background: #fff !important;
  border-color: #c89372 !important;
  box-shadow: 0 0 0 3px rgba(185, 85, 48, .12) !important;
  outline: none !important;
  cursor: text !important;
  -webkit-user-select: text !important;
  user-select: text !important;
}

/* 2026-11-08 实用分卷管理 */
.volume-manager-modal {
  width: min(calc(100% - 30px), 760px);
}
.volume-manager-card {
  width: min(calc(100vw - 30px), 760px);
  max-height: min(86dvh, 820px);
  overflow-y: auto;
}
.volume-manager-card > p {
  margin-bottom: 16px !important;
}
.volume-create-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  margin-bottom: 20px;
}
.volume-create-row input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid #ded9cf;
  border-radius: 12px;
  padding: 0 13px;
  background: #fff;
  color: #1f2937;
  font-size: 14px;
}
.volume-create-row .button {
  min-height: 44px;
  white-space: nowrap;
}
.volume-section-title {
  margin: 18px 0 9px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
}
.volume-list,
.volume-chapter-list {
  display: grid;
  gap: 8px;
}
.volume-item,
.volume-chapter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #e9e4da;
  border-radius: 14px;
  padding: 11px 12px;
  background: #fffdf8;
}
.volume-item-main,
.volume-chapter-row > span {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.volume-item-main b,
.volume-chapter-row b {
  overflow: hidden;
  color: #1f2937;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.volume-item-main span,
.volume-chapter-row small {
  color: #8b93a1;
  font-size: 11px;
}
.volume-item-actions {
  display: flex;
  flex: none;
  gap: 6px;
}
.volume-chapter-row select {
  width: min(45%, 210px);
  min-width: 126px;
  min-height: 38px;
  border: 1px solid #ded9cf;
  border-radius: 10px;
  padding: 0 9px;
  color: #374151;
  background: #fff;
  font-size: 12px;
}
.volume-empty {
  border: 1px dashed #ded9cf;
  border-radius: 14px;
  padding: 18px 14px;
  color: #8b93a1;
  background: #faf8f3;
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
}
@media (max-width: 820px) {
  .volume-manager-modal {
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    border-radius: 0;
  }
  .volume-manager-card {
    width: 100%;
    min-height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    padding: calc(70px + env(safe-area-inset-top, 0px)) 16px calc(18px + env(safe-area-inset-bottom, 0px));
  }
  .volume-manager-modal .modal-close {
    position: fixed !important;
    top: calc(14px + env(safe-area-inset-top, 0px)) !important;
    right: 14px !important;
    width: 48px !important;
    height: 48px !important;
    display: grid !important;
    place-items: center !important;
    z-index: 1000 !important;
  }
  .volume-create-row {
    grid-template-columns: minmax(0, 1fr) 104px;
  }
  .volume-chapter-row {
    align-items: stretch;
    flex-direction: column;
  }
  .volume-chapter-row select {
    width: 100%;
    max-width: none;
  }
}

/* 2026-11-08 作品页按分卷分组，支持点击分卷展开/收起 */
.volume-group {
  display: grid;
  gap: 10px;
}
.volume-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid #e5dfd4;
  border-radius: 14px;
  color: #1f2937;
  background: #fffdf8;
  box-shadow: 0 5px 16px rgba(28, 35, 53, .04);
  text-align: left;
}
.volume-group-head:active {
  background: #f8f4ec;
}
.volume-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.volume-group-title i {
  width: 16px;
  color: #b95530;
  font-style: normal;
  font-size: 16px;
  text-align: center;
}
.volume-group-title b {
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.volume-group-head small {
  flex: none;
  color: #8b93a1;
  font-size: 11px;
}
.volume-group-body {
  display: grid;
  gap: 10px;
  padding-left: 8px;
}
.volume-group-body[hidden] {
  display: none !important;
}
.volume-group.collapsed .volume-group-head {
  border-color: #ebe5db;
  background: #faf7f1;
}
@media (max-width: 820px) {
  .volume-group {
    gap: 8px;
  }
  .volume-group-head {
    min-height: 46px;
    padding: 9px 12px;
  }
  .volume-group-body {
    gap: 8px;
    padding-left: 0;
  }
}

/* 2026-11-08 分卷内直接显示章节，可在卷内移动到其他分卷 */
.volume-item {
  display: block;
  padding: 0;
  overflow: hidden;
}
.volume-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  background: #faf7f1;
  border-bottom: 1px solid #eee8de;
}
.volume-item-chapters {
  display: grid;
  gap: 8px;
  padding: 10px 12px 12px;
}
.volume-chapters-label {
  color: #9a6a50;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
}
.volume-item .volume-chapter-row {
  padding: 9px 10px;
  background: #fff;
}
.volume-empty.compact {
  padding: 12px;
  border-style: solid;
  background: #fff;
}
@media (max-width: 820px) {
  .volume-item .volume-chapter-row select {
    min-height: 40px;
  }
}

/* 2026-11-08 分卷管理：每卷可折叠，进入时默认全部收起 */
.volume-manager-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 38px;
  padding: 0;
  border: 0;
  color: #1f2937;
  background: transparent;
  text-align: left;
}
.volume-manager-toggle:active {
  opacity: .7;
}
.volume-manager-toggle-title {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.volume-manager-toggle-title i {
  flex: none;
  width: 16px;
  color: #b95530;
  font-style: normal;
  font-size: 16px;
  text-align: center;
}
.volume-manager-toggle-title b {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.volume-manager-toggle small {
  flex: none;
  color: #8b93a1;
  font-size: 11px;
}
.volume-item.collapsed .volume-item-chapters {
  display: none !important;
}
.volume-item-head .volume-item-actions {
  margin-left: 2px;
}
@media (max-width: 820px) {
  .volume-item-head {
    gap: 6px;
    padding: 9px 10px;
  }
  .volume-item-head .volume-item-actions {
    gap: 4px;
  }
  .volume-item-head .mini-button {
    padding-inline: 8px;
  }
}

/* 2026-11-08 原文/译文页上移后，关闭按钮同步贴到安全区顶部，避免遮挡标题 */
@media (max-width: 820px) {
  #chapterEditorDialog .modal-close,
  .chapter-translation-modal .modal-close {
    top: env(safe-area-inset-top, 0px) !important;
  }
}

/* 2026-11-08 章节译文：滑动正文时标题固定在顶部 */
.chapter-translation-heading {
  position: relative;
}
@media (max-width: 820px) {
  .chapter-translation-card {
    padding-top: 0 !important;
  }
  .chapter-translation-heading {
    position: sticky !important;
    top: 0 !important;
    z-index: 30 !important;
    margin: 0 -16px 12px !important;
    padding: calc(52px + env(safe-area-inset-top, 0px)) 16px 10px !important;
    background: #fffdf8 !important;
    border-bottom: 1px solid #ece6dc !important;
    box-shadow: 0 6px 16px rgba(20, 28, 45, .06) !important;
  }
  .chapter-translation-heading .side-label {
    display: block;
    margin-bottom: 5px;
  }
  .chapter-translation-heading h2 {
    margin: 0 0 4px !important;
    padding-right: 58px;
  }
  .chapter-translation-heading > p {
    margin: 0 !important;
    color: #7b8391 !important;
    font-size: 11px !important;
  }
  .chapter-translation-content {
    min-height: calc(100dvh - 330px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* 2026-11-08 章节译文页复用原文编辑页结构：固定标题、独立滚动正文、固定底栏 */
#chapterTranslationDialog .chapter-translation-card {
  width: min(calc(100vw - 30px), 920px);
  max-height: 90dvh;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  padding: 30px !important;
}
#chapterTranslationDialog .chapter-translation-heading {
  flex: 0 0 auto;
  position: relative;
  padding-bottom: 13px;
  border-bottom: 1px solid #e8e2d8;
}
#chapterTranslationDialog .chapter-translation-heading h2 {
  margin: 5px 0 4px !important;
}
#chapterTranslationDialog .chapter-translation-heading > p {
  margin: 0 !important;
  color: #7b8391 !important;
  font-size: 11px !important;
}
#chapterTranslationDialog .chapter-translation-editor-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
  padding: 14px 2px 18px !important;
}
#chapterTranslationDialog .chapter-translation-editor-body::-webkit-scrollbar {
  display: none;
}
#chapterTranslationDialog .chapter-translation-content {
  min-height: 100% !important;
  max-height: none !important;
  overflow: visible !important;
  margin: 0 !important;
  padding: 0 2px 24px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #1f2937 !important;
  font: 18px/1.9 "Songti SC", "SimSun", serif !important;
}
#chapterTranslationDialog .chapter-translation-content.empty {
  min-height: 100% !important;
  display: grid !important;
  place-items: center !important;
  color: #8b93a1 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif !important;
  font-size: 13px !important;
}
#chapterTranslationDialog .chapter-translation-footer {
  flex: 0 0 auto !important;
  margin-top: 0 !important;
  padding-top: 10px !important;
}
@media (max-width: 820px) {
  #chapterTranslationDialog {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
  }
  #chapterTranslationDialog .chapter-translation-card {
    width: 100% !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    padding: env(safe-area-inset-top, 0px) 16px 0 !important;
    border-radius: 0 !important;
  }
  #chapterTranslationDialog .chapter-translation-heading {
    position: relative !important;
    top: auto !important;
    z-index: auto !important;
    margin: 0 !important;
    padding: 0 0 12px !important;
    border-bottom: 1px solid #e8e2d8 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  #chapterTranslationDialog .chapter-translation-heading h2 {
    margin: 3px 0 4px !important;
    padding-right: 58px !important;
    font: 700 24px/1.35 "STKaiti", "KaiTi", serif !important;
  }
  #chapterTranslationDialog .chapter-translation-editor-body {
    padding: 14px 2px 16px !important;
  }
  #chapterTranslationDialog .chapter-translation-content {
    min-height: 100% !important;
    padding: 0 2px 24px !important;
  }
  #chapterTranslationDialog .chapter-translation-footer {
    margin: 0 -16px !important;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    border-top: 1px solid #e8e5de !important;
    background: #fffdf8 !important;
    box-shadow: 0 -8px 24px rgba(15,23,42,.08) !important;
  }
  #chapterTranslationDialog .chapter-editor-status {
    justify-content: flex-end !important;
  }
  #chapterTranslationDialog .chapter-translation-actions {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
    width: 100% !important;
  }
  #chapterTranslationDialog .chapter-translation-actions .button {
    width: 100% !important;
    min-height: 48px !important;
    padding: 10px 5px !important;
    font-size: 13px !important;
  }
}

/* 2026-11-08 原文/译文页再上移一格后，标题文字避开右上角关闭按钮 */
@media (max-width: 820px) {
  #chapterEditorDialog .chapter-title-inline {
    padding-right: 60px !important;
  }
}

/* 2026-11-08 译文底栏：字符状态与三个按钮之间不留空白 */
#chapterTranslationDialog .chapter-translation-footer {
  gap: 0 !important;
}
#chapterTranslationDialog .chapter-translation-footer .chapter-editor-status {
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.25 !important;
}
#chapterTranslationDialog .chapter-translation-actions {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* 2026-11-08 全球小说与作者平台目录 */
body.global-sites-mode .brand,
body.global-sites-mode .desktop-nav,
body.global-sites-mode .top-actions {
  display: none !important;
}
.global-sites-toolbar {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  padding: 16px;
}
.global-site-search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}
.global-site-search > span {
  color: #6b7280;
  font-size: 12px;
  font-weight: 800;
}
.global-site-search input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #ded9cf;
  border-radius: 12px;
  padding: 0 13px;
  color: #1f2937;
  background: #fff;
  font-size: 14px;
}
.global-site-filters,
.global-site-types {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.global-site-filter,
.global-site-type {
  min-height: 34px;
  border: 1px solid #e3ddd3;
  border-radius: 999px;
  padding: 6px 13px;
  color: #6b7280;
  background: #faf8f3;
  font-size: 12px;
  font-weight: 700;
}
.global-site-filter.active,
.global-site-type.active {
  border-color: #d39a7b;
  color: #fff;
  background: #b95530;
}
.global-site-count {
  margin: 0;
  color: #8b93a1;
  font-size: 11px;
}
.global-site-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.global-site-card {
  display: flex;
  flex-direction: column;
  min-height: 210px;
  border: 1px solid #e8e2d8;
  border-radius: 18px;
  padding: 16px;
  background: rgba(255,253,248,.92);
  box-shadow: 0 10px 28px rgba(25,31,46,.05);
}
.global-site-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.global-site-region,
.global-site-category {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 800;
}
.global-site-region {
  color: #7a4b35;
  background: #fff2ea;
}
.global-site-category.reader {
  color: #28674e;
  background: #edf8f1;
}
.global-site-category.author {
  color: #654c9d;
  background: #f2edff;
}
.global-site-card h3 {
  margin: 14px 0 7px;
  color: #1f2937;
  font-size: 18px;
  line-height: 1.35;
}
.global-site-card > p {
  flex: 1;
  margin: 0 0 13px;
  color: #697181;
  font-size: 12px;
  line-height: 1.75;
}
.global-site-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 13px;
}
.global-site-meta span {
  border-radius: 7px;
  padding: 4px 7px;
  color: #6f7684;
  background: #f3f0ea;
  font-size: 10px;
}
.global-site-open {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  border-radius: 10px;
  padding: 8px 10px;
  color: #a94828;
  background: #fff3ec;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}
.global-site-open:active {
  transform: scale(.98);
}
.global-site-empty {
  grid-column: 1 / -1;
}
@media (max-width: 1050px) {
  .global-site-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 820px) {
  body.global-sites-mode .topbar {
    height: calc(56px + env(safe-area-inset-top, 0px)) !important;
  }
  body.global-sites-mode .topbar .shell,
  body.global-sites-mode .topbar-inner {
    height: 56px !important;
    padding-top: 0 !important;
  }
  body.global-sites-mode main.app-main,
  body.global-sites-mode main.shell.app-main {
    top: calc(56px + env(safe-area-inset-top, 0px)) !important;
  }
  #view-global-sites {
    padding-top: 12px !important;
  }
  #view-global-sites .global-sites-heading {
    padding: 10px 16px 12px !important;
  }
  #view-global-sites .global-sites-heading h1 {
    margin: 5px 0 7px !important;
    font-size: 27px !important;
  }
  #view-global-sites .global-sites-heading p {
    margin: 0 !important;
  }
  .global-sites-toolbar {
    margin: 0 12px 14px !important;
    padding: 13px !important;
  }
  .global-site-search {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .global-site-filters,
  .global-site-types {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .global-site-types {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .global-site-filter,
  .global-site-type {
    padding-inline: 5px;
    white-space: nowrap;
  }
  .global-site-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 0 12px 16px;
  }
  .global-site-card {
    min-height: 0;
    padding: 14px;
    border-radius: 15px;
  }
  .global-site-card h3 {
    margin-top: 11px;
    font-size: 17px;
  }
}

/* 2026-11-08 底部导航增加全球小说网站，四项等宽 */
@media (max-width: 820px) {
  .mobile-nav:not(.nav-empty) {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

/* 2026-11-08 全球平台官网打开与复制备用 */
.global-site-network-note {
  margin: -2px 0 0 !important;
  color: #9a6a50 !important;
  font-size: 11px !important;
  line-height: 1.65 !important;
}
.global-site-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
}
.global-site-copy {
  min-height: 38px;
  border: 1px solid #e3d9cf;
  border-radius: 10px;
  padding: 8px 11px;
  color: #6b7280;
  background: #faf8f3;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.global-site-copy:active {
  transform: scale(.98);
}
.global-site-actions .global-site-open {
  min-width: 0;
}
@media (max-width: 820px) {
  .global-site-actions {
    grid-template-columns: 88px minmax(0, 1fr);
  }
  .global-site-copy {
    padding-inline: 8px;
  }
}

/* 2026-11-08 网页版桌面顶栏全球网站入口 */
.global-top-link {
  display: none;
}
@media (min-width: 821px) {
  body .topbar .global-top-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border: 1px solid #e3ddd3;
    border-radius: 999px;
    padding: 0 14px;
    color: #7a4b35;
    background: #fffaf4;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
  }
  body .topbar .global-top-link.active {
    color: #fff;
    background: #b95530;
    border-color: #b95530;
  }
}

/* 2026-11-08 全球小说网站页面不显示顶栏和返回键 */
body.global-sites-mode .topbar {
  display: none !important;
}
body.global-sites-mode main.app-main,
body.global-sites-mode main.shell.app-main {
  top: 0 !important;
}

/* 2026-11-08 我的翻译书库：标题与全球小说网站同字号，并增加说明 */
@media (max-width: 820px) {
  #view-library {
    padding-top: calc(170px + env(safe-area-inset-top, 0px)) !important;
  }
  #view-library .library-heading h1 {
    font-size: 27px !important;
    line-height: 1.3 !important;
  }
  #view-library .library-heading p {
    max-width: 100% !important;
    margin: 6px 0 0 !important;
    color: #8b93a1 !important;
    font-size: 12.5px !important;
    line-height: 1.65 !important;
    white-space: normal !important;
  }
}

/* 2026-11-08 全球小说网站标题和说明固定，与我的翻译书库一致 */
@media (max-width: 820px) {
  #view-global-sites {
    animation: none !important;
    padding-top: calc(121px + env(safe-area-inset-top, 0px)) !important;
  }
  #view-global-sites .global-sites-heading {
    position: fixed !important;
    top: env(safe-area-inset-top, 0px) !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 70 !important;
    margin: 0 !important;
    padding: 10px 16px 12px !important;
    background: #f2f2f7 !important;
    border-bottom: 1px solid #e7e4dd !important;
    box-shadow: 0 5px 14px rgba(15,23,42,.04) !important;
  }
  #view-global-sites .global-sites-heading h1 {
    margin: 5px 0 7px !important;
    font-size: 27px !important;
    line-height: 1.3 !important;
  }
  #view-global-sites .global-sites-heading p {
    margin: 0 !important;
    color: #8b93a1 !important;
    font-size: 12.5px !important;
    line-height: 1.65 !important;
  }
}

/* 2026-11-08 全球页固定标题区域高度与我的翻译书库一致 */
@media (max-width: 820px) {
  #view-global-sites {
    padding-top: calc(170px + env(safe-area-inset-top, 0px)) !important;
  }
  #view-global-sites .global-sites-heading {
    top: 0 !important;
    box-sizing: border-box !important;
    min-height: calc(139px + env(safe-area-inset-top, 0px)) !important;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 12px !important;
  }
}

/* 2026-11-08 全球页固定标题移到滚动容器外，彻底防止列表内容覆盖顶部 */
.global-sites-fixed-head {
  display: none;
}
@media (max-width: 820px) {
  body.global-sites-mode .global-sites-fixed-head {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 90;
    display: block;
    box-sizing: border-box;
    min-height: calc(139px + env(safe-area-inset-top, 0px));
    padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 12px;
    background: #f2f2f7;
    border-bottom: 1px solid #e7e4dd;
    box-shadow: 0 5px 14px rgba(15,23,42,.04);
  }
  .global-sites-fixed-head h1 {
    margin: 5px 0 7px;
    color: #1f2937;
    font-size: 27px;
    line-height: 1.3;
  }
  .global-sites-fixed-head p {
    margin: 0;
    color: #8b93a1;
    font-size: 12.5px;
    line-height: 1.65;
  }
  #view-global-sites .global-sites-heading {
    display: none !important;
  }
  #view-global-sites {
    padding-top: calc(170px + env(safe-area-inset-top, 0px)) !important;
  }
}

/* 2026-11-08 桌面网页全球页保留顶部导航，但不显示返回键 */
@media (min-width: 821px) {
  body.global-sites-mode .topbar {
    display: block !important;
  }
  body.global-sites-mode .topbar .brand,
  body.global-sites-mode .topbar .desktop-nav,
  body.global-sites-mode .topbar .top-actions {
    display: flex !important;
  }
  body.global-sites-mode .nav-back {
    display: none !important;
  }
}

/* 2026-11-08 统一书库与全球页固定栏高度，兼容320/375窄屏换行 */
@media (max-width: 820px) {
  #view-library .library-heading,
  body.global-sites-mode .global-sites-fixed-head {
    box-sizing: border-box !important;
    min-height: calc(160px + env(safe-area-inset-top, 0px)) !important;
  }
}

/* 2026-11-08 全球页固定栏与搜索区之间不留空白 */
@media (max-width: 820px) {
  #view-global-sites {
    padding-top: calc(160px + env(safe-area-inset-top, 0px)) !important;
  }
}

/* 2026-11-08 全球页压缩顶部固定栏高度，移除多余空白 */
@media (max-width: 820px) {
  body.global-sites-mode .global-sites-fixed-head {
    height: calc(112px + env(safe-area-inset-top, 0px)) !important;
    min-height: 0 !important;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px !important;
    overflow: hidden !important;
  }
  #view-global-sites {
    padding-top: calc(112px + env(safe-area-inset-top, 0px)) !important;
  }
}

/* 2026-11-08 作品章节列表移除前置数字后调整卡片为两栏 */
.chapter-row {
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 10px !important;
}
@media (max-width: 820px) {
  .chapter-row {
    grid-template-columns: minmax(0, 1fr) auto !important;
  }
}

/* 2026-11-08 作品卡片移除前置单字方框，状态保持右上角 */
.book-item-head {
  justify-content: flex-end !important;
}

/* 2026-11-08 删除作品方框后同步移除预留网格列 */
@media (max-width: 820px) {
  .book-item {
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-areas:
      "title badge"
      "langs langs"
      "meta meta"
      "prog prog"
      "foot foot" !important;
  }
}

/* 2026-11-08 会员中心美化：删除字数权益，强化套餐与账户卡片层级 */
#view-billing .plan-card:not(.featured) {
  background: linear-gradient(155deg, #fffefb, #fbf5eb) !important;
  box-shadow: 0 14px 34px rgba(25,31,46,.07);
}
#view-billing .plan-card > * {
  position: relative;
  z-index: 1;
}
#view-billing .plan-card::after {
  content: "译";
  position: absolute;
  right: 13px;
  bottom: 52px;
  color: rgba(185, 85, 48, .05);
  font: 700 72px/1 "STKaiti", "KaiTi", serif;
  pointer-events: none;
}
#view-billing .plan-card.featured::after {
  color: rgba(255,255,255,.055);
}
#view-billing .billing-side > .panel {
  border-radius: 20px;
  box-shadow: 0 12px 30px rgba(25,31,46,.06);
}
@media (max-width: 820px) {
  #view-billing {
    padding-top: 12px !important;
    background: linear-gradient(180deg, #f7f3ea 0, #f3f2ef 240px, #f7f6f3 100%);
  }
  #view-billing .page-heading {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: start !important;
    gap: 12px !important;
    margin: 0 12px 14px !important;
    padding: 19px 17px !important;
    border: 1px solid rgba(255,255,255,.12) !important;
    border-radius: 22px !important;
    color: #fff !important;
    background:
      radial-gradient(circle at 88% 18%, rgba(255,178,74,.28), transparent 38%),
      linear-gradient(145deg, #202b43, #111726 72%) !important;
    box-shadow: 0 18px 38px rgba(17,23,38,.2) !important;
  }
  #view-billing .page-heading .eyebrow {
    margin: 0 !important;
    color: rgba(255,255,255,.56) !important;
    font-size: 9.5px !important;
  }
  #view-billing .page-heading h1 {
    margin: 6px 0 7px !important;
    color: #fff !important;
    font-size: 28px !important;
    line-height: 1.25 !important;
  }
  #view-billing .page-heading p {
    margin: 0 !important;
    color: rgba(255,255,255,.66) !important;
    font-size: 12.5px !important;
    line-height: 1.7 !important;
  }
  #view-billing .membership-status {
    padding: 8px 10px !important;
    border: 1px solid rgba(255,255,255,.13) !important;
    color: rgba(255,255,255,.82) !important;
    background: rgba(255,255,255,.1) !important;
    font-size: 10.5px !important;
    white-space: nowrap;
  }
  #view-billing .membership-status.active {
    color: #dff8e9 !important;
    background: rgba(53,184,119,.2) !important;
    border-color: rgba(123,226,169,.28) !important;
  }
  #view-billing .billing-layout {
    display: block !important;
    padding: 0 !important;
  }
  #view-billing .plan-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 11px !important;
    padding: 0 12px !important;
  }
  #view-billing .plan-card {
    min-height: 0 !important;
    padding: 16px !important;
    border-radius: 19px !important;
    overflow: hidden;
  }
  #view-billing .plan-card.featured {
    border: 1px solid transparent !important;
    background:
      radial-gradient(circle at 92% 8%, rgba(255,178,74,.18), transparent 35%),
      linear-gradient(150deg, #202a41, #0d1322) !important;
  }
  #view-billing .plan-name {
    font-size: 13px !important;
    letter-spacing: .04em;
  }
  #view-billing .plan-price {
    color: #a94828;
    font-size: 28px !important;
    font-weight: 700;
  }
  #view-billing .plan-card.featured .plan-price {
    color: #ffc45f;
  }
  #view-billing .plan-quota {
    grid-column: 1 / -1 !important;
    grid-row: 3 !important;
    align-self: stretch !important;
    justify-self: stretch !important;
    width: 100% !important;
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: 82px minmax(0, 1fr) !important;
    margin-top: 10px !important;
    padding: 9px 11px !important;
    align-items: baseline !important;
    justify-content: initial !important;
    gap: 7px !important;
    box-sizing: border-box !important;
  }
  #view-billing .plan-description { grid-column: 1 / -1 !important; grid-row: 4 !important; }
  #view-billing .plan-benefits { grid-column: 1 / -1 !important; grid-row: 5 !important; }
  #view-billing .plan-card .button { grid-column: 1 / -1 !important; grid-row: 6 !important; }
  #view-billing .plan-quota b {
    min-width: 82px !important;
    font-size: 22px !important;
    text-align: left !important;
    white-space: nowrap !important;
  }
  #view-billing .plan-description {
    color: #727a88 !important;
    font-size: 12px !important;
  }
  #view-billing .plan-card.featured .plan-description {
    color: rgba(255,255,255,.64) !important;
  }
  #view-billing .plan-benefits {
    gap: 6px !important;
    margin-bottom: 13px !important;
  }
  #view-billing .plan-benefits span {
    border-radius: 8px;
    padding: 4px 8px;
    background: #f4f1eb;
    font-size: 11px !important;
  }
  #view-billing .plan-card.featured .plan-benefits span {
    background: rgba(255,255,255,.085);
  }
  #view-billing .plan-card .button {
    height: 46px !important;
    min-height: 46px !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
  }
  #view-billing .quota-pack-section {
    margin: 12px !important;
    padding: 15px !important;
    border-radius: 19px !important;
  }
  #view-billing .quota-pack-heading h2 {
    font-size: 18px !important;
  }
  #view-billing .quota-pack-grid {
    grid-template-columns: 1fr !important;
    gap: 9px !important;
  }
  #view-billing .quota-pack-card {
    padding: 14px !important;
  }
  #view-billing .quota-pack-price {
    margin: 9px 0 6px !important;
    font-size: 25px !important;
  }
  #view-billing .billing-side {
    display: grid !important;
    gap: 11px !important;
    margin: 12px 12px 18px !important;
    padding: 0 !important;
  }
  #view-billing .subscription-card,
  #view-billing .redeem-card {
    margin: 0 !important;
    padding: 17px !important;
    border-radius: 18px !important;
    background: rgba(255,255,255,.92) !important;
    box-shadow: 0 10px 28px rgba(25,31,46,.055) !important;
  }
  #view-billing .subscription-head h3,
  #view-billing .redeem-card h3 {
    font-size: 16px !important;
  }
  #view-billing .subscription-next {
    background: #f7f4ee !important;
    border-radius: 12px !important;
  }
  #view-billing .redeem-card .inline-field {
    margin-top: 11px !important;
  }
}

/* 2026-11-08 原文标题移出正文滚动区；原文与译文顶部标题固定 */
@media (max-width: 820px) {
  #chapterEditorDialog .chapter-title-inline {
    flex: 0 0 auto !important;
    position: relative !important;
    z-index: 45 !important;
    margin-top: 0 !important;
    background: #fffdf8 !important;
  }
  #chapterEditorDialog .chapter-editor-body {
    padding-top: 0 !important;
    overscroll-behavior: contain !important;
  }
  #chapterTranslationDialog .chapter-translation-heading {
    flex: 0 0 auto !important;
    position: relative !important;
    top: auto !important;
    z-index: 45 !important;
  }
  #chapterTranslationDialog .chapter-translation-editor-body {
    overscroll-behavior: contain !important;
  }
}

/* 2026-11-08 原文/译文标题在滚动时始终吸顶 */
@media (max-width: 820px) {
  #chapterEditorDialog .chapter-title-inline {
    position: sticky !important;
    top: 0 !important;
    z-index: 60 !important;
  }
  #chapterTranslationDialog .chapter-translation-heading {
    position: sticky !important;
    top: 0 !important;
    z-index: 60 !important;
  }
}

/* 2026-11-08 原文/译文页：顶部标题与底部操作栏固定，仅正文滚动 */
@media (max-width: 820px) {
  #chapterEditorDialog .chapter-title-inline {
    position: fixed !important;
    top: env(safe-area-inset-top, 0px) !important;
    left: 16px !important;
    right: 16px !important;
    width: auto !important;
    z-index: 2147483000 !important;
    margin: 0 !important;
    padding: 2px 60px 13px 2px !important;
    background: #fffdf8 !important;
  }
  #chapterEditorDialog .chapter-editor-body {
    padding-top: 62px !important;
    padding-bottom: 112px !important;
  }
  #chapterEditorDialog .chapter-editor-footer-v2 {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 2147482999 !important;
    margin: 0 !important;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    border-top: 1px solid #e8e5de !important;
    background: #fffdf8 !important;
    box-shadow: 0 -8px 24px rgba(15,23,42,.08) !important;
  }
  #chapterTranslationDialog .chapter-translation-heading {
    position: fixed !important;
    top: env(safe-area-inset-top, 0px) !important;
    left: 16px !important;
    right: 16px !important;
    width: auto !important;
    z-index: 2147483000 !important;
    margin: 0 !important;
    padding: 0 0 12px !important;
    background: #fffdf8 !important;
  }
  #chapterTranslationDialog .chapter-translation-editor-body {
    padding-top: 91px !important;
    padding-bottom: 112px !important;
  }
  #chapterTranslationDialog .chapter-translation-footer {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 2147482999 !important;
    margin: 0 !important;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    border-top: 1px solid #e8e5de !important;
    background: #fffdf8 !important;
    box-shadow: 0 -8px 24px rgba(15,23,42,.08) !important;
  }
}

/* 2026-11-08 原文/译文页最终布局：取消 fixed 层级，改用 flex 固定上下栏 */
@media (max-width: 820px) {
  #chapterEditorDialog .chapter-title-inline {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    width: 100% !important;
    z-index: 3 !important;
    margin: 0 !important;
    padding: 2px 60px 13px 2px !important;
    background: #fffdf8 !important;
  }
  #chapterEditorDialog .chapter-editor-body {
    padding-top: 0 !important;
    padding-bottom: 16px !important;
  }
  #chapterEditorDialog .chapter-editor-footer-v2 {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    z-index: 50 !important;
    margin: 0 -16px !important;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)) !important;
  }
  #chapterTranslationDialog .chapter-translation-heading {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    width: 100% !important;
    z-index: 3 !important;
    margin: 0 !important;
    padding: 0 0 12px !important;
  }
  #chapterTranslationDialog .chapter-translation-editor-body {
    padding-top: 14px !important;
    padding-bottom: 16px !important;
  }
  #chapterTranslationDialog .chapter-translation-footer {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    z-index: 50 !important;
    margin: 0 -16px !important;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)) !important;
  }
  #chapterEditorDialog .modal-close,
  #chapterTranslationDialog .modal-close {
    position: fixed !important;
    top: env(safe-area-inset-top, 0px) !important;
    right: 14px !important;
    z-index: 2147483647 !important;
  }
}

/* 2026-11-08 v180：彻底锁死弹窗外层，避免 iOS 惯性滚动把整页翻到顶部 */
@media (max-width: 820px) {
  html:has(#chapterEditorDialog[open]),
  html:has(#chapterTranslationDialog[open]),
  body:has(#chapterEditorDialog[open]),
  body:has(#chapterTranslationDialog[open]) {
    overflow: hidden !important;
    overscroll-behavior: none !important;
  }
  #chapterEditorDialog,
  #chapterTranslationDialog {
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    max-width: 100vw !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    overflow: hidden !important;
    overscroll-behavior: none !important;
  }
  #chapterEditorDialog .chapter-editor-card,
  #chapterTranslationDialog .chapter-translation-card {
    height: 100% !important;
    max-height: 100% !important;
    overflow: hidden !important;
    overscroll-behavior: contain !important;
  }
  #chapterEditorDialog .chapter-editor-body,
  #chapterEditorDialog .chapter-body-inline,
  #chapterTranslationDialog .chapter-translation-editor-body {
    overscroll-behavior: contain !important;
  }
  #chapterEditorDialog .modal-close,
  #chapterTranslationDialog .modal-close {
    top: calc(10px + env(safe-area-inset-top, 0px)) !important;
    right: 14px !important;
  }
}

/* 2026-11-08 v181：隐藏原文编辑框右侧滚动竖线，不改变滚动功能 */
@media (max-width: 820px) {
  #chapterEditorDialog #drawerChapterBodyInline.chapter-body-inline {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }
  #chapterEditorDialog #drawerChapterBodyInline.chapter-body-inline::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }
}

/* 2026-11-08 v182：原文与译文右上角关闭键使用完全相同的视觉样式 */
@media (max-width: 820px) {
  #chapterEditorDialog .modal-close,
  #chapterTranslationDialog .modal-close {
    top: calc(10px + env(safe-area-inset-top, 0px)) !important;
    right: 14px !important;
    width: 48px !important;
    height: 48px !important;
    display: grid !important;
    place-items: center !important;
    z-index: 2147483647 !important;
    padding: 0 !important;
    border: 1px solid #e7e4dd !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    color: #555d6d !important;
    box-shadow: 0 6px 20px rgba(15,23,42,.16) !important;
    font-size: 26px !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
  }
}

/* 2026-11-08 v184：会员中心顶部标题栏固定，采用白色标题栏模式 */
@media (max-width: 820px) {
  #view-billing {
    padding-top: calc(118px + env(safe-area-inset-top, 0px)) !important;
    background: linear-gradient(180deg, #f7f6f3 0, #f7f6f3 100%) !important;
  }
  #view-billing .page-heading {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 90 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 12px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    height: calc(118px + env(safe-area-inset-top, 0px)) !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px !important;
    border: 0 !important;
    border-bottom: 1px solid #e7e4dd !important;
    border-radius: 0 !important;
    color: #1f2937 !important;
    background: #ffffff !important;
    box-shadow: 0 5px 14px rgba(15,23,42,.04) !important;
    overflow: hidden !important;
  }
  #view-billing .page-heading .eyebrow {
    display: none !important;
  }
  #view-billing .page-heading h1 {
    margin: 0 0 5px !important;
    color: #1f2937 !important;
    font-size: 25px !important;
    line-height: 1.25 !important;
  }
  #view-billing .page-heading p {
    display: -webkit-box !important;
    margin: 0 !important;
    overflow: hidden !important;
    color: #8b93a1 !important;
    font-size: 11.5px !important;
    line-height: 1.55 !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
  }
  #view-billing .membership-status {
    align-self: center !important;
    padding: 7px 9px !important;
    border: 1px solid #e7e4dd !important;
    color: #5b6472 !important;
    background: #f7f7f8 !important;
    font-size: 10px !important;
    white-space: nowrap !important;
  }
  #view-billing .membership-status.active {
    color: #1e7c4e !important;
    background: rgba(53,184,119,.09) !important;
    border-color: rgba(53,184,119,.2) !important;
  }
}

/* 2026-11-08 v186：撤销订单记录固定标题栏，恢复原布局并整体上移3格（30px） */
@media (max-width: 820px) {
  #view-orders {
    padding-top: 24px !important;
  }
}
/* 2026-11-08 v187：订单记录再上移2格（20px），顶部间距24px -> 4px */
@media (max-width: 820px) {
  #view-orders {
    padding-top: 4px !important;
  }
}

/* ============================================================
 * iOS 审核版：私密翻译项目管理
 * 网页版与 Android 版不受影响
 * ============================================================ */
body.native-ios .global-top-link,
body.native-ios .home-clean-link[data-route="library"],
body.native-ios #view-translate .heading-actions,
body.native-ios #translateGate,
body.native-ios #translateWorkspace,
body.native-ios #view-translate .workspace-side,
body.native-ios #mineGoGlobalSites,
body.native-ios .redeem-card,
body.native-ios .quota-pack-section,
body.native-ios [data-route="global-sites"] {
  display: none !important;
}

body.native-ios #view-global-sites {
  display: none !important;
}

body.native-ios .mobile-nav {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

body.native-ios #view-translate {
  padding-top: 22px !important;
}

body.native-ios #view-translate .quick-wrap {
  width: min(100%, 680px);
  margin: 0 auto;
}

body.native-ios .mine-menu .mine-item[data-route="help"] {
  display: none !important;
}

body.native-ios .auth-page-copy {
  display: none !important;
}

/* 2026-11-16：微信 Native 扫码支付 */
.payment-modal { width: min(calc(100% - 30px), 500px); }
.payment-modal .modal-card { text-align: center; }
.payment-modal .modal-card > p { margin-bottom: 18px; }
.payment-modal .side-label { display: inline-block; margin-bottom: 10px; }
.payment-modal h2 { margin-bottom: 8px; }
.payment-qr-wrap {
  display: grid;
  place-items: center;
  width: min(100%, 278px);
  margin: 0 auto 15px;
  padding: 15px;
  border: 1px solid #e8e5df;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 16px 35px rgba(26, 35, 52, .09);
}
.payment-qr { display: grid; place-items: center; width: 230px; height: 230px; }
.payment-qr canvas, .payment-qr img, .payment-qr table { display: block; max-width: 100%; }
.payment-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 auto 10px;
  padding: 8px 12px;
  border-radius: 999px;
  color: #7b5d17;
  background: #fff8e8;
  font-size: 12px;
  font-weight: 700;
}
.payment-status span { width: 7px; height: 7px; border-radius: 50%; background: #e3a21a; }
.payment-status.paid { color: #167047; background: #eaf7f0; }
.payment-status.paid span { background: #18a466; }
.payment-status.error { color: #a13c36; background: #fdf0ee; }
.payment-status.error span { background: #d7574e; }
.payment-hint { margin: 0 !important; color: #7a8392 !important; font-size: 12px !important; line-height: 1.65; }
.payment-modal .modal-actions { margin-top: 20px; }
.payment-modal .button:disabled { opacity: .48; }
@media (max-width: 600px) {
  .payment-modal .modal-card { padding: 29px 19px 21px; }
  .payment-qr-wrap { width: 246px; padding: 12px; }
  .payment-qr { width: 214px; height: 214px; }
}
