/* ============================================
   QBell Wine — 酒之魂 | Premium Dark Theme v2
   ============================================ */

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #13131a;
  --bg-card: #1a1a24;
  --bg-card-hover: #22222e;
  --bg-input: #0f0f15;
  --gold: #c9a96e;
  --gold-light: #e0c896;
  --gold-dark: #9a7e4a;
  --gold-glow: rgba(201, 169, 110, 0.15);
  --text-primary: #f0ebe1;
  --text-secondary: #a09889;
  --text-muted: #6b6557;
  --border: rgba(201, 169, 110, 0.15);
  --border-hover: rgba(201, 169, 110, 0.35);
  --success: #4a7c59;
  --danger: #a04545;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-gold: 0 0 20px rgba(201, 169, 110, 0.1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --font-serif: 'Georgia', 'Noto Serif TC', 'Songti TC', serif;
  --font-sans: -apple-system, 'Noto Sans TC', 'PingFang TC', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* ===== Nav ===== */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 960px; margin: 0 auto;
  padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  font-family: var(--font-serif);
  color: var(--gold); text-decoration: none;
  font-size: 1.05rem; letter-spacing: 0.05em;
}
.nav-links { display: flex; gap: 20px; align-items: center; }
.nav-links a {
  color: var(--text-secondary); text-decoration: none;
  font-size: 0.85rem; transition: color 0.2s;
}
.nav-links a:hover { color: var(--gold); }
.nav-cta {
  padding: 6px 18px; border-radius: 20px;
  border: 1px solid var(--gold-dark); color: var(--gold) !important;
  transition: all 0.2s;
}
.nav-cta:hover { background: var(--gold-glow); }

/* ===== Hero ===== */
.hero {
  text-align: center; padding: 100px 20px 80px;
  background-image: radial-gradient(ellipse at center, rgba(201,169,110,0.06) 0%, transparent 60%);
}
.hero h1 {
  font-family: var(--font-serif);
  font-size: 3rem; font-weight: 400;
  color: var(--gold); letter-spacing: 0.05em;
  margin-bottom: 20px;
}
.hero-sub {
  font-size: 1.05rem; color: var(--text-secondary);
  max-width: 560px; margin: 0 auto 36px;
  line-height: 1.8;
}

/* ===== Buttons ===== */
.btn {
  display: inline-block; padding: 12px 28px;
  border: none; border-radius: var(--radius-md);
  font-size: 0.95rem; font-family: var(--font-sans);
  cursor: pointer; transition: all 0.3s;
  text-decoration: none; text-align: center;
  letter-spacing: 0.03em;
}
.btn-lg { padding: 14px 36px; font-size: 1rem; }
.btn-primary {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: #0a0a0f; font-weight: 600;
  box-shadow: 0 4px 16px rgba(201,169,110,0.2);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  box-shadow: 0 6px 24px rgba(201,169,110,0.35);
  transform: translateY(-1px);
}
.qty-btn {
  width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-input); color: var(--gold); font-size: 1rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
}
.qty-btn:hover {
  border-color: var(--gold); background: rgba(201,169,110,0.1);
}
.qty-step {
  width: 46px; height: 48px; border: 1px solid var(--border);
  background: var(--bg-input); color: var(--gold); font-size: 1.4rem;
  cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center;
}
.qty-step:first-child { border-radius: 12px 0 0 12px; border-right: none; }
.qty-step:last-of-type { border-radius: 0 12px 12px 0; border-left: none; }
.qty-step:hover { background: rgba(201,169,110,0.12); border-color: var(--gold); }
.qty-step:active { transform: scale(0.95); }
.qty-input {
  width: 72px; height: 48px; text-align: center;
  border: 1px solid var(--border); border-left: none; border-right: none;
  background: var(--bg-input); color: var(--gold); font-size: 1.2rem; font-weight: 700;
  outline: none; transition: border-color 0.2s;
  font-variant-numeric: tabular-nums;
}
.qty-input:focus { border-color: var(--gold); background: rgba(201,169,110,0.05); }
.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.btn-ghost {
  background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== Sections ===== */
.section { padding: 64px 20px; }
.section-alt { background: var(--bg-secondary); }
.section-inner { max-width: 800px; margin: 0 auto; }
.section-title {
  font-family: var(--font-serif);
  font-size: 1.8rem; color: var(--gold);
  text-align: center; margin-bottom: 16px;
  letter-spacing: 0.05em;
}
.section-lead {
  text-align: center; color: var(--text-secondary);
  font-size: 1rem; max-width: 600px;
  margin: 0 auto 40px; line-height: 1.8;
}

/* ===== Feature Cards ===== */
.feature-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px; margin-top: 32px;
}
@media (max-width: 600px) { .feature-grid { grid-template-columns: 1fr; } }
.feature-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px 20px;
  text-align: center; transition: border-color 0.3s;
}
.feature-card:hover { border-color: var(--border-hover); }
.feature-icon { font-size: 2rem; margin-bottom: 12px; }
.feature-card h3 {
  font-family: var(--font-serif); color: var(--gold);
  font-size: 1.05rem; margin-bottom: 8px;
}
.feature-card p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; }

