:root {
  --bg: #F6F7F9;
  --panel: #FFFFFF;
  --panel-2: #FBFCFD;
  --border: #E4E7EC;
  --border-strong: #D0D5DD;
  --text: #1A2233;
  --muted: #667085;
  --faint: #98A2B3;
  --brand: #3355D1;
  --brand-soft: #EFF2FD;
  --income: #E5484D;
  --income-soft: #FDECEC;
  --expense: #16A34A;
  --expense-soft: #E9F7EF;
  --warn: #D97706;
  --warn-soft: #FEF5E7;
  --radius: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; }

.boot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 100vh;
  color: var(--muted);
}
.boot-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand);
  animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: .25 } 50% { opacity: 1 } }

/* ---------- auth ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
}
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--brand);
  position: relative;
  flex: 0 0 auto;
}
.brand-mark::before, .brand-mark::after {
  content: ""; position: absolute; background: #fff; border-radius: 1px;
}
.brand-mark::before { width: 3px; height: 14px; left: 11px; top: 10px; }
.brand-mark::after { width: 3px; height: 14px; left: 20px; top: 10px; }
.brand-name { font-size: 17px; font-weight: 600; letter-spacing: .3px; }
.brand-logo { margin-bottom: 10px; }
.brand-logo img { height: 52px; width: auto; display: block; max-width: 100%; }
.auth-slogan { color: var(--text); font-size: 15px; font-weight: 600; margin: 0 0 6px; letter-spacing: .5px; }
.auth-sub { color: var(--muted); font-size: 13px; margin: 0 0 24px; }

.tabs { display: flex; gap: 4px; background: var(--bg); padding: 4px; border-radius: 10px; margin-bottom: 20px; }
.tabs button {
  flex: 1 1 auto; border: 0; background: transparent; padding: 8px 10px;
  border-radius: 7px; cursor: pointer; color: var(--muted); font-size: 13px;
  white-space: nowrap; line-height: 1.2;
}
.tabs button.active { background: var(--panel); color: var(--text); font-weight: 500; }

/* 页面级标签页（收支记账：收支明细 / 发票台账）与报表周期切换（月 / 季 / 年） */
#view .tabs .tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 12px; }
#view .tabs .tab .tab-sub { font-size: 11px; color: var(--faint); font-weight: 400; }
#view .tabs .tab.active .tab-sub { color: var(--muted); }
#view .tabs.tabs-seg { display: inline-flex; background: var(--bg); margin-bottom: 0; }
#view .tabs.tabs-seg .tab { flex: 0 0 auto; flex-direction: row; padding: 7px 16px; }

/* 登录页的演示入口（潜在客户不用手输 ?demo=1） */
.auth-demo { text-align: center; margin: 18px 0 0; font-size: 13px; position: relative; }
.auth-demo::before {
  content: ""; position: absolute; left: 0; right: 0; top: -10px;
  height: 1px; background: var(--border);
}
.auth-demo a { font-weight: 500; }
.auth-demo a:hover { text-decoration: underline; }

