/* ==========================================================================
   Celestial BaZi — 主样式
   暗金神秘夜风 · 多端自适应 · 移动优先
   ========================================================================== */

/* ==========================================================================
   布局容器
   ========================================================================== */

.cbz-container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--sp-5);
}

.section {
  padding-block: var(--sp-8);
}

.section--alt {
  background: var(--bg-elevated);
}

.section-head {
  text-align: center;
  max-width: 720px;
  margin-inline: auto;
  margin-bottom: var(--sp-7);
}

.section-head .kicker {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--accent-primary);
  margin-bottom: var(--sp-3);
}

.section-head h2 {
  font-size: var(--text-3xl);
  margin-bottom: var(--sp-4);
}

.section-head p {
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

/* ==========================================================================
   按钮（Component）
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 48px;              /* 触控目标 >= 44px */
  padding: var(--sp-3) var(--sp-6);
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--ease), background var(--ease), border-color var(--ease), box-shadow var(--ease), color var(--ease);
}

.btn:hover {
  transform: translateY(-2px);
  text-decoration: none;
  color: var(--text-primary);
  box-shadow: var(--shadow-glow);
}

.btn--primary {
  background: var(--accent-primary);
  color: var(--c-night);
  border-color: var(--accent-primary);
}
.btn--primary:hover { color: var(--c-night); box-shadow: var(--shadow-glow); }

.btn--ghost {
  border-color: var(--border-subtle);
}
.btn--ghost:hover { border-color: var(--accent-primary); }

.btn--large { padding: var(--sp-4) var(--sp-8); font-size: var(--text-lg); }

.btn--block { width: 100%; }

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(10, 9, 20, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
  height: 100%;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  text-decoration: none;
  color: var(--text-primary);
  min-height: 44px;
}
.site-brand:hover { text-decoration: none; color: var(--text-primary); }

.site-brand__logo {
  width: 36px;
  height: 36px;
  color: var(--accent-primary);
  animation: cbzSpin 60s linear infinite;
}

.site-brand__logo svg {
  width: 36px;
  height: 36px;
  display: block;
}

.site-brand__text { display: flex; flex-direction: column; }

.site-brand__name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.site-brand__name small {
  display: block;
  font-family: var(--font-body);
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

@keyframes cbzSpin {
  to { transform: rotate(360deg); }
}

/* 主导航 */
.main-nav { display: flex; align-items: center; }

.main-nav ul {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: var(--sp-2) var(--sp-4);
  color: var(--text-primary);
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.main-nav a:hover,
.main-nav .current-menu-item > a,
.main-nav .current_page_item > a {
  color: var(--accent-primary);
  background: var(--gold-soft, rgba(211, 171, 102, 0.1));
}

/* 语言切换器 */
.lang-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.lang-switch__toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 44px;
  padding: var(--sp-2) var(--sp-3);
  background: none;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: var(--text-sm);
  cursor: pointer;
  font-family: var(--font-body);
  transition: border-color var(--transition-fast);
}

.lang-switch__toggle:hover { border-color: var(--accent-primary); }
.lang-switch__toggle .globe { font-size: 1rem; }

.lang-switch__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 150px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: var(--sp-2);
  display: none;
  z-index: 50;
}

.lang-switch.is-open .lang-switch__menu { display: block; }

.lang-switch__menu a {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: var(--text-sm);
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.lang-switch__menu a:hover,
.lang-switch__menu a.is-active {
  background: var(--gold-soft, rgba(211, 171, 102, 0.12));
  color: var(--accent-primary);
}

.lang-switch__menu .flag { font-size: 1.05rem; line-height: 1; }

/* 移动端导航开关 */
.nav-toggle {
  display: none;
  min-width: 44px;
  min-height: 44px;
  padding: var(--sp-2);
  background: none;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-primary);
  align-items: center;
  justify-content: center;
}

.nav-toggle .bar {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform var(--ease), opacity var(--ease);
}
.nav-toggle .bar + .bar { margin-top: 5px; }
.nav-toggle.is-active .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-active .bar:nth-child(2) { opacity: 0; }
.nav-toggle.is-active .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================================
   Hero（首页开场）
   ========================================================================== */

.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}

.hero__canvas {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero__compass {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(70vmin, 560px);
  height: min(70vmin, 560px);
  transform: translate(-50%, -50%);
  opacity: 0.4;
  z-index: -1;
  animation: cbzSpin 120s linear infinite;
}

.hero__compass .ring { fill: none; stroke: rgba(211, 171, 102, 0.35); stroke-width: 1; }
.hero__compass .tick { stroke: rgba(239, 232, 216, 0.22); stroke-width: 1; }

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(10, 9, 16, 0.55) 0%, rgba(10, 9, 16, 0.2) 40%, rgba(10, 9, 16, 0.88) 100%);
  pointer-events: none;
}

