/* ==================== 基础样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #9a0707;
    --secondary-color: #f7c30a;
    --text-dark: #4f5150;
    --text-light: #949292;
    --bg-light: #fff;
    --bg-cream: #faf8f3;
    --shadow: 0 2px 20px rgba(0,0,0,0.1);
    --border-dark: #2f3030;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 
                 'Microsoft YaHei', sans-serif;
    color: var(--text-dark);
    background: var(--bg-light);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

img {
    max-width: 100%;
    display: block;
}

/* 图片懒加载占位效果 */
img.lazy-load {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    min-height: 200px;
}

img.lazy-loaded {
    animation: fadeIn 0.3s ease-in;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==================== 加载动画 ==================== */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s;
}

.loading.hide {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
}

.loading .heart {
    font-size: 3rem;
    animation: heartbeat 1.5s infinite;
}

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

.loading p {
    margin-top: 1rem;
    color: var(--text-light);
}

/* ==================== 音乐引导层 ==================== */
.music-guide {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #faf8f3 0%, #f5f3ee 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    opacity: 1;
    transition: opacity 0.5s, transform 0.5s;
}

.music-guide.hide {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

.guide-content {
    text-align: center;
    padding: 2rem;
    max-width: 400px;
    position: relative;
}

.guide-icon {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    animation: float 3s ease-in-out infinite;
}

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

.guide-title {
    font-size: 2rem;
    background: linear-gradient(135deg, #9a0707 0%, #d4567f 50%, #f7c30a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    font-weight: bold;
    letter-spacing: 0.08em;
    text-shadow: 0 2px 10px rgba(154, 7, 7, 0.3);
    animation: shimmer 3s ease-in-out infinite;
    line-height: 1.4;
}

@keyframes shimmer {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.2);
    }
}

/* 为了确保文字阴影在渐变文字上可见，添加一个伪元素 */
.guide-title::before {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    z-index: -1;
    background: linear-gradient(135deg, #9a0707 0%, #d4567f 50%, #f7c30a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: blur(8px);
    opacity: 0.5;
}

.guide-text {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.start-btn {
    position: relative;
    padding: 18px 50px;
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, var(--primary-color) 0%, #b00808 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(154, 7, 7, 0.3);
    transition: all 0.3s ease;
    overflow: hidden;
}

.start-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.start-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(154, 7, 7, 0.4);
}

.start-btn:hover::before {
    width: 300px;
    height: 300px;
}

.start-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(154, 7, 7, 0.3);
}

.start-btn span {
    position: relative;
    z-index: 1;
    letter-spacing: 0.1em;
}

.btn-decoration {
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 1.5rem;
    animation: pulse 2s ease-in-out infinite;
}

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

.guide-hint {
    margin-top: 2rem;
    font-size: 0.9rem;
    color: var(--text-light);
    opacity: 0.8;
}

/* ==================== 音乐按钮 ==================== */
.music-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    z-index: 1000;
    cursor: pointer;
    transition: transform 0.3s;
}

.music-btn.playing .music-icon {
    animation: rotate 3s linear infinite;
}

.music-icon {
    font-size: 24px;
    display: inline-block;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ==================== 音乐播放器控制面板 ==================== */
.music-player {
    background: linear-gradient(135deg, #fff 0%, #f8f8f8 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-radius: 15px;
    padding: 25px 20px;
    margin: 2.5rem 0;
    max-width: 100%;
}

.player-cover {
    width: 180px;
    height: 180px;
    margin: 0 auto 20px;
    position: relative;
}

.cover-disc {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border: 3px solid rgba(255, 255, 255, 0.8);
}

.cover-disc.playing {
    animation: rotate 20s linear infinite;
}

.player-info {
    text-align: center;
    margin-bottom: 20px;
}

.song-title {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--text-dark);
    margin-bottom: 8px;
    letter-spacing: 0.05em;
}

.song-artist {
    font-size: 0.95rem;
    color: var(--text-light);
}

.player-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    padding: 0 10px;
}

.time-current,
.time-total {
    font-size: 0.85rem;
    color: var(--text-light);
    min-width: 40px;
    font-family: 'Courier New', monospace;
}

.time-current {
    text-align: right;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
    transition: height 0.2s;
}

.progress-bar:hover {
    height: 6px;
}

.progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s linear;
}

.progress-handle {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    left: 0%;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.progress-bar:hover .progress-handle {
    opacity: 1;
}

.player-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 25px 0 20px;
}

.control-btn {
    width: 50px;
    height: 50px;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-dark);
}

.control-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

.control-btn:active {
    transform: scale(0.95);
}

.control-play {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(154, 7, 7, 0.3);
}

