/* ==================== 基础与变量 ==================== */
:root {
    --slate-900: #0f172a;
    --slate-800: #1e293b;
    --slate-700: #334155;
    --slate-600: #475569;
    --amber-400: #fbbf24;
    --amber-500: #f59e0b;
    --amber-600: #d97706;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --red-500: #ef4444;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: system-ui, -apple-system, sans-serif;
    background: linear-gradient(to bottom, var(--slate-900), var(--slate-800), var(--slate-900));
    color: var(--gray-300);
    min-height: 100vh;
    line-height: 1.5;
}
a { text-decoration: none; color: inherit; transition: 0.3s; }
button, input, select { outline: none; border: none; font-family: inherit; }
button { cursor: pointer; }

/* ==================== 布局工具 ==================== */
.container { max-width: 1280px; margin: 0 auto; padding: 0 1rem; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; } .justify-center { justify-content: center; }
.flex-col { flex-direction: column; } .flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 0.5rem; } .gap-3 { gap: 0.75rem; } .gap-4 { gap: 1rem; } .gap-6 { gap: 1.5rem; } .gap-8 { gap: 2rem; }
.w-full { width: 100%; } .h-full { height: 100%; }
.text-center { text-align: center; }
.relative { position: relative; } .absolute { position: absolute; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 响应式网格 */
.grid { display: grid; gap: 1rem; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 768px) {
    .md-grid-3 { grid-template-columns: repeat(3, 1fr); }
    .md-grid-4 { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1024px) {
    .lg-grid-3 { grid-template-columns: repeat(3, 1fr); }
    .lg-grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ==================== 导航栏 ==================== */
.header { position: sticky; top: 0; z-index: 50; background: linear-gradient(to right, var(--slate-900), var(--slate-800), var(--slate-900)); border-bottom: 1px solid var(--slate-700); box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 4rem; }
.logo { font-size: 1.5rem; font-weight: bold; color: white; display: flex; align-items: center; }
.logo span.ext { color: var(--amber-400); margin-left: 2px; }
.nav-links { display: none; gap: 1.5rem; }
.nav-links a { font-weight: 500; color: var(--gray-300); }
.nav-links a:hover { color: var(--amber-400); }
@media (min-width: 768px) { .nav-links { display: flex; } }

.search-bar { position: relative; display: none; }
@media (min-width: 768px) { .search-bar { display: block; } }
.search-bar input { width: 16rem; padding: 0.5rem 1rem; border-radius: 9999px; background: var(--slate-700); border: 1px solid var(--slate-600); color: white; transition: 0.3s; }
.search-bar input:focus { border-color: var(--amber-400); box-shadow: 0 0 0 1px var(--amber-400); }
.search-bar button { position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%); background: none; color: var(--gray-400); }

.auth-buttons { display: none; gap: 0.5rem; align-items: center; }
@media (min-width: 768px) { .auth-buttons { display: flex; } }
.btn-login { padding: 0.5rem 1rem; font-weight: 500; color: var(--gray-300); }
.btn-login:hover { color: var(--amber-400); }
.btn-register { padding: 0.5rem 1rem; font-weight: 500; background: var(--amber-500); color: white; border-radius: 9999px; }
.btn-register:hover { background: var(--amber-600); }

/* ==================== 视频卡片 (通用) ==================== */
.video-card { display: block; background: var(--slate-800); border-radius: 0.5rem; overflow: hidden; border: 1px solid transparent; transition: 0.3s; }
.video-card:hover { border-color: var(--amber-400); transform: scale(1.02); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.3); }
.video-thumb { position: relative; aspect-ratio: 16/9; background: var(--slate-700); overflow: hidden; }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; transition: 0.3s; }
.video-card:hover .video-thumb img { transform: scale(1.1); }
.video-badge-hd { position: absolute; top: 0.5rem; left: 0.5rem; background: var(--amber-500); color: white; font-size: 0.75rem; font-weight: bold; padding: 0.1rem 0.5rem; border-radius: 0.25rem; }
.video-badge-dur { position: absolute; top: 0.5rem; right: 0.5rem; background: rgba(0,0,0,0.75); color: white; font-size: 0.75rem; padding: 0.1rem 0.5rem; border-radius: 0.25rem; }
.video-info { padding: 1rem; }
.video-title { color: white; font-weight: 500; font-size: 0.875rem; margin-bottom: 0.5rem; transition: 0.2s; }
.video-card:hover .video-title { color: var(--amber-400); }
.video-meta { display: flex; justify-content: space-between; align-items: center; font-size: 0.75rem; color: var(--gray-400); margin-bottom: 0.5rem; }
.video-meta-stats { display: flex; gap: 0.75rem; }
.video-meta-stats span { display: flex; align-items: center; gap: 0.25rem; }
.video-rating { background: var(--slate-700); color: var(--amber-400); padding: 0.1rem 0.4rem; border-radius: 0.25rem; }
.video-footer { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--gray-500); }

