:root {
  --bg: #0c1222;
  --bg-secondary: #162032;
  --bg-card: #1a2740;
  --bg-muted: #0f1a30;
  --gold: #c9a84c;
  --gold-light: #e8d5a3;
  --text: #e8e0d4;
  --text-muted: #8b9bb4;
  --border: #253552;
  --font-serif: 'Noto Serif SC', 'Songti SC', serif;
  --font-sans: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; }
::selection { background: rgba(201,168,76,.3); color: var(--text); }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.container { max-width: 80rem; margin: 0 auto; padding: 0 1rem; }
@media (min-width: 640px) { .container { padding: 0 1.5rem; } }

.font-serif { font-family: var(--font-serif); }
.text-muted { color: var(--text-muted); }
.text-gold { color: var(--gold); }
.text-gold-light { color: var(--gold-light); }

.site-header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--border);
  background: rgba(12,18,34,.95);
  backdrop-filter: blur(12px);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 4rem;
}
.logo { display: flex; align-items: center; gap: .5rem; }
.logo-icon { font-size: 1.5rem; }
.logo-text { font-family: var(--font-serif); font-size: 1.25rem; font-weight: 700; color: var(--gold-light); }
.nav-desktop { display: none; gap: 2rem; }
.nav-desktop a { font-size: .875rem; color: var(--text-muted); transition: color .2s; }
.nav-desktop a:hover { color: var(--gold-light); }
@media (min-width: 768px) { .nav-desktop { display: flex; } .nav-mobile { display: none; } }
.header-actions { display: flex; align-items: center; gap: .75rem; }
.icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem; border-radius: 9999px;
  border: 1px solid var(--border); color: var(--text-muted);
  background: transparent; cursor: pointer; transition: .2s;
}
.icon-btn:hover { border-color: var(--gold); color: var(--gold-light); }
.btn-login {
  display: none; align-items: center; gap: .375rem;
  padding: .5rem 1rem; border-radius: 9999px;
  border: 1px solid var(--gold); color: var(--gold); font-size: .875rem;
}
.btn-login:hover { background: var(--gold); color: var(--bg); }
@media (min-width: 768px) { .btn-login { display: inline-flex; } }

