/* ==========================================================================
   高德本地生活 · 客户管理系统 —— 设计系统
   浅色主题，面向业务场景：高信息密度、清晰层级、移动端可用
   ========================================================================== */

:root {
  --brand: #1B6FE0;
  --brand-dark: #1257BC;
  --brand-soft: #EAF2FD;
  --brand-border: #BCD8F8;

  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --surface-2: #FAFBFC;
  --border: #E3E8EF;
  --border-strong: #CBD3DE;

  --text: #1A2029;
  --text-2: #55606F;
  --text-3: #8A94A3;

  --success: #0E9F6E;
  --success-soft: #E3F6EF;
  --warning: #C77700;
  --warning-soft: #FDF2E0;
  --danger: #D93F3F;
  --danger-soft: #FDECEC;
  --info: #1B6FE0;
  --info-soft: #EAF2FD;
  --neutral-soft: #F0F2F5;

  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(20, 30, 45, .06);
  --shadow: 0 2px 10px rgba(20, 30, 45, .08);
  --shadow-lg: 0 12px 40px rgba(20, 30, 45, .16);

  --sidebar-w: 216px;
  --header-h: 58px;
}

* { box-sizing: border-box; }

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

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

button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* ---------------------------------------------------------------- 登录页 */

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1000px 500px at 15% -10%, #E4EEFC 0%, transparent 55%),
    radial-gradient(800px 400px at 90% 110%, #EAF0F9 0%, transparent 55%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 34px 32px 30px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 6px;
}

.login-logo {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 17px;
  flex-shrink: 0;
}

.login-title { font-size: 19px; font-weight: 650; letter-spacing: -.2px; }
.login-sub { color: var(--text-3); font-size: 13px; margin-bottom: 24px; }

.login-hint {
  margin-top: 18px;
  padding: 11px 13px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.8;
}

.login-hint code {
  background: var(--brand-soft);
  color: var(--brand-dark);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11px;
}

/* 访问链接区块：便于转发给同事，链接需带 sharecode 才能通过网关鉴权 */
.login-link {
  margin-top: 12px;
  padding: 11px 13px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.login-link-title {
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 7px;
}

.login-link-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.login-link-url {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  color: var(--text-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 5px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.login-link-note {
  margin-top: 7px;
  font-size: 11px;
  line-height: 1.7;
  color: var(--text-3);
}

/* ---------------------------------------------------------------- 布局 */

.shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-head {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-logo {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.sidebar-name { font-weight: 650; font-size: 13.5px; line-height: 1.25; }
.sidebar-name small { display: block; font-weight: 400; font-size: 11px; color: var(--text-3); }

.nav {
  padding: 12px 10px;
  flex: 1;
}

.nav-group-label {
  font-size: 11px;
  color: var(--text-3);
  padding: 12px 8px 5px;
  font-weight: 600;
  letter-spacing: .3px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  cursor: pointer;
  font-size: 13.5px;
  transition: background .12s, color .12s;
  user-select: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }

.nav-icon { width: 17px; text-align: center; flex-shrink: 0; opacity: .85; }

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  min-width: 17px;
  height: 17px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  font-weight: 600;
}

.sidebar-foot {
  padding: 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-dark);
  display: grid;
  place-items: center;
  font-weight: 650;
  font-size: 12px;
  flex-shrink: 0;
}

.user-chip-info { min-width: 0; flex: 1; }
.user-chip-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip-role { font-size: 11px; color: var(--text-3); }

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 22px;
  position: sticky;
  top: 0;
  z-index: 20;
  flex-shrink: 0;
}

.topbar h1 { font-size: 16px; font-weight: 650; margin: 0; letter-spacing: -.2px; }
.topbar-spacer { flex: 1; }

.mobile-menu-btn {
  display: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 15px;
}

.content { padding: 20px 22px 44px; flex: 1; }

/* ---------------------------------------------------------------- 按钮 */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background .12s, border-color .12s, opacity .12s;
  white-space: nowrap;
}

.btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--text-3); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); border-color: var(--brand-dark); }

.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #B93232; border-color: #B93232; }

.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--neutral-soft); border-color: transparent; }

.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn-block { width: 100%; }

/* ---------------------------------------------------------------- 表单 */

.field { margin-bottom: 15px; }

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 5px;
}

.field label .req { color: var(--danger); margin-left: 2px; }

.input, .select, .textarea {
  width: 100%;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  transition: border-color .12s, box-shadow .12s;
  outline: none;
}

.textarea { height: auto; padding: 9px 11px; resize: vertical; min-height: 72px; line-height: 1.6; }

.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.input::placeholder, .textarea::placeholder { color: var(--text-3); }

.field-hint { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.checkbox-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 12.5px;
  cursor: pointer;
  background: var(--surface);
  transition: all .12s;
  user-select: none;
}

.checkbox-chip:hover { border-color: var(--brand-border); background: var(--brand-soft); }
.checkbox-chip.checked { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-dark); font-weight: 500; }

/* 只读展示字段（如客户档案里不可改的「广告产品」） */
.input-static {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13px;
}

/* 推送群组：配置状态标记 */
.config-state {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}
.config-state.ok {
  background: var(--success-soft);
  color: var(--success);
}
.config-state.miss {
  background: var(--danger-soft);
  color: var(--danger);
}

.channel-list td .cell-strong {
  font-weight: 500;
  color: var(--text-1);
}
.channel-list tr.row-editing {
  background: var(--brand-soft);
}

/* 单群组编辑面板 */
.channel-editor-box {
  margin-top: 4px;
}

.channel-editor {
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 14px;
}

.channel-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.channel-editor-head h4 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-1);
}

/* 推送群组：分群 / 分人配置 */
.channel-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 10px;
}

.channel-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 13px 14px;
}

.channel-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 11px;
}

.channel-card-title {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1 1 auto;
  min-width: 0;
}

.channel-card-title .input {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 320px;
}

.channel-rule-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  margin: 14px 0 10px;
  padding-top: 11px;
  border-top: 1px dashed var(--border);
}

.channel-rules {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

@media (max-width: 720px) {
  .channel-rules { grid-template-columns: 1fr; }
  .channel-card-title { flex-wrap: wrap; }
  .channel-card-title .input { max-width: none; }
}

/* 客户档案：品牌广告投放项录入 */
.brand-booking-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}

