:root {
    --font-serif: "Cinzel", "Noto Serif SC", "Songti SC", serif;
    --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Modern Imperial Palette */
    --bg-page: #fbf9f4;
    --bg-card: #ffffff;
    --bg-secondary: #f6f1e7;
    --bg-tertiary: #ede4d3;

    --text-main: #1c1917;
    --text-muted: #57534e;
    --text-light: #857e75;

    --imperial-red: #991b1b;
    --imperial-red-hover: #7f1d1d;
    --imperial-gold: #b45309;
    --imperial-gold-light: #fef3c7;
    --imperial-gold-border: #fcd34d;
    --gold-accent: #d97706;

    --border-warm: #e6dcce;
    --border-subtle: #f0e9df;

    /* Five Elements (五行) Imperial Tones */
    --wood-color: #15803d;
    --wood-bg: #f0fdf4;
    --wood-border: #bbf7d0;

    --fire-color: #b91c1c;
    --fire-bg: #fef2f2;
    --fire-border: #fecaca;

    --earth-color: #92400e;
    --earth-bg: #fefce8;
    --earth-border: #fde68a;

    --metal-color: #b45309;
    --metal-bg: #fffbeb;
    --metal-border: #fde68a;

    --water-color: #0369a1;
    --water-bg: #f0f9ff;
    --water-border: #bae6fd;
}

/* Midnight Obsidian (Dark Mode) Tokens */
[data-theme="dark"] {
    --bg-page: #111113;
    --bg-card: #18171b;
    --bg-secondary: #222026;
    --bg-tertiary: #2a2730;

    --text-main: #f5f5f4;
    --text-muted: #a8a29e;
    --text-light: #78716c;

    --imperial-red: #ef4444;
    --imperial-red-hover: #dc2626;
    --imperial-gold: #f59e0b;
    --imperial-gold-light: #3d2206;
    --imperial-gold-border: #78350f;
    --gold-accent: #fbbf24;

    --border-warm: #332f38;
    --border-subtle: #26232b;

    /* Five Elements Dark Mode Tones */
    --wood-color: #4ade80;
    --wood-bg: #052e16;
    --wood-border: #14532d;

    --fire-color: #f87171;
    --fire-bg: #450a0a;
    --fire-border: #7f1d1d;

    --earth-color: #fbbf24;
    --earth-bg: #38250c;
    --earth-border: #78350f;

    --metal-color: #fef08a;
    --metal-bg: #3a2e0a;
    --metal-border: #854d0e;

    --water-color: #38bdf8;
    --water-bg: #082f49;
    --water-border: #075985;
}

[data-theme="dark"] body {
    background-image: radial-gradient(#26242c 0.75px, transparent 0.75px), radial-gradient(#26242c 0.75px, var(--bg-page) 0.75px);
}

[data-theme="dark"] .profile-chip,
[data-theme="dark"] .today-insights-card,
[data-theme="dark"] .today-transit-banner,
[data-theme="dark"] .pillar-col,
[data-theme="dark"] .hidden-stems-list,
[data-theme="dark"] .edu-item,
[data-theme="dark"] .palace-card,
[data-theme="dark"] .shensha-card,
[data-theme="dark"] .shensha-card.star-present,
[data-theme="dark"] .qmdj-card,
[data-theme="dark"] .qmdj-info-strip,
[data-theme="dark"] .qmdj-palace-box,
[data-theme="dark"] .qmdj-palace-box.is-day-palace,
[data-theme="dark"] .elements-analysis-box,
[data-theme="dark"] .pentagram-visual-card,
[data-theme="dark"] .elem-stat-card,
[data-theme="dark"] .dayun-item-card,
[data-theme="dark"] .dayun-item-card.is-active-decade,
[data-theme="dark"] .micro-tooltip,
[data-theme="dark"] .dayun-ribbon-section,
[data-theme="dark"] .dayun-ribbon-item,
[data-theme="dark"] .liunian-card,
[data-theme="dark"] .liunian-card.is-selected,
[data-theme="dark"] .liuyue-card,
[data-theme="dark"] .library-card,
[data-theme="dark"] .library-search-input,
[data-theme="dark"] .lib-pill {
    background: var(--bg-card);
    border-color: var(--border-warm);
    color: var(--text-main);
}

[data-theme="dark"] .today-hero-summary,
[data-theme="dark"] .profile-banner,
[data-theme="dark"] .today-education-box,
[data-theme="dark"] .today-dynamics-strip,
[data-theme="dark"] .dayun-summary-strip,
[data-theme="dark"] .destiny-palace-card {
    background: var(--bg-secondary);
    border-color: var(--border-warm);
    color: var(--text-main);
}

/* Dark Mode Form Inputs & Controls */
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] select {
    background: var(--bg-secondary);
    border-color: var(--border-warm);
    color: var(--text-main);
    color-scheme: dark;
}

[data-theme="dark"] .gender-segmented-control,
[data-theme="dark"] .calendar-segmented-control {
    background: var(--bg-page);
    border-color: var(--border-warm);
}

[data-theme="dark"] .gender-tab input:checked + .tab-label {
    background: var(--bg-card);
    color: var(--imperial-red);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .cal-tab.is-active,
[data-theme="dark"] .cal-tab:has(input:checked) {
    background: var(--bg-card);
    color: var(--imperial-gold);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    border-color: var(--imperial-gold);
}

[data-theme="dark"] .advanced-settings-toggle {
    background: var(--bg-secondary);
    border-color: var(--border-warm);
}

[data-theme="dark"] .view-mode-bar,
[data-theme="dark"] .simple-superpowers-card {
    background: var(--bg-card);
    border-color: var(--border-warm);
}

[data-theme="dark"] .view-mode-btn {
    background: var(--bg-secondary);
    border-color: var(--border-warm);
    color: var(--text-main);
}

[data-theme="dark"] .view-mode-btn.is-active {
    background: var(--imperial-gold);
    color: #171412;
}

[data-theme="dark"] .cosmic-archetype-card {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.12) 0%, rgba(30, 24, 18, 0.6) 100%), var(--bg-card);
    border-color: var(--imperial-gold);
}

[data-theme="dark"] .archetype-box,
[data-theme="dark"] .simple-star-item {
    background: var(--bg-secondary);
    border-color: var(--border-warm);
}

[data-theme="dark"] .simple-cta-box {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12) 0%, rgba(20, 25, 45, 0.6) 100%), var(--bg-card);
    border-color: rgba(96, 165, 250, 0.4);
}

[data-theme="dark"] .btn-google-login,
[data-theme="dark"] .btn-user-avatar {
    background: var(--bg-secondary);
    border-color: var(--border-warm);
    color: var(--text-main);
}

[data-theme="dark"] .user-dropdown-panel {
    background: var(--bg-card);
    border-color: var(--border-warm);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .btn-dropdown-logout {
    background: var(--bg-secondary);
    border-color: var(--border-warm);
}

/* Dark Mode Transit Tags & Favorable / Mindful Boxes */
[data-theme="dark"] .guide-box.box-yi {
    background: #052e16;
    border-color: #14532d;
}
[data-theme="dark"] .guide-box.box-ji {
    background: #450a0a;
    border-color: #7f1d1d;
}
[data-theme="dark"] .edu-footer-tip {
    background: #38250c;
    border-color: #78350f;
    color: var(--gold-accent);
}
[data-theme="dark"] .tag-noble { background: #38250c; color: #fbbf24; border-color: #78350f; }
[data-theme="dark"] .tag-harmony { background: #052e16; color: #4ade80; border-color: #14532d; }
[data-theme="dark"] .tag-clash { background: #450a0a; color: #f87171; border-color: #7f1d1d; }
[data-theme="dark"] .tag-peach { background: #4a044e; color: #f472b6; border-color: #86198f; }
[data-theme="dark"] .tag-horse { background: #082f49; color: #38bdf8; border-color: #075985; }

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-page);
    background-image: radial-gradient(#ece3d2 0.75px, transparent 0.75px), radial-gradient(#ece3d2 0.75px, var(--bg-page) 0.75px);
    background-size: 30px 30px;
    background-position: 0 0, 15px 15px;
    color: var(--text-main);
    min-height: 100vh;
    padding: 2.5rem 1rem;
    display: flex;
    justify-content: center;
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

button, input, select, .nav-tab, .tab-btn, .cal-tab, .rel-type-tab {
    touch-action: manipulation;
}

.page-wrapper {
    width: 100%;
    max-width: 860px;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    position: relative;
}

/* Header & Traditional Seal */
.app-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    position: relative;
}

/* Header Controls Bar (Language & Theme) */
.header-controls {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.header-controls-right {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.lang-selector {
    display: inline-flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-warm);
    border-radius: 22px;
    padding: 3px;
    gap: 3px;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.04),
        inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

.lang-btn {
    background: transparent;
    border: 1px solid transparent;
    padding: 0.28rem 0.65rem;
    border-radius: 16px;
    font-size: 0.73rem;
    font-weight: 750;
    font-family: var(--font-sans);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    user-select: none;
}

.lang-btn:hover {
    color: var(--imperial-gold);
    transform: translateY(-0.5px);
}

.lang-btn:active {
    transform: translateY(1px);
}

.lang-btn.is-active {
    background: linear-gradient(180deg, #dc2626 0%, #991b1b 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 2px 8px rgba(185, 28, 28, 0.35),
        inset 0 1px 1px rgba(255, 255, 255, 0.4),
        inset 0 -1.5px 0 rgba(0, 0, 0, 0.25);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Theme Toggle Button */
.btn-theme-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border-warm);
    border-radius: 22px;
    padding: 0.35rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 750;
    font-family: var(--font-sans);
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.04),
        inset 0 1px 1px rgba(255, 255, 255, 0.8);
    user-select: none;
}

.btn-theme-toggle:hover {
    color: var(--imperial-gold);
    border-color: var(--imperial-gold);
    transform: translateY(-1px);
    box-shadow: 
        0 6px 16px rgba(212, 175, 55, 0.15),
        inset 0 1px 1px rgba(255, 255, 255, 0.9);
}

.btn-theme-toggle:active {
    transform: translateY(1.5px);
    box-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.1),
        inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Google Auth Header Widget & Profile Menu */
.auth-control-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.btn-google-login {
    background: var(--bg-card);
    border: 1px solid var(--border-warm);
    border-radius: 20px;
    padding: 0.35rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: var(--font-sans);
    color: var(--text-main);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.btn-google-login:hover {
    border-color: var(--imperial-gold);
    background: var(--bg-secondary);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.google-icon {
    flex-shrink: 0;
}

.user-profile-menu {
    position: relative;
}

.user-profile-menu.is-hidden,
.user-dropdown-panel.is-hidden,
.is-hidden {
    display: none !important;
}

.btn-user-avatar {
    background: var(--bg-card);
    border: 1px solid var(--border-warm);
    border-radius: 20px;
    padding: 0.25rem 0.65rem 0.25rem 0.3rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.btn-user-avatar:hover {
    border-color: var(--imperial-gold);
}

.user-avatar-img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--imperial-gold);
}

.user-name-display {
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-chevron {
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.btn-user-avatar[aria-expanded="true"] .user-menu-chevron {
    transform: rotate(180deg);
}

.user-dropdown-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 220px;
    background: var(--bg-card);
    border: 1px solid var(--border-warm);
    border-radius: 14px;
    padding: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    animation: fadeInDropdown 0.2s ease;
}

@keyframes fadeInDropdown {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-user-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.dropdown-user-info strong {
    font-size: 0.9rem;
    color: var(--text-main);
}

.dropdown-user-info span {
    font-size: 0.75rem;
    color: var(--text-muted);
    word-break: break-all;
}

.dropdown-sync-status {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.76rem;
    font-weight: 700;
    color: #10b981;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 8px;
    padding: 0.35rem 0.6rem;
}

.sync-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 6px #10b981;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-warm);
    margin: 0.2rem 0;
}

.btn-dropdown-logout {
    background: var(--bg-secondary);
    border: 1px solid var(--border-warm);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--imperial-red);
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}

.btn-dropdown-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--imperial-red);
}

.brand-logo-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    margin-bottom: 0.35rem;
}

.app-brand-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
    filter: drop-shadow(0 3px 8px rgba(212, 175, 55, 0.45));
    transition: transform 0.25s ease, filter 0.25s ease;
}

.app-brand-logo:hover {
    transform: scale(1.08) rotate(2deg);
    filter: drop-shadow(0 4px 14px rgba(212, 175, 55, 0.7));
}

.home-hero-crest {
    display: flex;
    justify-content: center;
    margin-bottom: 0.85rem;
}

.home-hero-logo {
    width: 68px;
    height: 68px;
    object-fit: contain;
    filter: drop-shadow(0 6px 18px rgba(212, 175, 55, 0.55));
    animation: floatLogo 4s ease-in-out infinite;
}

.reveal-brand-seal {
    width: 38px;
    height: 38px;
    margin: 0.25rem auto;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(212, 175, 55, 0.5));
    transition: transform 0.3s ease;
}

.reveal-brand-seal:hover {
    transform: scale(1.1);
}

@keyframes floatLogo {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-4px); }
}

