/* 全局樣式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 標題區域 */
.header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    padding: 30px 0;
}

.header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* 主要內容區域 */
.main-content {
    display: grid;
    gap: 30px;
}

/* 輸入表單區域 */
.input-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.input-section h2 {
    color: #5a67d8;
    margin-bottom: 20px;
    font-size: 1.8rem;
    text-align: center;
}

/* 表單樣式 */
.chart-form {
    display: grid;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    align-items: start; /* 確保頂部對齊 */
}

.form-group {
    display: flex;
    flex-direction: column;
    min-height: 120px; /* 確保所有 form-group 有相同的最小高度 */
}

.form-group label {
    font-weight: bold;
    margin-bottom: 8px;
    color: #4a5568;
}

.form-group input,
.form-group select {
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    margin-bottom: 4px; /* 為說明文字留出空間 */
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #5a67d8;
    box-shadow: 0 0 0 3px rgba(90, 103, 216, 0.1);
}

/* 統一說明文字樣式 */
.form-help {
    color: #666;
    font-size: 0.85em;
    margin-top: 4px;
    line-height: 1.4;
    min-height: 1.2em; /* 確保即使沒有文字也有最小高度 */
}

/* 模式選擇區域 */
.mode-selection {
    background: #f7fafc;
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    border: 2px solid #e2e8f0;
}

.mode-selection h3 {
    color: #5a67d8;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.radio-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px 15px;
    border-radius: 10px;
    transition: all 0.3s ease;
    background: white;
    border: 2px solid #e2e8f0;
    flex: 1;
    min-width: 200px;
}

.radio-option:hover {
    background: #f0f4f8;
    border-color: #5a67d8;
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e0;
    border-radius: 50%;
    margin-right: 10px;
    position: relative;
    transition: all 0.3s ease;
}

.radio-option input[type="radio"]:checked + .radio-custom {
    border-color: #5a67d8;
    background: #5a67d8;
}

