/**
 * 爱平小世界 - 全局样式
 * 小清新梦幻风格配色方案
 * 需求: 4.1, 4.2, 4.3
 */

/* ========== CSS变量定义 ========== */
:root {
    /* 主色调 */
    --color-light-blue: #7eb8da;
    --color-mint-green: #98d8c8;
    --color-pink: #ffb6c1;
    
    /* 辅助色 */
    --color-white: #ffffff;
    --color-light-gray: #f8f9fa;
    --color-text: #5a6c7d;
    --color-text-light: #8a9bab;
    --color-text-dark: #3d4f5f;
    
    /* 渐变色 */
    --gradient-primary: linear-gradient(135deg, var(--color-light-blue) 0%, var(--color-mint-green) 50%, var(--color-pink) 100%);
    --gradient-soft: linear-gradient(135deg, rgba(126, 184, 218, 0.3) 0%, rgba(152, 216, 200, 0.3) 50%, rgba(255, 182, 193, 0.3) 100%);
    --gradient-card: linear-gradient(145deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);
    
    /* 毛玻璃效果 */
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
    --glass-blur: blur(12px);
    
    /* 间距 */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 50%;
    
    /* 字体 - 可爱圆润风格 */
    --font-family: 'ZCOOL KuaiLe', 'Ma Shan Zheng', 'ZCOOL XiaoWei', 'PingFang SC', 'Microsoft YaHei UI', cursive, sans-serif;
    --font-family-cute: 'ZCOOL KuaiLe', 'Zhi Mang Xing', cursive, sans-serif;
    --font-family-title: 'Ma Shan Zheng', 'ZCOOL KuaiLe', cursive, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.25rem;
    --font-size-xl: 1.5rem;
    --font-size-2xl: 2rem;
    --font-size-3xl: 2.5rem;
}

/* ========== 基础重置 ========== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--color-text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ========== 渐变背景 ========== */
.gradient-bg {
    background: var(--gradient-primary);
    background-size: 400% 400%;
    min-height: 100vh;
}

.gradient-bg-soft {
    background: linear-gradient(135deg, 
        rgba(126, 184, 218, 0.15) 0%, 
        rgba(152, 216, 200, 0.15) 25%,
        rgba(255, 182, 193, 0.15) 50%,
        rgba(152, 216, 200, 0.15) 75%,
        rgba(126, 184, 218, 0.15) 100%);
    background-size: 400% 400%;
    min-height: 100vh;
}

/* ========== 毛玻璃效果 ========== */
.glass {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-md);
    box-shadow: 
        0 8px 32px rgba(31, 38, 135, 0.1),
        inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.glass-card-strong {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-md);
    box-shadow: 
        0 10px 40px rgba(31, 38, 135, 0.12),
        inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

/* ========== 容器 ========== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.container-sm {
    max-width: 800px;
}

.container-lg {
    max-width: 1400px;
}

/* ========== 导航栏 ========== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: var(--spacing-sm) var(--spacing-lg);
}

.navbar > .container {
    max-width: 100%;
    padding: 0;
}

.navbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--color-text-dark);
    text-decoration: none;
    margin-right: auto;
    padding-left: 0;
}

.navbar-nav {
    display: flex;
    list-style: none;
    gap: var(--spacing-sm);
}

.navbar-nav li {
    display: flex;
}

.nav-link {
    color: var(--color-text);
    text-decoration: none;
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(126, 184, 218, 0.1);
    border: 1px solid rgba(126, 184, 218, 0.2);
    font-size: 0.9rem;
    min-width: 70px;
    text-align: center;
    display: inline-block;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

/* 首页按钮光泽动画 */
.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.nav-link:hover::before {
    left: 100%;
}

.nav-link:hover {
    color: var(--color-light-blue);
    background: rgba(126, 184, 218, 0.25);
    border-color: rgba(126, 184, 218, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(126, 184, 218, 0.25);
}

.nav-link:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 6px rgba(126, 184, 218, 0.2);
}

