:root{
  --bg:#f6f7fb; --panel:#fff; --line:#e8ebf3; --line2:#eef1f7;
  --ink:#1f2430; --ink2:#5a6273; --muted:#98a0b3;
  --brand:#4f46e5; --brand-soft:#eef0fe; --brand-dark:#4038c9;
  --teal:#0f9b8e; --teal-soft:#e6f6f4;
  --gold:#b7791f; --gold-soft:#fdf6e3;
  --coral:#c2410c; --coral-soft:#fff1e9;
  --green:#15803d; --green-soft:#e8f6ed;
  --radius:10px; --shadow:0 1px 3px rgba(24,28,40,.06),0 8px 24px rgba(24,28,40,.05);
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0; background:var(--bg); color:var(--ink);
  font:14px/1.65 -apple-system,"Segoe UI","Microsoft YaHei",system-ui,sans-serif;
  -webkit-font-smoothing:antialiased;
}
a{color:inherit;text-decoration:none}
button{font-family:inherit}

/* ── 布局 ── */
.layout{display:flex;height:100vh;overflow:hidden}
.sidebar{
  width:212px;flex:0 0 212px;background:#1b2030;color:#c9cfdd;
  display:flex;flex-direction:column;overflow-y:auto;
}
.sidebar::-webkit-scrollbar{width:6px}
.sidebar::-webkit-scrollbar-thumb{background:#3a4358;border-radius:3px}

.brand{display:flex;gap:10px;align-items:center;padding:18px 16px 16px}
.brand-logo{
  width:34px;height:34px;border-radius:9px;background:linear-gradient(135deg,#6d5cf6,#4f46e5);
  color:#fff;font-weight:800;font-size:17px;display:grid;place-items:center;flex:0 0 34px;
}
.brand-name{color:#fff;font-weight:700;font-size:14.5px;letter-spacing:.2px}
.brand-sub{font-size:11px;color:#7b849b;margin-top:1px}

.nav{padding:4px 8px 24px;display:flex;flex-direction:column;gap:1px}
.nav-group{
  font-size:11px;color:#6b7488;padding:14px 10px 5px;letter-spacing:.6px;
}
.nav-item{
  padding:7.5px 10px;border-radius:7px;font-size:13.2px;cursor:pointer;
  color:#c9cfdd;transition:.15s;user-select:none;
}
.nav-item:hover{background:#262d40;color:#fff}
.nav-item.sub{padding-left:18px;font-size:13px}
.nav-item.active{background:var(--brand);color:#fff;font-weight:600}

/* ── 主区 ── */
.main{flex:1;display:flex;flex-direction:column;overflow:hidden;min-width:0}
.topbar{
  background:var(--panel);border-bottom:1px solid var(--line);
  padding:16px 26px 14px;display:flex;justify-content:space-between;align-items:flex-start;gap:20px;
}
.topbar h1{margin:0;font-size:18px;font-weight:700}
.page-sub{margin:3px 0 0;font-size:12.5px;color:var(--muted)}
.topbar-right{flex-shrink:0;padding-top:2px}
.content{flex:1;overflow-y:auto;padding:22px 26px 60px}

/* ── 通用组件 ── */
.card{
  background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);
  padding:20px 22px;box-shadow:var(--shadow);margin-bottom:16px;
}
.card h2{margin:0 0 4px;font-size:15.5px;font-weight:700}
.card .hint{margin:0 0 16px;font-size:12.5px;color:var(--muted);line-height:1.7}
.card-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:14px}

.btn{
  border:1px solid var(--line);background:#fff;color:var(--ink2);
  padding:8px 16px;border-radius:8px;font-size:13px;cursor:pointer;transition:.15s;
}
.btn:hover{border-color:#c9cfe0;color:var(--ink)}
.btn.primary{background:var(--brand);border-color:var(--brand);color:#fff;font-weight:600}
.btn.primary:hover{background:var(--brand-dark);border-color:var(--brand-dark)}
.btn.primary:disabled{opacity:.5;cursor:not-allowed}
.btn.sm{padding:5px 11px;font-size:12.2px;border-radius:7px}
.btn.ghost{border-color:transparent;background:transparent;color:var(--brand)}
.btn.ghost:hover{background:var(--brand-soft)}
.btn.danger{color:var(--coral);border-color:#f3d5c7}
.btn.danger:hover{background:var(--coral-soft)}

.input,.textarea,.select{
  width:100%;border:1px solid var(--line);border-radius:8px;padding:9px 12px;
  font-size:13.5px;font-family:inherit;color:var(--ink);background:#fff;transition:.15s;
}
.input:focus,.textarea:focus,.select:focus{
  outline:none;border-color:var(--brand);box-shadow:0 0 0 3px var(--brand-soft);
}
.textarea{resize:vertical;line-height:1.75}
.label{display:block;font-size:13px;font-weight:600;margin-bottom:6px}
.label .req{color:var(--coral);margin-left:3px}
.label .tip{font-weight:400;color:var(--muted);font-size:12px;margin-left:6px}

.grid2{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
.field{margin-bottom:16px}

.pill{
  display:inline-block;background:#f2f4f9;color:var(--ink2);border-radius:20px;
  padding:3px 11px;font-size:12px;margin:0 6px 6px 0;
}
.pill-soft{
  display:inline-block;background:var(--brand-soft);color:var(--brand);
  border-radius:20px;padding:4px 12px;font-size:12.3px;font-weight:600;
}
.pill.on{background:var(--brand-soft);color:var(--brand);font-weight:600}
.pill .x{cursor:pointer;opacity:.55;margin-left:4px;font-weight:700}
.pill .x:hover{opacity:1}

.opts{display:flex;flex-wrap:wrap;gap:8px}
.opt{
  border:1px solid var(--line);border-radius:8px;padding:7px 14px;font-size:13px;
  cursor:pointer;transition:.15s;background:#fff;color:var(--ink2);user-select:none;
}
.opt:hover{border-color:#c3cbe4;color:var(--ink)}
.opt.on{background:var(--brand-soft);border-color:#c3c9f7;color:var(--brand-dark);font-weight:600}

.note{border-radius:8px;padding:11px 14px;font-size:12.8px;line-height:1.7}
.note.info{background:#f4f6fd;color:#3d4663;border:1px solid #e3e8f8}
.note.ok{background:var(--green-soft);color:var(--green);border:1px solid #cbe8d6}
.note.warn{background:var(--gold-soft);color:var(--gold);border:1px solid #f0e0b8}
.note.err{background:var(--coral-soft);color:var(--coral);border:1px solid #f5d4c4}

.muted{color:var(--muted)}
.small{font-size:12.3px}
.mono{font-family:ui-monospace,Consolas,monospace}

.empty{text-align:center;padding:48px 20px;color:var(--muted);font-size:13.5px}
.empty b{display:block;color:var(--ink2);font-size:15px;margin-bottom:6px}

table{width:100%;border-collapse:collapse;font-size:13px}
th{
  text-align:left;font-weight:600;color:var(--muted);font-size:12px;
  padding:8px 10px;border-bottom:1px solid var(--line);white-space:nowrap;
}
td{padding:10px;border-bottom:1px solid var(--line2);vertical-align:top}
tr:last-child td{border-bottom:none}
tbody tr:hover{background:#fafbfe}

/* 统计卡 */
.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:18px}
.stat{
  background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);
  padding:16px 18px;box-shadow:var(--shadow);
}
.stat .k{font-size:12.3px;color:var(--muted);margin-bottom:7px}
.stat .v{font-size:24px;font-weight:700;letter-spacing:-.5px}
.stat .d{font-size:11.5px;color:var(--muted);margin-top:4px}

/* 编辑器 */
.editor-wrap{display:grid;grid-template-columns:1fr 1fr;gap:0;border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;background:#fff}
.editor-pane{display:flex;flex-direction:column;min-height:520px}
.editor-pane + .editor-pane{border-left:1px solid var(--line)}
.pane-head{
  padding:9px 14px;border-bottom:1px solid var(--line);font-size:12.3px;
  color:var(--muted);font-weight:600;background:#fafbfe;display:flex;justify-content:space-between;
}
.pane-body{flex:1;overflow-y:auto;padding:16px 18px}
.pane-body.src{font-family:ui-monospace,Consolas,monospace;font-size:12.8px;line-height:1.9;white-space:pre-wrap}
.preview img{max-width:100%;border-radius:8px;margin:10px 0}
.preview h2{font-size:16px;margin:18px 0 8px;font-weight:700}
.preview h3{font-size:14.5px;margin:16px 0 6px}
.preview p{margin:0 0 12px;line-height:1.85}
.preview blockquote{
  border-left:3px solid var(--brand);margin:12px 0;padding:4px 0 4px 14px;color:var(--ink2);
}

/* 结构/视角 选择卡 */
.pick-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(232px,1fr));gap:12px}
.pick{
  border:1.5px solid var(--line);border-radius:9px;padding:13px 15px;cursor:pointer;
  transition:.15s;background:#fff;
}
.pick:hover{border-color:#c3cbe4}
.pick.on{border-color:var(--brand);background:var(--brand-soft)}
.pick .t{font-weight:700;font-size:13.5px;margin-bottom:3px}
.pick .s{font-size:12px;color:var(--muted);line-height:1.6}
.pick.on .s{color:#5b58a8}

.toast{
  position:fixed;left:50%;bottom:38px;transform:translateX(-50%) translateY(20px);
  background:#1f2430;color:#fff;padding:11px 20px;border-radius:9px;font-size:13.4px;
  opacity:0;pointer-events:none;transition:.25s;z-index:999;box-shadow:0 8px 30px rgba(0,0,0,.2);
  max-width:70vw;
}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}

.spinner{
  display:inline-block;width:14px;height:14px;border:2px solid rgba(255,255,255,.35);
  border-top-color:#fff;border-radius:50%;animation:spin .7s linear infinite;
  vertical-align:-2px;margin-right:7px;
}
@keyframes spin{to{transform:rotate(360deg)}}

/* ── 富文本编辑器 ── */
.ed-toolbar{
  display:flex;flex-wrap:wrap;gap:4px;align-items:center;
  padding:7px 10px;border-bottom:1px solid var(--line);background:#fafbfe;
}
.ed-tb{
  border:1px solid transparent;background:#fff;color:var(--ink2);
  padding:4px 9px;border-radius:6px;font-size:12.3px;cursor:pointer;transition:.12s;
  line-height:1.5;white-space:nowrap;
}
.ed-tb:hover{border-color:#c3cbe4;color:var(--ink);background:#fff}
.ed-tb:active{background:var(--brand-soft);border-color:#c3c9f7;color:var(--brand-dark)}
.ed-sep{width:1px;height:16px;background:var(--line);margin:0 4px}
.ed-count{font-size:11.5px;color:var(--muted);padding-right:4px;white-space:nowrap}

.ed-src{
  width:100%;border:none;outline:none;resize:none;
  font-family:ui-monospace,Consolas,monospace;font-size:12.8px;line-height:1.9;
  padding:14px 16px;min-height:420px;color:var(--ink);background:#fff;
}
.ed-prev{min-height:420px}
.ed-prev img{max-width:100%;border-radius:8px;margin:10px 0;display:block}
.ed-prev h1{font-size:19px;margin:20px 0 10px;font-weight:700}
.ed-prev h2{font-size:16.5px;margin:20px 0 9px;font-weight:700;
  padding-left:10px;border-left:3px solid var(--brand)}
.ed-prev h3{font-size:14.5px;margin:18px 0 7px;font-weight:700;color:var(--ink2)}
.ed-prev p{margin:0 0 12px;line-height:1.9}
.ed-prev ul,.ed-prev ol{margin:0 0 12px;padding-left:22px;line-height:1.9}
.ed-prev blockquote{
  border-left:3px solid var(--brand);margin:12px 0;padding:6px 0 6px 14px;
  color:var(--ink2);background:#fafbfe;
}
.ed-prev hr{border:none;border-top:1px solid var(--line);margin:18px 0}
.ed-prev code{background:#f2f4f9;padding:1px 5px;border-radius:4px;font-size:12.5px}

/* 图片选择弹窗 */
.ed-modal{
  position:fixed;inset:0;background:rgba(20,24,36,.5);z-index:1000;
  display:flex;align-items:center;justify-content:center;padding:30px;
}
.ed-modal-box{
  background:#fff;border-radius:12px;padding:18px 20px;max-width:820px;width:100%;
  max-height:80vh;display:flex;flex-direction:column;box-shadow:0 20px 60px rgba(0,0,0,.25);
}
.ed-modal-head{display:flex;align-items:center;font-weight:700;font-size:14.5px;margin-bottom:14px}
.ed-modal-grid{
  display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:12px;
  overflow-y:auto;padding:2px;
}
.ed-modal-item{
  border:1.5px solid var(--line);border-radius:9px;overflow:hidden;cursor:pointer;
  transition:.15s;background:#fafbfe;
}
.ed-modal-item:hover{border-color:var(--brand);background:var(--brand-soft)}
.ed-modal-item img{width:100%;height:96px;object-fit:cover;display:block}
.ed-modal-item div{padding:6px 9px;word-break:break-all}

@media(max-width:1100px){
  .grid2,.editor-wrap{grid-template-columns:1fr}
  .stats{grid-template-columns:repeat(2,1fr)}
  .editor-pane + .editor-pane{border-left:none;border-top:1px solid var(--line)}
}

/* ══════ 顶栏提醒铃铛 ══════ */
.bell{
  position:relative;border:none;background:transparent;cursor:pointer;
  font-size:19px;line-height:1;padding:4px 6px;border-radius:9px;
  color:#4a5568;transition:background .15s;
}
.bell:hover{background:#eef2f8}
.bell-ico{display:inline-block}
.bell-dot{
  position:absolute;top:-1px;right:-1px;min-width:17px;height:17px;
  background:#e5484d;color:#fff;font-size:11px;font-weight:700;
  border-radius:9px;display:flex;align-items:center;justify-content:center;
  padding:0 4px;box-shadow:0 0 0 2px #fff;
}
.notify-panel{
  position:absolute;top:64px;right:22px;width:390px;max-height:520px;
  background:#fff;border:1px solid var(--line,#e3e8ef);border-radius:14px;
  box-shadow:0 12px 40px rgba(20,30,60,.16);z-index:200;
  display:flex;flex-direction:column;overflow:hidden;
}
.notify-head{
  display:flex;align-items:center;justify-content:space-between;
  padding:13px 16px;border-bottom:1px solid var(--line,#e3e8ef);
}
.notify-head b{font-size:15px}
.notify-acts a{font-size:12px;color:#5b6b8c;margin-left:12px;text-decoration:none}
.notify-acts a:hover{color:#2b6cff;text-decoration:underline}
.notify-list{overflow-y:auto;padding:6px}
.notify-item{
  padding:11px 12px;border-radius:10px;margin-bottom:4px;cursor:pointer;
  border-left:3px solid transparent;
}
.notify-item:hover{background:#f5f8fd}
.notify-item.unread{background:#f0f6ff;border-left-color:#2b6cff}
.notify-item .nt{font-size:13.5px;font-weight:600;color:#1f2937;margin-bottom:4px;line-height:1.4}
.notify-item .nb{font-size:12.5px;color:#5b6b8c;white-space:pre-wrap;line-height:1.6}
.notify-item .na{font-size:11px;color:#98a2b3;margin-top:6px}
.notify-empty{padding:40px 16px;text-align:center;color:#98a2b3;font-size:13px}
.notify-tip{
  background:#eef4ff;border:1px solid #cfe0ff;border-radius:9px;
  padding:9px 11px;font-size:12.5px;color:#2b4a7d;line-height:1.6;margin-top:8px;
}

/* ══════ 新增：素材库 / 信源探测（2026-10-18）══════ */
.nav-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 10.5px;
  font-weight: 700;
  border-radius: 20px;
  background: #eef1f6;
  color: var(--ink2);
  vertical-align: middle;
}
.nav-item.active .nav-badge { background: rgba(255,255,255,.22); color: #fff; }

.modal-mask { animation: maskIn .16s ease-out; }
@keyframes maskIn { from { opacity: 0 } to { opacity: 1 } }

/* 访谈：示例按钮 */
[data-iv-ex] { text-align: left; }

/* 素材卡片 hover */
[data-mat-toggle] { min-width: 52px; }

/* 信源排行条 */
#src-result .pill { font-size: 10.5px; }

/* textarea 统一 */
textarea.input:focus, input.input:focus {
  outline: none;
  border-color: #4f46e5 !important;
  box-shadow: 0 0 0 3px rgba(79,70,229,.10);
}

/* ══════ 导航折叠（2026-10-18）══════ */
.nav-advanced-head {
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--muted);
  padding: 16px 16px 6px;
  text-transform: uppercase;
  user-select: none;
  transition: color .15s;
}
.nav-advanced-head:hover { color: var(--ink2); }
#nav-adv { overflow: hidden; }

/* ══════ 账号菜单（顶部右侧）══════ */
.acct-wrap { position: relative; display: inline-block; }
.acct-btn {
  cursor: pointer;
  border: 1px solid transparent;
  font-family: inherit;
  transition: all .15s;
}
.acct-btn:hover { background: #eef1f6; border-color: var(--line); }
.acct-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 190px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(15,23,42,.13);
  padding: 6px 0;
  z-index: 8000;
  animation: acctIn .12s ease-out;
}
@keyframes acctIn { from { opacity: 0; transform: translateY(-4px) } to { opacity: 1; transform: none } }
.acct-menu-head {
  padding: 8px 14px 9px;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}
.acct-menu-sep { height: 1px; background: var(--line); margin: 4px 0; }
.acct-menu a {
  display: block;
  padding: 8px 14px;
  font-size: 13.5px;
  color: var(--ink);
  text-decoration: none;
  transition: background .12s;
}
.acct-menu a:hover { background: #f4f6fb; }
