/* ===== 福缘阁 - 玄学祈福网站样式 ===== */

:root {
    --primary: #C41E3A;
    --primary-dark: #8B0000;
    --gold: #D4A574;
    --gold-light: #F5DEB3;
    --bg: #1a0a0a;
    --bg-card: #2d1515;
    --bg-light: #3d2020;
    --text: #f0e6d2;
    --text-dim: #a09080;
    --success: #5cb85c;
    --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'STSong', 'SimSun', 'KaiTi', 'Microsoft YaHei', serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    background-image:
        radial-gradient(ellipse at 50% 0%, rgba(196,30,58,0.15) 0%, transparent 70%),
        radial-gradient(ellipse at 80% 20%, rgba(212,165,116,0.08) 0%, transparent 50%);
}

.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    padding-bottom: 80px;
    position: relative;
}

/* ===== Header ===== */
.header {
    background: linear-gradient(180deg, rgba(139,0,0,0.95) 0%, rgba(139,0,0,0.8) 100%);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--gold);
    position: sticky;
    top: 0;
    z-index: 100;
}
.logo {
    font-size: 20px;
    font-weight: 900;
    color: var(--gold-light);
    text-decoration: none;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.user-info {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 13px;
}
.user-info span { color: var(--gold-light); }

/* ===== Bottom Nav ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: rgba(20,5,5,0.95);
    display: flex;
    justify-content: space-around;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--bg-light);
    z-index: 100;
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-decoration: none;
    color: var(--text-dim);
    font-size: 11px;
    padding: 4px 12px;
    border-radius: 8px;
    transition: all 0.2s;
}
.nav-item.active { color: var(--gold); }
.nav-icon { font-size: 22px; }

/* ===== Hero ===== */
.hero-banner {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #5a0000 50%, var(--primary-dark) 100%);
    padding: 32px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-bottom: 2px solid var(--gold);
}
.hero-pattern {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        90deg, transparent, transparent 20px,
        rgba(212,165,116,0.05) 20px, rgba(212,165,116,0.05) 40px
    );
}
.hero-title { font-size: 36px; color: var(--gold-light); position: relative; z-index: 1; text-shadow: 0 2px 8px rgba(0,0,0,0.4); }
.hero-subtitle { color: var(--gold); margin-top: 8px; position: relative; z-index: 1; font-size: 16px; }
.hero-stats { display: flex; justify-content: center; gap: 24px; margin-top: 20px; position: relative; z-index: 1; }
.stat-item { text-align: center; }
.stat-num { font-size: 24px; font-weight: 900; color: var(--gold-light); display: block; }
.stat-label { font-size: 12px; color: var(--gold); }

