/* ============================================
   时光留夏 逐梦远航 - 毕业纪念播放页样式
   ============================================ */

/* ---------- 全局重置与基础 ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700;900&display=swap');

:root {
    --primary-orange: #FF8C42;
    --primary-yellow: #FFD166;
    --primary-pink: #F4A0C4;
    --primary-purple: #9B72CF;
    --gradient-warm: linear-gradient(135deg, #FFD166 0%, #FF8C42 50%, #F4A0C4 100%);
    --gradient-sky: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --text-dark: #2D2D2D;
    --text-light: #666;
    --text-white: #FFFFFF;
    --card-bg: rgba(255, 255, 255, 0.95);
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 8px 32px rgba(0, 0, 0, 0.15);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
}

html, body {
    width: 100%;
    min-height: 100vh;
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--gradient-warm);
    color: var(--text-dark);
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    /* 禁止选中和右键菜单 */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

body {
    position: relative;
}

/* ---------- 页面容器 ---------- */
.page {
    width: 100%;
    min-height: 100vh;
    position: relative;
}

/* ============================================
   封面页
   ============================================ */
.cover-page {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #FFE8D6 0%, #FFD6E0 30%, #E8D6FF 60%, #D6E8FF 100%);
    overflow: hidden;
    position: relative;
}

/* 背景装饰 */
.cover-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.floating-element {
    position: absolute;
    font-size: 2rem;
    opacity: 0.6;
    animation: floatAround 8s ease-in-out infinite;
}

.floating-element.paper-plane { top: 10%; left: 15%; font-size: 2.5rem; animation-delay: 0s; }
.floating-element.star:nth-child(2) { top: 20%; right: 20%; font-size: 1.8rem; animation-delay: 1s; }
.floating-element.star:nth-child(3) { bottom: 25%; left: 10%; font-size: 1.5rem; animation-delay: 2s; }
.floating-element.balloon:nth-child(4) { top: 15%; right: 10%; font-size: 2.8rem; animation-delay: 0.5s; }
.floating-element.balloon:nth-child(5) { bottom: 15%; right: 25%; font-size: 2.2rem; animation-delay: 1.5s; }
.floating-element.grad-hat { bottom: 30%; right: 15%; font-size: 2.5rem; animation-delay: 3s; }

@keyframes floatAround {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-20px) rotate(5deg); }
    50% { transform: translateY(-10px) rotate(-3deg); }
    75% { transform: translateY(-25px) rotate(4deg); }
}

/* 封面内容 */
.cover-content {
    text-align: center;
    padding: 40px 30px;
    z-index: 1;
    animation: fadeInUp 1.2s ease-out;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

.cover-badge {
    display: inline-block;
    background: var(--gradient-warm);
    color: white;
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 2px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(255, 140, 66, 0.3);
}

.cover-title {
    font-size: 3rem;
    font-weight: 900;
    background: var(--gradient-warm);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 6px;
    margin-bottom: 8px;
    text-shadow: none;
}

.cover-subtitle {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-purple);
    letter-spacing: 8px;
    margin-bottom: 16px;
}

.cover-school {
    font-size: 1rem;
    color: var(--text-light);
    font-weight: 500;
    margin-bottom: 4px;
}

.cover-class {
    font-size: 0.95rem;
    color: var(--text-light);
    font-weight: 400;
    margin-bottom: 20px;
}

.cover-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

.divider-star {
    color: var(--primary-orange);
    font-size: 1.2rem;
}

.divider-line {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-orange), transparent);
    border-radius: 1px;
}

.cover-quote {
    font-size: 1rem;
    color: var(--text-light);
    font-style: italic;
    font-weight: 300;
    margin-bottom: 30px;
    line-height: 1.6;
}

/* 进入按钮 */
.enter-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--gradient-warm);
    color: white;
    border: none;
    padding: 14px 36px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 25px rgba(255, 140, 66, 0.4);
    font-family: inherit;
    letter-spacing: 2px;
}

.enter-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 35px rgba(255, 140, 66, 0.5);
}

.enter-btn:active {
    transform: translateY(0) scale(0.98);
}

.btn-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.enter-btn:hover .btn-icon {
    transform: translateX(4px);
}

.cover-footer {
    margin-top: 30px;
    font-size: 0.8rem;
    color: #aaa;
    letter-spacing: 1px;
}

/* ============================================
   主播放页
   ============================================ */
.main-page {
    background: linear-gradient(180deg, #FFF5F0 0%, #FFF0F5 50%, #F5F0FF 100%);
    padding-bottom: 20px;
}

/* 顶部导航 */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.back-btn, .share-btn {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
    color: var(--text-dark);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-btn:active, .share-btn:active {
    background: rgba(0, 0, 0, 0.05);
}

.top-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    letter-spacing: 1px;
}

/* ============================================
   视频播放器（原生 HTML5）
   ============================================ */
.video-container {
    position: relative;
    width: 100%;
    background: #000;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    max-height: 50vh;
}

.video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #000;
}

/* 视频封面图 */
.video-poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 5;
    background: #000;
    transition: opacity 0.5s ease;
}

.video-poster.hidden {
    opacity: 0;
    pointer-events: none;
}

/* 视频覆盖层（中央播放按钮） */
.video-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.video-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.play-icon-big {
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary-orange);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.video-overlay:active .play-icon-big {
    transform: scale(0.9);
}

.overlay-text {
    color: white;
    font-size: 0.9rem;
    margin-top: 12px;
    font-weight: 500;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* 控制条 */
.controls-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    z-index: 20;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-container:hover .controls-bar,
.controls-bar.show {
    opacity: 1;
}

.ctrl-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.ctrl-btn:active {
    background: rgba(255, 255, 255, 0.2);
}

.progress-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-bar {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--primary-orange);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 6px rgba(255, 140, 66, 0.5);
}