.hero__inner {
  width: 100%;
  text-align: center;
  padding-block: var(--sp-8);
}

.hero .kicker {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--accent-primary);
  margin-bottom: var(--sp-5);
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  margin-bottom: var(--sp-5);
  text-shadow: 0 2px 30px rgba(10, 9, 16, 0.85);
}

.hero__sub {
  max-width: 640px;
  margin-inline: auto;
  margin-bottom: var(--sp-7);
  color: var(--text-secondary);
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-4);
}

.hero__seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-inline: var(--sp-2);
  border: 1px solid var(--c-cinnabar);
  background: var(--cinnabar-soft);
  color: #e6b0a2;
  font-size: 1.1rem;
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 0 2px rgba(196, 69, 47, 0.08);
  vertical-align: middle;
}

/* ==========================================================================
   产品卡
   ========================================================================== */

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--sp-6);
}

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--sp-7) var(--sp-6);
  overflow: hidden;
  transition: transform var(--ease), border-color var(--ease), box-shadow var(--ease);
}

.product-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
  opacity: 0.6;
}

.product-card:hover {
  transform: translateY(-6px);
  border-color: rgba(211, 171, 102, 0.45);
  box-shadow: var(--shadow-card);
}

.product-card__badge {
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-4);
  padding: var(--sp-1) var(--sp-3);
  border: 1px solid var(--c-cinnabar);
  border-radius: 999px;
  color: #e6b0a2;
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
}

.product-card__icon {
  width: 64px;
  height: 64px;
  margin-bottom: var(--sp-5);
  color: var(--accent-primary);
}

.product-card h3 {
  font-size: var(--text-2xl);
  margin-bottom: var(--sp-3);
}

.product-card .excerpt {
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--sp-5);
  flex-grow: 1;
}

.product-card ul.features {
  list-style: none;
  margin: 0 0 var(--sp-6);
  padding: 0;
}

.product-card ul.features li {
  position: relative;
  padding: var(--sp-2) 0 var(--sp-2) var(--sp-6);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.product-card ul.features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15px;
  width: 9px;
  height: 9px;
  border-left: 2px solid var(--accent-success);
  border-bottom: 2px solid var(--accent-success);
  transform: rotate(-45deg);
}

.product-card .price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--sp-5);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border-subtle);
}

.product-card .price {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  color: var(--accent-primary);
}

.product-card .price .woocommerce-Price-currencySymbol { font-size: 0.6em; vertical-align: super; }

/* ==========================================================================
   WooCommerce 通用覆盖
   ========================================================================== */

.woocommerce .button,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: var(--sp-3) var(--sp-6);
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-md);
  background: var(--accent-primary);
  color: var(--c-night);
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--ease), box-shadow var(--ease), background var(--ease);
}
.woocommerce .button:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover {
  background: var(--accent-primary);
  color: var(--c-night);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.woocommerce .price { color: var(--accent-primary); font-family: var(--font-display); }

.woocommerce-breadcrumb { color: var(--text-secondary); font-size: var(--text-sm); margin-bottom: var(--sp-5); }
.woocommerce-breadcrumb a { color: var(--text-secondary); }
.woocommerce-breadcrumb a:hover { color: var(--accent-primary); }

.woocommerce-notices-wrapper .woocommerce-message,
.woocommerce-notices-wrapper .woocommerce-info {
  background: var(--bg-surface);
  border-top: 3px solid var(--accent-success);
  color: var(--text-primary);
}

/* 数量与购物车微调 */
.woocommerce .quantity .qty {
  min-height: 48px;
  padding: var(--sp-2) var(--sp-3);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}

/* ==========================================================================
   内容页 / 博客
   ========================================================================== */

.page-hero {
  padding-block: var(--sp-8) var(--sp-6);
  text-align: center;
  border-bottom: 1px solid var(--border-subtle);
}

.page-hero h1 { font-size: var(--text-4xl); margin-bottom: var(--sp-3); }
.page-hero .sub { color: var(--text-secondary); max-width: 640px; margin-inline: auto; }

.entry-content {
  max-width: 760px;
  margin-inline: auto;
  line-height: var(--leading-relaxed);
  color: var(--text-primary);
}

.entry-content h2 { font-size: var(--text-2xl); margin-top: var(--sp-7); }
.entry-content h3 { font-size: var(--text-xl); margin-top: var(--sp-6); }
.entry-content a { text-decoration: underline; text-underline-offset: 3px; }

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--sp-6);
}