.control-play:hover {
    background: #b00808;
    box-shadow: 0 6px 20px rgba(154, 7, 7, 0.4);
}

.control-btn svg {
    width: 24px;
    height: 24px;
}

.control-play svg {
    width: 28px;
    height: 28px;
}

.play-icon {
    display: block;
}

.pause-icon {
    display: none;
}

.control-play.playing .play-icon {
    display: none;
}

.control-play.playing .pause-icon {
    display: block;
}

.player-volume {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

.volume-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-light);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.volume-btn:hover {
    color: var(--text-dark);
    transform: scale(1.1);
}

.volume-btn svg {
    width: 24px;
    height: 24px;
}

.volume-on,
.volume-off {
    display: none;
}

.volume-btn:not(.muted) .volume-on {
    display: block;
}

.volume-btn.muted .volume-off {
    display: block;
}

/* ==================== 容器 ==================== */
.container {
    max-width: 100%;
    min-height: 100vh;
}

.page {
    min-height: 100vh;
    padding: 60px 20px 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.content-box {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

/* ==================== 第1页：封面 ==================== */
.page-cover {
    position: relative;
    background: #000;
    overflow: hidden;
}

.cover-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/cover.jpg');
    background-size: cover;
    background-position: center;
    opacity: 0.85;
}

.cover-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.5));
}

.cover-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
}

.cover-content .title {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 1rem;
    letter-spacing: 0.5rem;
}

.cover-content .subtitle {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.cover-content .date {
    font-size: 1rem;
    opacity: 0.8;
}

.scroll-hint {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    font-size: 0.9rem;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(10px); }
}

/* ==================== 动画 ==================== */
.animate-fade-in {
    animation: fadeIn 1s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-bounce {
    animation: fadeIn 1s ease-in, bounce 2s 1s infinite;
}

/* ==================== 通用组件 ==================== */
.section-title {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-dark);
    font-weight: bold;
    letter-spacing: 0.1em;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--primary-color);
    margin: 1rem auto 0;
}

.text-content {
    line-height: 2.15;
    color: var(--text-light);
    text-align: center;
    margin: 2rem 0;
    letter-spacing: 0.08em;
    font-size: 0.95rem;
}

.text-content p {
    margin: 0.5rem 0;
}

.divider {
    text-align: center;
    color: var(--text-light);
    margin: 1.5rem 0;
}

/* 装饰性圆点 */
.decorative-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 2rem 0;
}

.decorative-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

/* ==================== 第2页：开场白 ==================== */
.page-intro {
    background: var(--bg-cream);
    position: relative;
}

.page-intro::before,
.page-intro::after {
    content: '•';
    position: absolute;
    font-size: 0.8rem;
    color: var(--text-light);
}

.page-intro::before {
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
}

.page-intro::after {
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
}

/* ==================== 第3页：新人介绍 ==================== */
.page-couple {
    background: var(--bg-cream);
}

.couple-info {
    display: flex;
    align-items: center;
    justify-content: space-around;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.person {
    text-align: center;
    flex: 0 0 40%;
}

.photo-frame {
    width: 130px;
    height: 130px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--primary-color);
    box-shadow: 0 4px 15px rgba(154, 7, 7, 0.2);
    position: relative;
}

.photo-frame::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    pointer-events: none;
}

.couple-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.person h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.divider-line {
    width: 60px;
    height: 1px;
    background: var(--text-dark);
    margin: 0.5rem auto;
    position: relative;
}

.divider-line::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--text-dark), transparent);
}

.contact-btn {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 10px 24px;
    background: var(--border-dark);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-size: 0.85rem;
    transition: all 0.3s;
    border: 1px solid var(--border-dark);
    letter-spacing: 0.05em;
}

.contact-btn::before {
    content: '📞 ';
    margin-right: 5px;
}

.contact-btn:active {
    transform: scale(0.95);
}

.heart-symbol {
    font-size: 2rem;
    flex: 0 0 10%;
    text-align: center;
}

/* ==================== 第4页：爱情故事 ==================== */
.page-story {
    background: var(--bg-cream);
}

.story-content {
    margin-top: 2rem;
}

.photo-item {
    margin: 2rem 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.story-photo {
    width: 100%;
    height: auto;
}

.photo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 2rem 0;
}

