/* ============================================
   音创工坊 全局样式
   主题：深空灰 + 琥珀金（音频/声学行业质感）
   ============================================ */
:root {
  --bg: #0f1115;
  --bg-soft: #161a20;
  --surface: #1b2028;
  --surface-2: #222832;
  --surface-3: #2a313d;
  --border: #2c3540;
  --border-strong: #3a4553;
  --text: #e6e9ee;
  --text-2: #a7b0bc;
  --text-3: #6c7683;
  --accent: #d9a445;      /* 琥珀金 */
  --accent-strong: #c08a2e;
  --accent-soft: rgba(217, 164, 69, .12);
  --success: #3fb67b;
  --danger: #d35a5a;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 6px 24px rgba(0,0,0,.35);
  --font: "Microsoft YaHei", "PingFang SC", system-ui, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }

img { max-width: 100%; display: block; }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 17, 21, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .5px;
}
.brand .logo {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #8a6a2a);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 800; color: #14100a;
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}
.header-nav a {
  color: var(--text-2);
  font-size: 14px;
}
.header-nav a:hover { color: var(--text); }
.header-nav .admin-link {
  border: 1px solid var(--border-strong);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
}
.header-nav .admin-link:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- 主容器 ---------- */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

/* ---------- 页面标题 ---------- */
.page-head {
  margin-bottom: 28px;
}
.page-head h1 {
  font-size: 26px;
  margin: 0 0 6px;
  font-weight: 700;
}
.page-head p {
  margin: 0;
  color: var(--text-3);
  font-size: 14px;
}

/* ---------- 商品网格 ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 20px;
}
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.product-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.product-card .cover {
  aspect-ratio: 4 / 3;
  background: var(--surface-2);
  overflow: hidden;
}
.product-card .cover img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.product-card .cover .no-cover {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  font-size: 13px;
  letter-spacing: 1px;
}
.product-card .body {
  padding: 16px;
}
.product-card .title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.product-card .desc {
  font-size: 13px;
  color: var(--text-3);
  margin: 0 0 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px;
}
.product-card .foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.price { color: var(--accent); font-weight: 700; font-size: 17px; }
.price small { font-size: 12px; color: var(--text-3); font-weight: 400; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  font-family: inherit;
}
.btn-primary { background: var(--accent); color: #14100a; }
.btn-primary:hover { background: var(--accent-strong); }
.btn-outline { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { color: var(--text-3); }
.btn-stock { background: var(--surface-3); color: var(--text-3); cursor: not-allowed; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-full { width: 100%; }
.btn-danger { background: var(--danger); color: #fff; }

/* ---------- 空状态 ---------- */
.empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-3);
}
.empty .mark {
  width: 56px; height: 56px;
  margin: 0 auto 16px;
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
}

/* ---------- 商品详情 ---------- */
.detail {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 28px;
  align-items: start;
}
@media (max-width: 820px) {
  .detail { grid-template-columns: 1fr; }
}
.detail .cover {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  aspect-ratio: 4 / 3;
}
.detail .cover img { width: 100%; height: 100%; object-fit: cover; }
.detail .cover .no-cover {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 14px; letter-spacing: 1px;
}
.detail .info h1 { font-size: 24px; margin: 0 0 10px; }
.detail .meta { color: var(--text-3); font-size: 13px; margin-bottom: 16px; }
.detail .desc-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  color: var(--text-2);
  white-space: pre-wrap;
  margin-bottom: 22px;
}
.buy-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.buy-panel .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.buy-panel .row:last-child { border-bottom: 0; }
.buy-panel .row .label { color: var(--text-3); font-size: 14px; }
.buy-panel .big-price { color: var(--accent); font-size: 26px; font-weight: 700; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.field input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}
.field input:focus { outline: none; border-color: var(--accent); }
.pay-options { display: flex; gap: 12px; margin: 18px 0 20px; }
.pay-option {
  flex: 1;
  padding: 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  text-align: center;
  cursor: pointer;
  background: var(--surface);
  transition: border-color .15s, background .15s;
  font-family: inherit;
  color: var(--text-2);
}
.pay-option:hover { border-color: var(--text-3); }
.pay-option.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.pay-option .t { font-size: 14px; font-weight: 600; }
.pay-option .s { font-size: 12px; color: var(--text-3); }
.pay-option.active .s { color: var(--accent); }
.pay-disabled {
  flex: 1; padding: 14px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  text-align: center; color: var(--text-3); font-size: 13px;
}
.notice {
  font-size: 12px; color: var(--text-3);
  margin-top: 12px; line-height: 1.7;
}

/* ---------- 二维码支付 ---------- */
.qr-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  max-width: 360px;
  margin: 0 auto;
}
.qr-panel .qr {
  width: 220px; height: 220px;
  margin: 0 auto 16px;
  background: #fff;
  border-radius: var(--radius-sm);
  display:flex; align-items:center; justify-content:center;
}
.qr-panel .qr img { width: 200px; height: 200px; }
.qr-panel .qr .loading { color:#666; font-size:14px; }
.qr-panel h2 { font-size: 18px; margin: 0 0 6px; }
.qr-panel .amount { color: var(--accent); font-size: 20px; font-weight: 700; margin-bottom: 12px; }
.qr-panel .hint { font-size: 13px; color: var(--text-3); }
.countdown { font-size: 13px; color: var(--danger); margin-top: 8px; }
.status-pill { display:inline-block; padding: 4px 10px; border-radius: 999px; font-size:12px; }

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}

/* ---------- 表单通用 ---------- */
.form {
  max-width: 540px;
}
.form .field input, .form textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}
.form .field input:focus, .form textarea:focus { outline: none; border-color: var(--accent); }
.form .field select {
  width: 100%; padding: 10px 12px;
  background: var(--bg-soft); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); color: var(--text); font-size: 14px; font-family: inherit;
}
.hint { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.err-text { color: var(--danger); font-size: 12px; margin-top: 4px; }
.form-error {
  background: rgba(211,90,90,.1);
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 14px;
}
.form-success {
  background: rgba(63,182,123,.1);
  border: 1px solid var(--success);
  color: var(--success);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 14px;
}

/* ---------- 徽章/标签 ---------- */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  border: 1px solid var(--border-strong);
  color: var(--text-2);
}

/* ---------- 提示条 ---------- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
}
.alert-warn { background: rgba(217,164,69,.1); border: 1px solid var(--accent); color: var(--accent); }
.alert-danger { background: rgba(211,90,90,.1); border: 1px solid var(--danger); color: var(--danger); }

/* ---------- 动画 ---------- */
.fade-in { animation: fadeIn .35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 640px) {
  .container { padding: 20px 16px 48px; }
  .pay-options { flex-direction: column; }
}
