/* 管理后台 —— 电脑端优先，兼容手机 */
:root {
  --primary: #1463d7; --sidebar: #102a43; --sidebar-active: #1a3f64;
  --bg: #f3f6fa; --card: #fff; --text: #172b4d; --text-sub: #6b7c93;
  --line: #e8ecf2; --danger: #e64340; --ok: #2fa75f; --warn: #e6a23c;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height:1.45; }
#app { min-height: 100vh; }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background:radial-gradient(circle at 80% 12%,#287eea 0,transparent 27%), linear-gradient(135deg, #102a43, #173f67); }
.login-box { background: rgba(255,255,255,.98); border-radius: 18px; padding: 38px 34px; width: 360px; box-shadow: 0 24px 60px rgba(0,0,0,.28); }
.login-box h1 { font-size: 19px; text-align: center; margin-bottom: 6px; }
.login-box .tip { text-align: center; color: var(--text-sub); font-size: 12.5px; margin-bottom: 22px; }
.login-box input { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; font-size: 14px; margin-bottom: 12px; outline: none; }
.login-box input:focus { border-color: var(--primary); }
.login-box button { width: 100%; border: 0; border-radius: 8px; background: var(--primary); color: #fff; font-size: 15px; font-weight: 700; padding: 11px; cursor: pointer; }
.login-err { color: var(--danger); font-size: 12.5px; margin-bottom: 10px; display: none; }

/* 布局 */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: linear-gradient(180deg,var(--sidebar),#0d2138); color: #cbd5e1; flex-shrink: 0; display: flex; flex-direction: column; }
.sidebar .logo { color: #fff; font-size: 17px; font-weight: 750; padding: 24px 22px 18px; letter-spacing:.3px; }
.sidebar .logo small { display: block; font-size: 11px; color: #64748b; font-weight: 400; margin-top: 3px; }
.menu-item { padding: 12px 22px; cursor: pointer; font-size: 14px; display: block; text-decoration: none; color: #cbd5e1; margin:1px 9px; border-radius:8px; transition:all .16s ease; }
.menu-item:hover { background: var(--sidebar-active); }
.menu-item.active { background: linear-gradient(135deg,var(--primary),#287eea); color: #fff; box-shadow:0 5px 12px rgba(20,99,215,.25); }
.sidebar .spacer { flex: 1; }
.menu-logout { padding: 14px 20px; font-size: 13px; color: #94a3b8; cursor: pointer; }
.main { flex: 1; padding: 28px 32px; min-width: 0; max-width:1600px; }
.page-title { font-size: 21px; font-weight: 750; margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; letter-spacing:.2px; }

/* 卡片/表格 */
.card { background: var(--card); border-radius: 15px; padding: 20px; box-shadow: 0 4px 18px rgba(28,36,48,.055); margin-bottom: 18px; border:1px solid rgba(16,42,67,.035); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 15px; margin-bottom: 20px; }
.stat-card { background: linear-gradient(145deg,#fff,#f7faff); border-radius: 14px; padding: 18px; box-shadow: 0 4px 18px rgba(28,36,48,.045); border:1px solid #e7eef7; }
.stat-card .v { font-size: 28px; font-weight: 800; color: var(--primary); }
.stat-card .l { font-size: 12.5px; color: var(--text-sub); margin-top: 4px; }
.stat-card.hl .v { color: var(--warn); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 11px; border-bottom: 1px solid var(--line); font-size: 13.5px; white-space: nowrap; }
th { color: var(--text-sub); font-weight: 650; font-size: 12px; background: #f7f9fc; letter-spacing:.15px; }
tr:hover td { background: #f7faff; }
td .price { color: var(--danger); font-weight: 700; }
.table-scroll { overflow-x: auto; }

/* 状态标签 */
.tag { display: inline-block; padding: 3px 10px; border-radius: 11px; font-size: 12px; }
.tag.待确认 { background: #fff4e0; color: #e6a23c; }
.tag.已确认 { background: #e6f3ff; color: #1a6df0; }
.tag.备货中 { background: #f0e8ff; color: #7c5cd6; }
.tag.已完成 { background: #e8f7ee; color: #2fa75f; }
.tag.已取消 { background: #f1f3f5; color: #98a2b3; }
.tag.在售 { background: #e8f7ee; color: #2fa75f; }
.tag.停售 { background: #f1f3f5; color: #98a2b3; }
.tag.已发布 { background: #e8f7ee; color: #2fa75f; }
.tag.待处理 { background: #fff4e0; color: #e6a23c; }

/* 控件 */
.btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px 14px; font-size: 13px; cursor: pointer; color: var(--text); transition:all .16s ease; }
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn.primary { background: linear-gradient(135deg,var(--primary),#287eea); color: #fff; border-color: var(--primary); font-weight: 650; box-shadow:0 4px 10px rgba(20,99,215,.15); }
.btn.primary:hover { background: #0f56c9; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); background: #fff5f5; }
.btn.sm { padding: 4px 10px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
input.inp, select.inp, textarea.inp { border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; font-size: 13.5px; outline: none; background:#fbfcfe; }
input.inp:focus, select.inp:focus, textarea.inp:focus { border-color: var(--primary); box-shadow:0 0 0 3px rgba(20,99,215,.10); background:#fff; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .grow { flex: 1; }
.link { color: var(--primary); cursor: pointer; text-decoration: none; }
.link.danger { color: var(--danger); }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: #fff; border-radius: 17px; width: 480px; max-width: 94vw; max-height: 88vh; overflow-y: auto; padding: 24px; box-shadow:0 22px 60px rgba(15,23,42,.24); }
.modal h3 { font-size: 16px; margin-bottom: 16px; }
.modal .field { margin-bottom: 13px; }
.modal label { display: block; font-size: 12.5px; color: var(--text-sub); margin-bottom: 5px; }
.modal .field input, .modal .field select, .modal .field textarea { width: 100%; }
.modal .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* 批量操作条 */
.batch-bar { background: #eef4ff; border: 1px solid #d4e3ff; border-radius: 9px; padding: 10px 14px; margin-bottom: 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }

/* 上传区 */
.upload-box { border: 2px dashed #c3d4f0; border-radius: 12px; padding: 40px 20px; text-align: center; color: var(--text-sub); cursor: pointer; }
.upload-box:hover { border-color: var(--primary); background: #f6faff; }

/* 步骤 */
.steps { display: flex; gap: 0; margin-bottom: 18px; }
.step { flex: 1; text-align: center; font-size: 12.5px; color: var(--text-sub); position: relative; padding-top: 22px; }
.step::before { content: ''; position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 16px; height: 16px; border-radius: 50%; background: #e2e8f0; }
.step.active { color: var(--primary); font-weight: 700; }
.step.active::before { background: var(--primary); box-shadow: 0 0 0 3px #dbe8ff; }
.step.done::before { background: var(--ok); }

/* 预览差价 */
.diff-plus { color: var(--ok); font-weight: 600; }
.source-price { color: var(--text-sub); text-decoration: none; }

/* toast & loading */
#toast { position: fixed; top: 24px; left: 50%; transform: translateX(-50%); background: rgba(15,23,42,.85); color: #fff; padding: 9px 20px; border-radius: 8px; font-size: 13.5px; z-index: 999; display: none; }
.loading { text-align: center; color: var(--text-sub); padding: 40px; }

/* 手机端适配 */
@media (max-width: 760px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; overflow-x: auto; align-items: center; }
  .sidebar .logo { padding: 12px 14px; white-space: nowrap; }
  .menu-item { padding: 12px 13px; white-space: nowrap; }
  .sidebar .spacer { display: none; }
  .main { padding: 16px 14px; }
  .sidebar { box-shadow:0 2px 10px rgba(16,42,67,.18); }
  .menu-item { margin:4px 2px; padding:9px 11px; }
  .page-title { font-size:19px; }
}
