/* ==================== 小算师 Global Styles ==================== */

:root {
  --bg: #0a0a0f;
  --bg-card: #141428;
  --bg-card-hover: #1a1a38;
  --text: #e8e0cc;
  --text-dim: #8a8578;
  --red: #c41e3a;
  --red-light: #e84040;
  --gold: #c9a96e;
  --gold-light: #d4b878;
  --border: #2a2a3a;
  --border-light: #3a3a4a;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  --radius: 12px;
  --radius-sm: 8px;
  --font-heading: 'Georgia', 'Times New Roman', serif;
  --font-body: 'Segoe UI', 'Inter', system-ui, -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Background constellation — Eastern mysterious sky */
.bg-constellation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(circle at 15% 25%, rgba(201, 169, 110, 0.18) 0%, transparent 28%),
    radial-gradient(circle at 85% 20%, rgba(196, 30, 58, 0.12) 0%, transparent 32%),
    radial-gradient(circle at 50% 80%, rgba(201, 169, 110, 0.10) 0%, transparent 40%),
    radial-gradient(circle at 75% 70%, rgba(196, 30, 58, 0.08) 0%, transparent 35%);
}

.bg-constellation::before,
.bg-constellation::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  animation: float 18s ease-in-out infinite;
}
.bg-constellation::before {
  width: 500px; height: 500px;
  top: -10%; left: -10%;
  background: radial-gradient(circle, rgba(201,169,110,0.18), transparent 70%);
}
.bg-constellation::after {
  width: 600px; height: 600px;
  bottom: -15%; right: -10%;
  background: radial-gradient(circle, rgba(196,30,58,0.14), transparent 70%);
  animation-delay: -9s;
}

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(30px) scale(1.05); }
}

/* Bagua symbol background — subtle decorative texture */
.bg-bagua {
  position: fixed;
  top: -15%;
  right: -15%;
  width: 65vw;
  height: 65vw;
  max-width: 900px;
  max-height: 900px;
  pointer-events: none;
  z-index: -1;
  opacity: 0.06;
  animation: slow-rotate 180s linear infinite;
}
.bg-bagua svg { width: 100%; height: 100%; }

@keyframes slow-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Subtle vignette overlay */
body::after {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at center, transparent 30%, rgba(5,5,8,0.75) 100%);
  pointer-events: none;
  z-index: 0;
}

/* Background ornament (kept for compatibility with other pages) */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(196, 30, 58, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(201, 169, 110, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(100, 100, 180, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ==================== Layout ==================== */

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

/* ==================== Header ==================== */

.mystic-header {
  padding: 24px 0;
  border-bottom: 1px solid rgba(201, 169, 110, 0.15);
  position: relative;
  z-index: 10;
  background: linear-gradient(180deg, rgba(10,10,15,0.95) 0%, rgba(10,10,15,0.65) 70%, transparent 100%);
  backdrop-filter: blur(8px);
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--gold);
  text-decoration: none;
  letter-spacing: 2px;
  text-shadow: 0 0 20px rgba(201, 169, 110, 0.25);
}

.logo-mark {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(201, 169, 110, 0.4);
  border-radius: 50%;
  font-size: 1.4rem;
  color: var(--gold);
  background: radial-gradient(circle, rgba(201,169,110,0.1), transparent 70%);
  box-shadow: 0 0 16px rgba(201,169,110,0.15);
  animation: breathe 4s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { box-shadow: 0 0 12px rgba(201,169,110,0.15); }
  50% { box-shadow: 0 0 24px rgba(201,169,110,0.3); }
}

.logo-text span { color: var(--red); }

nav {
  display: flex;
  gap: 28px;
  align-items: center;
}

nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.95rem;
  transition: all 0.25s;
  position: relative;
  padding: 4px 0;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), var(--red));
  transition: width 0.25s;
}

nav a:hover { color: var(--gold); }
nav a:hover::after { width: 100%; }

nav a.active { color: var(--red-light); }

/* Language Toggle */
.lang-toggle {
  background: var(--bg-card);
  color: var(--gold);
  border: 1px solid var(--gold);
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 1px;
  transition: all 0.2s;
  font-family: var(--font-body);
  margin-left: 4px;
}
.lang-toggle:hover {
  background: var(--gold);
  color: var(--bg);
}

/* ==================== Auth Nav ==================== */

.nav-login-btn {
  color: var(--gold) !important;
  border: 1px solid var(--gold);
  padding: 6px 18px !important;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.85rem !important;
  transition: all 0.2s;
  text-decoration: none;
}
.nav-login-btn:hover {
  background: var(--gold);
  color: var(--bg) !important;
}
.nav-login-btn::after { display: none !important; }

