/* ========== 全局样式 ========== */
:root {
    --primary-color: #a8d8b9;
    --primary-dark: #7eb8a3;
    --secondary-color: #a8c8e8;
    --secondary-dark: #7ba8d8;
    --accent-color: #e8c8a8;
    --text-color: #4a4a4a;
    --text-light: #7a7a7a;
    --bg-gradient: linear-gradient(135deg, #e8f0f8 0%, #f0e8f8 50%, #f8f0e8 100%);
    --card-bg: rgba(255, 255, 255, 0.85);
    --border-color: #e0e8f0;
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --radius-sm: 6px;
    --transition: all 0.3s ease;
}

* {
    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: var(--bg-gradient);
    min-height: 100vh;
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 760px;
    margin: 0 auto;
    padding: 16px;
}

/* ========== 头部样式 ========== */
.header {
    text-align: center;
    margin-bottom: 20px;
    animation: fadeInDown 0.6s ease;
}

.header-content {
    background: var(--card-bg);
    padding: 24px 32px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 36px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.logo-icon {
    -webkit-text-fill-color: var(--primary-dark);
    animation: bounce 2s ease infinite;
}

.subtitle {
    color: var(--text-light);
    font-size: 14px;
    letter-spacing: 2px;
}

/* ========== 主要内容 ========== */
.main-content {
    animation: fadeIn 0.6s ease;
}

/* ========== 统计卡片 ========== */
.stats-section {
    margin-bottom: 16px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.stat-card {
    background: var(--card-bg);
    padding: 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
    backdrop-filter: blur(20px);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.stat-icon {
    font-size: 28px;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 22px;
    font-weight: 600;
    color: var(--primary-dark);
    line-height: 1.2;
}

.stat-label {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 2px;
}

/* ========== 历史开奖下拉 ========== */
.history-section {
    margin-bottom: 16px;
}

.dropdown-container {
    position: relative;
}

.dropdown-btn {
    width: 100%;
    padding: 14px 20px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.dropdown-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-hover);
}

.dropdown-btn.active {
    border-color: var(--primary-color);
}

.btn-icon {
    transition: transform 0.3s ease;
    font-size: 12px;
}

.dropdown-btn.active .btn-icon {
    transform: rotate(180deg);
}

.dropdown-content {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: var(--transition);
    z-index: 100;
    max-height: 360px;
    overflow-y: auto;
    backdrop-filter: blur(20px);
}

.dropdown-content.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.history-list {
    padding: 10px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    transition: var(--transition);
    cursor: pointer;
}

.history-item:hover {
    background: rgba(168, 216, 185, 0.15);
}

.history-item:last-child {
    margin-bottom: 0;
}

.history-issue {
    font-weight: 500;
    color: var(--text-color);
    font-size: 13px;
}

.history-date {
    font-size: 11px;
    color: var(--text-light);
}

.history-number {
    display: flex;
    gap: 6px;
    align-items: center;
}

.ball {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 500;
    color: white;
}

.ball.red {
    background: linear-gradient(135deg, #a8d8b9, #7eb8a3);
}

.ball.blue {
    background: linear-gradient(135deg, #a8c8e8, #7ba8d8);
}

/* ========== 测字区域 ========== */
.fortune-section {
    margin-bottom: 16px;
}

.fortune-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-color);
}

.title-icon {
    font-size: 20px;
}

.fortune-input-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.fortune-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.fortune-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(168, 216, 185, 0.15);
}

.fortune-btn {
    padding: 12px 28px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(168, 216, 185, 0.25);
}

.fortune-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(168, 216, 185, 0.35);
}

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

.fortune-result {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    animation: slideUp 0.4s ease;
}

.blessing-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--primary-dark);
    text-align: center;
    padding: 12px;
    background: rgba(168, 216, 185, 0.1);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    line-height: 1.6;
}

.fortune-predictions {
    display: grid;
    gap: 10px;
}

/* ========== 预测区域 ========== */
.predictions-section {
    margin-bottom: 16px;
}

