/* ============================================================
   商务端原型设计 - 公共样式
   ============================================================ */

:root {
  --bg-primary: #0f1117;
  --bg-secondary: #161822;
  --bg-card: #1a1d2e;
  --bg-hover: #1f2338;
  --bg-input: #11131e;
  --border: #262a3a;
  --border-light: #2a2e40;
  --text-primary: #e8e9ed;
  --text-secondary: #9a9db4;
  --text-muted: #646889;
  --accent: #4f8cff;
  --accent-hover: #6ba0ff;
  --accent-bg: rgba(79, 140, 255, 0.10);
  --success: #34d399;
  --success-bg: rgba(52, 211, 153, 0.10);
  --warning: #fbbf24;
  --warning-bg: rgba(251, 191, 36, 0.10);
  --danger: #f87171;
  --danger-bg: rgba(248, 113, 113, 0.10);
  --sidebar-width: 220px;
  --header-height: 56px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.25);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  display: flex;
  min-height: 100vh;
}

/* ========== 左侧导航 ========== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo .logo-icon {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #fff; font-weight: 700;
}

.sidebar-logo .logo-text {
  font-size: 15px; font-weight: 600; color: var(--text-primary);
  white-space: nowrap;
}

.sidebar-nav { flex: 1; padding: 12px 0; }

.nav-group { margin-bottom: 4px; }

.nav-group-title {
  padding: 10px 20px 6px;
  font-size: 11px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 20px; cursor: pointer;
  color: var(--text-secondary); font-size: 13px;
  transition: all 0.15s; text-decoration: none;
  border-left: 3px solid transparent;
}

.nav-item:hover { color: var(--text-primary); background: var(--bg-hover); }
.nav-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.nav-item.active {
  color: var(--accent); background: var(--accent-bg);
  border-left-color: var(--accent);
}

.nav-item .nav-icon { width: 18px; text-align: center; font-size: 14px; }

.sub-nav .nav-item { padding-left: 50px; font-size: 12px; }

/* ========== 主内容区 ========== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1; display: flex; flex-direction: column;
  min-height: 100vh;
}

.header {
  height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 50;
}

.header-title { font-size: 15px; font-weight: 600; }

.header-actions { display: flex; align-items: center; gap: 16px; }

.user-info {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-secondary); font-size: 13px;
}

.header-checkbox {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-secondary); font-size: 13px;
  cursor: pointer;
  user-select: none;
}

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

.user-avatar {
  width: 30px; height: 30px;
  background: var(--accent); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 600;
}

.content { padding: 24px; flex: 1; }

/* ========== 卡片 ========== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}

.card-title { font-size: 15px; font-weight: 600; }

.card-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ========== 统计卡片 ========== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  transition: border-color 0.2s, background 0.2s;
  cursor: default;
}

.stat-card:hover {
  border-color: var(--text-muted);
  background: var(--bg-hover);
}

.stat-card .stat-label { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.stat-card .stat-value { font-size: 28px; font-weight: 700; }
.stat-card .stat-change { font-size: 12px; margin-top: 4px; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

.rank-change { font-size: 12px; font-weight: 500; white-space: nowrap; }
.rank-change.up   { color: var(--success); }
.rank-change.down { color: var(--danger); }

/* ========== 表格 ========== */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

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

th {
  background: var(--bg-input);
  padding: 10px 14px; text-align: left;
  font-weight: 600; color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap; font-size: 12px;
}

td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
}

tr:hover td { background: var(--bg-hover); }
tr:last-child td { border-bottom: none; }

/* ========== 表单 ========== */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block; font-size: 13px; font-weight: 500;
  color: var(--text-secondary); margin-bottom: 6px;
}

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

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  outline: none;
}

input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

input:disabled, select:disabled, textarea:disabled {
  opacity: 0.45; cursor: not-allowed;
}

/* checkbox 自定义样式 */
input[type="checkbox"] {
  width: 15px; height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
  vertical-align: middle;
}

select { cursor: pointer; }

textarea { resize: vertical; min-height: 80px; }

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

