:root {
    --bg-dark: #020412;
    --card-glass: rgba(13, 17, 38, 0.65);
    --card-border: rgba(255, 255, 255, 0.08);
    --accent: #00f2ff;
    /* Cyber Cyan */
    --accent-alt: #ff007a;
    /* Neon Magenta */
    --gold: #FFD700;
    --text: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.6);
    --grad-main: linear-gradient(135deg, #00f2ff, #7000ff);
    --grad-surface: linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
    --shadow-neon: 0 0 30px rgba(0, 242, 255, 0.2);
}

/* ULTRA-LARGE PRIMARY BUTTON STYLES */
.generate-btn, .btn-primary, #btn-generate { 
    display: block !important; 
    width: 100% !important; 
    padding: 28px !important; 
    background: var(--grad-main) !important; 
    color: #000 !important; 
    border: none !important; 
    border-radius: 25px !important; 
    font-size: 1.8rem !important; 
    font-weight: 900 !important; 
    letter-spacing: 10px !important; 
    cursor: pointer !important; 
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    margin: 40px 0 !important;
    box-shadow: 0 15px 45px rgba(0, 242, 255, 0.4) !important;
    text-transform: uppercase !important;
    font-family: 'Outfit', 'Noto Sans TC', sans-serif !important;
    text-align: center !important;
}

.generate-btn:hover, .btn-primary:hover, #btn-generate:hover {
    transform: translateY(-8px) scale(1.03) !important;
    box-shadow: 0 25px 60px rgba(0, 242, 255, 0.6) !important;
    filter: brightness(1.2) !important;
}

/* UNIQUE ACTION BUTTONS */
#btn-generate-composite {
    background: linear-gradient(135deg, #ff007a, #7000ff) !important;
    box-shadow: 0 15px 45px rgba(255, 0, 122, 0.4) !important;
}

#btn-generate-composite:hover {
    box-shadow: 0 25px 60px rgba(255, 0, 122, 0.6) !important;
}

#btn-generate-group {
    background: linear-gradient(135deg, #00ff88, #00b4ff) !important;
    box-shadow: 0 15px 45px rgba(0, 255, 136, 0.4) !important;
    color: #000 !important;
}

#btn-generate-group:hover {
    box-shadow: 0 25px 60px rgba(0, 255, 136, 0.6) !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', 'Noto Sans TC', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Moving Aura Background */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 20% 30%, #1a1b4b 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, #2e0854 0%, transparent 40%);
    overflow: hidden;
}

.background::after {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background-image: url('https://www.transparenttextures.com/patterns/stardust.png');
    opacity: 0.2;
    animation: rotateBg 120s linear infinite;
}

@keyframes rotateBg {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 60px 20px;
}

header {
    text-align: center;
    margin-bottom: 80px;
}

h1 {
    font-family: 'Noto Serif TC', serif;
    font-weight: 900;
    font-size: clamp(1.4rem, 5vw, 2.6rem);
    letter-spacing: clamp(2px, 1vw, 6px);
    background: linear-gradient(to right, #fff, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    text-shadow: 0 0 40px rgba(0, 242, 255, 0.3);
    margin-bottom: 5px;
}

#site-url {
    font-size: 0.95rem;
    color: var(--accent);
    opacity: 0.8;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 4px;
    font-weight: 700;
    margin-bottom: 15px;
    text-transform: lowercase;
    text-shadow: 0 0 10px rgba(0, 242, 255, 0.3);
}

.header-announcement {
    margin-top: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.header-announcement h2 {
    font-size: 1.1rem;
    color: #00f2ff;
    margin-bottom: 5px;
    font-weight: 600;
    letter-spacing: 3px;
    text-shadow: 0 0 15px rgba(0, 242, 255, 0.4);
    font-family: 'Outfit', sans-serif;
}

.disclaimer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

#disclaimer-text {
    font-size: 0.82rem;
    letter-spacing: 1px;
    color: var(--text);
    opacity: 0.9;
    font-weight: 400;
    background: rgba(0, 242, 255, 0.03);
    padding: 12px 25px;
    border-radius: 50px;
    border: 1px solid rgba(0, 242, 255, 0.2);
    text-align: center;
    max-width: 850px;
    line-height: 1.6;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    backdrop-filter: blur(5px);
}

font-size: 0.82rem;
color: var(--text-muted);
opacity: 0.7;
letter-spacing: 1px;
}

.tip {
    font-size: 0.8rem;
    color: var(--accent);
    opacity: 0.9;
    font-weight: 500;
}

/* New Header & Nav Styles */
.main-header {
    margin-bottom: 40px !important;
}

.main-header .subtitle {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-top: 10px;
    letter-spacing: 2px;
}

.main-nav {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 60px;
    flex-wrap: wrap;
}

.nav-item {
    color: var(--text-muted);
    text-decoration: none;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 2px;
    padding: 8px 15px;
    border-radius: 12px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
}

.nav-item:hover {
    color: var(--accent);
    background: rgba(0, 242, 255, 0.05);
    border-color: rgba(0, 242, 255, 0.2);
    transform: translateY(-2px);
}

.nav-item.active {
    color: var(--accent);
    background: rgba(0, 242, 255, 0.1);
    border-color: rgba(0, 242, 255, 0.3);
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.15);
}

/* SPECIAL STYLE FOR COMPOSITE TABS */
.nav-composite {
    background: linear-gradient(135deg, rgba(255, 0, 122, 0.1), rgba(0, 242, 255, 0.1)) !important;
    border-color: rgba(255, 0, 122, 0.3) !important;
    color: #ffb3d9 !important;
}

.nav-composite:hover {
    background: linear-gradient(135deg, rgba(255, 0, 122, 0.2), rgba(0, 242, 255, 0.2)) !important;
    border-color: #ff007a !important;
    box-shadow: 0 0 15px rgba(255, 0, 122, 0.3);
}

.nav-group {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.1), rgba(255, 215, 0, 0.1)) !important;
    border-color: rgba(0, 255, 136, 0.3) !important;
    color: #b3ffd9 !important;
}

.nav-group:hover {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.2), rgba(255, 215, 0, 0.2)) !important;
    border-color: #00ff88 !important;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}

