/* ============ HUAGOU 华购 代购站 ============ */
:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --ink: #1d2333;
  --ink-2: #5a6274;
  --ink-3: #9aa1b2;
  --line: #e6e8f0;
  --brand: #e4322b;
  --brand-dark: #c22620;
  --brand-soft: #fdeeee;
  --accent: #1667ff;
  --accent-soft: #eaf1ff;
  --ok: #1ca05c;
  --ok-soft: #e6f7ee;
  --warn: #d97b06;
  --warn-soft: #fdf3e4;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(25, 35, 65, .07);
  font-size: 15px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background: var(--bg); color: var(--ink); min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 1rem; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--card); border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1180px; margin: 0 auto; padding: 10px 20px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.25rem; }
.logo .logo-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), #ff7a45);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 900;
}
.logo .logo-cn { color: var(--brand); }
.main-nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.main-nav a {
  padding: 8px 13px; border-radius: 9px; color: var(--ink-2); font-weight: 600; font-size: .95rem;
}
.main-nav a:hover { background: var(--bg); color: var(--ink); }
.main-nav a.active { background: var(--brand-soft); color: var(--brand); }
.header-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip-select {
  border: 1px solid var(--line); background: var(--card); border-radius: 9px;
  padding: 7px 10px; font-weight: 600; color: var(--ink-2); font-size: .9rem;
}
.btn {
  border: none; border-radius: 10px; padding: 10px 18px;
  font-weight: 700; font-size: .95rem; transition: .15s;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-outline { background: transparent; border: 1.5px solid var(--line); color: var(--ink); }
.btn-outline:hover { border-color: var(--ink-3); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: .85rem; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- layout ---------- */
.container { max-width: 1180px; margin: 0 auto; padding: 24px 20px 60px; }
.page-title { font-size: 1.6rem; font-weight: 800; margin: 6px 0 4px; }
.page-sub { color: var(--ink-2); margin-bottom: 22px; }

/* ---------- hero ---------- */
.hero {
  background: linear-gradient(120deg, #e4322b 0%, #ff6a3d 60%, #ff9f45 100%);
  border-radius: 20px; color: #fff; padding: 46px 42px; margin-bottom: 26px;
  display: flex; justify-content: space-between; align-items: center; gap: 30px; flex-wrap: wrap;
}
.hero h1 { font-size: 2rem; font-weight: 900; line-height: 1.25; margin-bottom: 10px; }
.hero p { opacity: .93; max-width: 560px; line-height: 1.6; }
.hero .hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .btn-white { background: #fff; color: var(--brand); }
.hero .btn-ghost { background: rgba(255,255,255,.16); color: #fff; border: 1.5px solid rgba(255,255,255,.55); }

/* ---------- sections ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 28px 0 16px; }
.section-head h2 { font-size: 1.3rem; font-weight: 800; }
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.step-card {
  background: var(--card); border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); border: 1px solid var(--line);
}
.step-num {
  width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand);
  font-weight: 800; display: flex; align-items: center; justify-content: center; margin-bottom: 10px;
}
.step-card h3 { font-size: 1rem; margin-bottom: 6px; }
.step-card p { color: var(--ink-2); font-size: .88rem; line-height: 1.55; }

/* ---------- product grid ---------- */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.filter-bar select, .filter-bar input {
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; background: var(--card);
}
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 16px; }
.product-card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid var(--line); display: flex; flex-direction: column;
  transition: .15s;
}
.product-card:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(25,35,65,.12); }
.product-img { aspect-ratio: 1/1; width: 100%; object-fit: cover; background: var(--bg); cursor: pointer; }
.product-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-title { font-size: .93rem; font-weight: 600; line-height: 1.4; min-height: 2.6em; cursor: pointer; }
.product-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tag { font-size: .72rem; font-weight: 700; border-radius: 6px; padding: 3px 7px; }
.tag-taobao { background: #fff1e8; color: #ff5e00; }
.tag-pdd { background: #ffe9e8; color: #e4322b; }
.tag-cat { background: var(--accent-soft); color: var(--accent); }
.product-price { margin-top: auto; display: flex; align-items: baseline; gap: 6px; }
.product-price .cur-price { font-size: 1.15rem; font-weight: 800; color: var(--brand); }
.product-price .cny-ref { font-size: .78rem; color: var(--ink-3); }

/* ---------- forms ---------- */
.form-card {
  background: var(--card); border-radius: var(--radius); padding: 26px;
  box-shadow: var(--shadow); border: 1px solid var(--line); max-width: 640px;
}
.form-grid { display: grid; gap: 14px; }
.form-grid label { font-weight: 600; font-size: .9rem; display: block; margin-bottom: 5px; }
.form-grid input, .form-grid select, .form-grid textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff;
}
.form-grid textarea { min-height: 80px; resize: vertical; }
.form-hint { color: var(--ink-3); font-size: .82rem; margin-top: 4px; }
.form-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .form-row2 { grid-template-columns: 1fr; } }

/* ---------- badges / status ---------- */
.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.st-pending_quote { background: var(--warn-soft); color: var(--warn); }
.st-quoted { background: var(--accent-soft); color: var(--accent); }
.st-paid_goods { background: var(--ok-soft); color: var(--ok); }
.st-purchasing { background: #ede7fb; color: #7048d8; }
.st-shipping_quoted { background: var(--accent-soft); color: var(--accent); }
.st-completed { background: var(--ok-soft); color: var(--ok); }
.st-cancelled { background: #eef0f4; color: var(--ink-3); }

/* ---------- orders ---------- */
.order-card {
  background: var(--card); border-radius: var(--radius); border: 1px solid var(--line);
  box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 14px;
}
.order-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.order-id { font-weight: 700; font-size: .92rem; color: var(--ink-2); }
.order-items { color: var(--ink); font-size: .92rem; line-height: 1.6; }
.order-quote {
  background: var(--bg); border-radius: 10px; padding: 12px 14px; margin-top: 12px;
  display: flex; gap: 18px; flex-wrap: wrap; font-size: .9rem;
}
.order-quote b { font-size: 1.02rem; }
.quote-item .lab { color: var(--ink-2); font-size: .8rem; display: block; }
.order-actions { margin-top: 12px; display: flex; gap: 10px; flex-wrap: wrap; }
.timeline { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; font-size: .82rem; color: var(--ink-2); }
.timeline div { padding: 2px 0; }

/* ---------- modal ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(20, 25, 40, .45); z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-mask.open { display: flex; }
.modal {
  background: var(--card); border-radius: 16px; padding: 26px; width: 100%; max-width: 440px;
  max-height: 90vh; overflow: auto;
}
.modal h3 { font-size: 1.2rem; margin-bottom: 16px; }
.modal { position: relative; }
.modal-close {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%; border: none;
  background: var(--bg); color: var(--ink-2); font-size: 1.05rem; line-height: 1;
}
.modal-close:hover { background: var(--line); color: var(--ink); }
.pay-method {
  display: flex; align-items: center; gap: 12px; border: 1.5px solid var(--line);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; cursor: pointer;
}
.pay-method.selected { border-color: var(--brand); background: var(--brand-soft); }
.pay-method .pm-icon { font-size: 1.4rem; }
.pay-method .pm-name { font-weight: 700; font-size: .93rem; }
.pay-method .pm-desc { color: var(--ink-3); font-size: .78rem; }

/* ---------- admin ---------- */
.admin-wrap { display: grid; grid-template-columns: 220px 1fr; gap: 0; min-height: calc(100vh - 57px); }
@media (max-width: 800px) { .admin-wrap { grid-template-columns: 1fr; } }
.admin-side { background: #20263a; color: #cfd4e2; padding: 20px 12px; }
.admin-side a {
  display: block; padding: 10px 14px; border-radius: 9px; font-weight: 600; font-size: .92rem; margin-bottom: 4px;
}
.admin-side a:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-side a.active { background: var(--brand); color: #fff; }
.admin-main { padding: 24px; }
.table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table th, .table td { text-align: left; padding: 11px 13px; border-bottom: 1px solid var(--line); font-size: .88rem; vertical-align: top; }
.table th { background: var(--bg); font-size: .8rem; color: var(--ink-2); text-transform: uppercase; letter-spacing: .03em; }
.table tr:hover td { background: #fafbfe; }

/* ---------- PWA install button ---------- */
.install-btn {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  z-index: 90; background: var(--brand); color: #fff; border: none;
  border-radius: 999px; padding: 13px 26px; font-weight: 800; font-size: 1rem;
  box-shadow: 0 6px 18px rgba(228, 50, 43, .45);
  display: none; align-items: center; gap: 8px;
}
.install-btn:active { transform: translateX(-50%) scale(.96); }

/* ---------- 物流跟踪 ---------- */
.track-box { background: #f7f8fc; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 10px 0; }
.track-title { font-weight: 800; margin-bottom: 8px; font-size: .95rem; }
.track-event { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.track-event:last-child { border-bottom: none; }
.track-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); margin-top: 6px; flex: none; }
.track-stage { font-weight: 700; font-size: .92rem; }
.track-meta { color: var(--ink-3); font-size: .8rem; }
.track-note { font-size: .85rem; margin-top: 2px; word-break: break-word; }
.track-latest { background: #fff7f6; border-radius: 10px; padding: 7px 8px; margin: 0 -8px; }

/* ---------- 在线客服 ---------- */
.chat-btn {
  position: fixed; left: 16px; bottom: 16px; z-index: 90;
  background: linear-gradient(135deg, #2bb3a3, #1a8f9e); color: #fff; border: none;
  border-radius: 999px; padding: 11px 18px; font-weight: 700; font-size: .9rem;
  box-shadow: 0 6px 18px rgba(26, 143, 158, .4); cursor: pointer; display: flex; align-items: center; gap: 6px;
}
.chat-btn:active { transform: scale(.96); }
.chat-msgs { display: flex; flex-direction: column; gap: 8px; max-height: 45vh; overflow-y: auto; padding: 4px 2px; }
.chat-row { display: flex; }
.chat-row.mine { justify-content: flex-end; }
.chat-row.theirs { justify-content: flex-start; }
.chat-bubble {
  max-width: 82%; padding: 9px 12px; border-radius: 14px; font-size: .92rem; line-height: 1.5;
  background: var(--brand-soft, #fdecec); color: var(--ink); word-break: break-word;
}
.chat-row.mine .chat-bubble { background: var(--brand); color: #fff; }
.chat-row.theirs .chat-bubble { background: #eef1f7; }
.chat-trans { margin-top: 6px; padding-top: 6px; border-top: 1px dashed rgba(0,0,0,.15); font-size: .85rem; opacity: .92; }
.chat-orig { margin-top: 4px; font-size: .78rem; opacity: .75; }
.chat-time { margin-top: 4px; font-size: .7rem; opacity: .65; text-align: right; }
.chat-pending { opacity: .6; }

/* ---------- misc ---------- */
.notice {
  background: var(--accent-soft); border: 1px solid #c9dbff; color: #23408f;
  border-radius: 12px; padding: 12px 16px; font-size: .88rem; line-height: 1.55; margin-bottom: 18px;
}
.empty-state { text-align: center; color: var(--ink-3); padding: 60px 0; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card { background: var(--card); border-radius: var(--radius); padding: 18px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.stat-card .v { font-size: 1.5rem; font-weight: 800; }
.stat-card .k { color: var(--ink-2); font-size: .82rem; margin-top: 2px; }
footer.site-footer { border-top: 1px solid var(--line); background: var(--card); }
.footer-inner {
  max-width: 1180px; margin: 0 auto; padding: 22px 20px; color: var(--ink-3); font-size: .85rem;
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