/* 联系开发者入口 + 微信二维码弹层 */
.auth-contact { text-align: center; margin: 10px 0 0; font-size: 13px; }
.auth-contact a { font-weight: 500; }
.auth-contact a:hover { text-decoration: underline; }
.qr-modal { text-align: center; padding: 4px 0 2px; }
.qr-img {
  width: 240px;
  max-width: 78vw;
  display: block;
  margin: 0 auto;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.qr-text { margin: 12px 0 0; font-size: 14px; font-weight: 500; }
.qr-hint { margin: 8px 0 0; font-size: 12px; color: var(--faint); }

/* 试用到期的整站拦截页 */
.trial-end { text-align: center; }
.trial-end .brand-logo { display: flex; justify-content: center; }
.trial-end-badge {
  display: inline-block; margin: 2px 0 12px; padding: 4px 14px; border-radius: 999px;
  background: var(--warn-soft); color: var(--warn); font-size: 12.5px; font-weight: 600;
}
.trial-end-title { font-size: 18px; line-height: 1.5; margin: 0 0 12px; color: var(--text); }
.trial-end-desc { font-size: 13.5px; line-height: 1.8; color: var(--muted); margin: 0 0 16px; }
.trial-end-desc b { color: var(--text); }
.trial-end-note {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 13px 15px; font-size: 13px; line-height: 1.7; color: var(--text);
  margin: 0 0 20px; text-align: left; white-space: pre-wrap; word-break: break-word;
}

@media (max-width: 460px) {
  .auth-card { padding: 26px 18px; }
  .tabs button { padding: 8px 6px; font-size: 12.5px; }
  #view .tabs .tab { padding: 8px 8px; }
}

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: #fff; color: var(--text); outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); }
.field .hint { font-size: 12px; color: var(--faint); margin-top: 5px; }
.field .err { font-size: 12px; color: var(--income); margin-top: 5px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: #fff; color: var(--text);
  cursor: pointer; font-size: 13px; white-space: nowrap;
}
.btn:hover { background: var(--panel-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: #2A46B4; }
.btn-block { width: 100%; padding: 11px 16px; font-size: 14px; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--bg); }
.btn-danger { color: var(--income); border-color: #F3C6C6; }
.btn-danger:hover { background: var(--income-soft); }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 216px; flex: 0 0 216px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 20px 12px;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; }
.side-org { padding: 0 8px 16px; font-size: 12px; color: var(--faint); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-group { font-size: 11px; color: var(--faint); padding: 14px 10px 6px; letter-spacing: .5px; }
.nav a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 10px; border-radius: var(--radius-sm);
  color: var(--muted); font-size: 13.5px;
}
.nav a:hover { background: var(--bg); color: var(--text); }
.nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 500; }
.nav .pill {
  font-size: 11px; background: var(--income); color: #fff;
  border-radius: 20px; padding: 1px 7px; font-weight: 400;
}

.side-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); }
.who { display: flex; align-items: center; gap: 9px; padding: 6px 8px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto;
  background: var(--brand-soft); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 500;
}
.who-meta { min-width: 0; }
.who-name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-role { font-size: 11px; color: var(--faint); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 18px 28px; border-bottom: 1px solid var(--border);
  background: var(--panel); position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 17px; }
.topbar .sub { font-size: 12px; color: var(--faint); margin-top: 2px; }
.top-actions { display: flex; gap: 8px; align-items: center; }

.view { padding: 24px 28px 64px; flex: 1; }
.mobile-nav { display: none; }

/* ---------- cards ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.card + .card { margin-top: 16px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.card-head h3 { font-size: 14px; }
.card-head .sub { font-size: 12px; color: var(--faint); font-weight: 400; }

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-5-7 { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }

.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.stat .k { font-size: 12.5px; color: var(--muted); }
.stat .v { font-size: 25px; font-weight: 600; letter-spacing: -.5px; margin: 6px 0 2px; }
.stat .f { font-size: 12px; color: var(--faint); }
.stat.income .v { color: var(--income); }
.stat.expense .v { color: var(--expense); }
.stat.brand .v { color: var(--brand); }
.stat.warn .v { color: var(--warn); }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px;
  padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--panel-2); }
.num { font-variant-numeric: tabular-nums; }
.t-income { color: var(--income); font-weight: 500; }
.t-expense { color: var(--expense); font-weight: 500; }
.t-right { text-align: right; }
.t-muted { color: var(--faint); font-size: 12.5px; }
.t-strong { font-weight: 500; }
.who-cell { display: flex; align-items: center; gap: 9px; }

/* ---------- badge ---------- */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: 12px; line-height: 1.6; white-space: nowrap;
}
.badge.gray { background: var(--bg); color: var(--muted); }
.badge.green { background: var(--expense-soft); color: var(--expense); }
.badge.red { background: var(--income-soft); color: var(--income); }
.badge.blue { background: var(--brand-soft); color: var(--brand); }
.badge.amber { background: var(--warn-soft); color: var(--warn); }