.imperial-seal {
    display: inline-block;
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 50%, #7f1d1d 100%);
    color: #fffaf0;
    font-family: var(--font-serif);
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 2.5px;
    padding: 0.38rem 0.95rem;
    border-radius: 8px;
    border: 1.5px solid rgba(254, 202, 202, 0.4);
    box-shadow: 
        0 4px 12px rgba(153, 27, 27, 0.35),
        inset 0 1px 1px rgba(255, 255, 255, 0.5),
        inset 0 -2px 0 rgba(0, 0, 0, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    text-transform: uppercase;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.imperial-seal:hover {
    transform: translateY(-1px);
    box-shadow: 
        0 6px 16px rgba(153, 27, 27, 0.42),
        inset 0 1px 1px rgba(255, 255, 255, 0.6),
        inset 0 -2px 0 rgba(0, 0, 0, 0.3);
}

.app-title {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-main);
}

.app-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* Main Card */
.main-card {
    background: var(--bg-card);
    border: 1px solid var(--border-warm);
    border-radius: 18px;
    padding: 2rem;
    box-shadow: 0 15px 35px -10px rgba(60, 42, 20, 0.07), 0 5px 15px rgba(0, 0, 0, 0.03);
}

/* Form Styles */
.bazi-form {
    background: var(--bg-secondary);
    border: 1px solid var(--border-warm);
    border-radius: 14px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem;
    border-bottom: 1px dashed var(--border-warm);
}

.form-section-title {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
}

.btn-secondary-sm {
    background: var(--bg-card);
    border: 1px solid var(--border-warm);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary-sm:hover {
    color: var(--imperial-red);
    border-color: var(--imperial-red);
    background: #fff;
}

/* Saved Profiles Chip Strip */
.profiles-strip-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.2rem 0;
}

.profiles-strip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow-x: auto;
    scrollbar-width: none;
    flex: 1;
}
.profiles-strip::-webkit-scrollbar {
    display: none;
}

.no-profiles-text {
    font-size: 0.76rem;
    color: var(--text-light);
    font-style: italic;
}

