:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --line: #e6e8ec;
  --line-soft: #eef0f3;
  --text: #14181f;
  --text-2: #4a5261;
  --muted: #7a8291;
  --primary: #1668dc;
  --primary-dark: #0f4fb0;
  --primary-soft: #eaf2fe;
  --navy: #101827;
  --green: #12996b;
  --green-soft: #e6f6ef;
  --amber: #b7791f;
  --amber-soft: #fdf3e3;
  --red: #d64545;
  --red-soft: #fdecec;
  --purple: #6f5bd4;
  --purple-soft: #efeaff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 39, .04), 0 8px 24px rgba(16, 24, 39, .06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

/* ---------- 布局 ---------- */
.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 720px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.spacer { flex: 1; }

@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ---------- 顶栏 ---------- */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar-inner { display: flex; align-items: center; height: 60px; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15.5px; color: var(--text); }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px; background: var(--navy);
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600;
}
.navlinks { display: flex; gap: 22px; }
.navlinks a { color: var(--text-2); font-size: 14px; }
.navlinks a:hover { color: var(--primary); }
.navlinks a.active { color: var(--primary); font-weight: 500; }
.user-chip {
  display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 6px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff;
}
.avatar {
  width: 24px; height: 24px; border-radius: 50%; background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600;
}

