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

html, body {
    width: 100%;
    height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #2a0f0f 0%, #3d1818 100%);
    color: #333;
    overflow-x: hidden;
}

/* ==================== 信件容器 ==================== */
.letter-container {
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1a0a0a 0%, #3d1818 100%);
    transition: all 0.8s ease;
}

.letter-container.hidden {
    display: none;
}

.letter-envelope {
    perspective: 1000px;
    cursor: pointer;
    width: 400px;
    height: 280px;
    position: relative;
}

.letter-back {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #e8e8e8, #f5f5f5);
    border: 3px solid #d4af37;
    border-radius: 8px;
    z-index: 1;
    transform-origin: top;
    box-shadow: 0 20px 60px rgba(212, 175, 55, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.letter-front {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #f5f5f5, #ffffff);
    border-radius: 8px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 3px solid #d4af37;
    box-shadow: 0 20px 60px rgba(212, 175, 55, 0.3);
    z-index: 2;
    transform-origin: top;
    transform-style: preserve-3d;
    animation: letterFloat 3s ease-in-out infinite;
}

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

.letter-envelope:hover .letter-front {
    animation: none;
}

.letter-stamp {
    width: 50px;
    height: 60px;
    background: linear-gradient(45deg, #d4af37, #f4e4c1);
    border: 2px dashed #d4af37;
    position: absolute;
    top: 30px;
    right: 30px;
    border-radius: 4px;
    animation: stampRotate 4s ease-in-out infinite;
}

@keyframes stampRotate {
    0%, 100% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(-5deg);
    }
}

@keyframes letterOpen {
    0% {
        transform: rotateX(0deg);
        z-index: 2;
    }
    100% {
        transform: rotateX(120deg);
        z-index: 1;
    }
}

.letter-text {
    text-align: center;
}

.letter-text p {
    margin: 8px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.open-letter-btn {
    background: linear-gradient(135deg, #d4af37, #f4e4c1);
    color: #1a1a2e;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

.open-letter-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.5);
}

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

/* ==================== 主内容区域 ==================== */
/* 添加背景滚动动画 */
@keyframes backgroundScroll {
    0% { background-position: 0% center; }
    100% { background-position: 100% center; }
}

.main-content {
    min-height: 100vh;
    background: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)), url('./a.webp') center/200% 100% no-repeat; /* 添加半透明黑色渐变使背景变暗 */
    transition: all 0.8s ease;
    animation: backgroundScroll 20s linear infinite; /* 应用动画：20秒线性滚动，无限循环 */
}

.main-content.hidden {
    display: none;
}

/* 导航栏 */
.navbar {
    background: rgba(40, 15, 15, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #d4af37;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.navbar-title {
    font-size: 28px;
    color: #d4af37;
    font-weight: bold;
    letter-spacing: 2px;
}

.back-btn {
    background: linear-gradient(135deg, #d4af37, #f4e4c1);
    color: #1a1a2e;
    border: none;
    padding: 10px 25px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.4);
}

/* 章节标题 */
.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-size: 36px;
    color: #d4af37;
    margin-bottom: 15px;
    font-weight: bold;
    letter-spacing: 2px;
}

.header-line {
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #d4af37, transparent);
    margin: 0 auto;
}

/* ==================== 倒计时部分 ==================== */
.countdown-section {
    padding: 60px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.countdown-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 50px 0;
    flex-wrap: wrap;
}

.countdown-box {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(244, 228, 193, 0.1));
    border: 2px solid #d4af37;
    border-radius: 15px;
    padding: 30px;
    min-width: 100px;
    text-align: center;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    animation: countdownPulse 1s ease-in-out infinite;
}

.countdown-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.3);
    border-color: #f4e4c1;
}

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

