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

:root {
    --primary-red: #c8102e;
    --primary-gold: #d4af37;
    --primary-black: #1a1a1a;
    --bg-cream: #f5f0e1;
    --text-dark: #333333;
    --text-light: #666666;
    --border-color: #d4af37;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'SimSun', serif;
    background: linear-gradient(135deg, #f5f0e1 0%, #e8dcc4 100%);
    color: var(--text-dark);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== 背景装饰 ===== */
.bg-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.tai-chi {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 400px;
    height: 400px;
    transform: translate(-50%, -50%);
    opacity: 0.03;
    background: radial-gradient(circle at center,
        var(--primary-black) 0%,
        var(--primary-black) 48%,
        var(--bg-cream) 48%,
        var(--bg-cream) 52%,
        var(--primary-black) 52%,
        var(--primary-black) 100%
    );
    border-radius: 50%;
    animation: rotate 60s linear infinite;
}

@keyframes rotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.cloud {
    position: absolute;
    width: 150px;
    height: 60px;
    background: linear-gradient(to bottom,
        rgba(212, 175, 55, 0.1),
        rgba(212, 175, 55, 0.05)
    );
    border-radius: 50px;
    animation: float 20s ease-in-out infinite;
}

.cloud::before,
.cloud::after {
    content: '';
    position: absolute;
    background: inherit;
    border-radius: 50%;
}

.cloud::before {
    width: 70px;
    height: 70px;
    top: -35px;
    left: 20px;
}

.cloud::after {
    width: 50px;
    height: 50px;
    top: -25px;
    left: 70px;
}

.cloud-1 {
    top: 10%;
    left: 5%;
}

.cloud-2 {
    top: 20%;
    right: 5%;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* ===== 头部 ===== */
.header {
    text-align: center;
    padding: 30px 0;
    position: relative;
    z-index: 1;
}

.title h1 {
    font-size: 2.5rem;
    color: var(--primary-red);
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 8px;
}

.subtitle {
    font-size: 1rem;
    color: var(--primary-gold);
    letter-spacing: 4px;
}

/* ===== 主内容区 ===== */
.main-content {
    flex: 1;
    position: relative;
    z-index: 1;
    padding: 20px 0;
}

/* ===== 表单容器 ===== */
.form-container {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 2px solid var(--border-color);
}

.fortune-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

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

.form-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-black);
    display: flex;
    align-items: center;
}

.form-label::before {
    content: '◆';
    color: var(--primary-gold);
    margin-right: 6px;
    font-size: 0.8rem;
}

.form-input {
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.form-hint {
    font-size: 0.85rem;
    color: var(--text-light);
}

.radio-group {
    display: flex;
    gap: 20px;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    transition: all 0.3s;
}

.radio-label:hover {
    border-color: var(--primary-gold);
    background: rgba(212, 175, 55, 0.05);
}

.radio-label input[type="radio"] {
    margin-right: 8px;
    accent-color: var(--primary-gold);
}

.radio-label input[type="radio"]:checked + span {
    color: var(--primary-gold);
    font-weight: 600;
}

/* ===== 提交按钮 ===== */
.submit-btn {
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--primary-red), #a00d26);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(200, 16, 46, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(200, 16, 46, 0.4);
}

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

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== 结果容器 ===== */
.result-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 2px solid var(--border-color);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
}

.result-header h2 {
    font-size: 1.5rem;
    color: var(--primary-red);
}

.new-btn {
    padding: 8px 20px;
    background: white;
    color: var(--primary-red);
    border: 1px solid var(--primary-red);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.95rem;
}

.new-btn:hover {
    background: var(--primary-red);
    color: white;
}

/* ===== 加载动画 ===== */
.loading {
    text-align: center;
    padding: 40px 20px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(212, 175, 55, 0.2);
    border-top-color: var(--primary-gold);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

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

.loading p {
    color: var(--text-light);
    font-size: 1rem;
}

/* ===== 结果内容 ===== */
.result-content {
    display: none;
}

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

.result-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
    padding: 16px;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 8px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-size: 0.9rem;
    color: var(--text-light);
}

.info-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-red);
}

.fortune-text {
    line-height: 1.8;
    color: var(--text-dark);
    white-space: pre-wrap;
    word-wrap: break-word;
}

.fortune-text p {
    margin-bottom: 16px;
}

.fortune-text h3 {
    font-size: 1.2rem;
    color: var(--primary-red);
    margin: 24px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
}

/* 光标闪烁效果 */
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.fortune-text.typing::after {
    content: '▋';
    animation: blink 0.8s step-end infinite;
    color: var(--primary-gold);
}

/* ===== 页脚 ===== */
.footer {
    text-align: center;
    padding: 20px 0;
    color: var(--text-light);
    font-size: 0.85rem;
    position: relative;
    z-index: 1;
}

/* ===== 响应式设计 ===== */
@media (max-width: 640px) {
    .container {
        padding: 16px;
    }

    .title h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 0.9rem;
        letter-spacing: 2px;
    }

    .form-container,
    .result-container {
        padding: 20px;
    }

    .radio-group {
        gap: 12px;
    }

    .radio-label {
        padding: 6px 12px;
        font-size: 0.95rem;
    }

    .submit-btn {
        padding: 14px 24px;
        font-size: 1rem;
    }

    .result-info {
        grid-template-columns: 1fr;
    }

    .fortune-text {
        font-size: 0.95rem;
    }
}
