/* ===== 全局样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #e53935;
    --primary-light: #ff6b6b;
    --primary-dark: #b71c1c;
    --bg-dark: #0a0a0f;
    --bg-card: #141420;
    --bg-card-hover: #1c1c2e;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0b8;
    --text-muted: #6b6b80;
    --border: #1e1e35;
    --success: #00b894;
    --warning: #fdcb6e;
    --danger: #e53935;
    --gradient: linear-gradient(135deg, #e53935 0%, #ff6b6b 100%);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    --card-bg: #12121e;
    --card-border: #2a2a45;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: inherit;
}

input, textarea, select {
    font-family: inherit;
    outline: none;
    border: none;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== 头部导航 ===== */
.header {
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo i {
    font-size: 28px;
    -webkit-text-fill-color: var(--primary);
}

.nav {
    display: flex;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 15px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.nav-link:hover, .nav-link.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(229, 57, 53, 0.4);
}

.admin-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    background: rgba(229, 57, 53, 0.15);
    color: var(--primary-light);
    font-size: 14px;
    transition: all 0.3s ease;
    border: 1px solid rgba(229, 57, 53, 0.3);
}

.admin-btn:hover {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 15px rgba(229, 57, 53, 0.4);
}

/* ===== 页面切换 ===== */
.page {
    display: none;
    padding: 30px 0;
    animation: fadeIn 0.4s ease;
}

.page.active {
    display: block;
}

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

/* ===== 时间显示 ===== */
.time-section {
    margin-bottom: 20px;
}

.time-display {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 25px;
    background: linear-gradient(135deg, rgba(229, 57, 53, 0.08) 0%, rgba(255, 107, 107, 0.03) 100%);
    border: 1px solid rgba(229, 57, 53, 0.2);
    border-radius: 12px;
    font-size: 15px;
    color: var(--text-secondary);
}

.time-display i {
    color: var(--primary);
    font-size: 18px;
}

#current-date, #current-time {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 16px;
}

#current-week {
    color: var(--primary-light);
    font-weight: 500;
}

/* ===== 公告滚动 ===== */
.announcement-bar {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 500px;
    overflow: hidden;
    flex: 1;
    margin-left: 30px;
}

.announcement-bar i {
    color: var(--warning);
    font-size: 16px;
    flex-shrink: 0;
    animation: bellRing 2s ease infinite;
}

@keyframes bellRing {
    0%, 50%, 100% { transform: rotate(0deg); }
    10% { transform: rotate(-15deg); }
    20% { transform: rotate(10deg); }
    30% { transform: rotate(-10deg); }
    40% { transform: rotate(5deg); }
}

.announcement-content {
    overflow: hidden;
    white-space: nowrap;
    flex: 1;
    position: relative;
    height: 24px;
}

.announcement-text {
    display: inline-block;
    padding-left: 100%;
    animation: scrollText 18s linear infinite;
    color: var(--warning);
    font-size: 14px;
    line-height: 24px;
    transition: opacity 0.5s;
}

.announcement-bar:hover .announcement-text {
    animation-play-state: paused;
}

@keyframes scrollText {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* ===== 搜索框 ===== */
.search-section {
    margin-bottom: 30px;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 50px;
    padding: 5px 5px 5px 20px;
    transition: all 0.3s ease;
    max-width: 700px;
    margin: 0 auto;
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(229, 57, 53, 0.3);
}

.search-box i {
    color: var(--text-muted);
    font-size: 18px;
}

.search-box input {
    flex: 1;
    background: none;
    color: var(--text-primary);
    font-size: 16px;
    padding: 12px 15px;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box button {
    padding: 12px 30px;
    border-radius: 50px;
    background: var(--gradient);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.search-box button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(229, 57, 53, 0.4);
}

/* ===== 区块标题 ===== */
.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.section-title i {
    color: var(--primary);
    font-size: 22px;
}

.section-title h2 {
    font-size: 22px;
    font-weight: 700;
}

.section-title h3 {
    font-size: 18px;
    font-weight: 600;
}

.more-link {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s;
}

.more-link:hover {
    color: var(--primary-light);
}

/* ===== 热搜标签 ===== */
.hot-search-section {
    margin-bottom: 35px;
}

.hot-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hot-tag {
    padding: 8px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 25px;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hot-tag:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(229, 57, 53, 0.3);
}

.hot-tag .tag-num {
    font-size: 12px;
    opacity: 0.7;
}

/* ===== 视频网格 - 一行8个 ===== */
.video-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 16px;
}

/* ===== 视频卡片 - 红色慢闪烁边框 ===== */
@keyframes redBorderPulse {
    0%, 100% {
        border-color: rgba(229, 57, 53, 0.25);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
    50% {
        border-color: rgba(229, 57, 53, 0.7);
        box-shadow: 0 2px 12px rgba(229, 57, 53, 0.15);
    }
}

.video-card {
    background: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
    border: 2px solid rgba(229, 57, 53, 0.25);
    animation: redBorderPulse 3s ease-in-out infinite;
}

.video-card:hover {
    transform: translateY(-6px);
    border-color: var(--primary) !important;
    box-shadow: 0 12px 30px rgba(229, 57, 53, 0.25);
    animation: none;
}

.video-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4;
    overflow: hidden;
    background: #1a1a2e;
}

.video-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    opacity: 0;
}