/* ========== 按钮 ========== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500; cursor: pointer;
  border: 1px solid transparent; transition: all 0.15s;
  font-family: inherit; user-select: none;
}
.btn:active { transform: scale(0.96); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: var(--accent); color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
  background: transparent; color: var(--text-secondary);
  border-color: var(--border);
}
.btn-secondary:hover { color: var(--text-primary); border-color: var(--text-muted); }

.btn-ghost {
  background: transparent; color: var(--accent);
}
.btn-ghost:hover { background: var(--accent-bg); }

.btn-danger {
  background: var(--danger-bg); color: var(--danger);
}
.btn-danger:hover { background: rgba(248,113,113,0.20); }

.btn-sm { padding: 5px 12px; font-size: 12px; }

/* ========== 工具栏 ========== */
.toolbar {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; margin-bottom: 16px;
}

.toolbar .spacer { flex: 1; }

.toolbar input[type="text"],
.toolbar select {
  width: auto; min-width: 160px;
}

/* ========== 标签/徽章 ========== */
.badge {
  display: inline-block; padding: 2px 8px;
  border-radius: 10px; font-size: 11px; font-weight: 500;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-info    { background: var(--accent-bg);  color: var(--accent); }

/* ========== 标签筛选 ========== */
.tag-filter { display: flex; gap: 6px; flex-wrap: wrap; }

.tag {
  padding: 4px 12px; border-radius: 14px;
  font-size: 12px; cursor: pointer;
  background: var(--bg-input); color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: all 0.15s;
  user-select: none;
}

.tag.active { background: var(--accent-bg); color: var(--accent); border-color: var(--accent); }

.tag:hover:not(.active) { background: var(--bg-hover); }
.tag:active { transform: scale(0.95); }

/* ========== 图表占位 ========== */
.chart-placeholder {
  width: 100%; height: 300px;
  background: var(--bg-input);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 13px;
  position: relative;
}

/* ========== 预警等级 ========== */
.alert-level {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 500;
}

.alert-level.high   { color: var(--danger); }
.alert-level.medium { color: var(--warning); }
.alert-level.low    { color: var(--text-muted); }

/* ========== 分页 ========== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 12px 14px;
  color: var(--text-secondary);
  font-size: 13px;
}

.pagination-info {
  color: var(--text-muted);
  font-size: 13px;
}

.page-size-select {
  width: auto;
  min-width: 80px;
  padding: 5px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  outline: none;
  font-family: inherit;
}

.page-size-select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.pagination-btns {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination-btn,
.pagination-prev,
.pagination-next {
  padding: 5px 12px;
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
  font-family: inherit;
  min-width: 32px;
  white-space: nowrap;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pagination-prev,
.pagination-next {
  min-width: 64px;
  padding: 5px 14px;
}

.pagination-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.pagination-btn:hover:not(.active),
.pagination-prev:hover:not(:disabled),
.pagination-next:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.pagination-btn:active,
.pagination-prev:active:not(:disabled),
.pagination-next:active:not(:disabled) {
  transform: scale(0.94);
}

.pagination-prev:disabled,
.pagination-next:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-ellipsis {
  padding: 5px 8px;
  color: var(--text-muted);
  font-size: 13px;
  user-select: none;
}

.pagination-btn:focus-visible,
.pagination-prev:focus-visible,
.pagination-next:focus-visible,
.page-size-select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* ========== 原型说明浮动按钮 ========== */
.proto-help-btn {
  position: fixed;
  bottom: 28px; right: 28px;
  width: 56px; height: 56px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff; border: none; cursor: pointer;
  font-size: 14px; font-weight: 600;
  box-shadow: 0 4px 16px rgba(79, 140, 255, 0.35);
  z-index: 999;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  line-height: 1.3;
  text-align: center;
}

.proto-help-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(79, 140, 255, 0.45);
}

/* ========== 原型说明侧边栏 ========== */
.proto-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 1000;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}

.proto-overlay.open { opacity: 1; pointer-events: auto; }