/**
 * 品牌广告投放项的编辑行。
 *
 * 原来用 grid + 固定 8 列，但字段数是动态的 ——
 * 「投放商场」只在水牌时出现，一隐藏就与列定义对不上，
 * 类目被挤成几十像素、几项还错位到不同行。
 *
 * 改成 flex + wrap：字段按顺序排，放不下就整行换行，
 * 无论字段出现与否都不会错位。
 */
.brand-booking-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

/* 行内字段统一由 flex 控制宽度与间距 */
.brand-booking-row > .field {
  flex: 1 1 150px;
  min-width: 132px;
  margin-bottom: 0;
  /* 不允许被压扁：窗口窄或浏览器缩放时，压缩会把下拉框和日期框
     挤成一条（只剩一个下拉箭头 / 日历图标）。
     保持不压缩，放不下就整块换到下一行。 */
  flex-shrink: 0;
}

/* 字段标签不折行：「购买开始」四个字被拆成两行同样算乱 */
.brand-booking-row > .field > label {
  white-space: nowrap;
}

/* 类目路径长，多给一些宽度 */
.brand-booking-row > .field-bk-category {
  flex: 1 1 210px;
  min-width: 168px;
}

.brand-booking-row > .field-bk-mall {
  flex: 1 1 170px;
}

.brand-booking-row > .field-bk-date {
  flex: 0 1 150px;
  min-width: 138px;
}

.brand-booking-row > .field-bk-deal {
  flex: 0 1 130px;
  min-width: 118px;
}

.brand-booking-row > .brand-booking-tag {
  flex: 0 0 auto;
}

/* 天数提示与移除按钮：靠右排 */
.brand-booking-row > .brand-booking-days {
  flex: 0 0 auto;
}

.brand-booking-row > .btn {
  flex: 0 0 auto;
  margin-left: auto;
}

/** 投放天数提示：填完起止日期后显示总天数，超 90 天转红 */
.brand-booking-days {
  min-width: 96px;
  height: 34px;
  display: flex;
  align-items: center;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
}

.brand-booking-days.is-error {
  color: var(--danger, #D64545);
}

/* 明细行首的产品标签：替代原先占一列的只读输入框 */
.brand-booking-tag {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
  color: var(--brand-dark);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
}

.brand-booking-row .field label {
  font-size: 11.5px;
}

@media (max-width: 900px) {
  .brand-booking-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .brand-booking-tag {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

/* 客户投放明细：指标卡 */
.metric-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 9px;
  margin: 10px 0 4px;
}

.metric-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 10px 11px;
}

.metric-label {
  font-size: 11.5px;
  color: var(--text-3);
  margin-bottom: 4px;
}

.metric-value {
  font-size: 17px;
  font-weight: 650;
  color: var(--text-1);
  line-height: 1.25;
}

.metric-value.accent { color: var(--brand); }

.metric-sub {
  font-size: 10.5px;
  color: var(--text-3);
  margin-top: 3px;
}

/* 独占查询：类目级联选择 */
.cat-cascade {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

@media (max-width: 720px) {
  .cat-cascade {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 报单多广告：每个产品一个投放内容面板 */
.ad-order-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.ad-order-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 12px 13px;
}

.ad-order-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 10px;
  padding-left: 8px;
  border-left: 3px solid var(--brand);
}

/* 表单内联复选框 */
.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-1);
  cursor: pointer;
}

.checkbox-inline input[type='checkbox'] {
  width: 15px;
  height: 15px;
  accent-color: var(--brand);
  cursor: pointer;
}

/* 广告类型分组选择器 */
.ad-type-picker {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

.ad-type-group-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-3);
  margin-bottom: 6px;
  letter-spacing: .2px;
}

.ad-type-group {
  padding-bottom: 2px;
}


.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }

.form-error {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid #F5C6C6;
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 12.5px;
  margin-bottom: 14px;
}

/* ---------------------------------------------------------------- 卡片 / 面板 */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

/* h3 不许被挤窄：面板头部有控件时，标题会被压成竖排一列 */
.panel-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  flex: 0 0 auto;
  white-space: nowrap;
}
.panel-head .spacer { flex: 1; }
.panel-body { padding: 16px; }
.panel-body.flush { padding: 0; }

/* ---------------------------------------------------------------- 统计卡 */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--brand);
}

.stat-card.warn::before { background: var(--warning); }
.stat-card.ok::before { background: var(--success); }
.stat-card.danger::before { background: var(--danger); }