/* ---------- misc ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.toolbar .spacer { flex: 1; }
.toolbar input, .toolbar select {
  padding: 8px 11px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: #fff; outline: none;
  font-size: 13px;
}
.toolbar input:focus, .toolbar select:focus { border-color: var(--brand); }
.search { min-width: 190px; }

.empty { text-align: center; padding: 48px 20px; color: var(--faint); }
.empty h4 { font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.empty p { margin: 0 0 16px; font-size: 13px; }

.bars { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 8px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar-pair { display: flex; gap: 3px; align-items: flex-end; flex: 1; min-height: 0; width: 100%; justify-content: center; }
.bar { width: 13px; border-radius: 3px 3px 0 0; min-height: 2px; }
.bar.i { background: var(--income); }
.bar.e { background: var(--expense); }
.bar-x { font-size: 11.5px; color: var(--faint); }

.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; }

.cat-row { display: grid; grid-template-columns: 96px 1fr 84px; gap: 12px; align-items: center; padding: 7px 0; }
.cat-track { height: 8px; background: var(--bg); border-radius: 20px; overflow: hidden; }
.cat-fill { height: 100%; border-radius: 20px; background: var(--expense); }
.cat-amt { text-align: right; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); }

.note-box {
  background: var(--brand-soft); border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 13px; color: #2B3F9E; margin-bottom: 16px;
}

/* ---------- toast ---------- */
.toast-host { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: #23304A; color: #fff; padding: 9px 16px; border-radius: 8px;
  font-size: 13px; max-width: 80vw;
}
.toast.ok { background: #12693B; }
.toast.err { background: #A02626; }

/* ---------- modal ---------- */
.mask {
  position: fixed; inset: 0; background: rgba(16,24,40,.42);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 150;
}
.modal {
  background: var(--panel); border-radius: 14px; width: 100%; max-width: 520px;
  max-height: 88vh; overflow-y: auto; padding: 24px;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-head h3 { font-size: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.x { border: 0; background: transparent; font-size: 20px; line-height: 1; color: var(--faint); cursor: pointer; padding: 0 4px; }

/* ---------- 跟进记录（时间线） ---------- */
.fu-meta {
  padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 14px;
}
.fu-title {
  display: flex; align-items: baseline; gap: 8px; font-size: 13px; font-weight: 600;
  margin: 16px 0 10px;
}
.fu-title .sub { font-size: 12px; color: var(--faint); font-weight: 400; }
.fu-empty { font-size: 13px; color: var(--faint); padding: 10px 0 4px; }
.fu-list { position: relative; padding-left: 16px; }
.fu-list::before {
  content: ""; position: absolute; left: 4px; top: 8px; bottom: 8px;
  width: 1px; background: var(--border);
}
.fu-item { position: relative; padding-bottom: 12px; }
.fu-dot {
  position: absolute; left: -16px; top: 7px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--panel); border: 2px solid var(--brand);
}
.fu-body {
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
}
.fu-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.fu-n { font-weight: 600; color: var(--brand); font-size: 12px; }
.fu-head .badge { font-size: 11px; padding: 1px 7px; }
.fu-text { font-size: 13px; margin-top: 6px; color: var(--text); word-break: break-word; }
.fu-del { margin-left: auto; }

/* ---------- 区块标题 ---------- */
.sec-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 22px 0 12px; }
.sec-title h3 { font-size: 14px; }
.sec-title .sub { font-size: 12px; color: var(--faint); }

/* ---------- 饼图 ---------- */
.pie-row { display: flex; gap: 18px; flex-wrap: wrap; }
.pie-box { flex: 1 1 220px; min-width: 200px; }
.pie-box > h4 { font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 0 0 8px; }
.pie-wrap { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pie-svg { flex: 0 0 auto; display: block; }
.pie-legend { flex: 1 1 116px; min-width: 108px; display: flex; flex-direction: column; gap: 6px; }
.pie-li {
  display: grid; grid-template-columns: 9px minmax(0, 1fr) auto auto;
  gap: 7px; align-items: center; font-size: 12.5px;
}
.pie-li > i { width: 9px; height: 9px; border-radius: 2px; display: block; }
.pie-nm { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pie-li > b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.pie-pc { color: var(--faint); min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- 进度条（课时 / 周期进度） ---------- */
.prog-row {
  display: grid; grid-template-columns: 118px minmax(0, 1fr) 128px;
  gap: 12px; align-items: center; padding: 7px 0;
}
.prog-row + .prog-row { border-top: 1px solid var(--border); }
.prog-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prog-name .t-muted { font-size: 11.5px; }
.prog-track { height: 8px; background: var(--bg); border-radius: 20px; overflow: hidden; }
.prog-fill { height: 100%; border-radius: 20px; background: var(--brand); transition: width .3s ease; }
.prog-fill.warn { background: var(--warn); }
.prog-fill.full { background: var(--income); }
.prog-fill.idle { background: var(--faint); }
.prog-meta { text-align: right; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

@media (max-width: 980px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-5 { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-5-7 { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 760px) {
  .app { display: block; }
  .sidebar {
    position: static; width: auto; height: auto; flex: none;
    border-right: 0; border-bottom: 1px solid var(--border);
    padding: 14px 16px;
  }
  .side-brand { padding-bottom: 12px; }
  .side-org { padding-bottom: 10px; }
  .nav { flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 4px; }
  .nav-group { display: none; }
  .nav a { white-space: nowrap; padding: 7px 12px; }
  .side-foot { margin-top: 12px; padding-top: 12px; display: flex; justify-content: space-between; align-items: center; }
  .view { padding: 18px 16px 48px; }
  .topbar { padding: 14px 16px; position: static; }
  .grid-4, .grid-5, .grid-3, .grid-2 { grid-template-columns: minmax(0,1fr); }
  .row-2 { grid-template-columns: minmax(0,1fr); }
  .prog-row { grid-template-columns: 92px minmax(0,1fr) 112px; gap: 8px; }
  .pie-box { flex: 1 1 100%; min-width: 0; }
}

/* ---------- ICP 备案页脚 ---------- */
.beian { text-align: center; padding: 18px 12px 26px; font-size: 12px; color: var(--faint); background: var(--bg); }
.beian a { color: var(--faint); text-decoration: none; }
.beian a:hover { color: var(--muted); text-decoration: underline; }
.beian-org { margin-left: 10px; }
@media (max-width: 640px) { .beian-org { display: block; margin: 4px 0 0; } }

/* ---------- 员工权限多选 ---------- */
.role-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.role-checks label { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text); cursor: pointer; white-space: nowrap; }
.role-checks input { margin: 0; cursor: pointer; }

/* ---------- 视频号主页 / 外链 ---------- */
a.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.video-home .vh-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.video-home .vh-host { font-size: 12px; }
.link-title { color: var(--brand, #3355D1); text-decoration: none; border-bottom: 1px dashed currentColor; }
.link-title:hover { text-decoration: none; border-bottom-style: solid; }
.ext-link { color: var(--brand, #3355D1); }

/* ---------- 社交账号（视频号 / 小红书，可建多个） ---------- */
.social-accounts .acct-list { display: flex; flex-direction: column; gap: 10px; }
.social-accounts .acct-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--panel-2);
}
.social-accounts .acct-main { min-width: 0; }
.social-accounts .acct-act { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.social-accounts .vh-host { font-size: 12px; }

/* ---------- 学员专属链接：公开查询页（无需登录，手机优先） ---------- */
.pub {
  max-width: 640px;
  margin: 0 auto;
  padding: 18px 14px 40px;
}
.pub-head { text-align: center; padding: 10px 0 16px; }
.pub-org { font-size: 19px; font-weight: 600; letter-spacing: .2px; }
.pub-title { font-size: 13px; color: var(--muted); margin-top: 4px; }

.pub-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
.pub-msg { text-align: center; color: var(--muted); }
.pub-msg b { display: block; color: var(--text); font-size: 16px; margin-bottom: 8px; }
.pub-msg p { margin: 0 0 4px; }

.pub-inline { display: flex; gap: 8px; margin-top: 14px; }
.pub-inline input {
  flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); text-align: center; letter-spacing: 3px; font-size: 16px;
}

.pub-alert {
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 14px;
}
.pub-alert.red { background: var(--income-soft); color: var(--income); }
.pub-alert.amber { background: var(--warn-soft); color: var(--warn); }

.pub-stu { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.pub-avatar {
  width: 46px; height: 46px; flex: none; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand);
  display: flex; align-items: center; justify-content: center; font-size: 19px; font-weight: 600;
}
.pub-name { font-size: 17px; font-weight: 600; }
.pub-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.pub-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--border); margin-top: 14px; border-radius: var(--radius-sm); overflow: hidden; }
.pub-cell { background: var(--panel); padding: 12px 12px 12px; }
.pub-cell .k { font-size: 12px; color: var(--muted); }
.pub-cell .v { font-size: 19px; font-weight: 600; margin-top: 2px; }
.pub-cell .f { font-size: 11.5px; color: var(--faint); margin-top: 2px; }

.pub-card-head { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.pub-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.pub-table table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pub-table th, .pub-table td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.pub-table th { color: var(--muted); font-weight: 500; font-size: 12px; }
.pub-table tbody tr:last-child td { border-bottom: none; }
.pub-empty { color: var(--muted); font-size: 13px; padding: 6px 0; }

.pub-foot { text-align: center; color: var(--muted); font-size: 12.5px; }
.pub-foot p { margin: 0 0 6px; }
.pub-foot a { font-weight: 600; }
.pub-tip { color: var(--faint); }

/* ---------- 学员链接管理弹窗 ---------- */
.plink-new { border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 12px; }
.plink-chk { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }
.plink-chk input { margin-top: 3px; }
.plink-row2 { display: flex; gap: 8px; margin-top: 10px; }
.plink-row2 input {
  flex: 1; min-width: 0; padding: 8px 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
.plink-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 10px; background: var(--panel-2); }
.plink-item.off { opacity: .62; }
.plink-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; font-size: 13px; }
.plink-url {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--panel); color: var(--muted); font-size: 12px; font-family: ui-monospace, Menlo, Consolas, monospace;
}
.plink-act { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- 表单字段说明 ---------- */
.field-hint { color: var(--faint); font-size: 12px; margin-top: 4px; line-height: 1.5; }

/* ---------- 金额正负 ---------- */
.pos { color: var(--text); font-weight: 600; }
.neg { color: var(--income); font-weight: 600; }

/* ---------- 首页任务进度横条 ---------- */
.task-strip { margin-bottom: 16px; }
.task-strip-head { display: block; color: inherit; }
.task-strip-head h3 { font-size: 15px; }
.task-strip-head .sub { color: var(--faint); font-size: 12px; display: block; margin-top: 2px; }
.task-strip-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 13px; }
.ts-label { width: 34px; color: var(--muted); flex: 0 0 auto; }
.ts-bar {
  flex: 1; height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; display: block;
}
.ts-bar.mini { height: 6px; margin-top: 6px; max-width: 220px; }
.ts-bar i { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.ts-num { width: 52px; text-align: right; color: var(--muted); flex: 0 0 auto; }

/* ---------- 任务清单 ---------- */
.task-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 0;
  border-top: 1px solid var(--border);
}
.task-item:first-of-type { border-top: 0; }
.task-item.is-done .task-title { text-decoration: line-through; color: var(--faint); }
.task-item.is-over { background: var(--warn-soft); border-radius: var(--radius-sm); padding: 10px; }
.task-tick { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 3px; }
.task-tick.auto {
  display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px;
  border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 11px;
}
.task-body { flex: 1; min-width: 0; }
.task-title { font-weight: 500; word-break: break-word; }
.task-meta { color: var(--faint); font-size: 12px; margin-top: 2px; }

@media (max-width: 760px) {
  .task-strip-row { font-size: 12px; }
  .ts-label { width: 30px; }
  .ts-num { width: 44px; }
  .task-item { flex-wrap: wrap; }
}

/* ---------- 行内文字按钮（如统计维度切换） ---------- */
.link-btn {
  border: 0; background: none; padding: 0 2px; cursor: pointer;
  color: var(--brand); font-size: 12px; text-decoration: underline;
}
.link-btn.on { color: var(--text); font-weight: 600; text-decoration: none; }

/* ---------- 净利瀑布（分摊收入 → 课时费 → 毛利 → 底薪 → 净利） ---------- */
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.flow-item {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 14px; min-width: 152px;
}
.flow-item .fk { display: block; font-size: 12px; color: var(--faint); }
.flow-item b { font-size: 17px; font-variant-numeric: tabular-nums; }
.flow-op { color: var(--faint); font-weight: 600; }
.flow-item.net { border-color: var(--brand); background: var(--brand-soft); }
.flow-item.net b { color: var(--brand); }
.flow-item.in b { color: var(--income); }
@media (max-width: 760px) {
  .flow { gap: 6px; }
  .flow-item { min-width: calc(50% - 12px); flex: 1 1 calc(50% - 12px); padding: 8px 10px; }
  .flow-item b { font-size: 15px; }
  .flow-op { display: none; }
}

/* ---------- 柱状图第三 / 第四色（净利 · 课酬成本） ---------- */
.bar.n { background: var(--brand); }
.bar.b { background: var(--warn); }

/* ---------- 导出的网页报表 ---------- */
.rpt-body { padding: 22px; }
.rpt-wrap { max-width: 1080px; margin: 0 auto; }
@media print { .rpt-body { padding: 0; } .card, .stat { break-inside: avoid; } }

/* ---------- 密集柱状图（逐日 / 多系列，自动收窄避免溢出） ---------- */
.bars.dense { gap: 6px; }
.bars.dense .bar-pair { gap: 2px; }
.bars.dense .bar { width: 8px; }
.bars.dense .bar-x { font-size: 10.5px; }
.bars-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.bars-scroll .bars { min-width: 620px; }
@media (max-width: 760px) { .bars.dense .bar { width: 6px; } }

/* ---------- 盈亏平衡仪表盘 ---------- */
.be-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.be-card.reached { border-color: #B7E4C7; }
.be-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.be-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.be-sub { font-size: 12.5px; color: var(--faint); margin-top: 2px; font-weight: 400; }
.be-badge { padding: 4px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--warn-soft); color: var(--warn); white-space: nowrap; }
.be-badge.ok { background: var(--expense-soft); color: var(--expense); }
.be-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.be-cell { background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.be-cell .k { font-size: 12px; color: var(--muted); }
.be-cell .v { font-size: 20px; font-weight: 600; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.be-cell .f { font-size: 11.5px; color: var(--faint); }
.be-bar { margin-top: 14px; }
.be-track { height: 10px; background: var(--bg); border-radius: 20px; overflow: hidden; }
.be-fill { height: 100%; border-radius: 20px; background: linear-gradient(90deg, var(--brand), #5B7BE8); }
.be-card.reached .be-fill { background: linear-gradient(90deg, var(--expense), #34C77B); }
.be-meta { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.be-tip { margin-top: 12px; font-size: 12.5px; color: var(--muted); background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
@media (max-width: 760px) { .be-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- 学员预警 ---------- */
.alert-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.alert-card.hot { border-color: #F3C9C9; }
.alert-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.alert-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.alert-list { display: flex; flex-direction: column; gap: 8px; }
.alert-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; }
.alert-item .spacer { flex: 1; }
@media (max-width: 760px) { .alert-item { flex-wrap: wrap; } }

/* ---------- 支出发票：上传控件 ---------- */
.up-mount { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.up-input { display: none; }
.up-tip { font-size: 12px; color: var(--faint); }
.up-list { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; margin-top: 8px; }
.up-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 6px 4px 10px;
  background: var(--brand-soft); color: var(--brand); border: 1px solid #D6DEF8; border-radius: 999px; font-size: 12.5px; }
.up-chip .up-size { color: var(--muted); }
.up-del { border: 0; background: transparent; color: var(--brand); font-size: 15px; line-height: 1;
  cursor: pointer; padding: 0 2px; }
.up-del:hover { color: var(--income); }

/* ---------- 支出发票：明细表里的徽标 ---------- */
.inv-badge { border: 1px solid #D6DEF8; background: var(--brand-soft); color: var(--brand);
  border-radius: 999px; padding: 2px 10px; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.inv-badge:hover { border-color: var(--brand); }
.inv-add { border: 1px dashed var(--border-strong); background: transparent; color: var(--muted);
  border-radius: 999px; padding: 2px 10px; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.inv-add:hover { border-color: var(--brand); color: var(--brand); }

/* ---------- 支出发票：弹窗与台账 ---------- */
.inv-head { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 13px; }
.inv-head > div { min-width: 0; }
.inv-head .k { display: block; font-size: 11.5px; color: var(--faint); }
.inv-head b { display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 12px; }
.inv-item { display: flex; flex-direction: column; gap: 8px; background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px; min-width: 0; }
.inv-thumb { width: 100%; height: 118px; object-fit: cover; border-radius: 6px; background: #fff; border: 1px solid var(--border); display: block; }
.inv-thumb-pdf, .inv-thumb-loading { display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: var(--muted); background: var(--bg); }
.inv-meta { min-width: 0; }
.inv-name { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-ops { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.inv-group { border-top: 1px solid var(--border); padding: 14px 0; }
.inv-group:first-child { border-top: 0; padding-top: 4px; }
.inv-group-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.inv-group-head .spacer { flex: 1; min-width: 8px; }
.inv-note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
@media (max-width: 760px) {
  .inv-head { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inv-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .inv-thumb { height: 96px; }
  .inv-note { max-width: 100%; }
}

/* ---------- 社交截图存档 / 截图识别 ---------- */
.shot-tag { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px;
  font-size: 12px; color: var(--accent, #0f766e); background: rgba(15, 118, 110, .08);
  border-radius: 999px; padding: 1px 8px; }
.card-sub { background: var(--bg-soft, #f8fafc); border: 1px solid var(--line, #e2e8f0);
  border-radius: 10px; padding: 12px; }
.shot-rules { margin-top: 14px; padding: 12px 14px; border-left: 3px solid var(--accent, #0f766e);
  background: var(--bg-soft, #f8fafc); border-radius: 0 10px 10px 0; font-size: 13px; line-height: 1.7; }
.shot-rules b { display: block; margin-bottom: 6px; }
.shot-rules ul { margin: 0; padding-left: 18px; }
.shot-status { margin-top: 14px; padding: 12px 14px; border-radius: 10px; font-size: 13px;
  background: var(--bg-soft, #f8fafc); border: 1px dashed var(--line, #e2e8f0); color: var(--text-muted, #64748b); }
.shot-status.is-err { border-color: #f0b4b4; background: #fdf3f3; color: #b91c1c; }
.shot-result { margin-top: 14px; border: 1px solid var(--line, #e2e8f0); border-radius: 10px; overflow: hidden; }
.shot-result-head { padding: 9px 12px; font-size: 13px; font-weight: 600;
  background: var(--bg-soft, #f8fafc); border-bottom: 1px solid var(--line, #e2e8f0); }
.shot-kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.shot-kv-row { display: flex; gap: 8px; padding: 8px 12px; font-size: 13px;
  border-bottom: 1px solid var(--line-soft, #eef2f7); }
.shot-kv-row .k { color: var(--text-muted, #64748b); flex: 0 0 96px; }
.shot-kv-row .v { font-weight: 600; word-break: break-all; }
.shot-kv-row.is-empty .v { font-weight: 400; color: var(--text-muted, #94a3b8); }
.shot-sum { padding: 6px 0 2px; font-size: 12.5px; line-height: 1.7; }
.shot-sum b { color: var(--accent, #0f766e); }
.shot-sum ul { margin: 2px 0 6px; padding-left: 18px; }
.sum-reply { margin-top: 6px; padding: 7px 10px; border-radius: 8px; font-size: 12.5px;
  background: var(--bg-soft, #f8fafc); border-left: 3px solid var(--accent, #0f766e); }
@media (max-width: 760px) {
  .shot-kv { grid-template-columns: 1fr; }
}
