/* ==================== 全域設定 ==================== */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --accent-2: #f5576c;
    --text-dark: #2d3748;
    --text-light: #cbd5e0;
    --bg-dark: #1a202c;
    --bg-light: #f7fafc;
    --card-bg: rgba(255, 255, 255, 0.95);
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 20px 60px rgba(0, 0, 0, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Microsoft JhengHei', 'PingFang TC', 'Noto Sans TC', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==================== 粒子背景 ==================== */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.3;
}

/* ==================== 導航欄 ==================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(26, 32, 44, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
}

.nav-logo i {
    color: var(--accent-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-menu a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-menu a:hover {
    color: var(--accent-color);
}

/* ==================== 主橫幅 ==================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 20px 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.05" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,138.7C960,139,1056,117,1152,101.3C1248,85,1344,75,1392,69.3L1440,64L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>');
    background-size: cover;
}

.hero-content {
    position: relative;
    text-align: center;
    max-width: 1000px;
    z-index: 1;
}

.memorial-badge {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 12px 30px;
    border-radius: 50px;
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.hero-title {
    font-size: 4rem;
    color: white;
    margin-bottom: 20px;
    text-shadow: 2px 2px 20px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 1s ease;
}

.candle {
    display: inline-block;
    animation: flicker 2s ease-in-out infinite;
}

@keyframes flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.hero-subtitle {
    font-size: 1.8rem;
    color: rgba(255, 255, 255, 0.95);
    font-style: italic;
    margin-bottom: 40px;
    animation: fadeInUp 1s ease 0.2s both;
}

.hero-info {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    animation: fadeInUp 1s ease 0.4s both;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 12px 24px;
    border-radius: 30px;
    backdrop-filter: blur(5px);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 60px;
    flex-wrap: wrap;
    animation: fadeInUp 1s ease 0.6s both;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 36px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 35px rgba(245, 87, 108, 0.4);
}

.btn-secondary {
    background: white;
    color: var(--primary-color);
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 35px rgba(255, 255, 255, 0.3);
}

.video-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 40px;
    animation: fadeInUp 1s ease 0.8s both;
}

.video-container h3 {
    color: white;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.video-container iframe {
    width: 100%;
    max-width: 800px;
    height: 450px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.motto {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    color: white;
    font-size: 1.3rem;
    font-style: italic;
    animation: fadeInUp 1s ease 1s both;
}

.motto i {
    font-size: 2rem;
    opacity: 0.5;
}

.motto-text p {
    margin: 10px 0;
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 2rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

/* ==================== 區塊標題 ==================== */
.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 3rem;
    color: var(--text-dark);
    margin-bottom: 20px;
    display: inline-flex;
    align-items: center;
    gap: 15px;
}

.header-line {
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    margin: 0 auto;
    border-radius: 2px;
}

/* ==================== 關於區塊 ==================== */
.about-section {
    padding: 100px 20px;
    background: var(--bg-light);
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.about-card {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    text-align: center;
}

.about-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.card-icon {
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.about-card h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.about-card p {
    color: #4a5568;
    line-height: 1.8;
}

.old-site-cta {
    text-align: center;
    padding: 40px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 20px;
}

.btn-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-gradient:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 35px rgba(102, 126, 234, 0.4);
}

.note {
    margin-top: 15px;
    color: #718096;
    font-size: 0.95rem;
}

/* ==================== 時間軸 ==================== */
.timeline-section {
    padding: 100px 20px;
    background: white;
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-color), var(--accent-color));
}

.timeline-item {
    display: flex;
    align-items: center;
    margin-bottom: 60px;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    box-shadow: 0 0 0 4px white, 0 0 0 8px var(--primary-color);
    z-index: 1;
}

