/* ===========================================================
   3C数码商城 - 深色科技风 (Dark Tech / OLED)
   深黑蓝底 + 霓虹青发光 + 锐利圆角
   =========================================================== */
:root {
  --blue: #00d4ff;
  --blue-dark: #00a8cc;
  --blue-light: rgba(0, 212, 255, 0.12);
  --blue-accent: #7c5cff;
  --text: #e6edf3;
  --text-soft: #9aa8b8;
  --muted: #6b7a8c;
  --bg: #0b0e14;
  --bg-2: #0f131c;
  --white: #161b26;
  --white-2: #1c2230;
  --border: rgba(0, 212, 255, 0.16);
  --danger: #ff4d6d;
  --success: #2dd4a7;
  --radius: 12px;
  --glow: 0 0 18px rgba(0, 212, 255, 0.22);
  --glow-strong: 0 0 26px rgba(0, 212, 255, 0.4);
  --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);
  background-image: radial-gradient(circle at 15% 0%, rgba(0, 212, 255, 0.06), transparent 40%),
    radial-gradient(circle at 85% 100%, rgba(124, 92, 255, 0.06), transparent 40%);
  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(11, 14, 20, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 800;
  color: var(--blue);
  white-space: nowrap;
}
.logo .logo-mark {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--blue-light);
  border: 1px solid var(--border);
  color: var(--blue);
  display: grid; place-items: center;
  font-size: 18px;
  box-shadow: var(--glow);
}
.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.15s;
}
.nav a:hover { color: var(--blue); background: var(--blue-light); }
.nav a.active { color: #031018; background: var(--blue); box-shadow: var(--glow); font-weight: 700; }

.search-form {
  display: flex;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px 5px 3px 14px;
  flex: 0 1 260px;
}
.search-form input {
  border: none; background: transparent; outline: none; flex: 1;
  font-size: 14px; color: var(--text);
}
.search-form input::placeholder { color: var(--muted); }
.search-form button {
  border: none; background: var(--blue); color: #031018;
  width: 32px; height: 32px; border-radius: 8px; font-size: 14px; font-weight: 700;
}
.cart-link {
  position: relative;
  display: flex; align-items: center; gap: 6px;
  padding: 8px 15px; border-radius: 10px;
  background: var(--blue-light); color: var(--blue);
  border: 1px solid var(--border);
  font-weight: 700; white-space: nowrap;
}
.cart-link:hover { box-shadow: var(--glow); }
.cart-badge {
  position: absolute; top: -5px; right: -5px;
  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_bg.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(11, 14, 20, 0.88) 0%, rgba(11, 14, 20, 0.62) 55%, rgba(11, 14, 20, 0.25) 100%);
}
.hero-inner {
  position: relative;
  display: flex; align-items: center;
  padding: 56px 18px;
}
.hero-text h1 { font-size: 32px; line-height: 1.3; margin-bottom: 10px; color: #fff; }
.hero-text h1 .hl { color: var(--blue); text-shadow: var(--glow-strong); }
.hero-text p { color: rgba(230, 237, 243, 0.85); font-size: 15px; max-width: 460px; }
.hero-text .btn { margin-top: 16px; }
.hero-badge {
  display: inline-block;
  background: var(--blue-light);
  border: 1px solid var(--border);
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
  letter-spacing: 0.5px;
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 22px; border-radius: 10px; border: none;
  font-size: 15px; font-weight: 700; transition: 0.15s; white-space: nowrap;
}
.btn-primary { background: var(--blue); color: #031018; box-shadow: var(--glow); }
.btn-primary:hover { box-shadow: var(--glow-strong); transform: translateY(-1px); }
.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(1.1); }

/* ---------------- Section ---------------- */
.section { padding: 40px 0; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 10px;
}
.section-head h2 { font-size: 25px; color: var(--blue); }
.section-head .sub { color: var(--muted); font-size: 14px; }

/* ---------------- Product grid ---------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}
.card {
  background: var(--white); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border);
  transition: 0.18s; display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--glow); border-color: rgba(0, 212, 255, 0.4); }
.card-img {
  height: 168px; display: grid; place-items: center; font-size: 64px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  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: 15px; font-weight: 600; color: var(--text); }
.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(--blue); font-weight: 800; font-size: 19px; }
.price small { font-size: 12px; font-weight: 700; }
.add-btn {
  border: none; background: var(--blue); color: #031018;
  width: 36px; height: 36px; border-radius: 9px; font-size: 20px; line-height: 1;
  box-shadow: var(--glow); transition: 0.15s;
}
.add-btn:hover { box-shadow: var(--glow-strong); transform: scale(1.06); }

.empty {
  text-align: center; padding: 60px 20px; color: var(--muted);
  background: var(--white); 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: var(--bg-2);
  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: 28px; 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;
  border: 1px solid var(--border);
}
.detail-price .label { font-size: 13px; color: var(--text-soft); }
.detail-price .amount { color: var(--blue); 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: 10px; overflow: hidden; }
.qty-ctrl button { width: 38px; height: 38px; border: none; background: var(--white); 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; color: var(--text); background: var(--bg-2);
  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: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px;
}
.cart-item .ci-img {
  width: 80px; height: 80px; border-radius: 10px; display: grid; place-items: center;
  font-size: 38px; background: var(--bg-2); border: 1px solid var(--border);
}
.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(--blue); 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: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; 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(--blue); 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: var(--bg-2); color: var(--text); 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 input::placeholder, .field textarea::placeholder { color: var(--muted); }
.field textarea { resize: vertical; min-height: 70px; }
.form-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; }
.form-error { background: rgba(255, 77, 109, 0.12); color: var(--danger); border: 1px solid rgba(255, 77, 109, 0.4);
  padding: 11px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; }

/* ---------------- Order confirmation ---------------- */
.confirm-hero { text-align: center; padding: 30px 20px; background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--border); }
.confirm-hero .check {
  width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 50%;
  background: var(--success); color: #031018; display: grid; place-items: center; font-size: 42px;
  box-shadow: 0 0 20px rgba(45, 212, 167, 0.4);
}
.confirm-hero h1 { font-size: 26px; }
.confirm-hero p { color: var(--text-soft); margin-top: 6px; }
.order-box { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; margin-top: 22px; }
.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-2); 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: var(--white); border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--border); }
.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); 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: var(--bg-2); color: var(--text-soft); }
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: none;
  align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 200; overflow: auto;
}
.modal-backdrop.show { display: flex; }
.modal {
  background: var(--white); border-radius: var(--radius); width: 100%; max-width: 520px;
  padding: 26px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); border: 1px solid var(--border);
}
.modal h3 { margin-bottom: 18px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* ---------------- Footer ---------------- */
.footer { background: var(--bg-2); 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(--blue); }
.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(22, 27, 38, 0.95); color: var(--blue); padding: 12px 22px; border-radius: 10px;
  border: 1px solid var(--border); 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: 38px 18px; }
  .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:800; color:var(--blue); }