.post-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--ease), border-color var(--ease), box-shadow var(--ease);
}
.post-card:hover { transform: translateY(-4px); border-color: rgba(211, 171, 102, 0.4); box-shadow: var(--shadow-card); }
.post-card__body { padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-3); flex-grow: 1; }
.post-card h2 { font-size: var(--text-xl); margin: 0; }
.post-card h2 a { color: var(--text-primary); }
.post-card h2 a:hover { color: var(--accent-primary); }
.post-card .meta { font-size: var(--text-xs); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.12em; }
.post-card .excerpt { color: var(--text-secondary); font-size: var(--text-sm); line-height: var(--leading-relaxed); flex-grow: 1; }

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  gap: var(--sp-2);
  margin-top: var(--sp-7);
}
.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: var(--sp-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  text-decoration: none;
}
.pagination .page-numbers.current { background: var(--accent-primary); color: var(--c-night); border-color: var(--accent-primary); }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--sp-8);
  margin-top: var(--sp-8);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.4fr;
  gap: var(--sp-7);
  padding-bottom: var(--sp-7);
}

.site-footer h3 { font-size: var(--text-lg); margin-bottom: var(--sp-4); }

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-footer li { margin-bottom: var(--sp-3); }
.site-footer a { color: var(--text-secondary); font-size: var(--text-sm); }
.site-footer a:hover { color: var(--accent-primary); }

.site-footer__about { color: var(--text-secondary); font-size: var(--text-sm); line-height: var(--leading-relaxed); }
.site-footer__about p { margin-bottom: var(--sp-4); }

.site-footer__bottom {
  border-top: 1px solid var(--border-subtle);
  padding-block: var(--sp-5);
  text-align: center;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
}

/* 订阅表单（footer 邮件订阅） */
.subscribe-form {
  display: flex;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
}
.subscribe-form input[type="email"] {
  flex: 1;
  min-height: 48px;
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
}
.subscribe-form input[type="email"]::placeholder { color: var(--text-secondary); }

/* ==========================================================================
   表单（WooCommerce 结账 / 联系）
   ========================================================================== */

input[type="text"], input[type="email"], input[type="tel"], input[type="number"],
input[type="password"], select, textarea {
  width: 100%;
  min-height: 48px;
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  transition: border-color var(--transition-fast);
}
input:focus, select:focus, textarea:focus { border-color: var(--accent-primary); outline: none; }

.woocommerce form .form-row label { color: var(--text-primary); font-size: var(--text-sm); margin-bottom: var(--sp-2); }
.woocommerce form .form-row { margin-bottom: var(--sp-4); }
.woocommerce form .form-row .required { color: var(--c-cinnabar); }

/* 结账与购物车容器 */
.woocommerce .cart-collaterals,
.woocommerce-page .cart-collaterals { display: block; }

.woocommerce table.shop_table {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  border-collapse: separate;
  background: var(--bg-surface);
}
.woocommerce table.shop_table th, .woocommerce table.shop_table td { border-color: var(--border-subtle); color: var(--text-primary); }
.woocommerce table.shop_table tfoot th, .woocommerce table.shop_table tfoot td { color: var(--text-primary); }

.woocommerce #payment {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
.woocommerce #payment div.payment_box { background: var(--bg-elevated); color: var(--text-primary); }
.woocommerce #payment div.payment_box::before { border-bottom-color: var(--bg-elevated); }

/* ==========================================================================
   响应式（移动优先断点）
   ========================================================================== */

@media (max-width: 1024px) {
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 820px) {
  :root { --header-h: 64px; }

  .nav-toggle { display: inline-flex; }

  .main-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: rgba(10, 9, 20, 0.97);
    border-bottom: 1px solid var(--border-subtle);
    padding: var(--sp-4);
    transform: translateY(-120%);
    transition: transform var(--ease);
    visibility: hidden;
  }
  .main-nav.is-open {
    transform: translateY(0);
    visibility: visible;
  }
  .main-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: var(--sp-2);
  }
  .main-nav a { justify-content: center; font-size: var(--text-base); }

  .lang-switch__menu { position: static; margin-top: var(--sp-3); }
  .lang-switch__menu { display: none; }
  .lang-switch.is-open .lang-switch__menu { display: block; }
  .lang-switch__menu a { justify-content: center; }

  .section { padding-block: var(--sp-7); }
  .hero { min-height: 88vh; }

  .hero__actions .btn { width: 100%; max-width: 360px; }
}

@media (max-width: 520px) {
  .site-footer__grid { grid-template-columns: 1fr; gap: var(--sp-6); }
  .products-grid { grid-template-columns: 1fr; }
  .post-grid { grid-template-columns: 1fr; }
  .section-head h2 { font-size: var(--text-2xl); }
  .hero h1 { font-size: 2.1rem; }
}
