/* 繼承基礎變數 */
:root {
    --primary: #8b5cf6; /* 紫色系 */
    --primary-glow: rgba(139, 92, 246, 0.5);
    --secondary: #ec4899; /* 粉色系 */
    --text-main: #ffffff;
    --text-muted: #a1a1aa;
    
    --glass-bg: rgba(15, 23, 42, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
}

/* === 背景特效 === */
.bg-stars {
    position: fixed; inset: 0; z-index: -1;
    background-image: radial-gradient(white 1px, transparent 1px);
    background-size: 50px 50px; opacity: 0.1;
    animation: twinkle 5s infinite linear;
}

@keyframes twinkle {
    0% { opacity: 0.1; transform: translateY(0); }
    50% { opacity: 0.2; }
    100% { opacity: 0.1; transform: translateY(-20px); }
}

/* === 佈局 === */
.astro-container {
    max-width: 800px; margin: 0 auto; padding: 24px; min-height: 80vh;
}

.stage-section {
    width: 100%;
    position: relative;
}

.hero-text { text-align: center; margin-bottom: 40px; }
.hero-text h1 { font-size: 2rem; font-weight: 800; margin-bottom: 8px; background: linear-gradient(to right, #fff, #a5b4fc); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.date-badge { display: inline-block; padding: 4px 12px; background: rgba(255,255,255,0.1); border-radius: 20px; font-family: monospace; margin-top: 12px; color: var(--primary); border: 1px solid rgba(139, 92, 246, 0.3); }

/* === 星座 Grid === */
.zodiac-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 16px;
}

.zodiac-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px 10px;
    text-align: center;
    cursor: pointer;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex; flex-direction: column; align-items: center; gap: 8px;
}

.zodiac-card:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px -5px var(--primary-glow);
}

.z-icon { font-size: 2rem; color: var(--text-muted); transition: 0.3s; }
.zodiac-card:hover .z-icon { color: white; transform: scale(1.1); }
.z-name { font-size: 0.9rem; font-weight: 600; }
.z-date { font-size: 0.7rem; color: var(--text-muted); opacity: 0.7; }

/* === 結果卡片 === */
.result-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 32px;
    position: relative;
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.close-btn {
    position: absolute; top: 20px; right: 20px;
    background: transparent; border: none; color: var(--text-muted);
    font-size: 1.5rem; cursor: pointer; transition: 0.2s;
}
.close-btn:hover { color: white; transform: rotate(90deg); }

.astro-header { 
    display: flex; 
    align-items: center; 
    gap: 20px; 
    margin-bottom: 24px; 
    flex-wrap: wrap;
}
.astro-icon-large {
    width: 64px; height: 64px; background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 32px; color: white; box-shadow: 0 0 20px var(--primary-glow);
    flex-shrink: 0;
}
.astro-title-group {
    flex: 0 0 auto;
}
.astro-title-group h2 { font-size: 1.8rem; margin: 0; }
.date-range { color: var(--text-muted); font-size: 0.9rem; }

.daily-quote-inline {
    flex: 1;
    min-width: 200px;
    background: rgba(139, 92, 246, 0.1);
    border-left: 4px solid var(--primary);
    padding: 12px 16px;
    border-radius: 0 12px 12px 0;
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}
.quote-icon-inline {
    opacity: 0.3;
    font-size: 1.2rem;
    color: var(--primary);
    flex-shrink: 0;
}
.daily-quote-inline p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-main);
}

.total-score {
    margin-left: auto; 
    text-align: center;
    background: rgba(255,255,255,0.05); 
    padding: 8px 16px; 
    border-radius: 12px;
    flex-shrink: 0;
}
#resTotalScore { display: block; font-size: 1.8rem; font-weight: 800; color: #fbbf24; line-height: 1; }
.total-score small { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; }

.divider { height: 1px; background: var(--glass-border); margin: 20px 0; }

/* 運勢進度條 */
.luck-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.luck-item { margin-bottom: 8px; }
.luck-label { display: flex; align-items: center; gap: 6px; font-size: 0.9rem; margin-bottom: 6px; color: var(--text-muted); }
.progress-bar { height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; }
.fill { height: 100%; background: var(--primary); width: 0%; transition: width 1s ease-out; border-radius: 3px; }

/* 今日短評 */
.daily-short-review {
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
}
.short-review-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.short-review-header i {
    font-size: 1rem;
}
.daily-short-review p {
    margin: 0;
    color: var(--text-main);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* 幸運物 Tag */
.lucky-items { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.tag-item {
    background: rgba(255,255,255,0.03); border: 1px solid var(--glass-border);
    padding: 8px 16px; border-radius: 12px; flex: 1; min-width: 100px; text-align: center;
}
.tag-label { display: block; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; }
.tag-val { font-weight: 600; color: #e2e8f0; }

/* 運勢指數星級 */
.fortune-indices {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.fortune-index-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px;
}
.index-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.index-icon {
    font-size: 1.2rem;
}
.index-icon.overall { color: #10b981; }
.index-icon.love { color: #ec4899; }
.index-icon.career { color: #3b82f6; }
.index-icon.wealth { color: #f59e0b; }
.index-title {
    font-size: 0.9rem;
    color: var(--text-main);
    font-weight: 500;
}
.star-rating {
    display: flex;
    gap: 4px;
}
.star-rating i {
    font-size: 1.2rem;
    color: #fbbf24;
}

/* 詳細解析 */
.detailed-analysis {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
}
.analysis-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 20px 0;
    color: var(--text-main);
    text-align: center;
}
.analysis-item {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--glass-border);
}
.analysis-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.analysis-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.analysis-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
}
.analysis-stars {
    font-size: 0.9rem;
    color: #fbbf24;
    letter-spacing: 2px;
}
.analysis-text {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--text-muted);
}

.daily-quote {
    background: rgba(139, 92, 246, 0.1); border-left: 4px solid var(--primary);
    padding: 16px; border-radius: 0 12px 12px 0; position: relative;
}
.quote-icon { position: absolute; top: 10px; left: 10px; opacity: 0.2; font-size: 1.5rem; }
#resDesc { margin: 0; font-size: 0.95rem; line-height: 1.6; }

@media (max-width: 640px) {
    .zodiac-grid { grid-template-columns: repeat(3, 1fr); }
    .astro-header { 
        flex-direction: column; 
        text-align: center; 
        align-items: center;
    }
    .astro-title-group {
        width: 100%;
    }
    .daily-quote-inline {
        width: 100%;
        margin: 12px 0;
        min-width: auto;
    }
    .total-score { 
        margin-left: 0; 
        margin-top: 12px; 
        width: 100%; 
    }
    .luck-grid { grid-template-columns: 1fr; }
    .fortune-indices { grid-template-columns: 1fr; }
    .lucky-items .tag-item { min-width: calc(50% - 6px); }
}