/* ========================================================================
   芯美丽格·盘客 - 网页版 9.12 改
   配色完全对齐小程序：紫色主调
   布局：左侧 280px 固定侧栏 + 右侧弹性内容区（居中最大 1800px）
   适配：电脑屏幕（1280-1920）+ 投屏电视（1920+）
   ======================================================================== */

:root {
  --purple: #9B7BB8;
  --purple-dark: #7E5F9B;
  --purple-light: #ECE2F3;
  --purple-bg: #F8F4FF;
  --purple-border: #C9B8DC;
  --purple-deep: #4a4458;
  --bg: #F5F6F8;
  --card-bg: #FFFFFF;
  --text: #333333;
  --text-2: #555555;
  --text-3: #666666;
  --text-gray: #888888;
  --text-weak: #999999;
  --border: #E0E0E0;
  --border-light: #EEEEEE;
  --red: #E64340;
  --red-bg: #FFEBEB;
  --gold: #F5C518;
  --gold-light: #FFE08A;
  --silver: #C8C8C8;
  --silver-light: #F4F4F4;
  --bronze: #C77B3B;
  --bronze-light: #E8B98A;
  --shadow-sm: 0 2px 6px rgba(0,0,0,0.06);
  --shadow: 0 4px 16px rgba(155,123,184,0.12);
  --shadow-lg: 0 10px 40px rgba(155,123,184,0.18);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--purple-border); border-radius: 5px; }

a { color: inherit; text-decoration: none; cursor: pointer; }
button { font-family: inherit; cursor: pointer; }

/* ========================================================================
   根布局
   ======================================================================== */
.shell {
  display: flex;
  min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
  width: 280px;
  min-height: 100vh;
  background: var(--card-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 28px 24px;
  border-bottom: 1px solid var(--border-light);
}
.brand-logo {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-dark) 100%);
  color: white;
  font-size: 26px;
  font-weight: 700;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand-title { font-size: 18px; font-weight: 600; color: var(--text); line-height: 1.3; }
.brand-sub { font-size: 13px; color: var(--text-gray); line-height: 1.3; }

.sidebar-nav {
  flex: 1;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  color: var(--text-3);
  font-size: 17px;
  transition: all 0.15s;
  cursor: pointer;
}
.nav-item svg { width: 24px; height: 24px; flex-shrink: 0; }
.nav-item:hover { background: var(--purple-bg); color: var(--purple); }
.nav-item.active {
  background: var(--purple-bg);
  color: var(--purple);
  font-weight: 500;
}
.nav-item.active svg { stroke: var(--purple); }

.sidebar-foot { padding: 20px; border-top: 1px solid var(--border-light); }
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius-sm);
}
.sidebar-avatar {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-dark) 100%);
  color: white;
  font-size: 18px;
  font-weight: 600;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sidebar-name {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-role { font-size: 13px; color: var(--text-gray); }
.sidebar-logout {
  width: 40px; height: 40px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-gray);
  flex-shrink: 0;
  transition: all 0.15s;
}
.sidebar-logout:hover { border-color: var(--purple); color: var(--purple); }
.sidebar-logout svg { width: 18px; height: 18px; }

/* 主区 */
.main {
  margin-left: 280px;
  flex: 1;
  min-height: 100vh;
}
.page-root {
  max-width: 1800px;
  margin: 0 auto;
  padding: 40px 56px;
}

/* ========================================================================
   通用页面头
   ======================================================================== */
.page-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}
.page-bar-left { display: flex; align-items: center; gap: 18px; }
.page-bar-right { display: flex; align-items: center; gap: 14px; }
.page-title {
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
  position: relative;
}
.page-title::after {
  content: '';
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--purple) 0%, transparent 100%);
  margin-top: 8px;
  width: 60px;
  border-radius: 2px;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 18px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--text-3);
  cursor: pointer;
  transition: all 0.15s;
}
.back-btn:hover { border-color: var(--purple); color: var(--purple); }

.btn-primary {
  height: 48px;
  padding: 0 24px;
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-dark) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary:hover { opacity: 0.92; }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary.btn-large { height: 56px; padding: 0 40px; font-size: 17px; }

