:root {
  --bg: #F6F7FB;
  --card: #FFFFFF;
  --text: #23262F;
  --text2: #6B7186;
  --line: #E7E9F2;
  --primary: #FF2E4D;
  --primary2: #FF5C73;
  --blue: #1F4FFF;
  --green: #00B878;
  --orange: #FF8A00;
  --red: #E5484D;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(35, 38, 47, .05);
  font-size: 15px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif; background: var(--bg); color: var(--text); }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }
.hidden { display: none !important; }

/* ---------- 登录 ---------- */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #FFF0F2 0%, #F2F6FF 100%); }
.auth-card { width: 400px; background: #fff; border-radius: 20px; padding: 36px 34px; box-shadow: 0 10px 40px rgba(35,38,47,.08); }
.auth-logo { font-size: 24px; font-weight: 800; text-align: center; }
.auth-sub { font-size: 13px; color: var(--text2); text-align: center; margin: 8px 0 22px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.auth-form input { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; outline: none; }
.auth-form input:focus { border-color: var(--primary); }
.auth-tip { font-size: 12px; color: var(--text2); line-height: 1.7; }
.auth-error { color: var(--red); font-size: 13px; margin-top: 12px; text-align: center; min-height: 18px; }
.tabs { display: flex; background: var(--bg); border-radius: 10px; padding: 4px; }
.tab { flex: 1; border: none; background: transparent; padding: 9px; border-radius: 8px; font-size: 14px; color: var(--text2); }
.tab.active { background: #fff; color: var(--text); font-weight: 600; box-shadow: var(--shadow); }

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; }
.side-logo { padding: 14px 20px 10px; }
.side-logo-img { height: 46px; max-width: 170px; object-fit: contain; display: block; }
.auth-logo { display: flex; justify-content: center; margin-bottom: 6px; }
.auth-logo-img { height: 64px; max-width: 240px; object-fit: contain; }
.side-nav { flex: 1; display: flex; flex-direction: column; padding: 6px 10px; gap: 2px; }
.nav-item { border: none; background: transparent; text-align: left; padding: 11px 14px; border-radius: 10px; font-size: 14px; color: var(--text2); }
.nav-item:hover { background: var(--bg); }
.nav-item.active { background: linear-gradient(90deg, #FFF0F2, #FFF7F8); color: var(--primary); font-weight: 700; }
.side-foot { padding: 14px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.user-chip { flex: 1; font-size: 13px; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main { flex: 1; margin-left: 220px; padding: 28px 32px 60px; max-width: 1200px; }
.page h2 { font-size: 21px; margin-bottom: 18px; }
.h2-sub { font-size: 13px; color: var(--text2); font-weight: 400; margin-left: 8px; }

/* ---------- 卡片 ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card.slim { padding: 14px 18px; }
.card-title { font-weight: 700; margin-bottom: 14px; font-size: 15px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat-card { background: var(--card); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.stat-label { font-size: 13px; color: var(--text2); }
.stat-value { font-size: 22px; font-weight: 800; margin: 6px 0 4px; }
.stat-hint { font-size: 12px; color: var(--text2); }

.kernel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.kernel-item { background: var(--bg); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.kernel-item b { font-size: 13px; }
.kernel-item span { font-size: 12.5px; color: var(--text2); }
.windows { display: flex; flex-wrap: wrap; gap: 10px; }
.window-chip { background: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 13px; }
.window-chip b { color: var(--primary); }

/* ---------- 表单 ---------- */
.form-row { display: flex; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 120px; }
.field.grow { flex: 1; }
.field label { font-size: 12.5px; color: var(--text2); font-weight: 600; }
.field input, .field select, .field textarea, .industry-pick select, .form-row > select, .form-row > input {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; outline: none; min-width: 0;
}
.field textarea { resize: vertical; line-height: 1.8; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); }
.industry-pick { display: flex; gap: 8px; }
.industry-pick select { flex: 1; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text2); }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }
.w180 { width: 180px; }
.grow { flex: 1; }
.self-end { align-self: flex-end; }

/* ---------- 按钮 ---------- */
.btn { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 18px; font-size: 14px; font-weight: 600; color: var(--text); transition: .15s; }
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary2); color: #fff; }
.btn.ghost { border-color: transparent; color: var(--text2); }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn.lg { padding: 13px 34px; font-size: 15px; }
.btn.block { width: 100%; }
.link-btn { background: none; border: none; color: var(--text2); font-size: 13px; padding: 2px; }
.link-btn:hover { color: var(--primary); }
.btn.danger { color: var(--red); }
.btn.danger:hover { border-color: var(--red); }
.gen-actions { display: flex; align-items: center; gap: 14px; margin-top: 6px; }
.gen-mode-hint { font-size: 12.5px; color: var(--text2); }

/* ---------- 进度/提示 ---------- */
.progress { height: 6px; background: var(--line); border-radius: 4px; overflow: hidden; margin-top: 14px; }
.progress .bar { height: 100%; width: 40%; background: linear-gradient(90deg, var(--primary), var(--orange)); border-radius: 4px; animation: slide 1.2s infinite; }
@keyframes slide { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }
.notice { background: #FFF7E8; border: 1px solid #FFE3B3; color: #8A5A00; border-radius: 10px; padding: 12px 16px; font-size: 13.5px; margin-bottom: 14px; line-height: 1.7; }
.notice.quota { background: #FDECEC; border-color: #F8C9CB; color: #A02020; }
.hint { font-size: 12.5px; color: var(--text2); margin-top: 10px; line-height: 1.8; }

/* ---------- 笔记卡片 ---------- */
.note-card { background: var(--card); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 12px; }
.note-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.note-title { font-size: 16px; font-weight: 700; flex: 1; min-width: 200px; }
.badge { font-size: 11.5px; padding: 3px 9px; border-radius: 20px; font-weight: 600; }
.badge.t-资料 { background: #FFF0F2; color: var(--primary); }
.badge.t-科普 { background: #EEF3FF; color: var(--blue); }
.badge.t-种草 { background: #E9F9F1; color: var(--green); }
.badge.t-话题 { background: #FFF4E6; color: var(--orange); }
.badge.ces { background: var(--bg); color: var(--text2); }
.badge.risk-low { background: #E9F9F1; color: var(--green); }
.badge.risk-mid { background: #FFF4E6; color: var(--orange); }
.badge.risk-high { background: #FDECEC; color: var(--red); }
.badge.st-draft { background: var(--bg); color: var(--text2); }
.badge.st-queued { background: #EEF3FF; color: var(--blue); }
.badge.st-published { background: #E9F9F1; color: var(--green); }
.badge.st-failed { background: #FDECEC; color: var(--red); }
.note-tags { font-size: 12.5px; color: var(--blue); margin-bottom: 6px; word-break: break-all; }
.note-body { font-size: 13.5px; color: #3F4658; line-height: 1.9; white-space: pre-wrap; max-height: 130px; overflow: hidden; position: relative; }
.note-body.open { max-height: none; }
.note-cover { font-size: 12.5px; color: var(--text2); background: var(--bg); padding: 10px 14px; border-radius: 10px; margin: 10px 0; line-height: 1.7; }
.note-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.cover-strip { background: var(--bg); border-radius: 12px; padding: 12px; margin: 10px 0; }
.cover-strip .cimgs { display: flex; gap: 10px; }
.cover-strip .cimgs a { flex: 1; }
.cover-strip img { width: 100%; border-radius: 10px; display: block; border: 1px solid var(--line); }
.cover-strip .cimgs a:hover img { border-color: var(--primary); }
.cover-dl { display: flex; align-items: center; gap: 10px; margin-top: 10px; }

/* ---------- 账号/任务 ---------- */
.row-card { background: var(--card); border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow); margin-bottom: 12px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.row-main { flex: 1; min-width: 220px; }
.row-title { font-weight: 700; font-size: 15px; }
.row-sub { font-size: 12.5px; color: var(--text2); margin-top: 4px; line-height: 1.7; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.dot.green { background: var(--green); }
.dot.red { background: var(--red); }
.dot.gray { background: #C6CADB; }

/* ---------- 公众号 ---------- */
.wx-preview { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.wx-preview iframe { width: 100%; height: 640px; border: none; }
.wx-actions { display: flex; gap: 10px; margin: 14px 0; flex-wrap: wrap; }
.wx-draft-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.wx-draft-row:last-child { border-bottom: none; }

/* ---------- 设置 ---------- */
.local-status { font-size: 14px; line-height: 1.8; margin-bottom: 10px; }
.bal-state { font-size: 13px; font-weight: 600; }
.bal-state.ok { color: var(--green); }
.bal-state.low { color: var(--orange); }
.bal-state.empty { color: var(--red); }
.bal-state.local { color: var(--blue); }
.usage-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.usage-table th, .usage-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.usage-table th { color: var(--text2); font-weight: 600; }

/* ---------- 模态 ---------- */
.modal { position: fixed; inset: 0; background: rgba(20, 22, 30, .45); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal-box { background: #fff; border-radius: 18px; padding: 26px 28px; width: 560px; max-width: 92vw; max-height: 86vh; overflow: auto; }
.modal-box h3 { margin-bottom: 16px; }
.modal-box .form-row:last-child { margin-bottom: 0; }

/* ---------- Toast ---------- */
.toast { position: fixed; top: 24px; left: 50%; transform: translateX(-50%) translateY(-80px); background: #23262F; color: #fff; padding: 11px 22px; border-radius: 12px; font-size: 14px; transition: .3s; z-index: 200; box-shadow: 0 8px 30px rgba(0,0,0,.2); }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--red); }
.toast.ok { background: var(--green); }

.steps { padding-left: 20px; font-size: 13.5px; line-height: 2.1; color: #3F4658; }

@media (max-width: 900px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
}