.proto-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 500px; max-width: 92vw;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  z-index: 1001;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex; flex-direction: column;
  box-shadow: -4px 0 24px rgba(0,0,0,0.3);
}

.proto-panel.open { transform: translateX(0); }

.proto-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
}

.proto-panel-title {
  font-size: 16px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}

.proto-panel-close {
  width: 32px; height: 32px;
  border-radius: var(--radius);
  background: transparent; border: none;
  color: var(--text-secondary); cursor: pointer;
  font-size: 18px; display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}

.proto-panel-close:hover { background: var(--bg-hover); color: var(--text-primary); }

.proto-panel-body { flex: 1; overflow-y: auto; padding: 28px; }

.proto-section { margin-bottom: 24px; }

.proto-section:last-child { margin-bottom: 0; }

.proto-section-title {
  font-size: 13px; font-weight: 700;
  color: var(--accent);
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}

.proto-section-title::before {
  content: '';
  width: 4px; height: 16px;
  background: var(--accent);
  border-radius: 2px;
}

.proto-section-content {
  font-size: 13px; color: var(--text-secondary);
  line-height: 1.9;
}

.proto-section-content ul {
  list-style: none; padding-left: 0;
}

.proto-section-content ul li {
  padding: 7px 0 7px 18px; position: relative;
}

.proto-section-content ul li::before {
  content: '•'; position: absolute; left: 2px; top: 7px;
  color: var(--text-muted); font-weight: bold;
}

.proto-section-content b {
  color: var(--text-primary); font-weight: 600;
}

.proto-section-content .highlight {
  display: inline-block; padding: 1px 6px;
  background: var(--accent-bg); color: var(--accent);
  border-radius: 3px; font-size: 12px; font-weight: 500;
}

/* ========== 表头字段帮助提示 ========== */
.col-help {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  border: 1px solid var(--text-muted); color: var(--text-muted);
  font-size: 10px; font-weight: 700; cursor: help;
  margin-left: 3px; vertical-align: middle;
  transition: all 0.2s; position: relative;
}
.col-help:hover {
  border-color: var(--accent); color: var(--accent);
  background: var(--accent-bg);
}
.col-help::after {
  content: attr(data-tip);
  position: absolute; left: 50%; top: calc(100% + 6px);
  transform: translateX(-50%);
  padding: 6px 10px;
  background: var(--text-primary); color: var(--bg-primary);
  font-size: 12px; font-weight: 400; white-space: nowrap;
  border-radius: 6px; pointer-events: none;
  opacity: 0; transition: opacity 0.15s;
  z-index: 9999;
}
.col-help:hover::after {
  opacity: 1;
}

/* ========== 双栏布局 ========== */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

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

/* ========== 快捷时间选择 ========== */
.time-shortcuts { display: flex; gap: 4px; }

.time-shortcut {
  padding: 5px 12px; border-radius: var(--radius);
  background: var(--bg-input); color: var(--text-secondary);
  border: 1px solid var(--border); cursor: pointer;
  font-size: 12px; font-family: inherit;
  transition: all 0.15s;
}

.time-shortcut.active { background: var(--accent-bg); color: var(--accent); border-color: var(--accent); }
.time-shortcut:hover:not(.active) { background: var(--bg-hover); }
.time-shortcut:active { transform: scale(0.94); }

/* ========== 弹窗 ========== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6); z-index: 500;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.open { opacity: 1; pointer-events: auto; }

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 520px; max-width: 90vw;
  box-shadow: 0 12px 48px rgba(0,0,0,0.4);
  transform: scale(0.92) translateY(10px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}

.modal-xl { width: 960px; max-height: 85vh; display: flex; flex-direction: column; }

.modal-header {
  padding: 18px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 15px; font-weight: 600;
}

.modal-body { padding: 24px; }

.modal-xl .modal-body { overflow-y: auto; flex: 1; }

.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ========== 商务画像弹窗 ========== */
.profile-body { padding: 24px 28px; }

.profile-section { margin-bottom: 28px; }
.profile-section:last-child { margin-bottom: 0; }

