/* ==========================================
   上升星座计算器 - 星空主题样式
   ========================================== */

/* CSS 变量定义 */
:root {
    --bg-deep: #0a0a1a;
    --bg-primary: #0d0d24;
    --bg-secondary: #121230;
    --bg-card: rgba(20, 20, 50, 0.85);
    --bg-card-hover: rgba(30, 30, 70, 0.9);
    
    --text-primary: #e8e8f0;
    --text-secondary: #a0a0c0;
    --text-muted: #6a6a8a;
    
    --accent-primary: #7b68ee;
    --accent-secondary: #9370db;
    --accent-glow: rgba(123, 104, 238, 0.4);
    --accent-gold: #ffd700;
    --accent-gold-dim: rgba(255, 215, 0, 0.3);
    
    --border-subtle: rgba(123, 104, 238, 0.2);
    --border-active: rgba(123, 104, 238, 0.5);
    
    --gradient-cosmic: linear-gradient(135deg, #1a1a3a 0%, #0d0d24 50%, #1a0a2e 100%);
    --gradient-accent: linear-gradient(135deg, #7b68ee 0%, #9370db 100%);
    --gradient-gold: linear-gradient(135deg, #ffd700 0%, #ffb347 100%);
    
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 30px rgba(123, 104, 238, 0.2);
    --shadow-gold: 0 0 20px rgba(255, 215, 0, 0.3);
    
    --font-display: 'Noto Serif SC', 'Georgia', serif;
    --font-body: 'Noto Sans SC', 'Helvetica Neue', Arial, sans-serif;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* 基础重置 */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--gradient-cosmic);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* ==========================================
   星空背景动画
   ========================================== */
.stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.stars, .stars2, .stars3 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 200%;
    background-repeat: repeat;
}

.stars {
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #fff, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 90px 40px, #fff, transparent),
        radial-gradient(2px 2px at 160px 120px, rgba(255,255,255,0.9), transparent),
        radial-gradient(1px 1px at 230px 80px, #fff, transparent),
        radial-gradient(2px 2px at 300px 150px, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 370px 50px, #fff, transparent),
        radial-gradient(2px 2px at 440px 180px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 510px 100px, #fff, transparent),
        radial-gradient(2px 2px at 580px 60px, rgba(255,255,255,0.9), transparent);
    background-size: 600px 300px;
    animation: starsMove 80s linear infinite;
    opacity: 0.8;
}

.stars2 {
    background-image: 
        radial-gradient(1px 1px at 50px 50px, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 100px 150px, rgba(255,255,255,0.5), transparent),
        radial-gradient(2px 2px at 200px 100px, rgba(147,112,219,0.7), transparent),
        radial-gradient(1px 1px at 300px 200px, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 400px 50px, rgba(255,255,255,0.6), transparent),
        radial-gradient(2px 2px at 500px 180px, rgba(123,104,238,0.6), transparent);
    background-size: 550px 300px;
    animation: starsMove 120s linear infinite;
    opacity: 0.6;
}

.stars3 {
    background-image: 
        radial-gradient(3px 3px at 80px 80px, rgba(255,215,0,0.4), transparent),
        radial-gradient(2px 2px at 250px 120px, rgba(255,215,0,0.3), transparent),
        radial-gradient(3px 3px at 450px 200px, rgba(255,215,0,0.5), transparent);
    background-size: 500px 300px;
    animation: starsTwinkle 4s ease-in-out infinite, starsMove 150s linear infinite;
    opacity: 0.7;
}

@keyframes starsMove {
    from { transform: translateY(0); }
    to { transform: translateY(-50%); }
}

@keyframes starsTwinkle {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 0.3; }
}

/* ==========================================
   主容器布局
   ========================================== */
.container {
    position: relative;
    z-index: 1;
    max-width: 680px;
    margin: 0 auto;
    padding: 30px 20px 60px;
}

/* ==========================================
   头部区域
   ========================================== */
.header {
    text-align: center;
    padding: 40px 0 30px;
    margin-bottom: 20px;
}

.header-content {
    display: inline-block;
}

.title {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 5vw, 2.4rem);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    letter-spacing: 0.05em;
    text-shadow: 0 0 30px rgba(123, 104, 238, 0.5);
}

.title-icon {
    display: inline-block;
    color: var(--accent-gold);
    margin: 0 10px;
    animation: iconFloat 3s ease-in-out infinite;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

.title-icon:last-child {
    animation-delay: 1.5s;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-5px) rotate(10deg); }
}

.subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 300;
    letter-spacing: 0.1em;
}

/* ==========================================
   隐私声明
   ========================================== */
.privacy-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(123, 104, 238, 0.1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
}

.notice-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.notice-content {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.notice-content strong {
    color: var(--text-primary);
}

/* ==========================================
   卡片通用样式
   ========================================== */
.form-card,
.result-card,
.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 24px;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-soft), var(--shadow-glow);
    transition: var(--transition-normal);
}