/* ===== Cards ===== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    margin: 12px 16px;
    border: 1px solid var(--bg-light);
}
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.card-link { display: block; text-align: right; color: var(--gold); text-decoration: none; font-size: 14px; margin-top: 8px; }

/* ===== Almanac Card ===== */
.almanac-card { background: linear-gradient(135deg, var(--bg-card), #3a1a1a); }
.almanac-body { padding: 4px 0; }
.almanac-lunar { color: var(--gold); font-size: 14px; margin-bottom: 10px; }
.almanac-row { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.almanac-label { padding: 2px 10px; border-radius: 10px; font-size: 12px; font-weight: bold; min-width: 36px; text-align: center; }
.almanac-label.yi { background: #2d5a1e; color: #8fdf6e; }
.almanac-label.ji { background: #5a2d1e; color: #df8f6e; }
.almanac-text { font-size: 14px; flex: 1; line-height: 1.5; }
.almanac-meta { display: flex; gap: 12px; font-size: 12px; color: var(--text-dim); margin-top: 8px; flex-wrap: wrap; }

/* ===== Feature Grid ===== */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 0 16px;
    margin-bottom: 12px;
}
.feature-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px 8px;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    border: 1px solid var(--bg-light);
    transition: transform 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.feature-card:active { transform: scale(0.95); }
.feature-icon { font-size: 32px; }
.feature-name { font-size: 14px; font-weight: bold; }
.feature-desc { font-size: 11px; color: var(--text-dim); }

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: 25px;
    font-family: inherit;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--gold-light);
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(196,30,58,0.3);
}
.btn-primary:active { transform: scale(0.96); }
.btn-secondary {
    background: var(--bg-light);
    color: var(--text);
}
.btn-outline {
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
}
.btn-full { display: block; width: 100%; margin: 8px 0; }

/* ===== Page Header ===== */
.page-header {
    text-align: center;
    padding: 24px 16px 8px;
}
.page-header h2 { font-size: 24px; color: var(--gold-light); }
.page-header p { color: var(--text-dim); margin-top: 4px; }

/* ===== 求签 ===== */
.qian-container { text-align: center; padding: 20px 16px; }
.qian-tube {
    width: 100px; margin: 0 auto 20px;
    position: relative;
    transition: transform 0.1s;
}
.qian-tube.shaking { animation: shake 0.5s ease-in-out infinite; }
.qian-tube-body {
    background: linear-gradient(180deg, #6b3a2a, #4a2010);
    border-radius: 12px 12px 0 0;
    height: 160px;
    width: 100px;
    position: relative;
    overflow: hidden;
    border: 3px solid #8b5a3a;
}
.qian-tube-base {
    background: #8b5a3a;
    height: 20px;
    border-radius: 0 0 6px 6px;
}
.qian-sticks { position: absolute; top: 10px; left: 15px; }
.qian-sticks.shuffling { animation: shuffle 0.3s ease-in-out infinite; }
.stick {
    width: 3px; height: 45px;
    background: linear-gradient(180deg, #f5deb3, #d4a574);
    position: absolute;
    top: calc(var(--i) * 5px);
    left: calc(50% + var(--r, 0px));
    border-radius: 2px;
    transform: rotate(var(--r));
}
.btn-shake {
    font-size: 18px; padding: 14px 40px;
    animation: pulse 2s ease-in-out infinite;
}

/* ===== 签文结果 ===== */
.qian-result { padding: 0 16px 20px; }
.result-card {
    background: linear-gradient(135deg, #2d1515, #1a0808);
    border: 2px solid var(--gold);
    text-align: center;
    padding: 24px 20px;
    animation: fadeInUp 0.6s ease;
}
.sign-header { display: flex; justify-content: center; gap: 12px; margin-bottom: 8px; }
.sign-number { font-size: 18px; color: var(--gold); }
.sign-level { padding: 2px 12px; border-radius: 12px; font-size: 13px; }
.level-上签 { background: #5cb85c33; color: #5cb85c; }
.level-中签 { background: #f0ad4e33; color: #f0ad4e; }
.level-下签 { background: #d9534f33; color: #d9534f; }
.sign-title { font-size: 22px; color: var(--gold-light); margin: 8px 0; }
.sign-poem {
    font-size: 16px; line-height: 1.8; color: var(--text);
    padding: 12px; background: rgba(0,0,0,0.2); border-radius: 8px;
    margin: 12px 0; white-space: pre-line;
}
.sign-interpretation { font-size: 14px; color: var(--text-dim); line-height: 1.6; }
.sign-category { margin-top: 10px; font-size: 13px; color: var(--gold); }

/* ===== History ===== */
.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-item {
    display: flex; gap: 8px; align-items: center; padding: 8px;
    background: var(--bg-light); border-radius: 8px; font-size: 13px;
}
.hi-number { color: var(--gold); font-weight: bold; }
.hi-title { flex: 1; }
.hi-level { font-size: 11px; padding: 1px 6px; border-radius: 8px; }
.hi-time { color: var(--text-dim); font-size: 11px; }
.empty-hint { text-align: center; color: var(--text-dim); padding: 16px; }

/* ===== 供灯 ===== */
.active-lights-bar { background: var(--bg-card); padding: 12px 16px; text-align: center; border-bottom: 1px solid var(--bg-light); }
.lights-scroll { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.mini-light { background: var(--bg-light); padding: 4px 10px; border-radius: 15px; font-size: 13px; }
.lights-count { color: var(--gold); font-size: 13px; margin-top: 6px; }
.light-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.light-card {
    background: var(--bg-light); border-radius: var(--radius); padding: 12px 8px;
    text-align: center; cursor: pointer; border: 2px solid transparent;
    transition: all 0.2s;
}
.light-card.selected { border-color: var(--gold); background: #3a2020; }
.light-icon { font-size: 28px; display: block; }
.light-name { font-size: 14px; font-weight: bold; margin: 4px 0; display: block; }
.light-desc { font-size: 11px; color: var(--text-dim); display: block; }
.light-price { font-size: 13px; color: var(--gold); display: block; margin-top: 4px; }
.duration-options { display: flex; gap: 8px; flex-wrap: wrap; }
.dur-btn {
    padding: 8px 16px; border: 1px solid var(--bg-light); border-radius: 20px;
    background: transparent; color: var(--text); cursor: pointer; font-family: inherit;
    transition: all 0.2s;
}
.dur-btn.selected { background: var(--primary); color: var(--gold-light); border-color: var(--primary); }
.order-summary { margin-bottom: 16px; }
.order-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--bg-light); }
.order-price { font-size: 20px; color: var(--gold); font-weight: bold; }

/* ===== 抄经 ===== */
.scripture-container { padding: 0 16px 20px; }
.progress-bar-wrap { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.progress-bar { flex: 1; height: 12px; background: var(--bg-light); border-radius: 6px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--primary)); border-radius: 6px; transition: width 0.3s; width: 0; }
.progress-text { font-size: 13px; color: var(--gold); min-width: 100px; }
.scripture-paper {
    background: #fdf5e6; border-radius: 8px; overflow: auto;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    margin-bottom: 16px;
}
.scripture-actions { display: flex; gap: 10px; justify-content: center; }
.completion-msg { text-align: center; padding: 20px 16px; }

/* ===== 许愿墙 ===== */
.wish-input-wrap { }
.wish-input-wrap textarea {
    width: 100%; padding: 12px; border-radius: 8px; border: 1px solid var(--bg-light);
    background: var(--bg); color: var(--text); font-family: inherit; font-size: 14px;
    resize: vertical;
}
.wish-input-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.checkbox-label { font-size: 13px; color: var(--text-dim); display: flex; align-items: center; gap: 4px; cursor: pointer; }
.wish-wall { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.wish-card {
    background: var(--bg-card); border-radius: var(--radius); padding: 14px;
    border: 1px solid var(--bg-light); animation: fadeInUp 0.3s ease;
}
.wish-header { display: flex; justify-content: space-between; margin-bottom: 6px; }
.wish-user { font-size: 13px; color: var(--gold); font-weight: bold; }
.wish-time { font-size: 11px; color: var(--text-dim); }
.wish-content { font-size: 15px; line-height: 1.5; }
.wish-footer { margin-top: 8px; }
.btn-like { background: none; border: 1px solid var(--bg-light); color: var(--text-dim); padding: 4px 12px; border-radius: 14px; cursor: pointer; font-size: 12px; }

/* ===== 排行榜 ===== */
.tab-nav { display: flex; gap: 8px; padding: 8px 16px; }
.tab-btn {
    flex: 1; padding: 10px; background: var(--bg-card); color: var(--text);
    border: 1px solid var(--bg-light); border-radius: 8px; cursor: pointer;
    font-family: inherit; font-size: 14px; text-align: center;
}
.tab-btn.active { background: var(--primary); color: var(--gold-light); border-color: var(--primary); }
.rank-list { padding: 8px 16px; display: flex; flex-direction: column; gap: 8px; }
.rank-item {
    display: flex; align-items: center; gap: 10px;
    background: var(--bg-card); border-radius: var(--radius); padding: 12px 14px;
    border: 1px solid var(--bg-light);
}
.rank-item.top-1 { border-color: #ffd700; background: linear-gradient(135deg, #3a2a10, var(--bg-card)); }
.rank-item.top-2 { border-color: #c0c0c0; }
.rank-item.top-3 { border-color: #cd7f32; }
.rank-num { font-size: 20px; width: 32px; text-align: center; }
.rank-avatar { font-size: 24px; }
.rank-info { flex: 1; }
.rank-name { font-size: 15px; font-weight: bold; display: block; }
.rank-desc { font-size: 12px; color: var(--text-dim); }
.rank-merit { font-size: 16px; color: var(--gold); font-weight: bold; }

/* ===== 黄历详情 ===== */
.almanac-detail { text-align: center; }
.almanac-date-big { margin-bottom: 16px; }
.ad-solar { font-size: 24px; font-weight: bold; color: var(--gold-light); display: block; }
.ad-lunar { font-size: 16px; color: var(--gold); display: block; margin-top: 4px; }
.ad-week { font-size: 13px; color: var(--text-dim); }
.almanac-divider { height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); margin: 12px 0; }
.almanac-row.big { justify-content: center; margin-bottom: 10px; }
.week-almanac { padding: 8px 16px 20px; display: flex; flex-direction: column; gap: 8px; }
.day-card {
    background: var(--bg-card); border-radius: var(--radius); padding: 12px 14px;
    border: 1px solid var(--bg-light);
}
.day-card.today { border-color: var(--gold); background: #2a1a1a; }
.day-header { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.day-date { font-weight: bold; }
.day-weekday { color: var(--text-dim); font-size: 13px; }
.day-badge { background: var(--primary); color: var(--gold-light); font-size: 11px; padding: 1px 8px; border-radius: 8px; }
.day-lunar { font-size: 13px; color: var(--gold); margin-bottom: 4px; }
.day-row { font-size: 12px; color: var(--text-dim); margin-bottom: 2px; }
.day-row.yi { color: #8fdf6e; }
.day-row.ji { color: #df8f6e; }

/* ===== 海报 ===== */
.poster-preview-wrap { padding: 16px; }
.poster-card {
    background: var(--primary-dark);
    border-radius: var(--radius);
    overflow: hidden;
    border: 3px solid var(--gold);
    max-width: 360px;
    margin: 0 auto;
}
.poster-inner {
    padding: 24px 20px;
    text-align: center;
    background: linear-gradient(180deg, rgba(139,0,0,0.8), rgba(100,0,0,0.9));
}
.poster-top { margin-bottom: 12px; }
.poster-icon { font-size: 36px; }
.poster-title { font-size: 24px; color: var(--gold-light); }
.poster-dragon { margin: 16px 0; }
.poster-blessing { font-size: 32px; color: var(--gold-light); font-weight: 900; margin: 12px 0; }
.poster-subtitle { font-size: 14px; color: var(--gold); margin-bottom: 16px; }
.poster-info { padding: 12px; background: rgba(0,0,0,0.2); border-radius: 8px; }
.poster-user { font-size: 16px; color: var(--gold-light); }
.poster-merit { font-size: 13px; color: var(--gold); margin-top: 4px; }
.poster-stats { display: flex; justify-content: center; gap: 16px; margin: 12px 0; font-size: 13px; color: var(--text-dim); }
.poster-qr { margin-top: 12px; font-size: 12px; color: var(--text-dim); }
.qr-placeholder { font-size: 40px; margin-top: 4px; color: var(--gold); }
.blessing-options { display: flex; gap: 8px; flex-wrap: wrap; }
.blessing-btn {
    padding: 8px 16px; border: 1px solid var(--bg-light); border-radius: 20px;
    background: transparent; color: var(--text); cursor: pointer; font-family: inherit;
    font-size: 13px;
}
.blessing-btn.active { background: var(--gold); color: var(--bg); border-color: var(--gold); }
.poster-result { padding: 16px; text-align: center; }
.poster-result h3 { color: var(--gold); margin-bottom: 12px; }

/* ===== Animations ===== */
@keyframes shake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-8deg); }
    75% { transform: rotate(8deg); }
}
@keyframes shuffle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
.hidden { display: none !important; }

/* ===== Loading & States ===== */
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-loading { pointer-events: none; }

/* Toast message */
.toast-msg {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Smooth scroll */
html { scroll-behavior: smooth; }

/* Selection color */
::selection { background: var(--primary); color: var(--gold-light); }

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg-light); border-radius: 2px; }

/* Tap highlight removal */
a, button { -webkit-tap-highlight-color: transparent; }

/* Placeholder */
::placeholder { color: #6a5a4a; opacity: 0.6; }

/* Scripture paper scroll */
.scripture-paper { -webkit-overflow-scrolling: touch; max-height: 70vh; }

/* Light card transitions */
.light-card { transition: all 0.2s ease; }
.light-card:active { transform: scale(0.96); }

/* Duration buttons */
.dur-btn { transition: all 0.2s ease; }
.dur-btn:active { transform: scale(0.95); }

/* Wish card hover */
.wish-card { transition: transform 0.2s, box-shadow 0.2s; }
.wish-card:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,0.2); }

/* Rank item hover */
.rank-item { transition: transform 0.2s; }
.rank-item:hover { transform: translateX(4px); }

/* Poster responsive */
@media (max-width: 400px) {
    .poster-card { max-width: 100%; }
    .blessing-options { flex-wrap: wrap; }
}

/* ===== 经文选择 ===== */
.scripture-tabs { display: flex; gap: 8px; }
.scripture-tabs .tab-btn { flex: 1; }

/* ===== 供灯灯池 ===== */
.light-pool {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    padding: 8px;
}
.pool-light {
    aspect-ratio: 1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: rgba(255,165,0,0.1);
    animation: glow 2s ease-in-out infinite;
    animation-delay: calc(var(--i) * 0.2s);
}
.pool-light.lit {
    background: rgba(255,165,0,0.3);
    box-shadow: 0 0 12px rgba(255,165,0,0.4);
}
@keyframes glow {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* ===== 供奉队列滚动 ===== */
.queue-marquee { overflow: hidden; }
.queue-scroll { 
    display: flex; gap: 10px; 
    animation: marquee 20s linear infinite;
    width: max-content;
}
.queue-scroll:hover { animation-play-state: paused; }
.queue-item {
    background: var(--bg-light); padding: 6px 14px; border-radius: 15px;
    font-size: 12px; white-space: nowrap; flex-shrink: 0;
}
.queue-item:first-child { border: 1px solid var(--gold); background: #3a2020; }
@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Empty state CTA */
.empty-cta { text-align: center; padding: 24px 16px; }
.empty-cta .empty-icon { font-size: 48px; margin-bottom: 8px; }
.empty-cta .empty-text { color: var(--text-dim); font-size: 14px; margin-bottom: 12px; }

/* ===== 📱 手机端优化 (≤480px) ===== */
@media (max-width: 480px) {
    .app-container { max-width: 100%; }
    .feature-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 0 12px; }
    .feature-card { padding: 12px 6px; }
    .feature-icon { font-size: 26px; }
    .feature-name { font-size: 12px; }
    .hero-title { font-size: 28px; }
    .hero-stats { gap: 16px; }
    .stat-num { font-size: 20px; }
    .card { margin: 10px 12px; padding: 12px; }
    .bottom-nav { display: flex; }
    .desktop-sidebar { display: none; }
    .light-grid { grid-template-columns: repeat(2, 1fr); }
    .qr-modal { width: 95%; padding: 16px; }
}

/* ===== 💻 平板/桌面 (≥768px) ===== */
@media (min-width: 768px) {
    body { font-size: 16px; }
    .app-container {
        max-width: 1200px;
        display: flex;
        padding-bottom: 0;
        min-height: 100vh;
    }
    
    /* 桌面侧边栏 */
    .desktop-sidebar {
        display: flex !important;
        flex-direction: column;
        width: 220px;
        background: linear-gradient(180deg, rgba(139,0,0,0.95), rgba(30,5,5,0.98));
        border-right: 2px solid var(--gold);
        padding: 80px 0 20px;
        position: fixed;
        top: 0; left: 0; bottom: 0;
        z-index: 50;
    }
    .desktop-sidebar .nav-item {
        display: flex; align-items: center; gap: 10px;
        padding: 14px 24px; font-size: 15px;
        text-decoration: none; color: var(--text-dim);
        border-left: 3px solid transparent;
        transition: all 0.2s;
    }
    .desktop-sidebar .nav-item:hover,
    .desktop-sidebar .nav-item.active {
        color: var(--gold); background: rgba(212,165,116,0.08);
        border-left-color: var(--gold);
    }
    .desktop-sidebar .nav-icon { font-size: 20px; width: 24px; text-align: center; }

    /* 主内容区 */
    .main-content {
        margin-left: 220px;
        flex: 1;
        padding: 20px 32px;
        max-width: calc(1200px - 220px);
    }
    
    /* 隐藏底部导航 */
    .bottom-nav { display: none !important; }
    
    /* Header */
    .header {
        position: fixed; top: 0; left: 220px; right: 0;
        z-index: 60; padding: 14px 32px;
        justify-content: flex-end;
    }
    .header .logo { display: none; }
    
    /* Hero */
    .hero-banner { padding: 48px 32px; border-radius: 16px; margin: 0 0 20px; }
    .hero-title { font-size: 42px; }
    .hero-stats { gap: 40px; }
    .stat-num { font-size: 28px; }
    
    /* Feature grid - 3 columns on tablet, 6 on desktop */
    .feature-grid { 
        grid-template-columns: repeat(3, 1fr); 
        gap: 16px; padding: 0;
    }
    @media (min-width: 1024px) {
        .feature-grid { grid-template-columns: repeat(6, 1fr); }
    }
    .feature-card { padding: 20px 12px; }
    .feature-icon { font-size: 36px; }
    .feature-name { font-size: 15px; }
    
    /* Cards */
    .card { margin: 0 0 16px; padding: 20px; border-radius: 16px; }
    
    /* Light grid - 4 columns */
    .light-grid { grid-template-columns: repeat(4, 1fr); gap: 12px; }
    
    /* Almanac week */
    .week-almanac { 
        display: grid; 
        grid-template-columns: repeat(7, 1fr); 
        gap: 8px; 
    }
    
    /* Altar */
    .altar-area { margin: 0 0 20px; min-height: 250px; }
    .altar-table { min-height: 120px; padding: 24px; }
    
    /* QR modal */
    .qr-modal { max-width: 440px; }
    
    /* Admin */
    .admin-content { max-width: 1400px; }
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ===== 🖥️ 大屏桌面 (≥1200px) ===== */
@media (min-width: 1200px) {
    .app-container { max-width: 1400px; }
    .main-content { max-width: calc(1400px - 220px); }
    .feature-grid { grid-template-columns: repeat(6, 1fr); }
    .light-grid { grid-template-columns: repeat(4, 1fr); }
    .week-almanac { grid-template-columns: repeat(7, 1fr); }
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
    .row { flex-wrap: nowrap; }
}

/* ===== 悬停交互增强 ===== */
.feature-card:hover { transform: translateY(-4px); border-color: var(--gold); box-shadow: 0 8px 24px rgba(212,165,116,0.15); }
.card:hover { border-color: #5a3a2a; }
.rank-item:hover { background: var(--bg-light); cursor: default; }
.btn:hover { opacity: 0.9; transform: translateY(-1px); }
.btn:active { transform: scale(0.97); }
.light-card:hover { transform: translateY(-2px); }
.payment-method:hover { border-color: var(--gold); }


/* ===== 全局微交互 ===== */
.card, .feature-card, .rank-item, .btn, button {
    transition: all 0.25s cubic-bezier(.4,0,.2,1);
}
.card:active { transform: scale(.98); }
.btn:active, button:active { transform: scale(.95); }
.feature-card:active { transform: scale(.96); }

/* 涟漪效果 */
.ripple { position: relative; overflow: hidden; }
.ripple::after {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(circle, rgba(255,255,255,.15) 0%, transparent 70%);
    opacity: 0; transition: opacity .3s;
}
.ripple:active::after { opacity: 1; }

/* ===== 底部导航增强 ===== */
.bottom-nav {
    border-top: 1px solid rgba(212,165,116,.15);
    padding: 6px 0 env(safe-area-inset-bottom, 0);
}
.bottom-nav .nav-item {
    transition: all 0.2s;
    border-radius: 12px;
    margin: 0 2px;
}
.bottom-nav .nav-item:active {
    background: rgba(233,69,96,.15);
    transform: scale(.92);
}

/* ===== 桌面侧栏增强 ===== */
.desktop-sidebar {
}
.desktop-sidebar .nav-item {
    transition: all 0.2s cubic-bezier(.4,0,.2,1);
}

/* ===== 按钮系统 ===== */
.btn {
    position: relative;
    font-weight: 500;
    letter-spacing: .5px;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 4px 16px rgba(196,30,58,.25);
}
.btn-primary:hover { box-shadow: 0 6px 24px rgba(196,30,58,.35); }
.btn-outline { border: 2px solid var(--gold); color: var(--gold); }
.btn-outline:hover { background: rgba(212,165,116,.08); }

/* ===== 输入框增强 ===== */
input, textarea, select {
    transition: border-color .2s, box-shadow .2s;
}
input:focus, textarea:focus, select:focus {
    border-color: var(--gold) !important;
    box-shadow: 0 0 0 3px rgba(212,165,116,.1);
    outline: none;
}

/* ===== Toast 动画 ===== */
@keyframes toastIn {
    from { opacity: 0; transform: translate(-50%, -20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* ===== 空状态 ===== */
.empty-hint {
    text-align: center; color: var(--text-dim); padding: 20px; font-size: 13px;
}

/* ===== 滚动条美化 ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }


/* ===== 🎨 全局动效增强 ===== */

/* 页面切换淡入 */
.page-enter { animation: pageIn .35s cubic-bezier(.4,0,.2,1); }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* 滚动渐显 */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s cubic-bezier(.4,0,.2,1), transform .6s cubic-bezier(.4,0,.2,1); }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* 卡片悬浮增强 */
.card, .feature-card, .rank-item, .section {
    transition: transform .25s cubic-bezier(.4,0,.2,1), box-shadow .25s cubic-bezier(.4,0,.2,1), border-color .25s;
    will-change: transform;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,0,0,.35); border-color: rgba(212,165,116,.25); }
.feature-card:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 12px 36px rgba(233,69,96,.2); }

/* 按钮涟漪 */
.btn-ripple { position: relative; overflow: hidden; }
.btn-ripple::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle, rgba(255,255,255,.2) 0%, transparent 70%); opacity: 0; transition: opacity .4s; }
.btn-ripple:active::after { opacity: 1; transition: opacity 0s; }

/* Toast 增强 */
.toast {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    background: #16213e; color: var(--gold); padding: 12px 24px; border-radius: 12px;
    font-size: 14px; z-index: 9999; box-shadow: 0 8px 32px rgba(0,0,0,.5);
    border: 1px solid var(--gold); animation: toastIn .3s cubic-bezier(.4,0,.2,1);
    pointer-events: none;
}
.toast.error { color: #d9534f; border-color: #d9534f; }
.toast.success { color: #5cb85c; border-color: #5cb85c; }
.toast.warning { color: #f0ad4e; border-color: #f0ad4e; }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(-20px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* 骨架屏脉冲 */
.skeleton-pulse { animation: skPulse 1.8s ease infinite; }
@keyframes skPulse { 0%,100% { opacity: .4; } 50% { opacity: .8; } }

/* 标签Badge浮动 */
.badge-new { animation: badPop .6s cubic-bezier(.68,-.55,.27,1.55); }
@keyframes badPop { 0% { transform: scale(0); } 80% { transform: scale(1.2); } 100% { transform: scale(1); } }

/* 导航切换动效 */
.bottom-nav .nav-item { position: relative; }
.bottom-nav .nav-item::after {
    content: ''; position: absolute; bottom: -2px; left: 50%; transform: translateX(-50%) scaleX(0);
    width: 20px; height: 2px; background: var(--gold); border-radius: 1px;
    transition: transform .25s cubic-bezier(.4,0,.2,1);
}
.bottom-nav .nav-item:active::after, .bottom-nav .nav-item.active::after { transform: translateX(-50%) scaleX(1); }

/* 加载微调 */
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }

/* 桌面侧栏动效 */
.desktop-sidebar .nav-item {
    border-radius: 8px; margin: 2px 8px; padding: 10px 16px;
    transition: background .2s, color .2s, transform .2s;
}
.desktop-sidebar .nav-item:hover { background: rgba(233,69,96,.1); transform: translateX(2px); }
.desktop-sidebar .nav-item.active { background: rgba(233,69,96,.15); color: var(--gold); }


/* ===== 🚀 现代 CSS 高级技巧 ===== */

/* 1. CSS Container Queries — 组件级响应式 */
.card-container { container-type: inline-size; }
@container (min-width: 300px) {
  .card-responsive { display: grid; grid-template-columns: repeat(2,1fr); }
}

/* 2. View Transitions — 平滑页面切换 */
::view-transition-old(root) { animation: fadeOut .3s ease; }
::view-transition-new(root) { animation: fadeIn .5s ease; }
@keyframes fadeOut { to { opacity: 0; transform: scale(.98); } }

/* 3. Scroll-Driven — 滚动驱动动画 */
@supports (animation-timeline: scroll()) {
  .scroll-reveal { animation: slideUp linear both; animation-timeline: view(); animation-range: entry 10% entry 90%; }
  @keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
}

/* 4. CSS has() — 父选择器（新潮技巧） */
.card:has(.badge-new) { border-color: var(--gold); }
.btn:has(.loading) { pointer-events: none; opacity: .7; }
.wish-card:has(.wish-text:empty) { display: none; }

/* 5. @property — 渐变动画 */
@property --gradient-angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
.gradient-border {
  background: linear-gradient(var(--gradient-angle), var(--gold), var(--primary), var(--gold));
  animation: gradient-rotate 3s linear infinite;
}
@keyframes gradient-rotate { to { --gradient-angle: 360deg; } }

/* 6. 增强 backdrop-filter + 玻璃态 */

/* 7. 现代 focus-visible */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
:focus:not(:focus-visible) { outline: none; }

/* 8. CSS Nesting（现代浏览器原生） */
.card { 
  & .title { font-weight: bold; color: var(--gold); }
  & .body { line-height: 1.6; }
  &:hover { transform: translateY(-2px); }
}

/* 9. 文本自动适应 */
.text-fit { text-wrap: balance; }
.text-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 10. 图片优化 */
img { content-visibility: auto; }
.lazy-img { view-timeline-name: --image; view-timeline-axis: block; animation-timeline: --image; }


/* ===== 🚀 现代 CSS 框架级升级 ===== */

/* @property — 渐变色动画 */
@property --grad { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@property --pulse-opacity { syntax: '<number>'; initial-value: 0.5; inherits: false; }

/* 渐变边框动画 */
.glow-border {
  border: 2px solid transparent;
  background: linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
              linear-gradient(var(--grad), var(--gold), #e94560, var(--gold)) border-box;
  animation: border-rotate 4s linear infinite;
}
@keyframes border-rotate { to { --grad: 360deg; } }

/* has() — 状态驱动样式 */
.card:has(.badge-new) { border-color: var(--gold); box-shadow: 0 0 16px rgba(212,165,116,.15); }
.card:has(.empty) { opacity: .5; pointer-events: none; }
.btn:has(:disabled) { opacity: .4; }
.wish-card:has(.wish-text:empty) { display: none; }

/* CSS Nesting — 可读性提升 */
.card {
  & .card-header { font-weight: bold; color: var(--gold); }
  & .card-body { padding: 12px; line-height: 1.6; }
  &:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.3); }
  &:active { transform: scale(.98); }
}

/* text-wrap — 标题自动平衡 */
h1, h2, h3, .hero-title, .result-title { text-wrap: balance; }

/* scroll-behavior — 全局平滑滚动 */
html { scroll-behavior: smooth; }

/* content-visibility — 折叠区性能提升 */
.section-offscreen { content-visibility: auto; contain-intrinsic-size: 200px; }

/* 脉冲动画 — @property驱动 */
.pulse-glow { animation: pulse-glow 2s ease-in-out infinite; }
@keyframes pulse-glow { 
  0%, 100% { --pulse-opacity: 0.4; box-shadow: 0 0 8px rgba(var(--gold-rgb), var(--pulse-opacity)); } 
  50% { --pulse-opacity: 0.8; box-shadow: 0 0 24px rgba(var(--gold-rgb), var(--pulse-opacity)); } 
}

/* 现代 focus */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
:focus:not(:focus-visible) { outline: none; }

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* 移动端触摸优化 */
@media (pointer: coarse) {
  .btn, .nav-item, .wish-card { min-height: 44px; touch-action: manipulation; }
}




/* ===== 💻 桌面端增强 ===== */
@media(min-width:900px){
  .app-container { max-width: none !important; }
  body { font-size: 15px; }
  .hero h1 { font-size: 36px !important; }
  .hero p { font-size: 15px !important; }
  .hero-stat .n { font-size: 26px !important; }
  .hero-stat .l { font-size: 12px !important; }
  .wish-card { padding: 18px !important; }
  .wish-name { font-size: 14px !important; }
  .wish-text { font-size: 14px !important; }
  .wish-user { font-size: 12px !important; }
  .wish-time { font-size: 11px !important; }
  .card { padding: 20px !important; }
  .sec-title span { font-size: 17px !important; }
  .mq-item { font-size: 14px !important; }
  .mq-item .i { font-size: 18px !important; }
  .entry-card { padding: 20px 12px !important; }
  .ec-icon { font-size: 32px !important; }
  .ec-name { font-size: 14px !important; }
  h2 { font-size: 26px !important; }
  h3 { font-size: 18px !important; }
}