/* ===== Steps ===== */
.steps { display: flex; flex-direction: column; gap: 32px; }
.step { display: flex; gap: 20px; align-items: flex-start; }
.step-num {
  flex-shrink: 0; width: 40px; height: 40px;
  border-radius: 50%; background: var(--gold-glow);
  border: 1px solid var(--gold-dark);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); color: var(--gold);
  font-size: 1.1rem;
}
.step-content { flex: 1; }
.step-content h3 {
  font-family: var(--font-serif); color: var(--gold);
  font-size: 1.15rem; margin-bottom: 8px;
}
.step-content > p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 12px; }

/* ===== Purification Table ===== */
.purification-table { margin-top: 16px; }
.pt-row {
  display: grid; grid-template-columns: 100px 1fr 50px;
  gap: 12px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid rgba(201,169,110,0.06);
  font-size: 0.88rem;
}
/* pt-row-featured removed — all rows equal weight */
.pt-name { color: var(--gold); font-weight: 500; }
.pt-desc { color: var(--text-muted); font-size: 0.82rem; }
.pt-tier { color: var(--gold-light); font-weight: 600; text-align: right; white-space: nowrap; }

/* ===== Energy Grid ===== */
.energy-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px; margin-top: 32px;
}
@media (max-width: 768px) { .energy-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .energy-grid { grid-template-columns: 1fr; } }
.energy-block {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  transition: border-color 0.3s;
}
.energy-block:hover { border-color: var(--border-hover); }
.energy-cat {
  font-family: var(--font-serif); color: var(--gold-dark);
  font-size: 0.95rem; margin-bottom: 12px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
  letter-spacing: 0.05em;
}
.energy-item {
  display: flex; flex-direction: column;
  padding: 8px 0; font-size: 0.82rem;
}
.ei-name { color: var(--text-primary); font-weight: 500; }
.ei-desc { color: var(--text-muted); font-size: 0.75rem; margin: 2px 0; }
.ei-points { color: var(--gold); font-weight: 600; font-size: 0.78rem; }

/* ===== Pricing ===== */
.pricing-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin-top: 32px;
}
@media (max-width: 768px) { .pricing-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .pricing-grid { grid-template-columns: 1fr; } }
.pricing-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px 16px;
  text-align: center; position: relative;
  transition: border-color 0.3s;
}
.pricing-card:hover { border-color: var(--border-hover); }
.pricing-card-popular { border-color: var(--gold); box-shadow: var(--shadow-gold); }
.pricing-badge {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--gold); color: #0a0a0f;
  font-size: 0.7rem; padding: 3px 12px;
  border-radius: 10px; font-weight: 600;
}
.pricing-name { font-family: var(--font-serif); color: var(--text-secondary); font-size: 0.9rem; }
.pricing-points { font-size: 1.8rem; color: var(--gold); font-weight: 700; margin: 8px 0 4px; }
.pricing-price { color: var(--text-primary); font-size: 1.1rem; font-weight: 500; }
.pricing-unit { color: var(--text-muted); font-size: 0.78rem; margin-top: 4px; }

.pricing-example {
  margin-top: 40px; padding: 20px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); text-align: center;
}
.pricing-example h3 { font-family: var(--font-serif); color: var(--gold); font-size: 1rem; margin-bottom: 8px; }
.pricing-example p { font-size: 0.88rem; color: var(--text-secondary); }
.pricing-example strong { color: var(--gold-light); }
.pricing-example-sub { font-size: 0.8rem !important; color: var(--text-muted) !important; margin-top: 4px; }

/* ===== FAQ ===== */
.faq-list { margin-top: 24px; }
.faq-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px 20px;
  margin-bottom: 8px; transition: border-color 0.3s;
}
.faq-item:hover { border-color: var(--border-hover); }
.faq-item summary {
  cursor: pointer; font-size: 0.92rem;
  color: var(--text-primary); font-weight: 500;
  list-style: none;
}
.faq-item summary::before { content: '+ '; color: var(--gold); }
.faq-item[open] summary::before { content: '− '; }
.faq-item[open] summary { margin-bottom: 8px; }
.faq-item p { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.7; }