.profile-chip {
    background: #ffffff;
    border: 1px solid var(--border-warm);
    border-radius: 20px;
    padding: 0.25rem 0.65rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.76rem;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.profile-chip:hover {
    border-color: var(--imperial-gold);
    background: #fffdfa;
    box-shadow: 0 2px 6px rgba(60, 42, 20, 0.06);
}

.profile-chip-name {
    font-weight: 700;
}

.profile-chip-date {
    color: var(--text-light);
    font-size: 0.7rem;
}

.btn-chip-del {
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 0.95rem;
    cursor: pointer;
    padding: 0 0.15rem;
    border-radius: 50%;
    line-height: 1;
    transition: color 0.15s;
}
.btn-chip-del:hover {
    color: var(--imperial-red);
}

.btn-save-chip {
    background: var(--bg-card);
    border: 1px dashed var(--border-warm);
    border-radius: 20px;
    padding: 0.28rem 0.75rem;
    font-size: 0.76rem;
    font-weight: 700;
    font-family: var(--font-sans);
    color: var(--imperial-gold);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-save-chip:hover {
    background: #ffffff;
    border-color: var(--imperial-gold);
    color: var(--imperial-red);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

input[type="date"],
input[type="time"],
input[type="number"],
select {
    padding: 0.65rem 0.85rem;
    font-size: 0.95rem;
    font-family: var(--font-sans);
    border: 1px solid #d6cbba;
    border-radius: 8px;
    background: #ffffff;
    color: var(--text-main);
    outline: none;
    transition: all 0.2s;
}

input:focus,
select:focus {
    border-color: var(--imperial-gold);
    box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.15);
}

/* Gender Segmented Control */
.gender-segmented-control {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    background: var(--bg-tertiary);
    padding: 0.35rem;
    border-radius: 10px;
    border: 1px solid var(--border-warm);
}

.gender-tab {
    display: block;
    cursor: pointer;
}

.gender-tab input {
    display: none;
}

.gender-tab .tab-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    color: var(--text-muted);
    transition: all 0.2s;
}

.gender-tab input:checked + .tab-label {
    background: #ffffff;
    color: var(--imperial-red);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Submit Button (3D Tactile Golden-Edged Imperial Plaque) */
.btn-primary {
    width: 100%;
    padding: 0.95rem 1.5rem;
    background: linear-gradient(180deg, #dc2626 0%, #b91c1c 55%, #991b1b 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 14px;
    font-family: var(--font-serif);
    font-size: 1.08rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 
        0 6px 20px rgba(185, 28, 28, 0.38),
        inset 0 1px 1px rgba(255, 255, 255, 0.45),
        inset 0 -2.5px 0 rgba(0, 0, 0, 0.28);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    user-select: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 10px 28px rgba(185, 28, 28, 0.45),
        inset 0 1px 1px rgba(255, 255, 255, 0.55),
        inset 0 -2.5px 0 rgba(0, 0, 0, 0.28);
    filter: brightness(1.05);
}

.btn-primary:active {
    transform: translateY(2px) scale(0.99);
    box-shadow: 
        0 2px 6px rgba(185, 28, 28, 0.4),
        inset 0 2px 4px rgba(0, 0, 0, 0.35);
}

/* Result Container */
.result-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 2rem;
    animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Profile / Metadata Banner */
.profile-banner {
    background: linear-gradient(135deg, #fffdf8, #f8f4ec);
    border: 1px solid var(--border-warm);
    border-left: 4px solid var(--imperial-red);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    box-shadow: 0 4px 10px rgba(60, 42, 20, 0.03);
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.meta-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    font-weight: 600;
}

.meta-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
}

.day-master-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-weight: 700;
}

/* Live Daily Transit Banner (Placement A) */
.today-transit-banner {
    grid-column: 1 / -1;
    background: #ffffff;
    border: 1px solid var(--border-warm);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem 1rem;
    margin-top: 0.35rem;
    box-shadow: 0 2px 6px rgba(60, 42, 20, 0.03);
}

.transit-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.85rem;
    font-size: 0.84rem;
    color: var(--text-main);
}

.transit-label {
    font-family: var(--font-serif);
    font-weight: 800;
    color: var(--imperial-red);
}

.transit-god strong {
    color: var(--imperial-gold);
}

.transit-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.transit-tag {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.18rem 0.5rem;
    border-radius: 6px;
    border: 1px solid transparent;
}

.tag-noble { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.tag-harmony { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.tag-clash { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.tag-peach { background: #fdf2f8; color: #be185d; border-color: #fbcfe8; }
.tag-horse { background: #f0f9ff; color: #0369a1; border-color: #bae6fd; }

/* Today's Insights Card in Tab */
.today-insights-card {
    background: #ffffff;
    border: 1px solid var(--border-warm);
    border-radius: 14px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
    box-shadow: 0 4px 12px rgba(60, 42, 20, 0.04);
}

.today-hero-summary {
    background: linear-gradient(135deg, #fffaf5, #fdf6ec);
    border: 1px solid var(--border-warm);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.today-hero-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.today-god-title {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--imperial-red);
}

.today-date-sub {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

.today-vibe-text {
    font-size: 0.88rem;
    color: var(--text-main);
    line-height: 1.5;
}

.today-guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.85rem;
}

.guide-box {
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.box-yi {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.box-ji {
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.guide-title {
    font-size: 0.82rem;
    font-weight: 800;
}

.box-yi .guide-title { color: #15803d; }
.box-ji .guide-title { color: #b91c1c; }

.guide-text {
    font-size: 0.8rem;
    color: var(--text-main);
    line-height: 1.45;
}

.today-dynamics-strip {
    background: var(--bg-secondary);
    border: 1px solid var(--border-warm);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    font-size: 0.8rem;
}

.dynamic-item {
    display: flex;
    gap: 0.35rem;
}

.dynamic-label {
    color: var(--text-muted);
}

.dynamic-value {
    font-weight: 700;
    color: var(--text-main);
}

/* Educational Guide in Today's Luck */
.today-education-box {
    background: #faf8f5;
    border: 1px solid var(--border-warm);
    border-radius: 10px;
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.edu-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.edu-icon {
    font-size: 1.2rem;
}

.edu-title {
    font-family: var(--font-serif);
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--imperial-red);
}

.edu-intro {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.edu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.65rem;
    margin-top: 0.2rem;
}

.edu-item {
    background: #ffffff;
    border: 1px solid var(--border-warm);
    border-radius: 8px;
    padding: 0.65rem 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.edu-item strong {
    color: var(--text-main);
}

.edu-footer-tip {
    font-size: 0.76rem;
    color: var(--imperial-gold);
    background: #fffbeb;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    border: 1px solid #fde68a;
    line-height: 1.4;
}

/* Section Titles */
.section-title-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.9rem;
}

.section-title {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title::before {
    content: "◆";
    color: var(--imperial-gold);
    font-size: 0.9rem;
}

/* Four Pillars Matrix */
.pillars-matrix {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.85rem;
}

.pillar-col {
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 1.5px solid var(--border-warm);
    border-radius: 16px;
    padding: 1.2rem 0.95rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    box-shadow: 
        0 8px 24px -4px rgba(60, 42, 20, 0.06),
        0 2px 6px rgba(0, 0, 0, 0.03),
        inset 0 1px 1px rgba(255, 255, 255, 0.9),
        inset 0 -2px 0 rgba(0, 0, 0, 0.03);
    transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.pillar-col:hover {
    transform: translateY(-3px);
    border-color: var(--imperial-gold);
    box-shadow: 
        0 14px 32px rgba(212, 175, 55, 0.18),
        inset 0 1px 1px rgba(255, 255, 255, 1),
        inset 0 -2px 0 rgba(212, 175, 55, 0.35);
}

.pillar-name-tag {
    font-family: var(--font-serif);
    font-size: 0.88rem;
    font-weight: 850;
    color: var(--imperial-red);
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border-subtle);
    letter-spacing: 0.03em;
}

.god-badge {
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1;
    border-radius: 9999px;
    padding: 0.2rem 0.6rem;
    min-height: 1.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.god-badge-stem {
    color: var(--imperial-gold);
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.32);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.6);
}

.god-badge-branch {
    color: var(--text-muted);
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--border-warm);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .god-badge-branch {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(212, 175, 55, 0.22);
}

.char-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.75rem 0.4rem;
    border-radius: 12px;
    border: 1px solid var(--border-warm);
    background: var(--bg-card);
    box-shadow: 
        0 4px 10px rgba(0, 0, 0, 0.04),
        inset 0 1px 1px rgba(255, 255, 255, 0.85),
        inset 0 -2px 0 rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
}

.char-card:hover {
    transform: translateY(-1px);
    box-shadow: 
        0 6px 14px rgba(0, 0, 0, 0.08),
        inset 0 1px 1px rgba(255, 255, 255, 1);
}

.char-glyph {
    font-family: var(--font-serif);
    font-size: 2.0rem;
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.char-caption {
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.25px;
}

.hidden-stems-list {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border: 1px dashed rgba(212, 175, 55, 0.4);
    border-radius: 10px;
    padding: 0.55rem 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.75rem;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.03);
}

.hidden-stem-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border-radius: 5px;
    padding: 0.1rem 0.25rem;
    transition: background 0.15s ease, transform 0.15s ease;
    user-select: none;
}

.hidden-stem-item:hover {
    background: rgba(212, 175, 55, 0.12);
}

.hidden-stem-char {
    cursor: pointer;
    padding: 0 0.15rem;
    border-radius: 3px;
    transition: all 0.15s ease;
}

.hidden-stem-char:hover {
    background: rgba(212, 175, 55, 0.2);
    transform: scale(1.05);
}

.hidden-stem-god {
    cursor: pointer;
    font-size: 0.72rem;
    color: var(--text-muted);
    padding: 0 0.15rem;
    border-radius: 3px;
    transition: all 0.15s ease;
}

.hidden-stem-god:hover {
    color: var(--imperial-gold);
    background: rgba(212, 175, 55, 0.15);
}

.life-stage-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 750;
    color: var(--text-muted);
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    padding: 0.28rem 0.65rem;
    border-radius: 8px;
    border: 1px solid var(--border-warm);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.pillar-footer-info {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-top: 0.4rem;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.72rem;
    color: var(--text-light);
}

/* Four Pillars Mobile Cascade Overrides */
@media (max-width: 640px) {
    .pillars-matrix {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 0.3rem;
    }

    .pillar-col {
        padding: 0.45rem 0.18rem;
        gap: 0.28rem;
        border-radius: 8px;
    }

    .pillar-name-tag {
        font-size: 0.72rem;
        min-height: 1.15rem;
        padding-bottom: 0.15rem;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        white-space: nowrap;
    }

    .pillar-subtitle-tag {
        font-size: 0.58rem;
        min-height: 1.2rem;
        padding: 0.08rem 0.15rem;
        line-height: 1.15;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        white-space: nowrap;
        overflow: visible;
        text-overflow: clip;
        max-width: 100%;
    }

    .god-badge {
        font-size: 0.58rem;
        min-height: 1.25rem;
        padding: 1px 5px;
        line-height: 1.15;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        white-space: nowrap;
        overflow: visible;
        text-overflow: clip;
    }

    .char-card {
        padding: 0.32rem 0.12rem;
        gap: 0.08rem;
        border-radius: 9px;
    }

    .char-glyph {
        font-size: 1.25rem;
    }

    .char-caption {
        font-size: 0.54rem;
        letter-spacing: 0;
    }

    .hidden-stems-list {
        padding: 0.22rem 0.12rem;
        font-size: 0.56rem;
        gap: 0.12rem;
        border-radius: 7px;
    }

    .life-stage-badge {
        font-size: 0.54rem;
        padding: 0.12rem 0.22rem;
        border-radius: 6px;
    }

    .pillar-footer-info {
        font-size: 0.54rem;
        gap: 0.08rem;
        padding-top: 0.25rem;
    }
}

@media (max-width: 480px) {
    .pillars-matrix {
        gap: 0.22rem;
    }

    .pillar-col {
        padding: 0.38rem 0.12rem;
        gap: 0.22rem;
        border-radius: 6px;
    }

    .char-card {
        padding: 0.25rem 0.08rem;
        border-radius: 7px;
    }

    .char-glyph {
        font-size: 1.12rem;
    }

    .char-caption {
        font-size: 0.48rem;
    }

    .pillar-name-tag {
        font-size: 0.65rem;
    }

    .pillar-subtitle-tag {
        font-size: 0.52rem;
    }

    .god-badge {
        font-size: 0.50rem;
        padding: 1px 3px;
        min-height: 1.05rem;
    }

    .hidden-stems-list {
        padding: 0.18rem 0.08rem;
        font-size: 0.48rem;
    }

    .life-stage-badge {
        font-size: 0.48rem;
        padding: 0.08rem 0.18rem;
    }

    .pillar-footer-info {
        font-size: 0.48rem;
    }
}

@media (max-width: 360px) {
    .char-glyph {
        font-size: 1.0rem;
    }

    .char-caption {
        font-size: 0.44rem;
    }
}

/* Five Elements Styling */
.element-wood { color: var(--wood-color); background: var(--wood-bg); border-color: var(--wood-border); }
.element-fire { color: var(--fire-color); background: var(--fire-bg); border-color: var(--fire-border); }
.element-earth { color: var(--earth-color); background: var(--earth-bg); border-color: var(--earth-border); }
.element-metal { color: var(--metal-color); background: var(--metal-bg); border-color: var(--metal-border); }
.element-water { color: var(--water-color); background: var(--water-bg); border-color: var(--water-border); }

/* Special Auxiliary Palaces (四大辅助宫位) */
.palaces-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

@media (max-width: 640px) {
    .palaces-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.palace-card {
    background: #ffffff;
    border: 1px solid var(--border-warm);
    border-radius: 12px;
    padding: 1rem 0.75rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    box-shadow: 0 2px 8px rgba(60, 42, 20, 0.03);
    transition: transform 0.2s, box-shadow 0.2s;
}

.palace-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(60, 42, 20, 0.08);
}

.palace-header {
    font-family: var(--font-serif);
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-muted);
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--border-subtle);
}

.palace-gz {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 900;
    line-height: 1.2;
    margin: 0.2rem 0;
}

.palace-nayin {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--imperial-gold);
}

.palace-desc {
    font-size: 0.7rem;
    color: var(--text-light);
    line-height: 1.35;
    margin-top: auto;
    padding-top: 0.3rem;
}

/* Symbolic Stars (Shen Sha) Section */
.stars-active-count {
    font-size: 0.8rem;
    font-weight: 700;
    background: var(--bg-tertiary);
    color: var(--imperial-red);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    border: 1px solid var(--border-warm);
}

.shensha-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.95rem;
}

.shensha-card {
    background: var(--bg-card);
    border: 1px solid var(--border-warm);
    border-radius: 12px;
    padding: 1rem 1.05rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.65rem;
    min-height: 160px;
    box-shadow: 0 2px 6px rgba(60, 42, 20, 0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.shensha-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(60, 42, 20, 0.08);
}

.shensha-card.star-present {
    border-left: 4px solid var(--imperial-red);
    background: var(--bg-card);
}

.shensha-card.star-annual-active {
    border-left: 4px solid var(--imperial-gold);
    background: var(--bg-card);
}

.shensha-card.star-dormant {
    border-left: 4px solid var(--border-subtle);
    opacity: 0.9;
}

.shensha-top {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
}

.shensha-icon {
    font-size: 1.5rem;
    line-height: 1.1;
}

.shensha-name-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
}

.shensha-title {
    font-family: var(--font-serif);
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.3;
}

.shensha-category {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--imperial-gold);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.shensha-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.45;
    flex: 1;
}

.shensha-status {
    padding-top: 0.45rem;
    border-top: 1px dashed var(--border-subtle);
    font-size: 0.73rem;
    display: flex;
    align-items: center;
}

.badge-present {
    color: var(--imperial-red);
    font-weight: 800;
}

.badge-annual-active {
    color: #b45309;
    font-weight: 800;
}

[data-theme="dark"] .badge-annual-active {
    color: #fbbf24;
}

.badge-dormant {
    color: var(--text-light);
    font-weight: 600;
}

/* Five Elements Distribution Section */
.elements-analysis-box {
    background: #faf8f5;
    border: 1px solid var(--border-warm);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Five Elements Pentagram & Radar Layout */
.elements-pentagram-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.25rem;
    align-items: start;
}

@media (max-width: 720px) {
    .elements-pentagram-layout {
        grid-template-columns: 1fr;
    }
}

.pentagram-visual-card {
    background: #ffffff;
    border: 1px solid var(--border-warm);
    border-radius: 12px;
    padding: 1.15rem 0.85rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(60, 42, 20, 0.03);
}

.pentagram-compass-wrap {
    position: relative;
    width: 260px;
    height: 260px;
}

.pentagram-svg {
    width: 100%;
    height: 100%;
}

.svg-cycle-circle {
    fill: none;
    stroke: var(--border-warm);
    stroke-width: 1.5;
    stroke-dasharray: 4 4;
}

.svg-ke-star {
    fill: none;
    stroke: var(--imperial-gold);
    stroke-width: 1.3;
    opacity: 0.65;
}

.svg-sheng-arrow {
    fill: none;
    stroke: var(--imperial-red);
    stroke-width: 1.6;
    opacity: 0.5;
}

.pentagram-node {
    position: absolute;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: help;
}
.pentagram-node:hover {
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.node-glyph {
    font-family: var(--font-serif);
    font-size: 0.95rem;
    font-weight: 900;
    line-height: 1;
}
.node-pct {
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1;
    margin-top: 2px;
}

.node-fire { background: var(--fire-bg); color: var(--fire-color); border: 1.5px solid var(--fire-border); }
.node-earth { background: var(--earth-bg); color: var(--earth-color); border: 1.5px solid var(--earth-border); }
.node-metal { background: var(--metal-bg); color: var(--metal-color); border: 1.5px solid var(--metal-border); }
.node-water { background: var(--water-bg); color: var(--water-color); border: 1.5px solid var(--water-border); }
.node-wood { background: var(--wood-bg); color: var(--wood-color); border: 1.5px solid var(--wood-border); }

.pentagram-legend {
    display: flex;
    gap: 0.85rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}
.legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.dot-sheng { background: var(--imperial-red); }
.dot-ke { background: var(--imperial-gold); }

.elements-stats-col {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.multi-progress-bar {
    height: 14px;
    border-radius: 7px;
    overflow: hidden;
    display: flex;
    background: #e2e8f0;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.prog-segment {
    height: 100%;
    transition: width 0.4s ease;
}

.prog-wood { background: #16a34a; }
.prog-fire { background: #dc2626; }
.prog-earth { background: #b45309; }
.prog-metal { background: #d97706; }
.prog-water { background: #0284c7; }

.elements-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0.5rem;
}

.elem-stat-card {
    background: #ffffff;
    border: 1px solid var(--border-warm);
    border-radius: 8px;
    padding: 0.6rem 0.4rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.elem-stat-name {
    font-size: 0.76rem;
    font-weight: 700;
}

.elem-stat-count {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--text-main);
}

.element-balance-tip-box {
    background: linear-gradient(135deg, #fffdfa, #fdf6ec);
    border: 1px solid var(--border-warm);
    border-left: 3.5px solid var(--imperial-gold);
    border-radius: 10px;
    padding: 0.9rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.tip-box-title {
    font-family: var(--font-serif);
    font-size: 0.86rem;
    font-weight: 800;
    color: var(--imperial-red);
}

.tip-box-desc {
    font-size: 0.78rem;
    color: var(--text-main);
    line-height: 1.5;
}

[data-theme="dark"] .pentagram-visual-card,
[data-theme="dark"] .elem-stat-card {
    background: var(--bg-card);
    border-color: var(--border-warm);
    color: var(--text-main);
}

[data-theme="dark"] .element-balance-tip-box {
    background: var(--bg-secondary);
    border-color: var(--border-warm);
    color: var(--text-main);
}

/* Da Yun (Luck Pillars) Section */
.dayun-summary-strip {
    background: var(--bg-secondary);
    border: 1px solid var(--border-warm);
    border-radius: 10px;
    padding: 0.85rem 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.dayun-timeline-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
    gap: 0.75rem;
    margin-top: 0.85rem;
}

.dayun-item-card {
    background: #ffffff;
    border: 1px solid var(--border-warm);
    border-radius: 10px;
    padding: 0.85rem 0.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    position: relative;
    box-shadow: 0 2px 6px rgba(60, 42, 20, 0.03);
    transition: transform 0.2s, border-color 0.2s;
}

.dayun-item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(60, 42, 20, 0.08);
}

.dayun-item-card.is-active-decade {
    border: 2px solid var(--imperial-gold);
    background: linear-gradient(180deg, #fffdf8, #fff8eb);
}

.active-decade-flag {
    position: absolute;
    top: -9px;
    right: 8px;
    background: var(--imperial-gold);
    color: #ffffff;
    font-size: 0.62rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 8px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.dayun-age-text {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--text-main);
}

.dayun-years-text {
    font-size: 0.72rem;
    color: var(--text-light);
}

.dayun-pair-glyph {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 0.15rem 0;
}

.dayun-god-text {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--imperial-gold);
}

/* Qi Men Dun Jia (奇门遁甲) 9-Palace Matrix (3D Spatial Board) */
.qmdj-card {
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 1.5px solid rgba(212, 175, 55, 0.35);
    border-radius: 20px;
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    box-shadow: 
        0 10px 28px -4px rgba(60, 42, 20, 0.06),
        inset 0 1px 1px rgba(255, 255, 255, 0.9);
}

.qmdj-info-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.15rem;
    font-size: 0.84rem;
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    padding: 0.85rem 1.15rem;
    border-radius: 14px;
    border: 1px solid var(--border-warm);
    color: var(--text-muted);
    box-shadow: 
        0 2px 6px rgba(0, 0, 0, 0.03),
        inset 0 1px 1px rgba(255, 255, 255, 0.85);
}

.qmdj-info-strip strong {
    color: var(--imperial-red);
}

.qmdj-grid-3x3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    width: 100%;
    box-sizing: border-box;
}

.qmdj-palace-box {
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 1.5px solid var(--border-warm);
    border-radius: 14px;
    padding: 0.95rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
    box-shadow: 
        0 4px 12px rgba(60, 42, 20, 0.03),
        inset 0 1px 1px rgba(255, 255, 255, 0.85),
        inset 0 -1.5px 0 rgba(0, 0, 0, 0.03);
    transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.qmdj-palace-box:hover {
    transform: translateY(-3px);
    border-color: var(--imperial-gold);
    box-shadow: 
        0 10px 24px rgba(212, 175, 55, 0.18),
        inset 0 1px 1px rgba(255, 255, 255, 1);
}

.qmdj-palace-box.is-day-palace {
    border: 2px solid var(--imperial-red);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(185, 28, 28, 0.06) 100%);
    box-shadow: 
        0 6px 20px rgba(185, 28, 28, 0.18),
        inset 0 1px 1px rgba(255, 255, 255, 0.95);
}

.qmdj-palace-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--border-subtle);
    gap: 0.2rem;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.qmdj-palace-title {
    font-family: var(--font-serif);
    font-size: 0.85rem;
    font-weight: 850;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1 1 auto;
}

.qmdj-palace-tags {
    display: inline-flex;
    align-items: center;
    gap: 0.18rem;
    flex-shrink: 0;
}

.tag-day-master {
    font-size: 0.65rem;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(180deg, #fee2e2 0%, #fecaca 100%);
    color: var(--imperial-red);
    padding: 0.14rem 0.42rem;
    border-radius: 5px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    box-shadow: 0 1px 3px rgba(239, 68, 68, 0.15);
    white-space: nowrap;
    flex-shrink: 0;
    box-sizing: border-box;
}

.tag-chief {
    font-size: 0.65rem;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(180deg, var(--imperial-gold-light) 0%, rgba(212, 175, 55, 0.2) 100%);
    color: var(--imperial-gold);
    padding: 0.14rem 0.42rem;
    border-radius: 5px;
    border: 1px solid rgba(212, 175, 55, 0.35);
    box-shadow: 0 1px 3px rgba(212, 175, 55, 0.15);
    white-space: nowrap;
    flex-shrink: 0;
    box-sizing: border-box;
}

.tag-life-gua {
    font-size: 0.65rem;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(180deg, #dcfce7 0%, #bbf7d0 100%);
    color: var(--wood-color);
    padding: 0.14rem 0.42rem;
    border-radius: 5px;
    border: 1px solid rgba(22, 163, 74, 0.35);
    box-shadow: 0 1px 3px rgba(22, 163, 74, 0.15);
    white-space: nowrap;
    flex-shrink: 0;
    box-sizing: border-box;
}

[data-theme="dark"] .tag-life-gua {
    background: linear-gradient(180deg, rgba(22, 163, 74, 0.25) 0%, rgba(34, 197, 94, 0.15) 100%);
    border-color: rgba(34, 197, 94, 0.4);
    color: #4ade80;
}

.qmdj-layer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    font-weight: 750;
    gap: 0.25rem;
    min-width: 0;
}

.qmdj-deity-badge {
    color: var(--imperial-gold);
    font-weight: 800;
    white-space: nowrap;
    flex-shrink: 0;
}

.qmdj-star-badge {
    color: var(--text-main);
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    padding: 0.18rem 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border-warm);
    font-size: 0.76rem;
    font-weight: 750;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    white-space: nowrap;
    flex-shrink: 0;
}

.qmdj-layer-center {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.35rem;
    border-top: 1px dashed var(--border-subtle);
    gap: 0.25rem;
    min-width: 0;
}

.qmdj-door-badge {
    font-family: var(--font-serif);
    font-size: 1.02rem;
    font-weight: 900;
    color: var(--text-main);
    white-space: nowrap;
    flex-shrink: 0;
}

.door-auspicious {
    color: var(--wood-color);
}

.door-inauspicious {
    color: var(--imperial-red);
}

.qmdj-stems-pair {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 850;
    display: flex;
    align-items: center;
    gap: 0.15rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.stem-tian {
    color: var(--imperial-red);
}

.stem-divider {
    font-size: 0.82rem;
    color: var(--text-light);
    opacity: 0.75;
}

.stem-di {
    color: var(--text-muted);
}

.qmdj-destiny-analysis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.85rem;
    margin-top: 0.35rem;
}

.destiny-palace-card {
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--border-warm);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    box-shadow: 
        0 2px 6px rgba(0, 0, 0, 0.03),
        inset 0 1px 1px rgba(255, 255, 255, 0.85);
}

.destiny-palace-role {
    font-family: var(--font-serif);
    font-size: 0.85rem;
    font-weight: 850;
    color: var(--imperial-red);
}

.destiny-palace-detail {
    font-size: 0.76rem;
    line-height: 1.45;
    color: var(--text-muted);
}

/* Qi Men Destiny Profile Banner Plaque */
.qmdj-destiny-profile-banner {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.08) 0%, rgba(185, 28, 28, 0.04) 100%);
    border: 1.5px solid rgba(212, 175, 55, 0.4);
    border-radius: 14px;
    padding: 0.95rem 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    box-shadow: 
        0 4px 14px rgba(60, 42, 20, 0.04),
        inset 0 1px 1px rgba(255, 255, 255, 0.9);
}

.destiny-profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem 0.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed rgba(212, 175, 55, 0.3);
}

.destiny-profile-badge {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--imperial-gold);
}

.destiny-profile-palace {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
}

.destiny-profile-palace strong {
    color: var(--imperial-red);
    font-family: var(--font-serif);
    font-size: 0.95rem;
}

.destiny-gua-tag {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-left: 0.35rem;
}

.destiny-gua-tag strong {
    color: var(--wood-color);
}

[data-theme="dark"] .destiny-gua-tag strong {
    color: #4ade80;
}

.destiny-profile-chips {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem;
}

.destiny-chip {
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--border-warm);
    border-radius: 10px;
    padding: 0.55rem 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.destiny-chip:hover {
    transform: translateY(-2px);
    border-color: var(--imperial-gold);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.15);
}

.destiny-chip .chip-label {
    font-size: 0.70rem;
    font-weight: 750;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.destiny-chip .chip-value {
    font-family: var(--font-serif);
    font-size: 0.94rem;
    font-weight: 850;
    color: var(--text-main);
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.28rem;
    line-height: 1.25;
}

.destiny-chip .chip-sub {
    font-family: var(--font-sans);
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--imperial-gold);
    letter-spacing: 0.01em;
}

[data-theme="dark"] .qmdj-destiny-profile-banner {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.12) 0%, rgba(185, 28, 28, 0.08) 100%);
    border-color: rgba(212, 175, 55, 0.35);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .destiny-chip {
    background: rgba(30, 27, 24, 0.7);
    border-color: rgba(255, 255, 255, 0.08);
}

@media (max-width: 640px) {
    .destiny-profile-chips {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
    }
}

/* ============================================================
   QMDJ Mobile Responsive Cascade Overrides
   ============================================================ */
@media (max-width: 768px) {
    .qmdj-card {
        padding: 1rem 0.85rem;
        gap: 0.95rem;
        border-radius: 16px;
    }

    .qmdj-info-strip {
        padding: 0.7rem 0.85rem;
        gap: 0.45rem 0.85rem;
        font-size: 0.76rem;
    }

    .qmdj-grid-3x3 {
        gap: 0.45rem;
    }

    .qmdj-palace-box {
        padding: 0.55rem 0.38rem;
        gap: 0.35rem;
        border-radius: 10px;
    }

    .qmdj-palace-header {
        padding-bottom: 0.25rem;
        gap: 0.12rem;
    }

    .qmdj-palace-title {
        font-size: 0.72rem;
    }

    .qmdj-palace-tags {
        gap: 0.12rem;
    }

    .tag-day-master,
    .tag-chief {
        font-size: 0.52rem;
        padding: 0.08rem 0.22rem;
        border-radius: 3px;
    }

    .qmdj-layer-row {
        font-size: 0.72rem;
        gap: 0.15rem;
    }

    .qmdj-deity-badge {
        font-size: 0.72rem;
    }

    .qmdj-star-badge {
        font-size: 0.66rem;
        padding: 0.08rem 0.28rem;
        border-radius: 4px;
    }

    .qmdj-layer-center {
        padding-top: 0.25rem;
        gap: 0.15rem;
    }

    .qmdj-door-badge {
        font-size: 0.86rem;
    }

    .qmdj-stems-pair {
        font-size: 0.92rem;
        gap: 0.1rem;
    }

    .stem-divider {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .qmdj-card {
        padding: 0.75rem 0.5rem;
        gap: 0.75rem;
        border-radius: 14px;
    }

    .qmdj-info-strip {
        padding: 0.6rem 0.65rem;
        gap: 0.35rem 0.65rem;
        font-size: 0.7rem;
        border-radius: 10px;
    }

    .qmdj-grid-3x3 {
        gap: 0.28rem;
    }

    .qmdj-palace-box {
        padding: 0.4rem 0.24rem;
        gap: 0.24rem;
        border-radius: 7px;
        border-width: 1px;
    }

    .qmdj-palace-header {
        padding-bottom: 0.18rem;
        gap: 0.08rem;
    }

    .qmdj-palace-title {
        font-size: 0.6rem;
        letter-spacing: -0.2px;
    }

    .qmdj-palace-tags {
        gap: 0.08rem;
    }

    .tag-day-master,
    .tag-chief {
        font-size: 0.44rem;
        padding: 0.04rem 0.14rem;
        border-radius: 3px;
    }

    .qmdj-layer-row {
        font-size: 0.62rem;
        gap: 0.1rem;
    }

    .qmdj-deity-badge {
        font-size: 0.62rem;
    }

    .qmdj-star-badge {
        font-size: 0.56rem;
        padding: 0.04rem 0.16rem;
        border-radius: 3px;
    }

    .qmdj-layer-center {
        padding-top: 0.18rem;
        gap: 0.1rem;
    }

    .qmdj-door-badge {
        font-size: 0.74rem;
    }

    .qmdj-stems-pair {
        font-size: 0.78rem;
        gap: 0.05rem;
    }

    .stem-divider {
        font-size: 0.58rem;
    }

    .qmdj-destiny-analysis {
        grid-template-columns: 1fr;
        gap: 0.55rem;
    }

    .destiny-palace-card {
        padding: 0.65rem 0.75rem;
        border-radius: 9px;
    }

    .destiny-palace-role {
        font-size: 0.78rem;
        line-height: 1.35;
    }

    .destiny-palace-detail {
        font-size: 0.72rem;
        line-height: 1.4;
    }
}

@media (max-width: 360px) {
    .qmdj-grid-3x3 {
        gap: 0.2rem;
    }

    .qmdj-palace-box {
        padding: 0.32rem 0.16rem;
        gap: 0.18rem;
    }

    .qmdj-palace-header {
        gap: 0.06rem;
    }

    .qmdj-palace-title {
        font-size: 0.54rem;
        letter-spacing: -0.4px;
    }

    .qmdj-palace-tags {
        gap: 0.06rem;
    }

    .tag-day-master,
    .tag-chief {
        font-size: 0.40rem;
        padding: 0.02rem 0.10rem;
    }

    .qmdj-deity-badge {
        font-size: 0.56rem;
    }

    .qmdj-star-badge {
        font-size: 0.5rem;
        padding: 0.02rem 0.12rem;
    }

    .qmdj-door-badge {
        font-size: 0.66rem;
    }

    .qmdj-stems-pair {
        font-size: 0.7rem;
    }

    .stem-divider {
        font-size: 0.52rem;
    }
}

/* Segmented Tab Navigation */
.segmented-tab-nav {
    display: flex;
    background: var(--bg-secondary);
    border: 1px solid var(--border-warm);
    border-radius: 12px;
    padding: 0.35rem;
    gap: 0.35rem;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.segmented-tab-nav::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    flex: 1 0 auto;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 0.6rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: var(--font-sans);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    text-align: center;
}

.tab-btn:hover {
    color: var(--imperial-red);
    background: rgba(255, 255, 255, 0.6);
}

.tab-btn.is-active {
    background: #ffffff;
    color: var(--imperial-red);
    border-color: var(--border-warm);
    box-shadow: 0 2px 8px rgba(60, 42, 20, 0.08);
}

.chart-tab-panel {
    animation: tabFadeIn 0.25s ease-out;
}

.chart-tab-panel.is-hidden {
    display: none !important;
}

@keyframes tabFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Action Utilities Bar */
.action-tools-bar {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
}

.btn-tool {
    background: var(--bg-secondary);
    border: 1px solid var(--border-warm);
    border-radius: 8px;
    padding: 0.5rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-tool:hover {
    background: #ffffff;
    border-color: var(--imperial-gold);
    color: var(--imperial-gold);
}

/* Footer */
.app-footer {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-light);
    padding-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.footer-domain-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 700;
    transition: transform 0.15s ease, background 0.15s ease;
}

.footer-domain-badge:hover {
    background: rgba(212, 175, 55, 0.15);
    transform: translateY(-1px);
}

.footer-domain-link {
    color: var(--imperial-gold, #b45309);
    text-decoration: none;
    letter-spacing: 0.02em;
}

.footer-tagline {
    font-size: 0.85rem;
    color: var(--imperial-gold, #b45309);
    font-weight: 600;
    letter-spacing: 0.03em;
    margin: 0.2rem 0 0 0;
    text-align: center;
}

.footer-copyright {
    font-size: 0.76rem;
    color: var(--text-light, #a8a29e);
    margin: 0;
    opacity: 0.85;
    text-align: center;
}

/* Interactive Micro-Tooltips */
.has-interactive-tooltip {
    cursor: help;
    transition: transform 0.15s ease-out;
}

.has-interactive-tooltip:hover {
    transform: scale(1.04);
}

.micro-tooltip {
    position: fixed;
    z-index: 100000;
    pointer-events: auto;
    max-width: 300px;
    width: max-content;
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--imperial-gold-border, rgba(212, 175, 55, 0.4));
    border-left: 4px solid var(--imperial-gold, #d4af37);
    border-radius: 12px;
    padding: 0.75rem 0.95rem;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.22), 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: opacity 0.15s ease-out, transform 0.15s ease-out;
    font-family: var(--font-sans);
    box-sizing: border-box;
}

[data-theme="dark"] .micro-tooltip {
    background: #1a1917;
    border-color: rgba(212, 175, 55, 0.3);
    border-left-color: var(--imperial-gold);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55), 0 2px 10px rgba(0, 0, 0, 0.3);
}

.micro-tooltip.is-hidden {
    opacity: 0;
    transform: translateY(4px);
    visibility: hidden;
    pointer-events: none;
}

.tooltip-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.15rem;
}

.tooltip-title {
    font-family: var(--font-serif);
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.3;
}

.tooltip-close-btn {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0.1rem 0.35rem;
    line-height: 1;
    border-radius: 4px;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

[data-theme="dark"] .tooltip-close-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
}

.tooltip-close-btn:hover {
    background: rgba(184, 51, 42, 0.15);
    color: var(--imperial-red);
}

.tooltip-cat {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--imperial-gold);
    margin-bottom: 0.35rem;
}

.tooltip-desc {
    font-size: 0.76rem;
    color: var(--text-muted);
    line-height: 1.45;
}

@media (max-width: 640px) {
    .micro-tooltip {
        max-width: calc(100vw - 24px);
    }
}

/* Master Navigation Bar: 3D Floating Frosted Dock */
.master-nav-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    width: max-content;
    max-width: 100%;
    margin: 0.85rem auto 0 auto;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(248, 245, 240, 0.82) 100%);
    padding: 6px 8px;
    border-radius: 28px;
    border: 1px solid rgba(212, 175, 55, 0.35);
    box-shadow: 
        0 12px 32px -4px rgba(0, 0, 0, 0.08),
        0 4px 12px rgba(212, 175, 55, 0.1),
        inset 0 1px 1px 0 rgba(255, 255, 255, 0.95),
        inset 0 -1px 2px rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    position: relative;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

.master-nav-bar::-webkit-scrollbar {
    display: none;
}

.nav-tab {
    background: transparent;
    border: 1px solid transparent;
    padding: 0.55rem 1.25rem;
    border-radius: 22px;
    font-size: 0.86rem;
    font-weight: 750;
    font-family: var(--font-sans);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    user-select: none;
    position: relative;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-tab:hover {
    color: var(--imperial-red);
    background: rgba(212, 175, 55, 0.08);
    transform: translateY(-1px);
}

.nav-tab:active {
    transform: translateY(1.5px) scale(0.98);
}

.nav-tab.is-active {
    background: linear-gradient(180deg, #dc2626 0%, #b91c1c 55%, #991b1b 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 
        0 4px 14px rgba(185, 28, 28, 0.38),
        inset 0 1px 1px rgba(255, 255, 255, 0.45),
        inset 0 -2px 0 rgba(0, 0, 0, 0.25);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.nav-tab.is-active:active {
    transform: translateY(1.5px) scale(0.98);
    box-shadow: 
        0 1px 4px rgba(185, 28, 28, 0.4),
        inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* 3D Segmented Sub-Engine Switcher */
.calculator-sub-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.45rem;
    width: max-content;
    max-width: 100%;
    margin: 0.75rem auto 0.25rem auto;
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.09) 0%, rgba(212, 175, 55, 0.03) 100%);
    padding: 5px 8px;
    border-radius: 22px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    box-shadow: 
        inset 0 2px 5px rgba(0, 0, 0, 0.04),
        0 6px 20px rgba(212, 175, 55, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.3s ease;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

.calculator-sub-nav::-webkit-scrollbar {
    display: none;
}

.calculator-sub-nav.is-hidden {
    display: none !important;
}

.sub-nav-tab {
    background: transparent;
    border: 1px solid transparent;
    padding: 0.42rem 1.05rem;
    border-radius: 18px;
    font-size: 0.82rem;
    font-weight: 750;
    font-family: var(--font-sans);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
    user-select: none;
    flex-shrink: 0;
}

.sub-nav-tab:hover {
    color: var(--imperial-gold);
    background: rgba(212, 175, 55, 0.12);
    transform: translateY(-1px);
}

.sub-nav-tab:active {
    transform: translateY(1.5px) scale(0.98);
}

.sub-nav-tab.is-active {
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    color: var(--imperial-red);
    border: 1.5px solid var(--imperial-gold);
    box-shadow: 
        0 4px 12px rgba(212, 175, 55, 0.22),
        inset 0 1px 1px rgba(255, 255, 255, 0.95),
        inset 0 -2px 0 rgba(212, 175, 55, 0.35);
}

.sub-nav-tab.is-active:active {
    box-shadow: 
        0 1px 3px rgba(212, 175, 55, 0.3),
        inset 0 1px 3px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .master-nav-bar {
    background: linear-gradient(180deg, rgba(32, 26, 22, 0.88) 0%, rgba(18, 14, 12, 0.94) 100%);
    border-color: rgba(212, 175, 55, 0.4);
    box-shadow: 
        0 16px 40px rgba(0, 0, 0, 0.65),
        0 4px 16px rgba(0, 0, 0, 0.4),
        inset 0 1px 1px rgba(255, 255, 255, 0.15),
        inset 0 -1px 2px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .nav-tab.is-active {
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 55%, #b91c1c 100%);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 4px 16px rgba(239, 68, 68, 0.45),
        inset 0 1px 1px rgba(255, 255, 255, 0.5),
        inset 0 -2px 0 rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .calculator-sub-nav {
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.12) 0%, rgba(20, 15, 10, 0.5) 100%);
    border-color: rgba(212, 175, 55, 0.4);
    box-shadow: 
        inset 0 2px 6px rgba(0, 0, 0, 0.4),
        0 6px 22px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .sub-nav-tab.is-active {
    background: linear-gradient(180deg, #241f1c 0%, #161210 100%);
    color: var(--imperial-gold);
    border-color: var(--imperial-gold);
    box-shadow: 
        0 4px 14px rgba(212, 175, 55, 0.3),
        inset 0 1px 1px rgba(255, 255, 255, 0.15),
        inset 0 -2px 0 rgba(0, 0, 0, 0.4);
}

.app-page-panel.is-hidden {
    display: none !important;
}

/* Page 2: Annual & Monthly Luck Planner */
.annual-luck-header, .library-header {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-warm);
    padding-bottom: 1rem;
}

.annual-luck-title, .library-title {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.35rem;
}

.annual-luck-subtitle, .library-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.dayun-ribbon-section {
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 1.5px solid var(--border-warm);
    border-radius: 18px;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.04),
        inset 0 1px 1px rgba(255, 255, 255, 0.9);
}

.section-badge-label {
    font-size: 0.78rem;
    font-weight: 850;
    color: var(--imperial-gold);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.85rem;
}

.dayun-ribbon-scroll {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
}

.dayun-ribbon-item {
    flex: 0 0 auto;
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 1.5px solid var(--border-warm);
    border-radius: 14px;
    padding: 0.75rem 1.1rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 
        0 4px 10px rgba(0, 0, 0, 0.03),
        inset 0 1px 1px rgba(255, 255, 255, 0.85),
        inset 0 -1.5px 0 rgba(0, 0, 0, 0.04);
    user-select: none;
}

.dayun-ribbon-item:hover {
    border-color: var(--imperial-gold);
    transform: translateY(-2px);
    box-shadow: 
        0 8px 18px rgba(212, 175, 55, 0.15),
        inset 0 1px 1px rgba(255, 255, 255, 0.95);
}

.dayun-ribbon-item:active {
    transform: translateY(1.5px) scale(0.98);
}

.dayun-ribbon-item.is-selected {
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.18) 0%, var(--bg-card) 100%);
    border-color: var(--imperial-gold);
    box-shadow: 
        0 6px 18px rgba(212, 175, 55, 0.28),
        inset 0 1px 1px rgba(255, 255, 255, 0.95),
        inset 0 -2px 0 rgba(212, 175, 55, 0.35);
}

.dayun-ribbon-item .dy-ganzhi {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--imperial-red);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

.dayun-ribbon-item .dy-age {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.dayun-ribbon-item .dy-years {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-light);
}

.liunian-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}

.liunian-card {
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 1.5px solid var(--border-warm);
    border-radius: 14px;
    padding: 0.85rem 0.7rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    box-shadow: 
        0 4px 10px rgba(0, 0, 0, 0.03),
        inset 0 1px 1px rgba(255, 255, 255, 0.85);
    user-select: none;
}

.liunian-card:hover {
    border-color: var(--imperial-gold);
    transform: translateY(-2px);
    box-shadow: 
        0 8px 18px rgba(212, 175, 55, 0.15),
        inset 0 1px 1px rgba(255, 255, 255, 0.95);
}

.liunian-card:active {
    transform: translateY(1.5px) scale(0.98);
}

.liunian-card.is-selected {
    background: linear-gradient(180deg, rgba(185, 28, 28, 0.08) 0%, var(--bg-card) 100%);
    border-color: var(--imperial-red);
    box-shadow: 
        0 6px 18px rgba(185, 28, 28, 0.25),
        inset 0 1px 1px rgba(255, 255, 255, 0.9),
        inset 0 -2px 0 rgba(185, 28, 28, 0.3);
}

.liunian-year {
    font-size: 0.78rem;
    font-weight: 750;
    color: var(--text-light);
}

.liunian-ganzhi {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    font-weight: 900;
    color: var(--text-main);
    margin: 0.2rem 0;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

.liunian-god {
    font-size: 0.74rem;
    font-weight: 750;
    color: var(--imperial-gold);
}

.liunian-stars {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
    align-items: center;
    margin-top: 0.35rem;
    font-size: 0.8rem;
}

.liunian-star-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 6px;
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.2);
    transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
    user-select: none;
    line-height: 1;
}

.liunian-star-badge:hover {
    transform: scale(1.22);
    background: rgba(212, 175, 55, 0.22);
    border-color: var(--imperial-gold);
    box-shadow: 0 2px 6px rgba(212, 175, 55, 0.25);
}

.liuyue-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.85rem;
    margin-top: 1rem;
}

