/* ═══════════════════════════════════════════════════════════════
   风水平台 — macOS 内容层 (macOS content layer)
   Loaded AFTER macos.css. Additive only: upgrades all inner-view
   content (cards, forms, results) to macOS glass + SHARP text.
   Rollback = delete the <link> in index.html.
   ═══════════════════════════════════════════════════════════════ */

/* ─── §6.1 Design tokens — content layer, extends --mac-* dialect ─── */
:root {
  /* Type scale (unified) */
  --mac-type-display: 30px; --mac-type-h1: 22px; --mac-type-h2: 17px;
  --mac-type-h3: 14px; --mac-type-body: 13px; --mac-type-caption: 11px;
  /* Spacing rhythm (4px base) */
  --mac-space-1: 4px; --mac-space-2: 8px; --mac-space-3: 12px;
  --mac-space-4: 16px; --mac-space-5: 24px; --mac-space-6: 32px;
  /* Content glass — one notch above chrome glass (card #221f36) */
  --mac-glass-2: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015)), #221f36;
  --mac-glass-3: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01)), rgba(15,15,20,0.6);
  --mac-card-sheen: inset 0 1px 0 rgba(255,255,255,0.055), inset 0 -1px 0 rgba(0,0,0,0.18);
  --mac-content-title: #c9a96e;               /* gold — section/card titles */
  --mac-gold-strong: rgba(201,169,110,0.24);  /* hover gold border */
  --mac-gold-glow: 0 0 0 3px rgba(201,169,110,0.18);
  --mac-field-bg: rgba(15,15,20,0.78);
  --mac-tag-bg: rgba(201,169,110,0.16);
  --mac-title-underline: linear-gradient(90deg, rgba(201,169,110,0.55), rgba(201,169,110,0));
}

/* ─── §6.2 Unified type scale + spacing rhythm ─── */
.main-content { padding: 28px 32px 48px; font-size: var(--mac-type-body); }
.card { padding: 20px; margin-bottom: 18px; }          /* macos.css keeps bg/border/sheen */
.card-title { font-size: 14px; font-weight: 600; color: var(--accent-gold);
  letter-spacing: .5px; margin-bottom: 14px; padding-bottom: 10px;
  border-bottom: 1px solid var(--mac-hairline); }      /* macOS section-divider feel */
.card-body { font-size: 13px; line-height: 1.6; color: var(--text-secondary); }
.section-title { font-size: var(--mac-type-h2); font-weight: 700; color: var(--accent-gold);
  letter-spacing: 1.5px; margin-bottom: 24px; padding-bottom: 12px;
  border-bottom: 1px solid var(--mac-border-soft); position: relative; }
.section-title::after { content: ''; position: absolute; left: 0; bottom: -1px;
  width: 48px; height: 2px; border-radius: 2px; background: var(--mac-title-underline); }
.section-desc { font-size: 13.5px; color: var(--text-secondary); line-height: 1.65;
  margin-bottom: 20px; max-width: 640px; }

/* ─── §6.3 Hero + quick actions ─── */
.hero { padding: 56px 20px 40px; }
.hero h1 { font-size: clamp(24px, 5vw, var(--mac-type-display)); font-weight: 800;
  color: var(--accent-gold); letter-spacing: 2px;
  text-shadow: 0 0 28px rgba(201,169,110,0.25); }
.hero p { font-size: 15px; color: var(--text-secondary); line-height: 1.7;
  max-width: 620px; }
.hero::after { content: ''; display: block; width: 56px; height: 2px; margin: 20px auto 0;
  border-radius: 2px; background: var(--mac-title-underline); opacity: .8; }
.quick-action-card { position: relative; overflow: hidden; padding: 22px 16px;
  border-radius: 12px; }
.quick-action-card .icon { font-size: 26px; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4)); }
.quick-action-card h3 { font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.quick-action-card p { font-size: 11px; color: var(--text-muted); line-height: 1.45; }
/* macOS sheen sweep on hover (macos.css already supplies gold border + lift) */
.quick-action-card::after { content: ''; position: absolute; top: 0; left: -80%;
  width: 50%; height: 100%; transform: skewX(-20deg);
  background: linear-gradient(105deg, transparent, rgba(255,255,255,0.06), transparent);
  transition: left .5s ease; pointer-events: none; }
.quick-action-card:hover::after { left: 130%; }

/* ─── §6.4 Forms (covers static + JS-injected forms) ─── */
.form-group { margin-bottom: 18px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--text-secondary);
  letter-spacing: .4px; margin-bottom: 6px; transition: color .15s ease; }
