/* 重置和基础样式 */
:root {
    --primary-green: #2e8b57;
    --light-green: #90ee90;
    --dark-green: #006400;
    --accent-green: #3cb371;
    --background: linear-gradient(135deg, #f0fff0 0%, #e0f7e0 100%);
    --text-color: #333;
    --card-bg: rgba(255, 255, 255, 0.95);
    --shadow: 0 10px 30px rgba(46, 139, 87, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background: var(--background);
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
}

/* 动画背景 */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(45deg, #f0fff0, #e0f7e0, #d0f0d0);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 飘落的叶子 */
.leaf {
    position: fixed;
    background-color: var(--light-green);
    border-radius: 0 50%;
    z-index: -1;
    opacity: 0.7;
    animation: fall linear infinite;
}

.leaf1 {
    width: 30px;
    height: 30px;
    left: 10%;
    animation-duration: 15s;
    animation-delay: 0s;
}

.leaf2 {
    width: 20px;
    height: 20px;
    left: 30%;
    animation-duration: 12s;
    animation-delay: 3s;
}

.leaf3 {
    width: 25px;
    height: 25px;
    left: 50%;
    animation-duration: 18s;
    animation-delay: 6s;
}

.leaf4 {
    width: 35px;
    height: 35px;
    left: 70%;
    animation-duration: 14s;
    animation-delay: 9s;
}

.leaf5 {
    width: 22px;
    height: 22px;
    left: 90%;
    animation-duration: 16s;
    animation-delay: 12s;
}

@keyframes fall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* 主容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* 主界面样式 */
.main-page {
    text-align: center;
    padding-top: 5vh;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* 标题样式 */
.title {
    font-size: 4em;
    color: var(--dark-green);
    margin-bottom: 10px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.2);
    animation: fadeInDown 1s ease-out;
}

.glow {
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        text-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px var(--light-green);
    }
    to {
        text-shadow: 0 0 20px #fff, 0 0 30px var(--accent-green), 0 0 40px var(--primary-green);
    }
}

.subtitle {
    font-size: 1.8em;
    color: var(--primary-green);
    margin-bottom: 40px;
    animation: fadeInUp 1s ease-out 0.3s both;
}

.animated-subtitle {
    position: relative;
    display: inline-block;
}

.animated-subtitle::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 3px;
    bottom: -5px;
    left: 0;
    background: linear-gradient(90deg, transparent, var(--primary-green), transparent);
    animation: expandWidth 2s ease-in-out infinite;
}

@keyframes expandWidth {
    0%, 100% { width: 0; }
    50% { width: 100%; }
}

/* 标题装饰 */
.title-decoration {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px auto 40px;
    max-width: 400px;
}

.line {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-green));
    flex: 1;
}

.line.right {
    background: linear-gradient(90deg, var(--primary-green), transparent);
}

.flower {
    margin: 0 20px;
    font-size: 1.5em;
    color: var(--primary-green);
    animation: rotate 10s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 介绍框 */
.intro-box {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 20px;
    margin: 30px auto;
    max-width: 700px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(46, 139, 87, 0.1);
    animation: slideUp 1s ease-out 0.6s both;
    position: relative;
    overflow: hidden;
}

.intro-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(144, 238, 144, 0.2), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    100% { left: 100%; }
}

.memory-icon {
    font-size: 2em;
    color: var(--primary-green);
    margin-bottom: 15px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.memory-text {
    font-size: 1.3em;
    line-height: 1.8;
    margin: 10px 0;
    color: #444;
}

/* 导航按钮 */
.navigation {
    margin: 40px 0;
}

.nav-btn {
    background: linear-gradient(135deg, var(--primary-green), var(--dark-green));
    color: white;
    padding: 18px 50px;
    font-size: 1.3em;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 5px 15px rgba(46, 139, 87, 0.4);
    position: relative;
    overflow: hidden;
}

.nav-btn::after {
    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;
}

.nav-btn:hover::after {
    width: 300px;
    height: 300px;
}

.nav-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 20px rgba(46, 139, 87, 0.6);
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(46, 139, 87, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(46, 139, 87, 0); }
    100% { box-shadow: 0 0 0 0 rgba(46, 139, 87, 0); }
}