.countdown-value {
    font-size: 48px;
    font-weight: bold;
    color: #d4af37;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

.countdown-label {
    font-size: 14px;
    color: #b8860b;
    margin-top: 10px;
    font-weight: 500;
}

.countdown-colon {
    font-size: 40px;
    color: #d4af37;
    animation: blinking 1s ease-in-out infinite;
}

@keyframes blinking {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

.countdown-text {
    text-align: center;
    font-size: 18px;
    color: #d4af37;
    margin-top: 40px;
    letter-spacing: 1px;
}

/* ==================== 拍照部分 ==================== */
.photo-section {
    padding: 60px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.photo-container {
    margin-top: 40px;
}

.photo-frame {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.photo-placeholder {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(244, 228, 193, 0.08));
    border: 3px dashed #d4af37;
    border-radius: 15px;
    padding: 80px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.photo-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(244, 228, 193, 0.2), transparent);
    transition: left 0.5s;
}

.photo-placeholder:hover::before {
    left: 100%;
}

.photo-placeholder:hover {
    border-color: #f4e4c1;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.25), rgba(244, 228, 193, 0.15));
    transform: scale(1.02);
}

.photo-icon {
    width: 60px;
    height: 60px;
    color: #d4af37;
    margin-bottom: 20px;
}

.photo-text {
    font-size: 24px;
    color: #d4af37;
    margin: 20px 0 10px 0;
    font-weight: bold;
}

.photo-subtitle {
    font-size: 14px;
    color: #b8860b;
}

.photo-input {
    display: none;
}

.uploaded-photo {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    border-radius: 15px;
    overflow: hidden;
    border: 3px solid #d4af37;
}

.uploaded-photo.hidden {
    display: none;
}

.uploaded-photo img {
    width: 100%;
    height: auto;
    display: block;
    animation: photoAppear 0.6s ease-out;
}

@keyframes photoAppear {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.change-photo-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #d4af37, #f4e4c1);
    color: #1a1a2e;
    border: none;
    padding: 12px 24px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.change-photo-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
}

/* ==================== 摄像头相关样式 ==================== */
.camera-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    border-radius: 15px;
    overflow: hidden;
    background: #000;
    display: none;
    aspect-ratio: 4/3;
}

.camera-container.active {
    display: block;
}

.camera-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.capture-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
}

.camera-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 30px;
    z-index: 10;
}

.camera-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.camera-btn svg {
    width: 24px;
    height: 24px;
    stroke: white;
    fill: none;
    stroke-width: 2;
}

.switch-btn {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
}

.switch-btn:hover {
    background: rgba(212, 175, 55, 0.6);
    border-color: #d4af37;
    transform: scale(1.1);
}

.capture-btn {
    width: 72px;
    height: 72px;
    background: rgba(255, 255, 255, 0.9);
    border: 4px solid #d4af37;
    position: relative;
}

.capture-btn:hover {
    transform: scale(1.05);
}

.capture-ring {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #d4af37, #f4e4c1);
    transition: all 0.3s ease;
}

.capture-btn:active .capture-ring {
    transform: scale(0.9);
}

.close-btn {
    width: 44px;
    height: 44px;
    background: rgba(255, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.6);
}

.close-btn:hover {
    background: rgba(255, 0, 0, 0.8);
    transform: scale(1.1);
}

/* 拍照按钮动画 */
@keyframes captureFlash {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
    100% {
        opacity: 0;
    }
}

.camera-container.capturing .capture-canvas {
    opacity: 1;
    animation: captureFlash 0.3s ease-out;
}

/* 照片操作按钮 */
.photo-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.3), rgba(244, 228, 193, 0.15));
    border: 2px solid #d4af37;
    border-radius: 25px;
    color: #d4af37;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.action-btn:hover {
    background: linear-gradient(135deg, #d4af37, #f4e4c1);
    color: #1a1a2e;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
}

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

.upload-action-btn input[type="file"] {
    display: none;
}

.photo-actions-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    display: flex;
    justify-content: center;
    gap: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.uploaded-photo:hover .photo-actions-overlay {
    opacity: 1;
}

/* ==================== 节目单部分 ==================== */
.program-section {
    padding: 60px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.program-container {
    margin-top: 40px;
}

.program-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.program-item {
    display: flex;
    align-items: center;
    gap: 30px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(244, 228, 193, 0.08));
    padding: 25px 30px;
    border-radius: 12px;
    border-left: 4px solid #d4af37;
    transition: all 0.3s ease;
    animation: slideIn 0.6s ease-out both;
    position: relative;
}