.profile-section-title {
  font-size: 14px; font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; gap: 8px;
}

.profile-section-title::before {
  content: '';
  width: 4px; height: 16px;
  background: var(--accent);
  border-radius: 2px;
}

/* 基本信息网格 */
.profile-info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px 20px;
}

.profile-info-item {
  display: flex; flex-direction: column; gap: 2px;
}

.profile-info-label {
  font-size: 12px; color: var(--text-muted);
}

.profile-info-value {
  font-size: 13px; color: var(--text-primary);
}

/* 核心指标卡片 */
.profile-metric-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.profile-metric-card {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: default;
  transition: border-color 0.2s, background 0.2s;
}

.profile-metric-card:hover {
  border-color: var(--text-muted);
  background: var(--bg-hover);
}

.pmc-label { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.pmc-value { font-size: 22px; font-weight: 700; }
.pmc-change { font-size: 12px; margin-top: 4px; }
.pmc-change.up   { color: var(--success); }
.pmc-change.down { color: var(--danger); }

/* 趋势图双栏 */
.profile-chart-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.profile-chart {}

.profile-chart-label {
  font-size: 12px; color: var(--text-secondary);
  margin-bottom: 8px; font-weight: 500;
}

/* 排行榜双栏 */
.profile-ranking-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.profile-ranking {}

.profile-ranking-label {
  font-size: 12px; color: var(--text-secondary);
  margin-bottom: 8px; font-weight: 500;
}

/* 画像弹窗内表格 */
.profile-table {
  width: 100%; border-collapse: collapse; font-size: 12px;
}

.profile-table th {
  background: var(--bg-input);
  padding: 6px 10px; text-align: left;
  font-weight: 600; color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
}

.profile-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-light);
}

.profile-table tr:hover td { background: var(--bg-hover); }
.profile-table tr:last-child td { border-bottom: none; }

/* 渠道质量分布 */
.profile-quality-list {
  display: flex; flex-direction: column; gap: 12px;
}

.quality-item {
  display: flex; align-items: center; gap: 12px;
}

.quality-label {
  font-size: 13px; font-weight: 600; color: var(--text-primary);
  min-width: 70px;
}

.quality-desc {
  font-size: 11px; color: var(--text-muted);
  min-width: 90px;
}

.quality-bar {
  flex: 1; height: 10px;
  background: var(--bg-input);
  border-radius: 5px; overflow: hidden;
}

.quality-bar-fill {
  height: 100%; border-radius: 5px;
  transition: width 0.4s ease;
}