/* Top Bar & Share Bar Styles */
.top-bar {
    width: 100%;
    background: rgba(13, 17, 38, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    padding: 10px 0;
    position: relative;
    z-index: 2000;
}

.top-bar-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.brand-info {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
    letter-spacing: 0.5px;
}

.brand-line.sites {
    color: rgba(255, 255, 255, 0.4);
}

.brand-line .highlight {
    color: var(--accent);
    font-weight: 700;
}

.share-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Language Switcher Styles */
.lang-switcher {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 2px;
    overflow: hidden;
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    min-width: 32px;
}

.lang-btn:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.lang-btn.active {
    background: var(--accent);
    color: #000;
}

.share-sep {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 4px;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Outfit', sans-serif;
}

.share-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.share-icon {
    font-size: 0.8rem;
}

/* Share Button Brand Colors */
.util-btn {
    border-color: rgba(0, 242, 255, 0.2);
}

.util-btn:hover {
    background: rgba(0, 242, 255, 0.15);
    border-color: var(--accent);
}

.fb:hover {
    background: rgba(24, 119, 242, 0.2);
    border-color: #1877F2;
    color: #1877F2;
}

.line:hover {
    background: rgba(6, 199, 85, 0.2);
    border-color: #06C755;
    color: #06C755;
}

.xtwit:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #fff;
    color: #fff;
}

.ig:hover {
    background: linear-gradient(135deg, rgba(252, 175, 69, 0.2), rgba(188, 42, 141, 0.2));
    border-color: #E4405F;
    color: #E4405F;
}

.email:hover {
    background: rgba(234, 67, 53, 0.2);
    border-color: #EA4335;
    color: #EA4335;
}

.tg:hover {
    background: rgba(38, 165, 228, 0.2);
    border-color: #26A5E4;
    color: #26A5E4;
}

.wa:hover {
    background: rgba(37, 211, 102, 0.2);
    border-color: #25D366;
    color: #25D366;
}

.threads:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: #fff;
}

.reddit:hover {
    background: rgba(255, 69, 0, 0.2);
    border-color: #FF4500;
    color: #FF4500;
}

.linkedin:hover {
    background: rgba(10, 102, 194, 0.2);
    border-color: #0A66C2;
    color: #0A66C2;
}

.copy:hover {
    background: rgba(255, 215, 0, 0.15);
    border-color: #FFD700;
    color: #FFD700;
}

.native:hover {
    background: rgba(0, 242, 255, 0.15);
    border-color: var(--accent);
    color: var(--accent);
}

@media (max-width: 900px) {
    .top-bar-content {
        justify-content: center;
        text-align: center;
    }

    .brand-info {
        width: 100%;
        margin-bottom: 5px;
    }
}

@media (max-width: 600px) {
    .share-label {
        display: none;
    }

    .share-btn {
        padding: 6px 8px;
    }

    .share-icon {
        font-size: 0.9rem;
    }

    #disclaimer-text {
        flex-direction: column;
        padding: 15px;
        border-radius: 20px;
    }
}

.disclaimer-container {
    margin-top: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#disclaimer-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(0, 242, 255, 0.05);
    border: 1px solid rgba(0, 242, 255, 0.15);
    padding: 12px 25px;
    border-radius: 50px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1.6;
}

#disclaimer-text svg {
    min-width: 18px;
    margin-top: -5px;
    /* Up */
    margin-left: 8px;
    /* Right */
    opacity: 0.4;
    filter: drop-shadow(0 0 5px var(--accent));
}

header p {
    color: var(--text-muted);
    letter-spacing: clamp(2px, 1vw, 6px);
    font-size: clamp(0.7rem, 2vw, 0.9rem);
    margin-top: -5px;
}

.astro-reference {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.astro-tag {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: 0.3s;
}

.astro-tag:hover {
    background: rgba(0, 242, 255, 0.1);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 242, 255, 0.2);
}

/* Glass Card Global */
.glass-card {
    background: var(--card-glass);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--card-border);
    border-radius: 32px;
    padding: 40px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.03), transparent);
    animation: sweep 8s infinite;
}

@keyframes sweep {
    0% {
        left: -100%;
    }

    20% {
        left: 100%;
    }

    100% {
        left: 100%;
    }
}

/* Form Styling */
.tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 40px;
    justify-content: center;
}

.tab {
    padding: 12px 30px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
}

.tabs-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
}

.tab {
    background: #1a2332;
    color: #fff;
    padding: 12px 25px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: 0.4s;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tab.active {
    background: #00f2ff;
    color: #000;
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.6);
    font-weight: 700;
}

.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.input-group.location-group,
.input-group.timezone-group {
    grid-column: span 2;
}

@media (max-width: 800px) {

    .input-group.location-group,
    .input-group.timezone-group {
        grid-column: span 1;
    }
}

.input-group label {
    display: block;
    color: var(--accent);
    font-size: 0.75rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.input-group input:not([type="checkbox"]),
.input-group select {
    width: 100%;
    background: rgba(13, 17, 23, 0.8);
    border: 1px solid #30363d;
    border-radius: 12px;
    color: #fff;
    padding: 12px 5px;
    text-align: center;
    font-size: 1.05rem;
    font-weight: 700;
    transition: 0.3s;
    appearance: none;
    cursor: pointer;
}

.input-group select {
    text-align-last: center;
    background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%),
        linear-gradient(135deg, var(--accent) 50%, transparent 50%);
    background-position: calc(100% - 15px) calc(1em + 2px),
        calc(100% - 10px) calc(1em + 2px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.solar-toggle-group {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 5px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

#use-solar-time {
    appearance: none;
    -webkit-appearance: none;
    width: 48px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    transition: 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

#use-solar-time:checked {
    background: var(--accent);
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.4);
}

#use-solar-time::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    background: #fff;
    transition: 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

#use-solar-time:checked::before {
    left: 26px;
    background: #000;
}

.info-tooltip-container {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(0, 242, 255, 0.1);
    border: 1px solid var(--accent);
    color: var(--accent);
    font-size: 11px;
    font-weight: 900;
    margin-left: 4px;
    cursor: help;
    transition: 0.3s;
}

.info-icon:hover {
    background: var(--accent);
    color: #000;
    box-shadow: 0 0 10px var(--accent);
}

.info-tooltip {
    position: absolute;
    bottom: 150%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: 260px;
    padding: 15px;
    background: rgba(13, 17, 23, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(0, 242, 255, 0.3);
    border-radius: 15px;
    color: #fff;
    font-size: 0.8rem;
    line-height: 1.5;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    opacity: 0;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    text-align: left;
}

.info-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -8px;
    border-width: 8px;
    border-style: solid;
    border-color: rgba(0, 242, 255, 0.3) transparent transparent transparent;
}

.info-tooltip-container:hover .info-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

@media (max-width: 600px) {
    .info-tooltip {
        width: 220px;
        left: auto;
        right: -20px;
        transform: translateY(10px);
    }

    .info-tooltip::after {
        left: auto;
        right: 25px;
    }

    .info-tooltip-container:hover .info-tooltip {
        transform: translateY(0);
    }
}