.progress-bar::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--primary-orange);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.time-display {
    color: white;
    font-size: 0.75rem;
    font-weight: 400;
    white-space: nowrap;
    display: flex;
    gap: 4px;
    font-variant-numeric: tabular-nums;
}

.time-sep {
    opacity: 0.6;
}

/* ============================================
   信息区域
   ============================================ */
.info-section {
    padding: 20px 16px 30px;
}

.info-header {
    text-align: center;
    margin-bottom: 24px;
}

.info-title {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-warm);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 3px;
    margin-bottom: 6px;
}

.info-subtitle {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 400;
}

/* 寄语卡片 */
.message-card {
    display: flex;
    gap: 14px;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 18px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-soft);
    animation: fadeInUp 0.6s ease-out;
}

.message-card:nth-child(2) { animation-delay: 0.1s; }
.message-card:nth-child(3) { animation-delay: 0.2s; }

.message-icon {
    font-size: 2rem;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #FFF5F0, #FFF0F5);
    border-radius: 12px;
}

.teacher-message .message-icon {
    background: linear-gradient(135deg, #FFF5F0, #FFE8D6);
}

.student-message .message-icon {
    background: linear-gradient(135deg, #F0F5FF, #E8F0FF);
}

.message-content h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.message-content p {
    font-size: 0.88rem;
    color: var(--text-light);
    line-height: 1.7;
    font-weight: 400;
}

.message-sign {
    display: block;
    margin-top: 8px;
    font-size: 0.8rem;
    color: #999;
    font-style: italic;
}

/* 二维码区域 */
.qr-section {
    text-align: center;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 24px 18px;
    margin-top: 20px;
    box-shadow: var(--shadow-soft);
}

.qr-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
}

.qr-icon {
    font-size: 1.3rem;
}

.qrcode-container {
    display: inline-block;
    padding: 12px;
    background: white;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.qrcode-container img {
    display: block;
}

.qr-hint {
    margin-top: 12px;
    font-size: 0.78rem;
    color: #bbb;
}

/* 装饰元素 */
.deco-elements {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.deco-item {
    font-size: 1.5rem;
    animation: bounce 2s ease-in-out infinite;
    display: inline-block;
}

.deco-item:nth-child(2) { animation-delay: 0.2s; }
.deco-item:nth-child(3) { animation-delay: 0.4s; }
.deco-item:nth-child(4) { animation-delay: 0.6s; }
.deco-item:nth-child(5) { animation-delay: 0.8s; }
.deco-item:nth-child(6) { animation-delay: 1s; }

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* 底部 */
.bottom-bar {
    text-align: center;
    padding: 16px;
    font-size: 0.78rem;
    color: #ccc;
    letter-spacing: 2px;
}

/* ============================================
   弹窗
   ============================================ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: var(--radius-lg);
    padding: 32px 24px 24px;
    width: 85%;
    max-width: 320px;
    text-align: center;
    box-shadow: var(--shadow-medium);
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #999;
    padding: 4px 8px;
    border-radius: 4px;
}

.modal-close:active {
    background: rgba(0, 0, 0, 0.05);
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-dark);
}

.modal-qr {
    display: inline-block;
    padding: 12px;
    background: white;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 12px;
}

.modal-hint {
    font-size: 0.82rem;
    color: var(--text-light);
    margin-bottom: 16px;
}

.modal-btn {
    width: 100%;
    padding: 12px;
    background: var(--gradient-warm);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
    font-family: inherit;
}

.modal-btn:active {
    transform: scale(0.98);
}

/* ============================================
   飘落动画容器
   ============================================ */
.falling-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 999;
    overflow: hidden;
}

.falling-item {
    position: absolute;
    top: -30px;
    font-size: 1rem;
    animation: fall linear infinite;
    opacity: 0.4;
    will-change: transform;
}

@keyframes fall {
    0% {
        transform: translateY(-30px);
        opacity: 0.4;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

/* ============================================
   响应式适配
   ============================================ */

/* 小屏手机 */
@media screen and (max-width: 375px) {
    .cover-title { font-size: 2.4rem; }
    .cover-subtitle { font-size: 1.6rem; }
    .enter-btn { padding: 12px 28px; font-size: 1rem; }
    .info-title { font-size: 1.3rem; }
}

/* 大屏手机 */
@media screen and (min-width: 376px) and (max-width: 480px) {
    .cover-title { font-size: 2.8rem; }
    .cover-subtitle { font-size: 1.8rem; }
}

/* 平板及以上 */
@media screen and (min-width: 768px) {
    .cover-title { font-size: 4rem; }
    .cover-subtitle { font-size: 2.5rem; }
    .cover-content { padding: 60px 40px; }
    .info-section { padding: 30px 40px; max-width: 600px; margin: 0 auto; }
    .video-container { max-height: 60vh; }
}

/* 横屏模式 */
@media screen and (orientation: landscape) and (max-height: 500px) {
    .cover-content { padding: 20px; }
    .cover-title { font-size: 2rem; }
    .cover-subtitle { font-size: 1.4rem; }
    .cover-quote { margin-bottom: 16px; }
    .enter-btn { padding: 10px 24px; font-size: 0.9rem; }
    .video-container { max-height: 70vh; }
}

/* ---------- 工具类 ---------- */
.hidden {
    display: none !important;
}

/* ---------- 滚动条美化 ---------- */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 2px;
}