.user-menu { position: relative; display: none; }
@media (min-width: 768px) { .user-menu { display: block; } }
.user-menu__trigger {
  display: flex; align-items: center; gap: .5rem;
  padding: .375rem .75rem; border-radius: 9999px;
  border: 1px solid var(--border); background: transparent;
  color: var(--text-muted); cursor: pointer;
}
.user-avatar {
  width: 1.75rem; height: 1.75rem; border-radius: 9999px;
  background: var(--gold); color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700;
}
.user-name { font-size: .875rem; max-width: 6rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu__dropdown {
  position: absolute; right: 0; top: calc(100% + .5rem);
  width: 14rem; background: var(--bg-secondary);
  border: 1px solid var(--border); border-radius: .5rem;
  box-shadow: 0 10px 40px rgba(0,0,0,.4); overflow: hidden; z-index: 60;
}
.user-menu__dropdown a, .user-menu__dropdown button {
  display: block; width: 100%; text-align: left;
  padding: .625rem 1rem; font-size: .875rem;
  color: var(--text-muted); background: none; border: none; cursor: pointer;
}
.user-menu__dropdown a:hover, .user-menu__dropdown button:hover {
  background: var(--bg-card); color: var(--gold-light);
}
.user-menu__info { padding: .75rem 1rem; border-bottom: 1px solid var(--border); }
.user-menu__info .muted { font-size: .75rem; color: #5a6a82; margin-top: .125rem; }

.nav-mobile { position: relative; }
@media (min-width: 768px) { .nav-mobile { display: none !important; } }
.nav-mobile summary { list-style: none; }
.nav-mobile summary::-webkit-details-marker { display: none; }
.nav-mobile__panel {
  position: absolute; right: 0; top: calc(100% + .5rem);
  width: 12rem; background: var(--bg-secondary);
  border: 1px solid var(--border); border-radius: .5rem; padding: .5rem 0;
}
.nav-mobile__panel a, .nav-mobile__panel button {
  display: block; padding: .625rem 1rem; font-size: .875rem; color: var(--text-muted);
  background: none; border: none; width: 100%; text-align: left; cursor: pointer;
}
.nav-mobile__panel a:hover, .nav-mobile__panel button:hover { background: var(--bg-card); color: var(--gold-light); }
.nav-mobile__panel a.gold { color: var(--gold); }

.site-main { min-height: calc(100vh - 4rem); }
.site-footer {
  border-top: 1px solid var(--border);
  background: #0a0f1c; margin-top: 3rem;
}
.footer-grid {
  display: grid; gap: 2rem; padding: 3rem 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.footer-grid h4 { font-family: var(--font-serif); font-size: .875rem; color: var(--gold-light); margin-bottom: .75rem; }
.footer-grid ul { list-style: none; }
.footer-grid li { margin-bottom: .5rem; }
.footer-grid a { font-size: .875rem; color: var(--text-muted); }
.footer-grid a:hover { color: var(--gold-light); }
.footer-desc { margin-top: .75rem; font-size: .875rem; color: var(--text-muted); line-height: 1.7; }
.contact-list li { font-size: .875rem; color: var(--text-muted); }
.footer-bottom {
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
  padding: 1.5rem 1rem; border-top: 1px solid var(--border);
  font-size: .75rem; color: var(--text-muted);
}
@media (min-width: 640px) {
  .footer-bottom { flex-direction: row; justify-content: space-between; }
}
.footer-links { display: flex; gap: 1rem; }
.footer-links a:hover { color: var(--gold-light); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .75rem 1.5rem; border-radius: .5rem; font-size: .875rem;
  font-weight: 600; transition: .2s; cursor: pointer; border: none;
}
.btn-primary { background: var(--gold); color: var(--bg); }
.btn-primary:hover { background: var(--gold-light); }
.btn-outline {
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted);
}
.btn-outline:hover { border-color: rgba(201,168,76,.5); color: var(--gold-light); }
.btn-green { background: #16a34a; color: #fff; }
.btn-green:hover { background: #15803d; }
.btn-block { width: 100%; }

/* Hero */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--bg) 0%, #0f1a30 50%, var(--bg) 100%);
  padding: 5rem 0;
}
@media (min-width: 640px) { .hero { padding: 7rem 0; } }
.hero::before {
  content: ''; position: absolute; inset: 0; opacity: .2; pointer-events: none;
  background: radial-gradient(circle at 25% 25%, rgba(201,168,76,.1) 0%, transparent 50%),
              radial-gradient(circle at 75% 75%, rgba(74,111,165,.1) 0%, transparent 50%);
}
.hero-content { position: relative; max-width: 42rem; }
.badge-pill {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .375rem 1rem; border-radius: 9999px;
  border: 1px solid rgba(201,168,76,.3); background: rgba(201,168,76,.1);
  font-size: .75rem; color: var(--gold-light); margin-bottom: 1rem;
}
.badge-pill::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--gold);
}
.hero h1 {
  font-family: var(--font-serif); font-size: 2.25rem; font-weight: 700;
  line-height: 1.2; color: var(--text);
}
@media (min-width: 640px) { .hero h1 { font-size: 3rem; } }
.hero h1 .gold { color: var(--gold); }
.hero p { margin-top: 1.5rem; color: var(--text-muted); max-width: 32rem; }
.hero-actions { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 1rem; }

.trust-bar {
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  background: var(--bg-muted); padding: 1.5rem 0;
}
.trust-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem;
}
@media (min-width: 768px) { .trust-grid { grid-template-columns: repeat(4, 1fr); } }
.trust-item { display: flex; align-items: center; gap: .75rem; }
.trust-icon {
  width: 2.5rem; height: 2.5rem; border-radius: 50%;
  border: 1px solid rgba(201,168,76,.3); color: var(--gold);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.trust-item strong { display: block; font-size: .875rem; }
.trust-item span { font-size: .75rem; color: var(--text-muted); }

.section { padding: 4rem 0; }
.section-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 2rem;
}
.section-header h2 {
  font-family: var(--font-serif); font-size: 1.75rem; font-weight: 700;
}
.section-header p { margin-top: .5rem; font-size: .875rem; color: var(--text-muted); }