.gender-selection {
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#site-url {
    font-family: 'Orbitron', sans-serif;
    color: var(--accent);
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 5px;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(0, 242, 255, 0.4);
}

.section-label {
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: #fff;
    font-size: 0.9rem;
}

input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

#lunar-details {
    margin-bottom: 20px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    font-size: 0.9rem;
    cursor: pointer;
}

input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

input:focus {
    border-color: var(--accent);
    background: rgba(0, 0, 0, 0.5);
    outline: none;
    box-shadow: 0 0 15px var(--accent);
}

.taiji-info-card {
    background: rgba(0, 242, 255, 0.05);
    border: 1px solid rgba(0, 242, 255, 0.2);
    border-radius: 12px;
    padding: 15px;
    margin-top: 20px;
    margin-bottom: 30px;
    text-align: left;
}

.taiji-title {
    color: var(--accent);
    font-size: 1rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.taiji-content p {
    font-size: 0.85rem;
    color: #fff;
    margin-bottom: 12px;
    line-height: 1.6;
}

.taiji-features {
    list-style: none;
    padding: 0;
}

.taiji-features li {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.taiji-features li::before {
    content: "►";
    color: var(--accent);
}

.taiji-features li span {
    color: #fff;
    font-weight: 600;
    min-width: 70px;
}

.slots-info {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
}

.slots-info p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.slots-info span {
    color: var(--accent);
    font-weight: 800;
    margin-right: 2px;
}

.btn-primary {
    display: block;
    width: 100%;
    padding: 18px;
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 900;
    letter-spacing: 4px;
    cursor: pointer;
    transition: 0.4s;
}

.primary-btn {
    width: 100%;
    padding: 22px;
    border-radius: 70px;
    background: var(--grad-main);
    color: #000;
    font-size: 1.3rem;
    font-weight: 800;
    border: none;
    cursor: pointer;
    transition: 0.4s;
    text-transform: uppercase;
    letter-spacing: 3px;
    box-shadow: 0 10px 40px rgba(0, 242, 255, 0.2);
}

.primary-btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 60px rgba(0, 242, 255, 0.4);
    filter: brightness(1.1);
}

.master-grid-container {
    width: 100%;
    overflow-x: auto;
    padding: 20px 0 40px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
}

/* Grid Layout v1.18.28 */
.master-grid-container {
    width: 100%;
    overflow-x: auto;
    padding: 20px 0 40px;
}

.master-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    justify-content: center;
    gap: 10px;
    margin-bottom: 40px;
    min-width: 1000px; /* Ensure 9 columns don't crush too much */
}

.pillar {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px 5px;
    text-align: center;
    transition: 0.3s;
    min-height: 280px;
}

/* Color Distinction */
.temporal-pillar {
    border-color: rgba(0, 242, 255, 0.3);
    background: linear-gradient(180deg, rgba(0, 242, 255, 0.05) 0%, transparent 100%);
}

.natal-pillar {
    border-color: rgba(255, 215, 0, 0.3);
    background: linear-gradient(180deg, rgba(255, 215, 0, 0.05) 0%, transparent 100%);
}

.cycle-active {
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.2);
    transform: translateY(-5px);
}

.col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 5px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    margin-bottom: 10px;
}

.col-header h4 {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.pillar-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-bottom: 5px;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 242, 255, 0.2);
    border-radius: 4px;
    color: rgba(0, 242, 255, 0.6);
    cursor: pointer;
    font-size: 0.6rem;
    padding: 1px 6px;
    transition: 0.2s;
    line-height: 1;
    width: 28px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav-btn:hover {
    background: rgba(0, 242, 255, 0.1);
    color: #00f2ff;
    border-color: #00f2ff;
    box-shadow: 0 0 8px rgba(0, 242, 255, 0.3);
}

.pillar-name {
    font-size: 0.75rem;
    font-weight: 900;
    color: var(--text);
    opacity: 0.8;
    letter-spacing: 1px;
    margin: 2px 0;
}

.shishen {
    font-size: 0.7rem;
    font-weight: bold;
    color: var(--gold);
    margin-bottom: 8px;
    min-height: 1.1em;
}

.gan,
.zhi {
    font-family: 'Noto Serif TC', serif;
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
    margin: 8px 0;
    cursor: pointer;
    transition: 0.3s;
}

.gan.active-taiji {
    color: var(--accent);
    text-shadow: 0 0 15px var(--accent);
}

/* Elements */
.element-wood {
    color: #2ecc71;
}

.element-fire {
    color: #ff4757;
}

.element-earth {
    color: #f1c40f;
}

.element-metal {
    color: #ecf0f1;
}

.element-water {
    color: #3498db;
}

/* Relation Tags */
.rel-row {
    min-height: 24px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    margin: 4px 0;
}

.rel-tag {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    color: #000;
    font-weight: 900;
}

.rel-type-he {
    background: #2ecc71;
}

.rel-type-chong {
    background: #ff4757;
}

.rel-type-hai {
    background: #f39c12;
}

.rel-type-xing {
    background: #e67e22;
}

.rel-temporal {
    background: rgba(139, 148, 158, 0.1) !important;
    color: #8b949e !important;
    border-color: rgba(139, 148, 158, 0.3) !important;
}

.rel-dayun {
    background: rgba(231, 76, 60, 0.15) !important;
    color: #ff4757 !important;
    border-color: rgba(231, 76, 60, 0.4) !important;
    font-weight: 900;
}

.canggan-box {
    margin: 20px 0;
    padding: 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
}

.canggan-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    margin: 3px 0;
    padding: 0 5px;
}

.shishen-zhi {
    font-size: 0.65rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 5px;
    margin-top: 5px;
    line-height: 1.6;
}

.zhi-ss {
    display: block;
    color: var(--gold);
}

.shensha-box {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 40px;
}

.lifestage-box {
    margin-top: 8px;
    padding: 6px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ls-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
}

.ls-item small {
    color: var(--text-muted);
}

.ls-item span {
    color: var(--accent);
    font-weight: 700;
}


.ss-tag-minor {
    opacity: 0.6;
    font-size: 0.65rem;
    background: rgba(255, 255, 255, 0.02);
}

.ss-tag-tiny {
    opacity: 0.35;
    font-size: 0.6rem;
    background: transparent;
    border-color: rgba(255, 255, 255, 0.05);
    padding: 1px 3px;
}

.ss-tag {
    display: inline-block;
    padding: 2px 6px;
    font-size: 0.65rem;
    border-radius: 4px;
    margin: 1px;
    background: rgba(255, 215, 0, 0.15);
    color: var(--gold);
    border: 1px solid rgba(255, 215, 0, 0.3);
    white-space: nowrap;
}

