/* ============ 墨笔AI 主样式 ============ */
:root {
  --bg: #f4f5ef;
  --bg2: #eceae0;
  --card: #ffffff;
  --card2: #f8f8f1;
  --line: #e3e2d4;
  --line2: #cfcebc;
  --txt: #1f2a24;
  --dim: #5c6a5f;
  --dim2: #8b978c;
  --brand1: #a8803f;
  --brand2: #c9a44e;
  --gold: #96762c;
  --green: #2c9c68;
  --red: #cf5c5c;
  --radius: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--txt);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px; line-height: 1.65;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
::selection { background: rgba(196,150,74,.35); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.main { padding-top: 28px; padding-bottom: 60px; min-height: 70vh; }
.dim { color: var(--dim); font-size: 13px; font-weight: 400; }
.plus { color: var(--green); } .minus { color: var(--red); }

/* ---- 顶栏 ---- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.88); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 26px; height: 60px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 17px; }
.brand-logo {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand1), var(--brand2));
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px; font-weight: 700;
  box-shadow: 0 4px 14px rgba(196,150,74,.4);
}
.brand-logo.big { width: 44px; height: 44px; font-size: 22px; border-radius: 12px; }
.brand-name { letter-spacing: .5px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { padding: 7px 14px; border-radius: 8px; color: var(--dim); font-size: 14px; transition: .15s; }
.nav a:hover { color: var(--txt); background: var(--card); }
.nav a.on { color: #8a6524; background: rgba(196,150,74,.12); box-shadow: inset 0 0 0 1px rgba(196,150,74,.4); }
.ops { display: flex; align-items: center; gap: 10px; }
.points-pill {
  background: linear-gradient(135deg, rgba(232,200,126,.16), rgba(232,200,126,.08));
  color: var(--gold); border: 1px solid rgba(232,200,126,.3);
  padding: 4px 12px; border-radius: 99px; font-size: 13px; font-weight: 600;
}
.user-menu { position: relative; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 5px 8px; border-radius: 9px; }
.user-menu:hover { background: var(--card); }
.user-menu .avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--card2); }
.user-menu .uname { font-size: 13px; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu .dropdown {
  position: absolute; top: 110%; right: 0; min-width: 150px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 6px; display: none; flex-direction: column; box-shadow: 0 12px 40px rgba(40,55,45,.16);
}
.user-menu:hover .dropdown { display: flex; }
.user-menu .dropdown a { padding: 8px 12px; border-radius: 7px; font-size: 13px; color: var(--dim); }
.user-menu .dropdown a:hover { background: var(--card2); color: var(--txt); }

/* ---- 按钮 ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: 9px; font-size: 14px; font-weight: 500;
  border: 1px solid transparent; cursor: pointer; transition: .15s; white-space: nowrap;
  background: var(--card2); color: var(--txt);
}
.btn.primary { background: linear-gradient(135deg, var(--brand1), var(--brand2)); color: #fff; box-shadow: 0 4px 16px rgba(196,150,74,.35); }
.btn.primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn.ghost { background: transparent; border-color: var(--line2); color: var(--dim); }
.btn.ghost:hover { color: var(--txt); border-color: var(--brand1); }
.btn.big { padding: 13px 28px; font-size: 15px; border-radius: 11px; }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 7px; }
.btn.block { width: 100%; }
.btn.danger, .btn.ghost.danger { color: var(--red); border-color: rgba(255,128,128,.4); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---- 落地页 ---- */
.hero { padding: 70px 20px 60px; text-align: center; position: relative; overflow: hidden; }
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% -10%, rgba(196,150,74,.22), transparent),
              radial-gradient(ellipse 40% 40% at 80% 30%, rgba(220,187,122,.14), transparent);
  pointer-events: none;
}
.hero-inner { position: relative; max-width: 760px; margin: 0 auto; }
.hero-badge {
  display: inline-block; padding: 5px 14px; border-radius: 99px; font-size: 13px;
  background: rgba(196,150,74,.14); color: #ecd9a8; border: 1px solid rgba(196,150,74,.35);
  margin-bottom: 22px;
}
.hero h1 { font-size: 52px; line-height: 1.2; font-weight: 800; letter-spacing: 1px; }
.hero h1 .grad { background: linear-gradient(135deg, var(--brand1), #dcbb7a, var(--brand2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { color: var(--dim); margin: 20px 0 30px; font-size: 16px; }
.hero-cta { display: flex; gap: 14px; justify-content: center; }
.hero-stats { display: flex; gap: 40px; justify-content: center; margin-top: 46px; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats b { font-size: 26px; color: var(--txt); }
.hero-stats span { font-size: 12px; color: var(--dim2); }

.feats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 30px auto 60px; }
.feat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; transition: .2s; }
.feat:hover { border-color: var(--line2); transform: translateY(-3px); }
.feat-ico { font-size: 30px; margin-bottom: 12px; }
.feat h3 { font-size: 16px; margin-bottom: 8px; }
.feat p { color: var(--dim); font-size: 13px; }

.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; }
.sec-head h2 { font-size: 22px; }
.more { color: var(--brand1); font-size: 13px; }
.more:hover { text-decoration: underline; }

.grid-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.wcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: .2s; display: block; }
.wcard:hover { transform: translateY(-4px); border-color: var(--line2); box-shadow: 0 14px 40px rgba(50,70,55,.14); }
.wcard-cover { height: 130px; position: relative; display: flex; align-items: flex-end; padding: 14px; }
.wcard-cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 40%, rgba(0,0,0,.45)); }
.wcard-genre {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  background: rgba(0,0,0,.4); backdrop-filter: blur(4px);
  padding: 3px 10px; border-radius: 99px; font-size: 12px;
}
.wcard-title { position: relative; z-index: 2; font-size: 19px; font-weight: 700; text-shadow: 0 2px 8px rgba(0,0,0,.5); }
.wcard-body { padding: 14px 16px 16px; }
.wcard-body h4 { font-size: 15px; margin-bottom: 6px; }
.wcard-body p { color: var(--dim); font-size: 13px; height: 40px; overflow: hidden; }
.wcard-meta { margin-top: 10px; font-size: 12px; color: var(--dim2); }