.liuyue-card {
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 1.5px solid var(--border-warm);
    border-radius: 14px;
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    box-shadow: 
        0 4px 10px rgba(0, 0, 0, 0.03),
        inset 0 1px 1px rgba(255, 255, 255, 0.85);
    transition: all 0.2s ease;
}

.liuyue-card:hover {
    border-color: var(--imperial-gold);
    transform: translateY(-2px);
    box-shadow: 
        0 8px 18px rgba(212, 175, 55, 0.12),
        inset 0 1px 1px rgba(255, 255, 255, 0.95);
}

.liuyue-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.liuyue-title {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--imperial-red);
}

.liuyue-term {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.liuyue-guide {
    font-size: 0.72rem;
    line-height: 1.4;
    color: var(--text-muted);
    border-top: 1px dashed var(--border-warm);
    padding-top: 0.35rem;
}

/* Page 3: Metaphysics Knowledge Base */
.library-controls-bar {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.library-search-input {
    width: 100%;
    padding: 0.65rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--border-warm);
    background: var(--bg-secondary);
    color: var(--text-main);
    font-size: 0.84rem;
    font-family: var(--font-sans);
    outline: none;
    transition: border-color 0.2s;
}

.library-search-input:focus {
    border-color: var(--imperial-gold);
}

.library-filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.lib-pill {
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--border-warm);
    border-radius: 18px;
    padding: 0.35rem 0.85rem;
    font-size: 0.76rem;
    font-weight: 750;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 
        0 2px 6px rgba(0, 0, 0, 0.04),
        inset 0 1px 1px rgba(255, 255, 255, 0.8);
    user-select: none;
}