.video-cover img.loaded {
    opacity: 1;
}

.video-card:hover .video-cover img {
    transform: scale(1.08);
}

.video-cover::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #1a1a2e 25%, #252540 50%, #1a1a2e 75%);
    background-size: 200% 100%;
    animation: skeletonShine 1.5s infinite;
    z-index: 0;
}

@keyframes skeletonShine {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.video-cover .play-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.video-card:hover .play-overlay {
    opacity: 1;
}

.play-overlay i {
    font-size: 44px;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.video-cover .video-type {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    background: var(--primary);
    color: #fff;
    z-index: 3;
}

.video-cover .video-episode {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    z-index: 3;
}

.video-info {
    padding: 10px 12px;
    background: var(--card-bg);
}

.video-info h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
}

.video-info p {
    font-size: 12px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== 筛选栏 ===== */
.filter-bar {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    padding: 15px 20px;
    background: var(--bg-card);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    color: var(--text-secondary);
    font-size: 14px;
}

.filter-group select {
    padding: 8px 15px;
    border-radius: 6px;
    background: var(--bg-dark);
    color: var(--text-primary);
    border: 1px solid var(--border);
    font-size: 14px;
}

/* ===== 播放记录 ===== */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.history-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: var(--bg-card);
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid var(--border);
    position: relative;
}

.history-item:hover {
    border-color: var(--primary);
    background: var(--bg-card-hover);
    transform: translateX(4px);
}

.history-cover {
    width: 110px;
    height: 150px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.history-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.history-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.history-info h3 {
    font-size: 17px;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.history-info .episode-tag {
    display: inline-block;
    padding: 3px 10px;
    background: var(--primary);
    color: #fff;
    border-radius: 4px;
    font-size: 12px;
    margin-bottom: 6px;
    width: fit-content;
}

.history-info .watch-time {
    color: var(--text-muted);
    font-size: 12px;
}

.history-info .play-link {
    margin-top: 8px;
    color: var(--primary-light);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.history-delete {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(229, 57, 53, 0.15);
    color: var(--danger);
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    opacity: 0;
}

.history-item:hover .history-delete {
    opacity: 1;
}

.history-delete:hover {
    background: var(--danger);
    color: #fff;
}

.clear-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    border-radius: 8px;
    background: rgba(229, 57, 53, 0.15);
    color: var(--danger);
    font-size: 14px;
    transition: all 0.3s;
    border: 1px solid rgba(229, 57, 53, 0.3);
}

.clear-btn:hover {
    background: var(--danger);
    color: #fff;
}

/* ===== 留言板 ===== */
.message-form {
    background: var(--bg-card);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    border: 1px solid var(--border);
}

.form-group {
    margin-bottom: 15px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 18px;
    border-radius: 8px;
    background: var(--bg-dark);
    color: var(--text-primary);
    font-size: 15px;
    border: 1px solid var(--border);
    transition: border-color 0.3s;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary);
}

#submit-message {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 30px;
    border-radius: 8px;
    background: var(--gradient);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s;
}

#submit-message:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 15px rgba(229, 57, 53, 0.4);
}

.message-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message-item {
    padding: 20px;
    background: var(--bg-card);
    border-radius: 12px;
    border-left: 3px solid var(--primary);
}