.form-group:focus-within label { color: var(--mac-content-title); }
.form-group input, .form-group select, .form-group textarea {
  padding: 10px 12px; border-radius: 8px; font-size: 13px;
  background: var(--mac-field-bg); color: var(--text-primary);
  border: 1px solid var(--mac-border-soft); box-shadow: var(--mac-inset-hi);
  transition: border-color .15s ease, box-shadow .15s ease; }
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-muted); }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--mac-content-title); box-shadow: var(--mac-gold-glow); }
.form-group select { appearance: none; padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23c9a96e' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.form-group textarea { min-height: 84px; }

/* ─── §6.5 Stat / advice / product / task cards + records ─── */
.stat-card { background: var(--mac-glass-2); border-radius: 12px;
  box-shadow: var(--mac-card-sheen); padding: 18px 12px; }
.stat-card .stat-value { font-size: 24px; font-weight: 700; color: var(--mac-content-title); }
.stat-card .stat-label { font-size: 11px; color: var(--text-secondary); } /* bumped from muted */
.stat-card .stat-sub { font-size: 11px; color: var(--text-muted); }
.advice-card { background: var(--mac-glass-2); border-radius: 12px;
  box-shadow: var(--mac-card-sheen); padding: 16px; }
.advice-card h4 { font-size: 13px; font-weight: 600; color: var(--mac-content-title);
  letter-spacing: .5px; }
.advice-card ul li { color: var(--text-secondary); font-size: 12.5px; line-height: 1.55; }
.product-grid { gap: 14px; }
.product-card { background: var(--mac-glass-3); border-radius: 10px;
  box-shadow: var(--mac-card-sheen); padding: 14px; }
.product-card:hover { border-color: var(--mac-gold-strong); transform: translateY(-1px);
  box-shadow: var(--mac-inset-hi), 0 8px 18px rgba(0,0,0,0.3); }
.product-card h5 { font-size: 12.5px; font-weight: 600; color: var(--text-primary); }
.product-card p { font-size: 11.5px; color: var(--text-secondary); line-height: 1.5; }
.task-grid { gap: 18px; }
.task-card { border-radius: 12px; padding: 16px; }
.task-card .task-title { font-size: 14px; font-weight: 600; color: var(--text-primary);
  letter-spacing: .3px; }
.task-card .task-meta { gap: 6px; }
.task-card .task-tag { font-size: 10px; padding: 3px 9px; border-radius: 20px;
  background: var(--mac-tag-bg); color: var(--mac-content-title);
  border: 1px solid rgba(201,169,110,0.2); }
.task-card .task-desc { font-size: 12px; color: var(--text-secondary); }
.task-card .task-footer { font-size: 11px; color: var(--text-secondary); } /* bumped from muted */

/* ─── §6.6 Bazi result cards (JS-injected; inline styles only set bar heights/hex) ─── */
.bazi-pillars { gap: 12px; margin: 16px 0; }
.pillar-card { position: relative; background: var(--mac-glass-3);
  border: 1px solid var(--mac-border-soft); border-radius: 12px;
  box-shadow: var(--mac-card-sheen); padding: 16px 10px; }
.pillar-card .label { font-size: 10px; letter-spacing: 1.5px; color: var(--text-secondary); } /* bumped */
.pillar-card .chars { font-size: 24px; font-weight: 700; color: var(--wu-xing-tu);
  letter-spacing: 3px; }
.pillar-card .sub { font-size: 11px; color: var(--text-secondary); line-height: 1.4; }
/* Day-pillar emphasis (日主) — 3rd pillar, gold ring */
.pillar-card:nth-child(3) { border-color: var(--mac-gold-strong);
  background: linear-gradient(180deg, rgba(201,169,110,0.10), rgba(201,169,110,0.02)), rgba(15,15,20,0.6);
  box-shadow: var(--mac-card-sheen), 0 0 18px rgba(201,169,110,0.12); }
.element-bars { gap: 10px; height: 104px; }
.element-bar { border-radius: 6px 6px 2px 2px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.14); }   /* glass bar; inline bg hex untouched */
.element-bar-value { font-size: 11px; color: var(--text-secondary); } /* bumped */
.element-bar-label { font-size: 11px; color: var(--text-secondary); }
.color-swatch { border: 2px solid var(--mac-border-soft);
  box-shadow: var(--mac-inset-hi), 0 4px 10px rgba(0,0,0,0.35); }
.color-swatch.avoid { opacity: .45; }

/* ─── §6.7 Flying-star grids (feixing, home preview, zwds/bazhai) ─── */
.flying-stars-grid { gap: 8px; }
.flying-stars-grid .cell { background: var(--mac-glass-3); border: 1px solid var(--mac-border-soft);
  border-radius: 10px; box-shadow: var(--mac-card-sheen); } /* legacy cell variant, defensive */
.flying-star-cell { background: var(--mac-glass-3); border: 1px solid var(--mac-border-soft);
  border-radius: 10px; box-shadow: var(--mac-card-sheen); padding: 8px 6px; min-height: 100px; }
