/* ==================== 基础 ==================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #f5576c 75%, #4facfe 100%);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    min-height: 100vh;
    color: #fff;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 背景光晕 */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 20% 80%, rgba(255,255,255,0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(255,255,255,0.08) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

/* ==================== 容器 ==================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* ==================== 头部 ==================== */
.header {
    text-align: center;
    padding: 60px 20px 40px;
    animation: fadeInDown 1s ease-out;
}

.header h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 12px;
    text-shadow: 0 4px 30px rgba(0,0,0,0.2);
    letter-spacing: -0.5px;
}

.header p {
    font-size: 1.15rem;
    opacity: 0.9;
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.6;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==================== 玻璃卡片 ==================== */
.glass-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255,255,255,0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.6s;
}

.glass-card:hover::before {
    left: 100%;
}

.glass-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255,255,255,0.3);
    border-color: rgba(255, 255, 255, 0.35);
}

/* ==================== 首页卡片网格 ==================== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    padding: 20px 0 60px;
}

.card-item {
    cursor: pointer;
    text-align: center;
    animation: fadeInUp 0.8s ease-out backwards;
}

.card-item:nth-child(1) { animation-delay: 0.1s; }
.card-item:nth-child(2) { animation-delay: 0.2s; }
.card-item:nth-child(3) { animation-delay: 0.3s; }

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

.card-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    display: block;
}

.card-item h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.card-item p {
    font-size: 0.95rem;
    opacity: 0.85;
    line-height: 1.5;
}

/* ==================== 表单页面 ==================== */
.form-page {
    display: none;
    animation: fadeIn 0.5s ease-out;
    max-width: 700px;
    margin: 0 auto;
    padding: 20px 0 60px;
}

.form-page.active {
    display: block;
}

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

.form-header {
    text-align: center;
    margin-bottom: 30px;
}

.form-header h2 {
    font-size: 2rem;
    margin-bottom: 8px;
}

.form-header p {
    opacity: 0.8;
}

/* ==================== 表单元素 ==================== */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    font-size: 0.95rem;
}

.form-group label .required {
    color: #ff6b6b;
    margin-left: 4px;
}

.glass-input,
.glass-textarea,
.glass-select {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.glass-input::placeholder,
.glass-textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.glass-input:focus,
.glass-textarea:focus,
.glass-select:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.glass-textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

.glass-select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='rgba(255,255,255,0.7)' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.glass-select option {
    background: #4a5568;
    color: #fff;
}

/* ==================== 单选按钮组 ==================== */
.radio-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.radio-item {
    flex: 1;
    min-width: 120px;
}

.radio-item input[type="radio"] {
    display: none;
}

.radio-item label {
    display: block;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.radio-item input[type="radio"]:checked + label {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.2);
    transform: scale(1.02);
}

/* ==================== 按钮 ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    border: none;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 48px;
    min-width: 120px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.6);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ==================== 雷达图容器 ==================== */
.radar-container {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.radar-canvas {
    max-width: 100%;
    height: auto;
    touch-action: none;
    cursor: pointer;
}

.radar-values {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 16px;
    font-size: 0.9rem;
}

.radar-value-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

/* ==================== 关闭页面 ==================== */
.closed-page {
    text-align: center;
    padding: 100px 20px;
    animation: fadeIn 0.8s ease-out;
}

.closed-page h2 {
    font-size: 2rem;
    margin-bottom: 16px;
}

.closed-page p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 24px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.closed-page a {
    color: #fff;
    text-decoration: underline;
    opacity: 0.9;
}

/* ==================== Toast ==================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    padding: 16px 24px;
    border-radius: 16px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    color: #fff;
    font-weight: 500;
    transform: translateX(120%);
    animation: toastSlideIn 0.4s ease forwards, toastFadeOut 0.4s ease 3s forwards;
    pointer-events: auto;
    min-width: 280px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.success { border-left: 4px solid #48bb78; }
.toast.error { border-left: 4px solid #f56565; }

@keyframes toastSlideIn {
    to { transform: translateX(0); }
}

@keyframes toastFadeOut {
    to { opacity: 0; transform: translateX(120%); }
}

/* ==================== 加载动画 ==================== */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    z-index: 9998;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 16px;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ==================== 成功动画 ==================== */
.success-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    z-index: 9997;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

.success-overlay.active {
    display: flex;
}

.success-check {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #48bb78, #38a169);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 20px;
    animation: scaleIn 0.5s ease;
    box-shadow: 0 10px 40px rgba(72, 187, 120, 0.4);
}

@keyframes scaleIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

/* ==================== 返回按钮 ==================== */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateX(-4px);
}

/* ==================== 页脚 ==================== */
.footer {
    text-align: center;
    padding: 40px 20px;
    opacity: 0.6;
    font-size: 0.85rem;
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }

    .header p {
        font-size: 1rem;
    }

    .cards-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .glass-card {
        padding: 24px;
    }

    .radio-group {
        flex-direction: column;
    }

    .radar-values {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 12px;
    }
}

@media (max-width: 375px) {
    .header {
        padding: 40px 16px 30px;
    }

    .header h1 {
        font-size: 1.7rem;
    }

    .card-icon {
        font-size: 2.5rem;
    }

    .btn {
        width: 100%;
    }
}

/* ==================== 隐藏类 ==================== */
.hidden { display: none !important; }