.nav-user-menu { position: relative; }
.nav-user-btn {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text); padding: 6px 14px; border-radius: 20px;
  cursor: pointer; font-size: 0.85rem; font-family: var(--font-body);
  transition: all 0.2s;
}
.nav-user-btn:hover { border-color: var(--gold); }
.nav-user-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #b8922e);
  color: #0a0a0f; display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700;
}
.nav-user-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-user-arrow { font-size: 0.6rem; color: var(--text-dim); }

.nav-user-dropdown {
  position: absolute; top: 100%; right: 0; margin-top: 8px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; min-width: 180px; padding: 8px 0;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5); z-index: 100;
  animation: fadeInDown 0.2s ease;
}
.nav-user-dropdown a {
  display: block; padding: 10px 18px; color: var(--text);
  text-decoration: none; font-size: 0.9rem; transition: all 0.15s;
  white-space: nowrap;
}
.nav-user-dropdown a:hover { background: rgba(201,169,110,0.1); color: var(--gold); }
.nav-user-dropdown a::after { display: none !important; }
.nav-user-dropdown hr { border: none; border-top: 1px solid var(--border); margin: 4px 0; }

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ==================== Hero ==================== */

.hero {
  text-align: center;
  padding: 100px 20px 70px;
  position: relative;
}

.hero-eyebrow {
  display: inline-block;
  padding: 8px 24px;
  border: 1px solid rgba(201, 169, 110, 0.35);
  border-radius: 50px;
  color: var(--gold);
  font-size: 0.85rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 28px;
  background: rgba(201, 169, 110, 0.06);
  backdrop-filter: blur(4px);
}

.hero h1 {
  font-family: var(--font-heading);
  color: var(--gold);
  letter-spacing: 4px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.hero-line {
  font-size: 4.5rem;
  font-weight: 700;
  text-shadow:
    0 0 20px rgba(201, 169, 110, 0.3),
    0 0 60px rgba(196, 30, 58, 0.15);
  line-height: 1.1;
}

.hero-line .red { color: var(--red-light); }

.hero-subline {
  font-size: 1.2rem;
  letter-spacing: 6px;
  color: var(--text-dim);
  font-weight: 300;
  text-transform: uppercase;
}

.hero .subtitle {
  font-size: 1.25rem;
  color: var(--text-dim);
  margin: 0 auto 40px;
  max-width: 620px;
  line-height: 1.8;
}

.hero-divider {
  width: 120px;
  height: 1px;
  margin: 0 auto;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  position: relative;
}
.hero-divider::before {
  content: '◆';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  color: var(--gold);
  font-size: 0.7rem;
  background: var(--bg);
  padding: 0 8px;
}

/* ==================== Feature Cards ==================== */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 32px;
  padding: 20px 0 80px;
}

.feature-card {
  background: rgba(20, 20, 40, 0.55);
  border: 1px solid rgba(201, 169, 110, 0.18);
  border-radius: 20px;
  padding: 44px 36px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  text-decoration: none;
  color: var(--text);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.feature-glow {
  position: absolute;
  top: 50%; left: 50%;
  width: 160px; height: 160px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(201,169,110,0.12), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.4;
  transition: opacity 0.3s;
}

.feature-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(201,169,110,0.3), rgba(196,30,58,0.15), transparent 60%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.6;
}

.feature-card:hover {
  transform: translateY(-8px) scale(1.01);
  border-color: rgba(201, 169, 110, 0.35);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(201, 169, 110, 0.1);
}

.feature-card:hover .feature-glow { opacity: 1; }
.feature-card:hover::before { opacity: 1; }

.feature-card .icon-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.feature-card .icon {
  width: 56px;
  height: 56px;
  color: var(--gold);
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
  flex-shrink: 0;
}

.feature-card .icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.feature-symbol {
  font-size: 2.8rem;
  color: rgba(201, 169, 110, 0.2);
  font-family: serif;
  line-height: 1;
  transition: color 0.3s;
}
.feature-card:hover .feature-symbol {
  color: rgba(201, 169, 110, 0.45);
}

.feature-card h3 {
  font-family: var(--font-heading);
  font-size: 1.7rem;
  color: var(--gold);
  margin-bottom: 12px;
  letter-spacing: 1px;
}

.feature-card p {
  color: var(--text-dim);
  font-size: 0.98rem;
  line-height: 1.75;
}

.feature-card .cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  padding: 12px 28px;
  border: 1px solid rgba(201, 169, 110, 0.5);
  border-radius: 50px;
  color: var(--gold);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 1px;
  transition: all 0.3s;
  background: rgba(201, 169, 110, 0.06);
  position: relative;
  z-index: 1;
}