.nav-link.active {
    color: var(--color-light-blue);
    background: rgba(126, 184, 218, 0.3);
    border-color: rgba(126, 184, 218, 0.5);
    box-shadow: 0 2px 8px rgba(126, 184, 218, 0.2);
}

/* 契合测试按钮 - 特殊样式 */
.navbar-nav li:last-child .nav-link {
    background: linear-gradient(135deg, #ff7a9e, #ff8a80);
    background-size: 200% 200%;
    color: white;
    border: none;
    box-shadow: 0 3px 10px rgba(255, 122, 158, 0.35);
    animation: gradientPulse 3s ease infinite;
}

@keyframes gradientPulse {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.navbar-nav li:last-child .nav-link::before {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

.navbar-nav li:last-child .nav-link:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 20px rgba(255, 122, 158, 0.45);
    color: white;
    background: linear-gradient(135deg, #ff6b8e, #ff7a70);
}

.navbar-nav li:last-child .nav-link:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 3px 10px rgba(255, 122, 158, 0.3);
}

.navbar-nav li:last-child .nav-link.active {
    background: linear-gradient(135deg, #ff6b8e, #ff7a70);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 122, 158, 0.4);
}

.navbar-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-xs);
}

/* 移动端导航栏样式 */
@media (max-width: 767px) {
    .navbar .navbar-toggle {
        display: flex !important;
        z-index: 1002;
    }
    
    .navbar .navbar-nav {
        position: fixed;
        top: 0;
        right: -250px;
        width: 220px;
        height: 100vh;
        flex-direction: column;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding: 80px 20px 30px;
        gap: 10px;
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        z-index: 1001;
    }
    
    .navbar .navbar-nav.active {
        right: 0;
    }
    
    .navbar .navbar-nav li {
        width: 100%;
    }
    
    .navbar .navbar-nav .nav-link {
        display: block;
        width: 100%;
        text-align: center;
        padding: 12px 15px;
        border-radius: 12px;
    }
}

.navbar-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--color-text);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* ========== 卡片组件 ========== */
.card {
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.card-header {
    margin-bottom: var(--spacing-md);
}

.card-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--color-text-dark);
}

.card-body {
    color: var(--color-text);
}

/* ========== 按钮 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: var(--font-size-base);
    font-weight: 500;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--gradient-primary);
    background-size: 200% 200%;
    color: var(--color-white);
    box-shadow: 0 4px 15px rgba(126, 184, 218, 0.4);
}

.btn-primary:hover {
    background-position: 100% 0;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(126, 184, 218, 0.5);
}

.btn-secondary {
    background: var(--color-white);
    color: var(--color-text);
    border: 2px solid var(--color-light-blue);
}

.btn-secondary:hover {
    background: var(--color-light-blue);
    color: var(--color-white);
}

.btn-pink {
    background: var(--color-pink);
    color: var(--color-white);
    box-shadow: 0 4px 15px rgba(255, 182, 193, 0.4);
}

.btn-pink:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 182, 193, 0.5);
}

.btn-mint {
    background: var(--color-mint-green);
    color: var(--color-white);
    box-shadow: 0 4px 15px rgba(152, 216, 200, 0.4);
}

.btn-mint:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(152, 216, 200, 0.5);
}

/* ========== 表单元素 ========== */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    color: var(--color-text-dark);
}

.form-input,
.form-textarea {
    width: 100%;
    padding: var(--spacing-sm);
    font-size: var(--font-size-base);
    font-family: inherit;
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid rgba(126, 184, 218, 0.3);
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-light-blue);
    background: var(--color-white);
    box-shadow: 0 0 0 4px rgba(126, 184, 218, 0.15);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-error {
    color: #e74c3c;
    font-size: var(--font-size-sm);
    margin-top: var(--spacing-xs);
}