.detail-price .amount small { font-size:18px; }
.detail-price .orig-price { color:var(--muted); text-decoration:line-through; font-size:14px; }
.detail-price .sales-badge { background:var(--blue-light); color:var(--blue); font-size:12px; padding:2px 12px; border-radius:8px; }
.service-bar { display:flex; gap:18px; flex-wrap:wrap; color:var(--text-soft); font-size:13px; margin:12px 0; padding:10px 16px; background:var(--bg-2); border-radius:10px; border:1px solid var(--border); }
.service-bar span::before { content:"✓ "; color:var(--success); font-weight:700; }
.btn-buy { background:var(--blue); color:#031018; }
.btn-buy:hover { background:var(--blue-dark); color:#031018; }
.detail-section { margin-top:8px; }
.detail-copy { max-width:760px; }
.detail-lead { font-size:16px; line-height:2.0; color:var(--text); background:var(--bg-2); padding:18px 20px; border-radius:10px; border:1px solid var(--border); }
.detail-points h3, .detail-spec h3, .detail-notice h3 { font-size:16px; margin:26px 0 12px; color:var(--blue); border-left:3px solid var(--blue); padding-left:10px; }
.detail-points ul { list-style:none; padding:0; }
.detail-points li { padding:9px 0; border-bottom:1px dashed var(--border); color:var(--text-soft); line-height:1.7; }
.detail-points li::before { content:"✓ "; color:var(--success); font-weight:700; }
.detail-spec table { width:100%; border-collapse:collapse; font-size:14px; }
.detail-spec td { padding:11px 14px; border:1px solid var(--border); color:var(--text); }
.detail-spec td:first-child { width:120px; background:var(--bg-2); color:var(--muted); }
.detail-notice p { color:var(--muted); font-size:13px; line-height:1.9; margin:4px 0; }

/* ===== 深色科技风分类图标 ===== */
.cat-circle { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 26px; justify-content: center; }
.cat-circle a { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--text-soft); font-size: 13px; text-decoration: none; }
.cat-circle .circle-icon {
  width: 58px; height: 58px; border-radius: 12px;
  background: var(--white); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 26px; transition: 0.15s;
}
.cat-circle a.active { color: var(--blue); font-weight: 700; }
.cat-circle a.active .circle-icon {
  background: var(--blue-light); border-color: var(--blue);
  box-shadow: var(--glow);
}
.cat-circle a:hover .circle-icon { transform: translateY(-2px); box-shadow: var(--glow); }