.lib-pill:hover {
    color: var(--imperial-gold);
    border-color: var(--imperial-gold);
    transform: translateY(-1px);
    box-shadow: 
        0 4px 12px rgba(212, 175, 55, 0.15),
        inset 0 1px 1px rgba(255, 255, 255, 0.9);
}

.lib-pill:active {
    transform: translateY(1.5px) scale(0.98);
}

.lib-pill.is-active {
    background: linear-gradient(180deg, #dc2626 0%, #991b1b 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 3px 10px rgba(185, 28, 28, 0.35),
        inset 0 1px 1px rgba(255, 255, 255, 0.4),
        inset 0 -1.5px 0 rgba(0, 0, 0, 0.25);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.library-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.85rem;
    margin-top: 1.25rem;
}

.library-card {
    background: var(--bg-card);
    border: 1px solid var(--border-warm);
    border-radius: 10px;
    padding: 0.95rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    transition: all 0.2s;
}

.library-card:hover {
    border-color: var(--imperial-gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.lib-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lib-glyph-title {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
}

.lib-tag {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--imperial-gold);
    border: 1px solid var(--border-warm);
}

.lib-desc {
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--text-muted);
}

/* ==========================================
   BEGINNER-FRIENDLY & COSMIC ARCHETYPE STYLES
   ========================================== */

/* Calendar Type Segmented Control */
.calendar-segmented-control {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-secondary);
    padding: 0.25rem;
    border-radius: 10px;
    border: 1px solid var(--border-warm);
}

.cal-tab {
    flex: 1;
    text-align: center;
    font-size: 0.84rem;
    font-weight: 600;
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    color: var(--text-muted);
}

.cal-tab input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.cal-tab.is-active,
.cal-tab:has(input:checked) {
    background: var(--bg-card);
    color: var(--imperial-gold);
    font-weight: 800;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--imperial-gold);
}

/* Unknown Time Checkbox */
.label-with-check {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.unknown-time-check {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
}

.unknown-time-check input[type="checkbox"] {
    accent-color: var(--imperial-gold);
    cursor: pointer;
}

/* Collapsible Advanced Settings */
.advanced-settings-toggle {
    margin-top: 0.4rem;
    margin-bottom: 0.4rem;
    border: 1px dashed var(--border-warm);
    border-radius: 10px;
    padding: 0.5rem 0.85rem;
    background: var(--bg-secondary);
    transition: all 0.2s ease;
}

.advanced-settings-toggle > summary {
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}

.advanced-settings-toggle > summary::-webkit-details-marker {
    display: none;
}

.advanced-settings-toggle[open] {
    background: var(--bg-card);
    border-style: solid;
    border-color: var(--border-warm);
}

.advanced-settings-content {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-warm);
}

/* Dual View Mode Switcher */
.view-mode-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-warm);
    border-radius: 14px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.view-mode-label {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.view-mode-group {
    display: flex;
    gap: 0.5rem;
}

.view-mode-btn {
    font-size: 0.82rem;
    font-weight: 750;
    padding: 0.52rem 1.1rem;
    border-radius: 14px;
    border: 1px solid var(--border-warm);
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 
        0 2px 6px rgba(0, 0, 0, 0.04),
        inset 0 1px 1px rgba(255, 255, 255, 0.8);
    user-select: none;
}

.view-mode-btn:hover {
    border-color: var(--imperial-gold);
    transform: translateY(-1px);
    box-shadow: 
        0 4px 12px rgba(212, 175, 55, 0.15),
        inset 0 1px 1px rgba(255, 255, 255, 0.95);
}

.view-mode-btn:active {
    transform: translateY(1.5px) scale(0.98);
}

.view-mode-btn.is-active {
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 4px 14px rgba(217, 119, 6, 0.35),
        inset 0 1px 1px rgba(255, 255, 255, 0.5),
        inset 0 -2px 0 rgba(0, 0, 0, 0.25);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

/* Cosmic Persona Hero Card (3D Luxury Plaque) */
.cosmic-archetype-card {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.12) 0%, rgba(184, 134, 11, 0.04) 100%), var(--bg-card);
    border: 1.5px solid rgba(212, 175, 55, 0.45);
    border-radius: 20px;
    padding: 1.6rem 1.8rem;
    margin-bottom: 1.4rem;
    box-shadow: 
        0 10px 28px -4px rgba(212, 175, 55, 0.14),
        0 4px 10px rgba(0, 0, 0, 0.03),
        inset 0 1px 1px rgba(255, 255, 255, 0.9),
        inset 0 -2px 0 rgba(212, 175, 55, 0.3);
}

.archetype-header-row {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    margin-bottom: 1rem;
}

.archetype-icon {
    font-size: 3rem;
    line-height: 1;
    filter: drop-shadow(0 4px 8px rgba(212, 175, 55, 0.3));
}

.archetype-titles {
    flex: 1;
}

.archetype-badge {
    font-size: 0.74rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--imperial-gold);
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.18) 0%, rgba(212, 175, 55, 0.06) 100%);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    border: 1px solid rgba(212, 175, 55, 0.35);
    box-shadow: 
        0 2px 6px rgba(212, 175, 55, 0.12),
        inset 0 1px 1px rgba(255, 255, 255, 0.6);
    display: inline-block;
    margin-bottom: 0.35rem;
}