.cta-bar { background: linear-gradient(135deg, rgba(196,150,74,.14), rgba(220,187,122,.14)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 54px 20px; text-align: center; margin-top: 40px; }
.cta-bar h2 { font-size: 28px; margin-bottom: 8px; }
.cta-bar p { color: var(--dim); margin-bottom: 22px; }

.footer { border-top: 1px solid var(--line); padding: 26px 0; text-align: center; color: var(--dim2); font-size: 13px; }

/* ---- 工作台 ---- */
.notice-bar {
  background: linear-gradient(135deg, rgba(232,200,126,.12), rgba(232,200,126,.06));
  border: 1px solid rgba(232,200,126,.3); color: #ffe6a8;
  padding: 10px 16px; border-radius: 10px; margin-bottom: 20px; font-size: 13px;
}
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 22px; }
.dash-head h1 { font-size: 26px; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat-row.four { grid-template-columns: repeat(4, 1fr); }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.stat b { font-size: 24px; display: block; color: var(--txt); }
.stat span { font-size: 12px; color: var(--dim); }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 20px; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.panel-head h3 { font-size: 15px; }
.pad { padding: 20px; }
.pad-top { padding-top: 14px; }

.task-line { padding: 10px 20px; border-bottom: 1px solid var(--line); }
.task-line:last-child { border-bottom: none; }
.tl-info { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 7px; }
.tl-type { color: #ecd9a8; font-weight: 600; }
.tl-step { color: var(--dim); }
.tl-bar { height: 6px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.tl-fill { height: 100%; background: linear-gradient(90deg, var(--brand1), var(--brand2)); border-radius: 99px; transition: width .4s; }

.work-list { padding: 6px 0; }
.work-row { display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.work-row:last-child { border-bottom: none; }
.work-row:hover { background: var(--card2); }
.wr-cover { width: 42px; height: 56px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; color: rgba(255,255,255,.9); flex-shrink: 0; }
.wr-main { flex: 1; min-width: 0; }
.wr-title { font-size: 15px; font-weight: 600; display: block; margin-bottom: 3px; }
.wr-title:hover { color: var(--brand1); }
.wr-meta { display: flex; gap: 10px; align-items: center; font-size: 12px; color: var(--dim); flex-wrap: wrap; }
.wr-ops { display: flex; gap: 8px; }

.empty { padding: 46px 20px; text-align: center; }
.empty.sm { padding: 24px; }
.empty-ico { font-size: 40px; margin-bottom: 12px; }
.empty p { color: var(--dim); margin-bottom: 14px; font-size: 14px; }

/* ---- 表格/标签/状态 ---- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; padding: 10px 14px; color: var(--dim); font-weight: 500; font-size: 12px; border-bottom: 1px solid var(--line); background: #f3f2ea; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: rgba(196,150,74,.04); }
.tag { display: inline-block; padding: 2px 9px; border-radius: 6px; background: rgba(196,150,74,.15); color: #ecd9a8; font-size: 12px; }
.tag.gold { background: rgba(232,200,126,.15); color: var(--gold); }
.st { font-size: 12px; padding: 2px 9px; border-radius: 6px; }
.st-0 { background: rgba(138,148,173,.15); color: var(--dim); }
.st-1 { background: rgba(196,150,74,.18); color: #ecd9a8; }
.st-2 { background: rgba(93,211,158,.15); color: var(--green); }
.st-3 { background: rgba(255,128,128,.15); color: var(--red); }
.err-line { color: var(--red); font-size: 12px; }

/* ---- 表单 ---- */
label { display: block; font-size: 13px; color: var(--dim); margin: 14px 0 6px; }
input, textarea, select, .sel {
  width: 100%; padding: 10px 13px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; color: var(--txt); font-size: 14px; outline: none; transition: .15s;
  font-family: inherit;
}
input:focus, textarea:focus, select:focus { border-color: var(--brand1); box-shadow: 0 0 0 3px rgba(196,150,74,.15); }
textarea { resize: vertical; line-height: 1.7; }
.form-err, .auth-err { color: var(--red); font-size: 13px; margin-top: 10px; min-height: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 18px; }

/* ---- 创作向导 ---- */
.guide-steps { display: flex; gap: 10px; margin-bottom: 20px; }
.gs { flex: 1; text-align: center; padding: 10px; border-radius: 9px; background: var(--card); border: 1px solid var(--line); color: var(--dim); font-size: 13px; }
.gs b { display: inline-block; width: 20px; height: 20px; line-height: 20px; border-radius: 50%; background: var(--line); color: var(--txt); font-size: 12px; margin-right: 6px; }
.gs.on { color: #8a6524; border-color: var(--brand1); background: rgba(196,150,74,.10); }
.gs.on b { background: linear-gradient(135deg, var(--brand1), var(--brand2)); }
.guide-pane { display: none; }
.guide-pane.on { display: block; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 15px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line);
  color: var(--dim); font-size: 13px; cursor: pointer; transition: .15s;
}
.chip:hover { color: var(--txt); border-color: var(--line2); }
.chip.on { background: linear-gradient(135deg, rgba(196,150,74,.25), rgba(220,187,122,.25)); border-color: var(--brand1); color: #8a6524; }
.guide-btns { display: flex; justify-content: space-between; margin-top: 24px; }
.cost-box { background: var(--bg); border: 1px dashed var(--line2); border-radius: 10px; padding: 14px 16px; margin-top: 18px; font-size: 13px; }
.cost-box b { color: var(--gold); }

/* ---- 大纲页 ---- */
.gen-status { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.gen-spinner {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  border: 3px solid var(--line); border-top-color: var(--brand1);
  animation: spin 1s linear infinite;
}
.gen-spinner.big { width: 44px; height: 44px; margin: 0 auto 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
.gen-step { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.ol-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.ol-editor {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px; font-size: 14px; line-height: 1.8; color: var(--txt);
  font-family: "SF Mono", Consolas, "Courier New", monospace;
}

/* ---- 作品管理 ---- */
.work-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.work-ops { display: flex; gap: 8px; }
.work-layout { display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: start; }
.ch-list { position: sticky; top: 84px; max-height: calc(100vh - 110px); display: flex; flex-direction: column; }
.ch-items { overflow-y: auto; }
.ch-item { display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.ch-item:last-child { border-bottom: none; }
.ch-item.on { background: rgba(196,150,74,.12); }
.ch-item:hover { background: var(--card2); }
.ch-title { flex: 1; display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-size: 13px; min-width: 0; }
.ch-no { color: var(--dim2); font-size: 12px; min-width: 18px; }
.ch-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-words { font-size: 11px; }
.ch-tools { display: none; gap: 2px; padding-right: 8px; }
.ch-item:hover .ch-tools { display: flex; }
.ch-tools button { background: none; border: none; color: var(--dim2); cursor: pointer; padding: 3px 5px; font-size: 12px; border-radius: 5px; }
.ch-tools button:hover { color: var(--txt); background: var(--line); }

.editor { min-height: 480px; display: flex; flex-direction: column; }
.ed-head { display: flex; gap: 12px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.ed-title { flex: 1; background: transparent; border: none; font-size: 17px; font-weight: 700; padding: 4px 0; }
.ed-title:focus { box-shadow: none; }
.ed-ops { display: flex; align-items: center; gap: 12px; font-size: 12px; }
.ed-area {
  flex: 1; min-height: 420px; background: transparent; border: none; border-radius: 0;
  padding: 18px; font-size: 15px; line-height: 1.9; resize: vertical;
}
.ed-area:focus { box-shadow: none; }
.ai-bar { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); background: #f6f5ee; flex-wrap: wrap; }
.ai-bar-label { font-size: 12px; color: var(--gold); font-weight: 600; margin-right: 4px; }
.ai-btn {
  padding: 6px 14px; border-radius: 99px; font-size: 13px; cursor: pointer;
  background: linear-gradient(135deg, rgba(196,150,74,.18), rgba(220,187,122,.18));
  border: 1px solid rgba(196,150,74,.4); color: #8a6524; transition: .15s;
}
.ai-btn:hover { color: #6b4f16; border-color: var(--brand1); transform: translateY(-1px); }
.ai-btn.danger { background: rgba(255,128,128,.1); border-color: rgba(255,128,128,.4); color: var(--red); }
.work-settings summary { cursor: pointer; font-size: 14px; color: var(--dim); }
.work-settings summary:hover { color: var(--txt); }

/* ---- 模态 ---- */
.modal-mask { position: fixed; inset: 0; background: rgba(35,50,40,.38); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 20px; }
.modal { background: var(--card); border: 1px solid var(--line2); border-radius: 14px; padding: 26px; width: 100%; max-width: 420px; }
.modal h3 { margin-bottom: 6px; }
.modal p { margin-bottom: 14px; }
.modal-ops { display: flex; justify-content: flex-end; margin-top: 16px; }

/* ---- 分页 ---- */
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 26px; }
.pager-n { padding: 6px 13px; border-radius: 7px; background: var(--card); border: 1px solid var(--line); font-size: 13px; color: var(--dim); }
.pager-n.on { background: var(--brand1); color: #fff; border-color: var(--brand1); }

/* ---- 登录注册 ---- */
.auth-page { min-height: calc(100vh - 200px); display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 36px; text-align: center; }
.auth-brand { margin-bottom: 16px; }
.auth-card h1 { font-size: 22px; }
.auth-card .dim { margin-bottom: 6px; }
.auth-card form { text-align: left; margin-top: 18px; }
.auth-tip { background: rgba(93,211,158,.12); border: 1px solid rgba(93,211,158,.35); color: var(--green); border-radius: 8px; padding: 8px 12px; font-size: 13px; margin: 12px 0; }
.auth-alt { margin-top: 18px; font-size: 13px; color: var(--dim); }
.auth-alt a { color: var(--brand1); }

/* ---- 广场 ---- */
.square-filter { margin-bottom: 22px; }

/* ---- 后台 ---- */
.admin-body { display: block; }
.admin-shell { display: grid; grid-template-columns: 210px 1fr; min-height: 100vh; }
.admin-side { background: var(--bg2); border-right: 1px solid var(--line); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-side .brand { margin-bottom: 20px; padding-left: 6px; }
.admin-side nav { display: flex; flex-direction: column; gap: 2px; }
.admin-side nav a { padding: 9px 12px; border-radius: 8px; font-size: 13px; color: var(--dim); }
.admin-side nav a:hover { background: var(--card); color: var(--txt); }
.admin-side nav a.on { background: rgba(196,150,74,.16); color: #8a6524; }
.admin-main { padding: 24px 28px 60px; }
.admin-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 20px; }
.no-head .admin-head { display: none; }
.admin-head h2 { font-size: 21px; }
.admin-user { color: var(--dim); font-size: 13px; }
.admin-msg { background: rgba(93,211,158,.12); border: 1px solid rgba(93,211,158,.35); color: var(--green); padding: 10px 16px; border-radius: 9px; margin-bottom: 16px; font-size: 13px; }
.quick-links { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; padding: 16px 20px 20px; }
.ql { background: var(--card2); border: 1px solid var(--line); border-radius: 10px; padding: 14px 8px; text-align: center; font-size: 13px; color: var(--dim); line-height: 1.5; }
.ql:hover { border-color: var(--brand1); color: var(--txt); }
.inline-form { display: inline-flex; gap: 6px; align-items: center; margin-right: 6px; }
.mini-in { width: 80px; padding: 5px 8px; font-size: 12px; }
.mini-sel { width: auto; padding: 5px 8px; font-size: 12px; }
.ops { white-space: nowrap; }
.prompt-block { border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.pb-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.pb-name { max-width: 300px; margin-bottom: 10px; }
.pb-content { font-family: "SF Mono", Consolas, monospace; font-size: 13px; }
.pb-ops { display: flex; gap: 8px; margin-top: 10px; }

/* ---- 响应式 ---- */
@media (max-width: 960px) {
  .feats { grid-template-columns: repeat(2, 1fr); }
  .grid-cards { grid-template-columns: repeat(2, 1fr); }
  .work-layout { grid-template-columns: 1fr; }
  .ch-list { position: static; max-height: 300px; }
  .stat-row, .stat-row.four { grid-template-columns: repeat(2, 1fr); }
  .quick-links { grid-template-columns: repeat(3, 1fr); }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; display: flex; flex-wrap: wrap; gap: 4px; }
  .admin-side nav { flex-direction: row; flex-wrap: wrap; }
}
@media (max-width: 640px) {
  .hero h1 { font-size: 34px; }
  .hero-stats { gap: 20px; }
  .feats, .grid-cards { grid-template-columns: 1fr; }
  .nav { display: none; }
  .topbar .wrap { gap: 12px; }
  .form-grid { grid-template-columns: 1fr; }
  .work-head { flex-direction: column; align-items: flex-start; }
  .tbl { font-size: 12px; }
  .tbl th, .tbl td { padding: 8px 10px; }
}

/* ============ 前台介绍落地页 ============ */
.lp-body { background: var(--bg); }
.lp-page { padding-top: 0; }
.lp-hero { position: relative; padding: 84px 20px 70px; overflow: hidden; }
.lp-hero-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(600px 340px at 18% 12%, rgba(196,150,74,.20), transparent 62%),
    radial-gradient(700px 420px at 82% 78%, rgba(220,187,122,.17), transparent 60%),
    radial-gradient(420px 300px at 60% 8%, rgba(56,189,248,.10), transparent 65%);
}
.lp-hero-bg::after {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(196,150,74,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(196,150,74,.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 76% 60% at 50% 38%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 76% 60% at 50% 38%, #000 30%, transparent 75%);
}
.lp-hero-inner { position: relative; display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.lp-badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #8a6524;
  background: rgba(196,150,74,.13); border: 1px solid rgba(196,150,74,.35);
  padding: 6px 14px; border-radius: 99px; margin-bottom: 22px;
}
.lp-hero-text h1 { font-size: 54px; line-height: 1.14; font-weight: 800; letter-spacing: 1px; margin-bottom: 20px; }
.lp-hero-text h1 .grad { background: linear-gradient(120deg, #9a742e, #c9a44e, #a8803f); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lp-sub { color: var(--dim); font-size: 16px; line-height: 1.75; margin-bottom: 32px; }
.lp-hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.lp-note { color: var(--dim2); font-size: 12.5px; margin-top: 18px; }
.lp-hero-img { position: relative; }
.lp-hero-img::before {
  content: ''; position: absolute; inset: -8%; border-radius: 26px;
  background: radial-gradient(closest-side, rgba(196,150,74,.22), transparent 72%);
  filter: blur(28px); z-index: 0;
}
.lp-hero-img img {
  position: relative; z-index: 1; width: 100%; border-radius: 20px; display: block;
  border: 1px solid rgba(196,150,74,.28);
  box-shadow: 0 24px 70px rgba(50,70,55,.22);
}
.lp-stats { border-block: 1px solid var(--line); background: rgba(196,150,74,.05); }
.lp-stats-inner { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; padding: 26px 20px; text-align: center; }
.lp-stat b { display: block; font-size: 30px; font-weight: 800; background: linear-gradient(135deg, #a87c33, #c9a44e); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lp-stat span { font-size: 12.5px; color: var(--dim2); }
.lp-sec { padding: 74px 20px; }
.lp-sec-alt { background: linear-gradient(180deg, transparent, rgba(196,150,74,.045) 18%, rgba(196,150,74,.045) 82%, transparent); }
.lp-sec-head { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.lp-sec-head h2 { font-size: 30px; font-weight: 800; letter-spacing: .5px; margin-bottom: 10px; }
.lp-sec-head p { color: var(--dim); font-size: 14.5px; }
.lp-feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.lp-feat {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  transition: transform .22s, border-color .22s, box-shadow .22s;
}
.lp-feat:hover { transform: translateY(-5px); border-color: rgba(196,150,74,.45); box-shadow: 0 18px 46px rgba(50,70,55,.16); }
.lp-feat-img { aspect-ratio: 16/10; background: #f6f1e3; overflow: hidden; }
.lp-feat-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s; }
.lp-feat:hover .lp-feat-img img { transform: scale(1.05); }
.lp-feat h3 { font-size: 17px; padding: 20px 22px 8px; }
.lp-feat p { color: var(--dim); font-size: 13.5px; line-height: 1.7; padding: 0 22px 24px; }
.lp-flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; counter-reset: step; }
.lp-step {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 15px; padding: 26px 20px 22px;
  transition: border-color .2s, transform .2s;
}
.lp-step:hover { border-color: rgba(196,150,74,.45); transform: translateY(-3px); }
.lp-step-n {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  font-size: 17px; font-weight: 800; color: #fff; margin-bottom: 14px;
  background: linear-gradient(135deg, var(--brand1), var(--brand2));
  box-shadow: 0 6px 18px rgba(196,150,74,.35);
}
.lp-step h3 { font-size: 15.5px; margin-bottom: 7px; }
.lp-step p { color: var(--dim); font-size: 12.5px; line-height: 1.65; }
.lp-step:not(:last-child)::after {
  content: '→'; position: absolute; right: -13px; top: 44px; color: var(--dim2); font-size: 15px; z-index: 1;
}
.lp-providers { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.lp-provider {
  padding: 10px 20px; border-radius: 11px; font-size: 13.5px; color: var(--dim);
  background: var(--card); border: 1px solid var(--line); transition: .18s;
}
.lp-provider:hover { border-color: rgba(196,150,74,.5); color: var(--txt); transform: translateY(-2px); }
.lp-cta { text-align: center; padding: 88px 20px 96px; position: relative; overflow: hidden; }
.lp-cta::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(560px 300px at 50% 62%, rgba(196,150,74,.16), transparent 68%);
}
.lp-cta h2 { position: relative; font-size: 34px; font-weight: 800; line-height: 1.3; margin-bottom: 28px; }
.lp-cta .btn { position: relative; }
.lp-cta .lp-note { position: relative; margin-top: 16px; }
@media (max-width: 960px) {
  .lp-hero-inner { grid-template-columns: 1fr; gap: 34px; }
  .lp-hero-text h1 { font-size: 40px; }
  .lp-hero-img { max-width: 560px; margin: 0 auto; }
  .lp-feats { grid-template-columns: 1fr; }
  .lp-flow { grid-template-columns: repeat(2, 1fr); }
  .lp-step:nth-child(2)::after { display: none; }
  .lp-stats-inner { grid-template-columns: repeat(2, 1fr); gap: 22px; }
  .lp-sec { padding: 52px 20px; }
}
@media (max-width: 560px) {
  .lp-flow { grid-template-columns: 1fr; }
  .lp-step::after { display: none !important; }
  .lp-hero-text h1 { font-size: 33px; }
}

/* ============ 后台视觉美化 ============ */
.admin-shell { grid-template-columns: 232px 1fr; }
.admin-side {
  background: #ffffff;
  border-right: 1px solid var(--line);
  padding: 20px 14px; display: flex; flex-direction: column;
  box-shadow: 1px 0 8px rgba(50,70,55,.04);
}
.admin-side .brand { padding: 2px 6px 18px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.admin-side .brand-logo { box-shadow: 0 4px 14px rgba(196,150,74,.4); }
.admin-side nav { display: flex; flex-direction: column; gap: 3px; }
.admin-side nav a {
  display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-radius: 10px;
  font-size: 13.5px; color: var(--dim); transition: .16s; border: 1px solid transparent;
}
.admin-side nav a:hover { background: rgba(196,150,74,.09); color: var(--txt); }
.admin-side nav a.on {
  background: linear-gradient(135deg, rgba(196,150,74,.16), rgba(196,150,74,.07));
  color: #8a6524; border-color: rgba(196,150,74,.38); font-weight: 600;
}
.admin-side .side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; }
.admin-main { padding: 12px 24px 40px; display: flex; flex-direction: column; }
.admin-head h2 { font-size: 23px; font-weight: 700; letter-spacing: .3px; }
.admin-head .dim { font-size: 13px; }
.admin-user { color: var(--dim); font-size: 12.5px; background: var(--card); border: 1px solid var(--line); padding: 5px 12px; border-radius: 99px; }
.admin-msg { background: rgba(93,211,158,.10); border: 1px solid rgba(93,211,158,.32); color: var(--green); padding: 11px 16px; border-radius: 11px; margin-bottom: 18px; font-size: 13px; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 10px; }
.stat {
  background: linear-gradient(180deg, var(--card), rgba(196,150,74,.05));
  border: 1px solid var(--line); border-radius: 13px; padding: 10px 14px; transition: .18s;
}
.stat:hover { border-color: rgba(196,150,74,.4); transform: translateY(-2px); }
.stat b { display: block; font-size: 20px; font-weight: 800; color: var(--txt); line-height: 1.15; }
.stat span { font-size: 12.5px; color: var(--dim2); }
.panel { border-radius: 15px; box-shadow: 0 8px 28px rgba(50,70,55,.10); }
.panel-head { padding: 10px 16px; background: #f8f7f0; }
.panel-head h3 { font-size: 13.5px; font-weight: 600; letter-spacing: .2px; }
.more { color: #8a6524; font-size: 12.5px; }
.more:hover { color: #6b4f16; }
.tbl th { background: #f2f1e8; font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; padding: 11px 16px; }
.tbl td { padding: 12px 16px; }
.tbl tbody tr { transition: background .12s; }
.tag { font-size: 11.5px; padding: 2px 9px; border-radius: 6px; background: rgba(196,150,74,.14); color: #8a6524; border: 1px solid rgba(196,150,74,.22); }
.st { font-size: 11.5px; padding: 3px 10px; border-radius: 99px; font-weight: 500; }
.btn { border-radius: 9px; font-weight: 500; }
.btn.primary { box-shadow: 0 4px 14px rgba(196,150,74,.32); }
.btn.ghost:hover { background: rgba(196,150,74,.10); }
.form-row { display: grid; grid-template-columns: 150px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: start; }
.form-row:last-child { border-bottom: none; }
.form-row > label { color: var(--dim); font-size: 13px; padding-top: 9px; }
input[type=text], input[type=password], input[type=number], select, textarea {
  background: #ffffff; border: 1px solid var(--line2); color: var(--txt);
  border-radius: 9px; padding: 9px 13px; font-size: 13.5px; transition: .15s; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand1); outline: none; box-shadow: 0 0 0 3px rgba(196,150,74,.18); }
.ol-editor, textarea { line-height: 1.7; }
.quick-links { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; padding: 18px 20px 22px; }
.ql {
  display: grid; place-items: center; gap: 8px; padding: 18px 10px; border-radius: 13px; font-size: 12.5px;
  background: rgba(196,150,74,.07); border: 1px solid var(--line); color: var(--dim); transition: .18s; text-align: center;
}
.ql:hover { background: rgba(196,150,74,.14); border-color: rgba(196,150,74,.42); color: #8a6524; transform: translateY(-2px); }
.tl-bar { height: 5px; border-radius: 99px; background: #e9e8dd; overflow: hidden; margin-top: 8px; }
.tl-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand1), var(--brand2)); transition: width .4s; }
.work-row { border: 1px solid var(--line); border-radius: 13px; padding: 13px 15px; margin-bottom: 10px; background: #faf9f3; transition: .16s; }
.work-row:hover { border-color: rgba(196,150,74,.35); }
.empty { padding: 30px 18px; text-align: center; }
.empty-ico { font-size: 40px; margin-bottom: 12px; }
.empty p { color: var(--dim); font-size: 13.5px; margin-bottom: 18px; }
.empty.slim { padding: 13px 14px; }
.empty.slim p { margin-bottom: 0; }

/* ---- 仪表盘：欢迎横幅 ---- */
.welcome {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  background: linear-gradient(120deg, rgba(196,150,74,.16), rgba(220,187,122,.07) 55%, rgba(108,201,155,.08));
  border: 1px solid rgba(196,150,74,.28); border-radius: 16px;
  padding: 11px 18px; margin-bottom: 11px; position: relative; overflow: hidden;
}
.welcome::after {
  content: ''; position: absolute; right: -60px; top: -80px; width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(220,187,122,.22), transparent 70%);
}
.welcome-txt h2 { font-size: 19px; font-weight: 800; letter-spacing: .3px; }
.welcome-txt p { color: var(--dim); font-size: 12.5px; margin-top: 2px; }
.welcome-side { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.welcome-date, .welcome-user { color: var(--dim); font-size: 12px; background: #ffffff; border: 1px solid var(--line2); padding: 4px 12px; border-radius: 99px; white-space: nowrap; }

/* ---- 仪表盘：次级统计胶囊 ---- */
.stat-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.pill {
  font-size: 12px; color: var(--dim); background: #ffffff;
  border: 1px solid var(--line); border-radius: 99px; padding: 4px 13px;
}
.pill b { color: var(--txt); font-weight: 600; margin-left: 2px; }

/* ---- 仪表盘：左列分组（窄屏纵堆 / 宽屏横排）---- */
.dash-lgroup { display: flex; flex-direction: column; gap: 11px; min-width: 0; }
.dash-lgroup > .dash-col { flex: 1 1 auto; }

/* ---- 仪表盘：双列 ---- */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 14px; align-items: stretch; flex: 1 0 auto; }
.dash-col { min-width: 0; display: flex; flex-direction: column; gap: 11px; }
.dash-col > .panel, .dash-col > .start-card { flex: 1 1 auto; margin-bottom: 0; }
.panel { display: flex; flex-direction: column; }
.panel > *:not(.panel-head) { flex: 1 1 auto; }
.empty.slim { display: grid; place-items: center; }
.quick-links { align-content: center; }
.pv-grid { align-content: center; }
.tip-list { display: flex; flex-direction: column; justify-content: space-around; padding: 12px 20px 12px 36px; }
.sys-wrap { display: flex; flex-direction: column; justify-content: space-around; }
.tbl td[colspan] { padding: 24px 14px; text-align: center; }

/* ---- 仪表盘：创作引导卡 ---- */
.start-card {
  background: linear-gradient(160deg, var(--card), rgba(196,150,74,.06));
  border: 1px solid rgba(196,150,74,.30); border-radius: 15px;
  padding: 14px 16px; margin-bottom: 0; box-shadow: 0 8px 28px rgba(50,70,55,.10);
  display: flex; flex-direction: column; justify-content: center;
}
.start-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.start-ico {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  background: linear-gradient(135deg, var(--brand1), var(--brand2));
  display: grid; place-items: center; font-size: 18px;
  box-shadow: 0 4px 16px rgba(196,150,74,.35);
}
.start-card-head h3 { font-size: 16px; font-weight: 700; }
.start-card-head p { font-size: 12.5px; margin-top: 2px; }
.start-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 10px; }
.start-step {
  background: #f7f6ef; border: 1px solid var(--line); border-radius: 11px;
  padding: 9px 10px; text-align: center; position: relative;
}
.start-step b {
  display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(196,150,74,.16); color: #8a6524; font-size: 11px; margin-bottom: 4px;
  border: 1px solid rgba(196,150,74,.35);
}
.start-step span { display: block; font-size: 13px; font-weight: 600; }
.start-step em { display: block; font-style: normal; font-size: 11.5px; color: var(--dim2); margin-top: 3px; }
.start-step:not(:last-child)::after {
  content: '→'; position: absolute; right: -10px; top: 50%; transform: translateY(-50%);
  color: rgba(196,150,74,.55); font-size: 13px; z-index: 1;
}

/* ---- 仪表盘：提示面板 ---- */
.tip-list { padding: 8px 16px 10px 32px; }
.tip-list li { color: var(--dim); font-size: 12.5px; line-height: 1.55; }
.tip-list li::marker { color: #a87c33; }

/* 窄列内的快捷入口改 3 列 */
.dash-col .quick-links { grid-template-columns: repeat(3, 1fr); gap: 10px; }
.dash-col .ql { padding: 14px 6px; font-size: 12px; }

/* ---- 供应商状态 / 系统信息面板 ---- */
.pv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; padding: 4px 16px 8px; }
.pv-cell { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 3px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.pv-cell:nth-last-child(-n+2) { border-bottom: none; }
.pv-name { display: flex; align-items: center; gap: 7px; min-width: 0; }
.pv-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.pv-on { background: var(--green); box-shadow: 0 0 0 3px rgba(44,156,104,.15); }
.pv-off { background: var(--dim2); }
.pv-cell .dim { font-size: 11px; white-space: nowrap; }
.sys-row { display: flex; justify-content: space-between; padding: 5px 16px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.sys-row:last-child { border-bottom: none; }
.sys-row span:first-child { color: var(--dim); }
.sys-row span:last-child { font-weight: 500; }
.panel-foot-link { display: block; padding: 7px 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: #8a6524; background: #faf9f3; }
.panel-foot-link:hover { background: rgba(196,150,74,.10); }

/* 宽屏（≥1760px，覆盖 1920/2560 显示器）：三列布局 + 右列加宽 */
@media (min-width: 1760px) {
  .dash-lgroup { flex-direction: row; }
  .dash-lgroup > .dash-col { flex: 1 1 0; }
  .dash-grid { grid-template-columns: minmax(0, 1fr) 480px; }
}

@media (max-width: 960px) {
  .dash-grid { grid-template-columns: 1fr; }
  .welcome { flex-direction: column; align-items: flex-start; gap: 14px; }
  .start-steps { grid-template-columns: 1fr; }
  .start-step:not(:last-child)::after { content: '↓'; right: 50%; top: auto; bottom: -13px; transform: translateX(50%); }
}

/* 后台登录页美化 */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; position: relative; overflow: hidden; }
.auth-wrap::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(700px 420px at 20% 18%, rgba(196,150,74,.14), transparent 62%),
    radial-gradient(700px 460px at 84% 82%, rgba(220,187,122,.12), transparent 60%);
}
.auth-card {
  position: relative; width: 100%; max-width: 400px;
  background: linear-gradient(160deg, #ffffff, rgba(196,150,74,.05));
  border: 1px solid rgba(196,150,74,.32); border-radius: 20px; padding: 38px 36px;
  box-shadow: 0 18px 60px rgba(50,70,55,.14);
}
.auth-card .brand { justify-content: center; margin-bottom: 8px; }
.auth-card .brand-logo.big { width: 52px; height: 52px; font-size: 25px; border-radius: 14px; }
.auth-card h1 { text-align: center; font-size: 20px; margin: 14px 0 4px; }
.auth-card > .dim { text-align: center; margin-bottom: 26px; }
.auth-card label { display: block; font-size: 12.5px; color: var(--dim); margin: 14px 0 7px; }
.auth-card input { width: 100%; }
.auth-card .btn { margin-top: 22px; }
.auth-alt { text-align: center; margin-top: 20px; font-size: 12.5px; color: var(--dim2); }
.auth-alt a { color: #8a6524; }

/* ============ 免费渠道一键接入 ============ */
.free-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.free-card {
  display: flex; flex-direction: column; gap: 7px;
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px 12px;
  transition: border-color .15s, box-shadow .15s;
}
.free-card:hover { border-color: var(--line2); box-shadow: 0 4px 14px rgba(50,70,55,.06); }
.free-card.on { border-color: rgba(44,156,104,.45); background: linear-gradient(160deg, #fff, rgba(44,156,104,.05)); }
.free-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.free-name { font-weight: 600; font-size: 14.5px; color: var(--txt); }
.free-badge {
  flex: none; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px;
  background: rgba(44,156,104,.12); color: var(--green);
  border: 1px solid rgba(44,156,104,.3);
}
.free-card.on .free-badge { background: rgba(44,156,104,.18); }
.free-desc { font-size: 12.5px; color: var(--dim); line-height: 1.55; }
.free-limit { font-size: 12px; color: var(--dim2); line-height: 1.5; }
.free-meta { font-size: 11.5px; color: var(--dim2); }
.free-meta code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px; background: rgba(196,150,74,.12); color: #8a6524;
  padding: 1px 6px; border-radius: 5px; word-break: break-all;
}
.free-foot {
  margin-top: auto; padding-top: 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border-top: 1px dashed var(--line);
}
.free-link { font-size: 12px; color: var(--gold); text-decoration: none; }
.free-link:hover { text-decoration: underline; }
.free-st { font-size: 12px; font-weight: 500; padding: 2px 10px; border-radius: 99px; }
.free-st.on { background: rgba(44,156,104,.14); color: var(--green); }
.free-st.ready { background: rgba(196,150,74,.16); color: #8a6524; }
.free-st.added { background: rgba(138,148,173,.15); color: var(--dim); }
@media (max-width: 640px) {
  .free-grid { grid-template-columns: 1fr; }
}

/* ============ 拆书解析 ============ */
.book-meta {
  display: flex; flex-wrap: wrap; gap: 8px 22px;
  font-size: 13px; color: var(--dim);
  padding: 12px 14px; margin-bottom: 12px;
  background: var(--card2); border: 1px solid var(--line); border-radius: 10px;
}
.book-meta b { color: var(--txt); font-weight: 600; }
.book-summary {
  font-size: 13.5px; color: var(--txt); line-height: 1.7;
  padding: 12px 14px; margin-bottom: 12px;
  background: rgba(196,150,74,.07);
  border-left: 3px solid var(--brand1);
  border-radius: 0 10px 10px 0;
}
.book-err {
  font-size: 13px; color: var(--red);
  padding: 10px 14px; margin-bottom: 12px;
  background: rgba(207,92,92,.08); border-radius: 8px;
}
.book-progress { margin-bottom: 14px; }
.bp-bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bp-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--brand1), var(--brand2));
  border-radius: 99px; transition: width .4s;
}
.bp-text { font-size: 12.5px; color: var(--dim); margin-top: 6px; }
.book-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.book-actions .sel.sm { padding: 5px 8px; font-size: 12.5px; border-radius: 7px; }

.ent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}
.ent-card {
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  transition: border-color .15s;
}
.ent-card:hover { border-color: var(--line2); }
.ent-form { display: flex; flex-direction: column; gap: 8px; }
.ent-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ent-name {
  flex: 1 1 110px; min-width: 0; font-weight: 600; font-size: 14px;
  border: 1px solid transparent; border-radius: 7px; padding: 5px 8px;
  background: transparent; color: var(--txt);
}
.ent-name:hover, .ent-name:focus { border-color: var(--line2); background: var(--card); outline: none; }
.ent-cat {
  flex: 0 1 auto; max-width: 140px; font-size: 11.5px; padding: 4px 6px;
  border: 1px solid var(--line); border-radius: 7px;
  background: var(--card); color: var(--dim);
}
.ent-brief {
  width: 100%; font-size: 12.5px; line-height: 1.6; color: var(--dim);
  border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px;
  background: var(--card); resize: vertical;
}
.ent-brief:focus { border-color: var(--brand1); outline: none; }
.ent-foot { display: flex; gap: 8px; align-items: center; }
.ent-tags {
  flex: 1; min-width: 0; font-size: 11.5px; color: var(--dim2);
  border: 1px solid transparent; border-radius: 7px; padding: 4px 8px;
  background: transparent;
}
.ent-tags:hover, .ent-tags:focus { border-color: var(--line2); background: var(--card); outline: none; }
.ent-foot .ops { flex: none; display: flex; gap: 6px; }
@media (max-width: 640px) {
  .ent-grid { grid-template-columns: 1fr; }
  .book-meta { gap: 6px 14px; }
}

/* 后台窄屏适配（必须放在「后台视觉美化」裸规则之后：
   否则 .admin-shell{grid-template-columns:232px 1fr} 会压掉这里的 1fr，
   手机下侧栏不收成横条、内容区被挤成一条——曾致设定卡片名称输入框仅 18px 宽） */
@media (max-width: 960px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side {
    position: static; height: auto; display: flex; flex-wrap: wrap;
    align-items: center; gap: 4px 10px; padding: 10px 14px;
    border-right: none; border-bottom: 1px solid var(--line); box-shadow: none;
  }
  .admin-side .brand { padding: 0 8px 0 0; border-bottom: none; margin-bottom: 0; }
  .admin-side nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .admin-side .side-foot { margin: 0; padding: 0; border-top: none; flex-direction: row; gap: 4px; }
  .admin-main { padding: 12px 14px 32px; }
}
@media (max-width: 640px) {
  .admin-head h2 { font-size: 19px; }
  .admin-side .brand-name { display: none; }
  .admin-side nav a { padding: 6px 8px; font-size: 12px; gap: 6px; }
  .admin-side nav { gap: 3px; }
  .admin-side { gap: 3px 8px; padding: 8px 12px; }
  /* 欢迎横幅：右侧信息竖排铺满，开始创作按钮拉伸占满一行好按 */
  .welcome { padding: 10px 14px; }
  .welcome-side { width: 100%; flex-wrap: wrap; gap: 8px; }
  .welcome-side .btn { flex: 1 1 100%; text-align: center; }
}

/* ============ 创作联动：参考书选择 + 设定参考 ============ */
.ref-pick {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  margin: 4px 0 10px;
}
.ref-pick-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px;
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  font-size: 13px;
  transition: border-color .15s, background .15s;
}
.ref-pick-item:hover { border-color: var(--brand1); }
.ref-pick-item:has(input:checked) {
  border-color: var(--brand1);
  background: rgba(196,150,74,.10);
}
.ref-pick-item input { accent-color: var(--brand1); flex: none; }
.ref-pick-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--txt); font-weight: 500; }
.ref-pick-n { flex: none; font-size: 11px; color: var(--dim2); }

.ref-panel {
  border-top: 1px dashed var(--line);
  padding: 10px 0 2px;
}
.ref-panel > summary {
  cursor: pointer; font-size: 12.5px; color: var(--gold);
  padding: 4px 0; user-select: none;
}
.ref-panel > summary:hover { color: var(--txt); }
.ref-panel[open] > summary { margin-bottom: 8px; }
.ref-book { margin-bottom: 10px; }
.ref-book-title { font-size: 12px; font-weight: 600; color: var(--dim); margin-bottom: 6px; }
.ref-chip {
  display: inline-flex; align-items: center; gap: 3px;
  margin: 0 6px 6px 0;
  padding: 4px 10px;
  font-size: 12px; color: var(--txt);
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 99px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.ref-chip:hover { border-color: var(--brand1); background: rgba(196,150,74,.12); }
.ref-chip b { font-style: normal; }

/* ============ 拆书详情页 · 书籍档案（2026-10-21 重设计） ============ */
.bd-hero {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #96762c 0%, #b28c3e 45%, #c9a44e 100%);
  border-radius: 16px; padding: 16px 18px 18px; margin-bottom: 14px;
  box-shadow: 0 10px 26px rgba(150,118,44,.28);
  color: #fff;
}
.bd-hero::after {
  content: ''; position: absolute; right: -34px; top: -44px; width: 150px; height: 150px;
  border-radius: 50%; background: rgba(255,255,255,.12); pointer-events: none;
}
.bd-hero::before {
  content: ''; position: absolute; left: -46px; bottom: -58px; width: 130px; height: 130px;
  border-radius: 50%; background: rgba(255,255,255,.08); pointer-events: none;
}
.bd-back {
  display: inline-flex; align-items: center; gap: 3px; position: relative; z-index: 1;
  font-size: 12.5px; color: rgba(255,255,255,.9); margin-bottom: 12px;
  background: rgba(255,255,255,.16); padding: 5px 12px; border-radius: 99px;
  transition: background .15s;
}
.bd-back:hover { background: rgba(255,255,255,.28); }
.bd-hero-main { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.bd-cover {
  width: 58px; height: 58px; border-radius: 13px; flex-shrink: 0;
  background: rgba(255,255,255,.94); color: #8a6524;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 700;
  box-shadow: 0 4px 14px rgba(60,40,10,.25);
}
.bd-hero-info { flex: 1; min-width: 0; }
.bd-title-row { display: flex; align-items: center; gap: 8px; }
.bd-title {
  font-size: 19px; font-weight: 700; color: #fff; line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0;
}
.bd-rename {
  border: none; background: rgba(255,255,255,.2); color: #fff;
  width: 30px; height: 30px; border-radius: 8px; font-size: 13px; cursor: pointer;
  flex-shrink: 0; transition: background .15s; line-height: 1;
}
.bd-rename:hover { background: rgba(255,255,255,.36); }
.bd-sub { font-size: 12.5px; color: rgba(255,255,255,.82); margin: 3px 0 8px; }
.bd-st { font-size: 11.5px; padding: 3px 11px; border-radius: 99px; font-weight: 500; background: rgba(255,255,255,.22); color: #fff; }
.bd-rename-form { display: flex; gap: 8px; margin-top: 14px; position: relative; z-index: 1; }
.bd-rename-form input {
  flex: 1; min-width: 0; background: rgba(255,255,255,.95); border: none; color: var(--txt);
  border-radius: 9px; padding: 9px 13px; font-size: 14px; outline: none;
}
.bd-rename-form input:focus { box-shadow: 0 0 0 2px rgba(255,255,255,.6); }
.bd-rename-save, .bd-rename-cancel {
  border: none; border-radius: 9px; padding: 0 14px; font-size: 13px; cursor: pointer; flex-shrink: 0;
}
.bd-rename-save { background: #fff; color: #8a6524; font-weight: 600; }
.bd-rename-cancel { background: rgba(255,255,255,.2); color: #fff; }

.bd-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.bd-stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 4px 9px; text-align: center;
  box-shadow: 0 4px 14px rgba(50,70,55,.06);
}
.bd-stat b { display: block; font-size: 16px; font-weight: 700; color: var(--txt); line-height: 1.3; font-variant-numeric: tabular-nums; }
.bd-stat span { display: block; font-size: 11px; color: var(--dim); margin-top: 2px; }
.bd-stat b.bd-pending { color: var(--dim2); font-size: 13px; font-weight: 500; animation: bdPulse 1.6s ease-in-out infinite; }
@keyframes bdPulse { 0%,100% { opacity: .5; } 50% { opacity: 1; } }

.bd-prog {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 15px 16px 14px; margin-bottom: 14px; box-shadow: 0 6px 20px rgba(50,70,55,.07);
}
.bd-prog-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.bd-prog-title { font-size: 14px; font-weight: 600; }
.bd-prog-pct { font-size: 15px; color: var(--gold); font-weight: 700; font-variant-numeric: tabular-nums; }
.bd-prog-bar { height: 10px; background: var(--bg2); border-radius: 99px; overflow: hidden; }
.bd-prog-fill {
  height: 100%; width: 0; border-radius: 99px; position: relative; overflow: hidden;
  background: linear-gradient(90deg, var(--brand1), var(--brand2));
  transition: width .5s ease;
}
.bd-prog-fill::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent);
  animation: bdShine 1.6s linear infinite;
}
@keyframes bdShine { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.bd-prog-text { font-size: 12.5px; color: var(--dim); margin-top: 9px; }
.bd-prog-tip { font-size: 11.5px; color: var(--dim2); margin-top: 3px; }

.bd-actions { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.bd-act-row { display: flex; gap: 8px; }
.bd-act-row .sel { flex: 1; min-width: 0; }
.bd-act-row .btn { flex-shrink: 0; }
.bd-del { align-self: flex-start; }

.bd-empty { text-align: center; padding: 30px 16px 34px; }
.bd-empty-ico { font-size: 42px; margin-bottom: 8px; }
.bd-empty b { display: block; font-size: 15px; margin-bottom: 6px; }
.bd-empty p { font-size: 13px; color: var(--dim); line-height: 1.75; max-width: 420px; margin: 0 auto; }

.bd-sec-title { font-size: 13.5px; font-weight: 600; color: var(--gold); margin-bottom: 8px; letter-spacing: .2px; }
.bd-err {
  background: rgba(207,92,92,.08); border: 1px solid rgba(207,92,92,.3);
  color: var(--red); border-radius: 12px; padding: 12px 15px; margin-bottom: 14px; font-size: 13px; line-height: 1.6;
}

/* 窄屏微调 */
@media (max-width: 640px) {
  .bd-hero { padding: 14px 15px 15px; }
  .bd-title { font-size: 17.5px; }
  .bd-cover { width: 52px; height: 52px; font-size: 23px; border-radius: 11px; }
  .bd-stat b { font-size: 15px; }
  .bd-stat { padding: 10px 3px 8px; }
  .bd-act-row { flex-wrap: wrap; }
  .bd-act-row .sel { flex: 1 1 100%; }
  .bd-act-row .btn { flex: 1; }
  .bd-del { align-self: stretch; }
}

/* ============ 手机端适配强化（2026-10-22）：窄屏后台不再乱排/横溢 ============ */
@media (max-width: 860px) {
  /* 主列允许收缩，兜底裁掉意外横向溢出（供应商卡片被撑出屏、需左右滑才能看全的问题） */
  /* min-height:0 + align-content:start：掐掉 grid 把侧栏行拉伸到满屏高、
     内容垂直居中后上下各留 100 多px 空白的问题（顶部大空白即此病） */
  .admin-shell { grid-template-columns: 1fr; min-height: 0; align-content: start; }
  .admin-shell > * { min-width: 0; }
  .admin-main { min-width: 0; max-width: 100%; overflow-x: hidden; }
  .panel { min-width: 0; }
  .panel-head { flex-wrap: wrap; gap: 8px 10px; }
  .panel-head > span { display: flex; flex-wrap: wrap; gap: 6px; }
  /* 长词/长链接/模型名强制可断行，不再把卡片撑出屏 */
  .admin-main p, .admin-main td, .admin-main .dim, .admin-main code, .admin-main .free-card { overflow-wrap: anywhere; }

  /* 表格：单元格永不竖排"一字一行"，整表改为横向轻扫（表头跟随、内容保持一行可读） */
  .admin-main .tbl { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .admin-main .tbl th, .admin-main .tbl td { white-space: nowrap; padding: 9px 10px; font-size: 12.5px; }
}
@media (max-width: 640px) {
  /* 侧栏收成两行紧凑条：行1 = logo + （查看作品库/退出），行2 = 菜单 tab 独占一行横滑。
     不再单行硬塞（logo+7个菜单+页脚共 800+px，滑不到底） */
  .admin-side { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; height: auto; overflow: visible; padding: 8px 10px; row-gap: 6px; column-gap: 6px; }
  .admin-side .brand { flex: 1 1 auto; order: 1; padding: 0 4px 0 0; margin-bottom: 0; border-bottom: none; gap: 6px; }
  .admin-side .brand-logo { width: 26px; height: 26px; font-size: 13px; border-radius: 7px; }
  .admin-side .side-foot { order: 2; flex: none; margin-left: auto; flex-direction: row; gap: 2px; padding: 0; border-top: none; }
  .admin-side .side-foot a { flex: none; padding: 6px 8px; font-size: 12px; white-space: nowrap; }
  .admin-side nav { order: 3; flex: 1 1 100%; display: flex; flex-direction: row; flex-wrap: nowrap; gap: 4px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
  .admin-side nav a { flex: none; padding: 6px 9px; font-size: 12px; white-space: nowrap; border-radius: 99px; }
  /* 页头标题与右上角登录态竖排，不再互相挤 */
  .admin-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .admin-main { padding: 10px 12px 32px; }
}