/* ========== 进度条 ========== */
.progress {
    height: 8px;
    background: rgba(126, 184, 218, 0.2);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    background-size: 200% 200%;
    border-radius: var(--radius-lg);
    transition: width 0.5s ease;
}

/* ========== 标签 ========== */
.tag {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: var(--font-size-sm);
    border-radius: var(--radius-lg);
    background: rgba(126, 184, 218, 0.15);
    color: var(--color-light-blue);
}

.tag-pink {
    background: rgba(255, 182, 193, 0.2);
    color: #e88a9a;
}

.tag-mint {
    background: rgba(152, 216, 200, 0.2);
    color: #6bb8a5;
}

/* ========== 头像 ========== */
.avatar {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 4px solid var(--color-white);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.avatar-lg {
    width: 150px;
    height: 150px;
}

.avatar-sm {
    width: 60px;
    height: 60px;
}

/* ========== 分隔线 ========== */
.divider {
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(126, 184, 218, 0.3) 50%, 
        transparent 100%);
    margin: var(--spacing-lg) 0;
}

/* ========== 页脚 ========== */
.footer {
    padding: var(--spacing-xl) 0;
    text-align: center;
    color: var(--color-text-light);
}

.footer-text {
    font-size: var(--font-size-sm);
}

/* ========== 工具类 ========== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--color-light-blue); }
.text-pink { color: var(--color-pink); }
.text-mint { color: var(--color-mint-green); }
.text-muted { color: var(--color-text-light); }

.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }
.mt-5 { margin-top: var(--spacing-xl); }

.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }
.mb-5 { margin-bottom: var(--spacing-xl); }

.p-1 { padding: var(--spacing-xs); }
.p-2 { padding: var(--spacing-sm); }
.p-3 { padding: var(--spacing-md); }
.p-4 { padding: var(--spacing-lg); }
.p-5 { padding: var(--spacing-xl); }

.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.align-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--spacing-xs); }
.gap-2 { gap: var(--spacing-sm); }
.gap-3 { gap: var(--spacing-md); }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.hidden { display: none !important; }
.visible { display: block !important; }


/* ========== 导航栏滚动效果 ========== */
.navbar.scrolled {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

/* ========== 首页特定样式 ========== */
.hero-section {
    padding-top: calc(80px + var(--spacing-xl));
    min-height: 70vh;
    display: flex;
    align-items: center;
}

.hero-title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--color-text-dark);
}