.archetype-name {
    font-family: var(--font-serif);
    font-size: 1.45rem;
    font-weight: 900;
    color: var(--imperial-red);
    margin: 0 0 0.2rem 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.archetype-tagline {
    font-size: 0.9rem;
    font-weight: 650;
    color: var(--text-muted);
    margin: 0;
}

.archetype-quote-box {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-left: 4px solid var(--imperial-gold);
    border-radius: 0 12px 12px 0;
    padding: 0.8rem 1.15rem;
    margin-bottom: 1.15rem;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.archetype-quote {
    font-style: italic;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-main);
    margin: 0;
}

.archetype-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.85rem;
}

.archetype-box {
    background: var(--bg-card);
    border: 1px solid var(--border-warm);
    border-radius: 14px;
    padding: 0.9rem 1.05rem;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.03),
        inset 0 1px 1px rgba(255, 255, 255, 0.85);
    transition: all 0.2s ease;
}

.archetype-box:hover {
    border-color: var(--imperial-gold);
    transform: translateY(-2px);
    box-shadow: 
        0 8px 20px rgba(212, 175, 55, 0.12),
        inset 0 1px 1px rgba(255, 255, 255, 0.95);
}

.archetype-box-title {
    font-size: 0.78rem;
    font-weight: 850;
    color: var(--imperial-gold);
    display: block;
    margin-bottom: 0.35rem;
}

.archetype-box-content {
    font-size: 0.84rem;
    line-height: 1.5;
    color: var(--text-main);
    margin: 0;
}

/* Pillar Subtitle Tag */
.pillar-subtitle-tag {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border: 1px solid var(--border-warm);
    border-radius: 6px;
    padding: 0.1rem 0.4rem;
    margin: 0.2rem auto 0.4rem auto;
    max-width: 92%;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Simple Mode: Superpowers Card */
.simple-superpowers-card {
    background: var(--bg-card);
    border: 1px solid var(--border-warm);
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.simple-stars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.85rem;
}

.simple-star-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-warm);
    border-radius: 12px;
    padding: 0.85rem;
    transition: all 0.2s ease;
}

.simple-star-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.simple-star-item.is-annual-active {
    border-color: #d97706;
    background: rgba(217, 119, 6, 0.05);
}

.simple-star-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.simple-star-icon {
    font-size: 1.25rem;
}

.simple-star-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    flex: 1;
}

.simple-star-desc {
    font-size: 0.78rem;
    line-height: 1.4;
    color: var(--text-muted);
    margin: 0;
}

/* Simple Mode: Switch to Pro CTA Box */
.simple-cta-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.06) 0%, rgba(29, 78, 216, 0.02) 100%), var(--bg-card);
    border: 1.5px dashed rgba(37, 99, 235, 0.35);
    border-radius: 14px;
    padding: 1.25rem;
    margin-top: 1.25rem;
}

.simple-cta-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 250px;
}

.simple-cta-icon {
    font-size: 2.2rem;
}

.simple-cta-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0 0 0.25rem 0;
}

.simple-cta-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

.btn-switch-pro {
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 0.65rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-switch-pro:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

@media (max-width: 600px) {
    .simple-cta-box {
        flex-direction: column;
        align-items: stretch;
    }
    .btn-switch-pro {
        text-align: center;
    }
}

/* ==========================================
   RELATIONSHIP & SYNERGY MATCHER STYLES
   ========================================== */

.synergy-header {
    margin-bottom: 1.25rem;
}

.synergy-title {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0 0 0.25rem 0;
}

.synergy-subtitle {
    font-size: 0.84rem;
    color: var(--text-muted);
    margin: 0;
}

.synergy-rel-selector {
    display: flex;
    gap: 0.55rem;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    padding: 0.4rem;
    border-radius: 14px;
    border: 1px solid var(--border-warm);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.06),
        0 1px 0 rgba(255, 255, 255, 0.8);
    flex-wrap: wrap;
    box-sizing: border-box;
}

.rel-type-tab {
    flex: 1;
    min-width: 160px;
    text-align: center;
    padding: 0.65rem 0.95rem;
    border-radius: 10px;
    font-size: 0.86rem;
    font-weight: 750;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
    user-select: none;
    color: var(--text-muted);
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--border-warm);
    box-shadow: 
        0 2px 5px rgba(0, 0, 0, 0.04),
        inset 0 1px 1px rgba(255, 255, 255, 0.85),
        inset 0 -1px 1px rgba(0, 0, 0, 0.03);
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.rel-type-tab input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.rel-type-tab:hover {
    transform: translateY(-2px);
    color: var(--text-primary);
    border-color: rgba(212, 175, 55, 0.45);
    box-shadow: 
        0 6px 14px rgba(0, 0, 0, 0.08),
        inset 0 1px 1px rgba(255, 255, 255, 0.95);
}

.rel-type-tab:active {
    transform: translateY(1.5px) scale(0.98);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.15),
        0 1px 2px rgba(0, 0, 0, 0.05);
}

.rel-type-tab.is-active,
.rel-type-tab:has(input:checked) {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    transform: translateY(-1px);
}

/* 3D Radiant Thematic Active States */
#tab-rel-romance.is-active,
#tab-rel-romance:has(input:checked) {
    background: linear-gradient(180deg, #f43f5e 0%, #e11d48 50%, #be123c 100%);
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 
        0 6px 18px -2px rgba(225, 29, 72, 0.45),
        0 2px 6px rgba(159, 18, 57, 0.35),
        inset 0 1px 1.5px rgba(255, 255, 255, 0.65),
        inset 0 -2px 0 rgba(0, 0, 0, 0.25);
}

#tab-rel-business.is-active,
#tab-rel-business:has(input:checked) {
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 50%, #b45309 100%);
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 
        0 6px 18px -2px rgba(217, 119, 6, 0.45),
        0 2px 6px rgba(146, 64, 14, 0.35),
        inset 0 1px 1.5px rgba(255, 255, 255, 0.65),
        inset 0 -2px 0 rgba(0, 0, 0, 0.25);
}

#tab-rel-friendship.is-active,
#tab-rel-friendship:has(input:checked) {
    background: linear-gradient(180deg, #10b981 0%, #059669 50%, #047857 100%);
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 
        0 6px 18px -2px rgba(5, 150, 105, 0.45),
        0 2px 6px rgba(6, 95, 70, 0.35),
        inset 0 1px 1.5px rgba(255, 255, 255, 0.65),
        inset 0 -2px 0 rgba(0, 0, 0, 0.25);
}

.synergy-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.15rem;
    margin-bottom: 1.35rem;
}

.person-input-card {
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 1.5px solid var(--border-warm);
    border-radius: 16px;
    padding: 1.35rem;
    box-shadow: 
        0 6px 18px rgba(0, 0, 0, 0.03),
        inset 0 1px 1px rgba(255, 255, 255, 0.85);
}

.person-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.85rem;
}

.person-badge {
    font-size: 0.88rem;
    font-weight: 850;
    color: var(--imperial-gold);
}

.btn-sync-chart {
    font-size: 0.74rem;
    font-weight: 750;
    padding: 0.3rem 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.4);
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    color: var(--imperial-gold);
    cursor: pointer;
    box-shadow: 
        0 2px 6px rgba(0, 0, 0, 0.03),
        inset 0 1px 1px rgba(255, 255, 255, 0.85);
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    user-select: none;
}

.btn-sync-chart:hover {
    background: linear-gradient(180deg, var(--imperial-gold) 0%, #d97706 100%);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 
        0 4px 12px rgba(212, 175, 55, 0.3),
        inset 0 1px 1px rgba(255, 255, 255, 0.6);
}

.btn-sync-chart:active {
    transform: translateY(1px);
}

.synergy-action-bar {
    display: flex;
    justify-content: center;
    margin-bottom: 1.75rem;
}

.btn-primary-synergy {
    background: linear-gradient(180deg, #dc2626 0%, #b91c1c 55%, #991b1b 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 14px;
    padding: 0.95rem 2.5rem;
    font-size: 1rem;
    font-weight: 850;
    cursor: pointer;
    box-shadow: 
        0 6px 22px rgba(185, 28, 28, 0.38),
        inset 0 1px 1px rgba(255, 255, 255, 0.45),
        inset 0 -2.5px 0 rgba(0, 0, 0, 0.28);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    user-select: none;
}

.btn-primary-synergy:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 10px 28px rgba(185, 28, 28, 0.45),
        inset 0 1px 1px rgba(255, 255, 255, 0.55),
        inset 0 -2.5px 0 rgba(0, 0, 0, 0.28);
    filter: brightness(1.05);
}

.btn-primary-synergy:active {
    transform: translateY(2px) scale(0.99);
    box-shadow: 
        0 2px 6px rgba(185, 28, 28, 0.4),
        inset 0 2px 4px rgba(0, 0, 0, 0.35);
}

.synergy-results-wrap {
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
}

/* Synergy Hero Card (3D Luxury Plaque) */
.synergy-hero-card {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.12) 0%, rgba(184, 134, 11, 0.04) 100%), var(--bg-card);
    border: 1.5px solid rgba(212, 175, 55, 0.45);
    border-radius: 20px;
    padding: 1.6rem 1.8rem;
    box-shadow: 
        0 12px 32px -4px rgba(212, 175, 55, 0.15),
        0 4px 12px rgba(0, 0, 0, 0.03),
        inset 0 1px 1px rgba(255, 255, 255, 0.9),
        inset 0 -2px 0 rgba(212, 175, 55, 0.3);
}

.synergy-score-wrap {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.synergy-score-circle {
    width: 115px;
    height: 115px;
    border-radius: 50%;
    border: 4px solid var(--imperial-gold);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    box-shadow: 
        0 8px 24px rgba(212, 175, 55, 0.25),
        inset 0 2px 4px rgba(255, 255, 255, 0.9),
        inset 0 -2px 4px rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
    padding: 6px;
    box-sizing: border-box;
    text-align: center;
}

.synergy-score-num {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 900;
    color: var(--imperial-red);
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.synergy-score-label {
    font-size: 0.6rem;
    font-weight: 750;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.35px;
    margin-top: 0.25rem;
    max-width: 84px;
    line-height: 1.15;
    word-break: break-word;
    text-align: center;
}

.synergy-tier-badge {
    font-size: 0.78rem;
    font-weight: 850;
    padding: 0.28rem 0.85rem;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 0.35rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.synergy-names-headline {
    font-family: var(--font-serif);
    font-size: 1.45rem;
    font-weight: 850;
    color: var(--text-main);
    margin: 0 0 0.2rem 0;
}

.synergy-tagline-sub {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin: 0;
}

.archetype-bridge-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1.1rem;
    align-items: center;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border: 1px solid var(--border-warm);
    border-radius: 16px;
    padding: 1.1rem 1.4rem;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.03),
        inset 0 1px 1px rgba(255, 255, 255, 0.85);
}

.archetype-person-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.25rem;
}

.archetype-bridge-icon {
    font-size: 2.5rem;
    line-height: 1;
    filter: drop-shadow(0 2px 6px rgba(212, 175, 55, 0.25));
}

.archetype-bridge-name {
    font-size: 0.98rem;
    font-weight: 850;
    color: var(--text-main);
}

.archetype-bridge-role {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--imperial-gold);
}

.bridge-connection-pulse {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.pulse-icon {
    font-size: 1.45rem;
    animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {
    0%, 100% { transform: scale(1); opacity: 0.85; filter: drop-shadow(0 0 4px rgba(212, 175, 55, 0.4)); }
    50% { transform: scale(1.25); opacity: 1; filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.8)); }
}

.pulse-text {
    font-size: 0.7rem;
    font-weight: 750;
    color: var(--text-muted);
    white-space: nowrap;
}

/* 4 Dimensions */
.synergy-dimensions-card,
.synergy-pillars-section,
.synergy-insights-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border-warm);
    border-radius: 18px;
    padding: 1.4rem;
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.04),
        inset 0 1px 1px rgba(255, 255, 255, 0.85);
}

.dimension-gauges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.95rem;
}

.gauge-card {
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--border-warm);
    border-radius: 14px;
    padding: 0.95rem 1.05rem;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.03),
        inset 0 1px 1px rgba(255, 255, 255, 0.85);
    transition: all 0.2s ease;
}

.gauge-card:hover {
    border-color: var(--imperial-gold);
    transform: translateY(-2px);
    box-shadow: 
        0 8px 20px rgba(212, 175, 55, 0.12),
        inset 0 1px 1px rgba(255, 255, 255, 0.95);
}

.gauge-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 0.45rem;
    color: var(--text-main);
}

.gauge-bar-track {
    height: 8px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

.gauge-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* Synergy Pillars Grid */
.synergy-pillars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.syn-pillar-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-warm);
    border-radius: 12px;
    padding: 0.85rem;
    text-align: center;
}

.syn-pillar-card.syn-pillar-core {
    border: 1.5px solid var(--imperial-gold);
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.08) 0%, var(--bg-secondary) 100%);
}

.syn-pillar-title {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--imperial-gold);
    margin-bottom: 0.5rem;
}

.syn-pillar-duo {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.syn-duo-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.syn-duo-label {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.syn-duo-gz {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-main);
}

.syn-duo-gz.is-unknown-pillar {
    font-size: 0.92rem;
    color: var(--text-muted);
    font-style: italic;
    opacity: 0.75;
}

.syn-duo-vs {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
}

.syn-pillar-comment {
    font-size: 0.72rem;
    line-height: 1.35;
    color: var(--text-muted);
}

/* Highlights Grid */
.synergy-highlights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.85rem;
}

.syn-highlight-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-warm);
    border-radius: 12px;
    padding: 0.85rem;
}

.syn-highlight-item.is-challenge {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.05);
}

.syn-hl-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.syn-hl-icon {
    font-size: 1.25rem;
}