.message-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
}

.message-name {
    font-weight: 600;
    font-size: 15px;
}

.message-time {
    color: var(--text-muted);
    font-size: 12px;
    margin-left: auto;
}

.message-body {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
}

.admin-reply {
    margin-top: 10px;
    padding: 10px 15px;
    background: rgba(230, 126, 51, 0.08);
    border-left: 3px solid #e67e22;
    border-radius: 4px;
}

/* ===== 播放页 ===== */
.player-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 14px;
    transition: all 0.3s;
    border: 1px solid var(--border);
}

.back-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.player-header h2 {
    font-size: 20px;
    font-weight: 700;
}

.player-wrapper {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    margin-bottom: 30px;
}

.iframe-player-wrap {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.iframe-player {
    width: 100%;
    height: 100%;
    border: 0;
}

.player-info-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    background: var(--bg-card);
    border-radius: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.player-info-bar span {
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.player-nav-btns {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

.player-nav-btns button {
    padding: 6px 14px;
    border-radius: 6px;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    transition: all 0.3s;
}

.player-nav-btns button:hover:not(:disabled) {
    background: var(--primary-dark);
}

.player-nav-btns button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.player-right {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.route-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.route-tab {
    padding: 6px 14px;
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid var(--border);
}

.route-tab:hover, .route-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.episodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 6px;
    max-height: 400px;
    overflow-y: auto;
}

.episode-btn {
    padding: 6px 8px;
    border-radius: 5px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid var(--border);
}

.episode-btn:hover, .episode-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ===== 评论 ===== */
.player-comments {
    margin-top: 20px;
}

.comment-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: flex-start;
}

.comment-form textarea {
    flex: 1;
    padding: 12px 18px;
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 14px;
    border: 1px solid var(--border);
    resize: vertical;
    min-height: 60px;
}

.comment-form button {
    padding: 10px 24px;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.comment-form button:hover {
    background: var(--primary-dark);
}

.comment-item {
    padding: 15px 20px;
    background: var(--bg-card);
    border-radius: 10px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.comment-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
}

.comment-name {
    font-weight: 600;
    font-size: 14px;
}

.comment-time {
    color: var(--text-muted);
    font-size: 12px;
    margin-left: auto;
}

.comment-body {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

/* ===== 搜索结果弹窗 ===== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 14px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    border: 1px solid var(--border);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 17px;
    font-weight: 700;
}

.close-btn {
    font-size: 26px;
    color: var(--text-muted);
    background: none;
    transition: color 0.3s;
}

.close-btn:hover {
    color: var(--danger);
}

.modal-body {
    padding: 25px;
    overflow-y: auto;
    max-height: 60vh;
}

.search-result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.search-result-item {
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s;
    border: 1px solid var(--border);
}

.search-result-item:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
}

.search-result-item img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    display: block;
}

.search-result-info {
    padding: 8px 10px;
    background: var(--bg-dark);
}

.search-result-info h4 {
    font-size: 13px;
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-info p {
    font-size: 11px;
    color: var(--text-muted);
}

/* ===== 加载/空状态 ===== */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 15px;
}

.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 15px;
}

/* ===== 网站底部信息 ===== */
.footer-info {
    margin-top: 40px;
    padding: 25px 0;
    border-top: 1px solid var(--border);
}

.runtime {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

.runtime i {
    color: var(--primary);
}

.copyright {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.8;
}

/* ===== 响应式 ===== */
@media (max-width: 1400px) {
    .video-grid { grid-template-columns: repeat(6, 1fr); }
}

@media (max-width: 1200px) {
    .video-grid { grid-template-columns: repeat(5, 1fr); }
    .player-wrapper { grid-template-columns: 1fr 280px; }
}

@media (max-width: 1024px) {
    .video-grid { grid-template-columns: repeat(4, 1fr); }
    .player-wrapper { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .video-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .header .container { flex-wrap: wrap; gap: 10px; }
    .nav { order: 3; width: 100%; justify-content: center; }
    .time-display { flex-wrap: wrap; }
    .announcement-bar { margin-left: 0; width: 100%; }
    .search-box { max-width: 100%; }
    .history-item { flex-direction: column; }
    .history-cover { width: 100%; height: 200px; }
    .comment-form { flex-direction: column; }
}
