:root {
  --bg: #f1f4f9;
  --card: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e9f0;
  --primary: #1d4ed8;
  --primary-dark: #1e40af;
  --accent: #0ea5e9;
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", "Microsoft YaHei", -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- 顶栏 ---------- */
.topbar {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  color: #fff;
  padding: 18px 0;
}
.topbar-inner { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 46px; height: 46px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #2563eb);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 17px; letter-spacing: .5px;
}
.brand h1 { font-size: 20px; font-weight: 700; }
.brand .subtitle { font-size: 12.5px; opacity: .82; margin-top: 3px; }
.std-badge {
  display: inline-block; padding: 1px 8px; border-radius: 20px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25);
  font-size: 11px; margin-left: 6px;
}

/* ---------- 顶栏导出按钮 ---------- */
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.book-btn {
  background: #fff; color: #1e3a8a; padding: 9px 18px; border-radius: 8px;
  font-size: 13.5px; font-weight: 700; cursor: pointer; border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,.18); transition: all .15s; white-space: nowrap;
}
.book-btn:hover { background: #e0eaff; transform: translateY(-1px); }
.topbar-btns { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 640px) {
  .topbar-btns { width: 100%; }
  .topbar-btns > .book-btn { flex: 1; }
}

/* ---------- 更多菜单（顶栏按钮折叠） ---------- */
.more-menu { position: relative; }
.more-trigger { white-space: nowrap; }
.more-dropdown {
  display: none; position: absolute; right: 0; top: calc(100% + 10px);
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15,23,42,.18); min-width: 180px;
  padding: 6px; z-index: 90; flex-direction: column; gap: 2px;
}
.more-menu.open .more-dropdown { display: flex; }
.more-dropdown .book-btn {
  width: 100%; text-align: left; background: #fff; color: #1e3a8a;
  padding: 9px 12px; border-radius: 8px; font-size: 13.5px; box-shadow: none; flex: none;
}
.more-dropdown .book-btn:hover { background: #eff6ff; transform: none; }

/* ---------- 计算说明书导出面板 ---------- */
.book-form { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px; }
.book-form .form-row { margin-bottom: 10px; }
@media (max-width: 560px) { .book-form { grid-template-columns: 1fr; } }
.book-list { max-height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.book-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  border-bottom: 1px solid var(--line); cursor: pointer; transition: background .12s;
}
.book-item:last-child { border-bottom: none; }
.book-item:hover { background: #f8fafc; }
.book-item input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--primary); flex-shrink: 0; }
.book-name { font-weight: 700; font-size: 13.5px; color: var(--primary-dark); white-space: nowrap; }
.book-sum { flex: 1; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.book-time { font-size: 11.5px; color: #9ca3af; white-space: nowrap; }
.book-actions {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 16px; flex-wrap: wrap;
}
.book-actions .btn { width: auto; margin: 0; }
.book-actions .btn.primary { margin-left: 8px; }
.book-hint { font-size: 12px; color: var(--muted); }
.book-fmt-row {
  display: flex; align-items: center; gap: 10px; margin-top: 14px;
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel, #f9fafb);
}
.book-fmt-row select {
  flex: 1; padding: 7px 10px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 13px; color: var(--primary-dark);
  background: #fff; cursor: pointer;
}

/* ---------- Tab（分组 + 自动换行，确保所有模块可见） ---------- */
.tabs {
  display: flex; flex-wrap: wrap; gap: 6px 8px; width: 100%;
  max-width: 1180px; margin: 0 auto 4px; padding: 0 20px;
}
.tab {
  padding: 9px 18px; border: 1px solid var(--line);
  background: #eef1f7; border-radius: 999px; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--muted);
  transition: all .15s; white-space: nowrap;
}
.tab:hover { color: var(--primary); border-color: #c7d2fe; }
.tab.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(29, 78, 216, .22);
}
.tab-group {
  align-self: center; flex-shrink: 0; user-select: none;
  font-size: 11px; font-weight: 800; color: #64748b; letter-spacing: 1px;
  padding: 3px 2px 3px 8px; margin-right: 4px; border-left: 2px solid #c7d2fe;
}

/* ---------- 布局 ---------- */
.container { max-width: 1180px; margin: 0 auto; padding: 0 20px 40px; width: 100%; flex: 1; }
.panel { display: none; }
.panel.active { display: block; }
.grid {
  display: grid; grid-template-columns: 360px 1fr;
  gap: 20px; align-items: start;
}
@media (max-width: 900px) { .grid { grid-template-columns: 1fr; } }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px;
}
.form-card h2 { font-size: 16px; margin-bottom: 16px; color: var(--primary-dark); }
.form-row { margin-bottom: 14px; }
.form-row label {
  display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px;
}
.form-row .unit { color: #9ca3af; font-size: 11.5px; }
details.belt-multi-opt { margin: 4px 0 12px; border: 1px dashed #d1d5db; border-radius: 8px; padding: 2px 12px; background: #fafafa; }
details.belt-multi-opt summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--primary); padding: 8px 0; user-select: none; }
details.belt-multi-opt .opt-mark { color: #9ca3af; font-weight: normal; }
.form-row input, .form-row select {
  width: 100%; padding: 9px 12px; border: 1px solid #d4dae4;
  border-radius: 8px; font-size: 14px; outline: none; background: #fff;
  transition: border .15s, box-shadow .15s;
}
.form-row input:focus, .form-row select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(29,78,216,.12);
}
.form-row textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #d4dae4;
  border-radius: 8px; font-size: 14px; outline: none; background: #fff;
  transition: border .15s, box-shadow .15s; resize: vertical; font-family: inherit;
}
.form-row textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(29,78,216,.12);
}
.form-row.inline { display: flex; align-items: center; }
.form-row.inline label { margin: 0; display: flex; align-items: center; gap: 7px; color: var(--ink); font-size: 14px; }
.form-row.inline input { width: auto; }
.form-row.hint-row { margin: -4px 0 10px; padding: 8px 10px; background: #f0f4ff; border: 1px dashed #c3d3f5; border-radius: 8px; }
.form-hint { font-size: 12px; color: #4b6bb3; line-height: 1.5; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 18px; border-radius: 8px; font-size: 14px; font-weight: 600;
  cursor: pointer; border: none; transition: all .15s;
}
.btn.primary { background: var(--primary); color: #fff; width: 100%; margin-top: 6px; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.ghost {
  background: #fff; color: var(--primary); border: 1px solid var(--primary);
  width: 100%; margin-top: 10px;
}
.btn.ghost:hover { background: #eff6ff; }
.btn.small { width: auto; padding: 6px 12px; font-size: 12.5px; margin: 0; }
.btn.danger { background: #fff; color: var(--danger); border: 1px solid var(--danger); }
.btn.danger:hover { background: #fef2f2; }
.btn.small.primary { background: var(--primary); color: #fff; border: 1px solid var(--primary); }
.btn.small.primary:hover { background: var(--primary-dark); }

/* ---------- 结果区 ---------- */
.result-card { min-height: 320px; }
.placeholder {
  color: #9ca3af; text-align: center; padding: 80px 20px; font-size: 14px;
}
.result-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.result-head h3 { font-size: 15.5px; color: var(--primary-dark); }
.badge-ok {
  background: #dcfce7; color: var(--ok); padding: 3px 10px;
  border-radius: 20px; font-size: 12px; font-weight: 700;
}
.badge-fail {
  background: #fee2e2; color: var(--danger); padding: 3px 10px;
  border-radius: 20px; font-size: 12px; font-weight: 700;
}

.result-block { margin-bottom: 14px; }
.result-block h4 {
  font-size: 12px; color: var(--muted); text-transform: uppercase;
  letter-spacing: .6px; margin-bottom: 8px; border-left: 3px solid var(--accent);
  padding-left: 8px;
}
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.kv.full { grid-template-columns: 1fr; }
.kv .k { color: var(--muted); font-size: 12.5px; }
.kv .v { font-size: 13.5px; font-weight: 600; text-align: right; }
.kv .v.big { font-size: 20px; color: var(--primary); }
.kv .v.ok { color: var(--ok); }
.kv .v.no { color: var(--danger); }

.formula {
  background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 8px;
  padding: 10px 12px; font-size: 12.5px; color: #334155; line-height: 1.7;
  font-family: "Cascadia Mono", Consolas, monospace;
}

table.grid-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid-table th, table.grid-table td {
  border: 1px solid var(--line); padding: 7px 9px; text-align: center;
}
table.grid-table th { background: #f1f5f9; font-weight: 600; color: #334155; }
table.grid-table tr.hl td { background: #eff6ff; font-weight: 700; }

.warn-list { list-style: none; }
.warn-list li {
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px;
  color: #92400e; padding: 9px 12px; font-size: 13px; margin-bottom: 8px;
  line-height: 1.6;
}
.warn-list li.err {
  background: #fef2f2; border-color: #fecaca; color: #b91c1c;
}

.std-list { list-style: none; }
.std-list li {
  position: relative; padding-left: 18px; font-size: 12.5px;
  color: var(--muted); line-height: 1.7;
}
.std-list li::before {
  content: ""; position: absolute; left: 2px; top: 9px;
  width: 6px; height: 6px; border-radius: 2px;
  background: var(--accent); opacity: .7;
}

/* ---------- AI 智能助手（默认收起，点击头部展开） ---------- */
.ai-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  margin: 4px 0 22px; overflow: hidden;
}
.ai-card.collapsed .ai-head { border-bottom: none; cursor: pointer; }
.ai-card.collapsed .ai-head:hover { background: linear-gradient(135deg, #e3efff 0%, #e6f7ff 100%); }
.ai-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 16px;
  background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
  border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.ai-actions { display: flex; align-items: center; gap: 10px; }
.ai-chevron {
  font-size: 16px; color: var(--primary); cursor: pointer; line-height: 1;
  transition: transform .18s;
}
.ai-title { display: flex; align-items: center; gap: 8px; font-size: 14.5px; flex-wrap: wrap; }
.ai-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 3px rgba(22,163,74,.15);
}
.ai-hint { color: var(--muted); font-size: 12px; font-weight: 400; }
.ai-chat {
  max-height: 260px; overflow-y: auto; padding: 14px 16px;
  background: #fbfcfe;
}
.msg { margin-bottom: 12px; display: flex; }
.msg.user { justify-content: flex-end; }
.msg.assistant { justify-content: flex-start; }
.msg-bubble {
  max-width: 82%; padding: 9px 13px; border-radius: 12px;
  font-size: 13px; line-height: 1.65; white-space: pre-wrap;
}
.msg.user .msg-bubble {
  background: var(--primary); color: #fff;
  border-bottom-right-radius: 3px;
}
.msg.assistant .msg-bubble {
  background: #fff; border: 1px solid var(--line);
  color: var(--ink); border-bottom-left-radius: 3px;
}
.msg-bubble b { color: var(--primary-dark); }
.msg-bubble .err { color: var(--danger); }
.ai-examples { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ai-example {
  padding: 4px 10px; border: 1px dashed #bfdbfe; border-radius: 20px;
  background: #eff6ff; color: #1e40af; font-size: 12px; cursor: pointer;
  transition: all .15s;
}
.ai-example:hover { background: #dbeafe; border-style: solid; }
.ai-input-row { display: flex; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); }
.ai-input-row input {
  flex: 1; padding: 10px 14px; border: 1px solid #d4dae4; border-radius: 8px;
  font-size: 14px; outline: none;
}
.ai-input-row input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(29,78,216,.12); }
.btn.ai-send { width: auto; margin: 0; padding: 10px 26px; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  display: none; position: fixed; inset: 0; background: rgba(15,23,42,.55);
  z-index: 100; align-items: center; justify-content: center; padding: 20px;
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff; border-radius: 14px; max-width: 860px; width: 100%;
  max-height: 80vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.modal-body { overflow: auto; padding: 18px 20px; }
.modal-body h4 { font-size: 14px; color: var(--primary-dark); margin: 14px 0 8px; }
.modal-body h4:first-child { margin-top: 0; }

/* ---------- 历史记录弹窗 ---------- */
.history-list { max-height: 52vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 2px; }
.history-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 10px; transition: background .12s;
}
.history-item:hover { background: #f8fafc; }
.history-main { flex: 1; min-width: 0; }
.history-top { display: flex; align-items: center; gap: 10px; }
.history-name { font-weight: 700; font-size: 13.5px; color: var(--primary-dark); white-space: nowrap; }
.history-sum {
  font-size: 12px; color: var(--muted); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.history-actions { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }
.history-actions .btn { padding: 5px 10px; font-size: 12px; margin: 0; }
@media (max-width: 560px) { .history-item { flex-direction: column; align-items: stretch; } }

/* ---------- 帮助面板 ---------- */
.help-content { font-size: 13px; color: #334155; line-height: 1.75; overflow-x: auto; }
.help-content p { margin: 6px 0; }
.help-content ul { padding-left: 18px; margin: 6px 0; }
.help-content li { margin: 3px 0; }
.help-content table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 8px 0; }
.help-content th, .help-content td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; }
.help-content th { background: #f1f5f9; white-space: nowrap; }
.help-content tr:nth-child(even) td { background: #fafbfd; }
.help-content b { color: var(--primary-dark); }
.help-tip {
  background: #f0f4ff; border: 1px dashed #c3d3f5; border-radius: 8px;
  padding: 10px 12px; font-size: 12.5px; color: #4b6bb3; margin-bottom: 4px;
}

/* ---------- 页脚 ---------- */
.foot {
  text-align: center; color: #9ca3af; font-size: 12px;
  padding: 18px 20px 26px;
}

/* ---------- 加载态 ---------- */
.loading { text-align: center; color: var(--muted); padding: 40px; }
.spinner {
  width: 26px; height: 26px; border: 3px solid #e2e8f0; border-top-color: var(--primary);
  border-radius: 50%; margin: 0 auto 10px; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- V带多方案对比 ---- */
.cmp-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.cmp-table th, .cmp-table td {
  border: 1px solid #e2e8f0; padding: 6px 8px; text-align: center;
}
.cmp-table th { background: #f1f5f9; color: #475569; font-weight: 700; white-space: nowrap; }
.cmp-table td:first-child { font-weight: 600; }
.cmp-table tr.rec-row { background: #f0fdf4; }
.rec-tag {
  display: inline-block; background: var(--ok); color: #fff; font-size: 10px;
  padding: 1px 6px; border-radius: 10px; margin-left: 4px; vertical-align: middle;
}
.issue-list { margin: 0; padding-left: 18px; font-size: 13px; color: #334155; }
.issue-list li { margin: 3px 0; }
.muted { color: var(--muted); font-size: 12.5px; }

/* ---- 用户系统 + 云端同步 ---- */
.user-badge {
  display: inline-block; max-width: 120px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; background: #eef2ff; color: var(--primary-dark);
  border: 1px solid #cdd7f5; font-size: 12.5px; font-weight: 700;
  border-radius: 999px; padding: 5px 14px; align-self: center; line-height: 1.4;
}
.modal-narrow { max-width: 400px; }
.auth-msg { min-height: 18px; font-size: 12.5px; color: var(--danger); margin: 4px 0 0; }
.auth-actions { display: flex; gap: 10px; margin-top: 10px; }
.auth-actions .btn { flex: 1; margin-top: 0; }
.captcha-line { display: flex; align-items: stretch; gap: 10px; }
.captcha-line input { flex: 1; }
.captcha-line img {
  width: 130px; height: 44px; border: 1px solid #d4dae4; border-radius: 8px;
  cursor: pointer; background: #f2f4f7; flex-shrink: 0;
}

/* ---- 找回密码 / 账号设置 ---- */
.auth-forgot { margin: 10px 0 0; text-align: center; font-size: 13px; }
.auth-forgot a { color: #1B5BBF; text-decoration: none; }
.auth-forgot a:hover { text-decoration: underline; }
.auth-forgot-hint { margin-top: 10px; }
.step-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; font-size: 12.5px; color: #9ca3af; }
.step { padding: 3px 10px; border-radius: 999px; background: #f2f4f7; }
.step.active { background: #E8F0FE; color: #1B5BBF; font-weight: 600; }
.step-arrow { color: #cbd5e1; }
.account-overview {
  background: #f7f9fc; border: 1px solid var(--line); border-radius: 10px;
  padding: 4px 14px; margin-bottom: 8px;
}
.account-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 9px 0; font-size: 13.5px; border-bottom: 1px dashed #e3e8f0;
}
.account-row:last-child { border-bottom: none; }
.account-label { color: var(--muted); flex-shrink: 0; }
.account-value { color: #1F2937; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-section { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-top: 14px; }
.account-section h4 { margin: 0 0 10px; font-size: 14px; color: var(--primary-dark); }
#user-badge { cursor: pointer; transition: background .12s, border-color .12s; }
#user-badge:hover { background: #e0e7ff; border-color: #b9c6ee; }
@media (max-width: 560px) {
  .captcha-line img { width: 104px; height: 40px; }
  .step-bar { flex-wrap: wrap; }
  .account-row { flex-direction: column; align-items: flex-start; gap: 2px; }
}

/* ---- 剩余额度提示（顶栏常驻） ---- */
.quota-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: #fff; color: #1e3a8a; border: 1px solid #cdd7f5;
  border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 700;
  cursor: pointer; align-self: center; white-space: nowrap; user-select: none;
  box-shadow: 0 1px 4px rgba(30, 58, 138, .10); transition: all .15s;
}
.quota-chip:hover { background: #eef2ff; border-color: #a5b4fc; }
.quota-chip .qc-item { white-space: nowrap; }
.quota-chip .qc-sep { width: 1px; height: 12px; background: #cdd7f5; }
.quota-chip .qc-zero { color: var(--danger); }
.quota-chip.qc-warn {
  border-color: var(--danger); background: #fff1f2; color: var(--danger);
  animation: qc-pulse 1.4s ease-in-out infinite;
}
@keyframes qc-pulse { 50% { opacity: .65; } }
@media (max-width: 640px) {
  .quota-chip { font-size: 11px; padding: 5px 10px; gap: 5px; }
}

/* ---- 会员 / 专业版 ---- */
.pro-btn {
  background: linear-gradient(135deg, #b8860b, #d4a017);
  color: #fff !important; border-color: #b8860b !important;
  font-weight: 700;
}
.pro-btn:hover { filter: brightness(1.08); }
.agree-row { margin-top: 8px; }
.agree-label {
  display: flex; align-items: flex-start; gap: 6px; cursor: pointer;
  font-size: 12.5px; color: var(--ink); font-weight: 500; line-height: 1.5;
}
.agree-label input { margin-top: 2px; }
.agree-label a { color: var(--primary); text-decoration: underline; }
.member-loading { color: var(--muted); font-size: 13px; text-align: center; padding: 16px 0; }
.member-badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px;
  font-weight: 700; margin-left: 6px;
}
.member-badge.pro { background: #fdf3d7; color: #92600a; border: 1px solid #e9d39a; }
.member-badge.std { background: #e7f3ec; color: #1f7a4d; border: 1px solid #bcdccb; }
.member-badge.free { background: #eef2f7; color: #64748b; border: 1px solid #dbe2ec; }
.member-card {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  margin-bottom: 12px; background: var(--card);
}
.member-card .mc-title { font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.member-quota-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; margin: 5px 0; }
.member-quota-bar {
  flex: 1; height: 8px; border-radius: 99px; background: #eef1f5; overflow: hidden; min-width: 80px;
}
.member-quota-bar i { display: block; height: 100%; background: linear-gradient(90deg, #3b82f6, #6366f1); }
.member-plan-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 6px 0 4px; }
.member-plan-table th, .member-plan-table td {
  border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top;
}
.member-plan-table th { background: #f6f8fb; font-weight: 700; width: 34%; }
.member-plan-table .pro-col { background: #fffaf0; }
.member-plan-table li { list-style: none; position: relative; padding-left: 16px; margin: 4px 0; }
.member-plan-table li:before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
.member-plan-table .limited li:before { content: "·"; color: var(--muted); }
.redeem-line { display: flex; gap: 8px; margin: 10px 0 4px; }
.redeem-line input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: 1px; }
.redeem-line .btn { width: auto; flex: none; margin-top: 0; white-space: nowrap; }
.admin-codes {
  margin-top: 8px; max-height: 180px; overflow: auto; border: 1px solid var(--line);
  border-radius: 8px; font-size: 12px; background: #fafbfc;
}
.admin-codes table { width: 100%; border-collapse: collapse; }
.admin-codes th, .admin-codes td { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.admin-codes th { position: sticky; top: 0; background: #eef1f5; }
.admin-codes code { font-family: ui-monospace, Consolas, monospace; color: var(--primary-dark); }

/* ---------- 订阅会员（爱发电，标准版 / 专业版） ---------- */
.sub-group-label {
  font-weight: 700; font-size: 13px; color: var(--muted);
  margin: 10px 0 2px; letter-spacing: 1px;
}
.sub-plan-select {
  width: auto; flex: none; min-width: 84px; padding: 7px 8px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  font-size: 13px;
}
.sub-prices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 8px 0 4px; }
@media (max-width: 520px) { .sub-prices { grid-template-columns: 1fr; } }
.sub-card {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px;
  background: linear-gradient(180deg, #f8fafc, #ffffff);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.sub-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.sub-card.hot { border-color: #f59e0b; background: linear-gradient(180deg, #fffbeb, #ffffff); }
.sub-name { font-weight: 700; font-size: 13.5px; display: flex; align-items: center; }
.sub-tag {
  display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 20px;
  background: linear-gradient(135deg, #f59e0b, #f97316); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 18px;
}
.sub-price { font-size: 24px; font-weight: 800; color: var(--primary-dark); margin: 6px 0 2px; }
.sub-period { font-size: 12px; color: var(--muted); }
.sub-features { margin: 8px 0 10px; list-style: none; font-size: 12.5px; }
.sub-features li { padding-left: 16px; position: relative; margin: 3px 0; color: var(--ink); }
.sub-features li:before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
.sub-buy {
  display: block; text-align: center; text-decoration: none; font-size: 13px;
  width: 100%; padding: 9px 0;
}
.sub-buy-disabled {
  display: block; text-align: center; font-size: 12px; color: var(--muted);
  padding: 9px 0; border: 1px dashed var(--line); border-radius: 8px;
  text-decoration: none; cursor: pointer; transition: color .15s, border-color .15s, background .15s;
}
.sub-buy-disabled:hover {
  color: var(--primary); border-color: var(--primary);
  background: rgba(37, 99, 235, .05);
}
.bind-code-row { display: flex; align-items: center; gap: 10px; margin: 8px 0 4px; flex-wrap: wrap; }
.bind-code {
  font-family: ui-monospace, Consolas, monospace; font-size: 20px; font-weight: 700;
  letter-spacing: 3px; color: var(--primary-dark); background: #eef4ff;
  border: 1px dashed #93b4f5; border-radius: 8px; padding: 6px 14px; user-select: all;
}
.bind-steps { margin: 6px 0 0 18px; font-size: 12.5px; color: var(--ink); }
.bind-steps li { margin: 3px 0; }
.sub-source { color: var(--ok); font-weight: 700; }

/* ---------- 订阅订单面板（管理员） ---------- */
.affdian-toolbar { margin: 6px 0 2px; display: flex; justify-content: flex-end; }
.affdian-st { display: inline-block; padding: 1px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.affdian-st.paid { background: #dcfce7; color: #166534; }
.affdian-st.refunded { background: #fee2e2; color: #991b1b; }
.affdian-st.pending { background: #fef3c7; color: #92400e; }

.api-example {
  margin: 6px 0 2px; padding: 8px 10px; background: #0f172a; color: #dbeafe;
  border-radius: 8px; font-family: ui-monospace, Consolas, monospace; font-size: 12px;
  line-height: 1.6; overflow: auto; white-space: pre;
}
.legal-body { max-height: 60vh; overflow: auto; font-size: 13px; line-height: 1.8; color: var(--ink); }
.legal-body h4 { margin: 14px 0 6px; color: var(--primary-dark); }
.legal-body p, .legal-body li { margin: 4px 0; }

/* ---------- 意见反馈 ---------- */
.inline-label { display: flex; align-items: flex-start; gap: 8px; cursor: pointer;
  font-weight: 500; color: var(--ink); font-size: 13px; }
.inline-label input { margin-top: 2px; }
.fb-badge {
  display: inline-block; min-width: 8px; height: 8px; margin-left: 6px;
  border-radius: 50%; background: #ef4444; vertical-align: 2px;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, .25);
}
.feedback-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: center; }
.feedback-filter select, .feedback-filter input[type="text"] {
  padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 12.5px; background: var(--card); color: var(--ink); }
.feedback-filter input[type="text"] { flex: 1; min-width: 140px; }
.fb-card {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  margin-bottom: 10px; background: var(--card);
}
.fb-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fb-status { display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: 11.5px; border: 1px solid var(--line); color: var(--muted); }
.fb-status.pending { color: #b45309; background: #fffbeb; border-color: #fde68a; }
.fb-status.doing { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
.fb-status.done { color: #15803d; background: #f0fdf4; border-color: #bbf7d0; }
.fb-status.wontfix { color: #6b7280; background: #f3f4f6; }
.fb-meta { color: var(--muted); font-size: 12px; }
.fb-reply { margin-top: 6px; padding: 8px; border-radius: 8px;
  background: #f8fafc; border: 1px dashed var(--line); font-size: 12.5px;
  white-space: pre-wrap; word-break: break-all; }
.fb-reply-area { display: flex; gap: 8px; margin-top: 8px; }
.fb-reply-area textarea { flex: 1; padding: 6px 8px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 12.5px; min-height: 40px; resize: vertical;
  background: var(--card); color: var(--ink); font-family: inherit; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(10px);
  background: rgba(15, 23, 42, .92); color: #fff; font-size: 13px;
  padding: 10px 18px; border-radius: 999px; z-index: 300; opacity: 0;
  pointer-events: none; transition: opacity .2s, transform .2s; max-width: 86vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 资料库：标准件库 / 自定义材料 ---------- */
.sub {
  display: inline-block; font-size: 11px; font-weight: 600; color: #f59e0b;
  margin-left: 6px; vertical-align: 2px;
}
.req { color: #d33; font-weight: 700; }
.hint { font-size: 12px; color: var(--muted); margin: 8px 0 0; line-height: 1.5; }
.locked-box {
  padding: 14px 16px; background: #fff7ed; border: 1px dashed #fdba74;
  border-radius: 10px; color: #7c2d12; font-size: 13px; line-height: 1.7;
}
.std-note { font-size: 12px; color: var(--muted); margin: 0 0 8px; }
#result-standards .grid-table, #result-materials .grid-table { font-size: 12.5px; }
#result-standards .grid-table td, #result-materials .grid-table td { padding: 6px 8px; }
#result-materials .grid-table a { color: var(--primary-dark); margin-right: 6px; font-size: 12px; }