.syn-hl-title {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-main);
}

.syn-hl-desc {
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--text-muted);
    margin: 0;
}

/* Strategic Advice Box */
.synergy-advice-box {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.08) 0%, var(--bg-card) 100%);
    border-left: 4px solid var(--imperial-gold);
    border-radius: 0 14px 14px 0;
    padding: 1.1rem 1.35rem;
}

.advice-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.advice-icon {
    font-size: 1.35rem;
}

.advice-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--imperial-gold);
}

.advice-text {
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--text-main);
    margin: 0;
}

/* Dark Mode Overrides for Synergy Elements */
[data-theme="dark"] .synergy-rel-selector {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.2) 100%), var(--bg-secondary);
    box-shadow: 
        inset 0 2px 5px rgba(0, 0, 0, 0.5),
        0 1px 0 rgba(255, 255, 255, 0.06);
    border-color: rgba(212, 175, 55, 0.18);
}

[data-theme="dark"] .rel-type-tab {
    background: linear-gradient(180deg, var(--bg-card) 0%, rgba(20, 20, 20, 0.9) 100%);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 
        0 2px 5px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .rel-type-tab:hover {
    border-color: rgba(212, 175, 55, 0.5);
    box-shadow: 
        0 6px 14px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] #tab-rel-romance.is-active,
[data-theme="dark"] #tab-rel-romance:has(input:checked) {
    background: linear-gradient(180deg, #f43f5e 0%, #e11d48 50%, #be123c 100%);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 
        0 6px 20px rgba(244, 63, 94, 0.45),
        inset 0 1px 1.5px rgba(255, 255, 255, 0.7),
        inset 0 -2px 0 rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] #tab-rel-business.is-active,
[data-theme="dark"] #tab-rel-business:has(input:checked) {
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 50%, #b45309 100%);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 
        0 6px 20px rgba(245, 158, 11, 0.45),
        inset 0 1px 1.5px rgba(255, 255, 255, 0.7),
        inset 0 -2px 0 rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] #tab-rel-friendship.is-active,
[data-theme="dark"] #tab-rel-friendship:has(input:checked) {
    background: linear-gradient(180deg, #10b981 0%, #059669 50%, #047857 100%);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 
        0 6px 20px rgba(16, 185, 129, 0.45),
        inset 0 1px 1.5px rgba(255, 255, 255, 0.7),
        inset 0 -2px 0 rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .person-input-card,
[data-theme="dark"] .archetype-bridge-grid,
[data-theme="dark"] .gauge-card,
[data-theme="dark"] .syn-pillar-card,
[data-theme="dark"] .syn-highlight-item {
    background: var(--bg-secondary);
    border-color: var(--border-warm);
}

[data-theme="dark"] .btn-sync-chart {
    background: var(--bg-card);
}

[data-theme="dark"] .synergy-hero-card {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.12) 0%, rgba(30, 24, 18, 0.6) 100%), var(--bg-card);
}

[data-theme="dark"] .gauge-bar-track {
    background: rgba(255, 255, 255, 0.08);
}

@media print {
    body {
        background: none;
        padding: 0;
    }
    .bazi-form, .action-tools-bar, .app-footer, .btn-secondary-sm, .segmented-tab-nav, .master-nav-bar, .header-controls {
        display: none !important;
    }
    .chart-tab-panel.is-hidden {
        display: block !important;
    }
    .main-card {
        border: none;
        box-shadow: none;
        padding: 0;
    }
}

/* ============================================================
   Save-Image Fallback Modal (in-app-browser / iOS download safety)
   ============================================================ */
.save-image-fallback-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(20, 15, 10, 0.85);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.save-image-fallback-overlay.is-visible {
    display: flex;
}

.save-image-fallback-panel {
    position: relative;
    background: #fffdf8;
    border-radius: 12px;
    padding: 20px;
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.save-image-fallback-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.08);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 16px;
    cursor: pointer;
    line-height: 1;
}

.save-image-fallback-instruction {
    font-weight: 600;
    font-size: 15px;
    margin: 8px 0 16px;
    color: #2c221e;
}

.save-image-fallback-img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid #e7d9c0;
    -webkit-touch-callout: default;
}

/* ============================================================
   Reveal Hero — Animated Element & Day Master Ink-Bloom Reveal
   ============================================================ */
.reveal-hero {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: radial-gradient(120% 90% at 50% 0%, #17130f 0%, #0d0b0a 60%);
    padding: 32px 20px 26px;
    margin-bottom: 20px;
    text-align: center;
}
.reveal-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 25%, rgba(201, 164, 76, 0.08), transparent 42%),
        radial-gradient(circle at 82% 78%, rgba(201, 164, 76, 0.06), transparent 46%);
    pointer-events: none;
}
.reveal-eyebrow {
    position: relative;
    z-index: 2;
    font-family: "Cinzel", serif;
    font-size: 10.5px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #e9d8a6;
    opacity: 0;
    animation: revealFadeUp .6s ease forwards;
    animation-delay: .1s;
}
.reveal-glyph-wrap {
    position: relative;
    z-index: 2;
    margin: 16px auto 0;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.reveal-ring {
    position: absolute;
    inset: 22px;
    border-radius: 50%;
    border: 1px solid rgba(201, 164, 76, 0.35);
    opacity: 0;
    transform: scale(0.8);
    animation: revealRingIn .9s cubic-bezier(.2, .7, .3, 1) forwards;
    animation-delay: .25s;
}
.reveal-glyph {
    position: relative;
    z-index: 2;
    font-family: "Noto Serif SC", serif;
    font-weight: 900;
    font-size: 92px;
    line-height: 1;
    color: var(--reveal-accent, #c9a44c);
    text-shadow: 0 0 40px var(--reveal-glow, rgba(201, 164, 76, 0.5));
    filter: blur(14px);
    opacity: 0;
    transform: scale(1.3);
    animation: revealInkBloom 1s cubic-bezier(.2, .8, .25, 1) forwards;
    animation-delay: .4s;
}
.bagua-ring {
    position: absolute;
    inset: 0;
    opacity: 0;
    animation: revealBaguaFadeIn 1.1s ease forwards, revealBaguaSpin 100s linear infinite;
    animation-delay: .2s, 1.2s;
}
.trigram-slot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 22px;
    height: 22px;
    margin: -11px 0 0 -11px;
}
.trigram {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 13px;
    color: var(--reveal-accent, #c9a44c);
    opacity: 0.65;
    animation: revealBaguaCounterSpin 100s linear infinite;
    animation-delay: 1.2s;
}
@keyframes revealFadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes revealRingIn { to { opacity: 1; transform: scale(1); } }
@keyframes revealInkBloom { to { filter: blur(0px); opacity: 1; transform: scale(1); } }
@keyframes revealBaguaFadeIn { to { opacity: 1; } }
@keyframes revealBaguaSpin { to { transform: rotate(360deg); } }
@keyframes revealBaguaCounterSpin { to { transform: rotate(-360deg); } }

.reveal-names {
    position: relative;
    z-index: 2;
    margin-top: 16px;
    opacity: 0;
    animation: revealFadeUp .7s ease forwards;
    animation-delay: 1.1s;
}
.reveal-name-main {
    font-family: "Cinzel", serif;
    font-weight: 700;
    font-size: 21px;
    color: #f7f0e2;
    letter-spacing: 0.4px;
}
.reveal-name-sub {
    margin-top: 3px;
    font-size: 12px;
    color: #a89a82;
    letter-spacing: 0.8px;
}
.reveal-tagline {
    position: relative;
    z-index: 2;
    margin-top: 12px;
    font-size: 13px;
    line-height: 1.55;
    color: #cfc3ab;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0;
    animation: revealFadeUp .7s ease forwards;
    animation-delay: 1.35s;
}
.reveal-bars {
    position: relative;
    z-index: 2;
    margin: 18px auto 0;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    opacity: 0;
    animation: revealFadeUp .7s ease forwards;
    animation-delay: 1.55s;
}
.reveal-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    color: #a89a82;
}
.reveal-bar-label { width: 50px; text-align: right; letter-spacing: 0.4px; }
.reveal-bar-track {
    flex: 1;
    height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.07);
    overflow: hidden;
}
.reveal-bar-fill {
    height: 100%;
    border-radius: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--reveal-accent, #c9a44c), var(--reveal-accent-2, #8f7530));
    animation: revealGrowBar .9s ease forwards;
}
@keyframes revealGrowBar { to { width: var(--pct, 50%); } }
.reveal-bar-pct { width: 30px; text-align: left; }

.cosmic-archetype-card.is-hidden {
    display: none;
}

/* ============================================================
   Duo Compatibility Share Link
   ============================================================ */