.feature-card:hover .cta {
  background: linear-gradient(135deg, var(--gold), #b08d55);
  color: #1a0a0a;
  border-color: transparent;
  box-shadow: 0 4px 20px rgba(201, 169, 110, 0.3);
}

/* ==================== Bazi Page Styles ==================== */

.bazi-form {
  max-width: 500px;
  margin: 60px auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
}

.bazi-form h2 {
  font-family: var(--font-heading);
  color: var(--gold);
  text-align: center;
  margin-bottom: 8px;
  font-size: 1.6rem;
}

.bazi-form .form-subtitle {
  text-align: center;
  color: var(--text-dim);
  margin-bottom: 28px;
  font-size: 0.9rem;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

input, select {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font-body);
  transition: border-color 0.2s;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--gold);
}

.btn-primary {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--red), #a01a2e);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 1px;
  transition: all 0.2s;
  font-family: var(--font-body);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--red-light), var(--red));
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(196, 30, 58, 0.3);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  padding: 10px 28px;
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
}

.btn-secondary:hover {
  background: rgba(201, 169, 110, 0.1);
}

.btn-share {
  padding: 10px 20px;
  background: #25D366;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  cursor: pointer;
  margin: 4px;
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.85rem;
}

/* ==================== Result Panel ==================== */

.result-panel {
  max-width: 800px;
  margin: 0 auto 60px;
  display: none;
}

.result-panel.show { display: block; }

.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 20px;
}

.result-card h3 {
  font-family: var(--font-heading);
  color: var(--gold);
  font-size: 1.2rem;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* Eight Characters Display */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  text-align: center;
  margin-bottom: 24px;
}

.pillar {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 8px;
}

.pillar .label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.pillar .ganzhi {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: var(--gold);
  margin-bottom: 4px;
}

.pillar .pinyin {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.pillar .animal {
  font-size: 0.85rem;
  color: var(--red-light);
}

/* Day Master Card */
.day-master-card {
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-bottom: 20px;
}

.day-master-icon {
  font-size: 3rem;
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--red), var(--bg-card));
  border-radius: 50%;
  flex-shrink: 0;
}

