/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.mystic-app {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部 */
.app-header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.app-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.app-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 主内容区 */
.app-main {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* 标签页 */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
}

.tab-button {
    padding: 12px 24px;
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab-button:hover {
    color: #667eea;
}

.tab-button.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 表单样式 */
.input-section {
    margin-bottom: 40px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
}

.birth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

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

.form-group label {
    font-weight: 500;
    color: #555;
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-hint {
    font-size: 0.85rem;
    color: #999;
}

.primary-button {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    align-self: flex-start;
}

.primary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.primary-button:active {
    transform: translateY(0);
}

/* 星盘展示区 */
.chart-section {
    margin-bottom: 40px;
}

.chart-container {
    display: flex;
    justify-content: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

#chart-canvas {
    max-width: 100%;
    height: auto;
}

/* 解析结果区 */
.interpretation-section {
    margin-top: 40px;
}

.interpretation-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.interp-tab {
    padding: 8px 16px;
    background: #f0f0f0;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
}

.interp-tab:hover {
    background: #e0e0e0;
}

.interp-tab.active {
    background: #667eea;
    color: white;
}

.interp-content {
    display: none;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    min-height: 200px;
}

.interp-content.active {
    display: block;
}

.planet-item,
.house-item,
.aspect-item {
    padding: 15px;
    margin-bottom: 15px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.planet-item h3,
.house-item h3,
.aspect-item h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: #333;
}

.planet-item p,
.house-item p,
.aspect-item p {
    color: #666;
    line-height: 1.8;
}

/* 易经部分 */
.iching-section {
    padding: 20px 0;
}

.section-description {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 30px;
    text-align: center;
}

.iching-methods {
    margin-bottom: 40px;
}

.method-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
}

.method-tab {
    padding: 12px 24px;
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.method-tab:hover {
    color: #667eea;
}

.method-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.method-content {
    display: none;
}

.method-content.active {
    display: block;
}

.divination-form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.divination-form textarea {
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s;
}

.divination-form textarea:focus {
    outline: none;
    border-color: #667eea;
}

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

.coin-throw-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.coin-throw-item label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: #333;
}

.coin-throw-item input {
    width: 100%;
    padding: 8px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
}

.iching-result {
    margin-top: 40px;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 12px;
}

.result-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
}

.hexagram-visualization {
    text-align: center;
    padding: 30px;
    background: white;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 2rem;
    line-height: 1.8;
    font-family: monospace;
}

.hexagram-interpretation {
    background: white;
    padding: 20px;
    border-radius: 8px;
    white-space: pre-line;
    line-height: 1.8;
    color: #333;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .app-title {
        font-size: 2rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .chart-container {
        padding: 10px;
    }

    .interpretation-tabs {
        flex-direction: column;
    }

    .interp-tab {
        width: 100%;
    }
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.loading::after {
    content: "...";
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: "."; }
    40% { content: ".."; }
    60%, 100% { content: "..."; }
}