.ss-tag-kui-gang {
    background: rgba(255, 69, 0, 0.25) !important;
    color: #ff4500 !important;
    border-color: #ff4500 !important;
    font-weight: 800;
    box-shadow: 0 0 5px rgba(255, 69, 0, 0.5);
}

.ss-tag-void {
    background: rgba(255, 0, 0, 0.2) !important;
    color: #ff4757 !important;
    border-color: #ff4757 !important;
    font-weight: 800;
}

.ss-tag-peach {
    background: rgba(255, 105, 180, 0.2) !important;
    color: #ff69b4 !important;
    border-color: #ff69b4 !important;
}

.ss-tag-horse {
    background: rgba(0, 191, 255, 0.2) !important;
    color: #00bfff !important;
    border-color: #00bfff !important;
}

/* Memory Slots - TRENDY STYLE */
.memory-slots {
    margin-top: 60px;
}

.slots-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
}

.slot-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: 0.3s;
    position: relative;
    padding: 5px;
}

.slot-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
    color: #fff;
    transform: translateY(-3px);
}

.slot-btn.has-data {
    border-color: rgba(0, 242, 255, 0.4);
    color: var(--accent);
}

.slot-del {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background: #ff4d4d;
    color: #fff;
    border-radius: 4px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    box-shadow: 0 2px 5px rgba(255, 77, 77, 0.4);
    z-index: 5;
}

.slot-btn.has-data:hover .slot-del {
    display: flex;
}

/* Handle touch devices: remove hover-triggered delete to fix double-tap issue */
@media (hover: none) {
    .slot-btn:hover {
        transform: none;
    }

    .slot-btn.has-data .slot-del {
        display: flex;
        opacity: 0.8;
        width: 18px;
        height: 18px;
        top: -3px;
        right: -3px;
        background: #007aff;
        box-shadow: 0 4px 10px rgba(0, 122, 255, 0.4);
    }

    .slot-btn:not(.has-data) .slot-del {
        display: none !important;
    }
}

/* Cycle Explorer */
.cycle-columns {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-top: 25px;
}

.cycle-col h4 {
    font-size: 0.75rem;
    color: var(--accent);
    margin-bottom: 15px;
    text-transform: uppercase;
    text-align: center;
    letter-spacing: 1px;
}

.scroll-list {
    height: 350px;
    overflow-y: auto;
    padding-right: 5px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

.cycle-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    padding: 8px;
    margin-bottom: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.item-meta {
    font-size: 0.8rem;
    opacity: 0.9;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 5px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 5px;
    gap: 2px;
}

.item-meta span {
    display: block;
    width: 100%;
    text-align: center;
}

.item-meta span:last-child {
    color: var(--gold);
    font-size: 0.75rem;
}

.cycle-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.cycle-item.active {
    background: rgba(0, 242, 255, 0.1);
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.1);
}

/* Person Info Header */
.chart-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 25px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.02);
}

#person-info {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 2px;
}

footer {
    text-align: center;
    margin-top: 100px;
    padding: 60px;
    border-top: 1px solid var(--card-border);
    opacity: 1;
    font-weight: bold;
    font-size: 0.9rem;
}

/* Mobile Optimization */
.master-grid-container {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 20px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
}

@media (max-width: 1200px) {
    .master-grid {
        grid-template-columns: repeat(9, 138.6px);
    }

    .pillar {
        min-height: auto;
    }
}

