:root{
  --red:#ff2442; --red-dark:#e01833; --red-soft:#fff0f2;
  --bg:#f6f7f9; --panel:#ffffff; --line:#e8eaef; --line-2:#f0f2f6;
  --text:#1c1f26; --text-2:#5b6270; --text-3:#939aa8;
  --blue:#2b6cff; --green:#12a15c; --amber:#e8a300;
  --radius:12px; --radius-sm:8px;
  --shadow:0 1px 2px rgba(20,25,40,.06), 0 6px 20px rgba(20,25,40,.06);
  --shadow-lg:0 12px 48px rgba(20,25,40,.18);
}
*{box-sizing:border-box;}
html,body{height:100%;}
body{
  margin:0; background:var(--bg); color:var(--text);
  font-family:"PingFang SC","Microsoft YaHei","Helvetica Neue",Arial,sans-serif;
  font-size:14px; line-height:1.6; -webkit-font-smoothing:antialiased;
  display:flex; flex-direction:column;
}
button,input,select,textarea{font-family:inherit; font-size:14px; color:inherit;}
.hidden{display:none !important;}
.muted-sm{color:var(--text-3); font-size:12px;}
.spacer{flex:1;}

/* ---------- 顶栏 ---------- */
.topbar{
  height:58px; flex:0 0 auto; display:flex; align-items:center; justify-content:space-between;
  padding:0 18px; background:var(--panel); border-bottom:1px solid var(--line); z-index:20;
}
.brand{display:flex; align-items:baseline; gap:8px;}
.logo{
  background:var(--red); color:#fff; font-weight:700; font-size:12px;
  padding:2px 7px; border-radius:5px; letter-spacing:.5px;
}
.brand-name{font-size:17px; font-weight:700; letter-spacing:.3px;}
.brand-sub{font-size:12px; color:var(--text-3); margin-left:6px;}
.topbar-actions{display:flex; align-items:center; gap:8px;}
.dot{width:8px; height:8px; border-radius:50%; display:inline-block;}
.dot-off{background:#c9ced8;}
.dot-on{background:var(--green); box-shadow:0 0 0 3px rgba(18,161,92,.15);}

/* ---------- 按钮 ---------- */
.btn{
  border:1px solid var(--line); background:var(--panel); border-radius:var(--radius-sm);
  padding:7px 13px; cursor:pointer; transition:.15s; white-space:nowrap;
}
.btn:hover{background:#f2f4f8; border-color:#d8dce4;}
.btn:active{transform:translateY(1px);}
.btn:disabled{opacity:.5; cursor:not-allowed;}
.btn-primary{background:var(--red); border-color:var(--red); color:#fff; font-weight:600;}
.btn-primary:hover{background:var(--red-dark); border-color:var(--red-dark);}
.btn-ghost{background:transparent;}
.btn-block{width:100%; margin-top:10px; justify-content:center;}
.btn-sm{padding:5px 10px; font-size:13px;}
.icon-btn{
  border:none; background:transparent; font-size:16px; color:var(--text-3);
  cursor:pointer; width:30px; height:30px; border-radius:6px;
}
.icon-btn:hover{background:#f2f4f8; color:var(--text);}
.topbar-actions .btn b{color:var(--red); margin-left:2px;}

/* ---------- 布局 ---------- */
.layout{
  flex:1 1 auto; display:grid; grid-template-columns:392px 1fr;
  gap:14px; padding:14px; min-height:0;
}
.panel-left{display:flex; flex-direction:column; gap:14px; overflow-y:auto; padding-right:2px;}
.panel-right{display:flex; flex-direction:column; gap:12px; min-height:0; overflow-y:auto;}
.card{background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); padding:15px; box-shadow:var(--shadow);}
.card-title{
  font-size:13px; font-weight:700; color:var(--text); margin-bottom:12px;
  display:flex; align-items:center; gap:6px;
}
.card-title::before{content:''; width:3px; height:13px; background:var(--red); border-radius:2px;}

/* ---------- 表单 ---------- */
.field{display:flex; flex-direction:column; gap:5px; margin-bottom:11px; flex:1 1 0; min-width:0;}
.label{font-size:12px; color:var(--text-2); display:flex; align-items:center; gap:6px;}
.label em{font-style:normal; color:var(--text-3); font-size:11px;}
.field-row{display:flex; gap:10px;}
input[type=text],input[type=password],input[type=number],input:not([type]),select,textarea{
  border:1px solid var(--line); border-radius:var(--radius-sm); padding:8px 10px;
  background:#fbfcfd; width:100%; outline:none; transition:.15s; resize:vertical;
}
input:focus,select:focus,textarea:focus{border-color:var(--red); background:#fff; box-shadow:0 0 0 3px rgba(255,36,66,.08);}
textarea{line-height:1.55;}
.switch{display:flex; align-items:center; gap:8px; font-size:13px; color:var(--text-2); margin:9px 0; cursor:pointer;}
.switch input{width:auto; accent-color:var(--red); width:15px; height:15px;}

/* ---------- 日志 ---------- */
.log{
  background:#1b1f27; color:#d7dce6; border-radius:var(--radius-sm); padding:10px 12px;
  font-family:Consolas,"Courier New",monospace; font-size:12px; line-height:1.65;
  max-height:220px; overflow-y:auto; white-space:pre-wrap; word-break:break-all;
}
.log .lg-warn{color:#ffcf5c;}
.log .lg-err{color:#ff7b8a;}
.history{display:flex; flex-direction:column; gap:7px; max-height:190px; overflow-y:auto;}
.history-item{
  display:flex; justify-content:space-between; align-items:center; gap:8px;
  padding:7px 10px; background:#f8f9fb; border:1px solid var(--line-2);
  border-radius:var(--radius-sm); cursor:pointer; font-size:13px;
}
.history-item:hover{border-color:var(--red); background:var(--red-soft);}
.history-item .h-kw{font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.history-item .h-meta{color:var(--text-3); font-size:11px; white-space:nowrap;}

/* ---------- 工具栏 ---------- */
.toolbar{
  display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap;
  background:var(--panel); border:1px solid var(--line); border-radius:var(--radius);
  padding:9px 12px; box-shadow:var(--shadow);
}
.toolbar-left,.toolbar-right{display:flex; align-items:center; gap:8px; flex-wrap:wrap;}
.result-count{font-weight:700; font-size:13px; color:var(--red);}
.mini{padding:5px 9px; font-size:13px; width:auto;}
input.mini{min-width:170px;}

/* ---------- 卡片网格 ---------- */
.grid{
  display:grid; grid-template-columns:repeat(auto-fill,minmax(212px,1fr));
  gap:13px; align-content:start;
}
.note{
  background:var(--panel); border:1px solid var(--line); border-radius:var(--radius);
  overflow:hidden; display:flex; flex-direction:column; position:relative;
  transition:.16s; box-shadow:var(--shadow);
}
.note:hover{box-shadow:0 8px 26px rgba(20,25,40,.12); transform:translateY(-2px);}
.note.sel{border-color:var(--red); box-shadow:0 0 0 2px rgba(255,36,66,.18);}
.note-cover{
  position:relative; aspect-ratio:3/4; background:#f1f3f7; overflow:hidden;
}
.note-cover img{width:100%; height:100%; object-fit:cover; display:block;}
.note-cover .ph{
  width:100%; height:100%; display:flex; align-items:center; justify-content:center;
  color:var(--text-3); font-size:12px; background:linear-gradient(135deg,#f4f6fa,#e9edf4);
}
.badge-score{
  position:absolute; top:8px; left:8px; background:rgba(0,0,0,.62); color:#fff;
  border-radius:20px; padding:3px 9px; font-size:11px; font-weight:700; backdrop-filter:blur(4px);
}
.badge-score.s{background:linear-gradient(90deg,#ff2442,#ff6b35);}
.badge-score.a{background:linear-gradient(90deg,#ff7a18,#e8a300);}
.badge-score.b{background:rgba(43,108,255,.85);}
.badge-type{
  position:absolute; top:8px; right:8px; background:rgba(0,0,0,.5); color:#fff;
  border-radius:5px; padding:2px 6px; font-size:10px;
}
.pick{
  position:absolute; left:8px; bottom:8px; width:22px; height:22px; border-radius:6px;
  background:rgba(255,255,255,.92); border:1.5px solid #cfd5df; cursor:pointer;
  display:flex; align-items:center; justify-content:center; font-size:13px; color:transparent;
}
.note.sel .pick{background:var(--red); border-color:var(--red); color:#fff;}
.note-body{padding:10px 11px 11px; display:flex; flex-direction:column; gap:7px; flex:1;}
.note-title{
  font-size:13.5px; font-weight:600; line-height:1.45; color:var(--text);
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
  min-height:39px;
}
.note-meta{display:flex; justify-content:space-between; align-items:center; font-size:11.5px; color:var(--text-3);}
.note-author{overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:100px;}
.note-likes{color:var(--red); font-weight:700;}
.note-tags{display:flex; gap:4px; flex-wrap:wrap;}
.tag-pill{background:#f2f4f8; color:var(--text-2); border-radius:4px; padding:1px 6px; font-size:10.5px;}
.note-acts{display:flex; gap:6px; margin-top:auto; padding-top:4px;}
.note-acts .btn{flex:1; padding:5px 0; font-size:12px; text-align:center; justify-content:center;}

/* ---------- 空状态 ---------- */
.empty{text-align:center; padding:70px 24px; color:var(--text-3);}
.empty-icon{font-size:42px; margin-bottom:10px; opacity:.5;}
.empty h3{color:var(--text-2); font-size:15px; margin:0 0 8px; font-weight:600;}
.empty p{margin:0 auto; max-width:460px; font-size:13px; line-height:1.8;}

/* ---------- 底部操作条 ---------- */
.actionbar{
  position:fixed; left:50%; bottom:18px; transform:translate(-50%,140%);
  background:#22262f; color:#fff; border-radius:14px; padding:10px 16px;
  display:flex; align-items:center; gap:16px; box-shadow:var(--shadow-lg);
  z-index:40; transition:.22s cubic-bezier(.3,1.2,.5,1);
}
.actionbar.show{transform:translate(-50%,0);}
.sel-info{font-size:13px; color:#c7cdd8;}
.sel-info b{color:#fff; font-size:15px; margin:0 2px;}
.actionbar-btns{display:flex; gap:8px;}
.actionbar .btn-ghost{color:#e6eaf2; border-color:#3a4049; background:transparent;}
.actionbar .btn-ghost:hover{background:#31363f; color:#fff;}

/* ---------- 模型配置向导 ---------- */
.preset-grid{display:grid; grid-template-columns:repeat(2,1fr); gap:8px;}
.preset{
  border:1px solid var(--line); background:#fbfcfd; border-radius:10px; padding:9px 11px;
  cursor:pointer; text-align:left; transition:.15s; display:flex; flex-direction:column; gap:2px;
}
.preset:hover{border-color:var(--red); background:var(--red-soft);}
.preset.active{border-color:var(--red); background:var(--red-soft); box-shadow:0 0 0 2px rgba(255,36,66,.12);}
.preset b{font-size:13px;}
.preset span{font-size:11px; color:var(--text-3); line-height:1.4;}
.preset .p-tag{
  display:inline-block; font-size:10px; padding:0 5px; border-radius:4px; margin-left:5px;
  background:#e6f7ee; color:var(--green); font-weight:600; vertical-align:1px;
}
.preset .p-tag.paid{background:#f2f4f8; color:var(--text-3);}
.setup-hint{
  margin-top:11px; padding:11px 13px; border-radius:var(--radius-sm); font-size:12.5px; line-height:1.75;
  background:#f5f8ff; border:1px solid #dbe5ff; color:#2c4a8f;
}
.setup-hint.err{background:#fff3f4; border-color:#ffd3da; color:#a11b30; margin-bottom:14px; margin-top:0;}
.setup-hint code{
  background:#fff; border:1px solid #dbe5ff; border-radius:4px; padding:1px 5px;
  font-family:Consolas,monospace; font-size:12px; color:#1c3d80;
}
.setup-hint.err code{background:#fff; border-color:#ffd3da; color:#8e1a2c;}
.setup-hint ol{margin:6px 0 0; padding-left:19px;}
.setup-hint li{margin-bottom:3px;}
.setup-hint a{color:inherit; font-weight:600;}

#llmTestResult{white-space:pre-line; margin-top:8px; line-height:1.7; font-size:12.5px;}

/* ---------- 配图工作台 ---------- */
.modal-box.modal-xl{width:1300px;}
.img-layout{display:grid; grid-template-columns:330px 380px 1fr; gap:18px; align-items:start;}
.img-col{min-width:0;}
.img-col + .img-col{border-left:1px solid var(--line); padding-left:18px;}
.row-actions{display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-bottom:11px;}
.card-title em{margin-left:auto;}
.ref-grid,.shot-grid{display:grid; grid-template-columns:repeat(2,1fr); gap:9px;}
.ref-grid .muted-sm{grid-column:1/-1; line-height:1.7;}
.thumb{
  border:1px solid var(--line); border-radius:var(--radius-sm); overflow:hidden; background:#f4f6fa;
  display:flex; flex-direction:column; cursor:pointer; transition:.15s;
}
.shot-grid .thumb{grid-column:1/-1;}
.thumb:hover{border-color:var(--red);}
.thumb img{width:100%; aspect-ratio:3/4; object-fit:cover; display:block;}
.shot-grid .thumb img{aspect-ratio:auto; max-height:330px; object-fit:contain; background:#fff;}
.thumb .cap{
  font-size:11px; color:var(--text-3); padding:4px 7px; display:flex; justify-content:space-between; gap:6px;
  border-top:1px solid var(--line-2); background:#fff;
}
.thumb .cap b{color:var(--text-2); font-weight:600;}
.tpl-row{display:grid; grid-template-columns:repeat(4,1fr); gap:7px; margin-bottom:13px;}
.tpl-btn{
  border:1px solid var(--line); background:#fbfcfd; border-radius:var(--radius-sm);
  padding:7px 4px; font-size:12px; cursor:pointer; transition:.15s; text-align:center;
}
.tpl-btn:hover{border-color:var(--red);}
.tpl-btn.active{border-color:var(--red); background:var(--red-soft); color:var(--red-dark); font-weight:700;}
.plan-list{display:flex; flex-direction:column; gap:9px; max-height:330px; overflow-y:auto;}
.plan-item{
  border:1px solid var(--line); border-radius:var(--radius-sm); padding:10px 11px; background:#fbfcfd;
  cursor:pointer; transition:.15s;
}
.plan-item:hover{border-color:#cfd5df;}
.plan-item.on{border-color:var(--red); background:var(--red-soft);}
.plan-head{display:flex; align-items:center; gap:8px; margin-bottom:6px;}
.plan-slot{
  background:#eef1f6; color:var(--text-2); border-radius:5px; padding:1px 7px;
  font-size:11px; font-weight:700; flex:0 0 auto;
}
.plan-item.on .plan-slot{background:var(--red); color:#fff;}
.plan-text{font-size:13.5px; font-weight:700; flex:1; min-width:0;}
.plan-scene{font-size:12px; color:var(--text-2); line-height:1.7; margin-bottom:5px;}
.plan-prompt{
  font-size:11.5px; color:var(--text-3); line-height:1.6; background:#fff; border:1px dashed #d5dae3;
  border-radius:6px; padding:6px 8px; max-height:76px; overflow-y:auto; white-space:pre-wrap; word-break:break-word;
}
.plan-acts{display:flex; gap:6px; margin-top:7px;}
.plan-acts .btn{padding:3px 8px; font-size:11.5px;}
.let-hint{
  display:flex; gap:8px; align-items:flex-start; background:#fff8e6; border:1px solid #ffe2a8; color:#8a6100;
  border-radius:var(--radius-sm); padding:8px 10px; font-size:12px; line-height:1.65; margin-bottom:10px;
}
.let-hint .x{background:none; border:none; color:#b08a2e; cursor:pointer; font-size:14px; line-height:1; padding:0;}
#imgHint{margin-top:11px;}

/* ---------- 弹窗 ---------- */
.modal{
  position:fixed; inset:0; background:rgba(18,22,30,.45); backdrop-filter:blur(2px);
  display:flex; align-items:center; justify-content:center; z-index:100; padding:24px;
  opacity:0; pointer-events:none; transition:.18s;
}
.modal.show{opacity:1; pointer-events:auto;}
.modal-box{
  background:var(--panel); border-radius:16px; width:560px; max-width:100%;
  max-height:90vh; display:flex; flex-direction:column; box-shadow:var(--shadow-lg);
  transform:translateY(12px) scale(.99); transition:.18s;
}
.modal.show .modal-box{transform:none;}
.modal-lg{width:1080px;}
.modal-head{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:15px 18px; border-bottom:1px solid var(--line); flex:0 0 auto;
}
.modal-head h3{margin:0; font-size:15px; font-weight:700;}
.modal-body{padding:16px 18px; overflow-y:auto; flex:1 1 auto;}
.modal-foot{
  display:flex; align-items:center; gap:9px; padding:13px 18px;
  border-top:1px solid var(--line); background:#fafbfc; border-radius:0 0 16px 16px; flex:0 0 auto;
}

/* ---------- 复刻弹窗 ---------- */
.rw-layout{display:grid; grid-template-columns:320px 1fr; gap:20px; align-items:start;}
.rw-left{border-right:1px solid var(--line); padding-right:18px;}
.origin-box{
  background:#f8f9fb; border:1px solid var(--line-2); border-radius:var(--radius-sm);
  padding:11px; font-size:12.5px; color:var(--text-2); max-height:230px; overflow-y:auto;
  white-space:pre-wrap; word-break:break-word; line-height:1.7;
}
.origin-box .otitle{font-weight:700; color:var(--text); display:block; margin-bottom:6px;}
.why{margin:0; padding-left:17px; font-size:12.5px; color:var(--text-2); line-height:1.75;}
.why li{margin-bottom:5px;}
.why.warn li{color:#b26a00;}
.tabs{display:flex; gap:4px; border-bottom:1px solid var(--line); margin-bottom:14px;}
.tab{
  border:none; background:transparent; padding:8px 13px; cursor:pointer; font-size:13.5px;
  color:var(--text-2); border-bottom:2px solid transparent; margin-bottom:-1px;
}
.tab em{font-style:normal; color:var(--text-3); font-size:11px;}
.tab.active{color:var(--red); font-weight:700; border-bottom-color:var(--red);}
.tabpane{min-height:220px;}
.title-opt{
  display:flex; align-items:flex-start; gap:10px; padding:10px 12px; border:1px solid var(--line);
  border-radius:var(--radius-sm); margin-bottom:8px; cursor:pointer; transition:.15s; background:#fbfcfd;
}
.title-opt:hover{border-color:#cfd5df;}
.title-opt.active{border-color:var(--red); background:var(--red-soft);}
.title-opt .idx{
  flex:0 0 22px; height:22px; border-radius:6px; background:#eef1f6; color:var(--text-2);
  display:flex; align-items:center; justify-content:center; font-size:11.5px; font-weight:700;
}
.title-opt.active .idx{background:var(--red); color:#fff;}
.title-opt .ttext{flex:1; font-size:14px; font-weight:600; line-height:1.5;}
.body-edit{
  width:100%; border:1px solid var(--line); border-radius:var(--radius-sm);
  padding:12px; line-height:1.85; font-size:14px; background:#fbfcfd;
}
.tag-cloud{display:flex; flex-wrap:wrap; gap:8px;}
.tag-chip{
  background:var(--red-soft); color:var(--red-dark); border:1px solid #ffd3da;
  border-radius:20px; padding:5px 12px; font-size:13px; cursor:pointer;
}
.tag-chip.off{background:#f2f4f8; color:var(--text-3); border-color:var(--line);}
.cover-card{
  border:1px dashed #d5dae3; border-radius:var(--radius-sm); padding:14px; margin-bottom:9px;
  background:#fbfcfd;
}
.cover-card .big{font-size:19px; font-weight:800; letter-spacing:1px; line-height:1.5;}

/* ---------- 队列 / 选题库列表 ---------- */
.qitem{
  border:1px solid var(--line); border-radius:var(--radius); padding:13px 15px; margin-bottom:11px;
  background:#fbfcfd;
}
.qitem-head{display:flex; align-items:center; gap:9px; margin-bottom:8px; flex-wrap:wrap;}
.qitem-title{font-weight:700; font-size:14px; flex:1; min-width:200px;}
.qitem-body{
  font-size:13px; color:var(--text-2); line-height:1.8; white-space:pre-wrap;
  max-height:130px; overflow-y:auto; background:#fff; border:1px solid var(--line-2);
  border-radius:var(--radius-sm); padding:10px; margin:8px 0;
}
.qitem-foot{display:flex; gap:7px; align-items:center; flex-wrap:wrap;}
.qitem-foot .btn{padding:4px 10px; font-size:12px;}
.status-chip{border-radius:20px; padding:2px 9px; font-size:11.5px; font-weight:600;}
.st-待发布{background:#fff4e0; color:#b26a00;}
.st-已发布{background:#e6f7ee; color:var(--green);}
.st-已废弃{background:#f2f4f8; color:var(--text-3);}
select.status-sel{padding:3px 7px; font-size:12px; width:auto;}

/* ---------- 笔记详情弹窗 ---------- */
.nd-wrap{display:grid; grid-template-columns:230px minmax(0,1fr); gap:18px; align-items:start;}
.nd-cover{
  border:1px solid var(--line); border-radius:var(--radius-sm); overflow:hidden;
  background:#fbfcfd; position:relative; cursor:zoom-in;
}
.nd-cover img{width:100%; display:block;}
.nd-cover .ph{display:flex; align-items:center; justify-content:center; height:170px; color:var(--text-3); font-size:12px;}
.nd-cover .nd-zoom{
  position:absolute; right:7px; bottom:7px; background:rgba(20,25,40,.62); color:#fff;
  font-size:11px; padding:2px 8px; border-radius:20px; pointer-events:none;
}
.nd-title{font-size:16.5px; font-weight:700; line-height:1.5; margin:0 0 10px;}
.nd-meta{display:flex; flex-wrap:wrap; gap:6px 14px; color:var(--text-2); font-size:12.5px; margin-bottom:12px;}
.nd-meta b{color:var(--text); font-weight:600;}
.nd-desc{
  white-space:pre-wrap; word-break:break-word; font-size:13.5px; line-height:1.85;
  color:var(--text); background:#fff; border:1px solid var(--line-2);
  border-radius:var(--radius-sm); padding:14px; max-height:46vh; overflow-y:auto;
}
.nd-empty{
  border:1px dashed #d5dae3; border-radius:var(--radius-sm); background:#fbfcfd;
  padding:18px; text-align:center; color:var(--text-3); font-size:13px; line-height:1.8;
}
.nd-imgs{display:flex; flex-wrap:wrap; gap:8px; margin-top:12px;}
.nd-imgs img{
  width:88px; height:88px; object-fit:cover; border-radius:var(--radius-sm);
  border:1px solid var(--line); cursor:zoom-in; background:#fbfcfd;
}
@media (max-width:680px){
  .nd-wrap{grid-template-columns:1fr;}
  .nd-cover{max-width:260px;}
}

/* ---------- Toast ---------- */
.toast{
  position:fixed; top:74px; left:50%; transform:translate(-50%,-18px);
  background:#22262f; color:#fff; padding:10px 18px; border-radius:10px; font-size:13.5px;
  box-shadow:var(--shadow-lg); opacity:0; pointer-events:none; transition:.2s; z-index:200;
  max-width:70vw;
}
.toast.show{opacity:1; transform:translate(-50%,0);}
.toast.err{background:#c62828;}

/* ---------- 访问码门禁 ---------- */
.gate{
  position:fixed; inset:0; z-index:500; display:none;
  align-items:center; justify-content:center; padding:24px;
  background:linear-gradient(160deg,#20242c 0%,#2b1218 60%,#3a0f18 100%);
}
body.need-gate .gate{display:flex;}
body.need-gate .topbar,body.need-gate .layout,body.need-gate .actionbar{filter:blur(3px); pointer-events:none; user-select:none;}
.gate-card{
  background:#fff; border-radius:18px; padding:30px 26px; width:380px; max-width:100%;
  box-shadow:var(--shadow-lg); text-align:center;
}
.gate-brand{display:flex; align-items:center; justify-content:center; gap:8px; font-weight:700; font-size:16px; margin-bottom:18px;}
.gate-card h2{margin:0 0 6px; font-size:19px;}
.gate-card p{margin:0 0 16px;}
.gate-card input{margin-bottom:12px; text-align:center; letter-spacing:2px; font-size:15px;}
.gate-err{color:#c62828; margin-top:10px; min-height:16px;}

/* ---------- 独立登录窗口 ---------- */
.login-win{
  position:fixed; inset:0; z-index:60; display:none;
  align-items:center; justify-content:center; padding:18px;
  background:rgba(18,22,32,.55); backdrop-filter:blur(3px);
}
.login-win.show{display:flex;}
.lw-box{
  width:560px; max-width:100%; max-height:94vh; display:flex; flex-direction:column;
  background:var(--panel); border-radius:var(--radius); box-shadow:var(--shadow-lg);
  overflow:hidden; border:1px solid var(--line);
}
.lw-head{
  display:flex; align-items:center; gap:10px; padding:14px 16px;
  border-bottom:1px solid var(--line); flex:0 0 auto;
}
.lw-head h3{margin:0; font-size:15px; font-weight:700; flex:0 0 auto;}
.lw-head .muted-sm{flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.lw-tabs{display:flex; gap:6px; padding:12px 16px 0; flex:0 0 auto;}
.lw-tab{
  flex:1; padding:9px 10px; border:1px solid var(--line); background:#f8f9fb;
  border-radius:var(--radius-sm); font-size:13.5px; color:var(--text-2); cursor:pointer;
  font-family:inherit; transition:.15s;
}
.lw-tab:hover{background:#f1f3f7;}
.lw-tab.on{background:var(--red); border-color:var(--red); color:#fff; font-weight:600;}
.lw-body{padding:14px 16px; overflow-y:auto; flex:1 1 auto;}
.lw-live{display:flex; flex-direction:column; gap:7px; margin-bottom:10px; position:relative;}
.lw-stage{position:relative; display:block; line-height:0;}
.lw-live img{
  width:100%; height:250px; object-fit:contain; object-position:top center;
  background:#eef1f5; border:1px solid var(--line); border-radius:var(--radius-sm); display:block;
  opacity:0; transition:opacity .25s ease;
}
.lw-live img.has{opacity:1;}
/* 画面上的「隐形操作层」：点一下就等于点了云端浏览器同一位置 */
.lw-hit{
  position:absolute; inset:0; z-index:3; cursor:crosshair; border-radius:var(--radius-sm);
  touch-action:none; -webkit-user-select:none; user-select:none;
}
.lw-hit::after{
  content:'可以点这里'; position:absolute; right:6px; bottom:6px; font-size:11px; line-height:1.4;
  padding:2px 7px; border-radius:99px; background:rgba(20,24,34,.62); color:#fff; opacity:.85;
  pointer-events:none; transition:opacity .2s;
}
.lw-hit.touched::after{opacity:0;}
.lw-ripple{
  position:absolute; width:26px; height:26px; margin:-13px 0 0 -13px; border-radius:50%;
  border:2px solid var(--red); background:var(--red-soft); pointer-events:none;
  animation:lwpulse .55s ease-out forwards;
}
@keyframes lwpulse{from{transform:scale(.5); opacity:1;} to{transform:scale(1.9); opacity:0;}}
.lw-act{display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:8px;}
.lw-act .muted-sm{flex:1 1 auto; min-width:0;}
.lw-hint{
  background:#f7f8fb; border:1px dashed var(--line); border-radius:var(--radius-sm);
  padding:8px 10px; line-height:1.65; margin-bottom:12px;
}
.lw-live-tip{font-size:12px; color:var(--text-3); text-align:center;}
.lw-spin{
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  gap:9px; background:#f2f4f8; border:1px solid var(--line); border-radius:var(--radius-sm);
  font-size:12.5px; color:var(--text-2); pointer-events:none;
}
.lw-spin.hide{display:none;}
.lw-spin::before{
  content:''; width:15px; height:15px; border-radius:50%; flex:0 0 auto;
  border:2px solid #d8dde6; border-top-color:var(--red); animation:lwspin .8s linear infinite;
}
@keyframes lwspin{to{transform:rotate(360deg);}}
.lw-qr img{opacity:0; transition:opacity .25s ease;}
.lw-qr img.has{opacity:1;}
.lw-pane .btn.is-off{opacity:.55;}
.lw-pane{display:flex; flex-direction:column; gap:10px;}
.lw-qr{display:flex; justify-content:center;}
/* ⚠ 二维码要大 + 要清晰。源图现在是原生分辨率（或 3 倍截图），
   所以这里放大不会再糊 —— 之前源图只有 136px 却显示 200px，手机根本扫不动。 */
.lw-qr img{
  width:260px; height:260px; object-fit:contain; background:#fff;
  border:1px solid var(--line); border-radius:var(--radius-sm); display:block;
  image-rendering:auto;
}
/* 「只有一台手机」的主流程：视觉上要压过其它说明，别让人去找 */
.lw-qr-main{
  background:#fff5f7; border:1px solid #ffd7de; border-radius:var(--radius-sm);
  padding:10px 12px;
}
.lw-qr-main-t{font-size:13.5px; font-weight:600; color:var(--red); margin-bottom:4px;}
.lw-qr-main .lw-steps{margin:0; padding-left:20px;}
.lw-qr-main .lw-steps li{margin:3px 0; font-size:13px; line-height:1.7;}
.vcode-row{display:flex; gap:7px; align-items:center;}
.vcode-row .prefix{
  flex:0 0 auto; padding:8px 6px 8px 11px; font-size:14px; color:var(--text-2);
  border:1px solid var(--line); border-right:none; border-radius:var(--radius-sm) 0 0 var(--radius-sm);
  background:#fafbfc; margin-right:-8px; z-index:1;
}
.vcode-row input{
  flex:1; min-width:0; padding:9px 11px; border:1px solid var(--line); border-radius:var(--radius-sm);
  background:#fff; outline:none; font-size:14px;
}
.vcode-row input:focus{border-color:var(--red); box-shadow:0 0 0 3px var(--red-soft);}
.vcode-row .btn{flex:0 0 auto; white-space:nowrap;}
.btn-block{width:100%; margin-top:0; justify-content:center;}
.lw-adv{margin-top:4px; border-top:1px solid var(--line); padding-top:12px;}
.lw-adv summary{font-size:12.5px; color:var(--text-3); cursor:pointer; outline:none;}
.lw-adv-body{padding-top:10px; display:flex; flex-direction:column; gap:8px;}
.lw-foot{
  display:flex; justify-content:flex-end; gap:8px; padding:12px 16px;
  border-top:1px solid var(--line); background:#fafbfc; flex:0 0 auto;
}
.blocked-warn{
  margin-top:11px; padding:10px 12px; border-radius:var(--radius-sm); font-size:13px;
  background:#fff3f4; border:1px solid #ffd3da; color:#a11b30;
}
.blocked-warn b{color:#8e1a2c;}

/* ---------- 验证码弹窗 ---------- */
.code-box{width:360px; max-width:100%;}
.code-input{
  width:100%; margin:6px 0 12px; padding:14px 12px; font-size:26px; letter-spacing:.42em;
  text-align:center; border:1px solid var(--line); border-radius:var(--radius-sm);
  background:#fbfcfd; outline:none; font-family:ui-monospace,Menlo,Consolas,monospace;
}
.code-input:focus{border-color:var(--red); box-shadow:0 0 0 3px var(--red-soft); background:#fff;}
.code-row{display:flex; align-items:center; justify-content:space-between; margin-bottom:4px;}
.code-tip{margin-top:9px; min-height:16px; text-align:center;}
.code-tip.err{color:#c0223a;}
.code-tip.ok{color:var(--green);}

/* ---------- 微信内置浏览器提示条 ---------- */
.wx-tip{
  flex:0 0 auto; display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  padding:9px 18px; background:#fff7e6; border-bottom:1px solid #ffe2ad;
  color:#8a5a00; font-size:12.5px; line-height:1.5;
}
.wx-tip b{color:#6d4700;}
.wx-tip .btn{margin-left:auto; flex:0 0 auto;}

/* ---------- 空状态按钮 ---------- */
.empty-acts{display:flex; gap:9px; flex-wrap:wrap; justify-content:center; margin-top:16px;}

/* ---------- 登录窗口：步骤 / 提示 ---------- */
.lw-steps{
  margin:2px 0 0; padding:0 0 0 20px; font-size:12.5px; color:var(--text-2); line-height:1.75;
}
.lw-steps li{margin:1px 0;}
.lw-alt{
  display:flex; align-items:center; gap:8px; flex-wrap:wrap;
  padding:9px 11px; background:#f7f8fb; border:1px dashed var(--line);
  border-radius:var(--radius-sm); font-size:12.5px; color:var(--text-2);
}
.lw-alt .btn{margin-left:auto;}
.lw-note{min-height:0;}
.lw-note.warn{color:#b26a00;}
.lw-warn{color:#b26a00; line-height:1.6;}
.lw-wechat{
  margin-top:2px; padding-top:10px; border-top:1px solid var(--line); line-height:1.6;
}

/* ---------- 使用指南 ---------- */
.guide-body{display:flex; flex-direction:column; gap:14px;}
.guide-lead{
  background:var(--red-soft); border:1px solid #ffd7dd; color:#8f1729;
  border-radius:var(--radius-sm); padding:11px 13px; font-size:13px; line-height:1.7;
}
.guide-lead b{color:#7a1023;}
.gstep{display:flex; gap:12px; align-items:flex-start;}
.gstep-no{
  flex:0 0 auto; width:26px; height:26px; border-radius:50%; background:var(--red); color:#fff;
  font-weight:700; font-size:13.5px; display:flex; align-items:center; justify-content:center;
  margin-top:2px;
}
.gstep-main{flex:1 1 auto; min-width:0;}
.gstep-main h4{
  margin:0 0 6px; font-size:14.5px; font-weight:700; display:flex; align-items:baseline; gap:8px;
}
.gstep-main h4 em{
  font-style:normal; font-size:11.5px; font-weight:600; color:var(--red);
  background:var(--red-soft); border-radius:20px; padding:1px 8px;
}
.gstep-main p{margin:0 0 6px; font-size:13px; color:var(--text-2); line-height:1.7;}
.gstep-main ul{margin:0 0 6px; padding-left:19px; font-size:13px; color:var(--text-2); line-height:1.8;}
.gstep-main li{margin:2px 0;}
.gstep-main b{color:var(--text);}
.gstep-tip{
  font-size:12.5px !important; color:#7a5c00 !important; background:#fffaf0;
  border-left:3px solid #ffd48a; border-radius:0 6px 6px 0; padding:7px 10px; margin:0 !important;
}
.gfaq{border-top:1px solid var(--line); padding-top:14px;}
.gfaq h4{margin:0 0 10px; font-size:14.5px; font-weight:700;}
.gfaq dl{margin:0; font-size:13px;}
.gfaq dt{font-weight:600; color:var(--text); margin-top:10px;}
.gfaq dt::before{content:'Q '; color:var(--red); font-weight:700;}
.gfaq dd{margin:3px 0 0; color:var(--text-2); line-height:1.7; padding-left:16px;}
.gfaq dd b{color:var(--text);}

/* ---------- 用量与额度 ---------- */
.usage-grid{display:grid; grid-template-columns:repeat(2,1fr); gap:8px; margin:4px 0 12px;}
.usage-cell{
  background:#f7f8fb; border:1px solid var(--line); border-radius:var(--radius-sm); padding:9px 11px;
}
.usage-cell .k{font-size:11.5px; color:var(--text-3);}
.usage-cell .v{font-size:16px; font-weight:700; color:var(--text-1); line-height:1.3;}
.usage-cell .v small{font-size:11.5px; font-weight:400; color:var(--text-3);}
.gate-link{display:block; margin-top:12px; text-align:center; color:var(--text-3); text-decoration:none;}
.gate-link:hover{color:var(--red); text-decoration:underline;}

/* ---------- 响应式显隐 ---------- */
.only-mobile{display:none !important;}
body.is-cloud .only-local{display:none !important;}

/* ---------- 中屏 ---------- */
@media (max-width:1180px){
  .layout{grid-template-columns:330px 1fr;}
  .rw-layout{grid-template-columns:1fr;}
  .rw-left{border-right:none; border-bottom:1px solid var(--line); padding-right:0; padding-bottom:14px;}
  .img-layout{grid-template-columns:1fr;}
  .img-col + .img-col{border-left:none; padding-left:0; border-top:1px solid var(--line); padding-top:14px;}
}

/* ---------- 手机端 ---------- */
@media (max-width:820px){
  .only-mobile{display:inline-flex !important;}
  .hidem{display:none !important;}

  /* 顶栏：只留最必要的按钮，横向可滚 */
  .topbar{height:auto; min-height:52px; padding:8px 10px; gap:8px;}
  .brand{gap:6px; flex:0 0 auto;}
  .brand-sub{display:none;}
  .brand-name{font-size:15px;}
  .topbar-actions{gap:6px; overflow-x:auto; -webkit-overflow-scrolling:touch; scrollbar-width:none;}
  .topbar-actions::-webkit-scrollbar{display:none;}
  .topbar-actions .btn{padding:6px 10px; font-size:12.5px; flex:0 0 auto;}

  /* 主区单列 */
  .layout{grid-template-columns:1fr; padding:10px; gap:10px;}

  /* 左栏变成抽屉 */
  .panel-left{
    position:fixed; left:0; top:0; bottom:0; width:88vw; max-width:400px;
    background:var(--bg); z-index:150; padding:12px 12px calc(16px + env(safe-area-inset-bottom));
    transform:translateX(-102%); transition:transform .24s ease; overflow-y:auto;
    box-shadow:var(--shadow-lg); padding-right:12px;
  }
  body.left-open .panel-left{transform:none;}
  body.left-open::after{
    content:''; position:fixed; inset:0; background:rgba(18,22,30,.42); z-index:140;
  }
  .panel-left .card-title{padding-top:4px;}

  /* 工具栏 */
  .toolbar{padding:8px 10px; gap:8px;}
  .toolbar-left,.toolbar-right{gap:6px; width:100%;}
  .toolbar-right{justify-content:flex-start;}
  input.mini{min-width:0; flex:1 1 110px;}
  select.mini{flex:0 0 auto;}

  /* 结果卡片：两列，操作按钮压紧 */
  .grid{grid-template-columns:repeat(2,1fr); gap:9px;}
  .note-acts{display:grid; grid-template-columns:1fr 1fr; gap:5px;}
  .note-acts .btn{padding:5px 0; font-size:11.5px; width:100%;}
  .note-acts .btn[data-act="image"]{grid-column:1/-1;}
  .badge-score{font-size:10px; padding:2px 7px;}

  /* 弹窗全屏 */
  .modal{padding:0; align-items:stretch; backdrop-filter:none; background:rgba(18,22,30,.6);}
  .modal-box,.modal-box.modal-lg,.modal-box.modal-xl{
    width:100%; max-width:100%; height:100%; max-height:100%; border-radius:0;
    transform:translateY(3%);
  }
  .modal.show .modal-box{transform:none;}
  .modal-head{position:sticky; top:0; z-index:3; background:var(--panel);
    padding:12px 14px; padding-top:calc(12px + env(safe-area-inset-top));}
  .modal-head h3{font-size:14.5px;}
  .modal-body{padding:12px 14px;}
  .modal-foot{
    position:sticky; bottom:0; z-index:3; flex-wrap:wrap; gap:7px;
    padding:10px 14px calc(10px + env(safe-area-inset-bottom)); border-radius:0;
  }
  .modal-foot .btn{flex:0 0 auto; font-size:13px; padding:7px 11px;}
  .modal-foot .spacer{display:none;}
  .rw-layout{gap:14px;}
  .origin-box{max-height:160px;}
  .img-layout{gap:16px;}
  .tpl-row{grid-template-columns:repeat(2,1fr);}
  .plan-list{max-height:none;}
  .qitem-title{min-width:0;}

  /* 底部操作条 */
  .actionbar{
    left:0; right:0; bottom:0; width:100%; border-radius:14px 14px 0 0;
    padding:9px 12px calc(9px + env(safe-area-inset-bottom));
    transform:translateY(150%); gap:10px; justify-content:space-between;
  }
  .actionbar.show{transform:translateY(0);}
  .actionbar-btns{flex:1; justify-content:flex-end; gap:6px;}
  .actionbar .btn{padding:7px 11px; font-size:13px;}

  /* 卡片内边距收紧 */
  .card{padding:12px;}
  .log{max-height:170px;}

  /* 独立登录窗口：手机上占满整屏 */
  .login-win{padding:0; align-items:stretch; backdrop-filter:none;}
  .lw-box{width:100%; max-width:100%; max-height:100%; height:100%; border-radius:0; border:none;}
  .lw-head{padding:12px 14px; padding-top:calc(12px + env(safe-area-inset-top));}
  .lw-tabs{padding:10px 14px 0;}
  .lw-body{padding:12px 14px;}
  .lw-live img{height:240px;}
  .lw-qr img{width:280px; height:280px; max-width:100%;}
  .lw-foot{padding:10px 14px; padding-bottom:calc(10px + env(safe-area-inset-bottom));}
  .vcode-row input{font-size:14px; padding:8px 10px;}
  /* 验证码弹窗在手机上是底部弹层，不要全屏 */
  .modal#codePop{align-items:flex-end; backdrop-filter:none;}
  .modal#codePop .modal-box{
    width:100%; max-width:100%; height:auto; max-height:88%;
    border-radius:16px 16px 0 0; transform:none;
    animation:sheetUp .22s ease;
  }
  .modal#codePop .modal-head{position:static; border-radius:16px 16px 0 0;}
  .modal#codePop .modal-body{padding-bottom:calc(16px + env(safe-area-inset-bottom));}

  /* 微信提示条 / 使用指南 */
  .wx-tip{padding:8px 12px; font-size:12px; gap:8px;}
  .wx-tip .btn{margin-left:0;}
  .guide-body{gap:12px;}
  .gstep{gap:9px;}
  .gstep-no{width:23px; height:23px; font-size:12.5px;}
  .gstep-main h4{font-size:14px;}
  .gstep-main p,.gstep-main ul,.gfaq dl{font-size:12.5px;}
  .lw-alt .btn{margin-left:0;}
}
@keyframes sheetUp{from{transform:translateY(26px); opacity:.5;} to{transform:translateY(0); opacity:1;}}

@media (max-width:380px){
  .grid{grid-template-columns:repeat(2,1fr); gap:7px;}
  .note-title{font-size:12.5px;}
  .brand-name{display:none;}
}

/* ---------- 合规自检（v2.7.0） ---------- */
.setup-hint.warn{background:#fffaf0; border-color:#ffe1ad; color:#8a5a00; margin-top:0;}
.ck-list{display:flex; flex-direction:column; gap:8px;}
.ck-item{
  display:flex; gap:9px; align-items:flex-start; font-size:13px; line-height:1.65; color:var(--text-2);
  padding:9px 11px; border-radius:var(--radius-sm); background:#f7f8fa; border:1px solid var(--line);
}
.ck-item .ck-box{
  flex:0 0 auto; width:15px; height:15px; margin-top:2px; border-radius:4px;
  border:1.5px solid #c3c8d2; background:#fff; position:relative;
}
.ck-item.done{background:#f1fbf5; border-color:#cdeeda;}
.ck-item.done .ck-box{background:var(--green); border-color:var(--green);}
.ck-item.done .ck-box::after{
  content:''; position:absolute; left:4px; top:1px; width:4px; height:8px;
  border:solid #fff; border-width:0 1.5px 1.5px 0; transform:rotate(45deg);
}
.ck-item.todo{border-color:#ffdfe4; background:#fff8f9;}
.ck-statement{
  font-size:12.5px; line-height:1.8; color:var(--text-2); background:#f7f8fa;
  border:1px dashed #d6dae2; border-radius:var(--radius-sm); padding:11px 13px;
}
.cmp-head{display:flex; align-items:center; gap:8px; margin-bottom:9px;}
.cmp-badge{font-size:12px; font-weight:600; padding:3px 9px; border-radius:999px; color:#fff;}
.cmp-badge.low{background:var(--green);}
.cmp-badge.mid{background:#e08a00;}
.cmp-badge.high{background:var(--red);}
.cmp-bar{height:6px; border-radius:999px; background:#eceef3; overflow:hidden; margin-bottom:11px;}
.cmp-bar i{display:block; height:100%; border-radius:999px;}
.cmp-dim{display:flex; gap:8px; font-size:12.5px; line-height:1.6; margin-bottom:7px; color:var(--text-2);}
.cmp-dim .k{flex:0 0 76px; color:var(--text-3);}
.cmp-dim .v{flex:1; min-width:0;}
.cmp-dim .n{flex:0 0 44px; text-align:right; font-variant-numeric:tabular-nums;}
.cmp-why{margin:11px 0 0; padding-left:17px; font-size:12.5px; color:#b26a00; line-height:1.7;}
.cmp-why li{margin-bottom:6px;}
.cmp-ok{font-size:12.5px; color:var(--green); line-height:1.7;}
