:root {
  --bg: #0a0c11;
  --bg-2: #0e1118;
  --panel: rgba(255, 255, 255, 0.035);
  --panel-2: rgba(255, 255, 255, 0.06);
  --border: rgba(212, 180, 120, 0.16);
  --gold: #e8c987;
  --gold-2: #b8935a;
  --gold-soft: rgba(232, 201, 135, 0.12);
  --text: #ece9e2;
  --muted: #8b8a93;
  --danger: #e0795f;
  --radius: 14px;
  --serif: "Noto Serif SC", "Songti SC", serif;
  --sans: "Noto Sans SC", "PingFang SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(232, 201, 135, 0.08), transparent 60%),
    radial-gradient(1000px 500px at 100% 0%, rgba(120, 140, 200, 0.06), transparent 55%),
    var(--bg);
  font-weight: 300;
  overflow: hidden;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }

/* ---------- 登录/注册 ---------- */
.auth-gate {
  position: fixed; inset: 0; display: grid; place-items: center;
  background:
    radial-gradient(900px 500px at 50% -20%, rgba(232, 201, 135, 0.10), transparent 60%),
    linear-gradient(180deg, #0a0c11, #0c0f16);
  overflow: hidden;
}
.auth-glow {
  position: absolute; width: 600px; height: 600px; border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 201, 135, 0.18), transparent 70%);
  filter: blur(40px); animation: float 8s ease-in-out infinite;
}
@keyframes float { 0%,100%{ transform: translateY(-10px);} 50%{ transform: translateY(20px);} }
.auth-card {
  position: relative; width: 380px; padding: 40px 34px 30px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 20px; backdrop-filter: blur(18px);
  box-shadow: 0 30px 80px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.05);
}
.brand { font-family: var(--serif); font-size: 40px; font-weight: 700; letter-spacing: 6px;
  background: linear-gradient(135deg, #fff, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; text-align: center; }
.brand-en { display: block; font-family: var(--serif); font-size: 13px; letter-spacing: 2px; color: var(--gold-2); margin-top: 8px; font-weight: 500; line-height: 1.6; opacity: .9; }
.brand.small { font-size: 22px; letter-spacing: 3px; text-align: left; margin-left: 50px; }
.tagline { text-align: center; color: var(--muted); font-size: 13px; letter-spacing: 2px; margin: 10px 0 26px; }
.tabs { display: flex; gap: 8px; background: rgba(0,0,0,0.25); padding: 5px; border-radius: 12px; margin-bottom: 22px; }
.tab { flex: 1; border: 0; background: transparent; color: var(--muted); padding: 10px; border-radius: 9px; font-size: 14px; transition: .25s; }
.tab.active { background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #1a1408; font-weight: 500; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form input {
  background: rgba(0,0,0,0.3); border: 1px solid var(--border); color: var(--text);
  padding: 13px 15px; border-radius: 11px; font-size: 14px; outline: none; transition: .2s;
}
.auth-form input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.hint { color: var(--muted); font-size: 12px; text-align: center; margin: 4px 0 0; }
.auth-msg { color: var(--danger); font-size: 13px; text-align: center; min-height: 18px; margin: 10px 0 0; }

.btn-gold {
  border: 0; padding: 13px; border-radius: 11px; font-size: 15px; font-weight: 500; color: #1a1408;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  box-shadow: 0 10px 30px rgba(232, 201, 135, 0.25); transition: .25s; letter-spacing: 2px;
}
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 14px 38px rgba(232, 201, 135, 0.4); }
.btn-gold:disabled { opacity: .6; cursor: default; transform: none; }
.btn-gold.small { padding: 13px 16px; font-size: 13px; letter-spacing: 0; white-space: nowrap; }
.captcha-row { display: flex; gap: 10px; align-items: center; }
.captcha-row input { flex: 1; }
.captcha-img { width: 110px; height: 38px; border-radius: 11px; border: 1px solid var(--border); cursor: pointer; background: #1a1c22; flex-shrink: 0; }

.ai-actions { display: flex; gap: 10px; margin-top: 10px; }
.ai-actions button { flex: 1; }
.ai-clear {
  border: 0; padding: 13px; border-radius: 11px; font-size: 15px; font-weight: 500;
  color: #fff; background: #b23b3b; cursor: pointer; transition: .25s; letter-spacing: 2px;
}
.ai-clear:hover { background: #d24a4a; box-shadow: 0 10px 30px rgba(178, 59, 59, 0.35); }
.ai-chat {
  border: 0; padding: 13px; border-radius: 11px; font-size: 15px; font-weight: 500;
  color: #fff; background: #5c8d6b; cursor: pointer; transition: .25s; letter-spacing: 2px;
}
.ai-chat:hover { background: #6da37d; box-shadow: 0 10px 30px rgba(92, 141, 107, 0.35); }
.ai-chat:disabled { opacity: .6; cursor: default; transform: none; }

.ai-input-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.ai-input-hint { color: var(--muted); font-size: 12px; letter-spacing: 1px; }
.ai-reset {
  background: none; border: 1px solid var(--border); color: var(--muted);
  font-size: 12px; padding: 3px 12px; border-radius: 7px; cursor: pointer; transition: .2s;
}
.ai-reset:hover { color: #ff6b6b; border-color: #ff6b6b; }

/* ---------- 主应用 ---------- */
.app { height: 100vh; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; flex-wrap: nowrap; gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid var(--border); background: rgba(10,12,17,0.6); backdrop-filter: blur(10px);
  overflow: hidden;
}
.doc-title {
  flex: 1 1 auto; min-width: 120px; max-width: 100%; background: transparent; border: 0; border-bottom: 1px solid transparent;
  color: var(--text); font-family: var(--serif); font-size: 18px; font-weight: 600; padding: 6px 4px; outline: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.doc-title[readonly] { cursor: default; }
.doc-label { background: rgba(255, 77, 79, 0.15); color: #ff6b6b; border: 1px solid #ff6b6b; padding: 4px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; margin-left: 150px; }
.top-actions { margin-left: auto; display: flex; align-items: center; flex-wrap: nowrap; gap: 6px; }
.model-select {
  background: rgba(0,0,0,0.3); border: 1px solid var(--border); color: var(--text);
  padding: 6px 10px; border-radius: 8px; font-size: 14px; outline: none; min-width: 150px;
  color-scheme: dark;
}
.model-select:focus { border-color: var(--gold); }
.model-select option { background: #1a1c22; color: #f0f0f0; font-weight: 500; }
.ghost-btn { background: transparent; border: 1px solid var(--border); color: var(--gold); padding: 6px 12px; border-radius: 8px; font-size: 14px; transition: .2s; }
.ghost-btn:hover { background: var(--gold-soft); }
.user-chip { color: var(--muted); font-size: 14px; padding-left: 8px; border-left: 1px solid var(--border); white-space: nowrap; }
.user-chip b { color: var(--text); font-weight: 500; }
.user-chip a { color: var(--gold-2); margin-left: 6px; cursor: pointer; }
.logout-btn { color: #ff6b6b !important; font-size: 15px; font-weight: 600; }
.logout-btn:hover { color: #ff4c4c !important; text-decoration: underline; }
.credit-chip { background: var(--gold-soft); color: var(--gold); padding: 2px 8px; border-radius: 20px; font-size: 13px; margin-left: 6px; }
.credit-chip.zero { background: rgba(180, 60, 60, 0.2); color: #e08a8a; }

.layout { flex: 1; display: grid; grid-template-columns: 240px 1fr 340px; min-height: 0; }
.sidebar { border-right: 1px solid var(--border); padding: 18px 14px; background: rgba(0,0,0,0.18); overflow-y: auto; }
.side-btn { width: 100%; border: 1px dashed var(--border); background: transparent; color: var(--gold); padding: 12px; border-radius: 11px; font-size: 14px; transition: .2s; }
.side-btn:hover { background: var(--gold-soft); }
.side-label { color: var(--muted); font-size: 12px; letter-spacing: 2px; margin: 20px 0 10px; }
.project-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.project-list li { padding: 11px 12px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; transition: .2s; }
.project-list li:hover { background: var(--panel); }
.project-list li.active { background: var(--gold-soft); border-color: var(--border); }
.project-list .p-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.project-list .p-title { flex: 1; min-width: 0; font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-list .p-title:hover { color: var(--gold); }
.project-list .p-actions { display: flex; gap: 4px; opacity: 0; transition: .2s; }
.project-list li:hover .p-actions { opacity: 1; }
.project-list .p-action { background: transparent; border: 0; color: var(--muted); font-size: 13px; cursor: pointer; padding: 2px 5px; border-radius: 5px; line-height: 1; }
.project-list .p-action:hover { background: var(--gold-soft); color: var(--gold); }
.project-list .p-title-input { width: 100%; font-size: 14px; color: var(--text); background: var(--bg); border: 1px solid var(--gold); border-radius: 6px; padding: 4px 8px; outline: none; }
.project-list .p-meta { font-size: 11px; color: var(--muted); margin-top: 3px; }

.editor-wrap { position: relative; display: flex; flex-direction: column; min-height: 0; padding: 0 28px; }
.editor-toolbar { display: flex; align-items: center; gap: 8px; padding: 16px 0 12px; }
.tool { border: 1px solid var(--border); background: var(--panel); color: var(--text); padding: 8px 15px; border-radius: 9px; font-size: 13px; transition: .2s; }
.tool:hover { background: var(--gold-soft); color: var(--gold); border-color: var(--gold); }
.tool:disabled { opacity: .4; cursor: not-allowed; background: var(--panel); color: var(--muted); border-color: var(--border); }
.editor-toolbar .model-select {
  background: var(--panel); color: var(--gold); border-color: var(--gold);
  font-weight: 600; font-size: 14px; min-width: 160px; cursor: pointer;
}
.editor-toolbar .model-select:hover { background: var(--gold-soft); }
.spacer { flex: 1; }
.word-count, .save-state { font-size: 12px; color: var(--muted); }
.save-state.saving { color: var(--gold-2); }
.save-state.saved { color: #7fb98a; }
.editor {
  flex: 1; width: 100%; resize: none; border: 0; outline: none; background: transparent;
  color: var(--text); font-family: var(--serif); font-size: 18px; line-height: 2; font-weight: 400;
  padding: 10px 4px 40px;
}
.editor::placeholder { color: #4a4a52; }
.find-bar {
  position: absolute; top: 14px; right: 174px; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 8px 10px; box-shadow: 0 12px 30px rgba(0,0,0,0.45);
}
.find-bar.hidden { display: none; }
.find-input { background: rgba(0,0,0,0.3); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 6px 10px; font-size: 13px; outline: none; width: 200px; }
.find-input:focus { border-color: var(--gold); }
.find-count { font-size: 12px; color: var(--muted); min-width: 48px; text-align: center; }
.find-count.no-match { color: #ff6b6b; }
.find-nav, .find-close { border: 1px solid var(--border); background: var(--panel-2); color: var(--text); width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 14px; transition: .2s; }
.find-nav:hover, .find-close:hover { border-color: var(--gold); color: var(--gold); }

.ai-panel { border-left: 1px solid var(--border); background: rgba(0,0,0,0.2); display: flex; flex-direction: column; min-height: 0; }
.ai-head { padding: 16px 18px; font-family: var(--serif); font-size: 16px; color: var(--gold); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.ai-credits { font-family: var(--sans); font-size: 12px; color: var(--muted); background: var(--gold-soft); padding: 4px 10px; border-radius: 20px; }
.ai-credits.zero { color: #e08a8a; background: rgba(180, 60, 60, 0.2); }
.ai-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.ai-empty { color: var(--muted); font-size: 13px; line-height: 1.8; }
.ai-msg { font-size: 13px; line-height: 1.8; padding: 12px 14px; border-radius: 11px; white-space: pre-wrap; }
.ai-msg.user { background: var(--gold-soft); color: var(--text); align-self: flex-end; max-width: 90%; }
.ai-msg.bot { background: var(--panel-2); border: 1px solid var(--border); }
.ai-msg .insert { display: inline-block; color: var(--gold); font-size: 12px; cursor: pointer; border: 1px solid var(--border); padding: 4px 10px; border-radius: 8px; }
.ai-msg .copy { display: inline-block; color: var(--gold); font-size: 12px; cursor: pointer; border: 1px solid var(--border); padding: 4px 10px; border-radius: 8px; }
.ai-msg .copy:hover { background: var(--gold-soft); }
.ai-msg .copy.copied { color: #7fd18b; border-color: rgba(127, 209, 139, 0.4); background: rgba(127, 209, 139, 0.12); }
.ai-msg-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* 插入位置标记浮层 */
.insert-marker { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); max-width: min(720px, 92vw); background: var(--panel); border: 1px solid var(--gold); border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,0.45); padding: 12px 14px; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 9999; }
.insert-marker.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.insert-marker-label { font-size: 12px; color: var(--gold); margin-bottom: 6px; letter-spacing: .3px; }
.insert-marker-text { font-size: 13px; line-height: 1.8; max-height: 220px; overflow-y: auto; white-space: pre-wrap; word-break: break-word; color: var(--text); }
.insert-marker-text .ctx { color: #ff5a5a; }
.insert-marker-text .ins { color: var(--gold); background: var(--gold-soft); border-radius: 4px; padding: 0 2px; }
.ai-input { border-top: 1px solid var(--border); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.ai-input textarea { background: rgba(0,0,0,0.3); border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 10px; font-size: 13px; resize: none; height: 64px; outline: none; font-family: var(--sans); }
.ai-input textarea:focus { border-color: var(--gold); }

@media (max-width: 1180px) {
  .layout { grid-template-columns: 200px 1fr; }
  .ai-panel { display: none; }
  .ai-panel.open { display: flex; position: fixed; right: 0; top: 0; bottom: 0; width: 340px; z-index: 20; }
}

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.72); backdrop-filter: blur(4px); }
.modal-card { position: relative; width: 420px; max-width: 90vw; background: linear-gradient(180deg, rgba(20,22,28,0.98), rgba(14,16,22,0.98)); border: 1px solid var(--border); border-radius: 22px; padding: 28px; box-shadow: 0 40px 100px rgba(0,0,0,0.65), inset 0 1px 0 rgba(232,201,135,0.08); }
.modal-head { font-family: var(--serif); font-size: 20px; color: var(--gold); text-align: center; margin-bottom: 22px; letter-spacing: 2px; }
.modal-body { display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; justify-content: center; gap: 12px; margin-top: 24px; }
.modal-foot .btn-gold, .modal-foot .ghost-btn { padding: 11px 24px; border-radius: 11px; font-size: 14px; }
.redeem-input { width: 100%; background: rgba(0,0,0,0.35); border: 1px solid var(--border); color: var(--text); padding: 14px 16px; border-radius: 12px; font-size: 15px; outline: none; text-align: center; letter-spacing: 1px; }
.redeem-input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.redeem-result { text-align: center; padding: 16px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--border); line-height: 1.8; }
.redeem-result .success { color: #7fb98a; font-weight: 600; }
.redeem-result .fail { color: #e08a8a; font-weight: 600; }
.redeem-detail { color: var(--muted); font-size: 13px; margin-top: 6px; }
.contact-body { align-items: center; }
.contact-qr { width: 200px; height: 200px; display: grid; place-items: center; background: #fff; border-radius: 12px; padding: 12px; overflow: hidden; }
.contact-qr img { max-width: 100%; max-height: 100%; }
.contact-wechat { color: var(--text); font-size: 15px; margin-top: 8px; }
.contact-wechat span { color: var(--gold); font-weight: 600; }

.modal-card.wide { width: 860px; }
.ns-card { width: 460px; max-height: 86vh; overflow-y: auto; }
.ns-body { gap: 12px; }
.ns-field { display: flex; flex-direction: column; gap: 6px; }
.ns-label { font-size: 13px; color: var(--gold); letter-spacing: 0.5px; }
.ns-input, .ns-textarea { width: 100%; background: rgba(0,0,0,0.35); border: 1px solid var(--border); color: var(--text); padding: 11px 13px; border-radius: 11px; font-size: 14px; outline: none; font-family: inherit; resize: vertical; }
.ns-input:focus, .ns-textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.ns-textarea { min-height: 64px; line-height: 1.6; }
.tip-content { max-height: 62vh; overflow-y: auto; padding-right: 6px; line-height: 1.75; }
.tip-content h4 { margin: 16px 0 6px; font-size: 15px; color: var(--gold, #e8c987); font-weight: 600; }
.tip-content h4:first-child { margin-top: 0; }
.tip-content p { margin: 0 0 8px; font-size: 13.5px; color: var(--text); }
.tip-content code { padding: 1px 6px; border-radius: 5px; background: var(--panel-2); border: 1px solid var(--border); font-size: 12.5px; color: var(--gold, #e8c987); }
.price-list { display: flex; flex-direction: column; gap: 12px; max-height: 62vh; overflow-y: auto; padding-right: 4px; }
.price-header { display: flex; justify-content: space-between; align-items: center; padding: 0 20px 6px; font-size: 13px; color: var(--muted); letter-spacing: 1px; }
.price-item { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--border); }
.price-item .p-info { display: flex; flex-direction: column; }
.price-item .p-name { color: var(--text); font-size: 16px; font-weight: 700; letter-spacing: 0.5px; }
.price-item .p-sale { color: var(--gold); font-weight: 700; font-size: 16px; text-align: right; line-height: 1.6; }
.price-item .p-sale small { color: var(--muted); font-size: 12px; font-weight: 400; }
.usage-list { display: flex; flex-direction: column; gap: 14px; max-height: 64vh; overflow-y: auto; }
.usage-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.usage-summary .u-box { text-align: center; padding: 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--border); }
.usage-summary .u-box .u-label { color: var(--muted); font-size: 12px; }
.usage-summary .u-box .u-val { color: var(--gold); font-size: 18px; font-weight: 700; margin-top: 4px; }
.usage-summary .u-box .u-sub { color: var(--muted); font-size: 11px; margin-top: 2px; }
.usage-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.usage-table th, .usage-table td { padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: center; }
.usage-table th { color: var(--muted); font-weight: 500; }
.usage-table td { color: var(--text); }
.usage-table .u-model { text-align: left; color: var(--text); font-size: 15px; font-weight: 600; }
.usage-table .u-day { color: #ffd166; }
.usage-table .u-month { color: #4dd0e1; }
.usage-table .u-total { color: #ef83b6; }
.usage-empty { text-align: center; color: var(--muted); padding: 30px; }

/* 免费体验字数标签 - 大红色醒目 */
.free-chip {
  background: linear-gradient(135deg, #ff0000, #ff3333);
  color: #fff;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  margin-left: 8px;
  box-shadow: 0 0 10px rgba(255, 0, 0, 0.7), 0 0 20px rgba(255, 0, 0, 0.4);
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  animation: pulse-red 1.6s ease-in-out infinite;
  display: inline-block;
  vertical-align: middle;
}
@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 10px rgba(255,0,0,0.7), 0 0 20px rgba(255,0,0,0.4); transform: scale(1); }
  50% { box-shadow: 0 0 18px rgba(255,0,0,1), 0 0 32px rgba(255,0,0,0.6); transform: scale(1.03); }
}

/* 新用户首次登录豪华弹窗 */
.new-user-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; }
.new-user-modal.hidden { display: none; }
.new-user-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.72); backdrop-filter: blur(6px); animation: fadeIn 0.4s ease; }
.new-user-card { position: relative; width: 420px; max-width: 92vw; background: radial-gradient(circle at 30% 0%, #2a1a0a 0%, #1a110a 60%, #0d0a05 100%); border: 1px solid rgba(212, 175, 55, 0.5); border-radius: 20px; padding: 42px 34px; text-align: center; box-shadow: 0 0 0 1px rgba(212,175,55,0.15), 0 24px 60px rgba(0,0,0,0.7), 0 0 60px rgba(212, 175, 55, 0.25); animation: popIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
.new-user-card::before { content: ''; position: absolute; inset: -1px; border-radius: 20px; padding: 1px; background: linear-gradient(135deg, rgba(255,215,120,0.8), rgba(212,175,55,0.4), rgba(255,215,120,0.8)); -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.new-user-glow { position: absolute; top: -40px; left: 50%; transform: translateX(-50%); width: 120px; height: 120px; background: radial-gradient(circle, rgba(255,215,120,0.35) 0%, transparent 70%); filter: blur(20px); animation: glowPulse 2s ease-in-out infinite; }
.new-user-icon { font-size: 56px; line-height: 1; margin-bottom: 12px; animation: floatIcon 2.2s ease-in-out infinite; position: relative; z-index: 1; }
.new-user-card h2 { font-size: 22px; font-weight: 700; margin: 0 0 14px; background: linear-gradient(90deg, #ffd678, #d4af37, #ffd678); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.new-user-card p { color: #e0d0b0; font-size: 15px; line-height: 1.8; margin: 0 0 28px; }
.new-user-card .btn-gold { font-size: 16px; padding: 12px 36px; border-radius: 30px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(0.85) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes glowPulse { 0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); } 50% { opacity: 1; transform: translateX(-50%) scale(1.15); } }
@keyframes floatIcon { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* 续写设定弹窗 - 豪华风格 */
.continue-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; }
.continue-modal.hidden { display: none; }
.continue-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.72); backdrop-filter: blur(6px); animation: fadeIn 0.35s ease; }
.continue-card { position: relative; width: 540px; max-width: 94vw; max-height: 90vh; overflow-y: auto; background: radial-gradient(circle at 50% 0%, #241a0c 0%, #191206 55%, #0d0a04 100%); border: 1px solid rgba(212,175,55,0.45); border-radius: 22px; padding: 38px 34px 30px; box-shadow: 0 0 0 1px rgba(212,175,55,0.12), 0 24px 70px rgba(0,0,0,0.7), 0 0 70px rgba(212,175,55,0.22); animation: popIn 0.45s cubic-bezier(0.2,0.8,0.2,1); }
.continue-card::before { content: ''; position: absolute; inset: -1px; border-radius: 22px; padding: 1px; background: linear-gradient(135deg, rgba(255,215,120,0.75), rgba(212,175,55,0.35), rgba(255,215,120,0.75)); -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.continue-glow { position: absolute; top: -50px; left: 50%; transform: translateX(-50%); width: 160px; height: 90px; background: radial-gradient(circle, rgba(255,215,120,0.3) 0%, transparent 70%); filter: blur(24px); animation: glowPulse 2.4s ease-in-out infinite; }
.continue-title { position: relative; z-index: 1; text-align: center; font-size: 24px; font-weight: 700; margin: 0 0 8px; background: linear-gradient(90deg, #ffd678, #d4af37, #ffd678); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.continue-sub { position: relative; z-index: 1; text-align: center; color: #c9b48a; font-size: 13px; line-height: 1.6; margin: 0 0 22px; }
.continue-fields { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 16px; }
.cw-field { display: flex; flex-direction: column; gap: 6px; }
.cw-label { color: #e8d9b5; font-size: 14px; font-weight: 500; }
.cw-label::before { content: '◆ '; color: #d4af37; font-size: 11px; }
.cw-input { width: 100%; min-height: 72px; resize: vertical; background: rgba(20,14,6,0.7); border: 1px solid rgba(212,175,55,0.3); border-radius: 12px; padding: 12px 14px; color: #f0e6d2; font-size: 14px; line-height: 1.6; font-family: inherit; transition: border-color 0.2s, box-shadow 0.2s; }
.cw-input:focus { outline: none; border-color: rgba(212,175,55,0.8); box-shadow: 0 0 0 3px rgba(212,175,55,0.15); }
.cw-input::placeholder { color: #8a7550; }
.cw-empty { color: #9a875f; font-size: 14px; text-align: center; padding: 10px 0; }
.continue-foot { position: relative; z-index: 1; display: flex; gap: 14px; justify-content: center; margin-top: 26px; }
.continue-foot .btn-gold { font-size: 15px; padding: 11px 26px; border-radius: 30px; }
.continue-foot .btn-gold.ghost { background: transparent; border: 1px solid rgba(212,175,55,0.5); color: #e8d9b5; }
.continue-foot .btn-gold.ghost:hover { background: rgba(212,175,55,0.12); }

.continue-sub.blink-red {
  background: linear-gradient(135deg, #ff0000, #ff3333);
  color: #fff !important;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(255, 0, 0, 0.7), 0 0 20px rgba(255, 0, 0, 0.4);
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  animation: pulse-red 1.6s ease-in-out infinite;
  display: inline-block;
}

.chapter-modal { position: fixed; inset: 0; z-index: 210; display: flex; align-items: center; justify-content: center; }
.chapter-modal.hidden { display: none; }
.chapter-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.72); backdrop-filter: blur(6px); animation: fadeIn 0.35s ease; }
.chapter-card { position: relative; width: 1000px; max-width: 95vw; max-height: 95vh; display: flex; flex-direction: column; background: radial-gradient(circle at 50% 0%, #241a0c 0%, #191206 55%, #0d0a04 100%); border: 1px solid rgba(212,175,55,0.45); border-radius: 22px; padding: 30px 30px 24px; box-shadow: 0 0 0 1px rgba(212,175,55,0.12), 0 24px 70px rgba(0,0,0,0.7), 0 0 70px rgba(212,175,55,0.22); animation: popIn 0.45s cubic-bezier(0.2,0.8,0.2,1); }
.chapter-card::before { content: ''; position: absolute; inset: -1px; border-radius: 22px; padding: 1px; background: linear-gradient(135deg, rgba(255,215,120,0.75), rgba(212,175,55,0.35), rgba(255,215,120,0.75)); -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.chapter-glow { position: absolute; top: -50px; left: 50%; transform: translateX(-50%); width: 200px; height: 90px; background: radial-gradient(circle, rgba(255,215,120,0.3) 0%, transparent 70%); filter: blur(24px); animation: glowPulse 2.4s ease-in-out infinite; }
.chapter-head { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.chapter-title { margin: 0; font-size: 26px; font-weight: 700; background: linear-gradient(90deg, #ffd678, #d4af37, #ffd678); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
/* 统一弹窗关闭按钮 - 大红色闪烁 */
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #ff0000, #ff3333);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(255, 0, 0, 0.7), 0 0 20px rgba(255, 0, 0, 0.4);
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  animation: pulse-red 1.6s ease-in-out infinite;
  z-index: 10;
  transition: transform 0.15s, filter 0.15s;
}
.modal-close:hover {
  transform: scale(1.08);
  filter: brightness(1.15);
}
.chapter-head .modal-close,
.character-head .modal-close {
  position: static;
}
.chapter-body { position: relative; z-index: 1; display: flex; gap: 24px; min-height: 640px; }
.chapter-list-wrap { width: 270px; flex: 0 0 270px; display: flex; flex-direction: column; border-right: 1px solid rgba(212,175,55,0.2); padding-right: 16px; }
.chapter-list-head { color: #e8d9b5; font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.chapter-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; max-height: 640px; }
.chapter-item { display: flex; flex-direction: column; gap: 4px; padding: 13px 15px; border-radius: 10px; cursor: pointer; color: #d8c9a8; font-size: 15px; border: 1px solid transparent; transition: background 0.15s, border-color 0.15s; }
.chapter-item:hover { background: rgba(212,175,55,0.08); }
.chapter-item.active { background: rgba(212,175,55,0.16); border-color: rgba(212,175,55,0.5); color: #ffe9bf; }
.ci-title { font-weight: 500; line-height: 1.4; }
.ci-count { font-size: 13px; color: #9a875f; }
.chapter-empty-item { color: #9a875f; font-size: 13px; padding: 12px; text-align: center; }
.chapter-edit-wrap { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chapter-edit-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 12px; }
.chapter-cur-title { color: #ffd678; font-size: 17px; font-weight: 600; }
.chapter-editor { flex: 1; min-height: 580px; resize: vertical; background: rgba(20,14,6,0.7); border: 1px solid rgba(212,175,55,0.3); border-radius: 12px; padding: 18px 20px; color: #f0e6d2; font-size: 16px; line-height: 2.0; font-family: inherit; transition: border-color 0.2s, box-shadow 0.2s; }
.chapter-editor:focus { outline: none; border-color: rgba(212,175,55,0.8); box-shadow: 0 0 0 3px rgba(212,175,55,0.15); }
.chapter-editor::placeholder { color: #8a7550; }
.chapter-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.chapter-wordcount { color: #9a875f; font-size: 14px; }
.chapter-foot .btn-gold { font-size: 15px; padding: 11px 26px; border-radius: 30px; }

.toast-modal { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; }
.toast-modal.hidden { display: none; }
.toast-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.68); backdrop-filter: blur(4px); animation: fadeIn 0.25s ease; }
.toast-card { position: relative; min-width: 320px; max-width: 90vw; padding: 36px 32px 28px; border-radius: 20px; background: radial-gradient(circle at 50% 0%, #2b1f0d 0%, #191206 55%, #0d0a04 100%); border: 1px solid rgba(212,175,55,0.5); box-shadow: 0 0 0 1px rgba(212,175,55,0.1), 0 20px 60px rgba(0,0,0,0.65), 0 0 60px rgba(212,175,55,0.18); text-align: center; animation: popIn 0.35s cubic-bezier(0.2,0.8,0.2,1); }
.toast-card::before { content: ''; position: absolute; inset: -1px; border-radius: 20px; padding: 1px; background: linear-gradient(135deg, rgba(255,215,120,0.7), rgba(212,175,55,0.35), rgba(255,215,120,0.7)); -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.toast-icon { width: 52px; height: 52px; margin: 0 auto 16px; border-radius: 50%; background: linear-gradient(135deg, #d4af37, #b8860b); display: flex; align-items: center; justify-content: center; font-size: 26px; color: #1a1206; box-shadow: 0 0 16px rgba(212,175,55,0.45); }
.toast-message { color: #f0e6d2; font-size: 16px; line-height: 1.7; margin-bottom: 24px; }
.toast-btns { display: flex; justify-content: center; gap: 14px; }
.toast-ok { background: linear-gradient(135deg, #d4af37, #b8860b); color: #1a1206; border: none; padding: 11px 36px; border-radius: 30px; font-size: 15px; font-weight: 700; cursor: pointer; box-shadow: 0 0 16px rgba(212,175,55,0.35); transition: transform 0.15s, box-shadow 0.15s; }
.toast-ok:hover { transform: translateY(-2px); box-shadow: 0 4px 18px rgba(212,175,55,0.5); }
.toast-cancel { background: transparent; color: #c9b48a; border: 1px solid rgba(212,175,55,0.45); padding: 11px 36px; border-radius: 30px; font-size: 15px; font-weight: 700; cursor: pointer; transition: background 0.15s, color 0.15s; }
.toast-cancel:hover { background: rgba(212,175,55,0.12); color: #ffd678; }
.toast-cancel.hidden { display: none; }

.character-modal { position: fixed; inset: 0; z-index: 220; display: flex; align-items: center; justify-content: center; }
.character-modal.hidden { display: none; }
.character-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.72); backdrop-filter: blur(6px); animation: fadeIn 0.35s ease; }
.character-card { position: relative; width: 1080px; max-width: 96vw; max-height: 95vh; display: flex; flex-direction: column; background: radial-gradient(circle at 50% 0%, #241a0c 0%, #191206 55%, #0d0a04 100%); border: 1px solid rgba(212,175,55,0.45); border-radius: 22px; padding: 30px 30px 24px; box-shadow: 0 0 0 1px rgba(212,175,55,0.12), 0 24px 70px rgba(0,0,0,0.7), 0 0 70px rgba(212,175,55,0.22); animation: popIn 0.45s cubic-bezier(0.2,0.8,0.2,1); }
.character-card::before { content: ''; position: absolute; inset: -1px; border-radius: 22px; padding: 1px; background: linear-gradient(135deg, rgba(255,215,120,0.75), rgba(212,175,55,0.35), rgba(255,215,120,0.75)); -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); mask-composite: exclude; -webkit-mask-composite: xor; pointer-events: none; }
.character-glow { position: absolute; top: -50px; left: 50%; transform: translateX(-50%); width: 220px; height: 90px; background: radial-gradient(circle, rgba(255,215,120,0.3) 0%, transparent 70%); filter: blur(24px); animation: glowPulse 2.4s ease-in-out infinite; }
.character-head { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.character-title { margin: 0; font-size: 22px; font-weight: 700; background: linear-gradient(90deg, #ffd678, #d4af37, #ffd678); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.character-body { position: relative; z-index: 1; display: flex; gap: 20px; min-height: 380px; }
.character-list-wrap { width: 240px; flex: 0 0 240px; display: flex; flex-direction: column; border-right: 1px solid rgba(212,175,55,0.2); padding-right: 16px; }
.character-list-head { color: #e8d9b5; font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.character-list { list-style: none; margin: 0 0 10px; padding: 0; overflow-y: auto; flex: 1; max-height: 460px; }
.character-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; cursor: pointer; color: #d8c9a8; font-size: 13px; border: 1px solid transparent; transition: background 0.15s, border-color 0.15s; }
.character-item:hover { background: rgba(212,175,55,0.08); }
.character-item.active { background: rgba(212,175,55,0.16); border-color: rgba(212,175,55,0.5); color: #ffe9bf; }
.ci-name { font-weight: 500; line-height: 1.4; }
.ci-sub { font-size: 11px; color: #9a875f; }
.character-empty-item { color: #9a875f; font-size: 13px; padding: 12px; text-align: center; }
.character-list-actions { display: flex; flex-direction: column; gap: 8px; }
.character-edit-wrap { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.character-edit-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 12px; }
.character-cur-name { color: #ffd678; font-size: 15px; font-weight: 600; }
.character-fields { flex: 1; overflow-y: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; align-content: start; padding-right: 6px; max-height: 500px; }
.char-field { display: flex; flex-direction: column; gap: 4px; }
.char-field.full { grid-column: 1 / -1; }
.char-field label { color: #c9b48a; font-size: 12px; }
.char-field input, .char-field textarea { background: rgba(20,14,6,0.7); border: 1px solid rgba(212,175,55,0.3); border-radius: 10px; padding: 9px 12px; color: #f0e6d2; font-size: 14px; font-family: inherit; transition: border-color 0.2s, box-shadow 0.2s; }
.char-field input:focus, .char-field textarea:focus { outline: none; border-color: rgba(212,175,55,0.8); box-shadow: 0 0 0 3px rgba(212,175,55,0.15); }
.char-field textarea { resize: vertical; min-height: 64px; line-height: 1.6; }
.character-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.character-msg { color: #9a875f; font-size: 13px; }
.character-foot .btn-gold { font-size: 15px; padding: 11px 26px; border-radius: 30px; }

/* 充值/佣金弹窗 */
.rc-tabs { display:flex; gap:8px; margin-bottom:14px; border-bottom:1px solid var(--border); }
.rc-tab { flex:1; border:0; background:transparent; color:var(--muted); padding:10px; font-size:15px; cursor:pointer; border-bottom:2px solid transparent; }
.rc-tab.active { color:var(--gold); border-bottom-color:var(--gold); font-weight:600; }
.rc-pane { padding:4px 2px; }
.rc-tiers { display:flex; flex-wrap:wrap; gap:12px; margin-bottom:16px; }
.rc-tier { background:var(--panel); border:1px solid var(--border); border-radius:var(--radius); padding:14px 18px; cursor:pointer; text-align:center; color:var(--text); transition:.2s; min-width:120px; }
.rc-tier:hover { border-color:var(--gold); background:var(--gold-soft); }
.rc-tier-amt { font-size:20px; font-weight:700; color:var(--gold); }
.rc-tier-bonus { font-size:13px; color:var(--muted); margin-top:4px; }
.rc-tier-credits { font-size:12px; color:var(--muted); margin-top:2px; }
.rc-paytype { margin-bottom:14px; }
.rc-label { color:var(--muted); font-size:13px; margin-bottom:6px; }
.rc-pt { display:inline-flex; align-items:center; gap:6px; margin-right:18px; cursor:pointer; color:var(--text); font-size:14px; }
.rc-result { margin:8px 0; font-size:14px; }
.rc-qr-wrap { text-align:center; padding:10px; background:rgba(0,0,0,0.25); border:1px solid var(--border); border-radius:var(--radius); }
.rc-qr-title { color:var(--muted); font-size:13px; margin-bottom:10px; }
.rc-qr img { width:220px; height:220px; border-radius:10px; background:#fff; padding:6px; }
.rc-demo-note { color:var(--gold-2); padding:30px 10px; font-size:14px; }
.rc-order-info { color:var(--text); font-size:13px; margin:10px 0; line-height:1.7; }
.rc-url { font-size:12px; color:var(--muted); margin-top:8px; }
.rc-url a { color:var(--gold-2); }
.rc-row { display:flex; align-items:center; gap:12px; padding:8px 0; border-bottom:1px dashed var(--border); }
.rc-k { color:var(--muted); width:90px; flex-shrink:0; }
.rc-v { color:var(--text); font-weight:500; }
.rc-sub { color:var(--gold-2); font-size:14px; margin:16px 0 8px; }
.rc-qr-upload { display:flex; flex-wrap:wrap; align-items:center; gap:12px; }
.rc-qr-upload .qr-preview img { width:120px; height:120px; border-radius:10px; border:1px solid var(--border); background:#fff; object-fit:contain; display:none; }
.rc-withdraw { display:flex; flex-wrap:wrap; align-items:center; gap:12px; }
.rc-withdraw input { background:rgba(0,0,0,0.3); border:1px solid var(--border); color:var(--text); padding:8px 12px; border-radius:8px; width:240px; }
.ghost-btn.small { padding:4px 10px; font-size:12px; }