.btn-ghost {
  height: 48px;
  padding: 0 24px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  color: var(--text-3);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-ghost:hover { border-color: var(--purple); color: var(--purple); }

/* 搜索 / 日期 */
.search-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 0 20px;
  height: 48px;
  width: 360px;
  transition: border-color 0.15s;
}
.search-pill:focus-within { border-color: var(--purple); }
.search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 16px;
  color: var(--text);
}
.date-pill {
  height: 48px;
  padding: 0 20px;
  border: 1px solid var(--border);
  border-radius: 30px;
  background: white;
  font-size: 15px;
  color: var(--text-3);
  outline: none;
  font-family: inherit;
}
.date-pill:focus { border-color: var(--purple); }

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--purple-bg);
  border: 1px solid var(--purple-border);
  border-radius: 22px;
  font-size: 14px;
  color: var(--purple-dark);
}
.chip-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--purple-border);
  color: white;
  font-size: 14px;
  line-height: 1;
  margin-left: 4px;
  cursor: pointer;
}

/* 分类 tab */
.type-tabs {
  display: flex;
  gap: 6px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px;
  margin-bottom: 24px;
  width: fit-content;
}
.type-tab {
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 16px;
  color: var(--text-3);
  cursor: pointer;
  transition: all 0.15s;
}
.type-tab:hover { color: var(--purple); }
.type-tab.active { background: var(--purple); color: white; font-weight: 500; }

/* 通用 link button */
.link-btn {
  background: none;
  border: none;
  color: var(--purple);
  font-size: 14px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background 0.15s;
}
.link-btn:hover { background: var(--purple-bg); }

/* ========================================================================
   顾客卡片（列表 + 详情头）
   ======================================================================== */
.cust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(540px, 1fr));
  gap: 24px;
}