@media (max-width: 768px) {

    /* ── Overall Container ── */
    body {
        padding: 6px;
    }

    .container {
        padding: 15px 8px;
    }

    header {
        margin-bottom: 20px;
    }

    h1 {
        font-size: clamp(0.8rem, 4vw, 1.6rem);
        letter-spacing: clamp(1px, 0.5vw, 3px);
        margin-bottom: 6px;
    }

    .glass-card {
        padding: 14px 10px;
        border-radius: 16px;
        margin-bottom: 16px;
    }

    /* ── A. Input Form & Buttons ── */
    .tabs-container,
    #tabs {
        gap: 6px;
        margin-bottom: 14px;
    }

    .tab {
        padding: 6px 12px;
        font-size: 0.75rem;
        border-radius: 25px;
    }

    .input-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        margin-bottom: 12px;
    }

    .input-group label {
        font-size: 0.6rem;
        margin-bottom: 4px;
    }

    .input-group input {
        padding: 7px 3px;
        font-size: 0.75rem;
        border-radius: 8px;
    }

    .radio-label {
        font-size: 0.7rem;
        gap: 6px;
    }

    input[type="radio"],
    input[type="checkbox"] {
        width: 12px;
        height: 12px;
    }

    .checkbox-label {
        font-size: 0.7rem;
    }

    .generate-btn, .btn-primary, #btn-generate {
        padding: 24px !important;
        font-size: 1.4rem !important;
        letter-spacing: 5px !important;
        border-radius: 18px !important;
        margin: 25px 0 !important;
    }

    /* 記憑槽 */
    #slots-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 5px;
    }

    .slot-btn {
        min-height: 30px;
        font-size: 0.6rem;
        padding: 3px;
        border-radius: 8px;
    }

    .memory-slots {
        margin-top: 20px;
    }

    .memory-slots ul {
        font-size: 0.65rem;
        line-height: 1.5;
    }

    /* ── B. Main Chart Grid ── */
    .chart-header {
        padding: 8px 6px;
        border-radius: 12px;
        margin-bottom: 12px;
    }

    #person-info {
        font-size: 0.75rem;
        letter-spacing: 0.5px;
        white-space: normal;
        word-break: break-all;
    }

    .master-grid {
        /* flexbox 分兩排：natal 4 格 × 25% = 第一排；temporal 5 格 × 20% = 第二排 */
        display: flex;
        flex-wrap: wrap;
        gap: 3px;
        margin-bottom: 16px;
        width: 100%;
    }

    /* 年月日時柱：4 格一排（各 25%）*/
    .master-grid .pillar.natal-pillar {
        width: calc(25% - 3px);
        flex-shrink: 0;
    }

    /* 大運流年流月流日流時：5 格一排（各 20%）*/
    .master-grid .pillar.temporal-pillar {
        width: calc(20% - 3px);
        flex-shrink: 0;
    }

    .pillar {
        padding: 6px 2px;
        min-height: 240px;
        border-radius: 10px;
    }

    .pillar-name {
        font-size: 0.5rem;
        margin-bottom: 6px;
        letter-spacing: 1px;
    }

    .pillar-name-item {
        font-size: 0.5rem;
    }

    .shishen {
        font-size: 0.55rem;
        margin-bottom: 4px;
    }

    .gan,
    .zhi {
        font-size: 1.6rem;
        margin: 3px 0;
    }

    .canggan-box {
        margin: 6px 0;
        padding: 4px;
        border-radius: 6px;
    }

    .canggan-item {
        font-size: 0.5rem;
        margin: 1px 0;
    }

    .shishen-zhi {
        font-size: 0.5rem;
        padding-top: 5px;
        margin-top: 5px;
        line-height: 1.5;
    }

    .shensha-box {
        margin-top: 6px;
        gap: 2px;
        min-height: 30px;
    }

    .ss-tag {
        font-size: 0.5rem;
        padding: 1px 3px;
        border-radius: 3px;
    }

    .rel-tag {
        font-size: 0.5rem;
        padding: 1px 3px;
    }

    .ss-row {
        gap: 2px;
    }

    .taiji-label {
        font-size: 0.45rem;
    }

    /* ── C. 週期探究欄目（縮小 50%） ── */
    .cycle-columns {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .cycle-col h4 {
        font-size: 0.6rem;
        margin-bottom: 6px;
        letter-spacing: 0.5px;
    }

    .scroll-list {
        height: 175px;
    }

    .cycle-item {
        padding: 4px 6px;
        margin-bottom: 4px;
        border-radius: 6px;
    }

    .item-info {
        font-size: 0.7rem;
    }

    .item-gz {
        font-size: 0.85rem !important;
    }

    .item-meta {
        font-size: 0.6rem;
        padding-top: 3px;
        gap: 1px;
    }

    .item-meta span:last-child {
        font-size: 0.55rem;
    }

    small {
        font-size: 0.6rem;
    }

    /* ── D. 分析報告文件（優化 + 縮小 50%），上下分布 ── */
    .analysis-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 10px 6px;
    }

    .analysis-card {
        padding: 10px 8px;
        border-radius: 10px;
    }

    .analysis-header {
        font-size: 0.7rem;
        letter-spacing: 1px;
        margin-bottom: 8px;
        padding-bottom: 6px;
    }

    .balance-text,
    .health-text,
    .balance-status,
    .advice-item,
    .pattern-card {
        font-size: 0.65rem;
        line-height: 1.6;
    }

    .balance-status {
        padding: 6px 8px;
        border-radius: 8px;
    }

    .favored-list {
        font-size: 0.65rem;
        padding: 6px 8px;
        border-radius: 8px;
    }

    /* 五行雷達圖 */
    .wuxing-section {
        padding: 12px 8px;
    }

    .wuxing-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .radar-container svg {
        width: 100%;
        height: auto;
    }

    .wuxing-stats .stat-card {
        padding: 6px 8px;
        border-radius: 8px;
    }

    .stat-name {
        font-size: 0.6rem;
    }

    .stat-count {
        font-size: 0.65rem;
    }

    /* 地支團圖 */
    .rel-map-container {
        padding: 8px 4px;
    }

    .rel-connector-label {
        font-size: 0.55rem;
    }

    .rel-guide-item {
        font-size: 0.65rem;
        padding: 8px;
    }

    .rel-guide-item-title {
        font-size: 0.65rem;
    }

    /* 關係彙總 */
    .rel-table {
        font-size: 0.6rem;
    }

    .rel-table th,
    .rel-table td {
        padding: 4px 3px;
    }

    .rel-type-status {
        font-size: 0.55rem;
        padding: 1px 4px;
    }

    .pattern-warnings-box {
        padding: 6px;
    }

    .pattern-card {
        padding: 8px;
        border-radius: 8px;
        margin-bottom: 8px;
    }

    /* 納音列 */
    .nayin-bar {
        padding: 8px 6px;
    }

    .nayin-item {
        font-size: 0.6rem;
        padding: 4px 6px;
    }

    /* footer */
    footer {
        margin-top: 25px;
        padding: 20px 8px;
        font-size: 0.65rem;
    }
}

/* Custom Scrollbar for Mobile Grid */
.master-grid-container::-webkit-scrollbar {
    height: 6px;
}

.master-grid-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.master-grid-container::-webkit-scrollbar-thumb {
    background: rgba(0, 242, 255, 0.2);
    border-radius: 10px;
}

.master-grid-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 242, 255, 0.4);
}

/* 刑沖會合關係圖 (Interaction View) */
.interaction-view {
    margin-top: 40px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.interaction-header {
    margin-bottom: 25px;
    border-left: 4px solid var(--accent);
    padding-left: 15px;
}

.interaction-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--white);
}

.interaction-header p {
    margin: 5px 0 0;
    font-size: 0.85rem;
    color: var(--gray);
}

.rel-map-container {
    padding-top: 20px;
    position: relative;
    min-height: 250px;
    margin-left: auto;
    width: 60%;
    /* Align with Natal Pillars */
}

.pillar-names-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin-bottom: 30px;
    text-align: center;
}

.pillar-name-item {
    font-weight: 800;
}

.pillar-name-gz {
    display: block;
    font-size: 1.4rem;
    color: var(--white);
    letter-spacing: 2px;
}

.pillar-name-label {
    display: block;
    font-size: 0.8rem;
    color: var(--gray);
    margin-top: 5px;
}

.interaction-layer {
    position: relative;
    height: 60px;
    margin-bottom: 15px;
}

.interaction-layer-label {
    position: absolute;
    left: -120px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    width: 100px;
    text-align: right;
    font-weight: 800;
}

.rel-connector {
    position: absolute;
    height: 2px;
    top: 50%;
    transform: translateY(-50%);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.rel-connector::before,
.rel-connector::after {
    content: "";
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    top: -3px;
    box-shadow: 0 0 5px currentColor;
}

.rel-connector::before {
    left: 0;
}

.rel-connector::after {
    right: 0;
}

.rel-connector-label {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    white-space: nowrap;
    padding: 2px 10px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.6);
    font-weight: 800;
    backdrop-filter: blur(4px);
    border: 1px solid currentColor;
}

/* Color Schemes */
.rel-type-he {
    background: #4caf50;
    color: #4caf50;
}

.rel-type-he::before,
.rel-type-he::after {
    background: #4caf50;
}

.rel-type-chong {
    background: #ff5252;
    color: #ff5252;
}

.rel-type-chong::before,
.rel-type-chong::after {
    background: #ff5252;
}

.rel-type-hai {
    background: #ffb74d;
    color: #ffb74d;
}

.rel-type-hai::before,
.rel-type-hai::after {
    background: #ffb74d;
}

.rel-type-xing {
    background: #ba68c8;
    color: #ba68c8;
}

.rel-type-xing::before,
.rel-type-xing::after {
    background: #ba68c8;
}

.rel-type-po {
    background: #00bcd4;
    color: #00bcd4;
}

.rel-type-po::before,
.rel-type-po::after {
    background: #00bcd4;
}