.hero-description {
    font-size: var(--font-size-lg);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-info {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.avatar-wrapper {
    display: inline-block;
}

/* 引用样式 */
.quote-text {
    position: relative;
}

.quote-text::before,
.quote-text::after {
    font-size: 2rem;
    color: var(--color-light-blue);
    opacity: 0.5;
}

/* 感情态度区域 */
.feeling-item h4 {
    font-size: var(--font-size-base);
    font-weight: 600;
}

.feeling-item p {
    font-size: var(--font-size-sm);
    line-height: 1.8;
}


/* ========== 契合度测试页面样式 ========== */
.test-section {
    padding-top: calc(80px + var(--spacing-xl));
    min-height: 100vh;
    display: flex;
    align-items: center;
}

/* 测试开始界面 */
.test-start .test-icon {
    animation: pulse 2s ease-in-out infinite;
}

.test-info {
    background: rgba(126, 184, 218, 0.1);
}

.info-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.info-icon {
    font-size: var(--font-size-xl);
}

.info-text {
    font-size: var(--font-size-sm);
    color: var(--color-text);
}

/* 测试进度界面 */
.progress-wrapper {
    margin-bottom: var(--spacing-lg);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-bar-container {
    height: 10px;
    background: rgba(126, 184, 218, 0.2);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    background-size: 200% 200%;
    border-radius: var(--radius-lg);
    transition: width 0.5s ease;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.progress-percentage {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-light-blue);
}

/* 题目区域 */
.question-wrapper {
    min-height: 300px;
}

.question-text {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--color-text-dark);
    line-height: 1.5;
}

/* 选项列表 */
.options-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.option-item {
    display: flex;
    align-items: center;
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.6);
    border: 2px solid rgba(126, 184, 218, 0.2);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-item:hover {
    background: rgba(126, 184, 218, 0.1);
    border-color: var(--color-light-blue);
    transform: translateX(5px);
}

.option-item.selected {
    background: rgba(126, 184, 218, 0.2);
    border-color: var(--color-light-blue);
    box-shadow: 0 4px 15px rgba(126, 184, 218, 0.3);
}

.option-item.selected .option-radio {
    background: var(--color-light-blue);
    border-color: var(--color-light-blue);
}

.option-item.selected .option-radio::after {
    opacity: 1;
    transform: scale(1);
}

.option-radio {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(126, 184, 218, 0.5);
    border-radius: var(--radius-full);
    margin-right: var(--spacing-md);
    position: relative;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.option-radio::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    color: var(--color-white);
    font-size: 14px;
    font-weight: bold;
    opacity: 0;
    transition: all 0.3s ease;
}

/* 多选样式 */
.option-item.multiple .option-radio {
    border-radius: var(--radius-sm);
}

.option-text {
    font-size: var(--font-size-base);
    color: var(--color-text);
}

/* 导航按钮 */
.test-nav {
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(126, 184, 218, 0.2);
}

.test-nav .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* 测试结果界面 */
.result-icon {
    animation: bounce 1s ease-in-out;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.score-display {
    margin: var(--spacing-lg) 0;
}

.score-circle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 150px;
    height: 150px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

.score-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--color-white);
    line-height: 1;
}

.score-unit {
    font-size: var(--font-size-lg);
    color: rgba(255, 255, 255, 0.9);
}

.score-level {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--color-text-dark);
}

.result-description {
    background: rgba(126, 184, 218, 0.1);
    font-size: var(--font-size-base);
    color: var(--color-text);
    line-height: 1.8;
}

/* 分项得分 */
.category-scores {
    text-align: left;
}

.category-scores h3 {
    text-align: center;
    font-size: var(--font-size-lg);
    color: var(--color-text-dark);
}

.scores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--spacing-sm);
}

.score-item {
    display: flex;
    flex-direction: column;
    padding: var(--spacing-sm);
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-sm);
}

.score-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xs);
}

.score-item-name {
    font-size: var(--font-size-sm);
    color: var(--color-text);
}

.score-item-value {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-light-blue);
}

.score-item-bar {
    height: 6px;
    background: rgba(126, 184, 218, 0.2);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.score-item-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    transition: width 0.8s ease;
}

/* 加载状态 */
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(126, 184, 218, 0.2);
    border-top-color: var(--color-light-blue);
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* 按钮大小 */
.btn-lg {
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: var(--font-size-lg);
}

/* 涟漪效果 */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-full);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-ripple:active::after {
    width: 300px;
    height: 300px;
}

/* Section 通用样式 */
.section {
    padding: var(--spacing-xl) 0;
}

/* Grid 布局 */
.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: 1fr;
}


/* ========== 留言墙页面样式 ========== */
.messages-section {
    padding-top: calc(80px + var(--spacing-xl));
    min-height: 100vh;
}

.messages-header .header-icon {
    animation: pulse 2s ease-in-out infinite;
}

/* 留言表单 */
.message-form-wrapper {
    position: relative;
}

.message-form-wrapper h3 {
    color: var(--color-text-dark);
    font-size: var(--font-size-lg);
}

.char-count {
    font-size: var(--font-size-xs);
}

/* 留言列表 */
.messages-list-wrapper h3 {
    color: var(--color-text-dark);
    font-size: var(--font-size-lg);
}

.messages-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* 单条留言卡片 */
.message-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    transition: all 0.3s ease;
}

.message-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(126, 184, 218, 0.2);
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.message-author {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-white);
    font-weight: 600;
    font-size: var(--font-size-sm);
}