@media (max-width: 640px) {
  .topbar-inner { height: auto; flex-wrap: wrap; padding: 10px 0; }
  .brand { font-size: 14px; white-space: nowrap; }
  .brand-sub { display: none; }
  .topbar-inner .navlinks {
    order: 3; width: 100%; gap: 20px; margin-top: 9px; padding-top: 9px;
    border-top: 1px solid var(--line-soft);
  }
  .navlinks a { white-space: nowrap; font-size: 13.5px; }
  .user-chip { padding: 3px 10px 3px 4px; }
  .user-chip .small { white-space: nowrap; max-width: 96px; overflow: hidden; text-overflow: ellipsis; }
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.card.pad-lg { padding: 26px; }
.section-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.section-desc { color: var(--muted); font-size: 13px; }

/* ---------- 标签 ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 6px; font-size: 12px; font-weight: 500; line-height: 20px;
  background: var(--line-soft); color: var(--text-2); white-space: nowrap;
}
.tag-green { background: var(--green-soft); color: var(--green); }
.tag-amber { background: var(--amber-soft); color: var(--amber); }
.tag-red { background: var(--red-soft); color: var(--red); }
.tag-blue { background: var(--primary-soft); color: var(--primary); }
.tag-purple { background: var(--purple-soft); color: var(--purple); }
.tag-gray { background: #f0f1f4; color: var(--muted); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--text); font-size: 14px; cursor: pointer; font-family: inherit;
  transition: all .15s ease; white-space: nowrap;
}
.btn:hover { border-color: #d3d7de; background: #fafbfc; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-danger { color: var(--red); border-color: #f0d5d5; background: #fff; }
.btn-danger:hover { background: var(--red-soft); }
.btn-sm { height: 30px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--line-soft); }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 9px; background: #fff;
  padding: 9px 12px; font-size: 14px; color: var(--text); font-family: inherit; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(22, 104, 220, .12);
}
.textarea { min-height: 92px; resize: vertical; line-height: 1.6; }
.select { height: 38px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }

/* ---------- 提示 ---------- */
.alert { border-radius: 10px; padding: 10px 14px; font-size: 13.5px; margin-bottom: 16px; }
.alert-error { background: var(--red-soft); color: #a33535; border: 1px solid #f6dcdc; }
.alert-ok { background: var(--green-soft); color: #0f7a56; border: 1px solid #d6efe4; }

/* ---------- 首页头部 ---------- */
.hero {
  background: var(--navy); color: #fff; padding: 40px 0 34px; margin-bottom: 24px;
}
.hero h1 { font-size: 26px; font-weight: 600; color: #fff; }
.hero p { color: rgba(255, 255, 255, .68); margin: 8px 0 0; font-size: 14px; }
.hero-stats { display: flex; gap: 40px; margin-top: 22px; flex-wrap: wrap; }
.hero-stat b { display: block; font-size: 22px; font-weight: 600; color: #fff; }
.hero-stat span { font-size: 12.5px; color: rgba(255, 255, 255, .6); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chip {
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff;
  font-size: 13px; color: var(--text-2); cursor: pointer;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ---------- 货源卡片 ---------- */
.listing-card { display: block; color: inherit; padding: 18px 20px 16px; transition: all .18s ease; }
.listing-card:hover { transform: translateY(-2px); border-color: #cfd6e4; box-shadow: 0 6px 28px rgba(16, 24, 39, .1); }
.lc-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.lc-code { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.lc-title { font-size: 16.5px; font-weight: 600; }
.lc-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.lc-specs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0 12px; padding: 14px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.lc-spec label { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.lc-spec span { font-size: 14px; font-weight: 600; }
.lc-price { color: var(--primary); }
.lc-note { font-size: 13px; color: var(--text-2); min-height: 20px; }
.lc-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.lc-go { color: var(--primary); font-weight: 500; }

/* ---------- 详情页 ---------- */
.detail-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.detail-title { font-size: 23px; }
.detail-price { font-size: 26px; font-weight: 600; color: var(--primary); }
.detail-price small { font-size: 13px; color: var(--muted); font-weight: 400; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
@media (max-width: 940px) { .detail-layout { grid-template-columns: 1fr; } }
.spec-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; }
@media (max-width: 600px) { .spec-grid { grid-template-columns: 1fr; } }
.spec-item { border-bottom: 1px dashed var(--line-soft); padding-bottom: 10px; }
.spec-item label { display: block; font-size: 12px; color: var(--muted); }
.spec-item span { font-size: 14px; font-weight: 500; }
.sticky { position: sticky; top: 78px; }

.steps { counter-reset: step; display: flex; flex-direction: column; gap: 0; }
.step { display: flex; gap: 14px; padding-bottom: 18px; position: relative; }
.step:not(:last-child)::before {
  content: ''; position: absolute; left: 12px; top: 28px; bottom: 0; width: 1px; background: var(--line);
}
.step-n {
  width: 26px; height: 26px; border-radius: 50%; background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 600; flex: none; z-index: 1;
}
.step-body { font-size: 13.5px; color: var(--text-2); padding-top: 2px; }
.check-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.check-list li { display: flex; gap: 10px; font-size: 13.5px; color: var(--text-2); }
.check-mark { width: 18px; height: 18px; border-radius: 50%; background: var(--green-soft); color: var(--green); flex: none; display: flex; align-items: center; justify-content: center; font-size: 11px; }

/* ---------- 表格 ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
.table-scroll .table { min-width: 860px; }
.table td .row { flex-wrap: nowrap; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px;
  padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fafbfc;
}
.table td { padding: 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:hover td { background: #fafbfc; }
.table .t-strong { font-weight: 600; }
.empty { padding: 46px 20px; text-align: center; color: var(--muted); font-size: 13.5px; }

/* ---------- 后台 ---------- */
.admin-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; background: var(--navy); color: rgba(255, 255, 255, .8); padding: 20px 14px; flex: none;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .brand { color: #fff; padding: 0 8px 18px; }
.sidebar .brand-mark { background: #fff; color: var(--navy); }
.side-menu { display: flex; flex-direction: column; gap: 2px; }
.side-menu a {
  color: rgba(255, 255, 255, .72); padding: 9px 12px; border-radius: 8px; font-size: 13.5px;
  display: flex; align-items: center; justify-content: space-between;
}
.side-menu a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.side-menu a.active { background: rgba(255, 255, 255, .14); color: #fff; font-weight: 500; }
.side-menu .badge {
  background: var(--red); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 6px; line-height: 17px; min-width: 17px; text-align: center;
}
.admin-main { flex: 1; min-width: 0; padding: 26px 28px 60px; }
.admin-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 16px; flex-wrap: wrap; }
.admin-head h2 { font-size: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.stat label { font-size: 12.5px; color: var(--muted); }
.stat b { display: block; font-size: 26px; font-weight: 600; margin-top: 4px; letter-spacing: -.02em; }
.stat .sub { font-size: 12px; color: var(--muted); }
.stat.accent b { color: var(--primary); }

@media (max-width: 820px) {
  .admin-shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .side-menu { flex-direction: row; flex-wrap: wrap; }
}

/* ---------- 登录页 ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 20px; background: linear-gradient(180deg, #f5f6f8 0%, #eef1f6 100%); }
.auth-card { width: 420px; max-width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 32px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 20px; }
.auth-tabs { display: flex; gap: 4px; background: #f2f3f6; padding: 4px; border-radius: 10px; margin-bottom: 22px; }
.auth-tabs a { flex: 1; text-align: center; padding: 7px 0; border-radius: 7px; font-size: 13.5px; color: var(--text-2); }
.auth-tabs a.active { background: #fff; color: var(--text); font-weight: 500; box-shadow: 0 1px 3px rgba(16, 24, 39, .08); }

.page-foot { padding: 28px 20px 40px; text-align: center; color: var(--muted); font-size: 12.5px; }