.day-master-info h4 {
  color: var(--gold);
  font-family: var(--font-heading);
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.day-master-info p {
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* Element Bars */
.element-bars {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.element-bar {
  text-align: center;
}

.element-bar .bar-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.element-bar .bar {
  height: 120px;
  background: var(--bg);
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}

.element-bar .bar-fill {
  position: absolute;
  bottom: 0;
  width: 100%;
  border-radius: 6px;
  transition: height 0.8s ease;
}

.bar-fill.wood { background: linear-gradient(to top, #2d8a4e, #4caf50); }
.bar-fill.fire { background: linear-gradient(to top, #c41e3a, #ff5252); }
.bar-fill.earth { background: linear-gradient(to top, #8d6e3a, #b8953a); }
.bar-fill.metal { background: linear-gradient(to top, #888, #ccc); }
.bar-fill.water { background: linear-gradient(to top, #1a3a5c, #2980b9); }

.element-bar .bar-value {
  font-size: 0.8rem;
  color: var(--text);
  margin-top: 4px;
}

/* Analysis Sections */
.analysis-section {
  margin-bottom: 16px;
}

.analysis-section h4 {
  color: var(--gold);
  font-family: var(--font-heading);
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.analysis-section p {
  color: var(--text-dim);
  font-size: 0.92rem;
  line-height: 1.7;
}

/* Da Yun Table */
.da-yun-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.da-yun-table th {
  background: var(--bg);
  color: var(--text-dim);
  padding: 8px 12px;
  text-align: left;
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--border);
}

.da-yun-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.da-yun-table tr:hover td { background: rgba(201, 169, 110, 0.05); }

/* ==================== Feng Shui Page ==================== */

.upload-zone {
  max-width: 600px;
  margin: 60px auto;
  background: var(--bg-card);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 60px 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
}

.upload-zone:hover {
  border-color: var(--gold);
  background: var(--bg-card-hover);
}

.upload-zone .upload-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.upload-zone h3 {
  color: var(--gold);
  font-family: var(--font-heading);
  margin-bottom: 12px;
}

.upload-zone p {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.privacy-note {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 14px;
  background: rgba(201, 169, 110, 0.08);
  border: 1px solid rgba(201, 169, 110, 0.2);
  border-radius: 20px;
  color: var(--text-dim) !important;
  font-size: 0.78rem !important;
  line-height: 1.5;
}

.upload-zone.has-image {
  border-style: solid;
  border-color: var(--gold);
  padding: 20px;
}

.upload-zone img {
  max-width: 100%;
  max-height: 400px;
  border-radius: var(--radius-sm);
}

.room-type-selector {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 16px;
}

.room-type-btn {
  padding: 8px 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-dim);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
}

.room-type-btn:hover { border-color: var(--text-dim); }
.room-type-btn.selected {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

/* Analysis Issues */
.issue-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-bottom: 12px;
  display: flex;
  gap: 16px;
}

.issue-severity {
  width: 8px;
  border-radius: 4px;
  flex-shrink: 0;
}

.severity-high { background: var(--red); }
.severity-medium { background: var(--gold); }
.severity-low { background: #4caf50; }

.issue-content h4 {
  color: var(--text);
  margin-bottom: 6px;
  font-size: 1rem;
}

.issue-content .issue-location {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.issue-content .issue-impact {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.issue-content .issue-remedy {
  font-size: 0.9rem;
  color: #4caf50;
}

/* ==================== Loading ==================== */

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 10, 15, 0.9);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 100;
  flex-direction: column;
}

.loading-overlay.show { display: flex; }

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
  margin-top: 16px;
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* ==================== Referral / Lock Section (Bazi Card-style) ==================== */

.lock-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-top: 24px;
  text-align: center;
}

.lock-section h3 {
  color: var(--gold);
  font-family: var(--font-heading);
  margin-bottom: 12px;
}

/* Bazi Lock Card Grid */
.bazi-lock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

/* Individual Lock Card */
.bazi-lock-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 16px;
  position: relative;
  transition: all 0.3s ease;
  text-align: center;
  overflow: hidden;
}

.bazi-lock-card .card-preview {
  transition: filter 0.3s ease, opacity 0.3s ease;
}

.bazi-lock-card .card-icon {
  font-size: 2rem;
  margin-bottom: 8px;
  display: block;
}

.bazi-lock-card .card-preview h4 {
  color: var(--gold);
  font-size: 1.05rem;
  margin-bottom: 6px;
  font-family: var(--font-heading);
}

.bazi-lock-card .card-preview .card-snippet {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.5;
  min-height: 2.5em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Locked State — no blur, full content visible, bottom gradient fades the "精华" */
.bazi-lock-card.locked {
  cursor: pointer;
  max-height: 280px;
  overflow: hidden;
}

.bazi-lock-card.locked .card-preview {
  filter: none;
  opacity: 0.78;
}

.bazi-lock-card.locked .card-snippet {
  -webkit-line-clamp: unset;
  max-height: none;
  position: relative;
  padding-bottom: 20px;
}

.bazi-lock-card.locked .card-snippet::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3.5em;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
}

.bazi-lock-card.locked:hover {
  border-color: var(--gold);
  box-shadow: 0 0 24px rgba(201,169,110,0.18);
  transform: translateY(-3px);
}

.bazi-lock-card.locked:hover .card-preview {
  opacity: 0.92;
}

.bazi-lock-card.locked:active {
  transform: translateY(0);
}

/* Lock Overlay — bottom gradient, top content preview visible */
.bazi-lock-card .lock-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to bottom, transparent 0%, rgba(13,8,6,0.15) 35%, rgba(13,8,6,0.65) 65%, rgba(13,8,6,0.85) 100%);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 56px;
  z-index: 2;
  transition: background 0.2s;
  display: none;
}

.bazi-lock-card.locked .lock-overlay {
  display: flex;
}

.bazi-lock-card.locked:hover .lock-overlay {
  background: linear-gradient(to bottom, transparent 0%, rgba(13,8,6,0.05) 25%, rgba(13,8,6,0.55) 60%, rgba(13,8,6,0.8) 100%);
}

.bazi-lock-card .lock-overlay .lock-icon {
  font-size: 1.8rem;
  margin-bottom: 6px;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.4));
  animation: lockPulse 2s ease-in-out infinite;
}

@keyframes lockPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.bazi-lock-card .lock-overlay .lock-text {
  font-size: 0.9rem;
  color: var(--gold);
  text-align: center;
  line-height: 1.4;
  font-weight: 600;
  margin-bottom: 3px;
}

.bazi-lock-card .lock-overlay .lock-count {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.bazi-lock-card .lock-overlay .lock-btn {
  padding: 6px 16px;
  background: linear-gradient(135deg, var(--gold), #b08d55);
  color: #1a0a0a;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  pointer-events: none;
  letter-spacing: 0.5px;
}

/* Mini progress bar at card bottom */
.bazi-lock-card .lock-progress-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.bazi-lock-card.locked .lock-progress-mini {
  border-top-color: transparent;
}

.bazi-lock-card .lock-progress-mini .progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
}

.bazi-lock-card .lock-progress-mini .progress-bar .fill {
  height: 100%;
  background: var(--gold);
  border-radius: 2px;
  transition: width 0.5s ease;
}

.bazi-lock-card .lock-progress-mini span {
  font-size: 0.75rem;
  color: var(--text-dim);
  flex-shrink: 0;
}

/* Unlocked State */
.bazi-lock-card.unlocked {
  border-color: var(--gold);
  background: rgba(201, 169, 110, 0.05);
  cursor: default;
  max-height: none;
  overflow: visible;
}

.bazi-lock-card.unlocked .card-preview {
  filter: none;
  opacity: 1;
}

.bazi-lock-card.unlocked .lock-overlay {
  display: none;
}

.bazi-lock-card.unlocked .card-snippet {
  display: block;
  text-align: left;
  overflow-wrap: break-word;
  word-break: break-word;
  -webkit-line-clamp: unset;
  -webkit-box-orient: unset;
  overflow: visible;
  max-height: none;
}

.bazi-lock-card.unlocked .card-snippet strong,
.bazi-lock-card.unlocked .card-snippet span {
  max-width: 100%;
}

.bazi-lock-card.unlocked .card-icon {
  filter: drop-shadow(0 0 8px rgba(201,169,110,0.4));
}

/* Lock item (kept for backward compat, now unused but safe) */
.lock-item { display: none; }

.progress-bar {
  width: 100px;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar .fill {
  height: 100%;
  background: var(--gold);
  border-radius: 3px;
  transition: width 0.5s;
}

.share-link-box {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.share-link-box input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.85rem;
}

.share-link-box .btn-secondary {
  flex-shrink: 0;
  padding: 10px 20px;
}

.share-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
  flex-wrap: wrap;
}

.lock-item.unlocked {
  border-color: var(--gold);
  background: rgba(201, 169, 110, 0.08);
}

.lock-item.unlocked .lock-icon {
  filter: drop-shadow(0 0 6px rgba(201, 169, 110, 0.4));
}

/* ==================== Mobile Hamburger Menu ==================== */

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: 1px solid rgba(201,169,110,0.3);
  border-radius: 8px;
  cursor: pointer;
  padding: 8px;
  width: 40px;
  height: 40px;
  z-index: 1001;
  transition: border-color 0.2s;
}
.hamburger:hover { border-color: var(--gold); }
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--gold);
  border-radius: 1px;
  transition: all 0.3s ease;
}
.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile nav overlay */
nav.mobile-open {
  display: flex !important;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10,10,15,0.97);
  backdrop-filter: blur(16px);
  z-index: 1000;
  padding: 100px 32px 40px;
  gap: 28px;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
nav.mobile-open a {
  font-size: 1.15rem;
  color: var(--text);
}
nav.mobile-open a.active { color: var(--red-light); }
nav.mobile-open .lang-toggle {
  margin: 0;
  padding: 8px 28px;
  font-size: 0.95rem;
}
nav.mobile-open #navAuthSection {
  margin-top: 8px;
}

#unlockedContent .unlocked-section {
  animation: fadeInUp 0.5s ease;
}

/* ==================== Modal (for Bazi + FengShui) ==================== */

.modal {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal.show {
  opacity: 1;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 460px; width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  color: var(--gold);
  font-family: var(--font-heading);
  font-size: 1.15rem;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.modal-close:hover { color: var(--gold); }

.modal-body {
  padding: 20px;
  color: var(--text-dim);
  line-height: 1.6;
}

.modal-footer {
  display: flex;
  gap: 8px;
  padding: 12px 20px 20px;
  border-top: 1px solid var(--border);
}

/* Unlock Modal Tabs */
.unlock-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.unlock-tabs .tab-btn {
  flex: 1;
  padding: 12px 8px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.9rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.unlock-tabs .tab-btn:hover {
  color: var(--text-light);
}

.unlock-tabs .tab-btn.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
  font-weight: 600;
}

/* Paid unlock section in modal */
.pay-section {
  text-align: center;
}

.pay-section .pay-price-tag {
  display: inline-block;
  padding: 6px 20px;
  background: linear-gradient(135deg, var(--gold), #b08d55);
  color: #1a0a0a;
  border-radius: 24px;
  font-size: 1.3rem;
  font-weight: 700;
  margin: 8px 0 12px;
}

.pay-section .pay-link-btn {
  display: inline-block;
  padding: 10px 28px;
  background: linear-gradient(135deg, #4CAF50, #388E3C);
  color: #fff;
  border-radius: 24px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  margin: 8px 0 16px;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.pay-section .pay-link-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(76,175,80,0.3);
}

.pay-section .txn-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 10px;
  text-align: center;
}

.pay-section .txn-input:focus {
  outline: none;
  border-color: var(--gold);
  color: var(--text-light);
}

.pay-section .verify-btn {
  padding: 10px 28px;
  background: var(--gold);
  color: #1a0a0a;
  border: none;
  border-radius: 24px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.pay-section .verify-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.pay-section .verify-success {
  color: #4CAF50;
  font-size: 0.95rem;
  padding: 10px;
  animation: fadeInUp 0.4s ease;
}

/* PayPal button container in pay tab */
.pay-section #paypal-button-container,
.pay-section #fs-paypal-button-container {
  margin-top: 8px;
  margin-bottom: 8px;
}

/* ==================== How It Works Section ==================== */

.section-heading {
  text-align: center;
  color: var(--gold);
  font-family: var(--font-heading);
  font-size: 1.8rem;
  margin-bottom: 40px;
  letter-spacing: 1px;
}

/* ==================== GPT CTA Banner ==================== */

.gpt-banner {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 750px;
  margin: 48px auto 0;
  padding: 22px 28px;
  background: linear-gradient(135deg, rgba(16, 163, 127, 0.12) 0%, rgba(25, 195, 125, 0.06) 100%);
  border: 1px solid rgba(16, 163, 127, 0.25);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  position: relative;
  z-index: 1;
  overflow: hidden;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
}

.gpt-banner:hover {
  border-color: rgba(16, 163, 127, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(16, 163, 127, 0.15);
}

.gpt-banner-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(16, 163, 127, 0.15) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.gpt-banner-icon {
  font-size: 2.2rem;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0 8px rgba(16, 163, 127, 0.3));
}

.gpt-banner-body {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.gpt-banner-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #10a37f;
  margin-bottom: 4px;
  font-weight: 600;
}

.gpt-banner-title {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.gpt-banner-desc {
  display: block;
  font-size: 0.84rem;
  color: var(--text-dim);
}

.gpt-banner-arrow {
  font-size: 1.4rem;
  color: #10a37f;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  transition: transform 0.3s;
}

.gpt-banner:hover .gpt-banner-arrow {
  transform: translateX(4px);
}

@media (max-width: 768px) {
  .gpt-banner {
    margin: 36px 16px 0;
    padding: 18px 20px;
    gap: 14px;
  }
  .gpt-banner-icon { font-size: 1.8rem; }
  .gpt-banner-title { font-size: 1rem; }
  .gpt-banner-desc { font-size: 0.8rem; }
}

.how-it-works {
  padding: 60px 0 40px;
  position: relative;
  z-index: 1;
  border-top: 1px solid rgba(201, 169, 110, 0.08);
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  position: relative;
  transition: all 0.3s ease;
}

.step-card:hover {
  border-color: var(--gold);
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.step-card .step-number {
  position: absolute;
  top: -14px;
  left: 24px;
  font-family: var(--font-heading);
  font-size: 2.5rem;
  color: rgba(201, 169, 110, 0.12);
  font-weight: bold;
  line-height: 1;
  pointer-events: none;
}

.step-card .step-icon {
  font-size: 2.2rem;
  margin-bottom: 14px;
}

.step-card h3 {
  color: var(--gold-light);
  font-family: var(--font-heading);
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.step-card p {
  color: var(--text-dim);
  font-size: 0.88rem;
  line-height: 1.7;
}

/* ==================== Why XiaoSuanShi Section ==================== */

.why-us {
  padding: 40px 0 50px;
  position: relative;
  z-index: 1;
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.why-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  transition: all 0.3s ease;
}

.why-card:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

.why-card .why-icon {
  font-size: 2.4rem;
  margin-bottom: 12px;
}

.why-card h3 {
  color: var(--gold-light);
  font-family: var(--font-heading);
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.why-card p {
  color: var(--text-dim);
  font-size: 0.86rem;
  line-height: 1.7;
}

/* ==================== FAQ Section ==================== */

.faq {
  padding: 40px 0 60px;
  position: relative;
  z-index: 1;
  border-top: 1px solid rgba(201, 169, 110, 0.08);
}

.faq-list {
  max-width: 780px;
  margin: 0 auto;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.faq-item:hover {
  border-color: rgba(201, 169, 110, 0.25);
}

.faq-item summary {
  padding: 18px 24px;
  cursor: pointer;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '+';
  color: var(--gold);
  font-size: 1.3rem;
  font-weight: 300;
  flex-shrink: 0;
  margin-left: 16px;
  transition: transform 0.2s;
}

.faq-item[open] summary {
  border-bottom: 1px solid var(--border);
  color: var(--gold);
}

.faq-item[open] summary::after {
  content: '−';
  transform: rotate(180deg);
}

.faq-item p {
  padding: 18px 24px;
  color: var(--text-dim);
  font-size: 0.88rem;
  line-height: 1.8;
  margin: 0;
}

/* Responsive: collapse 3-col grids to 1-col on mobile */
@media (max-width: 768px) {
  .section-heading {
    font-size: 1.4rem;
    margin-bottom: 28px;
  }

  .steps-grid,
  .why-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .step-card,
  .why-card {
    padding: 24px 18px;
  }

  .step-card .step-number {
    font-size: 2rem;
    top: -10px;
  }

  .how-it-works { padding: 40px 0 24px; }
  .why-us { padding: 24px 0 32px; }
  .faq { padding: 24px 0 40px; }

  .faq-list { max-width: 100%; }
  .faq-item summary { padding: 14px 16px; font-size: 0.9rem; }
  .faq-item p { padding: 14px 16px; font-size: 0.84rem; }
}

/* ==================== Footer ==================== */

.mystic-footer {
  text-align: center;
  padding: 50px 20px 40px;
  border-top: 1px solid rgba(201, 169, 110, 0.12);
  color: var(--text-dim);
  font-size: 0.85rem;
  position: relative;
  background: linear-gradient(180deg, transparent, rgba(10,10,15,0.8));
}

.mystic-footer::before {
  content: '☯';
  display: block;
  font-size: 1.2rem;
  color: rgba(201, 169, 110, 0.25);
  margin-bottom: 12px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 14px;
}
.footer-links a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.88rem;
  transition: color 0.2s;
}
.footer-links a:hover {
  color: var(--accent-hover, #e0b84c);
  text-decoration: underline;
}

.footer-powered {
  margin: 12px auto 0;
  font-size: 0.75rem;
  color: var(--text-dim);
  opacity: 0.5;
  transition: opacity 0.2s;
}
.footer-powered:hover { opacity: 0.8; }
.footer-powered a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.footer-powered a:hover { text-decoration: underline; }

.footer-disclaimer {
  max-width: 650px;
  margin: 16px auto 0;
  font-size: 0.72rem;
  line-height: 1.6;
  color: var(--text-dim);
  opacity: 0.55;
}

@media (max-width: 768px) {
  .footer-disclaimer { font-size: 0.68rem; margin: 14px 8px 0; }
}

/* ==================== Toast ==================== */

.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 0.9rem;
  z-index: 200;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
}

/* ==================== Responsive — Mobile First ==================== */

/* Tablet Landscape (≤1024px) */
@media (max-width: 1024px) {
  .hero .hero-line { font-size: 3.2rem; }
  .container { padding: 0 24px; }
}

/* Tablet Portrait (≤768px) */
@media (max-width: 768px) {
  /* ---- Header ---- */
  .mystic-header { padding: 14px 0; }
  .container { padding: 0 16px; }
  .logo { font-size: 1.3rem; gap: 6px; }
  .logo-mark { width: 32px; height: 32px; font-size: 1rem; }

  /* Show hamburger, hide nav by default */
  .hamburger { display: flex; }
  .mystic-header nav { display: none; }
  .mystic-header nav.mobile-open { display: flex; }

  /* ---- Hero ---- */
  .hero { padding: 50px 16px 36px; }
  .hero-eyebrow { font-size: 0.7rem; letter-spacing: 2px; padding: 6px 14px; margin-bottom: 20px; }
  .hero .hero-line { font-size: 2.4rem; }
  .hero .hero-subline { font-size: 0.9rem; letter-spacing: 3px; }
  .hero .subtitle { font-size: 0.9rem; margin-bottom: 28px; padding: 0 8px; }

  /* ---- Feature Cards ---- */
  .features { grid-template-columns: 1fr; gap: 18px; padding: 10px 0 40px; }
  .feature-card { padding: 26px 22px; }
  .feature-card h3 { font-size: 1.35rem; }
  .feature-card .icon { width: 44px; height: 44px; }

  /* ---- Bazi Form ---- */
  .bazi-form { margin: 28px auto; padding: 22px 16px; }
  .bazi-form h2 { font-size: 1.25rem; }

  /* ---- Pillars ---- */
  .pillars-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .pillar { padding: 12px 6px; }
  .pillar .label { font-size: 0.7rem; letter-spacing: 1px; }
  .pillar .ganzhi { font-size: 1.3rem; }
  .pillar .pinyin { font-size: 0.72rem; }

  /* ---- Element Bars ---- */
  .element-bars { gap: 6px; }
  .element-bar .bar { height: 70px; }
  .element-bar .bar-label { font-size: 0.65rem; }
  .element-bar .bar-value { font-size: 0.7rem; }

  /* ---- Day Master ---- */
  .day-master-card { flex-direction: column; text-align: center; gap: 12px; }
  .day-master-icon { width: 56px; height: 56px; font-size: 2.2rem; }

  /* ---- Da Yun Table ---- */
  .result-card:has(.da-yun-table) { overflow-x: auto; }
  .da-yun-table { min-width: 500px; font-size: 0.78rem; }
  .da-yun-table th, .da-yun-table td { padding: 6px 8px; }

  /* ---- Result Panel ---- */
  .result-card { padding: 18px; margin-bottom: 14px; }
  .result-card h3 { font-size: 1.05rem; margin-bottom: 12px; }

  /* ---- Upload Zone ---- */
  .upload-zone { margin: 28px auto; padding: 28px 18px; }
  .upload-zone .upload-icon { font-size: 2.8rem; }
  .upload-zone h3 { font-size: 1.1rem; }
  .upload-zone.has-image { padding: 14px; }
  .upload-zone img { max-height: 260px; }

  /* ---- Room Type ---- */
  .room-type-selector { flex-direction: column; gap: 6px; }
  .room-type-btn { width: 100%; text-align: center; }

  /* ---- Positions Grid ---- */
  .positions-grid { grid-template-columns: 1fr !important; }

  /* ---- Issues ---- */
  .issue-card { flex-direction: column; gap: 10px; }
  .issue-severity { width: 100%; height: 4px; border-radius: 2px; }

  /* ---- Lock Cards (Bazi) ---- */
  .bazi-lock-grid { grid-template-columns: 1fr; gap: 10px; }
  .bazi-lock-card { padding: 16px 14px; }
  .bazi-lock-card.locked { max-height: 220px; }

  /* ---- Share Links ---- */
  .share-link-box { flex-direction: column; }
  .share-link-box .btn-secondary { width: 100%; }

  /* ---- Modal ---- */
  .modal-content { width: 94%; max-height: 88vh; border-radius: 14px; }
  .modal-header { padding: 14px 16px; }
  .modal-header h3 { font-size: 1.05rem; }
  .modal-body { padding: 16px; font-size: 0.9rem; }
  .modal-footer { padding: 10px 16px 14px; flex-wrap: wrap; }
  .unlock-tabs .tab-btn { font-size: 0.82rem; padding: 10px 6px; }

  /* ---- Toast ---- */
  .toast { width: 88%; max-width: 360px; text-align: center; font-size: 0.85rem; padding: 10px 18px; }

  /* ---- Footer ---- */
  .mystic-footer { padding: 32px 16px 24px; font-size: 0.78rem; }

  /* ---- Touch optimization ---- */
  input, select, textarea { font-size: 16px !important; } /* prevent iOS zoom */
  .btn-primary, .btn-secondary, .btn-share {
    min-height: 44px;
    font-size: 1rem;
  }
}

/* Phone (≤480px) */
@media (max-width: 480px) {
  .container { padding: 0 12px; }

  /* Header */
  .mystic-header { padding: 12px 0; }
  .logo { font-size: 1.15rem; gap: 4px; }
  .logo-mark { width: 28px; height: 28px; font-size: 0.85rem; }
  .hamburger { width: 36px; height: 36px; padding: 6px; }
  .hamburger span { width: 18px; }

  /* Hero */
  .hero { padding: 36px 12px 28px; }
  .hero .hero-line { font-size: 1.8rem; letter-spacing: 2px; }
  .hero .hero-subline { font-size: 0.78rem; letter-spacing: 2px; }
  .hero .subtitle { font-size: 0.8rem; line-height: 1.6; }

  /* Bazi Form */
  .bazi-form { margin: 20px auto; padding: 18px 12px; border-radius: 10px; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; gap: 8px; }
  .form-group { margin-bottom: 12px; }
  .form-group label { font-size: 0.75rem; }

  /* Pillars */
  .pillar { padding: 10px 4px; }
  .pillar .ganzhi { font-size: 1.15rem; }

  /* Element Bars */
  .element-bar .bar { height: 56px; }

  /* Upload */
  .upload-zone { padding: 22px 14px; border-radius: 10px; }
  .upload-zone img { max-height: 200px; }
  .privacy-note { font-size: 0.7rem !important; padding: 4px 10px; }

  /* Lock Cards */
  .bazi-lock-card .card-preview h4 { font-size: 0.95rem; }

  /* Modal */
  .modal-content { width: 96%; max-height: 92vh; border-radius: 12px; }
  .modal-footer { flex-direction: column; }
  .modal-footer .btn-primary, .modal-footer .btn-secondary { width: 100%; }
  .pay-section .pay-price-tag { font-size: 1.1rem; padding: 5px 16px; }

  /* Share buttons vertical */
  .share-buttons { flex-direction: column; }
  .share-buttons .btn-share { width: 100%; }

  /* Nav mobile */
  nav.mobile-open { padding: 80px 24px 32px; gap: 22px; }
  nav.mobile-open a { font-size: 1.05rem; }
}

/* Small Phone (≤360px) */
@media (max-width: 360px) {
  .hero .hero-line { font-size: 1.55rem; }
  .bazi-form { padding: 14px 10px; }
  .pillars-grid { gap: 6px; }
  .pillar .ganzhi { font-size: 1rem; }
  .element-bar .bar { height: 48px; }
  .upload-zone { padding: 18px 10px; }
}