.radio-option input[type="radio"]:checked + .radio-custom::after {
    content: '';
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.radio-text {
    font-weight: 500;
    color: #4a5568;
}

.radio-option input[type="radio"]:checked ~ .radio-text {
    color: #5a67d8;
    font-weight: bold;
}

/* 地點選擇區域 */
.location-section {
    background: #f7fafc;
    border-radius: 15px;
    padding: 20px;
    margin: 10px 0;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.location-section:has(input:focus),
.location-section:has(select:focus) {
    border-color: #5a67d8;
    box-shadow: 0 0 0 3px rgba(90, 103, 216, 0.1);
}

/* 提交按鈕 */
.submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-top: 10px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.submit-btn:active {
    transform: translateY(0);
}

.loading {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.submit-btn.loading .btn-text {
    opacity: 0;
}

.submit-btn.loading .loading {
    display: block;
}

/* 結果區域 */
.result-section {
    display: grid;
    gap: 30px;
}

.result-section h2 {
    color: white;
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* 卡片樣式 */
.info-card,
.axes-card,
.planets-card,
.houses-card,
.points-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    margin-bottom: 20px;
}

.info-card h3,
.axes-card h3,
.planets-card h3,
.houses-card h3,
.points-card h3 {
    color: #5a67d8;
    margin-bottom: 20px;
    font-size: 1.5rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

/* 基本資訊網格 */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.info-item {
    padding: 15px;
    background: #f7fafc;
    border-radius: 10px;
    border: 2px solid #5a67d8;
}

.info-item strong {
    color: #5a67d8;
    display: block;
    margin-bottom: 5px;
}

/* 四大尖軸 */
.axes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.axis-item {
    background: #f7fafc;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    border: 2px solid #af91f9;
    transition: all 0.3s ease;
}

.axis-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.axis-item strong {
    display: block;
    color: #5a67d8;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.axis-item span {
    color: #4a5568;
    font-weight: 500;
}

/* 表格樣式 */
.planets-table,
.houses-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.planets-table th,
.planets-table td,
.houses-table th,
.houses-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.planets-table th,
.houses-table th {
    background: #5a67d8;
    color: white;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.planets-table tr:nth-child(even),
.houses-table tr:nth-child(even) {
    background: #f8f9fa;
}

.planets-table tr:hover,
.houses-table tr:hover {
    background: #e8f4fd;
    transition: background 0.3s ease;
}

.interpretation {
    padding: 15px;
    border-left: 4px solid #5a67d8;
    margin-top: 5px;
    color: #4a5568;
    line-height: 1.6;
}

/* 特殊點位 */
.point-item {
    background: #f7fafc;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.point-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-color: #5a67d8;
}

.point-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.point-header strong {
    color: #5a67d8;
    font-size: 1.2rem;
}

.point-position {
    background: #5a67d8;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
}

.point-interpretation {
    color: #4a5568;
    line-height: 1.6;
    font-style: italic;
}

/* 公式說明 */
.formula-explanation {
    background: #e8f4fd;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
    border: 2px solid #bee3f8;
}

.formula-explanation h4 {
    color: #2b6cb0;
    margin-bottom: 15px;
}

.formula-item {
    background: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    border-left: 4px solid #5a67d8;
}

.formula-item:last-child {
    margin-bottom: 0;
}

.formula-item strong {
    color: #5a67d8;
    display: block;
    margin-bottom: 8px;
}

.retrograde {
    color: #e53e3e;
    font-weight: bold;
}

.retrograde-cell {
    text-align: center;
}

.retrograde-badge {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(229, 62, 62, 0.3);
    animation: pulse 2s infinite;
}

.direct-badge {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(56, 161, 105, 0.3);
}

.retrograde-explanation {
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
    border: 2px solid #e53e3e;
    border-radius: 15px;
    padding: 20px;
    margin-top: 25px;
    box-shadow: 0 4px 6px rgba(229, 62, 62, 0.1);
}

.retrograde-explanation h4 {
    color: #e53e3e;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.retrograde-explanation p {
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 10px;
}

.retrograde-explanation p:last-child {
    margin-bottom: 0;
}

/* 操作按鈕樣式 */
.action-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
    padding: 20px;
    background: #f7fafc;
    border-radius: 15px;
    border: 2px solid #e2e8f0;
}

.action-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 150px;
    justify-content: center;
}

.copy-btn {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(66, 153, 225, 0.3);
}

.copy-btn:hover {
    background: linear-gradient(135deg, #3182ce 0%, #2c5aa0 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(66, 153, 225, 0.4);
}

.download-btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.3);
}

.download-btn:hover {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.4);
}

.action-btn:active {
    transform: translateY(0);
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* 響應式設計 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-group {
        min-height: auto; /* 行動裝置上不需要固定最小高度 */
    }
    
    .axes-grid {
        grid-template-columns: 1fr;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .radio-group {
        flex-direction: column;
    }
    
    .radio-option {
        min-width: auto;
    }
    
    .point-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .planets-table,
    .houses-table {
        font-size: 0.9rem;
    }
    
    .planets-table th,
    .planets-table td,
    .houses-table th,
    .houses-table td {
        padding: 10px 8px;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 15px;
    }
    
    .action-btn {
        min-width: auto;
        width: 100%;
    }
}

/* 動畫效果 */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-section > * {
    animation: slideIn 0.6s ease-out forwards;
}

/* 捲軸樣式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Footer 樣式 */
.footer {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: #e2e8f0;
    padding: 40px 0 30px;
    margin-top: 60px;
    border-radius: 20px;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
     
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb, #f5576c);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.footer-content p {
    margin-bottom: 15px;
    font-size: 1rem;
    line-height: 1.6;
    opacity: 0.9;
    transition: all 0.3s ease;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    letter-spacing: 0.3px;
}

.footer-content p:last-child {
    margin-bottom: 0;
    font-size: 0.9rem;
    opacity: 0.7;
    font-style: italic;
}

.footer-content a {
    color: #63b3ed;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    padding: 2px 0;
    border-radius: 4px;
    padding: 4px 8px;
    margin: 0 2px;
}

.footer-content a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #63b3ed, #4299e1);
    transition: width 0.3s ease;
}

.footer-content a:hover {
    color: #90cdf4;
    transform: translateY(-1px);
    background: rgba(99, 179, 237, 0.1);
    box-shadow: 0 2px 8px rgba(99, 179, 237, 0.3);
}

.footer-content a:hover::after {
    width: 100%;
}

.footer-content a:active {
    transform: translateY(0);
}

/* Footer 響應式設計 */
@media (max-width: 768px) {
    .footer {
        padding: 30px 0 20px;
        margin-top: 40px;
        border-radius: 15px 15px 0 0;
    }
    
    .footer-content {
        padding: 0 15px;
    }
    
    .footer-content p {
        font-size: 0.9rem;
        margin-bottom: 12px;
    }
    
    .footer-content p:last-child {
        font-size: 0.8rem;
    }
    
    .footer::after,
    .footer .decoration-star {
        font-size: 1.2rem;
        top: 10px;
    }
    
    .footer::after {
        left: 15px;
    }
    
    .footer .decoration-star {
        right: 15px;
    }
}

/* 添加hover效果 */
.footer:hover {
    transform: translateY(-2px);
    box-shadow: 0 -15px 40px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.footer-content a:hover {
    text-shadow: 0 0 8px rgba(99, 179, 237, 0.5);
}

/* 添加一些裝飾性元素 */
.footer::after {
    content: '✨';
    position: absolute;
    top: 15px;
    left: 20px;
    font-size: 1.5rem;
    opacity: 0.6;
    animation: twinkle 2s ease-in-out infinite;
}

.footer .decoration-star {
    content: '🌟';
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    opacity: 0.6;
    animation: twinkle 2s ease-in-out infinite 1s;
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
} 