.product-grid {
  display: grid; gap: 1.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .product-grid.cols-4 { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1024px) { .product-grid.cols-3 { grid-template-columns: repeat(3, 1fr); } }

.product-card {
  display: block; border-radius: .75rem; overflow: hidden;
  border: 1px solid var(--border); background: var(--bg-card);
  transition: transform .3s, border-color .3s, box-shadow .3s;
}
.product-card:hover {
  transform: translateY(-2px);
  border-color: rgba(201,168,76,.5);
  box-shadow: 0 8px 24px rgba(201,168,76,.08);
}
.product-card__image {
  position: relative; aspect-ratio: 4/3; overflow: hidden; background: var(--bg-secondary);
}
.product-card__image img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s;
}
.product-card:hover .product-card__image img { transform: scale(1.05); }
.product-card__badge {
  position: absolute; top: .75rem; right: .75rem;
  background: var(--gold); color: var(--bg);
  font-size: .75rem; font-weight: 700; padding: .125rem .625rem; border-radius: 9999px;
}
.product-card__body { padding: 1rem; }
.product-card__title {
  font-family: var(--font-serif); font-size: 1rem; font-weight: 600;
}
.product-card:hover .product-card__title { color: var(--gold-light); }
.product-card__desc {
  margin-top: .375rem; font-size: .75rem; color: var(--text-muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-card__price { margin-top: .75rem; display: flex; align-items: baseline; gap: .5rem; }
.price-current { font-size: 1.125rem; font-weight: 700; color: var(--gold); }
.price-original { font-size: .75rem; color: var(--text-muted); text-decoration: line-through; }

.card {
  border-radius: .75rem; border: 1px solid var(--border);
  background: var(--bg-card); padding: 1.5rem;
}
.card-muted { background: var(--bg-muted); }
.card h2, .card h3 { font-family: var(--font-serif); color: var(--gold-light); }
.card h2 { font-size: 1.25rem; margin-bottom: 1rem; }

.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.stat-box {
  border-radius: .75rem; border: 1px solid var(--border);
  background: var(--bg-card); padding: 1.25rem; text-align: center;
}
.stat-box .num {
  font-family: var(--font-serif); font-size: 1.5rem; font-weight: 700; color: var(--gold);
}
.stat-box .label { margin-top: .25rem; font-size: .75rem; color: var(--text-muted); }

.promise-grid { display: grid; gap: 1.5rem; }
@media (min-width: 640px) { .promise-grid { grid-template-columns: repeat(3, 1fr); } }
.promise-card { padding: 1.5rem; border-radius: .75rem; border: 1px solid var(--border); background: var(--bg-card); }
.promise-card:hover { border-color: rgba(201,168,76,.3); }
.promise-card h3 { font-family: var(--font-serif); font-size: 1.125rem; color: var(--gold-light); }
.promise-card p { margin-top: .75rem; font-size: .875rem; color: var(--text-muted); line-height: 1.7; }
.promise-card a { margin-top: 1rem; display: inline-flex; align-items: center; gap: .25rem; font-size: .875rem; color: var(--gold); }

.page-header { padding: 2.5rem 0 0; }
.page-header h1 { font-family: var(--font-serif); font-size: 1.875rem; font-weight: 700; }
.page-header p { margin-top: .5rem; font-size: .875rem; color: var(--text-muted); }
.page-content { padding: 2rem 0 3rem; max-width: 56rem; margin: 0 auto; }

.breadcrumb {
  display: flex; align-items: center; gap: .5rem;
  font-size: .875rem; color: var(--text-muted); margin-bottom: 1.5rem; flex-wrap: wrap;
}
.breadcrumb a:hover { color: var(--gold-light); }

.category-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }
.category-tabs a, .category-tabs button {
  padding: .375rem 1rem; border-radius: 9999px; font-size: .875rem;
  border: 1px solid var(--border); background: transparent; color: var(--text-muted);
  cursor: pointer; transition: .2s;
}
.category-tabs a.active, .category-tabs button.active {
  background: var(--gold); color: var(--bg); border-color: var(--gold); font-weight: 600;
}
.category-tabs a:hover:not(.active) { border-color: rgba(201,168,76,.5); color: var(--gold-light); }

.product-detail { display: grid; gap: 2.5rem; }
@media (min-width: 1024px) { .product-detail { grid-template-columns: 1fr 1fr; } }
.product-detail__image {
  border-radius: .75rem; overflow: hidden; border: 1px solid var(--border);
  background: var(--bg-secondary);
}
.product-detail__image img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.tag { display: inline-flex; padding: .25rem .75rem; border-radius: 9999px; font-size: .75rem; background: rgba(201,168,76,.1); color: var(--gold); margin-bottom: .5rem; }
.product-detail h1 { font-family: var(--font-serif); font-size: 1.75rem; }
.price-lg { font-size: 1.875rem; font-weight: 700; color: var(--gold); }
.stock-ok { color: #4ade80; }
.stock-no { color: #f87171; }
.spec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: .75rem; }
.spec-grid span { font-size: .875rem; color: var(--text-muted); display: flex; align-items: center; gap: .5rem; }
.spec-grid span::before { content: ''; width: 4px; height: 4px; border-radius: 50%; background: var(--gold); }
.feature-list { list-style: none; margin-top: .75rem; }
.feature-list li {
  display: flex; gap: .5rem; font-size: .875rem; color: var(--text-muted); margin-bottom: .5rem;
}
.feature-list li::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold); margin-top: .5rem; flex-shrink: 0;
}
.action-row { display: flex; gap: .75rem; margin-top: 1.5rem; }
.action-row .btn { flex: 1; text-align: center; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .75rem; color: var(--text-muted); margin-bottom: .25rem; }
.form-input, .form-textarea {
  width: 100%; padding: .5rem .75rem; border-radius: .5rem;
  border: 1px solid var(--border); background: var(--bg-muted);
  color: var(--text);
}
.form-input:focus, .form-textarea:focus { outline: none; border-color: var(--gold); }
.form-input.error { border-color: #f87171; }
.form-error { font-size: .75rem; color: #f87171; margin-top: .25rem; }
.form-grid { display: grid; gap: 1rem; }
@media (min-width: 640px) { .form-grid.cols-2 { grid-template-columns: 1fr 1fr; } }

.alert {
  padding: .75rem 1rem; border-radius: .5rem; font-size: .875rem; margin-bottom: 1rem;
}
.alert-error { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3); color: #f87171; }
.alert-success { background: rgba(74,222,128,.1); border: 1px solid rgba(74,222,128,.3); color: #4ade80; }

.cart-item {
  display: flex; gap: 1rem; padding: 1rem;
  border-radius: .75rem; border: 1px solid var(--border); background: var(--bg-card);
}
.cart-item img { width: 5rem; height: 5rem; object-fit: cover; border-radius: .5rem; }
.qty-control { display: flex; align-items: center; gap: .5rem; }
.qty-control button {
  width: 1.75rem; height: 1.75rem; border-radius: .25rem;
  border: 1px solid var(--border); background: transparent; color: var(--text-muted); cursor: pointer;
}
.qty-control button:hover { border-color: var(--gold); color: var(--gold-light); }

.steps { display: flex; align-items: center; justify-content: center; gap: .5rem; margin-bottom: 2rem; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: .375rem; font-size: .75rem; }
.step-num {
  width: 1.5rem; height: 1.5rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700;
}
.step.active .step-num { background: var(--gold); color: var(--bg); }
.step:not(.active) .step-num { border: 1px solid var(--border); color: var(--text-muted); }
.step.active span { color: var(--gold); }
.step-line { width: 2rem; height: 1px; background: var(--border); }

.status-badge {
  display: inline-block; padding: .125rem .5rem; border-radius: .25rem;
  font-size: .75rem; border: 1px solid;
}
.status-pending { color: #facc15; background: rgba(250,204,21,.1); border-color: rgba(250,204,21,.3); }
.status-paid { color: #4ade80; background: rgba(74,222,128,.1); border-color: rgba(74,222,128,.3); }
.status-failed { color: #f87171; background: rgba(248,113,113,.1); border-color: rgba(248,113,113,.3); }

.login-page {
  min-height: calc(100vh - 4rem);
  display: flex; align-items: center; justify-content: center;
  padding: 3rem 1rem;
}
.login-card {
  width: 100%; max-width: 28rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 1rem; padding: 2rem;
}
.tabs { display: flex; background: var(--bg); border-radius: .5rem; padding: .25rem; margin-bottom: 1.5rem; }
.tabs a, .tabs button {
  flex: 1; text-align: center; padding: .625rem; font-size: .875rem;
  border-radius: .375rem; border: none; background: transparent; color: var(--text-muted); cursor: pointer;
}
.tabs a.active { background: var(--gold); color: var(--bg); font-weight: 600; }

.empty-state { text-align: center; padding: 5rem 1rem; color: var(--text-muted); }
.cta-section {
  text-align: center; padding: 4rem 0;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg), var(--bg-muted));
}
.cta-section h2 { font-family: var(--font-serif); font-size: 1.75rem; }
.cta-section p { margin-top: 1rem; color: var(--text-muted); }
.cta-actions { margin-top: 2rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; }

.pay-overlay { text-align: center; padding: 4rem 0; }
.pay-spinner {
  width: 5rem; height: 5rem; margin: 0 auto 1.5rem;
  border: 2px solid transparent; border-top-color: #22c55e;
  border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.row-between { display: flex; justify-content: space-between; gap: 1rem; font-size: .875rem; }
.row-between + .row-between { margin-top: .5rem; }
.divider { border-top: 1px solid var(--border); margin: 1rem 0; padding-top: 1rem; }

#return { scroll-margin-top: 5rem; }
#privacy { scroll-margin-top: 5rem; }
