/* ============================================================
   我们的恋爱成就 - 前台样式
   移动端优先，响应式适配
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #ff6b9d;
    --primary-light: #ff8fb8;
    --primary-dark: #e85a8a;
    --secondary: #a8e6cf;
    --accent: #ffd93d;
    --bg: #fff5f7;
    --card-bg: #ffffff;
    --text: #333333;
    --text-light: #888888;
    --text-lighter: #bbbbbb;
    --border: #ffe0e8;
    --shadow: 0 2px 12px rgba(255, 107, 157, 0.1);
    --shadow-hover: 0 6px 24px rgba(255, 107, 157, 0.2);
    --radius: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ---------- 顶部横幅 ---------- */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, #ffaec7 100%);
    color: white;
    padding: 48px 20px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 600px;
    margin: 0 auto;
}

.hero-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.hero-subtitle {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 24px;
}

.progress-bar-container {
    max-width: 320px;
    margin: 0 auto;
}

.progress-bar {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    height: 12px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    background: linear-gradient(90deg, var(--accent), #ffed4e);
    height: 100%;
    border-radius: 10px;
    transition: width 0.8s ease;
    width: 0%;
}

.progress-text {
    font-size: 13px;
    font-weight: 500;
}

/* ---------- 筛选标签 ---------- */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 16px 40px;
}

.filter-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.tab-btn {
    padding: 8px 20px;
    border: 2px solid var(--border);
    background: white;
    border-radius: 20px;
    font-size: 14px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.tab-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.tab-btn:hover:not(.active) {
    border-color: var(--primary-light);
    color: var(--primary);
}

/* ---------- 成就卡片网格 ---------- */
.achievement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}

@media (min-width: 600px) {
    .achievement-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 18px;
    }
}

.achievement-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 18px 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

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

.achievement-card.unlocked {
    border-color: var(--primary-light);
    background: linear-gradient(135deg, #fff 0%, #fff5f7 100%);
}

.achievement-card.locked {
    opacity: 0.65;
    filter: grayscale(0.3);
}

.achievement-card.locked:hover {
    opacity: 0.85;
    filter: grayscale(0);
}

.card-icon {
    font-size: 36px;
    text-align: center;
    margin-bottom: 10px;
    line-height: 1;
}

.achievement-card.unlocked .card-icon {
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 6px;
    color: var(--text);
}

.card-desc {
    font-size: 12px;
    color: var(--text-light);
    text-align: center;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-world-percent {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 10px;
    color: var(--primary);
    background: rgba(255, 107, 157, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.card-status {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.card-status.unlocked-badge {
    background: var(--secondary);
    color: #2d8659;
}

.card-status.locked-badge {
    background: #f0f0f0;
    color: #999;
}

/* ---------- 展开详情 ---------- */
.achievement-detail {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
    grid-column: 1 / -1;
}

.achievement-detail.open {
    max-height: 800px;
}

.detail-inner {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 4px;
    box-shadow: var(--shadow);
    border: 2px solid var(--primary-light);
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.detail-icon {
    font-size: 40px;
}

.detail-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.detail-desc {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 2px;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-light);
    background: var(--bg);
    padding: 6px 12px;
    border-radius: 8px;
}

.meta-item .meta-label {
    font-weight: 600;
    color: var(--primary);
}

.detail-photo {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 14px;
    cursor: pointer;
    max-height: 400px;
    object-fit: cover;
    transition: transform 0.3s;
}

.detail-photo:hover {
    transform: scale(1.01);
}

.detail-note {
    background: var(--bg);
    border-left: 3px solid var(--primary);
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
    font-size: 14px;
    color: var(--text);
    line-height: 1.7;
    white-space: pre-wrap;
}

.detail-locked-tip {
    text-align: center;
    padding: 20px;
    color: var(--text-lighter);
    font-size: 14px;
}

.detail-locked-tip .lock-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 8px;
}

/* ---------- 加载状态 ---------- */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
    font-size: 14px;
}

.loading.hidden {
    display: none;
}

/* ---------- 页脚 ---------- */
.footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-lighter);
    font-size: 12px;
}

/* ---------- 图片预览弹窗 ---------- */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
}

.modal-content {
    position: relative;
    z-index: 1;
    max-width: 90%;
    max-height: 90%;
}

.modal-content img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 12px;
    object-fit: contain;
}

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

.achievement-card {
    animation: fadeInUp 0.4s ease backwards;
}

/* 小屏适配 */
@media (max-width: 380px) {
    .hero-title {
        font-size: 24px;
    }
    .achievement-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .achievement-card {
        padding: 14px 10px;
    }
    .card-icon {
        font-size: 30px;
    }
    .card-title {
        font-size: 13px;
    }
}
