/* 电商ERP管理后台 —— 商业级视觉规范
 *
 * 设计原则:
 *   1. 单一强调色 + 中性灰阶,信息密度高但不刺眼,适合长时间操作;
 *   2. 8px 栅格,所有间距为 4 的倍数,保证纵向节奏一致;
 *   3. 语义化状态色(成功/警告/危险/信息),在表格、标签、通知中复用同一套。
 */

:root {
  /* 品牌与强调色 */
  --brand-50: #eef4ff;
  --brand-100: #dbe6ff;
  --brand-200: #bcd0ff;
  --brand-500: #2f6bff;
  --brand-600: #1f57e8;
  --brand-700: #1846bd;

  /* 中性色阶 */
  --gray-25: #fcfcfd;
  --gray-50: #f7f8fa;
  --gray-100: #eef0f4;
  --gray-200: #e2e5ec;
  --gray-300: #cdd2dc;
  --gray-400: #9aa3b2;
  --gray-500: #6b7488;
  --gray-600: #4d5566;
  --gray-700: #363d4d;
  --gray-800: #232936;
  --gray-900: #141821;

  /* 语义色 */
  --success: #12a150;
  --success-bg: #e7f7ee;
  --warning: #c2790a;
  --warning-bg: #fdf3e2;
  --danger: #d92d20;
  --danger-bg: #fdecea;
  --info: #0a7ea4;
  --info-bg: #e5f4f9;

  /* 版式 */
  --font: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Helvetica Neue",
    Helvetica, Arial, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", "JetBrains Mono", Consolas, "Liberation Mono", monospace;

  /* 布局 */
  --sidebar-w: 232px;
  --header-h: 56px;
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow: 0 4px 12px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.14);

  --bg: var(--gray-50);
  --surface: #ffffff;
  --border: var(--gray-200);
  --text: var(--gray-800);
  --text-muted: var(--gray-500);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }
::-webkit-scrollbar-track { background: transparent; }

/* ================= 登录页 ================= */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  background: var(--surface);
}

.login-hero {
  position: relative;
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  background:
    radial-gradient(1200px 600px at 10% 10%, rgba(255, 255, 255, 0.16), transparent 60%),
    linear-gradient(135deg, #1a3fb0 0%, #2f6bff 45%, #4b8bff 100%);
  overflow: hidden;
}

.login-hero::after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -140px;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.login-hero h1 { font-size: 30px; margin: 0 0 12px; letter-spacing: 0.5px; }
.login-hero p { margin: 0; opacity: 0.88; max-width: 460px; line-height: 1.8; }
.login-hero .brand-mark {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 16px; font-weight: 600; letter-spacing: 1px;
}
.login-hero .brand-mark .dot {
  width: 28px; height: 28px; border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--brand-600);
  display: grid; place-items: center; font-weight: 800;
}
.login-features { display: grid; gap: 14px; position: relative; z-index: 1; }
.login-features div { display: flex; gap: 10px; align-items: flex-start; opacity: 0.94; }
.login-features svg { flex: 0 0 auto; margin-top: 3px; }

.login-panel { display: grid; place-items: center; padding: 40px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { margin: 0 0 6px; font-size: 22px; }
.login-card .sub { color: var(--text-muted); margin: 0 0 28px; }
.login-tip {
  margin-top: 20px; padding: 10px 12px;
  background: var(--brand-50); border: 1px solid var(--brand-100);
  border-radius: var(--radius-sm); color: var(--brand-700); font-size: 12px;
}

@media (max-width: 900px) {
  .login-page { grid-template-columns: 1fr; }
  .login-hero { display: none; }
}

/* ================= 应用骨架 ================= */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--gray-900);
  color: var(--gray-300);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  transition: width 0.18s ease;
}

