/* ============================================================
   style.css · 豆豆之家 2026 七夕改版
   设计系统：「星河纪念册 × 奶油豆豆」
   — 月光纸 / 豆豆奶油 / 七夕暮紫 / 极光青 / 花束玫瑰 / 星光金 / 夜空墨蓝
   — 保留旧变量名映射，旧页面内联样式自动继承新主题
   ============================================================ */

/* ---------- 1. 设计令牌 ---------- */
:root {
    /* 新设计系统变量 */
    --bg-moonpaper:   #FFF9F3;   /* 月光纸 · 全局背景 */
    --cream-doudou:   #E9DDC7;   /* 豆豆奶油 · IP色、浅卡片 */
    --purple-qixi:    #6E587C;   /* 七夕暮紫 · 标题、主按钮 */
    --teal-aurora:    #79A99E;   /* 极光青 · 辅助状态、旅行章节 */
    --rose-bouquet:   #D9879D;   /* 花束玫瑰 · 强调、心动数据 */
    --gold-starlight: #D6B467;   /* 星光金 · 隐藏内容、获得奖励 */
    --ink-night:      #202A3D;   /* 夜空墨蓝 · 七夕封面、沉浸模式 */

    /* 旧变量兼容映射（旧页面内联样式自动换肤） */
    --bg-milky:      var(--bg-moonpaper);
    --text-soft:     #5A5166;    /* 柔和正文（暮紫灰） */
    --accent-pink:   var(--rose-bouquet);
    --accent-blue:   var(--teal-aurora);
    --polaroid-white:#FFFDF8;

    /* 字体（系统字体栈，不依赖 Google Fonts） */
    --title-font: 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', 'STSong', 'SimSun', serif;
    --body-font:  'MiSans', 'Noto Sans SC', 'Source Han Sans SC', 'PingFang SC', 'Microsoft YaHei', -apple-system, sans-serif;
    --cute-font:  'Kaiti SC', 'STKaiti', 'KaiTi', var(--title-font);

    --nav-height: 96px;          /* 底部导航留白 */
    --radius-card: 14px;
    --shadow-soft: 0 3px 14px rgba(110, 88, 124, 0.08);
    --shadow-float: 0 6px 18px rgba(110, 88, 124, 0.14);
    --ease-soft: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- 2. 基础 ---------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    background-color: var(--bg-moonpaper);
    background-image:
        linear-gradient(180deg, rgba(255,255,255,0.35), rgba(255,255,255,0));
    color: var(--text-soft);
    font-family: var(--body-font);
    margin: 0;
    padding: 0;
    padding-bottom: calc(var(--nav-height) + 16px);
    overflow-x: hidden;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }

a { color: var(--purple-qixi); }

/* ---------- 3. 排版 ---------- */
h1, h2, h3, .serif-title {
    font-family: var(--title-font);
    color: var(--purple-qixi);
    letter-spacing: 0.02em;
    line-height: 1.35;
}

h1 { font-size: 1.9rem; font-weight: 700; }
h2 { font-size: 1.45rem; font-weight: 700; }

/* 章节眉标（英文小标 / 年份编号） */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--teal-aurora);
    margin-bottom: 8px;
}
.eyebrow::before,
.eyebrow::after {
    content: '';
    height: 1px;
    width: 22px;
    background: currentColor;
    opacity: 0.5;
}

/* 页面标题块 */
.page-head {
    text-align: center;
    padding: 40px 16px 8px;
}
.page-head h1 { margin: 6px 0 4px; }
.page-head p { margin: 0; font-size: 0.95rem; color: #8A8196; }

/* ---------- 4. 通用卡片与按钮 ---------- */
.card {
    background: #FFFFFF;
    border: 1px solid rgba(233, 221, 199, 0.9);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft);
    padding: 26px 22px;
}

.card-cream {
    background: var(--cream-doudou);
    border: none;
    border-radius: var(--radius-card);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.6), var(--shadow-soft);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 26px;
    border-radius: 12px;
    border: none;
    font-family: var(--body-font);
    font-size: 0.98rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.25s var(--ease-soft), box-shadow 0.25s, background 0.25s;
}

.btn-primary {
    background: var(--purple-qixi);
    color: #FFF9F3;
    box-shadow: 0 4px 12px rgba(110, 88, 124, 0.25);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(110, 88, 124, 0.32);
}

.btn-rose {
    background: var(--rose-bouquet);
    color: #FFF9F3;
    box-shadow: 0 4px 12px rgba(217, 135, 157, 0.25);
}
.btn-rose:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(217, 135, 157, 0.35);
}