/* ===== CTA Section ===== */
.cta-section {
  text-align: center; padding: 80px 20px;
  background: linear-gradient(180deg, transparent, rgba(201,169,110,0.04));
}
.cta-inner h2 {
  font-family: var(--font-serif); font-size: 1.6rem;
  color: var(--gold); margin-bottom: 24px;
}

/* ===== Footer ===== */
footer {
  text-align: center; padding: 32px 20px;
  border-top: 1px solid var(--border);
}
footer p { font-size: 0.75rem; color: var(--text-muted); }

/* ===== Forms (login, member) ===== */
.form-group { margin-bottom: 18px; }
.form-group:last-child { margin-bottom: 0; }
.form-group label {
  display: block; font-size: 0.82rem;
  color: var(--text-secondary); margin-bottom: 6px;
}
input[type="text"], input[type="password"], input[type="email"],
select, textarea {
  width: 100%; padding: 12px 14px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-md); color: var(--text-primary);
  font-size: 0.95rem; font-family: var(--font-sans);
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
textarea { resize: vertical; min-height: 70px; }
select {
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%0A%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23c9a96e' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  padding-right: 36px;
}
input[type="file"] { font-size: 0.85rem; color: var(--text-secondary); }
input[type="file"]::file-selector-button {
  padding: 8px 16px; background: var(--bg-secondary);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--gold); cursor: pointer; font-size: 0.82rem;
  margin-right: 10px; transition: background 0.2s;
}
input[type="file"]::file-selector-button:hover { background: var(--gold-glow); }
.photo-preview {
  display: none; width: 100%; max-height: 200px;
  object-fit: cover; border-radius: var(--radius-md);
  margin-top: 10px; border: 1px solid var(--border);
}

/* ===== Checkbox / Radio ===== */
.checkbox-group { display: flex; flex-wrap: wrap; gap: 8px; }
.checkbox-item { position: relative; cursor: pointer; }
.checkbox-item input { position: absolute; opacity: 0; pointer-events: none; }
.checkbox-item span {
  display: inline-block; padding: 8px 16px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 20px; font-size: 0.85rem;
  color: var(--text-secondary); transition: all 0.2s;
  user-select: none;
}
.checkbox-item input:checked + span {
  background: var(--gold-glow); border-color: var(--gold);
  color: var(--gold-light);
}

/* ===== Card (form) ===== */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
  margin-bottom: 16px; box-shadow: var(--shadow-card);
}
.card-title {
  font-family: var(--font-serif); font-size: 1.15rem;
  color: var(--gold); margin-bottom: 20px;
  padding-bottom: 12px; border-bottom: 1px solid var(--border);
}

/* ===== Purification / Energy Cards (member page) ===== */
.purification-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (max-width: 480px) { .purification-options { grid-template-columns: 1fr; } }
.purification-card { position: relative; cursor: pointer; display: block; }
.purification-card input { position: absolute; opacity: 0; pointer-events: none; }
.purification-content {
  padding: 18px; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  transition: all 0.3s; text-align: center;
}
.purification-card input:checked + .purification-content {
  background: linear-gradient(135deg, var(--gold-glow), rgba(201,169,110,0.05));
  border-color: var(--gold); box-shadow: var(--shadow-gold);
}
.purification-name { font-family: var(--font-serif); color: var(--gold); font-size: 1.1rem; }
.purification-desc { font-size: 0.78rem; color: var(--text-muted); margin: 4px 0 8px; }
.purification-points { font-size: 0.85rem; color: var(--gold-light); font-weight: 600; }

.energy-category {
  font-family: var(--font-serif); color: var(--gold-dark);
  font-size: 0.95rem; margin: 20px 0 10px;
  padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.energy-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 600px) { .energy-options { grid-template-columns: repeat(2, 1fr); } }
.energy-card { position: relative; cursor: pointer; display: block; }
.energy-card input { position: absolute; opacity: 0; pointer-events: none; }
.energy-content {
  padding: 14px; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  transition: all 0.3s;
}
.energy-card input:checked + .energy-content {
  background: linear-gradient(135deg, var(--gold-glow), rgba(201,169,110,0.03));
  border-color: var(--gold);
}
.energy-name { font-size: 0.88rem; color: var(--text-primary); font-weight: 500; }
.energy-desc { font-size: 0.72rem; color: var(--text-muted); margin: 2px 0 6px; }
.energy-points { font-size: 0.8rem; color: var(--gold); font-weight: 600; }