.cust-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  gap: 20px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
  min-height: 220px;
}
.cust-card:hover {
  border-color: var(--purple-border);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.cust-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.cust-card-photo {
  width: 180px;
  flex-shrink: 0;
  background: var(--purple-bg);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cust-card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cust-photo-empty {
  color: var(--text-weak);
  font-size: 14px;
  text-align: center;
  padding: 20px 8px;
  line-height: 1.6;
}

.cust-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.cust-name {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
}
.cust-type-tag {
  display: inline-block;
  padding: 2px 10px;
  background: var(--purple-bg);
  color: var(--purple-dark);
  font-size: 13px;
  border-radius: 12px;
  font-weight: 500;
}

.cust-line {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 16px;
  padding: 5px 0;
  flex-wrap: wrap;
}
.cc-label { color: var(--text-gray); flex-shrink: 0; }
.cc-value { color: var(--text); }
.cc-empty { color: var(--purple); font-size: 14px; }
.cc-name-v { color: var(--text); font-weight: 500; }
.cust-divider {
  height: 1px;
  background: var(--border-light);
  margin: 8px 0;
}

/* 详情页档案头：字段可点 */
.cust-line[data-edit] {
  cursor: pointer;
  padding: 8px 10px;
  margin: 0 -10px;
  border-radius: 8px;
  transition: background 0.15s;
}
.cust-line[data-edit]:hover { background: var(--purple-bg); }

/* ========================================================================
   档案 section
   ======================================================================== */
.archive-sections { display: flex; flex-direction: column; gap: 20px; margin-top: 24px; }

.arch-section {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.arch-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border-light);
  background: var(--purple-bg);
}
.arch-section-title {
  font-size: 19px;
  font-weight: 600;
  color: var(--purple-dark);
}
.arch-section-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.arch-section-body { padding: 20px 32px; }

.arch-field { padding: 10px 0; }
.arch-field-label {
  font-size: 13px;
  color: var(--text-gray);
  margin-bottom: 6px;
}
.arch-field-val {
  font-size: 16px;
  color: var(--text);
  line-height: 1.7;
}
.arch-empty {
  color: var(--text-weak);
  font-size: 14px;
  text-align: center;
  padding: 24px 0;
  font-style: italic;
}

/* 术后随访 */
.followup-item {
  background: var(--purple-bg);
  border: 1px solid var(--purple-light);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 10px;
}
.followup-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.followup-date { font-size: 14px; font-weight: 500; color: var(--purple-dark); }
.followup-tag {
  font-size: 12px;
  padding: 2px 10px;
  background: white;
  color: var(--purple);
  border-radius: 12px;
}
.followup-content { font-size: 15px; color: var(--text); line-height: 1.6; }

/* 项目 */
.project-item {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 10px;
}
.project-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.project-name { font-size: 17px; font-weight: 500; color: var(--text); }
.project-amount { font-size: 17px; font-weight: 600; color: var(--purple); }
.project-date { font-size: 13px; color: var(--text-gray); }

/* 照片墙 */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.photo-cell {
  aspect-ratio: 1;
  background: var(--purple-bg);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
}
.photo-cell img { width: 100%; height: 100%; object-fit: cover; }
.photo-cell-add {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  color: var(--purple);
  border: 2px dashed var(--purple-border);
  background: var(--purple-bg);
  cursor: pointer;
  transition: all 0.15s;
}
.photo-cell-add:hover { border-color: var(--purple); color: var(--purple-dark); }

.profile-text { font-size: 16px; color: var(--text); line-height: 1.7; white-space: pre-wrap; }

/* ========================================================================
   加载/空态
   ======================================================================== */
.loading-state {
  text-align: center;
  color: var(--text-gray);
  padding: 100px 0;
  font-size: 16px;
}
.empty-state {
  text-align: center;
  color: var(--text-gray);
  padding: 100px 20px;
  font-size: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.empty-illust {
  width: 100px;
  height: 100px;
  background: var(--purple-bg);
  border: 2px dashed var(--purple-border);
  border-radius: 50%;
}

/* ========================================================================
   统计页
   ======================================================================== */
.period-tabs {
  display: flex;
  gap: 6px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px;
  width: fit-content;
  margin-bottom: 28px;
}
.period-tab {
  padding: 10px 28px;
  border-radius: 8px;
  font-size: 16px;
  color: var(--text-3);
  cursor: pointer;
  transition: all 0.15s;
}
.period-tab:hover { color: var(--purple); }
.period-tab.active { background: var(--purple); color: white; font-weight: 500; }

.stats-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 36px;
}
.stats-card-wide {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  align-items: center;
  gap: 22px;
  box-shadow: var(--shadow-sm);
}
.stats-icon { width: 64px; height: 64px; flex-shrink: 0; color: var(--purple); }
.stats-icon svg { width: 100%; height: 100%; }
.stats-label { font-size: 14px; color: var(--text-gray); margin-bottom: 8px; }
.stats-num { font-size: 48px; font-weight: 700; color: var(--text); line-height: 1; }
.stats-unit { font-size: 20px; font-weight: 400; color: var(--text-gray); margin-left: 6px; }

.ranking-section { }
.section-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--purple-light);
  display: inline-block;
}
.ranking-list { display: flex; flex-direction: column; gap: 14px; }
.rank-item {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: all 0.15s;
}
.rank-item:hover { box-shadow: var(--shadow-sm); }
.rank-badge {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  flex-shrink: 0;
}
.rank-badge.gold { background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: #7B5800; }
.rank-badge.silver { background: linear-gradient(135deg, var(--silver-light), var(--silver)); color: #555; }
.rank-badge.bronze { background: linear-gradient(135deg, var(--bronze-light), var(--bronze)); color: white; }
.rank-badge.normal { background: var(--purple-bg); color: var(--purple); font-size: 16px; }

.rank-body { flex: 1; min-width: 0; }
.rank-name { font-size: 18px; font-weight: 500; color: var(--text); margin-bottom: 10px; }
.rank-bar { height: 8px; background: var(--border-light); border-radius: 4px; overflow: hidden; margin-bottom: 8px; }
.rank-fill { height: 100%; background: linear-gradient(90deg, var(--purple), var(--purple-dark)); border-radius: 4px; }
.rank-meta { font-size: 14px; color: var(--purple); font-weight: 500; }

/* 员工排名页（卡片式） */
.rank-cards { display: flex; flex-direction: column; gap: 14px; }
.rank-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: all 0.15s;
}
.rank-card:hover { box-shadow: var(--shadow-sm); }
.rank-card-body { flex: 1; min-width: 0; }
.rank-tags { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.rank-tag {
  font-size: 13px;
  padding: 3px 12px;
  background: var(--purple-bg);
  color: var(--purple-dark);
  border-radius: 12px;
  font-weight: 500;
}
.rank-tag-light {
  font-size: 13px;
  padding: 3px 12px;
  background: var(--bg);
  color: var(--text-gray);
  border-radius: 12px;
}
.rank-view { padding: 0 18px; height: 40px; font-size: 14px; }

/* ========================================================================
   员工管理
   ======================================================================== */
.emp-table {
  width: 100%;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-collapse: collapse;
  overflow: hidden;
}
.emp-table th {
  background: var(--purple-bg);
  padding: 16px 20px;
  font-size: 15px;
  color: var(--purple-dark);
  font-weight: 500;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.emp-table td {
  padding: 18px 20px;
  font-size: 15px;
  border-bottom: 1px solid var(--border-light);
}
.emp-table tr:last-child td { border-bottom: none; }
.emp-table tr:hover { background: var(--purple-bg); }
.role-tag {
  display: inline-block;
  padding: 3px 12px;
  background: var(--bg);
  color: var(--text-3);
  border-radius: 12px;
  font-size: 13px;
}
.role-tag.admin { background: var(--purple); color: white; }
.status-tag {
  display: inline-block;
  padding: 3px 12px;
  background: #E8F5E8;
  color: #5CA912;
  border-radius: 12px;
  font-size: 13px;
}
.status-tag.off { background: var(--bg); color: var(--text-weak); }

/* 表单 */
.form-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  max-width: 960px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.form-field { display: flex; flex-direction: column; gap: 8px; }
.form-label { font-size: 14px; color: var(--text-3); }
.form-input {
  height: 52px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  outline: none;
  background: white;
  font-family: inherit;
  transition: border-color 0.15s;
}
.form-input:focus { border-color: var(--purple); }
.form-actions { margin-top: 36px; display: flex; justify-content: center; }

/* ========================================================================
   我的
   ======================================================================== */
.mine-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
}
.mine-avatar {
  width: 80px; height: 80px;
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-dark) 100%);
  color: white;
  font-size: 30px;
  font-weight: 600;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mine-name { font-size: 24px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.mine-role { font-size: 14px; color: var(--text-gray); }

.mine-menu {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.mine-menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  font-size: 17px;
  color: var(--text);
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s;
}
.mine-menu-item:last-child { border-bottom: none; }
.mine-menu-item:hover { background: var(--purple-bg); }
.mine-menu-item.danger { color: var(--red); }
.mine-menu-item.danger:hover { background: var(--red-bg); }
.mine-menu-item svg { color: currentColor; }

/* ========================================================================
   登录页
   ======================================================================== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--purple-bg) 0%, var(--purple-light) 100%);
  padding: 40px 20px;
}
.login-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 56px 48px;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow-lg);
}
.login-brand {
  font-size: 32px;
  font-weight: 700;
  color: var(--purple-dark);
  text-align: center;
  margin-bottom: 10px;
}
.login-sub {
  text-align: center;
  color: var(--text-gray);
  font-size: 15px;
  margin-bottom: 40px;
}
.login-fields { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }
.login-input {
  height: 56px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  outline: none;
  background: var(--bg);
  transition: all 0.15s;
}
.login-input:focus { border-color: var(--purple); background: white; }

.login-agree { margin-bottom: 20px; }
.agree-check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-3); cursor: pointer; }
.agree-check input { display: none; }
.agree-box {
  width: 18px; height: 18px;
  border: 1px solid var(--border);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.agree-check input:checked + .agree-box {
  background: var(--purple);
  border-color: var(--purple);
}
.agree-check input:checked + .agree-box::after {
  content: '✓';
  color: white;
  font-size: 13px;
}
.login-link { color: var(--purple); }

.login-err {
  color: var(--red);
  font-size: 14px;
  text-align: center;
  margin-bottom: 14px;
}

.login-btn {
  width: 100%;
  height: 56px;
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-dark) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
  margin-bottom: 14px;
}
.login-btn:hover { opacity: 0.92; }
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.login-tip { text-align: center; font-size: 13px; color: var(--text-weak); }

.agreement-page {
  min-height: 100vh;
  background: var(--bg);
  padding: 40px 20px;
  display: flex;
  justify-content: center;
}
.agreement-card {
  background: white;
  border-radius: var(--radius);
  padding: 48px;
  max-width: 880px;
  width: 100%;
}
.agreement-card h2 { font-size: 28px; margin-bottom: 28px; color: var(--text); }
.agreement-card h3 { font-size: 19px; margin: 24px 0 12px; color: var(--purple-dark); }
.agreement-content p { line-height: 1.8; color: var(--text-3); margin-bottom: 12px; font-size: 15px; }

/* ========================================================================
   模态框
   ======================================================================== */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  backdrop-filter: blur(3px);
}
.modal-mask.show { opacity: 1; pointer-events: auto; }
.modal-card {
  background: white;
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 540px;
  box-shadow: var(--shadow-lg);
}
.modal-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 24px;
}
.modal-input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  outline: none;
  margin-bottom: 14px;
  background: var(--bg);
  font-family: inherit;
}
.modal-input:focus { border-color: var(--purple); background: white; }
.modal-textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  outline: none;
  background: var(--bg);
  margin-bottom: 18px;
  resize: vertical;
  min-height: 120px;
  font-family: inherit;
}
.modal-textarea:focus { border-color: var(--purple); background: white; }
.modal-err { color: var(--red); font-size: 14px; margin-bottom: 14px; }
.modal-actions {
  display: flex;
  gap: 14px;
  margin-top: 20px;
  justify-content: flex-end;
}