.grid-photo {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

/* ==================== 第5页：婚礼信息 ==================== */
.page-info {
    background: var(--bg-cream);
}

/* 倒计时 */
.countdown-box {
    display: flex;
    justify-content: space-around;
    background: #000;
    padding: 25px 15px;
    border-radius: 8px;
    margin: 2rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    gap: 10px;
}

.countdown-item {
    text-align: center;
    color: white;
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    padding: 15px 10px;
    border-radius: 6px;
}

.countdown-value {
    display: block;
    font-size: 2.2rem;
    font-weight: bold;
    margin-bottom: 8px;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.05em;
}

.countdown-label {
    font-size: 0.85rem;
    opacity: 0.9;
    letter-spacing: 0.1em;
}

/* 信息区块 */
.info-section {
    margin: 2rem 0;
    text-align: center;
}

.info-section h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.info-text {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin: 0.5rem 0;
}

.info-subtext {
    font-size: 0.9rem;
    color: var(--text-light);
    margin: 0.5rem 0;
}

/* 日历 */
.calendar {
    background: white;
    padding: 25px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    margin: 2rem 0;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.calendar-header {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 5px;
}

.calendar-header .month {
    font-size: 3rem;
    font-weight: bold;
    line-height: 1;
}

.calendar-header .separator {
    font-size: 2rem;
    font-weight: 300;
    margin: 0 8px;
}

.calendar-header .day {
    font-size: 1.75rem;
    font-weight: bold;
    line-height: 1;
}

.calendar-header .year {
    font-size: 1.4rem;
    color: var(--text-light);
    font-weight: 400;
    margin-left: 10px;
}

.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 12px;
    text-align: center;
    font-weight: bold;
    font-size: 0.85rem;
    color: var(--text-dark);
    letter-spacing: 0.1em;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    text-align: center;
}

.calendar-days span {
    padding: 12px 8px;
    font-size: 0.9rem;
    color: var(--text-dark);
    border-radius: 4px;
    transition: all 0.2s;
}

.calendar-days span:not(:empty):hover {
    background: rgba(154, 7, 7, 0.05);
}

.calendar-days .today {
    background: var(--primary-color);
    color: white;
    border-radius: 6px;
    font-weight: bold;
    position: relative;
    box-shadow: 0 2px 8px rgba(154, 7, 7, 0.3);
    transform: scale(1.05);
}

.calendar-days .today i {
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 1rem;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

/* 导航按钮 */
.nav-btn {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 14px 35px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(154, 7, 7, 0.3);
    transition: all 0.3s;
    letter-spacing: 0.05em;
    border: none;
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(154, 7, 7, 0.4);
}

.nav-btn:active {
    transform: scale(0.95);
}

/* ==================== 第6页：宾客回执 ==================== */
.page-rsvp {
    background: var(--bg-cream);
}

.rsvp-form {
    margin: 2rem 0;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid var(--border-dark);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s;
    background: white;
    color: var(--text-dark);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--border-dark);
    box-shadow: 0 0 0 3px rgba(47, 48, 48, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.submit-btn {
    width: 100%;
    padding: 16px;
    background: var(--border-dark);
    color: white;
    border: 1px solid var(--border-dark);
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 0.05em;
}

.submit-btn:hover {
    background: #1a1a1a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.submit-btn:active {
    transform: scale(0.98);
}

.tips-section {
    margin-top: 3rem;
    padding: 20px;
    background: var(--bg-cream);
    border-radius: 10px;
}

.tips-section h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    text-align: center;
    color: var(--text-dark);
}

.tips-list {
    list-style: none;
    line-height: 1.8;
    color: var(--text-light);
}

.tips-list li {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    position: relative;
}

.tips-list li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.2rem;
}

/* ==================== 第7页：结束页 ==================== */
.page-end {
    background: var(--bg-cream);
}

.end-photo {
    margin: 2rem 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.final-photo {
    width: 100%;
    height: auto;
}

.thanks {
    font-size: 2rem;
    text-align: center;
    margin: 2rem 0 1rem;
    color: var(--primary-color);
    letter-spacing: 0.5rem;
}

.signature {
    text-align: center;
    color: var(--text-light);
    font-style: italic;
    margin: 1rem 0 3rem;
}

/* ==================== 响应式设计 ==================== */
@media screen and (max-width: 375px) {
    html {
        font-size: 14px;
    }
    
    .cover-content .title {
        font-size: 2.5rem;
    }
    
    .couple-info {
        flex-direction: column;
    }
    
    .person {
        flex: 0 0 100%;
        margin-bottom: 2rem;
    }
    
    .heart-symbol {
        flex: 0 0 100%;
        margin: 1rem 0;
    }
}

@media screen and (min-width: 768px) {
    .container {
        max-width: 768px;
        margin: 0 auto;
    }
    
    .page {
        padding: 80px 40px 60px;
    }
}

/* ==================== 滚动优化 ==================== */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* ==================== 深色模式支持 ==================== */
@media (prefers-color-scheme: dark) {
    :root {
        --text-dark: #e0e0e0;
        --text-light: #b0b0b0;
        --bg-light: #1a1a1a;
        --bg-cream: #2a2a2a;
    }
}