.person-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-share-duo {
    background: linear-gradient(135deg, #b45309 0%, #991b1b 100%) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 2px 6px rgba(180, 83, 9, 0.25);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-share-duo:hover {
    background: linear-gradient(135deg, #d97706 0%, #b91c1c 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(180, 83, 9, 0.35);
}

.btn-tool-share {
    background: linear-gradient(135deg, #b45309 0%, #991b1b 100%) !important;
    color: #ffffff !important;
    border-color: transparent !important;
    font-weight: 700 !important;
}

.btn-tool-share:hover {
    background: linear-gradient(135deg, #d97706 0%, #b91c1c 100%) !important;
    color: #ffffff !important;
}

.duo-invite-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--imperial-gold-light, #fef3c7);
    border: 1px solid var(--imperial-gold-border, #fcd34d);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 13.5px;
    color: var(--text-main, #1c1917);
}

.duo-invite-banner.is-hidden {
    display: none;
}

.duo-invite-icon {
    font-size: 18px;
    flex-shrink: 0;
}


/* ============================================================
   Android & Mobile Responsive Optimization (<= 640px / <= 480px)
   ============================================================ */
@media (max-width: 640px) {
    body {
        padding: 0.85rem 0.5rem;
    }

    .page-wrapper {
        gap: 1.15rem;
    }

    .header-controls {
        gap: 0.35rem;
    }

    .btn-theme-toggle {
        padding: 0.3rem 0.55rem;
        font-size: 0.72rem;
    }

    .btn-google-login {
        padding: 0.3rem 0.65rem;
        font-size: 0.74rem;
    }

    .app-title {
        font-size: 1.45rem;
        line-height: 1.25;
    }

    .app-subtitle {
        font-size: 0.8rem;
        padding: 0 0.5rem;
    }

    .master-nav-bar,
    .calculator-sub-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        justify-content: flex-start;
        border-radius: 16px;
        padding: 4px;
        gap: 4px;
    }
    .master-nav-bar::-webkit-scrollbar,
    .calculator-sub-nav::-webkit-scrollbar {
        display: none;
    }

    .nav-tab,
    .sub-nav-tab {
        white-space: nowrap;
        flex-shrink: 0;
        padding: 0.45rem 0.85rem;
        font-size: 0.78rem;
        border-radius: 12px;
    }

    .main-card {
        padding: 1rem 0.75rem;
        border-radius: 14px;
    }

    .bazi-form {
        padding: 0.85rem;
        border-radius: 12px;
        gap: 0.85rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    input[type="text"],
    input[type="date"],
    input[type="time"],
    input[type="number"],
    select {
        min-height: 44px;
        font-size: 15px;
    }

    .btn-calculate {
        min-height: 48px;
        font-size: 1rem;
        border-radius: 10px;
    }

    .profiles-strip-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .profiles-strip-wrap::-webkit-scrollbar {
        display: none;
    }

    .segmented-tab-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        flex-wrap: nowrap;
        justify-content: flex-start;
        border-radius: 14px;
        padding: 4px;
        gap: 4px;
    }
    .segmented-tab-nav::-webkit-scrollbar {
        display: none;
    }

    .tab-btn {
        white-space: nowrap;
        flex-shrink: 0;
        padding: 0.45rem 0.75rem;
        font-size: 0.78rem;
    }

    .reveal-hero {
        padding: 22px 12px 18px;
        border-radius: 16px;
    }
    .reveal-glyph-wrap {
        width: 160px;
        height: 160px;
        margin: 12px auto 0;
    }
    .reveal-glyph {
        font-size: 72px;
    }

    .action-tools-bar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    .btn-action-tool {
        width: 100%;
        justify-content: center;
        padding: 0.6rem 0.4rem;
        font-size: 0.74rem;
    }

    .synergy-hero-card {
        padding: 1.25rem 0.85rem;
    }
    .synergy-score-circle {
        width: 98px;
        height: 98px;
    }
    .synergy-score-num {
        font-size: 1.65rem;
    }
    .synergy-score-label {
        font-size: 0.54rem;
        max-width: 76px;
    }
}

/* Universal Social Share Modal */
.social-share-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(18, 14, 10, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
    animation: fadeIn 0.2s ease-out;
}

.social-share-card {
    background: var(--bg-card);
    border: 1.5px solid var(--imperial-gold);
    border-radius: 18px;
    width: 100%;
    max-width: 440px;
    padding: 1.4rem;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    animation: scaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleUp {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.social-share-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 0.75rem;
}

.social-share-title {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--imperial-gold);
    margin: 0;
}

.btn-close-modal {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    line-height: 1;
    border-radius: 6px;
    transition: background 0.15s ease, color 0.15s ease;
}

.btn-close-modal:hover {
    background: var(--bg-secondary);
    color: var(--text-main);
}

.social-preview-box {
    background: var(--bg-secondary);
    border: 1px dashed var(--border-warm);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.social-preview-text {
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--text-main);
    margin: 0;
}

.social-preview-url {
    font-size: 0.72rem;
    color: var(--text-muted);
    word-break: break-all;
}

.social-preview-hint {
    font-size: 0.72rem;
    color: var(--imperial-gold, #b45309);
    font-weight: 600;
}

.social-buttons-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
}

.btn-social-channel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 0.6rem;
    border-radius: 10px;
    font-size: 0.84rem;
    font-weight: 700;
    text-decoration: none;
    color: #ffffff !important;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.btn-social-channel:hover,
.btn-social-channel:active {
    transform: translateY(-2px);
    filter: brightness(1.08);
}

.btn-social-whatsapp  { background: #25D366; }
.btn-social-instagram { background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); }
.btn-social-facebook  { background: #1877F2; }
.btn-social-telegram  { background: #0088cc; }
.btn-social-twitter   { background: #000000; border: 1px solid #333; }
.btn-social-line      { background: #06C755; }

.social-actions-bottom {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.btn-action-copy {
    background: var(--bg-secondary);
    border: 1px solid var(--border-warm);
    color: var(--text-main);
    font-weight: 700;
    font-size: 0.86rem;
    padding: 0.75rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-action-copy:hover {
    background: var(--bg-card);
    border-color: var(--imperial-gold);
    color: var(--imperial-gold);
}

.btn-native-share {
    background: linear-gradient(135deg, #d97706, #f59e0b);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #ffffff !important;
    font-weight: 800;
    font-size: 0.88rem;
    padding: 0.8rem;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35);
    transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.btn-native-share:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
    box-shadow: 0 6px 18px rgba(217, 119, 6, 0.45);
}

/* Instagram Share Guidance Box */
.instagram-instruction-box {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    animation: fadeIn 0.2s ease-out;
}

.ig-guide-title {
    font-size: 0.92rem;
    color: #e6683c;
    font-weight: 800;
}

.ig-guide-step-copied {
    color: #27ae60;
    font-size: 0.84rem;
    background: rgba(39, 174, 96, 0.1);
    border: 1px solid rgba(39, 174, 96, 0.3);
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
}

.ig-guide-steps {
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--text-main);
    margin: 0;
}

.btn-open-instagram-now {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: #ffffff !important;
    text-decoration: none;
    font-weight: 800;
    font-size: 0.85rem;
    padding: 0.55rem 1rem;
    border-radius: 8px;
    margin-top: 0.3rem;
    box-shadow: 0 4px 12px rgba(220, 39, 67, 0.25);
    transition: transform 0.15s ease, filter 0.15s ease;
}

.btn-open-instagram-now:hover,
.btn-open-instagram-now:active {
    transform: translateY(-1px);
    filter: brightness(1.08);
}

/* =========================================================
   HOME PORTAL & 3D TACTILE METAPHYSICS STYLES
   ========================================================= */
#page-home {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.home-hero-card {
    position: relative;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.12) 0%, rgba(185, 28, 28, 0.08) 100%), var(--bg-card);
    border: 1.5px solid rgba(212, 175, 55, 0.4);
    border-radius: 24px;
    padding: 2.2rem 1.85rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.95rem;
    box-shadow: 
        0 14px 36px -6px rgba(0, 0, 0, 0.08),
        0 4px 14px rgba(212, 175, 55, 0.12),
        inset 0 1px 1px rgba(255, 255, 255, 0.9),
        inset 0 -2px 0 rgba(212, 175, 55, 0.25);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.home-hero-badge {
    font-size: 0.78rem;
    font-weight: 850;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--imperial-gold);
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.18) 0%, rgba(212, 175, 55, 0.06) 100%);
    padding: 0.35rem 1rem;
    border-radius: 9999px;
    border: 1px solid rgba(212, 175, 55, 0.35);
    box-shadow: 
        0 2px 8px rgba(212, 175, 55, 0.15),
        inset 0 1px 1px rgba(255, 255, 255, 0.6);
}

.home-hero-title {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--imperial-red);
    margin: 0;
    line-height: 1.25;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.home-hero-subtitle {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-muted);
    max-width: 680px;
    margin: 0;
}

.home-hero-cta-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    justify-content: center;
    margin-top: 0.65rem;
}

.btn-primary-home {
    background: linear-gradient(180deg, #dc2626 0%, #b91c1c 55%, #991b1b 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 0.8rem 1.6rem;
    border-radius: 14px;
    font-weight: 800;
    font-size: 0.94rem;
    cursor: pointer;
    box-shadow: 
        0 6px 20px rgba(185, 28, 28, 0.38),
        inset 0 1px 1px rgba(255, 255, 255, 0.45),
        inset 0 -2.5px 0 rgba(0, 0, 0, 0.28);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    user-select: none;
}

.btn-primary-home:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 10px 28px rgba(185, 28, 28, 0.45),
        inset 0 1px 1px rgba(255, 255, 255, 0.55),
        inset 0 -2.5px 0 rgba(0, 0, 0, 0.28);
    filter: brightness(1.05);
}

.btn-primary-home:active {
    transform: translateY(2px) scale(0.98);
    box-shadow: 
        0 2px 6px rgba(185, 28, 28, 0.4),
        inset 0 2px 4px rgba(0, 0, 0, 0.35);
}

.btn-secondary-home {
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 1.5px solid var(--imperial-gold);
    color: var(--imperial-gold);
    padding: 0.8rem 1.6rem;
    border-radius: 14px;
    font-weight: 800;
    font-size: 0.94rem;
    cursor: pointer;
    box-shadow: 
        0 4px 14px rgba(212, 175, 55, 0.18),
        inset 0 1px 1px rgba(255, 255, 255, 0.9),
        inset 0 -2px 0 rgba(212, 175, 55, 0.3);
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    user-select: none;
}

.btn-secondary-home:hover {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    transform: translateY(-2px);
    box-shadow: 
        0 8px 22px rgba(212, 175, 55, 0.28),
        inset 0 1px 1px rgba(255, 255, 255, 0.95),
        inset 0 -2px 0 rgba(212, 175, 55, 0.35);
}

.btn-secondary-home:active {
    transform: translateY(2px) scale(0.98);
    box-shadow: 
        0 1px 4px rgba(212, 175, 55, 0.2),
        inset 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* Today's 4 Pillars & Tong Shu Box (3D Plaque) */
.home-today-container {
    background: var(--bg-card);
    border: 1.5px solid rgba(212, 175, 55, 0.3);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.05),
        inset 0 1px 1px rgba(255, 255, 255, 0.9),
        inset 0 -2px 0 rgba(0, 0, 0, 0.03);
}

.home-today-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 0.95rem;
}

.home-today-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.home-today-icon {
    font-size: 1.65rem;
}

.home-today-title {
    font-family: var(--font-serif);
    font-size: 1.18rem;
    font-weight: 800;
    color: var(--imperial-gold);
    margin: 0;
}

.home-today-date {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 600;
}

.btn-calc-now-home {
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.82rem;
    padding: 0.52rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 
        0 4px 12px rgba(217, 119, 6, 0.3),
        inset 0 1px 1px rgba(255, 255, 255, 0.5),
        inset 0 -2px 0 rgba(0, 0, 0, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    user-select: none;
}

.btn-calc-now-home:hover {
    transform: translateY(-1.5px);
    box-shadow: 
        0 6px 16px rgba(217, 119, 6, 0.4),
        inset 0 1px 1px rgba(255, 255, 255, 0.6),
        inset 0 -2px 0 rgba(0, 0, 0, 0.2);
}

.btn-calc-now-home:active {
    transform: translateY(1.5px);
    box-shadow: 
        0 1px 3px rgba(217, 119, 6, 0.3),
        inset 0 2px 3px rgba(0, 0, 0, 0.3);
}

/* Home Pillars Matrix Grid */
.home-pillars-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
}

.home-pillar-col {
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--border-warm);
    border-radius: 14px;
    padding: 0.95rem 0.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    box-shadow: 
        0 4px 10px rgba(0, 0, 0, 0.03),
        inset 0 1px 1px rgba(255, 255, 255, 0.8),
        inset 0 -1.5px 0 rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

.home-pillar-col:hover {
    border-color: var(--imperial-gold);
    transform: translateY(-2px);
    box-shadow: 
        0 8px 18px rgba(212, 175, 55, 0.15),
        inset 0 1px 1px rgba(255, 255, 255, 0.9);
}

.home-pillar-tag {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--imperial-red);
    letter-spacing: 0.04em;
}

.home-pillar-gz {
    font-family: var(--font-serif);
    font-size: 1.55rem;
    font-weight: 900;
    color: var(--text-main);
    line-height: 1.1;
    margin: 0.15rem 0;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

.home-pillar-nayin {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
}

@media (max-width: 640px) {
    .home-pillars-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 0.3rem;
    }

    .home-pillar-col {
        padding: 0.5rem 0.18rem;
        border-radius: 8px;
    }

    .home-pillar-tag {
        font-size: 0.65rem;
    }

    .home-pillar-gz {
        font-size: 1.18rem;
    }

    .home-pillar-nayin {
        font-size: 0.58rem;
    }
}

@media (max-width: 480px) {
    .home-pillars-grid {
        gap: 0.22rem;
    }

    .home-pillar-col {
        padding: 0.4rem 0.12rem;
        border-radius: 6px;
    }

    .home-pillar-tag {
        font-size: 0.58rem;
    }

    .home-pillar-gz {
        font-size: 1.05rem;
    }

    .home-pillar-nayin {
        font-size: 0.52rem;
    }
}

@media (max-width: 360px) {
    .home-pillar-gz {
        font-size: 0.96rem;
    }
}

/* Tong Shu Almanac Strip */
.home-tongshu-card {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border: 1px dashed rgba(212, 175, 55, 0.4);
    border-radius: 14px;
    padding: 1.1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.tongshu-data-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem;
    font-size: 0.86rem;
}

.tongshu-data-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-main);
}

.tongshu-label {
    font-weight: 700;
    color: var(--text-muted);
}

.tongshu-val-highlight {
    font-weight: 800;
    color: var(--imperial-gold);
}

.tongshu-yi-ji-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.95rem;
    border-top: 1px solid var(--border-subtle);
    padding-top: 0.85rem;
}

.tongshu-activities-col {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.tongshu-col-header {
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.tongshu-col-header.is-yi { color: #16a34a; }
.tongshu-col-header.is-ji { color: #dc2626; }

.tongshu-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tongshu-chip {
    font-size: 0.74rem;
    font-weight: 700;
    padding: 0.25rem 0.55rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.tongshu-chip.is-yi {
    background: rgba(22, 163, 74, 0.12);
    color: #15803d;
    border: 1px solid rgba(22, 163, 74, 0.3);
}

.tongshu-chip.is-ji {
    background: rgba(220, 38, 38, 0.1);
    color: #b91c1c;
    border: 1px solid rgba(220, 38, 38, 0.25);
}

/* Feature Portal Grid (3D Spatial Plaque Cards) */
.home-portal-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.home-portal-section-title {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--imperial-gold);
    margin: 0;
    text-align: center;
}

.home-portal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.1rem;
}

.home-portal-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border-warm);
    border-radius: 18px;
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.04),
        inset 0 1px 1px rgba(255, 255, 255, 0.8),
        inset 0 -2px 0 rgba(0, 0, 0, 0.02);
    transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.home-portal-card:hover {
    border-color: var(--imperial-gold);
    transform: translateY(-3px);
    box-shadow: 
        0 14px 32px rgba(212, 175, 55, 0.15),
        inset 0 1px 1px rgba(255, 255, 255, 0.95),
        inset 0 -2px 0 rgba(212, 175, 55, 0.3);
}

.portal-card-icon {
    font-size: 1.85rem;
    line-height: 1;
}

.portal-card-title {
    font-family: var(--font-serif);
    font-size: 1.08rem;
    font-weight: 800;
    color: var(--imperial-red);
    margin: 0;
}

.portal-card-desc {
    font-size: 0.84rem;
    line-height: 1.5;
    color: var(--text-muted);
    margin: 0;
    flex-grow: 1;
}

.btn-portal-launch {
    margin-top: 0.5rem;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border: 1px solid var(--border-warm);
    color: var(--text-main);
    font-weight: 800;
    font-size: 0.84rem;
    padding: 0.55rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 
        0 2px 6px rgba(0, 0, 0, 0.04),
        inset 0 1px 1px rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
    text-align: center;
    user-select: none;
}

.btn-portal-launch:hover {
    background: var(--bg-card);
    border-color: var(--imperial-gold);
    color: var(--imperial-gold);
    transform: translateX(3px);
    box-shadow: 
        0 4px 12px rgba(212, 175, 55, 0.2),
        inset 0 1px 1px rgba(255, 255, 255, 0.9);
}

.btn-portal-launch:active {
    transform: translateX(1px);
}

[data-theme="dark"] .home-hero-card {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.12) 0%, rgba(239, 68, 68, 0.08) 100%), var(--bg-card);
    border-color: rgba(212, 175, 55, 0.4);
    box-shadow: 
        0 16px 40px rgba(0, 0, 0, 0.6),
        0 4px 16px rgba(212, 175, 55, 0.15),
        inset 0 1px 1px rgba(255, 255, 255, 0.15),
        inset 0 -2px 0 rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .home-today-container,
[data-theme="dark"] .home-portal-card {
    border-color: rgba(212, 175, 55, 0.35);
    box-shadow: 
        0 12px 30px rgba(0, 0, 0, 0.4),
        inset 0 1px 1px rgba(255, 255, 255, 0.08),
        inset 0 -2px 0 rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .btn-portal-launch {
    background: linear-gradient(180deg, #242028 0%, #17151a 100%);
    border-color: rgba(212, 175, 55, 0.3);
    box-shadow: 
        0 2px 6px rgba(0, 0, 0, 0.3),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

@media (max-width: 640px) {
    .home-portal-grid {
        grid-template-columns: 1fr;
    }
    .tongshu-yi-ji-wrap {
        grid-template-columns: 1fr;
    }
}