.btn-ghost {
    background: rgba(255,255,255,0.8);
    color: var(--purple-qixi);
    border: 1.5px solid rgba(110, 88, 124, 0.25);
}
.btn-ghost:hover { background: #fff; transform: translateY(-2px); }

.btn-gold {
    background: var(--gold-starlight);
    color: #4A3B14;
    box-shadow: 0 4px 12px rgba(214, 180, 103, 0.3);
}
.btn-gold:hover { transform: translateY(-2px); }

/* ---------- 5. 页面容器 ---------- */
.page-container {
    padding: 20px 16px;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    animation: fadeUp 0.55s var(--ease-soft) both;
}

/* ---------- 6. 底部导航（5 项 · 带文字标签） ---------- */
.bottom-nav {
    position: fixed;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: min(94vw, 540px);
    height: 66px;
    background: rgba(255, 253, 248, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(110, 88, 124, 0.14);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    border: 1px solid rgba(233, 221, 199, 0.8);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 64px;
    height: 60px;
    border-radius: 18px;
    text-decoration: none;
    color: #8A8196;
    transition: transform 0.2s var(--ease-soft), background 0.2s, color 0.2s;
    position: relative;
}

.nav-item .nav-icon {
    font-size: 1.35rem;
    line-height: 1;
    filter: grayscale(0.25) opacity(0.9);
    transition: filter 0.2s, transform 0.2s;
}

.nav-item .nav-label {
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    line-height: 1.2;
}

.nav-item:hover {
    transform: translateY(-3px);
    color: var(--purple-qixi);
}
.nav-item:hover .nav-icon { filter: none; transform: scale(1.1); }

.nav-item.active {
    color: var(--purple-qixi);
    background: rgba(233, 221, 199, 0.45);
    box-shadow: inset 0 0 0 1px rgba(110, 88, 124, 0.12);
}
.nav-item.active .nav-icon { filter: none; }

.nav-item:focus-visible {
    outline: 3px solid rgba(121, 169, 158, 0.5);
    outline-offset: 2px;
}

/* ---------- 7. 右上角用户条 ---------- */
.user-chip {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 252, 246, 0.9);
    backdrop-filter: blur(8px);
    padding: 6px 14px;
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(110, 88, 124, 0.18);
    font-size: 0.8rem;
    border: 1px solid rgba(255,255,255,0.95);
}
.user-chip .chip-name {
    font-family: var(--body-font);
    font-weight: 600;
    color: var(--purple-qixi);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-chip .chip-btn {
    text-decoration: none;
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 14px;
    transition: 0.2s;
    font-weight: 600;
}
.user-chip .chip-admin { background: #F3EAF6; color: var(--purple-qixi); }
.user-chip .chip-admin:hover { background: #EADCF0; }
.user-chip .chip-logout { background: #E9F1EF; color: var(--teal-aurora); }
.user-chip .chip-logout:hover { background: #DCEBE7; }

/* ---------- 8. 拍立得（旧类名兼容 + 新主题） ---------- */
.polaroid-wrapper {
    width: 280px;
    height: 360px;
    perspective: 1000px;
    cursor: pointer;
    position: relative;
    transition: transform 0.3s var(--ease-soft);
}

.polaroid-wrapper:hover {
    z-index: 100;
    transform: scale(1.04) rotate(0deg) !important;
}

.polaroid-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.7s var(--ease-soft);
    transform-style: preserve-3d;
    box-shadow: var(--shadow-soft);
    background-color: var(--polaroid-white);
    border-radius: 14px;
    border: 9px solid #FFFEFB;
}

.polaroid-wrapper.flipped .polaroid-inner { transform: rotateY(180deg); }

.polaroid-front, .polaroid-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    background-color: var(--polaroid-white);
    padding: 12px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    border-radius: 6px;
}

.photo-frame {
    background: var(--cream-doudou);
    width: 100%;
    height: 220px;
    overflow: hidden;
    border-radius: 6px;
    border: 1px solid rgba(233,221,199,0.8);
}
.photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.meta-info { margin-top: 14px; }

.date-stamp {
    font-family: var(--body-font);
    font-size: 0.78rem;
    color: var(--teal-aurora);
    background: #EDF5F2;
    padding: 2px 10px;
    border-radius: 12px;
    letter-spacing: 0.05em;
}

.caption {
    font-family: var(--cute-font);
    font-size: 1.25rem;
    margin-top: 6px;
    line-height: 1.3;
    color: #4A4252;
}

.action-hint {
    margin-top: auto;
    font-size: 0.78rem;
    color: var(--rose-bouquet);
    font-family: var(--body-font);
    opacity: 0.85;
}

.polaroid-back {
    transform: rotateY(180deg);
    background-color: #FFFDF4;
    background-image: linear-gradient(rgba(214,180,103,0.18) 1px, transparent 1px);
    background-size: 100% 26px;
    border: 4px solid var(--teal-aurora);
    text-align: left;
    overflow-y: auto;
}

.back-title {
    font-family: var(--title-font);
    font-size: 1rem;
    color: var(--purple-qixi);
    width: 100%;
    text-align: center;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 2px dashed rgba(214,180,103,0.55);
}

/* ---------- 9. 动效 ---------- */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes twinkle {
    0%, 100% { opacity: 0.35; transform: scale(0.9); }
    50%      { opacity: 1;    transform: scale(1.05); }
}

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

/* 尊重系统减弱动效偏好 */
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
    html { scroll-behavior: auto; }
}

/* ---------- 10. 响应式 ---------- */
@media (max-width: 640px) {
    h1 { font-size: 1.6rem; }
    .bottom-nav { width: min(96vw, 420px); }
    .page-container { padding: 16px 12px; }
}