.message-nickname {
    font-weight: 600;
    color: var(--color-text-dark);
    font-size: var(--font-size-base);
}

.message-time {
    font-size: var(--font-size-xs);
    color: var(--color-text-light);
}

.message-content {
    color: var(--color-text);
    line-height: 1.8;
    word-wrap: break-word;
    white-space: pre-wrap;
}

/* Toast 提示 */
.toast-container {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.toast {
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
    background: var(--color-white);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease;
    max-width: 300px;
}

.toast-success {
    border-left: 4px solid var(--color-mint-green);
}

.toast-error {
    border-left: 4px solid #e74c3c;
}

.toast-info {
    border-left: 4px solid var(--color-light-blue);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* 表单提交中状态 */
.btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn.loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
    margin-left: var(--spacing-xs);
}


/* ========== 全局音乐播放器 ========== */
.music-player {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
}

.music-card {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1.2rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    max-width: 180px;
}

.music-player.collapsed .music-card {
    padding: 0;
    width: 50px;
    height: 50px;
    max-width: 50px;
    border-radius: 50%;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 182, 193, 0.9), rgba(126, 184, 218, 0.9));
    box-shadow: 0 4px 15px rgba(255, 150, 180, 0.4);
}

.music-player.collapsed .music-icon {
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.music-player.collapsed .music-info {
    opacity: 0;
    width: 0;
    margin: 0;
    padding: 0;
    position: absolute;
}

.music-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    animation: musicBounce 1s ease-in-out infinite;
}

.music-player.paused .music-icon {
    animation: none;
}

@keyframes musicBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.music-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.music-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-dark);
}

.music-status {
    font-size: 0.7rem;
    color: var(--color-light-blue);
}

.music-player.collapsed:hover .music-card {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 150, 180, 0.5);
}

@media (max-width: 768px) {
    .music-player {
        right: 15px;
        top: auto;
        bottom: 100px;
        transform: none;
    }
    
    .music-card {
        padding: 0.6rem 1rem;
    }
    
    .music-player.collapsed .music-card {
        padding: 0;
        width: 40px;
        height: 40px;
        max-width: 40px;
    }
    
    .music-icon {
        font-size: 1.3rem;
    }
}


/* ========== 全局进入动画 ========== */
.intro-envelope {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.intro-envelope.hidden {
    animation: introFadeOut 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: none;
}

@keyframes introFadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; visibility: hidden; }
}

.envelope-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ffeef8 0%, #fff5f5 25%, #f0f8ff 50%, #fff0f5 75%, #f5fffa 100%);
    background-size: 400% 400%;
    animation: bgGradientShift 4s ease infinite;
}

@keyframes bgGradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.envelope-bg::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 182, 193, 0.4) 0%, rgba(255, 218, 233, 0.2) 40%, transparent 70%);
    transform: translate(-50%, -50%);
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
}

.petal-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.petal {
    position: absolute;
    opacity: 0;
    animation: petalFall linear forwards;
}

@keyframes petalFall {
    0% { transform: translateY(-30px) rotate(0deg) translateX(0); opacity: 0; }
    10% { opacity: 0.9; }
    50% { transform: translateY(50vh) rotate(360deg) translateX(30px); }
    90% { opacity: 0.9; }
    100% { transform: translateY(100vh) rotate(720deg) translateX(-20px); opacity: 0; }
}

.envelope {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: envelopeFloat 3s ease-in-out infinite;
}

