/* ==================== 全局重置与基础 ==================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --pink: #FF6B8A;
    --pink-light: #FFB3C6;
    --pink-pale: #FFF0F5;
    --pink-deep: #E75480;
    --pink-glow: #FF8FAB;
    --white: #FFFFFF;
    --text: #5D4E5F;
    --text-light: #9B8EA0;
    --gold: #FFD700;
    --shadow: 0 8px 30px rgba(255, 107, 138, 0.15);
    --shadow-hover: 0 15px 40px rgba(255, 107, 138, 0.25);
    --radius: 20px;
    --radius-sm: 12px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
    background: linear-gradient(180deg, #FFF0F5 0%, #FFF5F7 30%, #FFF0F5 60%, #FFE4E9 100%);
    min-height: 100vh;
    color: var(--text);
    overflow-x: hidden;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* ==================== 装饰粒子 ==================== */
.particles {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 0;
}
.particle {
    position: absolute;
    width: 6px; height: 6px;
    background: var(--pink-light);
    border-radius: 50%;
    animation: floatUp 8s linear infinite;
    opacity: 0.5;
}
@keyframes floatUp {
    0% { transform: translateY(100vh) scale(0) rotate(0deg); opacity: 0; }
    10% { opacity: 0.6; }
    90% { opacity: 0.2; }
    100% { transform: translateY(-10vh) scale(1.5) rotate(360deg); opacity: 0; }
}