.stat-label { font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.stat-value { font-size: 25px; font-weight: 680; letter-spacing: -.6px; line-height: 1.15; }
.stat-sub { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }

/* ---------------------------------------------------------------- 工具条 */

.toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.search-box { position: relative; min-width: 220px; flex: 0 1 300px; }
.search-box .input { padding-left: 32px; }
.search-box::before {
  content: '🔍';
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  opacity: .5;
  pointer-events: none;
}

.toolbar .spacer { flex: 1; }

.filter-select { height: 36px; min-width: 116px; width: auto; }

/* ---------------------------------------------------------------- 表格 */

.table-wrap { overflow-x: auto; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.data th {
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-2);
  background: var(--surface-2);
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table.data td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td.actions { text-align: right; white-space: nowrap; }

.cell-title { font-weight: 600; color: var(--text); }
.cell-sub { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.link-cell { color: var(--brand); cursor: pointer; font-weight: 600; }
.link-cell:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- 标签 */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  background: var(--neutral-soft);
  color: var(--text-2);
  white-space: nowrap;
}

.tag-brand { background: var(--brand-soft); color: var(--brand-dark); }
.tag-success { background: var(--success-soft); color: var(--success); }
.tag-warning { background: var(--warning-soft); color: var(--warning); }
.tag-danger { background: var(--danger-soft); color: var(--danger); }
.tag-info { background: var(--info-soft); color: var(--info); }

.tag-list { display: flex; flex-wrap: wrap; gap: 5px; }

.level-badge {
  display: inline-grid;
  place-items: center;
  width: 21px; height: 21px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 700;
}
.level-S { background: #FDECEC; color: #C62828; }
.level-A { background: #FFF3E0; color: #E65100; }
.level-B { background: #E8F4FD; color: #1565C0; }
.level-C { background: #EFF1F4; color: #546E7A; }

/* ---------------------------------------------------------------- 空态 */

.empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-3);
}
.empty-icon { font-size: 30px; opacity: .35; margin-bottom: 10px; }
.empty-text { font-size: 13px; }
.empty-hint { font-size: 12px; margin-top: 5px; opacity: .8; }

/* ---------------------------------------------------------------- 模态框 */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(18, 26, 38, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  animation: fade .14s ease;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: rise .16s ease;
}

.modal.wide { max-width: 780px; }

@keyframes rise {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.modal-head h3 { margin: 0; font-size: 15.5px; font-weight: 650; }
.modal-head .spacer { flex: 1; }

.modal-close {
  width: 28px; height: 28px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-3);
  font-size: 17px;
  line-height: 1;
}
.modal-close:hover { background: var(--neutral-soft); color: var(--text); }

.modal-body { padding: 20px; overflow-y: auto; flex: 1; }

.modal-foot {
  padding: 13px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 9px;
  justify-content: flex-end;
  flex-shrink: 0;
  background: var(--surface-2);
}

/* ---------------------------------------------------------------- 详情 */

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px 20px;
}

.detail-item .dt { font-size: 11.5px; color: var(--text-3); margin-bottom: 2px; }
.detail-item .dd { font-size: 13.5px; font-weight: 500; word-break: break-word; }

.detail-section { margin-top: 20px; }
.detail-section-title {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text-2);
  margin-bottom: 9px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* ---------------------------------------------------------------- 图表条 */

.bar-list { display: flex; flex-direction: column; gap: 9px; }

.bar-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.bar-label { width: 92px; color: var(--text-2); flex-shrink: 0; text-align: right; }
.bar-track { flex: 1; height: 8px; background: var(--neutral-soft); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--brand); border-radius: 4px; transition: width .3s ease; }
.bar-value { width: 38px; color: var(--text-3); font-size: 11.5px; flex-shrink: 0; }

/* ---------------------------------------------------------------- Toast */

.toast-root {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  background: #1A2029;
  color: #fff;
  padding: 9px 17px;
  /* 支持多行提示（如售卖期间、可购买时间） */
  white-space: pre-line;
  line-height: 1.55;
  max-width: min(92vw, 460px);
  border-radius: var(--radius-sm);
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  animation: toastIn .18s ease;
  max-width: 90vw;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warn { background: var(--warning); }

@keyframes toastIn {
  from { transform: translateY(-10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ---------------------------------------------------------------- 加载 */

.loading {
  padding: 44px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}

.spinner {
  display: inline-block;
  width: 17px; height: 17px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .65s linear infinite;
  vertical-align: -3px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- 页面布局 */

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.grid-main-side { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }
.mt-16 { margin-top: 16px; }

/* ---------------------------------------------------------------- 响应式 */

@media (max-width: 1080px) {
  .grid-2, .grid-3, .grid-main-side { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu-btn { display: grid; place-items: center; }
  .content { padding: 15px 13px 40px; }
  .topbar { padding: 0 13px; }
  .form-grid { grid-template-columns: 1fr; }
  .search-box { flex: 1 1 100%; min-width: 0; }
  .toolbar .spacer { display: none; }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .stat-value { font-size: 21px; }
  .sidebar-scrim {
    position: fixed; inset: 0;
    background: rgba(18, 26, 38, .4);
    z-index: 55;
  }
}

@media (max-width: 520px) {
  .modal { max-width: 100%; }
  .modal-foot { flex-direction: column-reverse; }
  .modal-foot .btn { width: 100%; }
}

/* ==========================================================================
   移动端专属视图（.view-mobile）
   目标：业务员在户外用手机单手操作 —— 底部导航、卡片列表、大点击区
   ========================================================================== */

.view-mobile {
  --tabbar-h: 58px;
  background: var(--bg);
}

/* 移动端隐藏侧边栏，改用底部导航 */
.view-mobile .sidebar { display: none; }
.view-mobile .mobile-menu-btn { display: none; }

/* ---------------------------------------------------------------- 顶栏 */

.view-mobile .topbar {
  height: 52px;
  padding: 0 12px;
  padding-top: env(safe-area-inset-top);
  height: calc(52px + env(safe-area-inset-top));
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
}

.view-mobile .topbar h1 { font-size: 16px; font-weight: 650; }

.view-mobile .topbar .tag { font-size: 11px; padding: 1px 7px; }

/* 视图切换链接 */
.view-switch {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid var(--brand-border);
}

.view-switch:active { background: var(--brand); color: #fff; }

.view-desktop .view-switch { display: none; }

/* ---------------------------------------------------------------- 内容区 */

.view-mobile .content {
  padding: 12px 12px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 18px);
}

/* ---------------------------------------------------------------- 底部导航 */

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 70;
  display: flex;
  background: rgba(255, 255, 255, .95);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -1px 12px rgba(20, 30, 45, .06);
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: var(--tabbar-h);
  border: none;
  background: none;
  color: var(--text-3);
  font-size: 10.5px;
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  transition: color .12s;
}

.tab-icon { font-size: 19px; line-height: 1.15; }
.tab-label { font-weight: 500; }

.tab-item.active { color: var(--brand); }
.tab-item.active .tab-icon { transform: translateY(-1px); }
.tab-item:active { background: var(--surface-2); }

/* ---------------------------------------------------------------- 统计卡 */

.view-mobile .stat-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  margin-bottom: 13px;
}

.view-mobile .stat-card { padding: 11px 12px; }
.view-mobile .stat-label { font-size: 11.5px; }
.view-mobile .stat-value { font-size: 21px; }
.view-mobile .stat-sub { font-size: 10.5px; }

/* ---------------------------------------------------------------- 工具条 */

.view-mobile .toolbar {
  gap: 7px;
  margin-bottom: 11px;
}

.view-mobile .search-box { flex: 1 1 100%; min-width: 0; }
.view-mobile .filter-select { flex: 1 1 calc(50% - 4px); min-width: 0; }

.view-mobile .toolbar > .btn-primary,
.view-mobile .toolbar > .btn {
  width: 100%;
  height: 40px;
}

/* ---------------------------------------------------------------- 表格 → 卡片 */

.view-mobile .table-wrap { overflow-x: visible; }

.view-mobile table.data,
.view-mobile table.data tbody,
.view-mobile table.data tr,
.view-mobile table.data td {
  display: block;
  width: 100%;
}

.view-mobile table.data thead { display: none; }

.view-mobile table.data tr {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 9px;
  padding: 11px 13px;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.view-mobile table.data tr:last-child { margin-bottom: 0; }

.view-mobile table.data td {
  border: none;
  padding: 3px 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  text-align: left;
}

.view-mobile table.data td::before {
  content: attr(data-label);
  /* 标签列需容纳「阿里商户通账号」等 7 字标签，否则中文会逐字折行成竖排 */
  flex: 0 0 88px;
  color: var(--text-3);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.55;
  padding-top: 1px;
  letter-spacing: -.2px;
  word-break: keep-all;
}

.view-mobile table.data td.num { text-align: left; }

.view-mobile table.data td.actions {
  margin-top: 8px;
  padding-top: 9px;
  border-top: 1px dashed var(--border);
  gap: 7px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.view-mobile table.data td.actions::before { display: none; }

.view-mobile table.data td.actions .btn {
  height: 34px;
  padding: 0 14px;
  font-size: 13px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
}

.view-mobile table.data td.actions .btn:active { background: var(--brand-soft); border-color: var(--brand); }

/* 主标题单元格：突出显示 */
.view-mobile table.data td:first-child {
  display: block;
  margin-bottom: 6px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--border);
}

.view-mobile table.data td:first-child::before {
  display: block;
  flex: none;
  margin-bottom: 3px;
}

/* 空态：移动端下表格行结构特殊，需单独处理 */
.view-mobile table.data td[colspan] {
  padding: 0;
  border: none;
}

.view-mobile table.data td[colspan]::before { display: none; }

.view-mobile table.data td[colspan] .empty { padding: 30px 12px; }

/* 单元格内的标题与副标题 */
.view-mobile .cell-title { font-size: 14px; font-weight: 650; }
.view-mobile .cell-sub { font-size: 11.5px; }
.view-mobile .link-cell { font-size: 14.5px; }

/* ---------------------------------------------------------------- 弹窗 → 全屏浮层 */

.view-mobile .modal-backdrop { padding: 0; align-items: flex-end; }

.view-mobile .modal {
  max-width: 100%;
  max-height: 92vh;
  border-radius: 16px 16px 0 0;
  animation: sheetUp .22s cubic-bezier(.22, .8, .3, 1);
}

@keyframes sheetUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.view-mobile .modal-head { padding: 14px 16px; }
.view-mobile .modal-head h3 { font-size: 15px; }

/* 拖拽提示条 */
.view-mobile .modal-head::before {
  content: '';
  position: absolute;
  top: 6px; left: 50%;
  transform: translateX(-50%);
  width: 34px; height: 4px;
  border-radius: 2px;
  background: var(--border-strong);
}

.view-mobile .modal-head { position: relative; padding-top: 18px; }

.view-mobile .modal-body { padding: 16px; }
.view-mobile .modal-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }

/* ---------------------------------------------------------------- 表单 */

.view-mobile .field { margin-bottom: 13px; }
.view-mobile .field label { font-size: 12px; margin-bottom: 5px; }
.view-mobile .input, .view-mobile .select { height: 42px; font-size: 15px; }
.view-mobile .textarea { font-size: 15px; min-height: 84px; }

.view-mobile .checkbox-chip { padding: 8px 13px; font-size: 13px; }

/* ---------------------------------------------------------------- 详情 */

.view-mobile .detail-grid { grid-template-columns: 1fr 1fr; gap: 11px 14px; }
.view-mobile .detail-item .dt { font-size: 11px; }
.view-mobile .detail-item .dd { font-size: 13.5px; }

.view-mobile .bar-label { width: 76px; font-size: 12px; }

/* ---------------------------------------------------------------- 更多面板 */

.more-sheet-list { display: flex; flex-direction: column; gap: 2px; }

.more-sheet-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 12px;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.more-sheet-item:active { background: var(--surface-2); }
.more-sheet-icon { font-size: 19px; width: 26px; text-align: center; }

/* ---------------------------------------------------------------- Toast */

.view-mobile .toast-root { top: auto; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px); }
.view-mobile .toast { font-size: 13.5px; padding: 11px 18px; }

/* ---------------------------------------------------------------- 登录页 */

.view-mobile .login-page { padding: 18px 16px; align-items: flex-start; padding-top: 8vh; }
.view-mobile .login-card { padding: 26px 22px 24px; border-radius: 16px; }
.view-mobile .login-title { font-size: 17.5px; }
.view-mobile .login-card .input { height: 44px; font-size: 16px; }
.view-mobile .login-card .btn { height: 44px; font-size: 15px; }

/* ---------------------------------------------------------------- 空态 */

.view-mobile .empty { padding: 36px 16px; }


/* ---------------------------------------------------------------- 独占资源大屏 */
.exclusive-board {
  margin-bottom: 18px;
}

.board-toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.board-toolbar-label {
  font-size: 12.5px;
  color: var(--text-2);
}

.board-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.board-stat {
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.board-stat-value {
  font-size: 23px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--text-1);
}

.board-stat-label {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-2);
}

.board-stat-free {
  border-color: #B7E4C7;
  background: #F0FAF4;
}
.board-stat-free .board-stat-value { color: #1D9E75; }

.board-stat-sold {
  border-color: #F3C1C1;
  background: #FDF2F2;
}
.board-stat-sold .board-stat-value { color: #D64545; }

.board-stat-rate .board-stat-value { color: var(--brand); }

.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 11px;
}

.board-card {
  padding: 12px 13px;
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: var(--radius-sm);
  background: var(--surface-1);
}

.board-card.is-free {
  border-left-color: #1D9E75;
  background: #F7FCF9;
}

.board-card.is-sold {
  border-left-color: #C9CDD4;
  background: var(--surface-2);
}

.board-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.board-card-type {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-2);
}

.board-card-state {
  font-size: 11.5px;
  font-weight: 500;
  padding: 1px 8px;
  border-radius: 999px;
}
.board-card.is-free .board-card-state {
  background: #D9F2E4;
  color: #1D9E75;
}
.board-card.is-sold .board-card-state {
  background: #E8EAED;
  color: #6B7280;
}

.board-card-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-1);
  line-height: 1.5;
}

.board-card-meta {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--text-2);
  line-height: 1.5;
  word-break: break-all;
}

.board-card-price {
  margin-top: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--brand);
}

