/* ===========================================================
   户外运动服装商城 - 样式表 (活力橙绿主题)
   =========================================================== */
:root {
  --blue: #ea580c;
  --blue-dark: #c2410c;
  --blue-light: #fff1e8;
  --blue-accent: #059669;
  --text: #1f2937;
  --text-soft: #6b7280;
  --muted: #9ca3af;
  --bg: #faf7f2;
  --white: #fff;
  --border: #f0e8de;
  --danger: #e5484d;
  --success: #059669;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 8px 24px rgba(234, 88, 12, 0.16);
  --maxw: 1180px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 18px; }

/* ---------------- Header ---------------- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 800;
  color: var(--blue);
  white-space: nowrap;
}
.logo .logo-mark {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--blue-accent), var(--blue));
  color: #fff;
  display: grid; place-items: center;
  font-size: 18px;
}
.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--text-soft);
  font-weight: 500;
  font-size: 15px;
  transition: 0.2s;
}
.nav a:hover { color: var(--blue); background: var(--blue-light); }
.nav a.active { color: #fff; background: var(--blue); }

.search-form {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 6px 4px 14px;
  flex: 0 1 260px;
}
.search-form input {
  border: none; background: transparent; outline: none; flex: 1;
  font-size: 14px; color: var(--text);
}
.search-form button {
  border: none; background: var(--blue); color: #fff;
  width: 34px; height: 34px; border-radius: 50%; font-size: 15px;
}
.cart-link {
  position: relative;
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--blue-light); color: var(--blue);
  font-weight: 600; white-space: nowrap;
}
.cart-link:hover { background: #ffe8d6; }
.cart-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 20px; height: 20px; padding: 0 5px;
  background: var(--danger); color: #fff;
  border-radius: 999px; font-size: 12px; font-weight: 700;
  display: grid; place-items: center; line-height: 1;
}

/* ---------------- Hero ---------------- */
.hero {
  position: relative;
  background: url('/static/images/hero.jpg') center/cover no-repeat;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.72) 0%, rgba(15, 23, 42, 0.45) 55%, rgba(15, 23, 42, 0.12) 100%);
}
.hero-inner {
  position: relative;
  display: flex; align-items: center;
  padding: 52px 18px;
}
.hero-text h1 { font-size: 30px; line-height: 1.3; margin-bottom: 10px; color: #fff; }
.hero-text h1 .hl { color: #ffb37e; }
.hero-text p { color: rgba(255, 255, 255, 0.88); font-size: 15px; max-width: 460px; }
.hero-text .btn { margin-top: 16px; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 22px; border-radius: 999px; border: none;
  font-size: 15px; font-weight: 600; transition: 0.2s; white-space: nowrap;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); box-shadow: var(--shadow-hover); }
.btn-ghost { background: transparent; color: var(--blue); border: 1px solid var(--blue); }
.btn-ghost:hover { background: var(--blue-light); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(0.94); }

/* ---------------- Section ---------------- */
.section { padding: 38px 0; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 22px; flex-wrap: wrap; gap: 10px;
}
.section-head h2 { font-size: 24px; }
.section-head .sub { color: var(--muted); font-size: 14px; }

/* category tabs */
.cat-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.cat-tabs a {
  padding: 9px 18px; border-radius: 999px;
  background: #fff; border: 1px solid var(--border); color: var(--text-soft);
  font-weight: 600; font-size: 14px; transition: 0.2s;
}
.cat-tabs a:hover { border-color: var(--blue); color: var(--blue); }
.cat-tabs a.active { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ---------------- Product grid ---------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}
.card {
  background: #fff; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); box-shadow: var(--shadow);
  transition: 0.22s; display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: #ffdcc0; }
.card-img {
  height: 168px; display: grid; place-items: center; font-size: 64px;
  background: linear-gradient(135deg, #fdf2e9, #fff1e8);
  overflow: hidden;
}
.card-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.card-body { padding: 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-brand { font-size: 12px; color: var(--blue); font-weight: 700; letter-spacing: 0.5px; }
.card-name { font-size: 16px; font-weight: 600; }
.card-desc {
  font-size: 13px; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 6px; }
.price { color: var(--danger); font-weight: 800; font-size: 18px; }
.price small { font-size: 12px; font-weight: 600; }
.add-btn {
  border: none; background: var(--blue); color: #fff;
  width: 36px; height: 36px; border-radius: 50%; font-size: 20px; line-height: 1;
  transition: 0.2s;
}
.add-btn:hover { background: var(--blue-dark); transform: scale(1.08); }

.empty {
  text-align: center; padding: 60px 20px; color: var(--muted);
  background: #fff; border-radius: var(--radius); border: 1px dashed var(--border);
}
.empty .big { font-size: 54px; margin-bottom: 10px; }

/* ---------------- Breadcrumb ---------------- */
.crumb { padding: 16px 0; font-size: 13px; color: var(--muted); }
.crumb a:hover { color: var(--blue); }

/* ---------------- Product detail ---------------- */
.detail { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding: 10px 0 30px; }
.detail-img {
  border-radius: var(--radius); background: linear-gradient(135deg, #fdf2e9, #fff1e8);
  display: grid; place-items: center; font-size: 150px; min-height: 360px;
  border: 1px solid var(--border);
}
.detail-info .brand { color: var(--blue); font-weight: 700; letter-spacing: 0.5px; }
.detail-info h1 { font-size: 30px; margin: 6px 0 14px; }
.detail-info .desc { color: var(--text-soft); margin-bottom: 18px; }
.detail-price {
  background: var(--blue-light); border-radius: var(--radius);
  padding: 18px 22px; margin-bottom: 22px;
}
.detail-price .label { font-size: 13px; color: var(--text-soft); }
.detail-price .amount { color: var(--danger); font-size: 34px; font-weight: 800; }
.detail-price .amount small { font-size: 18px; }
.qty-row { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.qty-row .label { color: var(--text-soft); }
.qty-ctrl { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.qty-ctrl button { width: 38px; height: 38px; border: none; background: #fff; font-size: 20px; color: var(--blue); }
.qty-ctrl button:hover { background: var(--blue-light); }
.qty-ctrl input {
  width: 54px; height: 38px; border: none; text-align: center; font-size: 16px;
  outline: none; border-left: 1px solid var(--border); border-right: 1px solid var(--border);
}
.detail-actions { display: flex; gap: 12px; }
.meta-list { margin-top: 24px; border-top: 1px solid var(--border); padding-top: 18px; }
.meta-list div { display: flex; justify-content: space-between; padding: 7px 0; font-size: 14px; color: var(--text-soft); }
.meta-list div b { color: var(--text); font-weight: 600; }

/* ---------------- Cart ---------------- */
.cart-layout { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.cart-list { display: flex; flex-direction: column; gap: 14px; }
.cart-item {
  display: grid; grid-template-columns: 80px 1fr auto; gap: 16px; align-items: center;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow);
}
.cart-item .ci-img {
  width: 80px; height: 80px; border-radius: 10px; display: grid; place-items: center;
  font-size: 38px; background: linear-gradient(135deg, #fdf2e9, #fff1e8);
}
.cart-item .ci-name { font-weight: 600; font-size: 16px; }
.cart-item .ci-brand { font-size: 12px; color: var(--blue); font-weight: 700; }
.cart-item .ci-price { color: var(--danger); font-weight: 700; margin-top: 4px; }
.ci-right { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.ci-subtotal { font-size: 17px; font-weight: 800; color: var(--text); }
.ci-remove { background: none; border: none; color: var(--muted); font-size: 13px; }
.ci-remove:hover { color: var(--danger); }

.summary {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); position: sticky; top: 86px;
}
.summary h3 { margin-bottom: 16px; font-size: 18px; }
.summary .row { display: flex; justify-content: space-between; padding: 7px 0; color: var(--text-soft); font-size: 14px; }
.summary .total { display: flex; justify-content: space-between; align-items: baseline;
  border-top: 1px dashed var(--border); margin-top: 10px; padding-top: 14px; }
.summary .total .amount { color: var(--danger); font-size: 26px; font-weight: 800; }

/* ---------------- Forms ---------------- */
.form-grid { display: grid; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; color: var(--text); }
.field input, .field textarea, .field select {
  border: 1px solid var(--border); border-radius: 10px; padding: 11px 14px;
  font-size: 15px; font-family: inherit; outline: none; background: #fff; transition: 0.2s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-light);
}
.field textarea { resize: vertical; min-height: 70px; }
.form-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.form-error { background: #fdecea; color: var(--danger); border: 1px solid #f5c6c2;
  padding: 11px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; }

/* ---------------- Order confirmation ---------------- */
.confirm-hero { text-align: center; padding: 30px 20px; background: #fff; border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow); }
.confirm-hero .check {
  width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 50%;
  background: var(--success); color: #fff; display: grid; place-items: center; font-size: 42px;
}
.confirm-hero h1 { font-size: 26px; }
.confirm-hero p { color: var(--text-soft); margin-top: 6px; }
.order-box { background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; margin-top: 22px; box-shadow: var(--shadow); }
.order-box h3 { margin-bottom: 14px; }
.order-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.order-meta .m { background: var(--bg); border-radius: 10px; padding: 12px 14px; }
.order-meta .m .k { font-size: 12px; color: var(--muted); }
.order-meta .m .v { font-weight: 600; }
.oitem { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.oitem:last-child { border-bottom: none; }

/* ---------------- Admin ---------------- */
.admin-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.admin-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); }
.admin-table th, .admin-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
.admin-table th { background: var(--blue-light); color: var(--blue-dark); font-weight: 700; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table .thumb { font-size: 26px; }
.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--blue-light);
  color: var(--blue); font-size: 12px; font-weight: 600; }
.tag.gray { background: #f3efe9; color: var(--text-soft); }
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45); display: none;
  align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 200; overflow: auto;
}
.modal-backdrop.show { display: flex; }
.modal {
  background: #fff; border-radius: var(--radius); width: 100%; max-width: 520px;
  padding: 26px; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal h3 { margin-bottom: 18px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* ---------------- Footer ---------------- */
.footer { background: #fff; border-top: 1px solid var(--border); margin-top: 50px; }
.footer-inner { padding: 34px 18px; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 24px; }
.footer h4 { font-size: 15px; margin-bottom: 12px; color: var(--text); }
.footer a, .footer p { color: var(--text-soft); font-size: 14px; display: block; padding: 3px 0; }
.footer a:hover { color: var(--blue); }
.footer-bottom { text-align: center; padding: 16px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--border); }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(20px);
  background: rgba(34,34,34,0.92); color: #fff; padding: 12px 22px; border-radius: 999px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: 0.3s; z-index: 300;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------- Responsive ---------------- */
@media (max-width: 920px) {
  .detail { grid-template-columns: 1fr; gap: 24px; }
  .cart-layout { grid-template-columns: 1fr; }
  .summary { position: static; }
}
@media (max-width: 760px) {
  .header-inner { flex-wrap: wrap; height: auto; padding: 10px 0; gap: 10px; }
  .nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .search-form { flex: 1 1 100%; order: 2; }
  .cart-link { order: 2; }
  .hero-inner { flex-direction: column; text-align: center; padding: 36px 18px; }
  .hero-art { font-size: 90px; }
  .hero-text h1 { font-size: 28px; }
  .cart-item { grid-template-columns: 64px 1fr; }
  .cart-item .ci-img { width: 64px; height: 64px; font-size: 30px; }
  .ci-right { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
  .detail-info h1 { font-size: 24px; }
}
@media (max-width: 480px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .card-img { height: 130px; font-size: 50px; }
  .section-head h2 { font-size: 20px; }
}


/* ============ 详情页增强（真实店铺风格） ============ */
.detail-price { display:flex; align-items:baseline; gap:12px; flex-wrap:wrap; margin:14px 0 6px; }
.detail-price .amount { font-size:34px; font-weight:700; color:#ff5000; }
.detail-price .amount small { font-size:18px; }
.detail-price .orig-price { color:#999; text-decoration:line-through; font-size:14px; }
.detail-price .sales-badge { background:#fff1ec; color:#ff5000; font-size:12px; padding:2px 10px; border-radius:12px; }
.service-bar { display:flex; gap:18px; flex-wrap:wrap; color:#666; font-size:13px; margin:12px 0; padding:10px 16px; background:#faf6f0; border-radius:8px; }
.service-bar span::before { content:"✓ "; color:#00b578; font-weight:700; }
.btn-buy { background:#ff5000; color:#fff; }
.btn-buy:hover { background:#e64600; color:#fff; }
.detail-section { margin-top:8px; }
.detail-copy { max-width:760px; }
.detail-lead { font-size:16px; line-height:2.0; color:#333; background:#fafafa; padding:18px 20px; border-radius:10px; }
.detail-points h3, .detail-spec h3, .detail-notice h3 { font-size:16px; margin:26px 0 12px; color:#111; border-left:3px solid #ea580c; padding-left:10px; }
.detail-points ul { list-style:none; padding:0; }
.detail-points li { padding:9px 0; border-bottom:1px dashed #eee; color:#444; line-height:1.7; }
.detail-points li::before { content:"✓ "; color:#ea580c; font-weight:700; }
.detail-spec table { width:100%; border-collapse:collapse; font-size:14px; }
.detail-spec td { padding:11px 14px; border:1px solid #eee; color:#333; }
.detail-spec td:first-child { width:120px; background:#faf6f0; color:#666; }
.detail-notice p { color:#999; font-size:13px; line-height:1.9; margin:4px 0; }