/* 导航链接 */
.nav-links {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.nav-link {
    color: var(--primary-green);
    text-decoration: none;
    font-size: 1.2em;
    padding: 10px 20px;
    border-radius: 25px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(46, 139, 87, 0.2);
}

.nav-link:hover {
    background: var(--primary-green);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(46, 139, 87, 0.3);
}

/* 倒计时 */
.countdown-box {
    background: rgba(255, 255, 255, 0.8);
    padding: 25px;
    border-radius: 15px;
    margin: 30px auto;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    animation: fadeIn 1.5s ease-out 1s both;
}

.countdown {
    font-size: 2em;
    font-weight: bold;
    color: var(--dark-green);
    margin: 15px 0;
    font-family: 'Courier New', monospace;
}

/* 页脚 */
footer {
    margin-top: 40px;
    padding: 20px 0;
    border-top: 1px solid rgba(46, 139, 87, 0.2);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.copyright {
    color: #666;
    font-size: 0.9em;
}

.social-icons {
    display: flex;
    gap: 20px;
}

.social-icon {
    color: var(--primary-green);
    font-size: 1.2em;
    transition: all 0.3s ease;
}

.social-icon:hover {
    color: var(--dark-green);
    transform: translateY(-3px);
}

/* 音乐按钮 */
.music-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, var(--primary-green), var(--dark-green));
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5em;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.floating {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.music-btn:hover {
    transform: scale(1.1) rotate(15deg);
}

/* 照片墙样式 - 胶卷效果 */
.gallery-page {
    min-height: 100vh;
}

.page-header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 1s ease-out;
}

.page-title {
    font-size: 3em;
    color: var(--dark-green);
    margin: 20px 0 10px;
}

.page-subtitle {
    font-size: 1.2em;
    color: var(--primary-green);
    margin-bottom: 30px;
}

.back-btn {
    color: var(--primary-green);
    text-decoration: none;
    font-size: 1em;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: var(--primary-green);
    color: white;
    transform: translateX(-5px);
}

/* 胶卷容器 */
.film-strip-container {
    height: 50vh;
    width: 100%;
    overflow: hidden;
    position: relative;
    background: linear-gradient(90deg, #222, #444);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    margin-bottom: 30px;
}

.film-strip {
    display: flex;
    flex-direction: column;
    height: 200%;
    animation: scrollFilm 30s linear infinite;
    position: relative;
}

.film-strip:hover {
    animation-play-state: paused;
}

@keyframes scrollFilm {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}

.film-item {
    height: 50%;
    display: flex;
    align-items: center;
    padding: 20px;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.film-perforation {
    position: absolute;
    left: 0;
    top: 0;
    width: 30px;
    height: 100%;
    background: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 20px,
        #666 20px,
        #666 25px
    );
}

.film-photo {
    width: 200px;
    height: 150px;
    object-fit: cover;
    border-radius: 5px;
    margin-left: 40px;
    border: 3px solid white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.film-photo:hover {
    transform: scale(1.05);
}

.film-info {
    flex: 1;
    padding: 0 30px;
    color: white;
}

.film-info h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: var(--light-green);
}

.film-info p {
    margin: 5px 0;
    opacity: 0.9;
}

/* 胶卷控制 */
.film-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.control-btn {
    background: var(--primary-green);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(46, 139, 87, 0.3);
}

.control-btn:hover {
    background: var(--dark-green);
    transform: translateY(-3px);
}

/* 照片详情 */
.photo-details {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    margin-top: 30px;
    animation: fadeIn 1s ease-out;
}

/* 毕业寄语页面 */
.memory-page {
    min-height: 100vh;
}

/* 签名板 */
.signature-board {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 40px;
    animation: fadeIn 1s ease-out;
}

.board-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(46, 139, 87, 0.2);
}

.board-header h2 {
    color: var(--dark-green);
    font-size: 2.2em;
    margin-bottom: 10px;
}

/* 签名输入 */
.signature-input {
    background: #f9f9f9;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    border: 2px dashed rgba(46, 139, 87, 0.3);
}

.input-group {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.input-group input {
    flex: 1;
    padding: 12px 20px;
    border: 1px solid rgba(46, 139, 87, 0.3);
    border-radius: 25px;
    font-size: 1em;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(46, 139, 87, 0.1);
}

/* 签名画布 */
.signature-pad {
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 15px;
    background: white;
    margin-bottom: 20px;
}

canvas {
    display: block;
    margin: 0 auto;
    border: 1px solid #ccc;
    border-radius: 5px;
    background: white;
    cursor: crosshair;
}

.canvas-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.canvas-btn {
    padding: 8px 15px;
    background: #f0f0f0;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
}

.canvas-btn:hover {
    background: #e0e0e0;
}

.submit-btn {
    background: linear-gradient(135deg, var(--primary-green), var(--dark-green));
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 30px;
    font-size: 1.1em;
    cursor: pointer;
    display: block;
    margin: 0 auto;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(46, 139, 87, 0.4);
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(46, 139, 87, 0.6);
}

/* 签名展示 */
.signatures-display {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.signature-item {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-left: 5px solid var(--primary-green);
    position: relative;
    animation: fadeInUp 0.5s ease-out;
}

.signature-item::before {
    content: '"';
    font-size: 3em;
    color: rgba(46, 139, 87, 0.2);
    position: absolute;
    top: 10px;
    left: 10px;
}

.signature-name {
    font-weight: bold;
    font-size: 1.2em;
    color: var(--dark-green);
    margin-bottom: 10px;
}

.signature-message {
    line-height: 1.6;
    margin-bottom: 15px;
    color: #555;
}

.signature-canvas {
    margin-top: 10px;
    border: 1px solid #eee;
    border-radius: 5px;
    padding: 5px;
    background: #f9f9f9;
}

.signature-time {
    font-size: 0.8em;
    color: #888;
    text-align: right;
}

.no-signatures {
    text-align: center;
    grid-column: 1 / -1;
    padding: 40px;
    color: #888;
}

.no-signatures i {
    font-size: 3em;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* 毕业寄语卡片 */
.graduation-messages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 40px;
}

.message-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border-top: 5px solid var(--primary-green);
}

.message-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(46, 139, 87, 0.2);
}

.message-card h3 {
    color: var(--dark-green);
    margin-bottom: 15px;
    font-size: 1.4em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.message-card p {
    line-height: 1.8;
    color: #555;
}

/* 动画类 */
.fade-in {
    animation: fadeIn 1s ease-out;
}

.slide-up {
    animation: slideUp 1s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .title {
        font-size: 2.5em;
    }
    
    .subtitle {
        font-size: 1.4em;
    }
    
    .nav-links {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
    
    .film-strip-container {
        height: 40vh;
    }
    
    .film-item {
        flex-direction: column;
        padding: 15px;
        text-align: center;
    }
    
    .film-photo {
        margin-left: 0;
        margin-bottom: 15px;
        width: 150px;
        height: 100px;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .signatures-display {
        grid-template-columns: 1fr;
    }
    
    .graduation-messages {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 2em;
    }
    
    .intro-box {
        padding: 20px;
    }
    
    .nav-btn {
        padding: 15px 30px;
        font-size: 1.1em;
    }
    
    .film-controls {
        flex-direction: column;
        align-items: center;
    }
}