.timeline-date {
    flex: 1;
    text-align: right;
    padding-right: 40px;
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.timeline-content {
    flex: 1;
    padding-left: 40px;
    background: var(--card-bg);
    padding: 25px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.timeline-content h3 {
    color: var(--text-dark);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.timeline-content p {
    color: #4a5568;
}

.timeline-item.final::before {
    background: var(--accent-2);
    box-shadow: 0 0 0 4px white, 0 0 0 8px var(--accent-2);
}

/* ==================== 畫廊 ==================== */
.gallery-section {
    padding: 100px 20px;
    background: var(--bg-light);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.gallery-card {
    background: var(--card-bg);
    padding: 40px 30px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: all 0.3s ease;
}

.gallery-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow-hover);
}

.gallery-icon {
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: 20px;
}

.gallery-card h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.gallery-card p {
    color: #718096;
    margin-bottom: 20px;
}

.gallery-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

.gallery-link:hover {
    color: var(--accent-2);
}

/* ==================== 傳承理念 ==================== */
.legacy-section {
    padding: 100px 20px;
    background: white;
}

.legacy-content {
    max-width: 900px;
    margin: 0 auto;
}

.legacy-text {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 40px;
    text-align: center;
    font-size: 1.1rem;
    line-height: 2;
    color: #2d3748;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: scale(1.05);
}

.stat-number {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* ==================== 社群 ==================== */
.social-section {
    padding: 80px 20px;
    background: var(--bg-light);
    text-align: center;
}

.social-section h3 {
    font-size: 2rem;
    margin-bottom: 30px;
    color: var(--text-dark);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.social-link {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 50%;
    font-size: 1.8rem;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.social-link:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: var(--shadow-hover);
}

/* ==================== 頁尾 ==================== */
.footer {
    background: var(--bg-dark);
    color: var(--text-light);
    padding: 60px 20px 30px;
    text-align: center;
}

.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 20px;
}

.footer-logo i {
    color: var(--accent-color);
}

.footer-text {
    font-size: 1.1rem;
    line-height: 2;
    margin-bottom: 20px;
    opacity: 0.9;
}

.footer-links {
    margin: 20px 0;
}

.footer-links a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: white;
}

.footer-links span {
    margin: 0 15px;
    opacity: 0.5;
}

.copyright {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.7;
}

/* ==================== 返回頂部 ==================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 999;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

/* ==================== 響應式設計 ==================== */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.3rem;
    }
    
    .hero-info {
        flex-direction: column;
        gap: 15px;
    }
    
    .cta-buttons {
        flex-direction: column;
    }
    
    .video-container iframe {
        height: 250px;
    }
    
    .motto {
        flex-direction: column;
        gap: 15px;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .timeline::before {
        left: 20px;
    }
    
    .timeline-item {
        flex-direction: column;
        align-items: flex-start;
        padding-left: 60px;
    }
    
    .timeline-item::before {
        left: 20px;
    }
    
    .timeline-date {
        text-align: left;
        padding-right: 0;
        padding-bottom: 10px;
    }
    
    .timeline-content {
        padding-left: 0;
        width: 100%;
    }
}

/* ==================== 公開信 ==================== */
.letter-section {
    padding: 100px 20px;
    background: #f9fafb;
}

.letter-card {
    max-width: 900px;
    margin: 0 auto;
    background: #fffdf8;
    border-radius: 20px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.letter-card summary {
    list-style: none;
}

.letter-card summary::-webkit-details-marker {
    display: none;
}

.letter-toggle {
    width: 100%;
    justify-content: center;
    border-radius: 0;
    padding: 18px 24px;
}

.letter-content {
    padding: 35px 40px 45px;
    color: #2d3748;
    line-height: 2;
    font-size: 1.05rem;
    background: linear-gradient(180deg, #fffdf8 0%, #fff8ee 100%);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.letter-content p {
    margin-bottom: 18px;
}

.letter-sign {
    margin-top: 20px;
    text-align: right;
    font-weight: bold;
    color: #4a5568;
}

/* ==================== 音樂播放器 ==================== */
.player-section {
    padding: 100px 20px;
    background: #ffffff;
}

.player-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    background: var(--card-bg);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 30px;
    align-items: center;
}

.track-info h3 {
    font-size: 1.6rem;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.track-info p {
    color: #718096;
    margin-bottom: 20px;
}

.controls {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.play-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(245, 87, 108, 0.35);
    transition: transform 0.2s ease;
}

.play-btn:hover {
    transform: translateY(-2px);
}

.time {
    color: #4a5568;
    font-weight: 600;
}

.time .sep {
    opacity: 0.6;
    margin: 0 6px;
}

.progress {
    width: 100%;
    appearance: none;
    height: 8px;
    border-radius: 8px;
    background: #edf2f7;
    outline: none;
    cursor: pointer;
}

.progress::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
}

.lyrics-panel {
    background: linear-gradient(180deg, #f8fafc 0%, #fff7f2 100%);
    border-radius: 18px;
    padding: 20px;
    height: 260px;
    overflow: hidden;
    position: relative;
}

.lyrics {
    height: 100%;
    overflow-y: auto;
    padding-right: 10px;
    scroll-behavior: smooth;
}

.lyrics-line {
    padding: 6px 8px;
    border-radius: 8px;
    color: #718096;
    transition: all 0.2s ease;
    line-height: 1.8;
}

.lyrics-line.active {
    color: #2d3748;
    background: rgba(102, 126, 234, 0.12);
    font-weight: 700;
}

.player-note {
    margin-top: 14px;
    color: #718096;
    font-size: 0.95rem;
    text-align: center;
}

.player-status {
    margin-top: 10px;
    text-align: center;
    color: #4a5568;
    font-size: 0.95rem;
}

.player-status.error {
    color: #e53e3e;
    font-weight: 600;
}

/* ==================== 響應式 ==================== */
@media (max-width: 900px) {
    .player-card {
        grid-template-columns: 1fr;
    }
    .lyrics-panel {
        height: 220px;
    }
}