/* ==================== 头部 ==================== */
.header {
    background: linear-gradient(135deg, #FFB3C6 0%, #FF8FAB 40%, #FF6B8A 100%);
    padding: 20px 0;
    box-shadow: 0 4px 20px rgba(255, 107, 138, 0.3);
    position: sticky; top: 0; z-index: 1000;
}
.header .container {
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px;
}
.logo { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.logo-icon { font-size: 2rem; }
.logo h1 {
    font-size: 1.8rem; color: #fff; font-weight: 800; letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.subtitle { font-size: 0.85rem; color: rgba(255,255,255,0.85); width: 100%; margin-top: 2px; }

.navigation { display: flex; gap: 8px; flex-wrap: wrap; }
.nav-item {
    display: flex; align-items: center; gap: 6px;
    padding: 10px 20px; border-radius: 25px;
    background: rgba(255,255,255,0.25); color: #fff;
    text-decoration: none; font-weight: 600; font-size: 0.95rem;
    transition: var(--transition); cursor: pointer;
    backdrop-filter: blur(4px);
}
.nav-item:hover { background: rgba(255,255,255,0.4); transform: translateY(-2px); }
.nav-item.active { background: #fff; color: var(--pink); box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
.nav-icon { font-size: 1.2rem; }

/* ==================== 主要内容区域 ==================== */
.main-content { padding: 40px 0; min-height: calc(100vh - 200px); position: relative; z-index: 1; }
.section { display: none; animation: fadeSlideIn 0.5s ease; }
.section.active { display: block; }
@keyframes fadeSlideIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.section-header { text-align: center; margin-bottom: 36px; }
.section-header h2 { font-size: 2.2rem; color: var(--pink-deep); margin-bottom: 8px; font-weight: 700; }
.section-header p { font-size: 1.1rem; color: var(--text-light); }

/* ==================== 场景筛选标签 ==================== */
.filter-tabs {
    display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 32px;
}
.filter-tab {
    padding: 10px 22px; border-radius: 25px; border: 2px solid var(--pink-light);
    background: #fff; color: var(--pink-deep); cursor: pointer;
    font-size: 0.95rem; font-weight: 600; transition: var(--transition);
}
.filter-tab:hover { border-color: var(--pink); background: var(--pink-pale); }
.filter-tab.active { background: linear-gradient(135deg, var(--pink), var(--pink-glow)); color: #fff; border-color: transparent; }

/* ==================== 穿搭卡片 ==================== */
.outfit-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; margin-bottom: 36px;
}
.outfit-card {
    background: #fff; border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow); transition: var(--transition); cursor: pointer;
    border: 1px solid rgba(255, 179, 198, 0.3);
}
.outfit-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); }
.outfit-card-image {
    height: 180px; display: flex; align-items: center; justify-content: center;
    font-size: 5rem; position: relative; overflow: hidden;
}
.outfit-card-image .bg-pattern {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0.15; pointer-events: none;
}
.outfit-card-body { padding: 20px; }
.outfit-card-body h4 { font-size: 1.2rem; color: var(--text); margin-bottom: 6px; }
.outfit-card-body .occasion-tag {
    display: inline-block; padding: 4px 14px; border-radius: 15px;
    background: var(--pink-pale); color: var(--pink-deep);
    font-size: 0.8rem; font-weight: 600; margin-bottom: 8px;
}
.outfit-card-body .outfit-items {
    display: flex; flex-wrap: wrap; gap: 6px;
}
.outfit-item-tag {
    padding: 4px 10px; border-radius: 12px; background: #f8f8f8;
    color: var(--text-light); font-size: 0.8rem;
}
.outfit-card-body .style-note {
    margin-top: 10px; font-size: 0.85rem; color: var(--text-light); line-height: 1.5;
}

/* ==================== 穿搭详情弹窗 ==================== */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 2000;
    justify-content: center; align-items: center; padding: 20px;
    backdrop-filter: blur(4px);
}
.modal-overlay.show { display: flex; }
.modal-card {
    background: #fff; border-radius: var(--radius); padding: 36px;
    max-width: 520px; width: 100%; max-height: 85vh; overflow-y: auto;
    position: relative; box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes popIn { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-close {
    position: absolute; top: 16px; right: 20px; font-size: 1.8rem;
    color: var(--text-light); cursor: pointer; transition: var(--transition);
}
.modal-close:hover { color: var(--pink); transform: rotate(90deg); }

.outfit-detail-card .detail-icon { font-size: 6rem; text-align: center; margin-bottom: 16px; }
.outfit-detail-card h3 { font-size: 1.6rem; color: var(--pink-deep); text-align: center; margin-bottom: 6px; }
.outfit-detail-card .detail-occasion {
    text-align: center; margin-bottom: 20px; color: var(--text-light);
}
.outfit-detail-card .detail-items {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px;
}
.detail-item {
    background: var(--pink-pale); padding: 14px; border-radius: var(--radius-sm);
    text-align: center;
}
.detail-item .item-emoji { font-size: 2rem; }
.detail-item .item-label { font-size: 0.85rem; color: var(--text); font-weight: 600; }
.detail-item .item-desc { font-size: 0.78rem; color: var(--text-light); margin-top: 2px; }
.outfit-detail-card .detail-tip {
    background: linear-gradient(135deg, #FFF0F5, #FFE4E9);
    padding: 16px; border-radius: var(--radius-sm); font-size: 0.9rem;
    color: var(--pink-deep); text-align: center; line-height: 1.6;
}

/* ==================== 颜色搭配模块 ==================== */
.color-picker-section { text-align: center; margin-bottom: 36px; }
.color-picker-section h3 { font-size: 1.2rem; color: var(--text); margin-bottom: 20px; }
.color-presets {
    display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin-bottom: 20px;
}
.color-preset {
    width: 50px; height: 50px; border-radius: 50%; cursor: pointer;
    border: 3px solid transparent; transition: var(--transition);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.color-preset:hover { transform: scale(1.15); }
.color-preset.active { border-color: var(--pink-deep); transform: scale(1.1); box-shadow: 0 0 0 6px rgba(255,107,138,0.2); }
.custom-color-row {
    display: flex; align-items: center; justify-content: center; gap: 12px;
}
#custom-color {
    width: 44px; height: 44px; border: none; border-radius: 50%; cursor: pointer;
    border: 3px solid var(--pink-light);
}
.custom-color-row label { font-size: 0.9rem; color: var(--text-light); }

.scheme-section { margin-bottom: 40px; }
.scheme-section h3 { text-align: center; font-size: 1.2rem; color: var(--text); margin-bottom: 20px; }
.scheme-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.scheme-card {
    background: #fff; border-radius: var(--radius); padding: 24px;
    box-shadow: var(--shadow); transition: var(--transition);
}
.scheme-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.scheme-card h4 { font-size: 1rem; color: var(--text); margin-bottom: 12px; }
.scheme-swatches { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.scheme-swatch {
    width: 56px; height: 56px; border-radius: 14px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1); transition: var(--transition);
    display: flex; align-items: flex-end; justify-content: center;
    padding-bottom: 4px; font-size: 0.65rem; font-weight: 600;
}
.scheme-swatch:hover { transform: scale(1.1); }
.scheme-card .scheme-desc { font-size: 0.85rem; color: var(--text-light); line-height: 1.5; }

.color-tips-section { margin-bottom: 40px; }
.color-tips-section h3 { text-align: center; font-size: 1.2rem; color: var(--text); margin-bottom: 20px; }
.tips-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.tip-card {
    background: #fff; border-radius: var(--radius-sm); padding: 20px;
    box-shadow: var(--shadow); transition: var(--transition);
    border-left: 4px solid var(--pink);
}
.tip-card:hover { transform: translateY(-2px); }
.tip-card .tip-icon { font-size: 1.8rem; margin-bottom: 8px; }
.tip-card h4 { font-size: 1rem; color: var(--text); margin-bottom: 6px; }
.tip-card p { font-size: 0.85rem; color: var(--text-light); line-height: 1.5; }

/* ==================== 答案之书模块 ==================== */
.book-container {
    display: flex; justify-content: center; align-items: center;
    padding: 40px 0; position: relative;
}
.book-glow {
    position: absolute; width: 300px; height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,107,138,0.2) 0%, transparent 70%);
    pointer-events: none; transition: all 0.8s ease;
}
.book-glow.active { width: 400px; height: 400px; opacity: 0.8; }

.book {
    width: 320px; height: 420px; perspective: 1200px; cursor: pointer; position: relative; z-index: 2;
}
.book-cover {
    width: 100%; height: 100%;
    background: linear-gradient(145deg, #E75480 0%, #FF6B8A 30%, #FF8FAB 60%, #E75480 100%);
    border-radius: 8px 20px 20px 8px;
    position: absolute; top: 0; left: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    box-shadow: 8px 8px 30px rgba(231,84,128,0.4);
    transform-origin: left center;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 3;
    border: 3px solid rgba(255,255,255,0.3);
}
.book-cover::after {
    content: ''; position: absolute; left: 8px; top: 4px; bottom: 4px;
    width: 3px; background: rgba(255,255,255,0.2); border-radius: 2px;
}
.book.open .book-cover { transform: rotateY(-160deg); }
.book-cover-decoration {
    display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.cover-star { font-size: 1.5rem; color: var(--gold); text-shadow: 0 0 10px rgba(255,215,0,0.5); animation: twinkle 2s infinite; }
@keyframes twinkle {
    0%,100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}
.book-cover-decoration h3 {
    font-size: 2rem; color: #fff; font-weight: 700; letter-spacing: 4px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.cover-hint {
    margin-top: 20px; font-size: 0.9rem; color: rgba(255,255,255,0.8);
    animation: pulseHint 2s infinite;
}
@keyframes pulseHint { 0%,100% { opacity: 0.7; } 50% { opacity: 1; } }

.book-pages {
    width: 100%; height: 100%;
    position: absolute; top: 0; left: 0;
    display: flex; border-radius: 8px 20px 20px 8px;
    overflow: hidden; z-index: 1;
    box-shadow: 8px 8px 30px rgba(0,0,0,0.1);
}
.book-left-page {
    flex: 1; background: linear-gradient(90deg, #fffdfc 0%, #fdf6f0 100%);
    border-right: 1px solid #f0e6de;
}
.book-right-page {
    flex: 1; background: #fffdfc;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 30px 20px;
}
.answer-text {
    font-size: 1.4rem; font-weight: 700; color: var(--pink-deep);
    text-align: center; line-height: 1.8; transition: all 0.5s ease;
}
.answer-subtitle {
    margin-top: 12px; font-size: 0.85rem; color: var(--text-light);
    text-align: center; font-style: italic;
}

/* 翻书动画 */
.book.flipping .book-cover { animation: flipPage 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
@keyframes flipPage {
    0% { transform: rotateY(0deg); }
    50% { transform: rotateY(-90deg); }
    100% { transform: rotateY(-160deg); }
}

/* ==================== 按钮 ==================== */
.center-action { text-align: center; margin: 32px 0; }
.btn-sparkle {
    padding: 14px 36px; border: none; border-radius: 30px;
    background: linear-gradient(135deg, #FF6B8A, #FF8FAB);
    color: #fff; font-size: 1.05rem; font-weight: 700; cursor: pointer;
    transition: var(--transition); box-shadow: 0 6px 20px rgba(255,107,138,0.3);
    letter-spacing: 1px;
}
.btn-sparkle:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(255,107,138,0.4); }
.btn-sparkle:active { transform: scale(0.97); }
.hint-text { color: var(--text-light); font-size: 0.95rem; margin-bottom: 12px; }

/* ==================== 答案历史 ==================== */
.answer-history {
    max-width: 500px; margin: 0 auto; margin-top: 40px;
}
.answer-history h4 {
    text-align: center; color: var(--text); font-size: 1.1rem; margin-bottom: 16px;
}
.history-list {
    display: flex; flex-direction: column; gap: 8px;
}
.history-item {
    background: #fff; padding: 14px 20px; border-radius: var(--radius-sm);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05); font-size: 0.9rem;
    display: flex; align-items: center; gap: 12px;
}
.history-item .history-answer { font-weight: 700; color: var(--pink-deep); }
.history-item .history-time { font-size: 0.75rem; color: var(--text-light); margin-left: auto; }
.empty-hint { text-align: center; color: var(--text-light); font-size: 0.9rem; }

/* ==================== 页脚 ==================== */
.footer {
    padding: 30px 0; text-align: center;
    background: linear-gradient(135deg, #FFB3C6, #FF8FAB);
    margin-top: 60px; color: #fff; position: relative; z-index: 1;
}
.footer-content { display: flex; align-items: center; justify-content: center; gap: 12px; }
.footer-icon { font-size: 1.2rem; }
.footer p { font-size: 0.95rem; opacity: 0.9; }

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    .header .container { flex-direction: column; text-align: center; }
    .logo { justify-content: center; }
    .section-header h2 { font-size: 1.8rem; }
    .book { width: 260px; height: 360px; }
    .outfit-grid { grid-template-columns: 1fr; }
    .scheme-cards { grid-template-columns: 1fr; }
    .filter-tabs { gap: 6px; }
    .filter-tab { padding: 8px 14px; font-size: 0.85rem; }
    .navigation { justify-content: center; }
    .nav-item { padding: 8px 14px; font-size: 0.85rem; }
}
@media (max-width: 480px) {
    .book { width: 220px; height: 310px; }
    .book-cover-decoration h3 { font-size: 1.5rem; }
    .outfit-card-image { height: 140px; font-size: 3.5rem; }
    .color-preset { width: 38px; height: 38px; }
    .scheme-swatch { width: 44px; height: 44px; }
}
