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

:root {
    --primary: #52b788;
    --primary-dark: #40916c;
    --primary-light: #74c69d;
    --secondary: #95d5b2;
    --accent: #d8f3dc;
    --bg-sky: #f0fdf4;
    --bg-card: #ffffff;
    --bg-mint: #d8f3dc;
    --text-primary: #1b4332;
    --text-secondary: #52796f;
    --border: #b7e4c7;
    --shadow: rgba(82, 183, 136, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: 
        radial-gradient(ellipse at 30% 0%, rgba(149, 213, 178, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 100%, rgba(82, 183, 136, 0.2) 0%, transparent 50%),
        linear-gradient(180deg, #f0fdf4 0%, #d8f3dc 50%, #b7e4c7 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.8;
}

.container {
    max-width: 540px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding: 2rem 1.5rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 8px 32px var(--shadow);
}

.header h1 {
    font-size: 2rem;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* 主内容区 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 表单卡片 */
.form-card {
    width: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 28px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 8px 32px var(--shadow);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group:last-of-type {
    margin-bottom: 1.25rem;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.65rem;
}

.label-icon {
    font-size: 1.1rem;
}

/* 文本输入框 */
.form-input {
    width: 100%;
    padding: 0.9rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-mint);
    border: 2px solid transparent;
    border-radius: 14px;
    transition: all 0.3s ease;
}

.form-input::placeholder {
    color: #95a8a0;
}

.form-input:hover {
    background: #c8e6ce;
}

.form-input:focus {
    outline: none;
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(82, 183, 136, 0.15);
}

/* 日期输入框 */
input[type="date"] {
    cursor: pointer;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
    filter: hue-rotate(30deg);
}

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

/* 性别按钮组 */
.gender-buttons {
    display: flex;
    gap: 0.85rem;
}

.gender-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.85rem;
    border: 2px solid var(--border);
    border-radius: 14px;
    background: var(--bg-mint);
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gender-btn:hover {
    background: #c8e6ce;
}

.gender-btn.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, var(--accent), #b7e4c7);
    color: var(--primary-dark);
}

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

/* 下拉选择框 */
.select-wrapper {
    position: relative;
}

.form-select {
    width: 100%;
    padding: 0.9rem 2.5rem 0.9rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-mint);
    border: 2px solid transparent;
    border-radius: 14px;
    cursor: pointer;
    appearance: none;
    transition: all 0.3s ease;
}

.form-select:hover {
    background: #c8e6ce;
}

.form-select:focus {
    outline: none;
    background: #fff;
    border-color: var(--primary);
}

.form-select option {
    padding: 0.75rem;
    background: #fff;
}

.select-arrow {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 0.65rem;
    pointer-events: none;
}

/* 查看运势按钮 */
.get-fortune-btn {
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(82, 183, 136, 0.4);
    letter-spacing: 2px;
}

.get-fortune-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(82, 183, 136, 0.5);
}

.get-fortune-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* 结果区域 */
.result-section {
    width: 100%;
    animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.result-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 6px 24px var(--shadow);
}

.result-icon {
    font-size: 3.5rem;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent), var(--secondary));
    border-radius: 50%;
}

.result-title h2 {
    font-size: 1.35rem;
    color: var(--primary-dark);
    margin-bottom: 0.15rem;
}

.result-title p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* 运势卡片网格 */
.fortune-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.9rem;
}

@media (max-width: 500px) {
    .fortune-cards {
        grid-template-columns: 1fr;
    }
}

.fortune-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    border-radius: 18px;
    padding: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
}

.fortune-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--shadow);
}

.fortune-card.full-width {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, rgba(216, 243, 220, 0.9), rgba(183, 228, 199, 0.7));
    border: none;
}

.fortune-card-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.65rem;
}

.fortune-card-icon {
    font-size: 1.3rem;
}

.fortune-card-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--primary-dark);
}

.fortune-card-content {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.8;
}

.fortune-card.full-width .fortune-card-content {
    white-space: pre-wrap;
    color: var(--text-primary);
}

/* 评分样式 */
.rating {
    display: flex;
    gap: 4px;
    margin-top: 0.5rem;
}

.rating-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #d8f3dc;
}

.rating-dot.filled {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 2rem 0 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* 流式输出动画 */
.streaming-cursor {
    display: inline-block;
    width: 8px;
    height: 1em;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    margin-left: 2px;
    border-radius: 2px;
    animation: blink 0.8s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* 装饰元素 */
.container::before {
    content: '🌿';
    position: fixed;
    top: 8%;
    left: 8%;
    font-size: 1.5rem;
    opacity: 0.3;
    transform: rotate(-20deg);
}

.container::after {
    content: '🍃';
    position: fixed;
    bottom: 12%;
    right: 10%;
    font-size: 1.3rem;
    opacity: 0.3;
    transform: rotate(15deg);
}