.board-card-buyer {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px dashed var(--border);
  font-size: 11.5px;
  color: var(--text-2);
  line-height: 1.7;
}

.board-card-free { color: #1D9E75; }

/* ---------------------------------------------------------------- 提成大屏 */
.commission-hero {
  padding: 20px 22px;
  margin-bottom: 14px;
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-md);
  background: var(--brand-soft);
}

.commission-hero-label {
  font-size: 12.5px;
  color: var(--text-2);
}

.commission-hero-value {
  margin-top: 5px;
  font-size: 34px;
  font-weight: 500;
  line-height: 1.15;
  color: var(--brand-dark);
}

.commission-hero-sub {
  margin-top: 5px;
  font-size: 12.5px;
  color: var(--text-2);
}

.commission-hero-bar {
  position: relative;
  margin-top: 13px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  overflow: visible;
}

.commission-hero-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--brand);
  transition: width 0.3s ease;
}

.commission-hero-bar-text {
  position: absolute;
  top: 12px;
  left: 0;
  font-size: 11.5px;
  color: var(--text-2);
}

.commission-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.commission-kpi {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.commission-kpi-label {
  font-size: 11.5px;
  color: var(--text-2);
}

.commission-kpi-value {
  margin-top: 4px;
  font-size: 17px;
  font-weight: 500;
  color: var(--text-1);
  word-break: break-all;
}

.commission-section-title {
  margin: 18px 0 10px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-1);
}

