/**
 * 影视在线 - 小米设计风格
 * 核心：简洁留白 + 橙色强调 + 圆角卡片 + flex布局
 */

/* ========== Reset ========== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; font-size: 14px; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.6; color: #333; background: #f5f5f5;
    min-height: 100%; display: flex; flex-direction: column;
}
a { color: #FF6700; text-decoration: none; }
a:hover { color: #e55d00; }
img { max-width: 100%; height: auto; vertical-align: middle; border: 0; }

/* main-wrap 撑开body，footer始终底部 */
.main-wrap { flex: 1 0 auto; width: 100%; }

/* ========== Container ========== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ========== Header ========== */
.header {
    background: #fff; border-bottom: 1px solid #f0f0f0;
    position: sticky; top: 0; z-index: 100;
}
.header-flex {
    display: flex; align-items: center; height: 56px;
}
.logo {
    display: flex; align-items: center; gap: 8px;
    font-size: 18px; font-weight: 700; color: #FF6700;
    white-space: nowrap; margin-right: 28px; flex-shrink: 0;
}
.logo-icon {
    width: 28px; height: 28px; background: #FF6700; border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-size: 12px;
}
.nav-main {
    display: flex; align-items: center; gap: 0; flex-shrink: 0;
}
.nav-main a {
    padding: 0 14px; height: 56px; display: flex; align-items: center;
    font-size: 14px; color: #666; transition: color .2s; white-space: nowrap;
}
.nav-main a:hover { color: #FF6700; }
.nav-main a.active { color: #FF6700; border-bottom: 2px solid #FF6700; }
.header-spacer { flex: 1; }
.header-right {
    display: flex; align-items: center; gap: 12px; flex-shrink: 0;
}
.search-box {
    display: flex; align-items: center; background: #f5f5f5;
    border-radius: 20px; padding: 0 4px 0 12px; height: 32px;
}
.search-box input {
    border: none; background: none; outline: none; font-size: 13px;
    width: 150px; height: 100%;
}
.search-box button {
    width: 28px; height: 28px; border-radius: 50%; border: none;
    background: #FF6700; color: #fff; cursor: pointer; font-size: 14px;
}
.user-area { display: flex; align-items: center; gap: 8px; }
.user-btn {
    padding: 4px 12px; font-size: 13px; color: #666; border-radius: 4px;
}
.user-btn:hover { color: #FF6700; }
.user-btn-primary {
    background: #FF6700; color: #fff !important;
}
.user-btn-primary:hover { background: #e55d00; color: #fff !important; }

/* ========== Footer ========== */
.footer {
    background: #fff; border-top: 1px solid #f0f0f0;
    padding: 32px 0 20px; margin-top: auto; flex-shrink: 0;
}
.footer-row {
    display: flex; justify-content: space-between; gap: 40px;
    padding-bottom: 20px; border-bottom: 1px solid #f0f0f0;
}
.footer-brand .logo { font-size: 16px; margin: 0; }
.footer-brand p { color: #999; font-size: 13px; margin-top: 4px; }
.footer-links h4 { font-size: 14px; margin-bottom: 8px; color: #333; }
.footer-links a { display: block; font-size: 13px; color: #999; margin-bottom: 4px; }
.footer-links a:hover { color: #FF6700; }
.footer-copy { text-align: center; color: #ccc; font-size: 12px; margin-top: 16px; }

/* ========== Banner ========== */
.banner { position: relative; border-radius: 8px; overflow: hidden; margin-bottom: 24px; }
.banner-slide { display: block; }
.banner-slide img { width: 100%; height: 360px; object-fit: cover; }
.banner-content { position: absolute; bottom: 0; left: 0; right: 0; padding: 24px; background: linear-gradient(transparent, rgba(0,0,0,.7)); color: #fff; }
.banner-content h2 { font-size: 24px; margin-bottom: 4px; }

/* ========== Section ========== */
.section { margin-bottom: 28px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.section-title { font-size: 20px; font-weight: 600; color: #333; }
.section-more { font-size: 13px; color: #999; }
.section-more:hover { color: #FF6700; }

/* ========== Video Card ========== */
.video-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.video-card {
    display: flex; flex-direction: column; background: #fff; border-radius: 8px; overflow: hidden;
    transition: box-shadow .2s, transform .2s;
}
.video-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); transform: translateY(-2px); }
.video-thumb { position: relative; aspect-ratio: 16/9; overflow: hidden; background: #eee; }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.badge-vip {
    position: absolute; top: 6px; right: 6px; background: #FF6700;
    color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 3px;
}
.video-info { padding: 10px 12px; }
.video-title { font-size: 14px; color: #333; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video-subtitle { font-size: 12px; color: #FF6700; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.video-meta { font-size: 12px; color: #999; margin-top: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.video-duration { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: #999; background: #f5f5f5; padding: 1px 6px; border-radius: 3px; }
.video-duration::before { content: ''; display: inline-block; width: 10px; height: 10px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23999'%3E%3Cpath d='M8 0a8 8 0 110 16A8 8 0 018 0zm0 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM8 4a.75.75 0 01.75.75v3.5l2.35 1.41a.75.75 0 01-.77 1.29l-2.74-1.64A.75.75 0 017.25 9V4.75A.75.75 0 018 4z'/%3E%3C/svg%3E") no-repeat center/contain; }
.video-free-tag { font-size: 11px; color: #52c41a; }

/* ========== Breadcrumb ========== */
.breadcrumb { padding: 10px 0; font-size: 12px; color: #999; }
.breadcrumb a { color: #999; text-decoration: none; }
.breadcrumb a:hover { color: #FF6700; }
.breadcrumb span { margin: 0 6px; color: #ccc; }
.breadcrumb .current { color: #333; }

/* ========== Side Ad (对联广告) ========== */
.side-ad { position: fixed; right: 0; top: 50%; transform: translateY(-50%); z-index: 90; display: flex; flex-direction: column; gap: 2px; }
.side-ad-item { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 56px; padding: 10px 4px; color: #fff; font-size: 11px; text-decoration: none; text-align: center; line-height: 1.3; cursor: pointer; transition: opacity .2s; border-radius: 6px 0 0 6px; }
.side-ad-item:hover { opacity: .85; color: #fff; }
@media (max-width: 992px) { .side-ad { display: none; } }

/* ========== Favorite Button ========== */
.fav-btn { padding: 6px 14px; border-radius: 16px; border: 1px solid #e0e0e0; background: #fff; font-size: 13px; cursor: pointer; color: #666; transition: all .15s; }
.fav-btn:hover { border-color: #FF6700; color: #FF6700; }
.fav-btn.faved { background: #fff8f0; border-color: #FF6700; color: #FF6700; }

/* ========== Cinema Mode ========== */
.cinema-toggle { cursor: pointer; display: inline-flex; align-items: center; gap: 4px; background: #FF6700; color: #fff; padding: 5px 12px; border-radius: 4px; font-size: 12px; transition: background .2s; border: none; }
.cinema-toggle:hover { background: #e55d00; }
.cinema-toggle .tri { width: 0; height: 0; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 7px solid #fff; }

/* ========== Play Page ========== */
.play-layout { display: flex; gap: 16px; align-items: flex-start; }
.play-sidebar {
    width: 390px; flex-shrink: 0; background: #fff; border-radius: 0;
    padding: 14px; max-height: calc(100vh - 80px); overflow-y: auto;
    position: sticky; top: 72px; order: -1;
}
.play-sidebar h3 { font-size: 15px; margin-bottom: 12px; color: #333; }
.cat-parent { margin-bottom: 2px; }
.cat-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 10px; cursor: pointer; border-radius: 4px;
    font-size: 14px; color: #333; transition: background .15s;
}
.cat-header:hover { background: #f5f5f5; }
.cat-header.active { color: #FF6700; background: #fff8f0; }
.cat-header span:first-child { flex:1; overflow-wrap:break-word; word-break:break-all; white-space:normal; line-height:1.4 }
.cat-arrow { transition: transform .2s; font-size: 12px; color: #ccc; flex-shrink:0; margin-left:6px }
.cat-arrow.open { transform: rotate(90deg); color: #FF6700; }
.cat-children { display: none; padding-left: 16px; }
.cat-children.open { display: block; }
.cat-child {
    padding: 6px 10px; font-size: 13px; color: #666; cursor: pointer;
    border-radius: 4px; transition: background .15s;
    overflow-wrap:break-word; word-break:break-all; white-space:normal; line-height:1.4;
}
.cat-child:hover { background: #f5f5f5; }
.cat-child.active { color: #FF6700; background: #fff8f0; }
/* 二级目录标题醒目样式 */
.cat-child-title{display:flex;align-items:center;gap:6px;padding:10px 12px;font-size:15px;font-weight:700;color:#FF6700;background:linear-gradient(135deg,#fff8f0,#fff5eb);border-left:4px solid #FF6700;border-radius:0 6px 6px 0;margin:8px 0 4px 0;position:relative}
.cat-child-title .sub-icon{font-size:16px;flex-shrink:0}
.cat-child-title .sub-name{flex:1;overflow-wrap:break-word;word-break:break-all;white-space:normal;line-height:1.4}
.cat-child-title .sub-count{font-size:11px;color:#ff8533;background:#fff;padding:2px 8px;border-radius:10px;font-weight:500;flex-shrink:0}
/* 二级目录视频列表容器 */
.sub-videos{padding:4px 0 4px 8px;border-left:2px solid #ffe0b2;margin:0 0 6px 12px}
.sub-videos .sidebar-video-item{font-size:12px}
.sub-videos .sidebar-video-item.current{font-weight:700;border-left:3px solid #FF6700;background:#fff5eb;padding:4px 8px 4px 10px;border-radius:4px;margin:2px 0}
/* 画质按钮禁用态 */
.yt-q-disabled{opacity:.4;cursor:not-allowed!important}
.yt-q-disabled:hover{background:transparent!important;color:#999!important}
/* 懒加载提示 */
.lazy-hint{font-size:10px;color:#bbb;margin-left:4px;transition:color .2s}
.lazy-cat:hover .lazy-hint{color:#FF6700}
.lazy-cat.loaded .lazy-hint{display:none}
.lazy-loading{font-size:11px;color:#999;padding:4px 10px}
.lazy-error{font-size:11px;color:#ff4d4f;padding:4px 10px}
/* 试听标签 */
.tag-free{display:inline-block;background:#ff4d4f;color:#fff;font-size:9px;padding:1px 5px;border-radius:3px;margin-left:4px;vertical-align:middle;line-height:1.4;font-weight:500}
.play-main { flex: 1; min-width: 0; }
.video-player-wrap {
    background: #000; border-radius: 0; overflow: hidden;
    aspect-ratio: 16/9; position: relative;
}
.video-player-wrap video { width: 100%; height: 100%; }
/* 画质切换提示 */
#qualityTip{position:absolute;top:10px;right:10px;background:rgba(0,0,0,.7);color:#fff;font-size:11px;padding:3px 8px;border-radius:3px;z-index:10;pointer-events:none;transition:opacity .3s}
.no-access {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; height: 100%; color: #fff; text-align: center;
}
.no-access h2 { font-size: 22px; margin-bottom: 8px; }
.no-access p { color: #ccc; margin-bottom: 16px; }
.video-title-bar { padding: 12px 0; }
.video-title-bar h1 { font-size: 20px; font-weight: 600; }
.video-meta-bar { display: flex; gap: 16px; color: #999; font-size: 13px; margin-top: 6px; }
.video-desc-section { padding: 12px 0; }
.video-desc-section h3 { font-size: 15px; margin-bottom: 8px; }
.video-desc-section p { font-size: 14px; color: #666; line-height: 1.8; }

/* YouTube风格分辨率栏 */
.quality-bar {
    display: flex; align-items: center; gap: 6px; padding: 8px 0;
    border-top: 1px solid #f0f0f0; flex-wrap: wrap;
}
.yt-q-btn {
    padding: 4px 12px; border-radius: 12px; border: none;
    background: #f0f0f0; color: #666; font-size: 12px; cursor: pointer;
    transition: all .15s;
}
.yt-q-btn:hover { background: #e0e0e0; }
.yt-q-btn.active { background: #fff; color: #333; box-shadow: 0 1px 3px rgba(0,0,0,.2); }

/* 播放页操作栏 */
.action-bar { display: flex; gap: 8px; padding: 10px 0; flex-wrap: wrap; border-top: 1px solid #f0f0f0; }
.act-btn {
    padding: 6px 14px; border-radius: 16px; border: 1px solid #e0e0e0;
    background: #fff; font-size: 13px; cursor: pointer; color: #666;
    transition: all .15s;
}
.act-btn:hover { border-color: #FF6700; color: #FF6700; }
.act-btn.liked, .act-btn.faved { background: #fff8f0; border-color: #FF6700; color: #FF6700; }

/* ========== VIP Page ========== */
.vip-hero {
    background: linear-gradient(135deg, #FF6700, #FF8A00); padding: 48px 0; text-align: center; color: #fff;
}
.vip-hero h1 { font-size: 32px; margin-bottom: 8px; }
.vip-hero p { font-size: 16px; opacity: .9; }
.vip-stats { display: flex; justify-content: center; gap: 40px; margin-top: 24px; }
.vip-stat-item { text-align: center; }
.vip-stat-item .num { font-size: 28px; font-weight: 700; }
.vip-stat-item .label { font-size: 13px; opacity: .8; }
.vip-pkg-section { padding: 40px 0; }
.vip-pkg-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; }
.vip-pkg {
    background: #fff; border-radius: 12px; padding: 28px 20px; text-align: center;
    border: 2px solid #eee; position: relative; transition: all .3s;
}
.vip-pkg:hover { border-color: #FF6700; transform: translateY(-4px); box-shadow: 0 8px 24px rgba(255,103,0,.15); }
.vip-pkg.recommended { border-color: #FF6700; }
.vip-pkg-badge {
    position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
    background: #FF6700; color: #fff; padding: 2px 14px; border-radius: 10px; font-size: 12px;
}
.vip-pkg h3 { font-size: 18px; margin-bottom: 8px; }
.vip-pkg .price { font-size: 36px; font-weight: 700; color: #FF6700; }
.vip-pkg .price small { font-size: 16px; }
.vip-pkg .original { font-size: 14px; color: #ccc; text-decoration: line-through; }
.vip-pkg .daily { font-size: 12px; color: #999; margin: 4px 0 12px; }
.vip-pkg-btn {
    display: inline-block; padding: 8px 28px; background: #FF6700; color: #fff;
    border-radius: 20px; font-size: 14px; margin-top: 8px;
}
.vip-pkg-btn:hover { background: #e55d00; }
.vip-priv-section { padding: 40px 0; background: #fff; }
.vip-priv-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; }
.vip-priv { text-align: center; padding: 20px; }
.vip-priv-icon { font-size: 32px; margin-bottom: 8px; }
.vip-priv h4 { font-size: 15px; margin-bottom: 4px; }
.vip-priv p { font-size: 13px; color: #999; }
.vip-faq { padding: 40px 0; }
.vip-faq-item { margin-bottom: 8px; }
.vip-faq-q {
    padding: 12px 16px; background: #fff; border-radius: 6px; cursor: pointer;
    font-size: 14px; font-weight: 500; transition: background .15s;
}
.vip-faq-q:hover { background: #fafafa; }
.vip-faq-q.open { border-radius: 6px 6px 0 0; }
.vip-faq-a { display: none; padding: 12px 16px; background: #fafafa; border-radius: 0 0 6px 6px; font-size: 13px; color: #666; }
.vip-faq-a.open { display: block; }

/* ========== User Center ========== */
.user-card { background: #fff; border-radius: 8px; padding: 20px; margin-bottom: 16px; }
.user-tabs { display: flex; gap: 0; background: #fff; border-radius: 8px; margin-bottom: 16px; overflow: hidden; }
.user-tab {
    flex: 1; text-align: center; padding: 12px; font-size: 14px; cursor: pointer;
    color: #666; border-bottom: 2px solid transparent; transition: all .15s;
}
.user-tab:hover { color: #FF6700; background: #fafafa; }
.user-tab.active { color: #FF6700; border-bottom-color: #FF6700; background: #fff8f0; }
.course-item {
    display: flex; align-items: center; gap: 16px; padding: 16px;
    border-bottom: 1px solid #f0f0f0;
}
.course-item:last-child { border-bottom: none; }
.course-info { flex: 1; }
.course-info h4 { font-size: 15px; margin-bottom: 4px; }
.course-info p { font-size: 12px; color: #999; }
.progress-bar { height: 6px; background: #f0f0f0; border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: #FF6700; border-radius: 3px; transition: width .3s; }

/* ========== Category Nav ========== */
.cat-nav {
    display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px;
    background: #fff; padding: 12px 16px; border-radius: 8px;
}
.cat-nav a {
    padding: 6px 16px; border-radius: 16px; font-size: 13px;
    color: #666; background: #f5f5f5; transition: all .2s;
}
.cat-nav a:hover, .cat-nav a.active { background: #FF6700; color: #fff; }

/* ========== Empty State ========== */
.empty-state { text-align: center; padding: 60px 20px; color: #999; font-size: 16px; }

/* ========== Admin ========== */
.card { background: #fff; border-radius: 8px; padding: 20px; margin-bottom: 16px; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
.data-table th { background: #fafafa; font-weight: 600; }
.data-table tr:hover { background: #fafafa; }
.btn { padding: 6px 14px; border: none; border-radius: 4px; cursor: pointer; font-size: 13px; }
.btn-primary { background: #FF6700; color: #fff; }
.btn-primary:hover { background: #e55d00; }
.btn-sm { padding: 3px 10px; font-size: 12px; }
.btn-danger { background: #ff4d4f; color: #fff; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: #666; margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 8px 12px; border: 1px solid #e0e0e0;
    border-radius: 6px; font-size: 14px; outline: none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: #FF6700; }
.form-group textarea { resize: vertical; }
.alert-success { background: #e8f5e9; color: #2e7d32; padding: 10px; border-radius: 6px; margin-bottom: 16px; font-size: 13px; }
.alert-danger { background: #ffebee; color: #c62828; padding: 10px; border-radius: 6px; margin-bottom: 16px; font-size: 13px; }
.stats-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: 8px; padding: 20px; text-align: center; }
.stat-num { font-size: 28px; font-weight: 700; color: #FF6700; }
.stat-label { font-size: 13px; color: #999; margin-top: 4px; }
.upload-tips { background: #fff8f0; border: 1px solid #ffe0b2; border-radius: 6px; padding: 12px; margin-bottom: 16px; font-size: 12px; color: #666; }

/* ========== Responsive ========== */
@media (max-width: 992px) {
    .video-row { grid-template-columns: repeat(3, 1fr); }
    .play-layout { flex-direction: column; }
    .play-sidebar { width: 100%; max-height: 300px; position: static; border-radius: 8px; }
    .video-player-wrap { border-radius: 0; }
    .stats-grid { grid-template-columns: repeat(2,1fr); }
    .vip-pkg-grid { grid-template-columns: repeat(2,1fr); }
    .vip-priv-grid { grid-template-columns: repeat(2,1fr); }
    .cat-child-title { font-size: 14px; padding: 8px 10px; }
    .sub-videos { margin-left: 8px; }
}
@media (max-width: 768px) {
    .header-flex { flex-wrap: wrap; height: auto; padding: 8px 20px; }
    .nav-main { order: 3; width: 100%; overflow-x: auto; padding: 8px 0; -webkit-overflow-scrolling: touch; }
    .header-spacer { display: none; }
    .header-right { margin-left: auto; }
    .search-box input { width: 120px; }
    .video-row { grid-template-columns: repeat(2, 1fr); }
    .banner-slide img { height: 200px; }
    .section-title { font-size: 17px; }
    .vip-pkg-grid { grid-template-columns: 1fr; }
    .vip-priv-grid { grid-template-columns: repeat(2,1fr); }
    .footer-row { flex-direction: column; gap: 20px; }
    .quality-bar { flex-wrap: wrap; }
    .yt-q-btn { font-size: 11px; padding: 3px 6px; }
    #qualityTip { font-size: 10px; padding: 2px 6px; top: 6px; right: 6px; }
}
@media (max-width: 480px) {
    .video-row { grid-template-columns: repeat(2, 1fr); }
    .video-title { font-size: 13px; }
    .search-box input { width: 100px; }
}