/* ===== Summary ===== */
.summary-row {
  display: flex; justify-content: space-between;
  padding: 8px 0; font-size: 0.9rem;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(201,169,110,0.06);
}
.summary-row span:last-child { color: var(--text-primary); font-weight: 500; }
.total-row {
  font-size: 1.1rem !important; padding: 14px 0 !important;
  border-top: 1px solid var(--border) !important; margin-top: 8px;
}
.total-row span { color: var(--gold) !important; font-weight: 600; }

/* ===== Result Box ===== */
.result-box {
  padding: 20px; border-radius: var(--radius-md);
  margin-top: 16px; font-size: 0.9rem; line-height: 1.6;
}
.result-box.success { background: rgba(74,124,89,0.1); border: 1px solid rgba(74,124,89,0.3); color: #7eb892; }
.result-box.error { background: rgba(160,69,69,0.1); border: 1px solid rgba(160,69,69,0.3); color: #d98080; }
.result-box code { background: rgba(201,169,110,0.1); padding: 2px 8px; border-radius: 4px; color: var(--gold-light); }
.hidden { display: none; }

/* ===== Member Page ===== */
.member-header {
  display: flex; justify-content: space-between;
  align-items: center; padding: 16px 0;
  border-bottom: 1px solid var(--border); margin-bottom: 24px;
}
.member-info { display: flex; gap: 16px; align-items: center; }
.member-badge {
  padding: 4px 12px; border-radius: 20px;
  background: rgba(201,169,110,0.12); color: var(--gold-light);
  border: 1px solid var(--border); font-size: 0.8rem;
}
.points-badge {
  padding: 4px 12px; border-radius: 20px;
  background: rgba(74,124,89,0.15); color: #7eb892;
  border: 1px solid rgba(74,124,89,0.3); font-size: 0.8rem;
}

/* ===== Order List ===== */
.order-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px;
  margin-bottom: 8px; transition: border-color 0.3s;
}
.order-card:hover { border-color: var(--border-hover); }
.order-row { display: flex; justify-content: space-between; font-size: 0.85rem; padding: 4px 0; }
.order-row .label { color: var(--text-muted); }
.order-row .value { color: var(--text-primary); }
.status-badge {
  display: inline-block; padding: 3px 10px;
  border-radius: 12px; font-size: 0.75rem; font-weight: 500;
}
.status-待處理 { background: rgba(184,134,11,0.15); color: #d4a942; }
.status-ZPF寫入中 { background: rgba(74,124,89,0.15); color: #7eb892; }
.status-完成 { background: rgba(201,169,110,0.15); color: var(--gold-light); }

/* ===== Login Page ===== */
.login-container { max-width: 400px; margin: 60px auto; padding: 0 20px; }
.login-container .card { padding: 32px; }

/* ===== Responsive Nav ===== */
@media (max-width: 600px) {
  .nav-links { gap: 12px; }
  .nav-links a { font-size: 0.78rem; }
  .hero h1 { font-size: 2rem; }
  .hero { padding: 60px 20px 50px; }
  .section { padding: 48px 20px; }
}

/* ===== File Upload ===== */
.file-upload-wrapper {
  position: relative;
  width: 100%;
}
.file-upload-wrapper input[type="file"] {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.2s;
}
.file-upload-wrapper input[type="file"]:hover {
  border-color: var(--gold);
}
.file-upload-wrapper input[type="file"]::file-selector-button {
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  border: none;
  border-radius: var(--radius-sm);
  color: #0a0a0f;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  margin-right: 12px;
  transition: opacity 0.2s;
}
.file-upload-wrapper input[type="file"]::file-selector-button:hover {
  opacity: 0.85;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--gold-dark); border-radius: 3px; }

/* ===== Mobile Responsive ===== */
@media (max-width: 768px) {
  .nav-inner { flex-wrap: wrap; padding: 12px 16px; }
  .nav-links { 
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 0;
    margin-top: 8px;
  }
  .nav-links.show { display: flex; }
  .nav-links a { 
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
  }
  .nav-links a:last-child { border-bottom: none; }
  .nav-links a.nav-cta, .nav-links a[style*="margin-right"] { 
    margin-right: 0 !important;
    margin-top: 4px;
  }
  .nav-toggle {
    display: block;
    background: none;
    border: none;
    color: var(--gold);
    font-size: 1.3rem;
    cursor: pointer;
    margin-left: auto;
  }
  .hero h1 { font-size: 1.6rem; }
  .hero { padding: 40px 16px; }
  .section { padding: 32px 16px; }
  .section-inner { max-width: 100% !important; padding: 0; }
  .card { padding: 16px; }
  .reg-card { padding: 20px; }
}
@media (min-width: 769px) {
  .nav-toggle { display: none; }
}

/* ===== Mobile Nav Toggle ===== */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--gold);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 8px;
}