.fill-green  { background: var(--success); }
.fill-yellow { background: var(--warning); }
.fill-orange { background: #f59e0b; }
.fill-gray   { background: var(--text-muted); }

.quality-num {
  font-size: 13px; color: var(--text-secondary);
  min-width: 70px; text-align: right;
}

/* ========== 开关 ========== */
.toggle-switch {
  width: 40px; height: 22px;
  background: var(--border);
  border-radius: 11px; cursor: pointer;
  position: relative; transition: background 0.2s;
  flex-shrink: 0;
}

.toggle-switch.on { background: var(--accent); }

.toggle-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.toggle-switch::after {
  content: '';
  position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px;
  background: #fff; border-radius: 50%;
  transition: transform 0.2s;
}

.toggle-switch.on::after { transform: translateX(18px); }

/* ========== 汇总行 ========== */
tr.summary-row td {
  font-weight: 700; color: var(--accent);
  background: var(--accent-bg);
  border-top: 1px solid var(--accent);
}

/* ========== 滚动条 ========== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ========== 空状态 ========== */
.empty-state {
  text-align: center; padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state .empty-text { font-size: 14px; }

/* ========== 加载骨架 ========== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-input) 25%, var(--bg-hover) 50%, var(--bg-input) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ========== Toast 提示 ========== */
.toast {
  position: fixed; top: 80px; left: 50%; transform: translateX(-50%);
  background: var(--bg-card); color: var(--text-primary);
  padding: 10px 24px; border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  z-index: 2000; font-size: 13px;
  opacity: 0; transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(4px); }

/* 三级商务专属色 */
.badge-l3 { background: var(--success-bg); color: var(--success); }

/* ========== 排行榜维度切换 ========== */
.ranking-tabs {
  display: flex; gap: 0; margin-bottom: 16px;
  border-bottom: 2px solid var(--border);
}

.ranking-tab {
  padding: 10px 28px;
  background: transparent; color: var(--text-secondary);
  border: none; border-bottom: 2px solid transparent;
  cursor: pointer; font-size: 14px; font-weight: 500;
  font-family: inherit; margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}

.ranking-tab:hover { color: var(--text-primary); }
.ranking-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.ranking-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.ranking-panel { display: none; }
.ranking-panel.active { display: block; }

.ranking-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

/* 排行榜日期范围 */
.date-range {
  color: var(--text-muted);
  font-size: 12px;
  margin-left: 12px;
  white-space: nowrap;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
  .sidebar { width: 180px; }
  .main-content { margin-left: 180px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .proto-panel { width: 100vw; max-width: 100vw; }
}

/* ========== 内联 SVG 图标 ========== */
.nav-icon { display: inline-flex; align-items: center; justify-content: center; }
.nav-icon svg { width: 18px; height: 18px; display: block; }

/* ========== 真实图表（内联 SVG） ========== */
.chart { width: 100%; display: block; height: auto; }
.chart text { fill: var(--text-muted); font-size: 11px; }
.chart .grid-line { stroke: var(--border-light); stroke-width: 1; }
.chart .axis-line { stroke: var(--border); stroke-width: 1; }
.chart .area-fill { fill: var(--accent-bg); }
.chart polyline.line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart polyline.line-2 { stroke: var(--warning); }
.chart .dot { fill: var(--accent); transition: r .12s; }
.chart .dot-2 { fill: var(--warning); }
.chart .dot:hover { r: 5; }
.chart .bar { fill: var(--accent); transition: fill .15s, opacity .15s; }
.chart .bar:hover { fill: var(--accent-hover); }
.chart .bar-2 { fill: var(--warning); }
.chart .bar-2:hover { fill: #fcd34d; }
.chart-legend { display: flex; gap: 18px; font-size: 12px; color: var(--text-secondary); margin-top: 10px; flex-wrap: wrap; }
.chart-legend .lg { display: flex; align-items: center; gap: 6px; }
.chart-legend .swatch { width: 10px; height: 10px; border-radius: 3px; }
.chart-legend .swatch.line { height: 3px; border-radius: 2px; width: 14px; }
.chart-tip { fill: var(--text-primary); font-size: 11px; font-weight: 600; }

/* ========== 时间快捷选择 ========== */
.time-chip {
  display: inline-flex; align-items: center;
  padding: 1px 12px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--bg-input);
  color: var(--text-muted); font-size: 12px; cursor: pointer;
  white-space: nowrap; transition: all 0.2s;
}
.time-chip:hover { border-color: var(--accent); color: var(--accent); }
.time-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ========== 日期选择组件：快捷时间+日期输入 ========== */
.date-picker-group {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg-input);
}
.date-picker-group input {
  background: var(--bg-card); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 6px 10px; font-size: 12px; height: 32px;
  box-sizing: border-box; outline: none;
  transition: border-color 0.2s;
}
.date-picker-group input:hover,
.date-picker-group input:focus {
  border-color: var(--accent);
}

/* 可清空的日期输入 */
.dp-clearable { position: relative; display: inline-flex; align-items: center; }
.dp-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; display: none; align-items: center; justify-content: center;
  background: var(--text-muted); color: var(--bg-card);
  border-radius: 50%; font-size: 14px; line-height: 1; cursor: pointer;
  transition: background 0.2s;
}
.dp-clearable:hover .dp-clear { display: flex; background: var(--accent); }
.dp-clearable input { padding-right: 28px; }

/* 自定义日期选择器 */
.dp-shortcuts div:hover { background: var(--bg-input); color: var(--accent); }

