:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --line: #e5e8ec;
  --text: #1f2430;
  --muted: #6b7280;
  --primary: #1f5fd8;
  --primary-soft: #eaf1ff;
  --green: #0f8a63;
  --green-soft: #e6f6ef;
  --amber: #b26a00;
  --amber-soft: #fff4dd;
  --red: #c0392b;
  --red-soft: #fdecea;
  --radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
}
button, input, select, textarea { font-family: inherit; font-size: 14px; }
button { cursor: pointer; }
a { color: var(--primary); text-decoration: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 12px; }
.footnote { color: var(--muted); font-size: 12px; margin-top: 20px; }

/* ================= 左侧可收缩导航栏 ================= */
#appShell { display: flex; min-height: 100vh; align-items: stretch; }

.sidebar {
  width: 220px;
  flex: none;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  transition: width .18s ease;
  z-index: 30;
}
.sidebar-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 12px 14px 16px;
  border-bottom: 1px solid var(--line);
  min-height: 62px;
}
.sidebar-head .brand { flex: 1; min-width: 0; overflow: hidden; }
.brand-text { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.brand-name { font-size: 16px; font-weight: 600; line-height: 1.3; white-space: nowrap; }
.brand-sub { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-toggle {
  flex: none;
  width: 28px; height: 28px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 7px;
  display: grid; place-items: center;
  color: var(--muted);
  padding: 0;
  transition: color .15s, border-color .15s;
}
.sidebar-toggle:hover { color: var(--primary); border-color: var(--primary); }
/* 箭头：展开时指向左（收起），收起时指向右（展开） */
.toggle-icon {
  width: 8px; height: 8px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-left: 3px;
  transition: transform .18s ease;
}
body.side-collapsed .toggle-icon { transform: rotate(-135deg); margin-left: 0; }

.nav { display: flex; flex-direction: column; gap: 2px; padding: 12px 10px; flex: 1; overflow-y: auto; }
.nav-btn {
  border: 0; background: transparent; color: var(--muted);
  padding: 10px 12px; border-radius: 8px; font-size: 14px;
  display: flex; align-items: center; gap: 10px;
  text-align: left; width: 100%;
  white-space: nowrap;
}
.nav-btn:hover { background: var(--bg); color: var(--text); }
.nav-btn.active { background: var(--primary-soft); color: var(--primary); font-weight: 500; }
.nav-ico {
  flex: none; width: 20px; text-align: center;
  font-size: 14px; line-height: 1;
  color: inherit;
}
.nav-text { overflow: hidden; text-overflow: ellipsis; }

.sidebar-foot {
  border-top: 1px solid var(--line);
  padding: 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.user-chip { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; min-width: 0; }
.user-chip-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow: hidden; }
.user-chip-text > #userName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: #e8ebf0; display: grid; place-items: center; color: var(--text); flex: none; }
.side-logout { align-self: flex-start; }

/* 收缩态：只留图标条 */
body.side-collapsed .sidebar { width: 64px; }
body.side-collapsed .sidebar-head { padding: 14px 0 14px 0; justify-content: center; }
body.side-collapsed .brand-text,
body.side-collapsed .nav-text,
body.side-collapsed .user-chip-text,
body.side-collapsed .side-logout { display: none; }
body.side-collapsed .nav-btn { justify-content: center; padding: 11px 0; }
/* 收缩后切换按钮移到侧栏右边缘，做成竖向小把手，避免压住 logo */
body.side-collapsed .sidebar-toggle {
  position: absolute;
  right: -11px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px; height: 34px;
  border-radius: 0 7px 7px 0;
  border-right: 0;
  background: var(--surface);
  box-shadow: 2px 0 8px rgba(24, 28, 38, .1);
}
body.side-collapsed .sidebar-toggle .toggle-icon { transform: rotate(-135deg); margin-left: 0; }
body.side-collapsed .sidebar-head { position: relative; }
body.side-collapsed .user-chip { justify-content: center; }
body.side-collapsed .sidebar-foot { align-items: center; }

/* 旧的顶栏样式保留给登录页品牌等复用 */
.brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.logo {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--primary); color: #fff;
  display: grid; place-items: center; font-weight: 600; flex: none;
}

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

main { max-width: 1240px; margin: 0 auto; padding: 28px 32px 60px; width: 100%; }
.view { display: none; }
.view.active { display: block; }

.hero { display: grid; grid-template-columns: 1.35fr 1fr; gap: 40px; align-items: center; margin-bottom: 28px; }
.tag { display: inline-block; background: var(--primary-soft); color: var(--primary); padding: 3px 10px; border-radius: 20px; font-size: 12px; margin-bottom: 14px; }
h1 { font-size: 32px; line-height: 1.35; margin: 0 0 14px; font-weight: 600; letter-spacing: -0.5px; }
.hero-desc { color: var(--muted); max-width: 560px; margin: 0 0 22px; }
.url-bar { display: flex; gap: 10px; max-width: 680px; }
.url-bar input, .toolbar input, .toolbar select, .modal-box input, .modal-box textarea {
  border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 10px 12px; color: var(--text); outline: none;
}
.url-bar input:focus, .toolbar input:focus, .modal-box input:focus, .modal-box textarea:focus { border-color: var(--primary); }
.url-bar input { flex: 1; min-width: 0; }
.btn { border: 1px solid transparent; border-radius: 8px; padding: 10px 18px; white-space: nowrap; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: #174db0; }
.btn.ghost { background: var(--surface); border-color: var(--line); color: var(--text); }
.btn.ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn.danger { background: var(--red-soft); color: var(--red); }
.hint { color: var(--muted); font-size: 12px; margin-top: 10px; }

.preview-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.preview-head { display: flex; align-items: center; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.red { background: #f08080; } .dot.amber { background: #f0c674; } .dot.green { background: #7bc9a0; }
.preview-head span:last-child { margin-left: 8px; }
.preview-body { padding: 18px; }
.preview-title { font-weight: 600; margin-bottom: 14px; line-height: 1.5; }
.preview-grid { display: grid; grid-template-columns: 76px 1fr; gap: 8px 10px; font-size: 13px; }
.preview-grid span { color: var(--muted); }
.preview-grid strong { font-weight: 500; }
.preview-badge { margin-top: 16px; display: inline-block; background: var(--green-soft); color: var(--green); border-radius: 6px; padding: 4px 10px; font-size: 12px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.stat-card .label { color: var(--muted); font-size: 13px; }
.stat-card .value { font-size: 26px; font-weight: 600; margin-top: 4px; }
.stat-card .value.money { font-size: 22px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stat-card .value small { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 4px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-head h2, .page-head h2 { margin: 0; font-size: 16px; font-weight: 600; }
.link-btn { border: 0; background: transparent; color: var(--primary); font-size: 13px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.page-head p { margin: 2px 0 0; }

/* 工作台「即将开标的项目」：与项目台账一致的表格，列多所以更紧凑 */
.upcoming-wrap { padding: 0; }
.upcoming-table th, .upcoming-table td { padding: 11px 12px; }
.upcoming-table th:first-child, .upcoming-table td:first-child { padding-left: 20px; }
.upcoming-table th:last-child, .upcoming-table td:last-child { padding-right: 20px; }
.upcoming-table .cell-name { max-width: 260px; }
.recent-empty { padding: 28px 0; color: var(--muted); text-align: center; font-size: 13px; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; white-space: nowrap; }
.badge.blue { background: var(--primary-soft); color: var(--primary); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.gray { background: #f0f1f3; color: var(--muted); }
.badge.red { background: var(--red-soft); color: var(--red); }

.toolbar { display: flex; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.toolbar input { min-width: 240px; flex: 1; }
.toolbar select { min-width: 130px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); background: #fafbfc; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfe; }
.cell-name { max-width: 320px; font-weight: 500; cursor: pointer; }
.cell-name:hover { color: var(--primary); }
.row-btn { border: 0; background: transparent; color: var(--primary); font-size: 13px; padding: 2px 6px; }
.row-btn.del { color: var(--muted); }
/* 开标倒计时 */
.countdown { margin-top: 4px; font-size: 12px; line-height: 1.4; white-space: nowrap; }
.countdown.cd-normal { color: var(--muted); }
.countdown.cd-urgent { color: var(--red); font-weight: 500; }
.countdown.cd-today { color: var(--amber); font-weight: 600; }
.empty { padding: 50px 20px; text-align: center; color: var(--muted); }

.company-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; font-size: 13px; }
.company-bar-label { font-weight: 600; }
.company-bar select { padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--text); min-width: 220px; }
.company-bar-tip { color: var(--muted); }
/* 中标统计归属：当前范围文字 + 「切换单位」下拉菜单 */
.scope-name { font-weight: 600; font-size: 14px; padding: 4px 12px; border-radius: 20px; background: var(--primary-soft); color: var(--primary); }
.unit-switch { position: relative; display: inline-flex; }
.unit-menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 260px; max-height: 320px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 28px rgba(24, 28, 38, .14); padding: 6px; z-index: 30; }
.unit-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left; border: 0; background: transparent; color: var(--text); font-size: 13px; padding: 9px 12px; border-radius: 7px; cursor: pointer; }
.unit-item:hover { background: #f4f6fa; }
.unit-item.active { color: var(--primary); font-weight: 600; background: rgba(47,111,237,.07); }
.unit-check { font-size: 11px; color: var(--primary); font-weight: 500; }
.unit-item-manage { margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 7px 7px; color: var(--muted); padding-top: 11px; }
.unit-item-manage:hover { color: var(--primary); }
/* ================= 用户中心（独立页面，非弹窗） ================= */
.profile-page {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px 26px;
  max-width: 900px;
}
.profile-page .page-head { margin-bottom: 20px; }
.profile-page .profile-card {
  background: linear-gradient(135deg, rgba(31,95,216,.08), rgba(31,95,216,.02));
  border: 1px solid var(--line);
  border-radius: 12px; padding: 16px 18px; margin-bottom: 6px;
}
.profile-page .profile-section {
  padding-top: 18px; margin-top: 18px; border-top: 1px solid var(--line);
}
.profile-page .profile-section:first-of-type { border-top: 0; }
.profile-page .profile-foot { margin-top: 24px; }
.profile-page .company-add input {
  flex: 1; min-width: 0;
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 8px; padding: 10px 12px; color: var(--text); outline: none;
}
.profile-page .company-add input:focus { border-color: var(--primary); }
.profile-page .contact-grid input {
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 8px; padding: 10px 12px; color: var(--text); outline: none; width: 100%;
}
.profile-page .contact-grid input:focus { border-color: var(--primary); }

@media (max-width: 760px) {
  .profile-page { padding: 18px 16px 20px; }
}

.profile-box { width: min(640px, 100%); }
.profile-box .modal-head p { margin: 4px 0 0; }
/* 用户中心 · 账号卡片 */
.profile-card { display: flex; align-items: center; gap: 14px; background: linear-gradient(135deg, rgba(31,95,216,.08), rgba(31,95,216,.02)); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 6px; }
.profile-avatar { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; color: #fff; flex: none; }
.profile-avatar.b-company { background: var(--primary); }
.profile-avatar.b-employee { background: var(--green); }
.profile-avatar.b-personal { background: #8a94a6; }
.profile-meta { min-width: 0; }
.profile-name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile-name { font-size: 16px; font-weight: 600; }
.profile-badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 500; }
.profile-badge.b-company { background: rgba(31,95,216,.12); color: var(--primary); }
.profile-badge.b-employee { background: var(--green-soft); color: var(--green); }
.profile-badge.b-personal { background: #eceff3; color: #6b7280; }
.profile-org { font-size: 12px; color: var(--muted); margin-top: 4px; }
/* 用户中心 · 分区 */
.profile-section { padding-top: 18px; margin-top: 18px; border-top: 1px solid var(--line); }
.profile-section:first-of-type { border-top: 0; }
.profile-section-title { display: flex; align-items: baseline; gap: 8px; font-size: 14px; font-weight: 600; margin: 0 0 12px; }
.profile-section-title .profile-section-sub { font-size: 12px; font-weight: 400; color: var(--muted); }
.profile-section-title.sub { font-size: 13px; color: var(--muted); margin-top: 16px; }
.profile-foot { margin-top: 20px; }

/* 用户中心 · 公司主体卡 */
.org-card { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; margin-bottom: 12px; }
.org-card-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px 14px; }
.org-card-logo {
  width: 42px; height: 42px; border-radius: 11px; flex: none;
  background: linear-gradient(135deg, var(--primary), #4a86ee); color: #fff;
  display: grid; place-items: center; font-size: 19px; font-weight: 700;
}
.org-card-meta { min-width: 0; }
.org-card-name { font-size: 16px; font-weight: 600; line-height: 1.4; word-break: break-all; }
.org-card-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.org-code-box { border-top: 1px dashed var(--line); background: linear-gradient(135deg, rgba(31,95,216,.06), rgba(31,95,216,.015)); padding: 14px 18px 16px; }
.org-code-box.org-code-private { background: #fafbfc; }
.org-code-box-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.org-code-box-body { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.org-code-box .org-code-text { font-size: 30px; letter-spacing: 6px; line-height: 1.3; }
.org-code-hint { font-size: 12px; color: var(--muted); }
.btn.tiny { padding: 6px 14px; font-size: 12px; border-radius: 7px; }

/* 用户中心 · 成员卡片 */
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.member-card {
  display: flex; align-items: center; gap: 11px;
  border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px; background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.member-card:hover { border-color: #cfd8e8; box-shadow: 0 3px 12px rgba(24, 28, 38, .06); }
.member-card.is-me { border-color: rgba(31,95,216,.42); background: rgba(31,95,216,.035); }
.member-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: #e8ebf0; color: #4b5563; display: grid; place-items: center;
  font-size: 15px; font-weight: 600;
}
.member-avatar.is-owner { background: linear-gradient(135deg, var(--primary), #4a86ee); color: #fff; }
.member-info { flex: 1; min-width: 0; }
.member-name-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.member-name { font-weight: 500; font-size: 14px; }
.member-tag { font-size: 11px; color: var(--primary); background: var(--primary-soft); padding: 1px 7px; border-radius: 999px; }
.member-sub { font-size: 12px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 用户中心 · 公司列表 */
.company-add { display: flex; gap: 10px; margin-bottom: 12px; }
.company-add input { flex: 1; min-width: 0; }
.company-list { display: flex; flex-direction: column; gap: 8px; }
.company-row { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.company-row.is-default { border-color: rgba(31,95,216,.34); background: rgba(31,95,216,.035); }
.company-row.is-editing { background: #fafbfc; border-color: var(--primary); }
.company-title { display: inline-flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.company-row .company-name { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.company-default-tag { flex: none; font-size: 11px; color: var(--primary); background: var(--primary-soft); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.company-bound { display: inline-flex; align-items: center; gap: 4px; flex: none; color: var(--green); font-size: 12px; white-space: nowrap; }
.company-bound .bound-i { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; border: 1px solid var(--green); border-radius: 50%; font-family: Georgia, serif; font-size: 10px; font-style: italic; line-height: 1; }
.company-rename-input { flex: 1; min-width: 0; padding: 6px 10px; border: 1px solid var(--primary); border-radius: 7px; outline: none; background: var(--surface); color: var(--text); }
.company-won { flex: none; white-space: nowrap; }

.source-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.source-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: block; color: var(--text); transition: border-color .15s; }
.source-card:hover { border-color: var(--primary); }
.source-card .city { font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.source-card .city-left { display: flex; align-items: center; gap: 9px; min-width: 0; }
.source-card .arrow { color: var(--muted); font-size: 13px; flex: none; }
.source-logo { position: relative; flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; overflow: hidden; }
.source-logo .logo-letter { font-size: 14px; font-weight: 700; }
.source-logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 4px; background: #fff; }
.source-logo.l0 { background: #e5efff; color: #2563eb; }
.source-logo.l1 { background: #e6f6ef; color: #159065; }
.source-logo.l2 { background: #fff1e6; color: #cc6a13; }
.source-logo.l3 { background: #f0eaff; color: #7c4dcc; }
.source-logo.l4 { background: #ffe9ee; color: #cc3d63; }
.source-logo.l5 { background: #e6f4f7; color: #18869b; }
.source-card .url { color: var(--muted); font-size: 12px; margin-top: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-card.province { background: var(--primary-soft); border-color: #cbdcff; }

.modal { position: fixed; inset: 0; background: rgba(24, 28, 38, .42); display: grid; place-items: center; z-index: 40; padding: 20px; }
.modal-box { background: var(--surface); border-radius: 16px; width: min(720px, 100%); max-height: 88vh; overflow-y: auto; padding: 24px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-head h2 { margin: 0; font-size: 17px; font-weight: 600; }
.icon-btn { border: 0; background: transparent; font-size: 24px; line-height: 1; color: var(--muted); }
.modal-box label { display: block; font-size: 13px; font-weight: 500; margin: 16px 0 6px; }
.modal-box input, .modal-box textarea { width: 100%; }
.modal-box textarea { resize: vertical; line-height: 1.6; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.ok-tip { background: var(--green-soft); color: var(--green); padding: 10px 14px; border-radius: 8px; font-size: 13px; margin: 0 0 16px; }
.match-tip { background: var(--primary-soft); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-bottom: 16px; font-size: 13px; }
.match-tip .match-title { font-weight: 500; margin-bottom: 8px; }
.match-tip .match-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; }
.match-tip .match-row + .match-row { border-top: 1px solid var(--line); }
.match-tip .match-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-tip .match-meta { color: var(--muted); font-size: 12px; }
.match-tip .btn { padding: 6px 12px; font-size: 12px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { margin: 0; color: var(--muted); font-size: 12px; font-weight: 400; }
.field input, .field select, .field textarea { padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; width: 100%; background: var(--surface); color: var(--text); resize: vertical; line-height: 1.6; }
.field.wide { grid-column: 1 / -1; }
.field .source-note { font-size: 11px; color: var(--muted); }

.detail-box { width: min(760px, 100%); }
.detail-box .modal-head p { margin: 4px 0 0; }
.detail-body { padding-top: 4px; }
.detail-section { margin-top: 22px; }
.detail-section h3 { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 10px; }
.detail-grid { display: grid; grid-template-columns: 120px 1fr; gap: 10px 12px; font-size: 13px; align-items: start; }
.detail-grid span { color: var(--muted); }
.detail-grid .v { word-break: break-all; }
.timeline { border-left: 2px solid var(--line); margin-left: 6px; padding-left: 16px; }
.timeline-item { position: relative; padding-bottom: 14px; }
.timeline-item::before { content: ""; position: absolute; left: -22px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: #cbd2dc; }
.timeline-item.done::before { background: var(--green); }
.timeline-item .t { font-weight: 500; }
.timeline-item .d { color: var(--muted); font-size: 12px; }
.update-box { width: min(780px, 100%); }
.update-box .modal-head p { margin: 4px 0 0; }
.update-parse { background: #fafbfc; border: 1px solid var(--line); border-radius: 10px; padding: 4px 16px 16px; margin-bottom: 18px; }
.update-parse label { margin: 12px 0 6px; }
.update-parse .modal-actions { margin-top: 12px; }
.update-divider { font-size: 13px; font-weight: 600; color: var(--muted); border-top: 1px solid var(--line); padding-top: 16px; margin: 0 0 14px; }

.toast { position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); background: #252a36; color: #fff; padding: 11px 20px; border-radius: 8px; z-index: 60; font-size: 13px; max-width: 90vw; }

/* 分页控件 */
.pager {
  display: flex; align-items: center; justify-content: flex-end;
  flex-wrap: wrap; gap: 6px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.pager:empty { display: none; }
.pager-info { color: var(--muted); font-size: 12px; margin-right: auto; }
.pager-btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  min-width: 32px; height: 32px; padding: 0 10px; border-radius: 7px; font-size: 13px;
  display: inline-grid; place-items: center;
}
.pager-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pager-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 500; }
.pager-btn:disabled { color: #c3c8d0; cursor: not-allowed; background: #fafbfc; }
.pager-gap { color: var(--muted); padding: 0 2px; }
.col-index { width: 56px; }
td.col-index, th.col-index { text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }

@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; }
  .hero-side { display: none; }
  .stats, .source-grid { grid-template-columns: repeat(2, 1fr); }
  main { padding: 20px 16px 50px; }
  .field-grid { grid-template-columns: 1fr; }
}

/* 窄屏：侧边栏收成图标条，内容全宽 */
@media (max-width: 760px) {
  .sidebar { width: 64px; }
  .sidebar .brand-text,
  .sidebar .nav-text,
  .sidebar .user-chip-text,
  .sidebar .side-logout { display: none; }
  .sidebar .nav-btn { justify-content: center; padding: 11px 0; }
  .sidebar .sidebar-head { padding: 14px 0 14px 0; justify-content: center; position: relative; }
  .sidebar .sidebar-toggle {
    position: absolute; right: -11px; top: 50%; transform: translateY(-50%);
    width: 22px; height: 34px; border-radius: 0 7px 7px 0; border-right: 0;
    background: var(--surface); box-shadow: 2px 0 8px rgba(24, 28, 38, .1);
  }
  .sidebar .toggle-icon { transform: rotate(-135deg); margin-left: 0; }
  .sidebar .user-chip { justify-content: center; }
  .sidebar .sidebar-foot { align-items: center; }
  .site-foot { padding: 0 16px 30px; flex-wrap: wrap; }
}

.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; width: min(420px, 100%); padding: 30px; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 600; }
.auth-slogan { color: var(--muted); font-size: 13px; margin: 8px 0 22px; }
.auth-tabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.auth-tab { flex: 1; border: 0; background: transparent; padding: 10px; color: var(--muted); border-bottom: 2px solid transparent; }
.auth-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }
.auth-form label { display: block; font-size: 13px; margin: 14px 0 6px; }
.auth-form input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; outline: none; }
.auth-form input:focus { border-color: var(--primary); }
.auth-form .btn { width: 100%; margin-top: 22px; }
.agree-row { display: flex; align-items: flex-start; gap: 6px; font-size: 12px; font-weight: 400; color: var(--muted); line-height: 1.6; margin: 2px 0 4px; }
.agree-row input { margin: 2px 0 0; flex: none; }
.agree-row a { color: var(--primary); }
.auth-note { color: var(--muted); font-size: 12px; text-align: center; margin: 18px 0 0; }
/* 注册身份选择（公司 / 员工） */
.role-row { display: flex; gap: 10px; margin: 16px 0 4px; }
.role-opt { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; cursor: pointer; font-size: 14px; margin: 0; }
.role-opt input { width: auto; flex: none; margin: 0; padding: 0; accent-color: var(--primary); }
.role-opt:has(input:checked) { border-color: var(--primary); background: rgba(47,111,237,.06); color: var(--primary); }
/* 公司码展示 */
.org-code-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; background: rgba(47,111,237,.06); border: 1px dashed var(--primary); border-radius: 8px; padding: 12px 14px; margin-bottom: 12px; }
.org-code-label { font-size: 13px; color: var(--muted); }
.org-code-text { font-size: 26px; letter-spacing: 4px; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }
.org-code-tip { font-size: 12px; }
.site-foot { max-width: 1240px; margin: 0 auto; padding: 0 32px 30px; display: flex; gap: 20px; color: var(--muted); font-size: 12px; flex-wrap: wrap; }
.site-foot a { color: var(--muted); }
.site-foot a:hover { color: var(--primary); }

/* 个人中心 · 联系方式 */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
/* 成员角色标记 */
.member-role { flex: none; font-size: 12px; padding: 2px 8px; border-radius: 20px; background: #f0f1f3; color: var(--muted); white-space: nowrap; }
.member-role.owner { background: var(--amber-soft); color: var(--amber); }
/* 忘记密码 / 找回 */
.forgot-link { width: 100%; margin-top: 12px; text-align: center; font-size: 13px; }
.forgot-result { background: var(--green-soft); color: var(--green); padding: 10px 14px; border-radius: 8px; font-size: 13px; margin: 14px 0 0; word-break: break-all; line-height: 1.6; }
.dev-link { margin-top: 8px; padding-top: 8px; border-top: 1px dashed rgba(0,0,0,.12); font-size: 12px; word-break: break-all; }
.dev-link a { color: var(--primary); }

@media (max-width: 1000px) {
  .contact-grid { grid-template-columns: 1fr; }
}

/* 管理员白名单（用户管理页） */
.panel-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.btn.tiny { padding: 4px 10px; font-size: 12px; border-radius: 6px; border: 1px solid transparent; cursor: pointer; }
.wl-add-row { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.wl-add-label { color: var(--muted); font-size: 13px; margin: 0; }
.wl-add-row input { flex: 1; min-width: 220px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 9px 12px; color: var(--text); outline: none; }
.wl-add-row input:focus { border-color: var(--primary); }
.wl-msg { padding: 0 20px 14px; font-size: 13px; min-height: 0; }
.wl-msg.ok { color: var(--green); }
.wl-msg.err { color: var(--red); }

@media (max-width: 700px) {
  .wl-add-row { flex-direction: column; align-items: stretch; }
  .wl-add-row input { min-width: 0; }
}

/* ================= 用户推广计划 ================= */
.ref-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap;
  background: linear-gradient(135deg, #1f5fd8 0%, #3d7fe2 52%, #57a2ff 100%);
  border-radius: 16px; padding: 28px 30px; color: #fff; margin-bottom: 20px;
  box-shadow: 0 12px 28px rgba(31, 95, 216, .2);
}
.ref-hero-main { min-width: 0; flex: 1 1 420px; }
.ref-hero-label { font-size: 13px; opacity: .88; margin-bottom: 12px; }
.ref-code-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ref-code {
  font-size: 34px; font-weight: 700; letter-spacing: 9px; font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, .16); border: 1px dashed rgba(255, 255, 255, .65);
  border-radius: 12px; padding: 6px 14px 6px 22px; line-height: 1.35;
}
.btn.light { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .55); color: #fff; }
.btn.light:hover { background: rgba(255, 255, 255, .3); }
/* 推荐链接：推广页使用（深色底） */
.ref-link-box {
  margin-top: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: rgba(255, 255, 255, .14); border: 1px dashed rgba(255, 255, 255, .5);
  border-radius: 10px; padding: 9px 14px;
}
.ref-link-label { font-size: 12px; opacity: .9; flex: none; }
.ref-link-text {
  font-size: 13px; color: #fff; text-decoration: underline; word-break: break-all;
  cursor: pointer; font-family: ui-monospace, Menlo, Consolas, monospace;
}
.ref-link-hint { font-size: 12px; opacity: .85; flex: none; }
/* 注册页「已自动填入推荐码」提示：紧跟推荐码 label，避免要再滚一屏才看到 */
.reg-ref-auto-tip {
  display: inline-block; margin-left: 8px; vertical-align: middle;
  font-size: 12.5px; font-weight: 400; color: #0f7b4f;
  background: #eaf8f1; border: 1px solid #c4ead8; border-radius: 8px; padding: 3px 10px;
}
.ref-hero-tip { margin: 14px 0 0; font-size: 13px; opacity: .92; max-width: 560px; line-height: 1.75; }
.ref-hero-points { text-align: right; min-width: 190px; }
.ref-points-num { font-size: 44px; font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; }
.ref-points-num small { display: block; font-size: 13px; font-weight: 400; opacity: .9; margin-top: 6px; }
.ref-points-cash { margin-top: 10px; font-size: 13px; background: rgba(255, 255, 255, .18); border-radius: 20px; padding: 5px 14px; display: inline-block; }

.ref-rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; margin-bottom: 20px; }
.ref-rule { display: flex; align-items: center; gap: 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.ref-rule-num {
  width: 40px; height: 40px; border-radius: 11px; flex: none;
  background: linear-gradient(135deg, #f5a623, #e07b00); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 18px;
}
.ref-rule-num.symbol { font-size: 17px; }
.ref-rule-text { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); line-height: 1.6; }
.ref-rule-text strong { color: var(--text); font-weight: 600; }
.ref-rule-text b { color: #c96a00; font-weight: 600; }

.ref-panel-gap { margin-top: 20px; }
.ref-points { font-weight: 700; color: #d97706; font-size: 15px; font-variant-numeric: tabular-nums; }
.ref-detail-btn { font-size: 12px; margin-left: 6px; text-decoration: underline; }
.ref-detail {
  margin-top: 9px; background: #fafbfc; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; min-width: 300px; text-align: left;
}
.ref-detail-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; font-size: 12px; padding: 6px 0; color: var(--muted); }
.ref-detail-row + .ref-detail-row { border-top: 1px dashed var(--line); }
.ref-detail-row b { color: #d97706; white-space: nowrap; }
.ref-detail-empty { font-size: 12px; color: var(--muted); }

.ref-withdraw { display: flex; gap: 20px; padding: 18px 20px; align-items: flex-start; flex-wrap: wrap; }
.ref-withdraw-form { display: grid; grid-template-columns: repeat(2, minmax(150px, 1fr)); gap: 12px 14px; flex: 1 1 420px; }
.ref-withdraw-form .field-submit { grid-column: 1 / -1; }
.ref-withdraw-form .field input, .ref-withdraw-form .field select {
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; background: var(--surface);
  color: var(--text); outline: none; width: 100%;
}
.ref-withdraw-form .field input:focus, .ref-withdraw-form .field select:focus { border-color: var(--primary); }
.ref-withdraw-tip { background: var(--amber-soft); border-radius: 12px; padding: 14px 16px; font-size: 13px; min-width: 240px; line-height: 1.8; }
.ref-withdraw-tip b { color: #b26a00; font-size: 16px; }

@media (max-width: 760px) {
  .ref-hero { padding: 22px 20px; }
  .ref-hero-points { text-align: left; }
  .ref-code { font-size: 26px; letter-spacing: 6px; }
  .ref-withdraw-form { grid-template-columns: 1fr; }
  .ref-detail { min-width: 0; }
}

/* 管理员打款留痕：流水号 + 企业资质核验 */
.wd-pay-row td { background: var(--surface-2, #f7f9fc); padding: 14px 12px; }
.wd-pay-form { display: flex; flex-direction: column; gap: 10px; max-width: 520px; }
.wd-pay-form .field label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 4px; }
.wd-pay-form .field input {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--surface);
  color: var(--text); outline: none; width: 100%;
}
.wd-pay-form .field input:focus { border-color: var(--primary); }
.wd-cert-check { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--text); line-height: 1.6; }
.wd-cert-check input { margin-top: 3px; flex: none; }
.wd-pay-form .modal-actions { margin: 0; display: flex; gap: 8px; }