/* ========================================================================
   Toast / Loading
   ======================================================================== */
.toast {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(51,51,51,0.92);
  color: white;
  padding: 14px 32px;
  border-radius: 36px;
  font-size: 15px;
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: rgba(92,169,18,0.95); }
.toast.error { background: rgba(230,67,64,0.95); }

.loading-mask {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  backdrop-filter: blur(2px);
}
.loading-mask.show { display: flex; }
.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--purple-border);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========================================================================
   响应式
   - 1100px 以下：侧边栏收 240px
   - 768px 以下：侧边栏收 80px（仅图标）
   - 1920px+（投屏电视）：进一步放大所有元素
   ======================================================================== */
@media (min-width: 1920px) {
  /* 投屏电视场景 - 进一步放大 */
  body { font-size: 18px; }
  .page-root { max-width: 1900px; padding: 56px 72px; }
  .page-title { font-size: 32px; }
  .page-title::after { width: 72px; height: 5px; }
  .sidebar { width: 320px; }
  .main { margin-left: 320px; }
  .brand-logo { width: 60px; height: 60px; font-size: 30px; }
  .brand-title { font-size: 21px; }
  .brand-sub { font-size: 15px; }
  .nav-item { font-size: 19px; padding: 16px 22px; }
  .nav-item svg { width: 28px; height: 28px; }
  .btn-primary { height: 56px; font-size: 18px; padding: 0 32px; }
  .search-pill { height: 56px; font-size: 17px; }
  .search-input { font-size: 17px; }
  .date-pill { height: 56px; font-size: 17px; }
  .cust-card { padding: 36px; gap: 24px; min-height: 260px; }
  .cust-card-photo { width: 220px; }
  .cust-name { font-size: 26px; }
  .cust-line { font-size: 18px; }
  .arch-section-title { font-size: 22px; }
  .arch-section-body { padding: 24px 40px; }
  .stats-card-wide { padding: 40px; }
  .stats-num { font-size: 60px; }
  .stats-label { font-size: 16px; }
  .stats-icon { width: 80px; height: 80px; }
  .rank-item { padding: 24px 32px; }
  .rank-name { font-size: 20px; }
  .rank-badge { width: 64px; height: 64px; font-size: 22px; }
}

@media (max-width: 1100px) {
  .page-root { padding: 32px 28px; }
  .sidebar { width: 240px; }
  .main { margin-left: 240px; }
  .cust-grid { grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); }
}

@media (max-width: 768px) {
  .sidebar { width: 80px; }
  .sidebar-brand > div:not(.brand-logo),
  .nav-item span,
  .sidebar-name,
  .sidebar-role,
  .sidebar-logout { display: none; }
  .sidebar-brand { padding: 20px; justify-content: center; }
  .sidebar-nav { padding: 16px 8px; }
  .nav-item { justify-content: center; padding: 14px 8px; }
  .sidebar-foot { padding: 12px 8px; }
  .sidebar-user { justify-content: center; padding: 0; }
  .main { margin-left: 80px; }
  .page-root { padding: 20px 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .search-pill { width: 200px; }
  .cust-grid { grid-template-columns: 1fr; }
  .stats-summary { grid-template-columns: 1fr; }
}