.predictions-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.refresh-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.refresh-btn:hover {
    border-color: var(--primary-color);
    transform: rotate(180deg);
}

.refresh-icon {
    font-size: 18px;
}

.prediction-group {
    margin-bottom: 16px;
}

.prediction-group:last-child {
    margin-bottom: 0;
}

.group-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 12px;
    color: var(--text-color);
}

.group-icon {
    font-size: 16px;
}

.fortune-group {
    background: linear-gradient(135deg, rgba(168, 216, 185, 0.1), rgba(168, 216, 185, 0.05));
    padding: 16px;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary-color);
}

.prediction-list {
    display: grid;
    gap: 12px;
}

.prediction-item {
    background: rgba(255, 255, 255, 0.7);
    padding: 16px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: var(--transition);
}

.prediction-item:hover {
    border-color: var(--secondary-color);
    transform: translateX(2px);
}

.prediction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.prediction-type {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
}

.copy-btn {
    padding: 5px 14px;
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 4px;
}

.copy-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(168, 200, 232, 0.35);
}

.prediction-numbers {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.prediction-ball {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.prediction-ball.red {
    background: linear-gradient(135deg, #a8d8b9, #7eb8a3);
}

.prediction-ball.blue {
    background: linear-gradient(135deg, #a8c8e8, #7ba8d8);
}

.ball-separator {
    font-size: 16px;
    color: var(--text-light);
    font-weight: 500;
}

/* ========== 复制全部 ========== */
.copy-all-container {
    margin-top: 16px;
    text-align: center;
}

.copy-all-btn {
    width: 100%;
    padding: 12px 28px;
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-dark));
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(168, 200, 232, 0.25);
}

.copy-all-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(168, 200, 232, 0.35);
}

/* ========== 免责声明 ========== */
.disclaimer-section {
    margin-bottom: 16px;
}

.disclaimer-card {
    background: var(--card-bg);
    padding: 16px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-left: 3px solid var(--accent-color);
    backdrop-filter: blur(20px);
}

.disclaimer-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
    color: var(--text-color);
}

.disclaimer-content {
    font-size: 12px;
    color: var(--text-light);
    line-height: 1.6;
}

.disclaimer-content p {
    margin-bottom: 6px;
}

/* ========== 底部 ========== */
.footer {
    text-align: center;
    padding: 16px;
}

.footer-content {
    background: var(--card-bg);
    padding: 14px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
}

.copyright {
    font-size: 12px;
    color: var(--text-light);
}

.copyright a {
    color: var(--primary-dark);
    text-decoration: none;
    transition: var(--transition);
}

.copyright a:hover {
    text-decoration: underline;
}

/* ========== Toast提示 ========== */
.toast {
    position: fixed;
    top: 16px;
    right: 16px;
    background: rgba(168, 200, 232, 0.95);
    color: white;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-hover);
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateX(120%);
    transition: transform 0.4s ease;
    z-index: 1000;
    backdrop-filter: blur(20px);
}

.toast.show {
    transform: translateX(0);
}

.toast-icon {
    font-size: 18px;
}

.toast-message {
    font-size: 13px;
    font-weight: 500;
}

/* ========== 动画 ========== */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }

    .header-content {
        padding: 18px 20px;
    }

    .logo {
        font-size: 28px;
    }

    .subtitle {
        font-size: 13px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 14px;
    }

    .fortune-input-wrapper {
        flex-direction: column;
    }

    .fortune-btn {
        width: 100%;
        justify-content: center;
    }

    .prediction-numbers {
        gap: 5px;
    }

    .prediction-ball {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }

    .history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .history-number {
        width: 100%;
        justify-content: flex-start;
    }
}

/* ========== 滚动条样式 ========== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: rgba(168, 216, 185, 0.4);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(168, 216, 185, 0.6);
}

.loading {
    text-align: center;
    padding: 16px;
    color: var(--text-light);
    font-size: 13px;
}