/* 五行雷達圖 (Wuxing Radar Chart) */
.wuxing-section {
    margin-top: 40px;
    padding: 30px;
}

.wuxing-grid {
    display: grid;
    grid-template-columns: 1.2fr 1.2fr 1fr;
    gap: 30px;
    align-items: center;
}

.pie-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 15px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}


.wuxing-stats {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateX(10px);
    background: rgba(255, 255, 255, 0.06);
}

.stat-info .stat-name {
    font-size: 1.1rem;
    font-weight: 800;
    margin-right: 10px;
}

.stat-info .stat-count {
    font-size: 0.85rem;
    color: var(--gray);
}

.radar-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1;
    margin: 0 auto;
}

#wuxing-radar-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 15px rgba(0, 242, 255, 0.2));
}

.radar-grid-line {
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 1;
    fill: none;
}

.radar-axis {
    stroke: rgba(255, 255, 255, 0.2);
    stroke-width: 1;
}

.radar-area {
    fill: rgba(0, 242, 255, 0.2);
    stroke: var(--accent);
    stroke-width: 3;
    stroke-linejoin: round;
}

.radar-point {
    fill: var(--accent);
    stroke: #fff;
    stroke-width: 2;
}

.radar-label {
    fill: var(--white);
    font-size: 14px;
    font-weight: 800;
    text-anchor: middle;
}


/* 人生 K 線圖 (Life Fortune K-Line) */
.kline-section {
    margin-top: 40px;
    padding: 30px;
    position: relative;
    overflow: hidden;
}

.kline-container {
    width: 100%;
    height: 350px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

#fortune-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.kline-axis-x,
.kline-axis-y {
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 1;
}

.kline-label-text {
    fill: var(--gray);
    font-size: 10px;
}

.kline-line {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2.5;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 8px rgba(0, 242, 255, 0.5));
}

.kline-area {
    fill: linear-gradient(180deg, rgba(0, 242, 255, 0.2) 0%, rgba(0, 242, 255, 0) 100%);
    opacity: 0.3;
}

.kline-ma10 {
    fill: none;
    stroke: var(--gold);
    stroke-width: 1.5;
    stroke-dasharray: 4 2;
    opacity: 0.6;
}

.kline-current-marker {
    stroke: var(--accent);
    stroke-width: 1;
    stroke-dasharray: 3 3;
}

.kline-marker-text {
    fill: var(--accent);
    font-size: 11px;
    font-weight: 800;
}

.kline-legend {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--gray);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}


/* 分析與養生建議 (Analysis & Wellness) */
.analysis-section {
    margin-top: 40px;
}

.analysis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 30px;
}

.analysis-card {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid var(--accent);
}

.analysis-header {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 15px;
    color: var(--white);
}

.balance-text,
.health-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--gray);
}

.balance-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    background: var(--accent);
    color: var(--bg);
    font-weight: 900;
    margin-bottom: 10px;
}

.favored-list {
    margin-top: 10px;
    color: var(--gold);
    font-weight: 800;
}

.advice-item {
    margin-top: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
}

.advice-target {
    color: var(--white);
    font-weight: 800;
}


/* 地支關係導引樣式 */
.rel-guide-container {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.rel-guide-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 15px;
}

.rel-guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.rel-guide-item {
    background: rgba(255, 255, 255, 0.02);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.rel-guide-item-title {
    font-weight: 900;
    margin-bottom: 12px;
    font-size: 1rem;
    padding: 6px 12px;
    border-radius: 6px;
    display: inline-block;
    color: #000 !important;
}

.rel-guide-item-text {
    font-size: 0.9rem;
    color: var(--gray);
    line-height: 1.6;
    text-align: justify;
}

.rel-guide-item-title.rel-type-he {
    background-color: #2ecc71;
}

.rel-guide-item-title.rel-type-chong {
    background-color: #ff4757;
}

.rel-guide-item-title.rel-type-hai {
    background-color: var(--gold);
}

.rel-guide-item-title.rel-type-xing {
    background-color: #a55eea;
}

.rel-guide-item-title.rel-type-po {
    background-color: #f7b731;
}


/* 關係圖連接線標籤配色同步 */
.rel-connector.rel-type-he {
    background: #2ecc71;
}

.rel-connector.rel-type-chong {
    background: #ff4757;
}

.rel-connector.rel-type-hai {
    background: var(--gold);
}

.rel-connector.rel-type-xing {
    background: #a55eea;
}

.rel-connector.rel-type-po {
    background: #f7b731;
}

.rel-connector .rel-connector-label {
    color: #fff !important;
}


/* 人類圖 (Human Design) 樣式 */
.hd-section {
    margin-top: 40px;
    padding: 30px;
}

.hd-flex-container {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    justify-content: center;
    align-items: start;
    margin-top: 30px;
}

.bodygraph-container {
    width: 380px;
    height: 500px;
    position: relative;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 20px;
}

.hd-info-panel {
    flex: 1;
    min-width: 300px;
}

.hd-type-badge {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--accent);
    margin-bottom: 20px;
    text-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

.hd-detail-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.hd-detail-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 15px;
    border-radius: 12px;
    border-left: 3px solid var(--accent);
}

.hd-label {
    font-size: 0.8rem;
    color: var(--gray);
    margin-bottom: 5px;
}

.hd-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--white);
}

.hd-description {
    margin-top: 30px;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--gray);
    text-align: justify;
    padding: 20px;
    background: rgba(255, 255, 255, 0.01);
    border-radius: 12px;
}

.center-defined {
    fill: var(--accent);
    stroke: var(--white);
    stroke-width: 2;
    transition: all 0.5s;
}

.center-undefined {
    fill: rgba(255, 255, 255, 0.05);
    stroke: rgba(255, 255, 255, 0.2);
    stroke-width: 1;
    transition: all 0.5s;
}

.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: var(--accent);
}

.relation-summary-section {
    margin-top: 40px;
    margin-bottom: 40px;
}

.rel-group h4 {
    color: #f1c40f;
    margin-bottom: 15px;
    font-weight: 800;
    letter-spacing: 1px;
    border-left: 4px solid #00ffff;
    padding-left: 15px;
}

.rel-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 15px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    overflow: hidden;
    font-size: 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.rel-table th {
    background: rgba(255, 255, 255, 0.05);
    color: #f1c40f;
    text-align: left;
    padding: 15px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.rel-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: top;
}

.rel-table tr:last-child td {
    border-bottom: none;
}

.rel-type-status {
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 900;
    display: inline-block;
    white-space: nowrap;
}

