@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@300;400;500;700;900&display=swap');

:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --bg-gradient: linear-gradient(135deg, #f6f8fd 0%, #f1f5f9 100%);
    --text-main: #2d3748;
    --text-muted: #718096;
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.5);
    --shadow-soft: 0 10px 30px rgba(0,0,0,0.05);
    --shadow-hover: 0 15px 35px rgba(0,0,0,0.1);
    --radius-lg: 20px;
    --radius-md: 12px;
}

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

body {
    font-family: 'Noto Sans TC', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-main);
    line-height: 1.7;
    overflow-x: hidden;
}

/* Glassmorphism Utilities */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Header & Hero */
header {
    text-align: center;
    padding: 80px 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border-bottom-left-radius: 40px;
    border-bottom-right-radius: 40px;
    margin-bottom: 40px;
    box-shadow: 0 10px 20px rgba(118, 75, 162, 0.2);
}

header h1 { font-size: 3rem; font-weight: 900; margin-bottom: 10px; letter-spacing: 2px; }
header p { font-size: 1.2rem; opacity: 0.9; }

.meeting-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 25px;
    border-radius: 30px;
    margin-top: 20px;
    font-weight: 500;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.3);
}

/* Main Container */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px 80px; }
section { margin-bottom: 60px; }

.section-title {
    font-size: 2rem; font-weight: 700; margin-bottom: 30px;
    text-align: center; color: var(--secondary); position: relative;
}
.section-title::after {
    content: ''; display: block; width: 60px; height: 4px;
    background: var(--primary); margin: 10px auto 0; border-radius: 2px;
}

/* File Preview Cards */
.file-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.file-card { padding: 30px; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.file-card.clickable { cursor: pointer; }
.file-card.clickable:hover { transform: translateY(-8px); box-shadow: var(--shadow-hover); border-color: var(--primary); }
.file-card .icon { font-size: 3rem; margin-bottom: 20px; color: var(--primary); }
.file-card h3 { font-size: 1.5rem; margin-bottom: 15px; }
.file-card p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 20px; }
.view-btn { padding: 8px 20px; background: rgba(102, 126, 234, 0.1); color: var(--primary); border: 2px solid var(--primary); border-radius: 20px; font-weight: bold; transition: all 0.3s; pointer-events: none; }
.file-card:hover .view-btn { background: var(--primary); color: white; }

/* Flashcards */
.flashcards-container { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; }
.scene { width: 320px; height: 220px; perspective: 1000px; cursor: pointer; }
.card { width: 100%; height: 100%; position: relative; transition: transform 0.8s; transform-style: preserve-3d; }
.scene.is-flipped .card { transform: rotateY(180deg); }
.card-face { position: absolute; width: 100%; height: 100%; -webkit-backface-visibility: hidden; backface-visibility: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; text-align: center; border-radius: var(--radius-md); box-shadow: var(--shadow-soft); }
.card-face-front { background: white; color: var(--text-main); border-top: 5px solid var(--primary); }
.card-face-front h3 { font-size: 1.4rem; }
.card-face-back { background: var(--primary); color: white; transform: rotateY(180deg); border-top: 5px solid var(--secondary); justify-content: flex-start; padding-top: 30px; }
.answer-label { font-size: 0.85rem; background: rgba(255,255,255,0.2); padding: 4px 12px; border-radius: 12px; margin-bottom: 15px; font-weight: bold; letter-spacing: 1px; }
.card-face-back p { font-size: 1.1rem; font-weight: 500; }

/* Quiz */
.quiz-container { max-width: 700px; margin: 0 auto; padding: 40px; }
.question { font-size: 1.3rem; font-weight: 700; margin-bottom: 20px; }
.options { display: flex; flex-direction: column; gap: 15px; }
.option { padding: 15px 20px; background: rgba(255,255,255,0.8); border: 2px solid transparent; border-radius: var(--radius-md); cursor: pointer; transition: all 0.3s ease; font-weight: 500; }
.option:hover { background: white; border-color: var(--primary); }
.option.selected { background: var(--primary); color: white; border-color: var(--primary); }
.option.correct { background: #48bb78; color: white; border-color: #48bb78; }
.option.wrong { background: #f56565; color: white; border-color: #f56565; }
.quiz-controls { margin-top: 30px; display: flex; justify-content: space-between; align-items: center; }
button#next-btn { padding: 12px 25px; background: var(--secondary); color: white; border: none; border-radius: 30px; font-size: 1rem; font-weight: 700; cursor: pointer; transition: transform 0.2s, background 0.3s; font-family: inherit; }
button#next-btn:hover { transform: translateY(-2px); background: var(--primary); }
button#next-btn:disabled { background: #cbd5e0; cursor: not-allowed; transform: none; }

/* Meeting Summary in Modal */
.summary-container { padding: 10px; }
.summary-block { margin-bottom: 30px; }
.summary-block h3 { color: var(--primary); font-size: 1.5rem; margin-bottom: 15px; border-left: 4px solid var(--secondary); padding-left: 10px; }
.summary-item { margin-bottom: 15px; padding-left: 15px; line-height: 1.8; }
.summary-item strong { color: var(--secondary); font-size: 1.1rem; }

/* Comic Grid */
.comic-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px; max-width: 900px; margin: 0 auto; }
.comic-panel { position: relative; border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-soft); background: #fff; border: 4px solid #fff; display: flex; flex-direction: column; }
.comic-panel img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; transition: transform 0.5s ease; border-radius: calc(var(--radius-md) - 4px); }
.comic-panel:hover img { transform: scale(1.03); }
.panel-number { position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,0.7); color: white; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-weight: bold; z-index: 2; }
.comic-caption { padding: 15px; background: white; text-align: center; font-weight: bold; color: var(--secondary); font-size: 1.1rem; border-top: 1px solid #eee; z-index: 3; }

/* Modals */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(5px);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; opacity: 0; visibility: hidden; transition: all 0.3s ease;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-content {
    width: 90%; max-width: 600px; max-height: 85vh; background: rgba(255,255,255,0.95);
    border-radius: var(--radius-lg); padding: 40px; position: relative;
    transform: translateY(20px); transition: transform 0.3s ease;
    overflow-y: auto; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}
.modal-overlay.active .modal-content { transform: translateY(0); }
.close-btn {
    position: absolute; top: 20px; right: 20px; background: #eee;
    border: none; width: 36px; height: 36px; border-radius: 50%;
    font-size: 1.5rem; display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: background 0.2s; color: #555;
}
.close-btn:hover { background: #ddd; color: #000; }
.modal-title { font-size: 1.8rem; color: var(--primary); margin-bottom: 20px; border-bottom: 2px solid #eee; padding-bottom: 10px; }
.modal-body p { margin-bottom: 15px; font-size: 1.1rem; line-height: 1.8; }
.download-btn { display: inline-block; padding: 12px 25px; background: var(--primary); color: white; text-decoration: none; border-radius: 30px; font-weight: bold; transition: background 0.3s, transform 0.2s; box-shadow: var(--shadow-soft); }
.download-btn:hover { background: var(--secondary); transform: translateY(-2px); }

@media (max-width: 768px) {
    .comic-grid { grid-template-columns: 1fr; }
    header h1 { font-size: 2rem; }
}