.program-item:nth-child(1) {
    animation-delay: 0.1s;
}

.program-item:nth-child(2) {
    animation-delay: 0.2s;
}

.program-item:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.program-item:hover {
    transform: translateX(10px);
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.25), rgba(244, 228, 193, 0.15));
    border-left-color: #f4e4c1;
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.2);
}

.program-item.pending {
    opacity: 0.8;
}

.program-number {
    font-size: 28px;
    font-weight: bold;
    color: #d4af37;
    min-width: 50px;
    text-align: center;
}

.program-info {
    flex: 1;
}

.program-name {
    font-size: 18px;
    color: #d4af37;
    margin-bottom: 5px;
    font-weight: bold;
}

.program-performer {
    font-size: 14px;
    color: #b8860b;
}

.program-time {
    font-size: 16px;
    color: #d4af37;
    font-weight: bold;
    min-width: 80px;
    text-align: right;
}

.program-delete-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d4af37, #f4e4c1);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 18px;
    color: #1a1a2e;
    position: relative;
}

.program-delete-btn::before,
.program-delete-btn::after {
    content: '';
    position: absolute;
    background-color: #1a1a2e;
}

.program-delete-btn::before {
    width: 14px;
    height: 2px;
    transform: rotate(45deg);
}

.program-delete-btn::after {
    width: 14px;
    height: 2px;
    transform: rotate(-45deg);
}

.program-delete-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.4);
}

.program-empty {
    text-align: center;
    padding: 60px 20px;
    color: #d4af37;
    font-size: 18px;
    opacity: 0.6;
}

.program-note {
    text-align: center;
    margin-top: 40px;
    padding: 30px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(244, 228, 193, 0.05));
    border-radius: 12px;
    border: 2px dashed #d4af37;
    font-size: 18px;
    color: #d4af37;
    animation: fadeInUp 0.8s ease-out 0.5s both;
}

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

/* 添加节目表单 */
.program-add-section {
    margin-top: 40px;
    padding: 30px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(244, 228, 193, 0.05));
    border-radius: 12px;
    border: 2px solid #d4af37;
}

.add-program-form {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 15px;
    align-items: end;
}

.program-input {
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #d4af37;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    transition: all 0.3s ease;
}

.program-input:focus {
    outline: none;
    border-color: #f4e4c1;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.program-input::placeholder {
    color: #b8860b;
}

.add-program-btn {
    background: linear-gradient(135deg, #d4af37, #f4e4c1);
    color: #1a1a2e;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.add-program-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
}

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

/* ==================== 页脚 ==================== */
.footer {
    background: rgba(40, 15, 15, 0.95);
    padding: 40px;
    text-align: center;
    border-top: 2px solid #d4af37;
    margin-top: 60px;
}

.footer p {
    font-size: 18px;
    color: #d4af37;
    letter-spacing: 1px;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 15px;
        padding: 15px 20px;
    }

    .navbar-title {
        font-size: 22px;
    }

    .section-header h2 {
        font-size: 28px;
    }

    .countdown-container {
        gap: 10px;
    }

    .countdown-box {
        padding: 20px;
        min-width: 80px;
    }

    .countdown-value {
        font-size: 36px;
    }

    .countdown-colon {
        font-size: 28px;
    }

    .program-item {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .program-time {
        text-align: center;
    }

    .letter-front {
        width: 90%;
        max-width: 350px;
        height: auto;
    }

    .countdown-section,
    .photo-section,
    .program-section {
        padding: 40px 20px;
    }

    .add-program-form {
        grid-template-columns: 1fr;
    }

    .add-program-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .navbar-title {
        font-size: 18px;
    }

    .section-header h2 {
        font-size: 24px;
    }

    .countdown-box {
        padding: 15px;
        min-width: 70px;
    }

    .countdown-value {
        font-size: 28px;
    }

    .letter-front {
        padding: 25px;
    }

    .open-letter-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}