/* ==================== 首页独有样式 ==================== */
.hero { position: relative; height: 24rem; background: linear-gradient(to right, #78350f, #9a3412, #7f1d1d); overflow: hidden; display: flex; align-items: center; justify-content: center; text-align: center; }
.hero-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.4); }
.hero-content { position: relative; z-index: 10; padding: 0 1rem; }
.hero-title { font-size: 2.5rem; font-weight: bold; color: white; margin-bottom: 1rem; }
@media (min-width: 768px) { .hero-title { font-size: 3.75rem; } }
.hero-desc { font-size: 1.125rem; color: var(--gray-200); margin-bottom: 2rem; }
.hero-buttons { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.btn-hero-primary { background: var(--amber-500); color: white; font-weight: bold; padding: 0.75rem 2rem; border-radius: 9999px; transition: 0.3s; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.btn-hero-primary:hover { background: var(--amber-600); transform: scale(1.05); }
.btn-hero-secondary { background: var(--slate-700); color: white; font-weight: bold; padding: 0.75rem 2rem; border-radius: 9999px; transition: 0.3s; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.btn-hero-secondary:hover { background: var(--slate-600); transform: scale(1.05); }

.section-title { font-size: 1.5rem; font-weight: bold; color: white; display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1.5rem; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.view-more { color: var(--amber-400); font-size: 0.875rem; }
.view-more:hover { color: #fcd34d; }

.sidebar-box { background: var(--slate-800); border-radius: 0.5rem; padding: 1.5rem; border: 1px solid var(--slate-700); margin-bottom: 1.5rem; }
.rank-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem; border-radius: 0.25rem; transition: 0.2s; }
.rank-item:hover { background: var(--slate-700); }
.rank-num { width: 1.5rem; height: 1.5rem; display: flex; align-items: center; justify-content: center; border-radius: 0.25rem; font-size: 0.875rem; font-weight: bold; }
.rank-num.top { background: linear-gradient(to bottom right, var(--amber-400), #f97316); color: white; }
.rank-num.normal { background: var(--slate-700); color: var(--gray-400); }
.rank-title { flex: 1; font-size: 0.875rem; color: var(--gray-300); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-item:hover .rank-title { color: var(--amber-400); }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag-cloud a { font-size: 0.75rem; padding: 0.25rem 0.75rem; background: var(--slate-700); color: var(--gray-300); border-radius: 9999px; transition: 0.3s; }
.tag-cloud a:hover { background: var(--amber-400); color: black; transform: scale(1.05); }

/* ==================== 列表页独有样式 ==================== */
.page-banner { background: linear-gradient(to right, var(--slate-800), var(--slate-900)); padding: 3rem 0; border-bottom: 1px solid var(--slate-700); }
.filter-box { background: var(--slate-800); border-radius: 0.5rem; padding: 1.5rem; border: 1px solid var(--slate-700); margin-bottom: 2rem; }
.filter-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.filter-tag { padding: 0.5rem 1rem; border-radius: 9999px; font-size: 0.875rem; font-weight: 500; transition: 0.2s; }
.filter-tag.active { background: var(--amber-500); color: white; }
.filter-tag:not(.active) { background: var(--slate-700); color: var(--gray-300); }
.filter-tag:not(.active):hover { background: var(--slate-600); }
.control-bar { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1.5rem; }
@media (min-width: 640px) { .control-bar { flex-direction: row; justify-content: space-between; align-items: center; } }
.sort-select { background: var(--slate-700); color: white; border: 1px solid var(--slate-600); padding: 0.5rem 1rem; border-radius: 0.5rem; font-size: 0.875rem; }
.sort-select:focus { border-color: var(--amber-400); }

/* ==================== 详情页独有样式 ==================== */
.detail-layout { display: grid; gap: 2rem; }
@media (min-width: 1024px) { .detail-layout { grid-template-columns: 2fr 1fr; } }
.player-box { background: var(--slate-800); border-radius: 0.5rem; overflow: hidden; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); margin-bottom: 1.5rem; }
.video-container { aspect-ratio: 16/9; background: #000; }
.video-container video { width: 100%; height: 100%; outline: none; }

.info-box { background: var(--slate-800); border-radius: 0.5rem; padding: 1.5rem; border: 1px solid var(--slate-700); margin-bottom: 1.5rem; }
.info-title { font-size: 1.5rem; font-weight: bold; color: white; margin-bottom: 1rem; }
@media (min-width: 768px) { .info-title { font-size: 1.875rem; } }
.info-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; color: var(--gray-400); font-size: 0.875rem; margin-bottom: 1rem; }
.info-meta .badge { background: var(--amber-500); color: white; padding: 0.25rem 0.75rem; border-radius: 9999px; font-weight: bold; }
.info-actions { display: flex; gap: 0.75rem; margin-bottom: 1.5rem; }
.btn-action-primary { flex: 1; padding: 0.75rem 1.5rem; background: var(--amber-500); color: white; border-radius: 0.5rem; font-weight: 500; text-align: center; }
.btn-action-primary:hover { background: var(--amber-600); }
.btn-action-secondary { padding: 0.75rem 1.5rem; background: var(--slate-700); color: white; border-radius: 0.5rem; font-weight: 500; }
.btn-action-secondary:hover { background: var(--slate-600); }
.desc-text { color: var(--gray-400); font-size: 0.875rem; line-height: 1.6; margin-bottom: 1rem; }
.desc-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.desc-tag { background: var(--slate-700); color: var(--amber-400); padding: 0.25rem 0.75rem; border-radius: 9999px; font-size: 0.875rem; }
.desc-tag:hover { background: var(--slate-600); }

.comment-item { display: flex; gap: 1rem; padding: 1rem; background: var(--slate-700); border-radius: 0.5rem; margin-bottom: 1rem; }
.comment-avatar { width: 2.5rem; height: 2.5rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-weight: bold; flex-shrink: 0; }
.comment-body { flex: 1; }
.comment-header { display: flex; justify-content: space-between; margin-bottom: 0.5rem; }
.comment-author { color: white; font-weight: 500; font-size: 0.875rem; }
.comment-date { color: var(--gray-500); font-size: 0.75rem; }
.comment-content { color: var(--gray-300); font-size: 0.875rem; margin-bottom: 0.5rem; }

.side-rec-item { display: flex; gap: 0.75rem; padding: 0.5rem; border-radius: 0.5rem; transition: 0.2s; margin-bottom: 0.5rem; }
.side-rec-item:hover { background: var(--slate-700); }
.side-thumb { width: 8rem; height: 5rem; background: var(--slate-700); border-radius: 0.25rem; position: relative; overflow: hidden; flex-shrink: 0; }
.side-thumb img { width: 100%; height: 100%; object-fit: cover; transition: 0.3s; }
.side-rec-item:hover .side-thumb img { transform: scale(1.1); }
.side-info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center;}
.side-title { color: white; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.25rem; transition: 0.2s; }
.side-rec-item:hover .side-title { color: var(--amber-400); }
.side-meta { font-size: 0.75rem; color: var(--gray-400); display: flex; align-items: center; gap: 0.5rem; }

/* ==================== 页脚 ==================== */
.footer { background: linear-gradient(to bottom, var(--slate-900), #000); border-top: 1px solid var(--slate-800); padding: 3rem 0 1.5rem; margin-top: 3rem; color: var(--gray-300); }
.footer-title { color: var(--amber-400); font-weight: bold; font-size: 1.125rem; margin-bottom: 1rem; }
.footer-text { font-size: 0.875rem; color: var(--gray-400); margin-bottom: 0.75rem; }
.footer-links { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-links a { font-size: 0.875rem; color: var(--gray-300); }
.footer-links a:hover { color: var(--amber-400); }
.footer-bottom { border-top: 1px solid var(--slate-800); margin-top: 2rem; padding-top: 1.5rem; text-align: center; font-size: 0.875rem; color: var(--gray-500); }
/* ==================== 手机端菜单 (纯 CSS 控制) ==================== */
.hidden-radio { display: none !important; }
.md-hidden { display: none; }

@media (max-width: 767px) {
    .md-hidden { display: flex; } /* 手机端显示汉堡按钮 */
}
@media (min-width: 768px) {
    .md-hidden { display: none !important; } /* 电脑端强制隐藏手机元素 */
}

/* 汉堡按钮样式 */
.mobile-toggle-btn { 
    color: var(--gray-300); 
    cursor: pointer; 
    font-size: 1.5rem; 
    align-items: center; 
    justify-content: center; 
    user-select: none;
}
.mobile-toggle-btn:hover { color: var(--amber-400); }
.icon-close { display: none; }

/* 选中状态：切换图标 */
#mobile-menu-toggle:checked ~ .container .mobile-toggle-btn .icon-menu { display: none; }
#mobile-menu-toggle:checked ~ .container .mobile-toggle-btn .icon-close { display: inline; }

/* 选中状态：展开菜单 */
.mobile-menu-wrapper { 
    display: none; 
    background: var(--slate-800); 
    border-top: 1px solid var(--slate-700); 
    width: 100%; 
    position: absolute; 
    top: 100%; 
    left: 0; 
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.5);
}
#mobile-menu-toggle:checked ~ .mobile-menu-wrapper { display: block; }

.mobile-link { 
    display: block; 
    padding: 0.85rem 0; 
    color: var(--gray-300); 
    font-weight: 500; 
    border-bottom: 1px solid var(--slate-700);
}
.mobile-link:last-child { border-bottom: none; }
.mobile-link:hover { color: var(--amber-400); }
.mobile-search-input {
    width: 100%; padding: 0.6rem 1rem; border-radius: 9999px; background: var(--slate-900); border: 1px solid var(--slate-600); color: white;
}