.commission-table .row-mine {
  background: var(--brand-soft);
}

.commission-table .masked {
  color: var(--text-3);
  letter-spacing: 1px;
}

.commission-cell {
  font-weight: 500;
  color: var(--brand-dark);
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 500;
  background: #EDEFF2;
  color: #6B7280;
}

.rank-badge.rank-1 { background: #FFE9B3; color: #9A6B00; }
.rank-badge.rank-2 { background: #E6E9ED; color: #5F6570; }
.rank-badge.rank-3 { background: #F5E2D0; color: #96603A; }

.commission-trend {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.commission-trend-row {
  display: grid;
  grid-template-columns: 92px 1fr 96px;
  align-items: center;
  gap: 11px;
}

.commission-trend-name {
  font-size: 12.5px;
  color: var(--text-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.commission-trend-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 42px;
}

.commission-trend-bar {
  flex: 1;
  border-radius: 3px 3px 0 0;
  background: var(--brand);
  opacity: 0.82;
}

.commission-trend-total {
  font-size: 12.5px;
  text-align: right;
  color: var(--text-1);
  font-weight: 500;
}

.commission-trend-legend {
  display: flex;
  gap: 6px;
  padding-top: 7px;
  border-top: 1px dashed var(--border);
  font-size: 11px;
  color: var(--text-3);
}

.commission-trend-legend span {
  flex: 1;
  text-align: center;
}

.commission-config {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

/* 独占查询：刊例价直接跟在查询结果旁 */
.query-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 4px;
  padding: 10px 14px;
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
}

.query-price-label {
  font-size: 12.5px;
  color: var(--text-2);
}

.query-price-value {
  font-size: 20px;
  font-weight: 500;
  color: var(--brand-dark);
}

.query-price-extra {
  font-size: 12px;
  color: var(--text-2);
}

.price-cell {
  font-weight: 500;
  color: var(--brand-dark);
  white-space: nowrap;
}

/* 业绩构成：三段式卡片 */
.commission-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 11px;
  margin-bottom: 16px;
}

.commission-split-card {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-top: 3px solid var(--brand);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.commission-split-title {
  font-size: 12.5px;
  color: var(--text-2);
}

.commission-split-amount {
  margin-top: 6px;
  font-size: 20px;
  font-weight: 500;
  color: var(--text-1);
}

.commission-split-commission {
  margin-top: 3px;
  font-size: 14px;
  font-weight: 500;
  color: var(--brand-dark);
}

.commission-split-note {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.6;
}

.commission-total {
  font-weight: 500;
  color: var(--brand-dark);
  white-space: nowrap;
}

/* 阶梯编辑器 */
.tier-editor {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 12px;
}

.tier-editor-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.tier-editor-label {
  font-size: 12px;
  color: var(--text-2);
}


/* 报单表单：自动带出客户历史投放的提示 */
.draft-hint {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin: -6px 0 12px;
  padding: 8px 11px;
  border: 1px solid var(--brand-soft);
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--text-1);
}

.draft-hint .btn {
  padding: 2px 9px;
  font-size: 11.5px;
}

/* 独占资源大屏：全量类目 / 商场的售卖一览 */
.board-group {
  margin-bottom: 18px;
}

.board-group-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 0 2px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}

.board-group-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
}

.board-group-stat {
  font-size: 12px;
  color: var(--text-3);
}

/* 条目网格：一眼看清售出状态 */
.board-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 8px;
}

.board-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-1);
  min-width: 0;
}

.board-item.is-free {
  border-color: #cfe6d4;
  background: #f3faf5;
}

.board-item.is-sold {
  border-color: #f0d3c0;
  background: #fdf6f1;
}

.board-item-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.board-item.is-free .board-item-dot {
  background: #2f9e5f;
}

.board-item.is-sold .board-item-dot {
  background: #d98324;
}

.board-item-main {
  flex: 1 1 auto;
  min-width: 0;
}