.flying-star-cell .direction { font-size: 12px; font-weight: 600; color: var(--text-primary); }
.flying-star-cell .star-number { font-size: 26px; font-weight: 800; }
.flying-star-cell .star-name { font-size: 12.5px; color: var(--text-secondary); }
.flying-star-cell .fortune-label { font-size: 11px; }
/* re-glass fortune tints (same specificity as style.css, later file wins) */
.flying-star-cell.fortune-good { background: linear-gradient(180deg, rgba(90,159,124,0.10), rgba(90,159,124,0.03)); }
.flying-star-cell.fortune-bad  { background: linear-gradient(180deg, rgba(196,90,74,0.10),  rgba(196,90,74,0.03)); }
.flying-star-cell.fortune-great{ background: linear-gradient(180deg, rgba(201,169,110,0.14), rgba(201,169,110,0.04)); }
.flying-star-cell.center-cell { border-width: 1px; border-color: var(--mac-content-title);
  box-shadow: 0 0 20px rgba(201,169,110,0.16); }
.flying-stars-grid.xuan-kong-grid { gap: 4px; }  /* compact 玄空 overlay (bazhai-ui.js) */

/* ─── §6.8 Advice lists, info banner, empty state, badges, progress, tabs ─── */
.advice-list { gap: 0; }
.advice-item { background: linear-gradient(90deg, rgba(255,255,255,0.02), rgba(255,255,255,0)), rgba(15,15,20,0.5);
  border-left: 3px solid var(--border-color); border-radius: 0 10px 10px 0;
  padding: 10px 14px; margin-bottom: 8px; font-size: 12.5px; color: var(--text-secondary);
  line-height: 1.55; }
/* priority tints stay (style.css higher specificity on border-left-color) */
.info-banner { background: linear-gradient(90deg, rgba(201,169,110,0.10), rgba(201,169,110,0.04));
  border: 1px solid rgba(201,169,110,0.22); border-radius: 10px;
  box-shadow: var(--mac-inset-hi); padding: 14px 16px; margin-bottom: 18px; }
.info-banner .info-title { font-size: 13px; font-weight: 700; color: var(--mac-content-title);
  letter-spacing: .5px; }
.empty-state { padding: 40px 20px; border: 1px dashed var(--mac-border-soft);
  border-radius: 12px; background: rgba(255,255,255,0.015); }
.empty-state h3 { font-size: 15px; font-weight: 600; color: var(--text-secondary); }
.empty-state p { font-size: 12px; color: var(--text-muted); line-height: 1.6; }
.style-badge { background: var(--mac-tag-bg); border: 1px solid rgba(201,169,110,0.25);
  box-shadow: var(--mac-inset-hi); font-weight: 600; }
.progress-bar { background: rgba(15,15,20,0.6); border: 1px solid var(--mac-hairline);
  box-shadow: var(--mac-inset-hi); border-radius: 6px; height: 8px; }
.progress-bar-fill { border-radius: 6px; box-shadow: 0 0 10px rgba(201,169,110,0.25); }
.tab-bar { border-radius: 10px; gap: 4px; }
.tab-btn { font-size: 12px; font-weight: 500; letter-spacing: .3px; border-radius: 7px; }

/* ─── §6.9 Buttons, selection, scrollbar (accent pass) ─── */
.btn { border-radius: 9px; font-weight: 600; letter-spacing: .3px; }
.btn-sm { border-radius: 7px; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-danger { border: 1px solid rgba(196,90,74,0.3); }
::selection { background: rgba(201,169,110,0.3); }
:focus-visible { outline: 2px solid rgba(201,169,110,0.6); outline-offset: 2px; }
::-webkit-scrollbar-thumb { background: rgba(201,169,110,0.25); }
::-webkit-scrollbar-thumb:hover { background: rgba(201,169,110,0.4); }

/* ─── §6.10 Mobile ≤768px ─── */
@media (max-width: 768px) {
  .main-content { padding: 18px 14px 84px; }
  .hero { padding: 32px 12px 24px; }
  .hero h1 { font-size: 22px; }
  .hero p { font-size: 13.5px; }
  .quick-actions { gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .quick-action-card { padding: 16px 12px; }
  .section-title { font-size: 16px; margin-bottom: 18px; }
  .section-desc { font-size: 13px; }
  .card { padding: 14px; margin-bottom: 14px; }
  .card-title { font-size: 13.5px; }
  .form-group input, .form-group select, .form-group textarea { padding: 9px 11px; font-size: 16px; } /* ≥16px prevents iOS zoom */
  .bazi-pillars { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .pillar-card { padding: 12px 8px; }
  .pillar-card .chars { font-size: 20px; }
  .element-bars { height: 88px; }
  .flying-stars-grid { max-width: 280px; }
  .flying-star-cell { min-height: 84px; }
  .task-grid { grid-template-columns: 1fr; gap: 14px; }
  .advice-grid, .product-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .advice-card, .product-card { padding: 12px; }
  .stat-card { padding: 14px 10px; }
  .empty-state { padding: 28px 16px; }
}

/* ─── §6.11 Reduced motion ─── */
@media (prefers-reduced-motion: reduce) {
  .quick-action-card, .card, .task-card, .product-card, .advice-item,
  .form-group input, .form-group select, .form-group textarea { transition: none; }
  .quick-action-card::after { display: none; }
}