.r-合 {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.r-沖 {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.r-刑 {
    background: rgba(155, 89, 182, 0.15);
    color: #9b59b2;
    border: 1px solid rgba(155, 89, 182, 0.3);
}

.r-害 {
    background: rgba(230, 126, 34, 0.15);
    color: #e67e22;
    border: 1px solid rgba(230, 126, 34, 0.3);
}

.r-破 {
    background: rgba(52, 152, 219, 0.15);
    color: #3498db;
    border: 1px solid rgba(52, 152, 219, 0.3);
}

.rel-desc {
    color: #cfd8dc;
    line-height: 1.8;
    text-align: justify;
    font-size: 0.9rem;
}

@media (max-width: 900px) {
    .rel-table {
        display: block;
    }

    .rel-table thead {
        display: none;
    }

    .rel-table tbody {
        display: block;
    }

    .rel-table tr {
        display: block;
        border-bottom: 2px solid rgba(255, 255, 255, 0.1);
        padding: 15px 0;
    }

    .rel-table td {
        display: block;
        width: 100%;
        border-bottom: none;
        padding: 5px 15px;
    }

    .rel-table td::before {
        content: attr(data-label);
        font-weight: 800;
        color: #f1c40f;
        display: block;
        margin-bottom: 5px;
        font-size: 0.75rem;
    }
}

.pattern-warnings-box {
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.pattern-card {
    padding: 20px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-left: 5px solid transparent;
    animation: card-pulse 3s infinite ease-in-out;
}

.p-warning {
    border-left-color: #f1c40f;
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.1);
}

.p-danger {
    border-left-color: #ff4757;
    box-shadow: 0 0 15px rgba(255, 71, 87, 0.1);
}

.p-title {
    font-weight: 900;
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: #fff;
    letter-spacing: 1px;
}

.p-desc {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #cfd8dc;
    text-align: justify;
}

@keyframes card-pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.005);
        background: rgba(255, 255, 255, 0.03);
    }

    100% {
        transform: scale(1);
    }
}

.group-row {
    background: rgba(0, 255, 255, 0.03);
}

.rel-type-status.r-會 {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
    border: 1px solid rgba(52, 152, 219, 0.4);
}

.ss-tag-taiji {
    background: rgba(155, 89, 182, 0.2);
    color: #e1bee7;
    border: 1px solid rgba(155, 89, 182, 0.4);
}

.ss-tag-guoyin {
    background: rgba(192, 57, 43, 0.2);
    color: #ffab91;
    border: 1px solid rgba(192, 57, 43, 0.4);
}

.ss-tag-gold-god {
    background: rgba(241, 196, 15, 0.2);
    color: #fff176;
    border: 1px solid rgba(241, 196, 15, 0.4);
}

.brand-line a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    transition: 0.3s;
}

.brand-line a:hover {
    color: var(--accent);
    border-color: var(--accent);
    text-shadow: 0 0 10px var(--accent);
}

.brand-line {
    font-size: 0.85rem;
    color: #fff;
    line-height: 1.5;
    opacity: 0.9;
}

.taiji-label {
    font-size: 0.65rem;
    color: #00ffff;
    font-weight: 900;
    margin-left: 3px;
    vertical-align: middle;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.8);
}

.gan.active-taiji,
.zhi.active-taiji {
    border: 2px solid #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
    border-radius: 8px;
    transform: scale(1.05);
    z-index: 10;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ===== 三大功能按鍵 v1.0 ===== */
.action-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin: 0 0 36px 0;
    padding: 20px 30px;
    background: rgba(0, 242, 255, 0.04);
    border: 1px solid rgba(0, 242, 255, 0.12);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    flex-wrap: wrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 50px;
    border: 1px solid transparent;
    font-family: 'Outfit', 'Noto Sans TC', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    text-decoration: none;
}

.action-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.action-btn:hover::before {
    opacity: 1;
}

.btn-print {
    background: rgba(0, 242, 255, 0.1);
    border-color: rgba(0, 242, 255, 0.4);
    color: #00f2ff;
}

.btn-print:hover {
    background: rgba(0, 242, 255, 0.22);
    border-color: #00f2ff;
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.35);
    transform: translateY(-3px) scale(1.04);
    color: #fff;
}

.btn-share {
    background: rgba(255, 0, 122, 0.1);
    border-color: rgba(255, 0, 122, 0.4);
    color: #ff007a;
}

.btn-share:hover {
    background: rgba(255, 0, 122, 0.22);
    border-color: #ff007a;
    box-shadow: 0 0 20px rgba(255, 0, 122, 0.35);
    transform: translateY(-3px) scale(1.04);
    color: #fff;
}

.btn-save {
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.4);
    color: #FFD700;
}

.btn-save:hover {
    background: rgba(255, 215, 0, 0.22);
    border-color: #FFD700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.35);
    transform: translateY(-3px) scale(1.04);
    color: #fff;
}

.btn-taiji {
    background: #ffffff;
    border-color: #ff4757;
    color: #ff4757;
    font-weight: 800;
}

.btn-taiji:hover {
    background: #ff4757;
    border-color: #ff4757;
    box-shadow: 0 0 20px rgba(255, 71, 87, 0.4);
    transform: translateY(-3px) scale(1.04);
    color: #fff;
}

.btn-ref {
    background: rgba(33, 150, 243, 0.1);
    border-color: rgba(33, 150, 243, 0.4);
    color: #2196F3;
}

.btn-ref:hover {
    background: rgba(33, 150, 243, 0.22);
    border-color: #2196F3;
    box-shadow: 0 0 20px rgba(33, 150, 243, 0.35);
    transform: translateY(-3px) scale(1.04);
    color: #fff;
}

.btn-manual {
    background: rgba(155, 89, 182, 0.1);
    border-color: rgba(155, 89, 182, 0.4);
    color: #9b59b2;
}

.btn-manual:hover {
    background: rgba(155, 89, 182, 0.22);
    border-color: #9b59b2;
    box-shadow: 0 0 20px rgba(155, 89, 182, 0.35);
    transform: translateY(-3px) scale(1.04);
    color: #fff;
}

.btn-top {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    margin-left: auto;
    /* Push to the right if space allows */
}

.btn-top:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #fff;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    transform: translateY(-3px) scale(1.04);
}

.action-btn:active {
    transform: translateY(0) scale(0.97);
    transition: transform 0.1s;
}

@media (max-width: 600px) {
    .action-bar {
        gap: 10px;
        padding: 16px 15px;
    }

    .action-btn {
        padding: 10px 18px;
        font-size: 0.85rem;
        letter-spacing: 1px;
    }
}

@media print {

    .action-bar,
    .controls-card,
    #cycle-explorer,
    footer {
        display: none !important;
    }

    body,
    .container {
        background: #fff !important;
        color: #000 !important;
    }

    .glass-card {
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }
}