.board-item-label {
  font-size: 12.5px;
  color: var(--text-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-item-sub {
  font-size: 11.5px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-item-state {
  flex: none;
  font-size: 11.5px;
  font-weight: 500;
}

.board-item.is-free .board-item-state {
  color: #2f9e5f;
}

.board-item.is-sold .board-item-state {
  color: #d98324;
}

/* 独占大屏的分组容器：整行铺开，条目在组内用网格排 */
.board-groups {
  display: block;
}

.board-groups .board-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
  gap: 8px;
}

/* 已售条目里的售卖期间 */
.board-item-time {
  font-size: 11px;
  color: #b06a24;
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-item.is-sold.has-end {
  cursor: pointer;
}

.board-item.is-sold.has-end:hover {
  border-color: #d98324;
}

/* 账号权限勾选 */
.perm-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.perm-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.perm-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
}

.perm-editor {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.perm-group-title {
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 5px;
}

.perm-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.perm-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 13px;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}

.perm-chip input {
  margin: 0;
  cursor: pointer;
}

.perm-chip.checked {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-dark);
}

/* ==========================================================================
   客户展示页 —— 管理端编辑界面
   ========================================================================== */

.sc-edit { display: grid; gap: 14px; }

/* 顶部链接区 */
.sc-link-box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sc-link-label { font-size: 12.5px; color: var(--text-3); }

.sc-link-url {
  font-size: 12.5px;
  padding: 4px 9px;
  border-radius: var(--radius-sm);
  background: var(--neutral-soft);
  color: var(--text-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
}

/* 模板选择卡片 */
.sc-template-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.sc-template-card {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .16s, background .16s;
}

.sc-template-card:hover { border-color: var(--brand-border); }

.sc-template-card.active {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.sc-template-name { font-size: 13.5px; font-weight: 650; margin-bottom: 4px; }

.sc-template-desc { font-size: 12px; color: var(--text-3); line-height: 1.55; }

.sc-template-card.active .sc-template-desc { color: var(--text-2); }

/* 小节标题 */
.sc-edit-subtitle {
  margin: 22px 0 10px;
  font-size: 13px;
  font-weight: 650;
  color: var(--text-2);
  padding-left: 9px;
  border-left: 3px solid var(--brand-border);
}

/* 列表编辑器 */
.sc-edit-list { display: grid; gap: 10px; }

.sc-edit-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 14px 16px;
}

.sc-edit-item-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.sc-edit-item-title {
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 指标编辑行 */
.sc-stat-edit { display: grid; gap: 8px; }

.sc-stat-edit-row {
  display: grid;
  grid-template-columns: 88px 72px 1fr auto;
  gap: 8px;
  align-items: center;
}

@media (max-width: 720px) {
  .sc-stat-edit-row { grid-template-columns: 1fr 1fr; }
}

/* 微信二维码上传控件 */
.sc-qr-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 132px;
  height: 132px;
  margin-bottom: 10px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.sc-qr-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.sc-qr-placeholder {
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
}

.sc-qr-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* 实景图列表编辑器 */
.sc-img-list { display: grid; gap: 8px; }

.sc-img-row {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  gap: 8px;
  align-items: center;
}

.sc-img-thumb {
  width: 46px;
  height: 46px;
  object-fit: cover;
  object-position: top center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
}

/* ------------------------------------------------------------ 报单表单新增 */

/** 投放天数超限提示 */
.field-hint.is-error {
  color: var(--danger, #D64545);
  font-weight: 600;
}

/** 最近 1 个月报单流水 */
.order-recent {
  border: 1px solid var(--border, #E3E8EF);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface, #fff);
}

.order-recent-list {
  display: flex;
  flex-direction: column;
  max-height: 240px;
  overflow-y: auto;
}

.order-recent-row {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) minmax(0, 1.2fr) 76px 72px 84px;
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  font-size: 12.5px;
  color: var(--text, #1A2029);
  border-bottom: 1px solid var(--border, #E3E8EF);
}

.order-recent-row:last-child { border-bottom: none; }
.order-recent-row:nth-child(odd) { background: rgba(0, 0, 0, .015); }

.order-recent-no {
  font-variant-numeric: tabular-nums;
  color: var(--text-3, #8A94A3);
  white-space: nowrap;
}

.order-recent-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-recent-type {
  color: var(--text-2, #55606F);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-recent-kind {
  font-size: 11.5px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent-soft, #EAF2FD);
  color: var(--accent, #1B6FE0);
  text-align: center;
  white-space: nowrap;
}

.order-recent-status {
  font-size: 11.5px;
  color: var(--text-2, #55606F);
  white-space: nowrap;
}

.order-recent-budget {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .order-recent-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "no name"
      "type kind"
      "status budget";
    gap: 4px 10px;
  }
  .order-recent-no { grid-area: no; }
  .order-recent-name { grid-area: name; }
  .order-recent-type { grid-area: type; }
  .order-recent-kind { grid-area: kind; justify-self: end; }
  .order-recent-status { grid-area: status; }
  .order-recent-budget { grid-area: budget; }
}

/* ------------------------------------------------------------ 验证码登录 */

/** 登录页的「账号密码登录 / 验证码登录」切换入口 */
.login-mode-link {
  color: var(--accent, #1B6FE0);
  cursor: pointer;
  font-size: 13px;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 3px;
  margin-bottom: 6px;
}

.login-mode-link:hover { opacity: .78; }

/** 登录页底部的说明文字 */
.login-hint-note {
  color: var(--text-3, #8A94A3);
  font-size: 11.5px;
  line-height: 1.6;
  text-align: center;
}

/** 系统设置里的短信通道配置块 */
.sms-config-box {
  border: 1px solid var(--border, #E3E8EF);
  border-radius: var(--radius-sm, 8px);
  padding: 14px;
  background: var(--surface-2, #F7F9FC);
}

.sms-config-warn {
  background: #FFF7E6;
  border: 1px solid #FFD591;
  color: #874D00;
  border-radius: var(--radius-sm, 8px);
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.7;
  margin-bottom: 12px;
}

/** 短信通道按所选供应商切换显示 */
.sms-provider-box { margin-top: 12px; }
.sms-provider-box .field-hint { margin-top: 4px; }

/** 登录页的演示模式提示：需要醒目，避免有人误以为验证码真的发到了手机上 */
.sms-demo-tip {
  background: #FFF7E6;
  border: 1px solid #FFD591;
  color: #874D00;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 12px;
}

/** 登录页：号码没绑定账号时的直接切换入口 */
.login-sms-alt {
  margin-top: -4px;
  margin-bottom: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface-2, #F5F7FA);
  border: 1px solid var(--border, #E3E8EF);
  font-size: 12.5px;
  color: var(--text-2, #5A6472);
  cursor: pointer;
  text-align: center;
}

.login-sms-alt b,
.login-mode-link b {
  color: var(--accent, #1B6FE0);
  font-weight: 600;
  margin-left: 4px;
}

/** 侧栏底部用户卡片可点击（我的账号入口） */
.user-chip.clickable {
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}

.user-chip.clickable:hover {
  background: var(--surface-2, #F3F6FA);
}

.user-chip.clickable:active { transform: scale(.99); }

/** 顶栏角色标签可点开「我的账号」 */
.tag.clickable { cursor: pointer; }
.tag.clickable:hover { filter: brightness(.96); }

/** 业绩大屏：来源标签配色 */
.tag-info { background: #E8F2FF; color: #1B6FE0; }

/** 业绩大屏：原价 / 溢价的逐项拆分说明 */
.commission-split-hint {
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-3, #8A94A3);
  margin-top: 2px;
  max-width: 220px;
}

/** 业绩大屏：未达计提状态的报单提醒 */
.commission-pending-hint {
  background: #FFF7E6;
  border: 1px solid #FFD591;
  color: #874D00;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 12.5px;
  line-height: 1.7;
  margin-bottom: 14px;
}

/* ------------------------------------------------------- 打款方式查询 */
.pay-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}

.pay-card {
  position: relative;
  padding: 16px 18px;
  border: 1px solid var(--border, #E3E8EF);
  border-radius: var(--radius, 10px);
  background: var(--surface, #fff);
}

.pay-card-head {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px dashed var(--border, #E3E8EF);
}

.pay-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #1F2733);
}

.pay-card-name {
  font-size: 12.5px;
  color: var(--text-3, #8A94A3);
}

.pay-info-row {
  display: flex;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 7px;
}

.pay-info-k {
  flex: 0 0 58px;
  font-size: 12.5px;
  color: var(--text-3, #8A94A3);
}

.pay-info-v {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  color: var(--text, #1F2733);
  word-break: break-all;
}

.pay-info-v.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .4px;
  font-weight: 600;
}

.pay-scope {
  margin-top: 12px;
  padding: 9px 11px;
  border-radius: 7px;
  background: var(--accent-soft, #E8F2FF);
  border: 1px solid rgba(27, 111, 224, .16);
}

.pay-scope-label {
  font-size: 11.5px;
  color: var(--accent, #1B6FE0);
  margin-bottom: 3px;
}

.pay-scope-text {
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-2, #5A6472);
}

.pay-note {
  margin-top: 10px;
  font-size: 12px;
  color: var(--warning, #B76E00);
  line-height: 1.6;
}

/* 复制按钮紧跟在账号 / 联行号后面，不做绝对定位（否则两个按钮会叠在一起） */
.pay-info-row .btn-inline-copy {
  flex: 0 0 auto;
  padding: 2px 8px;
  font-size: 11.5px;
  line-height: 1.6;
  margin-left: 4px;
}

/* 打款方式查询：按产品线命中的片段高亮 */
.pay-scope-text mark {
    background: #FFE9A8;
    color: #874D00;
    font-weight: 600;
    padding: 0 3px;
    border-radius: 3px;
}

/* ------------------------------------------- 客户运营 · 五星门店搭建 */
.wx-progress-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--border, #E3E8EF);
  overflow: hidden;
}

.wx-progress-lg { height: 10px; }

.wx-progress-fill {
  height: 100%;
  background: var(--accent, #1B6FE0);
  border-radius: 999px;
  transition: width .25s ease;
}

.wx-progress { min-width: 132px; }
.wx-progress .cell-sub { margin-top: 5px; }

/* 逾期的跟进：整行标一下 */
.row-urgent { background: rgba(226, 75, 74, .05); }
.row-urgent .cell-title { color: var(--danger, #C0392B); }

/* 搭建清单面板 */
.wx-panel { max-height: 68vh; overflow-y: auto; padding: 4px 2px; }

.wx-head { margin-bottom: 18px; }
.wx-head-text { margin-top: 8px; font-size: 13px; color: var(--text-2, #5A6472); }

.wx-module-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 20px 0 9px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--border, #E3E8EF);
}

.wx-module-name { font-size: 14px; font-weight: 600; color: var(--text, #1F2733); }

.wx-list { display: flex; flex-direction: column; gap: 8px; }

.wx-item {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--border, #E3E8EF);
  border-radius: 10px;
  background: var(--surface, #fff);
}

.wx-item-done { background: rgba(43, 164, 113, .06); border-color: rgba(43, 164, 113, .3); }
.wx-item-doing { border-color: rgba(224, 160, 48, .45); }

.wx-check { flex: none; margin-top: 2px; cursor: pointer; }
.wx-check input { width: 16px; height: 16px; cursor: pointer; }

.wx-item-main { flex: 1; min-width: 0; }

.wx-item-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text, #1F2733);
}

.wx-item-done .wx-item-title { color: var(--text-2, #5A6472); }

.wx-req { font-size: 11px; padding: 1px 6px; }
.wx-opt { font-size: 11px; padding: 1px 6px; }

.wx-item-req {
  margin: 5px 0 8px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-2, #5A6472);
}

.wx-note { font-size: 12.5px; padding: 7px 10px; }

/* 敏感词自查结果 */
.wx-scan-result { margin-top: 14px; }
.wx-scan-group { margin-top: 10px; }
.wx-scan-group-name { font-size: 12.5px; color: var(--text-2, #5A6472); margin-bottom: 6px; }
.wx-scan-words { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------------------------------------- 五星搭建：按组推进 */
.wx-groups { display: flex; flex-direction: column; gap: 10px; }

.wx-group {
  border: 1px solid var(--border, #E3E8EF);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface, #fff);
}

.wx-group-done { background: rgba(43, 164, 113, .06); border-color: rgba(43, 164, 113, .3); }

.wx-group-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
}

.wx-group-main { flex: 1; min-width: 0; }
.wx-group-title { font-size: 13.5px; font-weight: 600; color: var(--text, #1F2733); }
.wx-group-done .wx-group-title { color: var(--text-2, #5A6472); }

.wx-group-detail {
  padding: 0 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px dashed var(--border, #E3E8EF);
  padding-top: 12px;
}

/* ---------------------------------------- 早报预览 */
.wx-report-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #1F2733);
  margin-bottom: 10px;
}

.wx-report-text {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--border, #E3E8EF);
  border-radius: 10px;
  background: var(--surface, #fff);
  font-family: var(--font-sans);
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--text-2, #5A6472);
  white-space: pre-wrap;
  word-break: break-word;
}

/* 展示页页脚 · ICP 备案号
   对外网站底部必须显著位置标明备案编号并链接到工信部备案系统 */
.sc-footer-icp {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--text-3, #8A94A2);
  text-align: center;
}

.sc-footer-icp a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}

.sc-footer-icp a:hover { color: var(--brand, #1B6FE0); }

/* ---------------------------------------- 主应用页脚 · ICP 备案号 */
.app-footer-icp {
  padding: 14px 16px 22px;
  text-align: center;
  font-size: 12px;
  color: var(--text-3, #8A94A2);
}

.app-footer-icp a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}

.app-footer-icp a:hover { color: var(--brand, #1B6FE0); }

/* 表格合计行 */
.table .row-total td {
  background: var(--surface-2, #F7F9FC);
  font-weight: 600;
  color: var(--text, #1F2733);
  border-top: 1px solid var(--border, #E3E8EF);
}

/* ------------------------------------------------------------ 首屏缓冲层
 *
 * 脚本还没加载完时，页面原本是一片空白。
 * 先亮出高德 logo 与加载动画，让「正在打开」这件事有交代。
 */

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #F6F8FB;
}

.boot-screen.is-hidden { display: none; }

.boot-logo {
  width: 88px;
  height: auto;
  object-fit: contain;
}

.boot-spinner {
  width: 26px;
  height: 26px;
  margin: 20px 0 12px;
  border: 3px solid #D8DFE9;
  border-top-color: #1B6FE0;
  border-radius: 50%;
  animation: boot-spin .8s linear infinite;
}

@keyframes boot-spin { to { transform: rotate(360deg); } }

.boot-text {
  font-size: 13px;
  color: #7A8698;
  letter-spacing: .5px;
}

/* ------------------------------------------------------------ 财务概览 */

.finance-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.finance-metrics .metric-value.fin-profit { color: #17B978; }

.finance-body .section-title {
  margin: 20px 0 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.finance-body td.fin-profit { color: #17B978; font-weight: 600; }
.finance-body .fin-unknown { color: var(--text-3); }
.finance-body .fin-note { margin-top: 10px; line-height: 1.7; }

.finance-body .metric-value.fin-cost { color: #E8A317; }

/* ------------------------------------------------------------ 安装到桌面
 *
 * 系统是 PWA，Android/桌面 Chrome 可一键装，iOS 给「添加到主屏幕」指引。
 */

.install-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 560px;
  margin: 0 auto;
  padding: 11px 12px 11px 16px;
  border-radius: 14px;
  background: #1B2434;
  color: #fff;
  box-shadow: 0 8px 28px rgba(20, 30, 45, .28);
  font-size: 13.5px;
  line-height: 1.5;
}

.install-bar-text { flex: 1; }

.install-bar .btn-primary {
  background: var(--accent, #1B6FE0);
  border-color: var(--accent, #1B6FE0);
  flex: 0 0 auto;
}

.install-bar-close {
  flex: 0 0 auto;
  background: transparent;
  border: none;
  color: #9AA6B8;
  font-size: 15px;
  padding: 4px 2px;
  cursor: pointer;
}

.install-bar-close:hover { color: #fff; }

@media (max-width: 480px) {
  .install-bar { font-size: 12.5px; padding: 10px 10px 10px 13px; }
}

/* 登录页：短信通道未接通的醒目提示 */
.sms-demo-tip.sms-warn {
  background: #FFF4E5;
  color: #B25E00;
  border-color: #FFD9A0;
}

/* ------------------------------------------------------------ 工作台：业绩排名 */

.rank-list {
  display: flex;
  flex-direction: column;
  padding: 6px 16px 12px;
}

.rank-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

.rank-row:last-child { border-bottom: none; }

.rank-no {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  line-height: 22px;
  text-align: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: #C4CBD6;
}

.rank-no.r1 { background: #E8B93B; }
.rank-no.r2 { background: #A9B4C4; }
.rank-no.r3 { background: #C98B5E; }

.rank-name {
  flex: 0 0 84px;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-bar {
  flex: 1 1 auto;
  min-width: 40px;
  height: 7px;
  border-radius: 4px;
  background: #E7ECF3;
  overflow: hidden;
}

.rank-fill {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #4C8DF6, #1B6FE0);
}

.rank-num {
  flex: 0 0 auto;
  min-width: 92px;
  text-align: right;
  font-weight: 700;
  color: #1B6FE0;
  font-variant-numeric: tabular-nums;
}

.rank-sub {
  flex: 0 0 auto;
  min-width: 54px;
  text-align: right;
  font-size: 12.5px;
  color: var(--text-3);
}

@media (max-width: 560px) {
  .rank-name { flex-basis: 64px; }
  .rank-num { min-width: 74px; font-size: 13px; }
  .rank-sub { display: none; }
}

/* ------------------------------------------------------------ 财务：客户与投放明细
 *
 * 不用宽表格 —— 表格一多列就挤成一团，而且数字对不上具体是哪笔投放。
 * 改成「客户 → 产品 → 逐笔投放」的层级，一层层往下展开。
 */

.fin-merchant {
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}

.fin-merchant-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  background: #F7F9FC;
  border-bottom: 1px solid var(--border);
}

.fin-merchant-name { font-weight: 700; font-size: 14.5px; }
.fin-merchant-total { font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }

.fin-product {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  padding: 9px 14px 7px;
  border-bottom: 1px dashed var(--border);
}

.fin-product-name {
  font-size: 13px;
  font-weight: 700;
  color: #38455C;
  min-width: 62px;
}

.fin-product-num {
  font-size: 12.5px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.fin-product-num.fin-profit { color: #17B978; font-weight: 600; }

.fin-item {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 6px 14px 6px 30px;
  font-size: 13px;
  border-bottom: 1px solid #F1F4F8;
}

.fin-item:last-child { border-bottom: none; }
.fin-item:hover { background: #FAFBFD; }

.fin-item-no {
  flex: 0 0 116px;
  color: var(--text-3);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fin-item-target {
  flex: 1 1 auto;
  color: #38455C;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fin-item-num {
  flex: 0 0 auto;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 88px;
  text-align: right;
}

.fin-item-empty {
  color: var(--text-3);
  font-size: 12.5px;
  padding-left: 30px;
}

@media (max-width: 560px) {
  .fin-item { padding-left: 16px; flex-wrap: wrap; }
  .fin-item-no { flex-basis: 100%; }
}