@keyframes envelopeFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.letter {
    position: relative;
    width: 320px;
    min-height: 240px;
    background: linear-gradient(90deg, rgba(200, 220, 240, 0.15) 1px, transparent 1px),
                linear-gradient(rgba(200, 220, 240, 0.15) 1px, transparent 1px),
                linear-gradient(180deg, #fffef9 0%, #fff9f0 100%);
    background-size: 12px 12px, 12px 12px, 100% 100%;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(255, 200, 200, 0.3);
    z-index: 10;
    opacity: 0;
    transform: scale(0.8) translateY(30px);
    animation: letterReveal 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s forwards;
}

@keyframes letterReveal {
    0% { transform: scale(0.8) translateY(30px) rotateX(15deg); opacity: 0; }
    60% { transform: scale(1.02) translateY(-10px) rotateX(-3deg); opacity: 1; }
    100% { transform: scale(1) translateY(0) rotateX(0deg); opacity: 1; }
}

.letter::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border: 1px dashed rgba(255, 150, 180, 0.3);
    border-radius: 8px;
    pointer-events: none;
}

.letter-content {
    padding: 2.5rem 2rem;
    text-align: center;
}

.letter-stamp {
    position: absolute;
    top: 12px;
    right: 18px;
    font-size: 2.2rem;
    opacity: 0;
    animation: stampBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 1.4s forwards;
}

@keyframes stampBounce {
    0% { opacity: 0; transform: scale(0) rotate(-30deg) translateY(-20px); }
    50% { transform: scale(1.3) rotate(10deg) translateY(5px); }
    70% { transform: scale(0.9) rotate(-5deg) translateY(-2px); }
    100% { opacity: 1; transform: scale(1) rotate(0deg) translateY(0); }
}

.letter-greeting {
    font-size: 1.15rem;
    color: #e91e63;
    margin-bottom: 1.2rem;
    opacity: 0;
    animation: textSlideUp 0.6s ease 1.6s forwards;
}

.letter-text {
    font-size: 0.95rem;
    color: #5a6c7d;
    line-height: 2.2;
    margin-bottom: 1.2rem;
    opacity: 0;
    animation: textSlideUp 0.6s ease 1.9s forwards;
}

.letter-text .highlight {
    color: #ff6b9d;
    font-weight: 600;
}

.letter-signature {
    font-size: 1.05rem;
    color: #7eb8da;
    font-style: italic;
    opacity: 0;
    animation: textSlideUp 0.6s ease 2.2s forwards;
}

@keyframes textSlideUp {
    0% { opacity: 0; transform: translateY(15px); }
    100% { opacity: 1; transform: translateY(0); }
}

.intro-hint {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(150, 150, 150, 0.8);
    font-size: 0.85rem;
    opacity: 0;
    animation: hintFadeIn 0.5s ease 2.8s forwards;
}

@keyframes hintFadeIn {
    to { opacity: 1; }
}

.intro-stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.intro-star {
    position: absolute;
    font-size: 1rem;
    opacity: 0;
    animation: starTwinkle 2s ease-in-out infinite;
}

.intro-star:nth-child(1) { top: 15%; left: 10%; animation-delay: 0s; }
.intro-star:nth-child(2) { top: 25%; right: 15%; animation-delay: 0.3s; }
.intro-star:nth-child(3) { top: 60%; left: 8%; animation-delay: 0.6s; }
.intro-star:nth-child(4) { top: 70%; right: 12%; animation-delay: 0.9s; }
.intro-star:nth-child(5) { top: 40%; left: 15%; animation-delay: 1.2s; }
.intro-star:nth-child(6) { bottom: 20%; right: 20%; animation-delay: 1.5s; }

@keyframes starTwinkle {
    0%, 100% { opacity: 0; transform: scale(0.5); }
    50% { opacity: 0.8; transform: scale(1); }
}

@media (max-width: 768px) {
    .letter {
        width: 260px;
        min-height: 200px;
    }
    .letter-content {
        padding: 2rem 1.5rem;
    }
    .letter-text {
        font-size: 0.88rem;
        line-height: 2;
    }
    .envelope-bg::before {
        width: 400px;
        height: 400px;
    }
}

@media (max-width: 375px) {
    .letter {
        width: 240px;
    }
    .letter-content {
        padding: 1.5rem 1.2rem;
    }
    .letter-greeting {
        font-size: 1rem;
    }
    .letter-text {
        font-size: 0.82rem;
    }
}