/* ===== 分享平台選單 v1.5 (absolute 向上展開，不依賴 JS 座標計算) ===== */
.share-wrapper {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    z-index: 1000;
}

.share-panel {
    /* 相對於 share-wrapper，向上展開，無需 JS 計算座標 */
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    z-index: 9999;
    background: rgba(10, 14, 30, 0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 0, 122, 0.25);
    border-radius: 20px;
    padding: 20px 18px 16px;
    min-width: 280px;
    white-space: nowrap;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 30px rgba(255, 0, 122, 0.1);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.share-panel.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.share-panel-title {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.share-platforms {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.share-plat {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 11px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    color: #fff;
    font-family: 'Outfit', 'Noto Sans TC', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.share-plat:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(4px);
}

.plat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 900;
    flex-shrink: 0;
    transition: box-shadow 0.2s;
}

/* Facebook */
.plat-fb {
    background: #1877F2;
    color: #fff;
    font-family: Georgia, serif;
    font-size: 1.2rem;
}

#share-fb:hover {
    border-color: rgba(24, 119, 242, 0.5);
}

#share-fb:hover .plat-fb {
    box-shadow: 0 0 12px rgba(24, 119, 242, 0.6);
}

/* Instagram */
.plat-ig {
    background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    color: #fff;
    font-size: 0.9rem;
}

#share-ig:hover {
    border-color: rgba(220, 39, 67, 0.5);
}

#share-ig:hover .plat-ig {
    box-shadow: 0 0 12px rgba(220, 39, 67, 0.6);
}

/* LINE */
.plat-line {
    background: #06C755;
    color: #fff;
    font-family: Georgia, serif;
    font-size: 1.2rem;
}

#share-line:hover {
    border-color: rgba(6, 199, 85, 0.5);
}

#share-line:hover .plat-line {
    box-shadow: 0 0 12px rgba(6, 199, 85, 0.6);
}

/* X (Twitter) */
.plat-x {
    background: #000;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.85rem;
}

#share-x:hover {
    border-color: rgba(255, 255, 255, 0.3);
}

#share-x:hover .plat-x {
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.25);
}

/* E-mail */
.plat-email {
    background: #EA4335;
    color: #fff;
    font-size: 1.05rem;
    font-style: italic;
}

#share-email:hover {
    border-color: rgba(234, 67, 53, 0.5);
}

#share-email:hover .plat-email {
    box-shadow: 0 0 12px rgba(234, 67, 53, 0.6);
}

/* IG 備註文字 */
#share-ig span:last-child::after {
    content: ' (複製連結)';
    font-size: 0.72rem;
    opacity: 0.5;
    font-weight: 400;
}

@media (max-width: 600px) {
    .share-panel {
        min-width: 240px;
    }
}

/* AI Analysis Section Styles (v1.18.8) */
#ai-analysis-section {
    margin-top: 30px;
    padding: 35px;
    border: 1px dashed rgba(100, 100, 255, 0.3);
    background: rgba(0, 0, 0, 0.4);
    border-radius: 32px;
    animation: fadeIn 0.8s ease-out;
    text-align: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-header {
    margin-bottom: 30px;
}

.ai-gift-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 15px;
}

.ai-header h3 {
    color: #ffda44;
    font-size: 1.3rem;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(255, 218, 68, 0.4);
    line-height: 1.4;
}

.ai-header p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    line-height: 1.7;
    max-width: 750px;
    margin: 0 auto;
}

/* Restored Primary Button Styles */
.generate-btn, .btn-primary, #btn-generate { 
    display: block !important; 
    width: 100% !important; 
    padding: 22px !important; 
    background: var(--grad-main) !important; 
    color: #000 !important; 
    border: none !important; 
    border-radius: 20px !important; 
    font-size: 1.4rem !important; 
    font-weight: 900 !important; 
    letter-spacing: 6px !important; 
    cursor: pointer !important; 
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    margin: 30px 0 !important;
    box-shadow: 0 10px 30px rgba(0, 242, 255, 0.3) !important;
    text-transform: uppercase !important;
    font-family: 'Outfit', 'Noto Sans TC', sans-serif !important;
}

.generate-btn:hover, .btn-primary:hover, #btn-generate:hover {
    transform: translateY(-5px) scale(1.02) !important;
    box-shadow: 0 20px 50px rgba(0, 242, 255, 0.5) !important;
    filter: brightness(1.1) !important;
}

.ai-buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin: 30px 0;
}

.ai-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 20px;
    border-radius: 16px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    backdrop-filter: blur(10px);
}

.ai-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.4);
}

/* Smaller AI Buttons v1.18.69 */
.ai-buttons-grid-sm {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin: 15px 0 30px 0;
    width: 90%;
    margin-left: auto;
    margin-right: auto;
}

.ai-btn-sm {
    padding: 12px 15px;
    font-size: 0.85rem;
    border-radius: 12px;
}

.ai-btn-sm .ai-icon {
    font-size: 1rem;
    margin-right: 8px;
}

.gemini-btn {
    background: linear-gradient(135deg, rgba(255, 218, 68, 0.15), rgba(184, 134, 11, 0.25));
    color: #ffda44;
    border-color: rgba(255, 218, 68, 0.3);
}

.chatgpt-btn {
    background: linear-gradient(135deg, rgba(16, 163, 127, 0.15), rgba(9, 121, 105, 0.25));
    color: #10a37f;
    border-color: rgba(16, 163, 127, 0.3);
}

.perplexity-btn {
    background: linear-gradient(135deg, rgba(50, 100, 150, 0.15), rgba(25, 50, 80, 0.25));
    color: #4da3ff;
    border-color: rgba(50, 100, 150, 0.3);
}

.copilot-btn {
    background: linear-gradient(135deg, rgba(255, 140, 0, 0.15), rgba(200, 100, 0, 0.25));
    color: #ff8c00;
    border-color: rgba(255, 140, 0, 0.3);
}

.ai-icon {
    margin-right: 12px;
    font-size: 1.2rem;
}

.ai-copy-container {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

.copy-prompt-btn {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 3px 10px;
    border-radius: 15px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    transition: all 0.3s;
    font-weight: 400;
    box-shadow: none;
    margin: 0 auto;
    display: block;
    width: fit-content;
    opacity: 0.5;
}

.copy-prompt-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    opacity: 1;
}

.copy-icon {
    margin-right: 6px;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .ai-buttons-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .ai-buttons-grid {
        grid-template-columns: 1fr;
    }

    .ai-header h3 {
        font-size: 1.1rem;
    }

    #ai-analysis-section {
        padding: 25px 15px;
    }
}