:root {
  --brand: #1677FF;
  --brand-hover: #4096FF;
  --brand-active: #0958D9;
  --brand-dark: #001529;
  --brand-light: #E6F4FF;
  --accent: #1677FF;
  --accent-soft: #E6F4FF;
  --ink: rgba(0, 0, 0, 0.88);
  --ink-secondary: rgba(0, 0, 0, 0.65);
  --ink-muted: rgba(0, 0, 0, 0.45);
  --line: #F0F0F0;
  --line-strong: #D9D9D9;
  --surface: #ffffff;
  --bg: #F0F2F5;
  --bg-warm: #F0F2F5;
  --danger: #FF4D4F;
  --warning: #FAAD14;
  --success: #52C41A;
  --info: #1677FF;
  --sidebar-bg: #001529;
  --sidebar-hover: rgba(255, 255, 255, 0.08);
  --sidebar-active: #1677FF;
  --radius-sm: 4px;
  --radius: 8px;
  --shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03), 0 1px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px 0 rgba(0, 0, 0, 0.02);
  --shadow-modal: 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-display: var(--font);
}

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

html { font-size: 14px; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
table { border-collapse: collapse; width: 100%; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* —— 原型导航条（演示工具，不抢产品层级） —— */
.proto-bar {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 16px;
  height: 36px;
  background: #000C17;
  color: #fff;
  font-size: 12px;
  flex-wrap: nowrap;
  overflow-x: auto;
}
.proto-bar .logo {
  font-weight: 600;
  margin-right: 8px;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0;
}
.proto-bar a {
  color: rgba(255, 255, 255, 0.55);
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.proto-bar a:hover,
.proto-bar a.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.proto-bar .divider {
  width: 1px;
  height: 12px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 6px;
}

/* —— 按钮 —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 400;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 0 rgba(5, 145, 255, 0.1);
}
.btn-primary:hover { background: var(--brand-hover); color: #fff; }
.btn-primary:active { background: var(--brand-active); color: #fff; }
.btn-secondary {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn-secondary:hover { color: var(--brand); border-color: var(--brand); }
.btn-accent {
  background: var(--surface);
  border-color: var(--brand);
  color: var(--brand);
}
.btn-accent:hover { color: var(--brand-hover); border-color: var(--brand-hover); }
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover { background: #ff7875; color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--brand);
  border-color: var(--brand);
}
.btn-ghost:hover { color: var(--brand-hover); border-color: var(--brand-hover); background: var(--brand-light); }
.btn-sm { height: 24px; padding: 0 7px; font-size: 14px; }
.btn-lg { height: 40px; padding: 0 15px; font-size: 16px; }
.btn-block { width: 100%; }

/* —— 标签 / 状态 —— */
.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1;
  border: 1px solid transparent;
}
.tag-green { background: #F6FFED; color: #389E0D; border-color: #B7EB8F; }
.tag-gold { background: #FFFBE6; color: #D48806; border-color: #FFE58F; }
.tag-blue { background: #E6F4FF; color: #0958D9; border-color: #91CAFF; }
.tag-orange { background: #FFF7E6; color: #D46B08; border-color: #FFD591; }
.tag-red { background: #FFF2F0; color: #CF1322; border-color: #FFA39E; }
.tag-gray { background: #FAFAFA; color: rgba(0, 0, 0, 0.45); border-color: #D9D9D9; }

/* —— 表单 —— */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 400;
  color: var(--ink);
}
.form-label .req { color: var(--danger); margin-left: 2px; }
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: all 0.2s;
}
.form-input::placeholder { color: rgba(0, 0, 0, 0.25); }
.form-input:hover,
.form-select:hover,
.form-textarea:hover { border-color: var(--brand-hover); }
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(5, 145, 255, 0.1);
}
.form-textarea { height: auto; min-height: 80px; padding: 8px 10px; resize: vertical; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-hint { font-size: 12px; color: var(--ink-muted); margin-top: 4px; }

.upload-box {
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  color: var(--ink-muted);
  background: var(--bg);
  cursor: pointer;
  font-size: 13px;
}
.upload-box:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }
.upload-box .icon { font-size: 18px; margin-bottom: 6px; color: var(--ink-muted); }

/* —— 卡片 / 列表面板 —— */
.card {
  background: var(--surface);
  border: none;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card + .card { margin-top: 16px; }
.card .data-table th:first-child,
.card .data-table td:first-child { padding-left: 24px; }
.card .data-table th:last-child,
.card .data-table td:last-child { padding-right: 24px; }

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}
.page-header .page-title { margin-bottom: 4px; }
.page-header .page-sub { margin-bottom: 0; }

.list-panel {
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
}
.list-panel .filter-bar {
  margin: 0 0 16px;
  border: none;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.list-panel .tabs {
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: var(--shadow);
}
.list-panel .tab-panel .filter-bar {
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  border-bottom: 1px solid var(--line);
}
.list-panel .pagination {
  margin: 0;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow);
}

.table-wrap {
  overflow: auto;
  max-height: calc(100vh - 280px);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.list-panel .table-wrap:has(+ .pagination) {
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: var(--shadow);
}
.list-panel:has(.tabs) {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.list-panel:has(.tabs) .tabs,
.list-panel:has(.tabs) .tab-panel .filter-bar,
.list-panel:has(.tabs) .table-wrap {
  box-shadow: none;
  border-radius: 0;
  margin-bottom: 0;
}

/* —— 表格 —— */
.data-table th,
.data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  vertical-align: middle;
}
.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #FAFAFA;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  font-size: 14px;
}
.data-table td { color: var(--ink); background: #fff; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #E6F4FF; }
.data-table .actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.data-table .link-btn {
  background: none;
  border: none;
  color: var(--brand);
  font-size: 14px;
  padding: 0;
  font-weight: 400;
}
.data-table .link-btn:hover { color: var(--brand-hover); }
.data-table .link-btn.danger { color: var(--danger); }
.data-table .actions .btn { height: 24px; }

/* —— 分页 —— */
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  font-size: 14px;
  color: var(--ink-secondary);
}
.pagination button {
  min-width: 32px;
  height: 32px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 14px;
}
.pagination button:hover { color: var(--brand); border-color: var(--brand); }
.pagination button.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* —— 弹窗 —— */
.modal-mask {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-mask.show { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-modal);
}
.modal-lg { max-width: 720px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close {
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  font-size: 16px;
  color: var(--ink-muted);
  border-radius: 4px;
  line-height: 1;
}
.modal-close:hover { background: var(--bg); color: var(--ink); }
.modal-body { padding: 24px; overflow: auto; flex: 1; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
  background: #FAFAFA;
  border-radius: 0 0 var(--radius) var(--radius);
}

/* —— 空状态 / Toast / 加载 —— */
.empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--ink-muted);
  font-size: 13px;
}
.empty::before {
  content: "";
  display: block;
  width: 40px;
  height: 40px;
  margin: 0 auto 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--bg);
}
.toast {
  position: fixed;
  top: 48px;
  left: 50%;
  transform: translateX(-50%) translateY(-12px);
  background: var(--ink);
  color: #fff;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s;
  z-index: 3000;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* —— Tabs —— */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
  background: var(--surface);
  padding: 0 8px;
}
.tab {
  padding: 12px 0;
  margin: 0 16px;
  font-size: 14px;
  font-weight: 400;
  color: var(--ink);
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--brand); }
.tab.active {
  color: var(--brand);
  font-weight: 500;
  border-bottom-color: var(--brand);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* —— 步骤条 —— */
.steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 0;
  overflow-x: auto;
}
.step {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.step-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--ink-muted);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
}
.step.done .step-dot,
.step.active .step-dot {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.step-label { font-size: 12px; color: var(--ink-muted); }
.step.active .step-label { color: var(--ink); font-weight: 500; }
.step.done .step-label { color: var(--ink-secondary); }
.step-line {
  width: 24px;
  height: 1px;
  background: var(--line);
  margin: 0 8px;
  flex-shrink: 0;
}
.step.done + .step-line { background: var(--brand); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.stat-card {
  background: var(--surface);
  border: none;
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
}
.stat-card:nth-child(1),
.stat-card:nth-child(2),
.stat-card:nth-child(3),
.stat-card:nth-child(4) { border-left-color: transparent; }
.stat-card .label { font-size: 14px; color: var(--ink-muted); }
.stat-card .value {
  font-size: 30px;
  font-weight: 600;
  margin-top: 8px;
  line-height: 1.2;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.stat-card .value.green { color: var(--success); }
.stat-card .value.gold { color: var(--warning); }

.desc-list {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 8px 16px;
  font-size: 13px;
}
.desc-list dt { color: var(--ink-muted); font-weight: 400; }
.desc-list dd { color: var(--ink); font-weight: 400; }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 16px;
  align-items: flex-end;
  margin-bottom: 16px;
  padding: 24px 24px 16px;
  background: var(--surface);
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.filter-bar .form-group {
  margin-bottom: 8px;
  min-width: 200px;
  flex: 1 1 200px;
  max-width: 280px;
}
.filter-bar .form-input,
.filter-bar .form-select { height: 32px; }
.filter-bar .btn { flex-shrink: 0; margin-bottom: 8px; height: 32px; }

.page-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: 0;
  color: var(--ink);
  line-height: 1.4;
}
.page-sub {
  font-size: 14px;
  color: var(--ink-muted);
  margin-bottom: 16px;
  font-weight: 400;
}

.badge-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--danger);
  margin-left: 4px;
  vertical-align: middle;
}

.switch {
  position: relative;
  width: 36px;
  height: 20px;
  display: inline-block;
  vertical-align: middle;
}
.switch input { display: none; }
.switch .slider {
  position: absolute;
  inset: 0;
  background: #D0D3D8;
  border-radius: 20px;
  cursor: pointer;
  transition: 0.15s;
}
.switch .slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: 0.15s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.switch input:checked + .slider { background: var(--brand); }
.switch input:checked + .slider::before { transform: translateX(16px); }

.voucher-thumb,
.img-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 12px;
  color: var(--brand);
  cursor: pointer;
  text-align: center;
  line-height: 1.3;
  padding: 4px;
}
.voucher-thumb:hover,
.img-thumb:hover { background: var(--brand-light); }

.voucher-area {
  min-height: 80px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  padding: 14px;
  color: var(--ink-secondary);
  font-size: 13px;
}
.voucher-area:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }
.voucher-area .hint { font-size: 12px; color: var(--ink-muted); }

.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.name-link {
  background: none;
  border: none;
  color: var(--brand);
  font-size: 14px;
  font-weight: 400;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}
.name-link:hover { color: var(--brand-hover); }

.section-block {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.section-block h4 {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--ink-secondary);
}