.form-card:hover,
.result-card:hover {
    border-color: var(--border-active);
    box-shadow: var(--shadow-soft), 0 0 40px rgba(123, 104, 238, 0.25);
}

/* ==========================================
   表单区域
   ========================================== */
.form-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.section-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    font-family: var(--font-body);
    color: var(--text-primary);
    background: rgba(10, 10, 30, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    outline: none;
    transition: var(--transition-fast);
}

.form-group input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(123, 104, 238, 0.15);
    background: rgba(10, 10, 30, 0.8);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.input-helper {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* 日期和时间输入特殊样式 */
input[type="date"],
input[type="time"] {
    color-scheme: dark;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(0.8);
    cursor: pointer;
    opacity: 0.7;
    transition: var(--transition-fast);
}

input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* 高级选项切换 */
.advanced-toggle {
    margin-top: 8px;
}

.toggle-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 16px;
    font-size: 0.9rem;
    font-family: var(--font-body);
    color: var(--text-secondary);
    background: rgba(123, 104, 238, 0.1);
    border: 1px dashed var(--border-subtle);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}

.toggle-btn:hover {
    background: rgba(123, 104, 238, 0.15);
    color: var(--text-primary);
}

.toggle-btn .arrow {
    transition: transform var(--transition-normal);
}

.toggle-btn.active .arrow {
    transform: rotate(180deg);
}

/* 高级选项面板 */
.advanced-options {
    display: none;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
    margin-top: -8px;
    background: rgba(10, 10, 30, 0.4);
    border: 1px solid var(--border-subtle);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    animation: slideDown 0.3s ease;
}

.advanced-options.show {
    display: flex;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 计算按钮 */
.calculate-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 24px;
    margin-top: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: var(--font-body);
    color: #fff;
    background: var(--gradient-accent);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-normal);
    box-shadow: 0 4px 15px rgba(123, 104, 238, 0.4);
    position: relative;
    overflow: hidden;
}

.calculate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: 0.5s;
}

.calculate-btn:hover::before {
    left: 100%;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(123, 104, 238, 0.5);
}

.calculate-btn:active {
    transform: translateY(0);
}

.calculate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    font-size: 1.2rem;
}

/* ==========================================
   结果卡片
   ========================================== */
.result-card {
    animation: fadeInUp 0.5s ease;
}

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

.result-header {
    text-align: center;
    margin-bottom: 24px;
}

.result-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--accent-gold);
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.result-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* 上升星座主显示 */
.ascendant-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 30px;
    background: linear-gradient(135deg, rgba(123, 104, 238, 0.15) 0%, rgba(147, 112, 219, 0.1) 100%);
    border: 1px solid var(--border-active);
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
}

.ascendant-display::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,215,0,0.05) 0%, transparent 70%);
    animation: rotateGlow 20s linear infinite;
}

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