.sidebar-brand {
  height: var(--header-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 18px;
  color: #fff; font-weight: 600; font-size: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  white-space: nowrap; overflow: hidden;
}
.sidebar-brand .logo {
  width: 26px; height: 26px; flex: 0 0 26px; border-radius: 7px;
  background: linear-gradient(135deg, var(--brand-500), #64a0ff);
  display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 13px;
}

.nav { flex: 1; overflow-y: auto; padding: 10px 10px 24px; }
.nav-group { margin-top: 14px; }
.nav-group:first-child { margin-top: 4px; }
.nav-group-title {
  font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--gray-500); padding: 6px 10px; white-space: nowrap;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  color: var(--gray-300); cursor: pointer; white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav-item.active { background: var(--brand-600); color: #fff; font-weight: 500; }
.nav-item .icon { flex: 0 0 18px; display: grid; place-items: center; opacity: 0.9; }
.nav-item .badge-dot {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--danger); color: #fff;
  font-size: 11px; display: grid; place-items: center;
}

.sidebar.collapsed { width: 64px; flex-basis: 64px; }
.sidebar.collapsed .nav-group-title,
.sidebar.collapsed .nav-item span.label,
.sidebar.collapsed .sidebar-brand .name { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; }

.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex; flex-direction: column;
  min-width: 0;
  transition: margin-left 0.18s ease;
}
.main.wide { margin-left: 64px; }

.header {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
  padding: 0 20px;
  position: sticky; top: 0; z-index: 20;
}
.header .page-title { font-size: 16px; font-weight: 600; }
.header .spacer { flex: 1; }
.icon-btn {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: transparent;
  display: grid; place-items: center; cursor: pointer; color: var(--gray-600);
  position: relative;
}
.icon-btn:hover { background: var(--gray-100); color: var(--gray-800); }
.icon-btn .dot-badge {
  position: absolute; top: 5px; right: 5px;
  min-width: 15px; height: 15px; padding: 0 4px; border-radius: 8px;
  background: var(--danger); color: #fff; font-size: 10px;
  display: grid; place-items: center;
}

.user-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 10px 5px 5px; border-radius: 999px;
  cursor: pointer; border: 1px solid var(--border); background: var(--surface);
}
.user-chip:hover { background: var(--gray-50); }
.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-500), #6ba4ff);
  color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 600;
}
.user-chip .role { color: var(--text-muted); font-size: 12px; }

.content { padding: 20px; flex: 1; min-width: 0; }

/* ================= 通用组件 ================= */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 16px; }
.card-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.card-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.card-head .spacer { flex: 1; }
.card-body { padding: 16px; }
.card-body.tight { padding: 0; }

.toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.toolbar .grow { flex: 1; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.field .required { color: var(--danger); margin-left: 2px; }
.field .hint { font-size: 12px; color: var(--text-muted); }

input[type="text"], input[type="password"], input[type="number"],
input[type="date"], input[type="search"], select, textarea {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
textarea { height: auto; padding: 8px 10px; line-height: 1.6; resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px var(--brand-50);
}
input:disabled, select:disabled, textarea:disabled {
  background: var(--gray-50); color: var(--gray-400); cursor: not-allowed;
}
input::placeholder, textarea::placeholder { color: var(--gray-400); }
select { appearance: none; padding-right: 28px;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7488' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
}

.btn {
  height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-300);
  background: var(--surface);
  color: var(--gray-700);
  font-size: 13px; font-family: inherit; font-weight: 500;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s, color 0.12s, box-shadow 0.12s;
}
.btn:hover { background: var(--gray-50); border-color: var(--gray-400); }
.btn:active { background: var(--gray-100); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary {
  background: var(--brand-600); border-color: var(--brand-600); color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b42318; border-color: #b42318; color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--gray-100); border-color: transparent; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-lg { height: 40px; font-size: 14px; }

.btn-link {
  border: none; background: none; padding: 0; height: auto;
  color: var(--brand-600); cursor: pointer; font-size: 13px; font-family: inherit;
}
.btn-link:hover { color: var(--brand-700); text-decoration: underline; background: none; }
.btn-link.danger { color: var(--danger); }

/* ---------- 表格 ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
table.data th {
  text-align: left;
  padding: 10px 12px;
  background: var(--gray-50);
  color: var(--gray-600);
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 1;
}
table.data td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
table.data tbody tr:hover td { background: var(--gray-25); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td.mono { font-family: var(--mono); font-size: 12px; }
table.data .actions { display: flex; gap: 10px; white-space: nowrap; }
.table-empty { padding: 48px 16px; text-align: center; color: var(--text-muted); }
.table-empty .big { font-size: 15px; color: var(--gray-600); margin-bottom: 4px; }

.pagination {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.pagination .total { color: var(--text-muted); font-size: 13px; }
.pagination .spacer { flex: 1; }
.pagination .pages { display: flex; gap: 4px; }
.page-btn {
  min-width: 30px; height: 30px; padding: 0 8px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer; font-size: 13px; color: var(--gray-700);
}
.page-btn:hover:not(:disabled) { border-color: var(--brand-500); color: var(--brand-600); }
.page-btn.active { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.page-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- 标签 ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px; border-radius: 11px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
  background: var(--gray-100); color: var(--gray-600);
}
.tag.success { background: var(--success-bg); color: var(--success); }
.tag.warning { background: var(--warning-bg); color: var(--warning); }
.tag.danger { background: var(--danger-bg); color: var(--danger); }
.tag.info { background: var(--info-bg); color: var(--info); }
.tag.brand { background: var(--brand-50); color: var(--brand-600); }
.tag .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- 指标卡 ---------- */
.stat-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.stat .label { color: var(--text-muted); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.stat .value {
  font-size: 26px; font-weight: 650; margin-top: 8px;
  font-variant-numeric: tabular-nums; letter-spacing: -0.5px;
}
.stat .foot { margin-top: 6px; font-size: 12px; color: var(--text-muted); }
.stat .foot .up { color: var(--success); font-weight: 600; }
.stat .foot .down { color: var(--danger); font-weight: 600; }
.stat .glyph {
  position: absolute; right: 14px; top: 14px;
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--brand-50); color: var(--brand-600);
}

.todo-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.todo {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface); cursor: pointer;
}
.todo:hover { border-color: var(--brand-500); box-shadow: var(--shadow-sm); }
.todo .n { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
.todo .t { color: var(--text-muted); font-size: 13px; }
.todo.alert .n { color: var(--danger); }

/* ---------- 图表 ---------- */
.chart { width: 100%; height: 260px; }
.chart-legend { display: flex; gap: 16px; font-size: 12px; color: var(--text-muted); }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 5px; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(16, 24, 40, 0.45);
  display: grid; place-items: center; padding: 24px;
  animation: fade 0.15s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px; max-height: 86vh;
  display: flex; flex-direction: column;
  animation: pop 0.16s ease;
}
@keyframes pop { from { transform: translateY(8px) scale(0.99); opacity: 0; } to { transform: none; opacity: 1; } }
.modal.lg { max-width: 900px; }
.modal.xl { max-width: 1140px; }
.modal-head {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.modal-head .spacer { flex: 1; }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-foot {
  padding: 14px 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}

.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.form-grid.one { grid-template-columns: 1fr; }
.section-title {
  grid-column: 1 / -1; font-weight: 600; font-size: 13px; color: var(--gray-700);
  padding-top: 6px; border-top: 1px dashed var(--border); margin-top: 4px;
}
.section-title:first-child { border-top: none; padding-top: 0; margin-top: 0; }

/* ---------- 描述列表 ---------- */
.desc { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px 20px; }
.desc .item { display: flex; gap: 8px; font-size: 13px; min-width: 0; }
.desc .item .k { color: var(--text-muted); flex: 0 0 92px; }
.desc .item .v { color: var(--text); word-break: break-all; }

/* ---------- 通知 ---------- */
.toasts {
  position: fixed; top: 16px; right: 16px; z-index: 200;
  display: flex; flex-direction: column; gap: 10px; max-width: 380px;
}
.toast {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--brand-500);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start;
  animation: slide 0.18s ease;
}
@keyframes slide { from { transform: translateX(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast .msg { flex: 1; font-size: 13px; word-break: break-word; }
.toast .close { cursor: pointer; color: var(--gray-400); }

/* ---------- 加载 ---------- */
.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--brand-100); border-top-color: var(--brand-600);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-mask {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(255, 255, 255, 0.5);
  display: grid; place-items: center;
}
.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-50) 37%, var(--gray-100) 63%);
  background-size: 400% 100%; animation: shimmer 1.2s infinite;
  border-radius: 4px; height: 14px;
}
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- 客服会话 ---------- */
.chat { display: grid; grid-template-columns: 280px 1fr; height: calc(100vh - var(--header-h) - 40px); }
.chat-list { border-right: 1px solid var(--border); overflow-y: auto; }
.chat-item { padding: 12px 14px; border-bottom: 1px solid var(--gray-100); cursor: pointer; }
.chat-item:hover { background: var(--gray-25); }
.chat-item.active { background: var(--brand-50); box-shadow: inset 3px 0 0 var(--brand-600); }
.chat-item .row1 { display: flex; align-items: center; gap: 8px; }
.chat-item .name { font-weight: 600; font-size: 13px; flex: 1; }
.chat-item .time { font-size: 11px; color: var(--text-muted); }
.chat-item .last {
  font-size: 12px; color: var(--text-muted); margin-top: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-main { display: flex; flex-direction: column; min-width: 0; }
.chat-head { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.chat-body { flex: 1; overflow-y: auto; padding: 16px; background: var(--gray-25); }
.msg-row { display: flex; margin-bottom: 14px; gap: 8px; }
.msg-row.mine { flex-direction: row-reverse; }
.msg-bubble {
  max-width: 62%; padding: 9px 12px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 13px; line-height: 1.6; word-break: break-word; white-space: pre-wrap;
}
.msg-row.mine .msg-bubble { background: var(--brand-600); color: #fff; border-color: var(--brand-600); }
.msg-row.system { justify-content: center; }
.msg-row.system .msg-bubble {
  background: var(--gray-100); color: var(--text-muted); font-size: 12px;
  border: none; max-width: 80%; text-align: center;
}
.msg-meta { font-size: 11px; color: var(--text-muted); margin-bottom: 3px; }
.chat-input { border-top: 1px solid var(--border); padding: 12px 16px; display: flex; gap: 10px; }
.chat-input textarea { flex: 1; height: 60px; }

/* ---------- 导入结果 ---------- */
.import-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.import-summary .box {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px; text-align: center;
}
.import-summary .box .n { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
.import-summary .box .t { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.import-summary .box.ok .n { color: var(--success); }
.import-summary .box.bad .n { color: var(--danger); }
.err-list { max-height: 320px; overflow-y: auto; margin-top: 14px; }
.err-list .err {
  padding: 8px 10px; border-left: 3px solid var(--danger);
  background: var(--danger-bg); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 8px; font-size: 12px;
}
.err-list .err .loc { font-weight: 600; color: var(--danger); }

.dropzone {
  border: 2px dashed var(--gray-300); border-radius: var(--radius);
  padding: 32px; text-align: center; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--brand-500); background: var(--brand-50); }
.dropzone .big { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.dropzone .sub { color: var(--text-muted); font-size: 13px; }
.dropzone .file { margin-top: 10px; color: var(--brand-600); font-weight: 600; }

/* ---------- 其他 ---------- */
.checkbox { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: 13px; user-select: none; }
.checkbox input { width: 15px; height: 15px; accent-color: var(--brand-600); cursor: pointer; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.muted { color: var(--text-muted); }
.mono { font-family: var(--mono); font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-wrap { flex-wrap: wrap; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.money { font-variant-numeric: tabular-nums; font-weight: 600; }
.money::before { content: "¥"; font-size: 0.85em; opacity: 0.7; margin-right: 1px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); padding: 0 16px; }
.tab {
  padding: 10px 14px; cursor: pointer; font-size: 13px; color: var(--text-muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500;
}
.tab:hover { color: var(--gray-800); }
.tab.active { color: var(--brand-600); border-bottom-color: var(--brand-600); }

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .content { padding: 12px; }
  .chat { grid-template-columns: 1fr; }
}

@media print {
  .sidebar, .header, .toolbar, .pagination { display: none !important; }
  .main { margin-left: 0; }
}
