/* ==========================================================================
   快帮帮聊天助手 · 后台统一样式
   设计基准：LicenseServer 后台（深色侧栏 + 白色面板 + 青绿主色）
   被 super/（平台总后台）、admin/（企业后台）、m/（手机版）、登录页、首页共用
   ========================================================================== */

:root {
    --bg: #f4f6f8;
    --panel: #ffffff;
    --ink: #1e2833;
    --muted: #6b7785;
    --line: #e4e9ef;
    --brand: #0f9d8f;
    --brand-dark: #0b7f74;
    --brand-soft: #e6f6f4;
    --danger: #d0463f;
    --amber: #c8860d;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

a { color: var(--brand-dark); text-decoration: none; }
code, .mono { font-family: "Cascadia Mono", Consolas, "SFMono-Regular", monospace; }

/* ---------------- 布局：深色侧栏 + 主区 ---------------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 208px;
    flex: 0 0 208px;
    background: #16202b;
    color: #cfd8e3;
    display: flex;
    flex-direction: column;
    padding: 18px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 18px; text-decoration: none; color: inherit; cursor: pointer; }
.logo {
    width: 34px; height: 34px; border-radius: 9px;
    background: var(--brand); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; letter-spacing: .5px; font-size: 13px;
    flex: 0 0 34px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; gap: 2px; }
.brand .logo-img {
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 11px; padding: 4px; object-fit: contain;
  background: linear-gradient(135deg, #1e3330 0%, #16262a 100%);
  border: 1px solid rgba(15, 157, 143, .22);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .30);
}
.brand-text strong { color: #fff; font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-text small { color: #9db1c2; font-size: 11px; letter-spacing: .3px; }

.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.nav a {
    display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 8px;
    color: #b9c5d2; font-size: 13.5px;
    transition: background .15s, color .15s;
}
.nav a:hover { background: #1e2b38; color: #fff; }
.nav a.on { background: var(--brand); color: #fff; font-weight: 600; }
/* 未读数量角标：靠右的红色小圆牌，选中项上用半透明白底 */
.nav-badge {
    margin-left: auto; min-width: 18px; height: 18px; padding: 0 6px; border-radius: 9px;
    background: #e05656; color: #fff; font-size: 11px; font-weight: 600;
    line-height: 18px; text-align: center;
}
.nav a.on .nav-badge { background: rgba(255, 255, 255, .3); }

.side-foot {
    margin-top: auto; padding-top: 14px; border-top: 1px solid #26333f;
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    font-size: 12.5px; color: #8a99a8;
}
.link-btn {
    background: none; border: 0; color: #9fb0c0; cursor: pointer;
    font-size: 12.5px; padding: 0;
}
.link-btn:hover { color: #fff; }

.main { flex: 1; padding: 26px 30px 50px; max-width: 1760px; min-width: 0; }

/* 旧页面外层容器（原来 max-width + 居中），改成纯容器 */
.wrap { padding: 0; margin: 0; max-width: none; }

.page-head { margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.2px; }
.page-sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

/* ---------------- 提示条 ---------------- */
.flash {
    padding: 10px 14px; border-radius: 8px; margin-bottom: 16px;
    font-size: 13.5px; border: 1px solid transparent;
}
.flash-success { background: #eaf7f3; border-color: #b9e6d9; color: #17695c; }
.flash-error { background: #fdeeee; border-color: #f3c9c7; color: #a3312b; }

/* 旧类名 ok / err 直接复用提示条样式 */
.ok { background: #eaf7f3; border: 1px solid #b9e6d9; color: #17695c;
      padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 13.5px; }
.err { background: #fdeeee; border: 1px solid #f3c9c7; color: #a3312b;
       padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 13.5px; }

/* ---------------- 卡片 / 面板 ---------------- */
.card, .panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
}
.card, .panel { padding: 18px 20px; margin-bottom: 18px; }
.card h2, .panel-head h2 { margin: 0 0 14px; font-size: 15px; font-weight: 600; }
.panel-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }

.tip, .hint { color: var(--muted); font-size: 12.5px; line-height: 1.8; margin: 8px 0 0; }
.empty { color: var(--muted); padding: 18px 4px; margin: 0; }

/* ---------------- 统计卡 ---------------- */
.stats, .stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}
.stat {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 14px 16px;
    display: flex; flex-direction: column; gap: 6px;
}
.stat .n, .stat strong {
    font-size: 24px; font-weight: 600; line-height: 1.1; color: var(--brand-dark);
}
.stat .l, .stat-label { color: var(--muted); font-size: 12.5px; }

/* ---------------- 企业后台概览（面子页） ---------------- */
.dash-hero {
    position: relative; overflow: hidden; margin-bottom: 16px;
    padding: 26px 28px; border-radius: 16px; color: #fff;
    background: linear-gradient(120deg, #092831 0%, #0b5b55 56%, #12a394 100%);
    box-shadow: 0 12px 30px rgba(11, 70, 67, .16);
}
.dash-hero::before {
    content: ""; position: absolute; width: 330px; height: 330px; border-radius: 50%;
    right: -90px; top: -165px; background: rgba(255, 255, 255, .10);
}
.dash-hero::after {
    content: ""; position: absolute; width: 210px; height: 210px; border-radius: 50%;
    right: 110px; bottom: -150px; background: rgba(255, 255, 255, .07);
}
.dash-hero-inner {
    position: relative; z-index: 1; display: flex; align-items: flex-end;
    justify-content: space-between; gap: 22px; flex-wrap: wrap;
}
.dash-kicker {
    font-size: 11.5px; letter-spacing: .18em; color: rgba(255, 255, 255, .62);
    margin-bottom: 4px;
}
.dash-hero h1 {
    margin: 0; font-size: 27px; line-height: 1.3; font-weight: 650;
    letter-spacing: -.4px; color: #fff;
}
.dash-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.dash-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 11px; border-radius: 999px; font-size: 12.5px;
    color: #eafffb; background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .20);
    transition: background .15s, border-color .15s;
}
.dash-pill:hover { background: rgba(255, 255, 255, .22); border-color: rgba(255, 255, 255, .30); color: #fff; }
.dash-pill b { font-weight: 600; }
.dash-actions { display: flex; gap: 8px; flex-wrap: wrap; }
/* 头部卡片右上角客服联系方式：深色渐变底上用浅色小字 */
.hero-contact {
    position: absolute; top: 18px; right: 24px; z-index: 2;
    font-size: 12.5px; color: rgba(255, 255, 255, .78); letter-spacing: .02em;
    cursor: pointer; display: inline-flex; align-items: center;
    padding: 6px 10px; border-radius: 8px;
}
.hero-contact:hover { color: #fff; background: rgba(255, 255, 255, .12); }
.dash-action {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 9px 15px; border-radius: 9px; font-size: 13px; font-weight: 600;
    color: #0b625c; background: #fff; border: 1px solid #fff;
    transition: background .15s, color .15s, border-color .15s;
}
.dash-action:hover { background: #e9fffb; color: #084b47; }
.dash-action.ghost { color: #fff; background: rgba(255, 255, 255, .10); border-color: rgba(255, 255, 255, .32); }
.dash-action.ghost:hover { background: rgba(255, 255, 255, .20); color: #fff; }

.dash-stats {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px; margin-bottom: 16px;
}
.dash-stat {
    position: relative; display: flex; flex-direction: column; gap: 3px;
    min-height: 112px; padding: 15px 18px;
    border: 1px solid var(--line); border-radius: 12px; background: #fff;
    color: var(--ink); transition: border-color .15s, box-shadow .15s, transform .15s;
}
.dash-stat::before {
    content: ""; position: absolute; left: 0; top: 15px; bottom: 15px; width: 3px;
    border-radius: 0 4px 4px 0; background: var(--brand);
}
.dash-stat:hover {
    border-color: #a7ded5; box-shadow: 0 8px 20px rgba(15, 77, 74, .08);
    transform: translateY(-1px);
}
.dash-stat-label { font-size: 12.5px; color: var(--muted); }
.dash-stat-value {
    font-size: 25px; font-weight: 650; line-height: 1.25; color: var(--brand-dark);
    font-variant-numeric: tabular-nums;
}
.dash-stat-value small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.dash-stat-value.is-off { color: #c04037; }
.dash-stat-meta {
    margin-top: auto; padding-top: 6px; display: flex; align-items: center;
    justify-content: space-between; gap: 8px; font-size: 12px; color: #8a969f;
}
.dash-stat-meta em { font-style: normal; color: var(--brand); font-weight: 500; }

.dash-two { display: grid; grid-template-columns: 1.15fr .85fr; gap: 14px; margin-bottom: 16px; }
.dash-two .card { margin-bottom: 0; }
.dash-card-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-bottom: 14px;
}
.dash-card-head h2 { margin: 0; }
.dash-more { font-size: 12.5px; color: var(--brand-dark); white-space: nowrap; }
.dash-more:hover { text-decoration: underline; }

.dash-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.dash-step {
    display: flex; gap: 9px; padding: 12px; border-radius: 10px;
    background: #f8fbfa; border: 1px solid #e8f1ef;
}
.dash-step-no {
    flex: 0 0 23px; width: 23px; height: 23px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11.5px; font-weight: 600; color: #fff; background: var(--brand);
}
.dash-step b { display: block; font-size: 12.5px; color: var(--ink); margin-bottom: 2px; }
.dash-step .dash-step-text { display: block; font-size: 12px; line-height: 1.55; color: var(--muted); }
.dash-step strong { display: block; font-size: 12.5px; color: var(--brand-dark); font-weight: 600; margin-top: 3px; }
.dash-note { margin: 12px 0 0; font-size: 12px; color: var(--muted); }

.dash-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dash-link {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 11px 12px; border-radius: 9px; border: 1px solid #edf1f4;
    background: #f8fafb; color: var(--ink); font-size: 13px;
    transition: background .15s, border-color .15s, color .15s;
}
.dash-link:hover { background: var(--brand-soft); border-color: #c9eae4; color: var(--brand-dark); }
.dash-link span:last-child { color: var(--brand); font-size: 12px; white-space: nowrap; }
.dash-empty { padding: 18px 4px; color: var(--muted); font-size: 13px; }
.dash-empty a { color: var(--brand-dark); font-weight: 500; }
.dash-table-name { color: var(--brand-dark); font-weight: 500; }
.dash-table-name:hover { text-decoration: underline; }

/* ---------------- 企业后台续费升级 ---------------- */
.renew-hero {
    position: relative; overflow: hidden; margin-bottom: 16px;
    padding: 24px 26px; border-radius: 16px; color: #fff;
    background: linear-gradient(122deg, #0a2632 0%, #0d535b 58%, #158f86 100%);
    box-shadow: 0 12px 30px rgba(11, 70, 67, .14);
}
.renew-hero::before {
    content: ""; position: absolute; width: 300px; height: 300px; border-radius: 50%;
    right: -100px; top: -190px; background: rgba(255, 255, 255, .09);
}
.renew-hero-inner {
    position: relative; z-index: 1; display: flex; align-items: flex-end;
    justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.renew-kicker { font-size: 11.5px; letter-spacing: .16em; color: rgba(255, 255, 255, .6); margin-bottom: 5px; }
.renew-title { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: 26px; font-weight: 650; letter-spacing: -.3px; line-height: 1.3; }
.renew-status {
    display: inline-block; padding: 2px 9px; border-radius: 999px;
    background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .20);
    color: #eafffb; font-size: 12px; font-weight: 500;
}
.renew-sub { margin-top: 8px; color: rgba(255, 255, 255, .78); font-size: 13px; }
.renew-hero-link { display: inline-block; margin-top: 12px; color: #d9fff9; font-size: 12.5px; }
.renew-hero-link:hover { color: #fff; text-decoration: underline; }
.renew-metrics { display: grid; grid-template-columns: repeat(3, minmax(86px, 1fr)); gap: 10px; min-width: 300px; }
.renew-metric {
    padding: 10px 12px; border-radius: 10px;
    background: rgba(255, 255, 255, .10); border: 1px solid rgba(255, 255, 255, .14);
}
.renew-metric span { display: block; color: rgba(255, 255, 255, .62); font-size: 11.5px; }
.renew-metric b { display: block; margin-top: 3px; color: #fff; font-size: 16px; font-weight: 600; }

.renew-alert {
    padding: 10px 14px; margin-bottom: 14px; border-radius: 9px;
    background: #fff8e8; border: 1px solid #f1dfb4; color: #805d13; font-size: 13px;
}
/* 续费页会员折扣摘要条：仅命中档位时展示；标签/折扣加粗加色，按基线对齐 */
.renew-member-bar {
    display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px;
    padding: 12px 14px; margin-bottom: 16px; border-radius: 14px;
    background: var(--brand-soft); border: 1px solid #d3f0eb;
    font-size: 12.5px; line-height: 1.4; color: #33504a;
}
.renew-member-label { color: var(--brand-dark); font-size: 13px; font-weight: 600; }
.renew-member-discount { color: var(--brand-dark); font-size: 13px; font-weight: 700; }
.renew-member-bar .tip { color: #7a8a86; font-size: 12.5px; line-height: 1.4; }
.renew-table-wrap { overflow-x: auto; }
.renew-plan-table {
    width: 100%; min-width: 640px; border-collapse: separate; border-spacing: 0;
    table-layout: fixed; font-size: 13px;
}
.renew-plan-table th {
    width: auto; padding: 0 10px 10px; border-bottom: 1px solid #e5efec;
    background: transparent; color: #81918c; font-size: 11.5px; font-weight: 600;
    letter-spacing: .03em; white-space: nowrap;
}
.renew-plan-table th:nth-child(1) { width: 17%; padding-left: 14px; }
.renew-plan-table th:nth-child(2) { width: 9%; }
.renew-plan-table th:nth-child(3) { width: 10%; }
.renew-plan-table th:nth-child(4) { width: 20%; }
.renew-plan-table th:nth-child(5) { width: 26%; }
.renew-plan-table th:nth-child(6) { width: 18%; }
.renew-plan-table td { padding: 14px 10px; border-bottom: 1px solid #edf3f1; vertical-align: middle; }
.renew-plan-table td:first-child { padding-left: 14px; }
.renew-plan-table tbody tr:last-child td { border-bottom: 0; }
.renew-plan-table tbody tr:hover td { background: #fafdfc; }
/* 当前套餐整行浅绿底，左侧竖条让客户一眼认出自己那档 */
.renew-plan-table tr.current-plan td, .renew-plan-table tr.current-plan:hover td { background: #f1faf7; }
.renew-plan-table tr.current-plan td:first-child { box-shadow: inset 3px 0 0 #179682; border-radius: 8px 0 0 8px; }
.renew-plan-table tr.current-plan td:last-child { border-radius: 0 8px 8px 0; }
.renew-row-title { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.renew-row-name { font-size: 14.5px; font-weight: 650; color: var(--ink); white-space: nowrap; }
.renew-plan-table .tag { flex: none; margin-top: 0; padding: 1px 5px; font-size: 10.5px; }
.renew-plan-table .tag-full { display: none; }
@media (min-width: 1200px) {
    .renew-plan-table .tag-full { display: inline; }
}
.renew-row-num { color: #179682; font-size: 13px; font-weight: 650; white-space: nowrap; }
.renew-row-price { color: var(--brand-dark); white-space: nowrap; line-height: 1.2; }
.renew-row-price small { font-size: 11px; font-weight: 500; margin-right: 1px; }
.renew-row-price b { font-size: 18px; font-weight: 650; letter-spacing: -.3px; }
.renew-row-cycle { margin-left: 2px; color: var(--muted); font-size: 10.5px; font-weight: 400; }
.renew-row-pay { margin-top: 6px; color: #4b5b66; font-size: 10.8px; line-height: 1.4; white-space: nowrap; }
.renew-row-pay b { color: var(--brand-dark); font-size: 11.5px; font-weight: 650; }
.renew-row-deduct { margin-left: 3px; color: #81908a; font-size: 10.2px; }
.renew-row-quote { font-size: 12px; line-height: 1.5; color: var(--muted); }
.renew-row-mode { display: inline-block; color: #179682; font-size: 11.5px; font-weight: 600; margin-bottom: 2px; }
.renew-row-mode.is-error { color: #b42318; }
.renew-row-main { color: #4b5b66; }
.renew-row-main b { color: var(--ink); font-weight: 600; }
.renew-row-date { white-space: nowrap; }
.renew-row-sub { margin-top: 3px; color: #81908a; }
.renew-row-quote.is-error .renew-row-sub { color: #b42318; }
.renew-row-action { text-align: right; }
.renew-row-action .btn { width: 102px; padding: 8px 6px; margin-right: 6px; font-size: 12.5px; }
.renew-row-action .btn-secondary { background: #f4f7f9; color: #8a969f; border-color: #e3e9ee; }

/* 套餐变更确认弹窗：比浏览器默认 confirm 更清楚的「从哪到哪 / 到期 / 实付」 */
dialog.modal.renew-confirm-dialog {
    width: min(700px, 94vw); border-radius: 16px;
    box-shadow: 0 28px 80px rgba(10, 32, 30, .28);
}
.renew-confirm-head {
    padding: 18px 22px 16px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdfd 100%);
}
.renew-confirm-headline { display: flex; align-items: center; gap: 12px; min-width: 0; }
.renew-confirm-emblem {
    width: 38px; height: 38px; flex: 0 0 38px; border-radius: 11px;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-size: 19px; font-weight: 600;
    background: linear-gradient(135deg, #14a99a 0%, var(--brand-dark) 100%);
    box-shadow: 0 6px 14px rgba(15, 157, 143, .22);
}
.renew-confirm-kicker {
    color: var(--brand); font-size: 11px; font-weight: 650;
    letter-spacing: .1em; text-transform: uppercase; line-height: 1.3;
}
.renew-confirm-head h3 { margin: 2px 0 0; font-size: 19px; font-weight: 650; letter-spacing: -.2px; }
.renew-confirm-close {
    width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px;
    background: #f2f5f7; color: #7c8995; font-size: 20px; line-height: 1;
    cursor: pointer;
}
.renew-confirm-close:hover { background: #e8edf1; color: var(--ink); }
.renew-confirm-body { padding-top: 16px; }
.renew-confirm-route {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center; gap: 10px;
    padding: 13px 10px; border: 1px solid #d7ebe7; border-radius: 11px;
    background: linear-gradient(135deg, #f4fbf9 0%, #fbfefd 65%, #f7fcfa 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
}
.renew-confirm-plan {
    display: inline-flex; align-items: center; min-height: 28px; padding: 3px 11px;
    border-radius: 8px; background: #fff; border: 1px solid #dce8e4;
    color: #46545f; font-size: 13px; font-weight: 600;
    box-shadow: 0 1px 2px rgba(15, 67, 61, .04);
}
.renew-confirm-switch {
    display: flex; align-items: flex-start; gap: 10px;
    min-width: 0;
}
.renew-confirm-planblock {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    flex: 1 1 0; min-width: 0;
}
.renew-confirm-plan-meta {
    color: #75847e; font-size: 11px; line-height: 1.35;
    white-space: nowrap; text-align: center;
}
.renew-confirm-plan.is-target { color: var(--brand-dark); border-color: #b9dfd7; background: var(--brand-soft); }
.renew-confirm-arrow {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 26px; padding: 2px 9px; border-radius: 20px;
    border: 1px solid #d2e9e4; background: #fff; color: var(--brand-dark);
    font-size: 11.5px; font-weight: 650; white-space: nowrap;
    box-shadow: 0 1px 2px rgba(15, 67, 61, .04);
    align-self: flex-start; margin-top: 1px;
}
.renew-confirm-used {
    display: flex; flex-direction: column; align-items: center; gap: 1px;
    padding: 8px 12px; min-width: 0; width: 146px; max-width: 100%;
    justify-self: end;
    border: 1px solid #e0eee9; border-radius: 9px;
    background: rgba(255, 255, 255, .86); text-align: center;
}
.renew-confirm-used-label { color: var(--muted); font-size: 10.5px; }
.renew-confirm-used b { color: #46545f; font-size: 12.5px; font-weight: 650; line-height: 1.35; }
.renew-confirm-used em { color: #7b8983; font-style: normal; font-size: 11px; line-height: 1.35; }
.renew-confirm-grid {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px; margin-top: 12px;
}
.renew-confirm-metric {
    min-height: 64px; padding: 10px 12px; border: 1px solid #e4ecef;
    border-radius: 10px; background: linear-gradient(180deg, #ffffff 0%, #f8fbfc 100%);
    box-shadow: 0 1px 2px rgba(15, 40, 38, .03);
    display: flex; flex-direction: column; justify-content: center; gap: 2px;
}
.renew-confirm-metric span { color: var(--muted); font-size: 11.5px; }
.renew-confirm-metric b {
    color: var(--ink); font-size: 15px; font-weight: 650;
    font-variant-numeric: tabular-nums; line-height: 1.3;
}
.renew-confirm-metric.is-pay {
    background: linear-gradient(135deg, #fffaf0 0%, #fff6e4 100%);
    border-color: #eddcb8; box-shadow: inset 3px 0 0 #e6b75f;
}
.renew-confirm-metric.is-pay b { color: #a96908; font-size: 18px; }
.renew-confirm-note {
    position: relative; margin-top: 12px; padding: 10px 12px 10px 38px;
    border-radius: 9px; border: 1px solid #f0dfb8;
    background: linear-gradient(135deg, #fff9eb 0%, #fff5df 100%);
    color: #85570b; font-size: 12.5px; line-height: 1.7;
}
.renew-confirm-note::before {
    content: "!"; position: absolute; left: 12px; top: 50%;
    width: 18px; height: 18px; margin-top: -9px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: #e2ae4c; color: #fff; font-size: 11px; font-weight: 700;
    box-shadow: 0 1px 3px rgba(176, 123, 26, .22);
}
.renew-confirm-note.is-pay {
    border-color: #cfe7e2; background: linear-gradient(135deg, #f4fcfa 0%, #eef9f7 100%);
    color: var(--brand-dark);
}
.renew-confirm-note.is-pay::before { content: "✓"; background: var(--brand); box-shadow: 0 1px 3px rgba(15, 157, 143, .2); }
.renew-confirm-footer .btn, .renew-confirm-dialog .modal-foot .btn { border-radius: 8px; }
.renew-confirm-primary {
    border-color: var(--brand-dark) !important;
    background: linear-gradient(135deg, #16aa9b 0%, #0b7f74 100%) !important;
    box-shadow: 0 6px 14px rgba(15, 157, 143, .22);
}
.renew-confirm-primary:hover {
    background: linear-gradient(135deg, #129789 0%, #086e65 100%) !important;
}
.renew-confirm-dialog .modal-foot { border-radius: 0 0 16px 16px; }

/* 集采确认弹窗：套餐明细行（左名称规格、右小计） */
.bulk-confirm-lines { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.bulk-confirm-line {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 12px; border: 1px solid #e4ecef; border-radius: 10px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfc 100%);
    box-shadow: 0 1px 2px rgba(15, 40, 38, .03);
}
.bulk-confirm-line-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bulk-confirm-name { color: var(--ink); font-weight: 600; font-size: 13.5px; }
.bulk-confirm-spec { color: var(--muted); font-size: 11.5px; }
.bulk-confirm-sub { color: var(--ink); font-weight: 650; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 520px) {
    .renew-confirm-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .renew-confirm-route { grid-template-columns: 1fr; align-items: start; }
    .renew-confirm-switch { width: 100%; }
    .renew-confirm-used {
        width: 100%; min-width: 0; margin-left: 0;
        flex-direction: row; flex-wrap: wrap; align-items: center; gap: 3px 8px;
    }
    .renew-confirm-used-label { width: 100%; }
}

.renew-rules { background: linear-gradient(120deg, #fff 0%, #f6fbfa 100%); }
.renew-rules ul { margin: 0; padding-left: 18px; color: #51606d; font-size: 13px; line-height: 1.9; }
.renew-rules li { margin-bottom: 3px; }
.renew-rules li b { color: var(--ink); }
.renew-redeem { background: linear-gradient(120deg, #f7fffd 0%, #fff 55%, #f8fbfd 100%); border-color: #d9eee9; }
.renew-redeem .row { margin-bottom: 0; }
.renew-redeem input { font-family: Consolas, "Cascadia Mono", monospace; letter-spacing: .4px; }

@media (max-width: 900px) {
    .renew-plan-table { min-width: 660px; }
    .renew-metrics { width: 100%; }
}
@media (max-width: 760px) {
    .renew-hero { padding: 22px; border-radius: 13px; }
    .renew-title { font-size: 22px; }
    .renew-metrics { grid-template-columns: 1fr 1fr; }
}

/* ---------------- 话术管理列表 ---------------- */
/* 五列：话术名、内容/附件、范围+分类、时间、操作，窄屏也不会把内容挤没 */
.phrase-title-cell { vertical-align: top; }
.phrase-title {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; font-size: 13.5px; font-weight: 600; line-height: 1.45;
    word-break: break-all; color: var(--ink);
}
.phrase-title-cell .tag { margin-top: 4px; }
.phrase-thumb { display: flex; align-items: center; gap: 9px; min-width: 0; }
.phrase-thumb-media {
    flex: 0 0 46px; width: 46px; height: 46px; border-radius: 8px;
    border: 1px solid #e4e9ef; background: #f7f9fb; display: flex;
    align-items: center; justify-content: center; overflow: hidden;
}
.phrase-thumb-file { font-size: 20px; text-decoration: none; }
.phrase-thumb-preview {
    padding: 0 !important; border: 1px solid #e4e9ef !important;
    background: #f7f9fb !important; cursor: zoom-in;
}
.phrase-thumb-preview:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.phrase-thumb-broken {
    width: 46px; height: 46px; border-radius: 8px; border: 1px solid #e4e9ef;
    background: #f7f9fb; display: flex; align-items: center; justify-content: center;
    font-size: 18px; color: #9aa6b2;
}
.phrase-thumb-img { width: 46px; height: 46px; object-fit: cover; display: block; }
.phrase-thumb-copy { flex: 1; min-width: 0; }
.phrase-thumb-name {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: 13px; color: #1e2833;
}
.phrase-thumb-name a { color: inherit; }
.phrase-thumb-note {
    margin-top: 2px; font-size: 11px; color: #9aa6b2; line-height: 1.35;
    white-space: normal; display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
}
.phrase-text-preview {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; max-width: 520px; line-height: 1.55; word-break: break-word;
}
.phrase-scope, .phrase-cat {
    vertical-align: middle;
    padding-left: 6px !important; padding-right: 6px !important;
}
.phrase-scope .tag {
    display: inline-block; max-width: 100%; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
}
.phrase-cat {
    color: var(--muted); overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
}
.phrase-time { line-height: 1.5; white-space: nowrap; }
.phrase-add-wrap { margin-left: auto; }
.phrase-check { width: 30px; text-align: center; padding-left: 6px !important; padding-right: 3px !important; vertical-align: top; }
.phrase-check input {
    width: 15px; height: 15px; margin: -3px 0 0; cursor: pointer;
    accent-color: var(--brand); vertical-align: middle;
}
.phrase-batch-bar {
    position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
    z-index: 80; display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; background: #fff; border: 1px solid var(--brand);
    border-radius: 10px; box-shadow: 0 8px 26px rgba(16, 42, 67, .18);
    font-size: 13px; white-space: nowrap;
}
.phrase-batch-bar[hidden] { display: none; }
.phrase-batch-bar form { margin: 0; }
.phrase-batch-bar b { color: var(--danger); }

/* 图片预览：列表里点图不直接下载，先看缩略图，弹窗里再显式下载原图 */
.phrase-image-modal {
    position: fixed; inset: 0; z-index: 120; display: flex;
    align-items: center; justify-content: center; padding: 24px;
    background: rgba(12, 20, 28, .72);
}
.phrase-image-modal[hidden] { display: none; }
.phrase-image-box {
    display: flex; flex-direction: column; max-width: 86vw; max-height: 86vh;
    overflow: hidden; background: #fff; border-radius: 14px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
}
.phrase-image-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; padding: 10px 14px; border-bottom: 1px solid var(--line);
}
.phrase-image-head b {
    min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: 13px; color: var(--ink);
}
.phrase-image-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.phrase-image-close {
    width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%;
    background: #f1f4f7; color: var(--muted); font-size: 20px; line-height: 1;
}
.phrase-image-close:hover { background: #e5ebf1; color: var(--ink); }
.phrase-image-body {
    display: flex; align-items: center; justify-content: center;
    min-width: 320px; min-height: 180px; padding: 0; background: #101820;
    overflow: auto;
}
.phrase-image-body img { display: block; max-width: 80vw; max-height: 72vh; object-fit: contain; }
select:disabled { background: #f7f9fb; color: #9aa6b2; cursor: not-allowed; }

/* 话术分页：左边总数，右边页码；翻页时保留范围/员工/分类/关键词 */
.phrase-pager {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px 18px; flex-wrap: wrap; padding-top: 14px;
}
.phrase-pager-info { color: var(--muted); font-size: 12.5px; }
.phrase-pager-info b { color: var(--ink); font-weight: 600; }
.phrase-pager-links { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pager-step, .pager-num {
    display: inline-flex; align-items: center; justify-content: center;
    height: 32px; min-width: 32px; padding: 0 10px; border: 1px solid var(--line);
    border-radius: 8px; background: #fff; color: var(--ink); font-size: 13px;
    text-decoration: none; white-space: nowrap;
}
.pager-num { padding: 0 8px; }
.pager-step:hover, .pager-num:hover { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-soft); }
.pager-num.on { border-color: var(--brand); background: var(--brand); color: #fff; font-weight: 600; }
.pager-step.is-off { color: #b6c0c8; background: #f8fafb; cursor: default; }
.pager-gap { padding: 0 2px; color: #9aa6b2; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table, .table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, .table th {
    text-align: left; font-weight: 600; color: var(--muted);
    font-size: 12.5px; padding: 8px 10px;
    border-bottom: 1px solid var(--line); white-space: nowrap;
    background: transparent;
}
td, .table td { padding: 10px; border-bottom: 1px solid #f1f4f7; vertical-align: middle; font-size: 13.5px; }
tbody tr:hover, tr:hover { background: #fafcfd; }
/* 当前套餐行：浅绿底 + 左侧主题色竖条，客户一眼能找到自己在用的那档 */
.current-plan td, .current-plan:hover td { background: #f0fbf7; }
.current-plan td:first-child { box-shadow: inset 3px 0 0 #1aa383; }
.strong { font-weight: 600; }
.dim { color: var(--muted); }
.small { font-size: 12px; }

/* ---------------- 登录日志来源快捷筛选 ---------------- */
.src-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.src-btn {
    display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 999px;
    font-size: 13px; font-weight: 500; color: var(--muted);
    background: #fff; border: 1px solid var(--line); transition: background .15s, color .15s, border-color .15s;
}
.src-btn:hover { background: var(--brand-soft); border-color: #c9eae4; color: var(--brand-dark); }
.src-btn.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

/* ---------------- 状态徽标 ---------------- */
.badge, .tag {
    display: inline-block; padding: 2px 8px; border-radius: 20px;
    font-size: 12px; line-height: 1.7; white-space: nowrap;
    background: #eff2f5; color: #5c6976;
}
.badge.gray, .tag.free { background: #eff2f5; color: #5c6976; }
.badge.green, .tag.active { background: #e7f6ef; color: #147a57; }
.badge.amber, .tag.trial { background: #fdf4e3; color: #96660a; }
.badge.red, .tag.expired, .tag.disabled { background: #fceaea; color: #a1302b; }
.tag.current { background: #179682; color: #fff; font-weight: 600; }
.badge.blue { background: #e8f1fb; color: #23608f; }

/* 套餐类型标签：内置档位固定配色，未知套餐走 p1-p4 轮转色 */
.tag.plan-free     { background: #eff2f5; color: #5c6976; }
.tag.plan-trial    { background: #fdf4e3; color: #96660a; }
.tag.plan-standard { background: #e8f1fb; color: #23608f; }
.tag.plan-pro      { background: #e7f6ef; color: #147a57; }
.tag.plan-duo      { background: #f1ecfb; color: #6a3fa8; }
.tag.plan-max      { background: #fdeee6; color: #a8481c; }
.tag.plan-p1       { background: #e6f5f4; color: #0f7a72; }
.tag.plan-p2       { background: #fbeef3; color: #a33f6b; }
.tag.plan-p3       { background: #eef1f7; color: #46587a; }
.tag.plan-p4       { background: #f2f6e6; color: #5f7322; }

/* ---------------- 按钮 ---------------- */
button, .btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 6px; padding: 8px 14px; border-radius: 8px;
    border: 1px solid transparent; cursor: pointer;
    font-size: 13px; font-family: inherit; white-space: nowrap;
    background: var(--brand); color: #fff; font-weight: 500;
    transition: background .15s, border-color .15s, color .15s;
}
button:hover, .btn-primary:hover { background: var(--brand-dark); }
button.gray, .btn-secondary { background: #fff; color: var(--ink); border-color: #ccd6e0; }
button.gray:hover, .btn-secondary:hover { background: #f4f7fa; }
button.red, .btn-danger { background: var(--danger); color: #fff; }
button.red:hover, .btn-danger:hover { background: #b53b35; }
button.ghost, .btn-ghost { background: transparent; color: var(--muted); border-color: transparent; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-xs { padding: 2px 8px; font-size: 11.5px; }
.btn.current { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 600; }
button:disabled, .btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------------- 表单 ---------------- */
input[type=text], input[type=password], input[type=number], input[type=date],
input:not([type]), select, textarea {
    font-family: inherit; font-size: 13.5px;
    padding: 8px 10px; border: 1px solid #ccd6e0; border-radius: 8px;
    background: #fff; color: var(--ink); outline: none;
    transition: border-color .15s, box-shadow .15s;
    width: 100%;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}
textarea { resize: vertical; }

label { display: block; color: var(--muted); font-size: 12.5px; margin: 0 0 6px; }

/* 纵向表单块（标签在输入框上方） */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label, .field > span { margin: 0; font-size: 12.5px; color: var(--muted); }
.field:last-of-type { margin-bottom: 18px; }

/* 团队资料：名称和手机号输入框不再占满半屏 */
.team-info-row { align-items: flex-end; }
.team-info-name { width: 320px; max-width: 100%; }
.team-info-phone { width: 200px; max-width: 100%; }

/* 旧页面用 .row 排横向表单 / 按钮组 */
.row, .form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row > div, .form-row > div { min-width: 0; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

/* 账号详情头部信息格：浅底小卡，标题与数值分层更清楚（独立于公共 grid3） */
.acc-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.acc-grid > div {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 10px;
}
.acc-grid > div label { margin-bottom: 3px; }
.acc-grid > div > :last-child { font-size: 14px; font-weight: 600; color: var(--ink); }

/* 帮助文章表单：标题占宽，分类居中，排序收窄 */
.help-form-grid { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr) 130px; gap: 12px; }
/* 发布状态下拉只按内容宽度收窄，不撑满整行 */
.help-status-select { max-width: 260px; }

/* ---------------- 详情页 ---------------- */
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 8px 12px; margin: 0; }
.kv dt { color: var(--muted); font-size: 12.5px; }
.kv dd { margin: 0; word-break: break-all; }

/* ---------------- 企业后台概览的店铺卡（原渐变 hero → 白卡） ---------------- */
.hero {
    background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
    padding: 18px 20px; margin-bottom: 18px;
}
.hero h1 { margin: 0 0 10px; font-size: 18px; font-weight: 600; color: var(--ink); }
.hero .sub {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
    color: var(--muted); font-size: 13px;
}
.hero .badge {
    display: inline-block; margin: 0; padding: 2px 9px; border-radius: 20px;
    font-size: 12px; background: var(--brand-soft); color: var(--brand-dark);
}

/* ---------------- 登录页 ---------------- */
.login-body {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at 30% 20%, #e9f4f2 0, #f4f6f8 45%, #eff3f6 100%);
    padding: 24px;
}
.login-card {
    width: 100%; max-width: 360px; background: #fff;
    border: 1px solid var(--line); border-radius: 14px;
    padding: 28px 26px; box-shadow: 0 18px 44px rgba(24, 44, 60, .1);
}
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.login-brand .logo { width: 38px; height: 38px; border-radius: 10px; font-size: 14px; flex: 0 0 38px; }
.login-brand strong { display: block; font-size: 16px; }
.login-brand small { color: var(--muted); font-size: 12px; }
.login-tip { color: #9aa6b2; font-size: 12px; text-align: center; margin: 16px 0 0; }

/* ---------------- 入口卡片（首页导航） ---------------- */
.entry-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.entry-card {
    display: flex; flex-direction: column; justify-content: center;
    min-height: 96px; padding: 16px 18px; text-decoration: none;
    border: 1px solid var(--line); border-radius: 10px; background: #fbfdfd;
    transition: border-color .15s, background .15s;
}
.entry-card:hover { border-color: var(--brand); background: var(--brand-soft); }
.entry-card b { display: block; font-size: 15px; color: var(--ink); margin-bottom: 4px; }
.entry-card span { font-size: 12.5px; color: var(--muted); }

/* ---------------- 页内标签条（一个侧栏页面里的几块功能分开看） ---------------- */
/* 分组管理、话术管理原来一页塞着好几块表单和列表，现在一次只显示一块；
   纯链接实现（index.php?p=xxx&t=yyy），刷新/收藏都能停在同一块。 */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 18px; }
.tabs a {
    padding: 7px 15px; border-radius: 8px; font-size: 13.5px;
    color: var(--muted); background: #fff; border: 1px solid var(--line);
    transition: background .15s, border-color .15s, color .15s;
}
.tabs a:hover { color: var(--brand-dark); border-color: #b9e6d9; background: var(--brand-soft); }
.tabs a.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1080px) {
    .stats, .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    /* 账号概览/邀请返利的六项摘要：平板宽度仍排两列，别一列拉到底 */
    .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid2 { grid-template-columns: 1fr; }
    .dash-two { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
    .grid3 { grid-template-columns: 1fr; }
    .help-form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .dash-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dash-steps { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .shell { flex-direction: column; }
    .sidebar {
        width: 100%; flex: none; height: auto; position: static;
        flex-direction: row; align-items: center; gap: 14px;
        padding: 12px 14px; flex-wrap: wrap;
    }
    .brand { padding: 0; }
    .nav { flex-direction: row; flex-wrap: wrap; margin: 0; }
    .nav a { padding: 7px 10px; }
    .side-foot { margin: 0 0 0 auto; border: 0; padding: 0; }
    .main { padding: 18px 16px 40px; }
    .card, .panel { padding: 16px; }
    .dash-hero { padding: 22px; border-radius: 13px; }
    .dash-hero h1 { font-size: 22px; }
    .dash-actions { width: 100%; }
    .dash-action { flex: 1; }
    .dash-stats { grid-template-columns: 1fr; }
    .dash-links { grid-template-columns: 1fr; }
}

/* ---------------- 弹窗（新增 / 编辑话术等） ---------------- */
dialog.modal {
    border: 0; padding: 0; width: min(900px, 94vw); max-height: 92vh;
    border-radius: 12px; background: #fff; color: var(--ink);
    box-shadow: 0 24px 64px rgba(15, 23, 42, .28);
}
dialog.modal::backdrop { background: rgba(15, 23, 42, .45); }
.modal-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 16px 22px; border-bottom: 1px solid var(--line);
}
.modal-body { padding: 18px 22px; max-height: calc(88vh - 150px); overflow-y: auto; }
.modal-foot {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 14px 22px; border-top: 1px solid var(--line);
    background: #fbfcfd; border-radius: 0 0 12px 12px;
}
.modal-body label { display: block; }
.modal-body input[type=file] { width: 100%; max-width: 100%; }
/* 批量改属性只改范围/员工/分类，弹窗不需要像新增话术那么宽 */
.phrase-bulk-dialog { width: min(620px, 94vw); }
/* ---------------- 话术类型分段按钮 / 附件选择行 ---------------- */
.seg {
    display: inline-flex; align-items: center; gap: 3px; padding: 3px;
    background: #fff; border: 1px solid #ccd6e0; border-radius: 8px;
}
.seg button {
    border: 0; background: transparent; color: var(--muted);
    padding: 6px 20px; border-radius: 6px; font-size: 13px;
}
.seg button:hover { background: #f4f7fa; color: var(--ink); }
.seg button.on, .seg button.on:hover { background: var(--brand); color: #fff; }
.seg button:disabled { color: #b7c2cc; cursor: not-allowed; background: #f6f8fa; }
.seg button:disabled:hover { background: #f6f8fa; color: #b7c2cc; }
.pick-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* ---------------- 素材放置框（点一下弹选择框，也可以直接把图片/文件拖进来） ---------------- */
.drop-box {
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 10px; min-height: 170px; padding: 20px;
    background: #fbfffd; border: 1px dashed #c9d6dd; border-radius: 8px;
    cursor: pointer; outline: none; transition: border-color .15s ease, background .15s ease;
}
.drop-box:hover, .drop-box:focus-visible { border-color: var(--brand); background: var(--brand-soft); }
.drop-box.over { border-color: var(--brand); background: var(--brand-soft); }
.drop-box img { max-width: 100%; max-height: 190px; border-radius: 8px; display: block; }
/* 素材框右上角的清除按钮：有素材时才出现，悬上去变红 */
.drop-x {
    position: absolute; top: 8px; right: 8px; z-index: 2;
    width: 28px; height: 28px; line-height: 25px;
    text-align: center; font-size: 16px; color: #9aa9a6;
    background: #fff; border: 1px solid #dbe6e3; border-radius: 50%;
    cursor: pointer; user-select: none; transition: color .15s ease, border-color .15s ease;
}
.drop-x:hover { color: #c0392b; border-color: #c0392b; background: #fff6f5; }
.drop-hint { text-align: center; line-height: 1.8; }
.drop-hint b { display: block; font-weight: 600; color: var(--ink); font-size: 14px; }
.drop-hint span { display: block; color: var(--muted); font-size: 12.5px; }
/* 弹窗内容区再给高一点，避免分类行被压在最底下要滚动 */
.modal-body { max-height: calc(90vh - 132px) !important; }
/* 用户列表这类列多的表：缩小行内边距，避免出现横向滚动条 */
table.compact th, table.compact td { padding: 9px 6px; }
table.compact td { font-size: 13px; }

/* 变更记录：套餐、到期日是核对依据，正常屏幕不折行；小屏空间不够时才允许换行 */
.ledger-billing-table td:nth-child(3), .ledger-billing-table td:nth-child(4),
.ledger-billing-table td:nth-child(5) { white-space: nowrap; }
@media (max-width: 1079.98px) {
    .ledger-billing-table td:nth-child(3), .ledger-billing-table td:nth-child(4),
    .ledger-billing-table td:nth-child(5) { white-space: normal; }
}

/* 分组/分类列表：平板宽度下重排列宽，别让改名输入框把保存按钮挤到删除列里 */
@media (max-width: 1080px) {
    .group-list-table th:nth-child(1) { width: 28% !important; }
    .group-list-table th:nth-child(2) { width: 8% !important; }
    .group-list-table th:nth-child(3) { width: 12% !important; }
    .group-list-table th:nth-child(4) { width: 38% !important; }
    .group-list-table th:nth-child(5) { width: 14% !important; }
    .cat-list-table th:nth-child(1) { width: 24% !important; }
    .cat-list-table th:nth-child(2) { width: 20% !important; }
    .cat-list-table th:nth-child(3) { width: 10% !important; }
    .cat-list-table th:nth-child(4) { width: 32% !important; }
    .cat-list-table th:nth-child(5) { width: 14% !important; }
    .groups-table .rename-form input[name=name] { flex: 0 1 150px; min-width: 0; }
}

/* 话术列表：标题和说明分左右，导入导出按钮跟筛选/重置并排在表单行里 */
.phrase-filter-head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 8px 16px; flex-wrap: wrap; margin-bottom: 12px;
}
.phrase-filter-head h2 { margin: 0; }
.phrase-io-tip { color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.phrase-io-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.phrase-io-actions .btn { padding: 6px 7px; font-size: 12px; line-height: 1.5; border-radius: 6px; white-space: nowrap; }

/* 话术导入页：说明、预览、确认三层分开，别让人一上来就点写库 */
.phrase-import-help h2, .phrase-import-preview h2 { margin-bottom: 4px; }
.phrase-import-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.phrase-import-head .btn { white-space: nowrap; }
.phrase-import-rules {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 6px 24px; margin: 14px 0 16px; padding: 12px 14px;
    background: #f8fbfb; border: 1px solid #e5eeec; border-radius: 8px;
    color: #4f5f6b; font-size: 13px; line-height: 1.7;
}
.phrase-import-rules b { color: var(--ink); font-weight: 600; }
.phrase-import-upload { align-items: flex-end; }
.phrase-import-sum { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.phrase-import-pill {
    display: inline-flex; align-items: center; min-height: 26px; padding: 2px 10px;
    border-radius: 20px; font-size: 12.5px; font-weight: 600;
}
.phrase-import-pill.is-new { background: #e7f6ef; color: #147a57; }
.phrase-import-pill.is-update { background: #e8f1fb; color: #23608f; }
.phrase-import-pill.is-bad { background: #fceaea; color: #a1302b; }
.phrase-import-pill.is-ok { background: #eff2f5; color: #5c6976; }
.phrase-import-scroll { max-height: 330px; overflow: auto; border: 1px solid #edf1f3; border-radius: 8px; }
.phrase-import-scroll table { margin: 0; }
.phrase-import-scroll thead th { position: sticky; top: 0; z-index: 1; background: #f7fafb; }
.phrase-import-sub { margin: 18px 0 8px; font-size: 14px; }
.phrase-import-actions { margin-top: 16px; padding-top: 14px; border-top: 1px dashed #e1e9ec; }
.phrase-import-skip { display: block; margin-bottom: 10px; color: #5c6976; font-size: 13px; line-height: 1.6; }
.phrase-import-skip input { vertical-align: -2px; margin-right: 4px; }
.phrase-import-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 640px) {
    .phrase-import-rules { grid-template-columns: 1fr; }
    .phrase-import-buttons .btn, .phrase-import-buttons button { width: 100%; }
}

/* ==========================================================================
   平台总后台（super）专属微调：仅作用于 .super-body，不影响企业后台 / 手机版
   原则：不改布局结构与功能，只提升层次、留白与轻质感
   ========================================================================== */
.super-body { background: #f2f5f8; }

/* 侧栏：深色竖向微渐变，品牌 logo 轻投影，选中项更沉稳 */
.super-body .sidebar {
    background: linear-gradient(180deg, #17222e 0%, #121b25 100%);
}
.super-body .brand .logo-img { box-shadow: 0 4px 10px rgba(15, 157, 143, .32); }
.super-body .nav a { border-radius: 9px; }
.super-body .nav a.on { box-shadow: 0 4px 12px rgba(15, 157, 143, .28); }

/* 主区标题：呼吸感 */
.super-body .page-head { margin-bottom: 20px; }
.super-body .page-head h1 { font-size: 23px; letter-spacing: -.3px; }
.super-body .page-sub { margin-top: 5px; }

/* 卡片：轻投影 + 圆角，标题左侧品牌竖条 */
.super-body .card,
.super-body .panel {
    border-radius: 12px;
    border-color: #e6ecf1;
    box-shadow: 0 1px 2px rgba(16, 42, 67, .06), 0 10px 26px rgba(16, 42, 67, .08);
}
.super-body .card h2,
.super-body .panel-head h2 { position: relative; padding-left: 11px; line-height: 1.3; }
.super-body .card h2::before,
.super-body .panel-head h2::before {
    content: ""; position: absolute; left: 0; top: 3px; bottom: 3px; width: 3px;
    border-radius: 3px; background: var(--brand);
}

/* 统计卡：轻投影，悬停微微上浮 */
.super-body .stat {
    border-radius: 12px;
    border-color: #e6ecf1;
    box-shadow: 0 1px 2px rgba(16, 42, 67, .05), 0 6px 18px rgba(16, 42, 67, .05);
    transition: box-shadow .15s, transform .15s, border-color .15s;
}
.super-body .stat:hover {
    border-color: #cfe6e1;
    box-shadow: 0 2px 4px rgba(16, 42, 67, .06), 0 10px 24px rgba(15, 77, 74, .10);
    transform: translateY(-1px);
}

/* 表格：表头浅青底，行 hover 更柔和 */
.super-body table th {
    background: #f6faf9;
    color: #55636f;
    border-bottom-color: #e8eef0;
}
.super-body table td { border-bottom-color: #f0f4f6; }
.super-body table tbody tr:hover td,
.super-body table tr:hover td { background: #f7fbfb; }

/* 概览·经营概况：左侧在售套餐条目 + 右侧 2×2 指标块 */
.super-body .ovv { display: grid; grid-template-columns: 1fr 1.1fr; gap: 22px; }
.super-body .ovv-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.super-body .ovv-metric {
    background: #f7faf9; border: 1px solid #e8f1ef; border-radius: 10px;
    padding: 10px 12px; display: flex; flex-direction: column; gap: 5px;
}
.super-body .ovv-num { font-size: 19px; font-weight: 600; color: var(--brand-dark); line-height: 1.1; }
.super-body .ovv-num small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.super-body .ovv-sub { font-size: 12px; color: var(--muted); line-height: 1.3; }
/* 可点击的统计卡 / 指标方块：去掉链接默认下划线与蓝色，沿用卡片配色 */
.super-body a.stat, .super-body a.ovv-metric { text-decoration: none; color: inherit; }
.super-body .ovv-plans { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.super-body .ovv-plan-list { display: flex; flex-direction: column; gap: 7px; }
.super-body .ovv-plan {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; border: 1px solid #edf1f4; border-radius: 9px; background: #fbfcfd;
}
.super-body .ovv-plan-name { font-weight: 600; font-size: 13px; min-width: 64px; }
.super-body .ovv-plan-price { color: var(--brand-dark); font-weight: 600; font-size: 13px; }
.super-body .ovv-plan-seats { margin-left: auto; color: var(--muted); font-size: 12px; }
@media (max-width: 900px) {
    .super-body .ovv { grid-template-columns: 1fr; }
}

/* 帮助文章富文本编辑器（wangEditor 本地部署）容器样式 */
.help-editor-toolbar {
    border: 1px solid #ccd6e0;
    border-bottom: 0;
    border-radius: 10px 10px 0 0;
    background: #fbfcfd;
    padding: 6px 8px;
}
.help-editor-body {
    border: 1px solid #ccd6e0;
    border-radius: 0 0 10px 10px;
    background: #fff;
    min-height: 320px;
    padding: 10px 12px;
}
.help-editor-body .w-e-text-container { min-height: 300px; }
/* 编辑器内图片按编辑区宽度等比缩放，避免高清截图原图撑得过大 */
.help-editor-body img { max-width: 100%; height: auto; border-radius: 8px; }

/* 工具栏行：菜单占满，「源码」以纯文字附在菜单右侧 */
.help-editor-toolbar-wrap { display: flex; align-items: stretch; gap: 8px; }
.help-editor-toolbar-wrap .help-editor-toolbar { flex: 1; }
.source-link {
    flex: 0 0 auto;
    align-self: center;
    padding: 6px 8px;
    font-size: 12.5px;
    font-family: inherit;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
}
.source-link:hover { background: #f4f7fa; color: var(--ink); }

/* 源码查看 / 编辑弹窗 */
.source-mask {
    position: fixed; inset: 0;
    background: rgba(20, 30, 38, .45);
    display: flex; align-items: center; justify-content: center;
    padding: 24px; z-index: 1000;
}
/* hidden 属性默认 display:none，上面的 display:flex 会覆盖它；这里显式还原，保证初始隐藏、关闭后真正收起 */
.source-mask[hidden] { display: none; }
/* 本机草稿按钮 / 提示：无草稿时真正隐藏（.btn 的 inline-flex 会覆盖 hidden） */
#helpDraftClear[hidden], #helpDraftTip[hidden] { display: none; }
.source-dialog {
    background: #fff; border-radius: 14px;
    width: 680px; max-width: 100%; height: 70vh;
    display: flex; flex-direction: column;
    box-shadow: 0 18px 50px rgba(20, 30, 38, .25);
    overflow: hidden;
}
.source-dialog-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.source-dialog-head strong { font-size: 15px; }
.source-dialog-x {
    border: 0; background: transparent; font-size: 22px; line-height: 1;
    color: var(--muted); cursor: pointer; padding: 2px 6px; border-radius: 6px;
}
.source-dialog-x:hover { background: #f4f7fa; color: var(--ink); }
.source-textarea {
    flex: 1; width: 100%; border: 0; resize: none;
    padding: 14px 18px; font-family: "Cascadia Mono", Consolas, monospace;
    font-size: 13px; line-height: 1.7; color: var(--ink);
    outline: none; background: #fbfcfd;
}
.source-dialog-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 18px; border-top: 1px solid var(--line);
}
.source-dialog-foot .tip { color: var(--muted); font-size: 12px; }
.source-dialog-actions { display: flex; gap: 8px; flex: 0 0 auto; }

/* ===================== 代理集采 ===================== */
.bulk-plan-list, .bulk-qty-list { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.bulk-plan, .bulk-qty {
    position: relative; border: 1px solid var(--line); border-radius: 12px;
    padding: 12px 16px; cursor: pointer; background: #fff; min-width: 150px;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.bulk-plan:hover, .bulk-qty:hover { background: #f7fbf9; }
.bulk-plan.on, .bulk-qty.on { border-color: #179682; background: #f0f9f5; box-shadow: 0 2px 10px rgba(23, 150, 130, .12); }
.bulk-plan input, .bulk-qty input { position: absolute; opacity: 0; pointer-events: none; }
.bulk-plan-name { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.bulk-plan-meta { color: var(--muted); font-size: 12px; }
.bulk-qty-num { font-weight: 600; font-size: 15px; margin-bottom: 2px; }
.bulk-qty-disc { color: #179682; font-size: 12.5px; font-weight: 600; }

/* 多套餐采购车：档位条 + 套餐行 + 汇总 */
/* 阶梯折扣档位条：淡品牌底容器，读取总后台启用档位展示给客户，当前命中档高亮 */
/* 未开通集采权限：标题说明下方的付费开通引导行，文案与按钮同行、窄屏换行 */
.bulk-access-note { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: -4px 0 16px; }
.bulk-access-note .tip { line-height: 1.5; }
.bulk-tier-bar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    background: var(--brand-soft); border: 1px solid #d3f0eb;
    border-radius: 14px; padding: 12px 14px; margin-bottom: 16px;
}
.bulk-tier-label { color: var(--brand-dark); font-size: 13px; font-weight: 600; margin-right: 2px; }
/* 会员折扣信息：贴到阶梯折扣条同一行右侧，窄屏换行后仍靠右；文案不折行；标签与正文按基线对齐 */
.bulk-tier-member { margin-left: auto; display: flex; align-items: baseline; gap: 8px; color: #33504a; font-size: 12.5px; line-height: 1.4; white-space: nowrap; }
.bulk-tier-member .bulk-tier-label { font-size: 12.5px; margin-right: 0; }
.bulk-tier-member .tip { color: #7a8a86; font-size: 12.5px; line-height: 1.4; }
.bulk-tier-chip {
    border: 1px solid #cdeee4; background: #fff; color: #147a57;
    border-radius: 999px; padding: 5px 11px; font-size: 12.5px; font-weight: 600;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.bulk-tier-chip.on {
    background: linear-gradient(135deg, #16aa9b 0%, #0b7f74 100%);
    border-color: var(--brand-dark); color: #fff;
    box-shadow: 0 3px 10px rgba(15, 157, 143, .25);
}

.bulk-cart-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 18px; }
.bulk-cart-row {
    position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px;
    border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px;
    background: #fff; transition: border-color .18s, box-shadow .18s, transform .18s;
}
.bulk-cart-row::before {
    content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 3px;
    border-radius: 3px; background: var(--brand); opacity: 0; transition: opacity .18s;
}
.bulk-cart-row:hover { border-color: #bfe6df; box-shadow: 0 6px 18px rgba(15, 157, 143, .10); transform: translateY(-1px); }
.bulk-cart-row:hover::before { opacity: 1; }
/* 数量大于 0：视为已选，左侧竖条常亮并轻微高亮卡片 */
.bulk-cart-row.is-selected { border-color: #bfe6df; background: linear-gradient(180deg, #fbfefd 0%, #f5fbf9 100%); }
.bulk-cart-row.is-selected::before { opacity: 1; }
.bulk-cart-info { min-width: 0; flex: 1; }
.bulk-plan-name { font-weight: 650; font-size: 15px; color: var(--ink); margin-bottom: 6px; }
.bulk-specs { display: flex; flex-wrap: wrap; gap: 6px 8px; margin-bottom: 8px; }
.bulk-spec { background: #f4f7f9; border: 1px solid #eef2f5; border-radius: 8px; padding: 3px 9px; color: var(--muted); font-size: 12px; }
.bulk-spec b { color: var(--ink); font-weight: 650; font-size: 13px; margin-right: 2px; }
.bulk-plan-meta { color: var(--muted); font-size: 12.5px; margin-bottom: 6px; }
.bulk-plan-price { font-size: 17px; font-weight: 700; color: var(--ink); }
.bulk-plan-price small { font-size: 11.5px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.bulk-cart-op { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; white-space: nowrap; }
.bulk-qty-box { display: flex; align-items: center; gap: 6px; }
.bulk-step {
    width: 32px; height: 38px; border: 1px solid var(--line); background: #fff;
    border-radius: 10px; color: var(--brand-dark); font-size: 17px; font-weight: 600;
    cursor: pointer; line-height: 1; transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.bulk-step:hover { background: var(--brand-soft); border-color: #bfe6df; }
.bulk-step:active { transform: scale(.96); }
.bulk-cart-op .bulk-qty-input {
    width: 64px; padding: 9px 8px; border: 1px solid var(--line); border-radius: 10px;
    font-size: 14px; text-align: center; transition: border-color .15s, box-shadow .15s;
}
.bulk-cart-op .bulk-qty-input:focus {
    outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15, 157, 143, .15);
}
.bulk-qty-input::-webkit-outer-spin-button,
.bulk-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bulk-qty-input { -moz-appearance: textfield; appearance: textfield; }
.bulk-row-sub { color: var(--ink); font-size: 13px; font-weight: 600; text-align: right; line-height: 1.4; }
.bulk-row-sub small { display: block; color: var(--muted); font-weight: 500; font-size: 11px; }

.bulk-summary {
    display: grid; grid-template-columns: repeat(6, minmax(90px, 1fr)); gap: 12px;
    background: linear-gradient(135deg, #f7fcfb 0%, #f2f8f7 100%);
    border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin-bottom: 14px;
}
.bulk-sum-row { border-left: 1px solid #e6efee; padding-left: 14px; }
.bulk-sum-row:first-child { border-left: 0; padding-left: 0; }
.bulk-sum-row span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.bulk-sum-row b { font-size: 17px; font-weight: 650; color: var(--ink); }
.bulk-sum-pay { border-left-color: #cdeee4; }
.bulk-sum-pay b { color: var(--brand-dark); }

.bulk-filters { margin-left: auto; }
.bulk-filters .row { display: flex; align-items: center; }
/* 我的卡密筛选区：搜索框 + 状态/套餐快捷按钮组，自动换行 */
.bulk-key-filters { margin-left: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.bulk-search-form { display: flex; align-items: center; gap: 6px; margin: 0; }
.bulk-kw-input {
  width: 150px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 13px; transition: border-color .15s, box-shadow .15s;
}
.bulk-kw-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15, 157, 143, .15); }
.bulk-chip-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
/* 套餐组（连同导出按钮）跟随状态组同一行排列，空间不足时自动换行 */
.bulk-chip-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
/* 卡密卡片头：标题与筛选区允许换行，标题保持一行不被挤压 */
.bulk-key-head { flex-wrap: wrap; }
.bulk-key-head h2 { flex-shrink: 0; white-space: nowrap; margin-bottom: 0; }
.bulk-key-code { font-family: "Cascadia Mono", Consolas, monospace; }
.bulk-key-op { white-space: nowrap; }
.bulk-key-op .btn { margin-right: 6px; }

/* 卡密状态配色 */
.tag.unused { background: #e7f6ef; color: #147a57; }
.tag.used { background: #e8f1fb; color: #23608f; }
.tag.void { background: #fceaea; color: #a1302b; }
.tag.void_pending { background: #fdf4e3; color: #96660a; }

@media (max-width: 720px) {
    .bulk-summary { grid-template-columns: repeat(2, 1fr); }
    .bulk-sum-row { border-left: 0; padding-left: 0; }
    .bulk-cart-list { grid-template-columns: 1fr; }
    .bulk-plan, .bulk-qty { min-width: 130px; }
    .bulk-cart-op { flex-direction: row; width: 100%; justify-content: space-between; align-items: center; }
    .bulk-row-sub { min-width: 0; }
}