.ascendant-icon {
    font-size: 4rem;
    line-height: 1;
    text-shadow: 0 0 30px var(--accent-glow);
    animation: pulse 2s ease-in-out infinite;
    position: relative;
    z-index: 1;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.ascendant-info {
    text-align: left;
    position: relative;
    z-index: 1;
}

.ascendant-sign {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 600;
    color: var(--accent-gold);
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
    margin-bottom: 4px;
}

.ascendant-degree {
    font-size: 1rem;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
    letter-spacing: 0.05em;
}

/* 详细信息 */
.result-details {
    padding: 20px;
    background: rgba(10, 10, 30, 0.5);
    border-radius: var(--radius-md);
}

.details-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-subtle);
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dotted rgba(123, 104, 238, 0.1);
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.detail-value {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
}

/* 星座特质描述 */
.result-description {
    padding: 20px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.05) 0%, rgba(255, 183, 71, 0.03) 100%);
    border: 1px solid rgba(255, 215, 0, 0.1);
    border-radius: var(--radius-md);
}

.description-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent-gold);
    margin-bottom: 12px;
}

.description-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* 重新计算按钮 */
.recalculate-btn {
    width: 100%;
    padding: 14px 20px;
    margin-top: 16px;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: var(--font-body);
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}

.recalculate-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-active);
    background: rgba(123, 104, 238, 0.1);
}

/* ==========================================
   算法说明卡片
   ========================================== */
.info-card {
    background: rgba(20, 20, 50, 0.6);
}

.info-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.info-content {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.info-content p {
    margin-bottom: 12px;
}

.info-list {
    list-style: none;
    margin: 16px 0;
    padding-left: 8px;
}

.info-list li {
    padding: 6px 0;
    padding-left: 8px;
    color: var(--text-secondary);
}

.info-list li::before {
    color: var(--accent-primary);
}

.info-note {
    margin-top: 16px;
    padding: 14px;
    background: rgba(255, 215, 0, 0.05);
    border-left: 3px solid var(--accent-gold);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.info-note strong {
    color: var(--accent-gold);
}

/* ==========================================
   页脚
   ========================================== */
.footer {
    text-align: center;
    padding: 30px 0 10px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.footer p {
    margin-bottom: 8px;
}

.footer-note {
    color: var(--text-secondary);
    font-style: italic;
}

/* ==========================================
   加载状态
   ========================================== */
.loading {
    position: relative;
    pointer-events: none;
}

.loading .btn-text {
    opacity: 0;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ==========================================
   错误提示
   ========================================== */
.error-message {
    display: none;
    padding: 12px 16px;
    margin-top: 12px;
    font-size: 0.85rem;
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: var(--radius-sm);
    animation: shake 0.5s ease;
}

.error-message.show {
    display: block;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ==========================================
   响应式设计
   ========================================== */
@media (max-width: 600px) {
    .container {
        padding: 20px 16px 40px;
    }
    
    .header {
        padding: 30px 0 20px;
    }
    
    .title {
        font-size: 1.6rem;
    }
    
    .title-icon {
        margin: 0 6px;
    }
    
    .form-card,
    .result-card,
    .info-card {
        padding: 20px;
        border-radius: var(--radius-md);
    }
    
    .ascendant-display {
        flex-direction: column;
        gap: 16px;
        padding: 24px;
    }
    
    .ascendant-info {
        text-align: center;
    }
    
    .ascendant-icon {
        font-size: 3.5rem;
    }
    
    .ascendant-sign {
        font-size: 1.6rem;
    }
    
    .detail-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .privacy-notice {
        flex-direction: column;
        text-align: center;
    }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 打印样式 */
@media print {
    .stars-container,
    .calculate-btn,
    .recalculate-btn,
    .advanced-toggle,
    .privacy-notice {
        display: none !important;
    }
    
    body {
        background: #fff;
        color: #000;
    }
    
    .form-card,
    .result-card,
    .info-card {
        background: #fff;
        border: 1px solid #ccc;
        box-shadow: none;
    }
}
