/* =====================================================
   全局 Reset & 基础
   ===================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: #111;
    color: #eee;
}

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

a:hover {
    color: #f5c518;
}

/* =====================================================
   布局包裹层（替代 body 百分比 padding 的反模式）
   ===================================================== */
.navbar,
.content,
.footer {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding-left: 16px;
    padding-right: 16px;
}

/* =====================================================
   导航栏
   ===================================================== */
.navbar-wrap {
    background-color: #222;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 2px solid #f5c518;
}

.navbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 10px;
    padding-bottom: 10px;
}

.logo-link {
    display: flex;
    align-items: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.logo-img {
    height: 36px;
    width: auto;
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 2px;
}

.nav-item a {
    display: block;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 14px;
    color: #ccc;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.nav-item a:hover {
    background: #f5c518;
    color: #111;
}

/* 搜索框 */
.search-form {
    margin-left: auto;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.search-form input[type="text"] {
    padding: 6px 10px;
    border: none;
    border-radius: 3px 0 0 3px;
    width: 180px;
    font-size: 14px;
    background: #444;
    color: #eee;
    outline: none;
}

.search-form input[type="text"]::placeholder {
    color: #999;
}

.search-form button {
    padding: 6px 10px;
    border: none;
    border-radius: 0 3px 3px 0;
    background: #f5c518;
    color: #111;
    cursor: pointer;
    font-size: 16px;
}

/* =====================================================
   内容区域
   ===================================================== */
.content {
    padding-top: 20px;
    padding-bottom: 20px;
    min-height: 60vh;
}

/* =====================================================
   视频卡片网格
   ===================================================== */
.video-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.video-item {
    background: #1a1a1a;
    border-radius: 6px;
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s;
}

.video-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(245, 197, 24, 0.25);
}

.video-item a img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.video-item .no-thumb {
    width: 100%;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2a2a2a;
    color: #666;
    font-size: 12px;
}

.video-item p {
    margin: 0;
    padding: 6px 8px;
    font-size: 13px;
    line-height: 1.4;
    color: #bbb;
    /* 限制两行，超出省略 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-item p a:hover {
    color: #f5c518;
}

/* =====================================================
   单视频播放页
   ===================================================== */
.single-video-container {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 20px 0;
}

.single-video-container video {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 6px;
    margin-bottom: 20px;
}

/* 推荐区标题 */
.tuijian {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    border-left: 4px solid #f5c518;
    padding-left: 10px;
}

.tuijian h3 {
    margin: 0;
    font-size: 16px;
    color: #f5c518;
}

/* =====================================================
   分页
   ===================================================== */
.pagination {
    list-style: none;
    margin: 24px 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.pagination li a,
.pagination li span {
    display: block;
    padding: 6px 12px;
    border: 1px solid #444;
    border-radius: 3px;
    color: #ccc;
    font-size: 14px;
    transition: background 0.15s;
}

.pagination li a:hover {
    background: #f5c518;
    color: #111;
    border-color: #f5c518;
}

.pagination li.active a {
    background: #f5c518;
    color: #111;
    border-color: #f5c518;
}

.pagination li.disabled span {
    color: #555;
    cursor: default;
}

/* =====================================================
   热播榜
   ===================================================== */
.hot-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    font-size: 15px;
}

.hot-item a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 4px;
    color: #ccc;
    transition: background 0.15s;
}

.hot-item a:hover {
    background: #222;
    color: #f5c518;
}

.hot-item img {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* =====================================================
   页脚
   ===================================================== */
.footer-wrap {
    background: #1a1a1a;
    border-top: 1px solid #333;
    margin-top: 40px;
}

.footer {
    padding-top: 16px;
    padding-bottom: 16px;
    text-align: center;
    font-size: 13px;
    color: #666;
}

.footer-desktop { display: block; }
.footer-mobile  { display: none; }

/* =====================================================
   分类区块标题
   ===================================================== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 28px 0 12px;
    border-left: 4px solid #f5c518;
    padding-left: 10px;
}

.section-header h3 {
    margin: 0;
    font-size: 17px;
    color: #f5c518;
}

.more-link {
    font-size: 13px;
    color: #999;
    padding: 3px 8px;
    border: 1px solid #444;
    border-radius: 3px;
    transition: all 0.15s;
}

.more-link:hover {
    background: #f5c518;
    color: #111;
    border-color: #f5c518;
}

/* 视频卡片标题 */
.video-title {
    padding: 6px 8px 8px;
    font-size: 12px;
    color: #bbb;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.video-item:hover .video-title {
    color: #f5c518;
}

.empty-tip {
    color: #555;
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
}

/* 详情页 */
.detail-meta {
    max-width: 960px;
    margin: 0 auto 12px;
    padding: 0 0 12px;
    border-bottom: 1px solid #333;
}

.cat-badge {
    display: inline-block;
    background: #f5c518;
    color: #111;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 3px;
    margin-bottom: 8px;
}

.detail-title {
    font-size: 15px;
    color: #ddd;
    margin: 6px 0 4px;
    font-weight: normal;
}

.detail-hint {
    font-size: 12px;
    color: #666;
    margin: 0;
}

/* 简化分页（inc_video_grid 直接用 a/span） */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 24px 0;
    font-size: 14px;
}

.pagination a {
    padding: 6px 14px;
    border: 1px solid #444;
    border-radius: 3px;
    color: #ccc;
    transition: background 0.15s;
}

.pagination a:hover {
    background: #f5c518;
    color: #111;
    border-color: #f5c518;
}

.pagination span {
    color: #666;
}

/* =====================================================
   响应式 — 平板 (≤1024px): 4列
   ===================================================== */
@media (max-width: 1024px) {
    .video-container {
        grid-template-columns: repeat(4, 1fr);
    }

    .hot-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* =====================================================
   响应式 — 手机 (≤768px): 2列
   ===================================================== */
@media (max-width: 768px) {
    .navbar {
        gap: 6px;
    }

    .logo-img {
        height: 28px;
    }

    .nav-item a {
        padding: 4px 7px;
        font-size: 13px;
    }

    .search-form {
        width: 100%;
        order: 3;
        margin-left: 0;
    }

    .search-form input[type="text"] {
        flex: 1;
        width: 0;
    }

    .video-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .video-item a img,
    .video-item .no-thumb {
        height: 120px;
    }

    .hot-list {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-desktop { display: none; }
    .footer-mobile  { display: block; }

    .single-video-container video {
        aspect-ratio: 16 / 9;
        height: auto;
    }
}

/* =====================================================
   响应式 — 小屏手机 (≤480px): 2列保持，更紧凑
   ===================================================== */
@media (max-width: 480px) {
    .nav-item a {
        font-size: 12px;
        padding: 3px 6px;
    }

    .video-item p {
        font-size: 12px;
    }
}

/* =====================================================
   PWA 下載頁
   ===================================================== */
.hidden { display: none !important; }

.app-download {
    max-width: 480px;
    margin: 0 auto;
    padding: 24px 16px 48px;
    text-align: center;
}

.app-hero {
    margin-bottom: 28px;
}

.app-icon {
    width: 96px;
    height: 96px;
    border-radius: 22px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    margin-bottom: 16px;
}

.app-hero h1 {
    margin: 0 0 8px;
    font-size: 26px;
    color: #f5c518;
}

.app-tagline {
    margin: 0;
    color: #999;
    font-size: 15px;
}

.app-panel {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 20px 16px;
    margin-bottom: 16px;
    text-align: left;
}

.app-steps-title {
    margin: 0 0 12px;
    font-size: 16px;
    color: #f5c518;
    text-align: center;
}

.app-panel ol {
    margin: 0;
    padding-left: 20px;
    color: #ccc;
    line-height: 1.8;
    font-size: 14px;
}

.app-tip {
    margin: 12px 0 0;
    font-size: 13px;
    color: #888;
    text-align: center;
}

.app-tip.warn {
    color: #e6a817;
    margin-bottom: 16px;
}

.app-url {
    word-break: break-all;
    color: #f5c518;
    font-size: 14px;
    margin: 8px 0;
}

.ios-icon {
    font-size: 18px;
}

.app-btn {
    display: block;
    width: 100%;
    max-width: 320px;
    margin: 0 auto 12px;
    padding: 14px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
}

.app-btn.primary {
    background: #f5c518;
    color: #111;
}

.app-btn.primary:hover {
    background: #ffd84d;
}

.app-btn.secondary {
    background: transparent;
    color: #999;
    border: 1px solid #444;
}

.app-btn.secondary:hover {
    border-color: #f5c518;
    color: #f5c518;
}

.app-panel-success {
    text-align: center;
}

.app-success-title {
    font-size: 20px;
    color: #4caf50;
    margin: 0 0 12px;
}

.app-ios-note {
    margin: 0 0 16px;
    padding: 12px;
    background: #252525;
    border-radius: 8px;
    color: #ccc;
    font-size: 14px;
    line-height: 1.6;
    text-align: center;
}

.app-btn-hint {
    margin: -4px 0 16px;
    font-size: 12px;
    color: #666;
    text-align: center;
}

.app-btn-pulse {
    animation: app-pulse 1.2s ease-in-out infinite;
}

@keyframes app-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 197, 24, 0.5); }
    50% { box-shadow: 0 0 0 12px rgba(245, 197, 24, 0); }
}

.ios-steps-box {
    margin-top: 8px;
}

.ios-step-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
    color: #ccc;
    font-size: 14px;
    line-height: 1.5;
}

.ios-step-num {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    line-height: 26px;
    text-align: center;
    background: #f5c518;
    color: #111;
    border-radius: 50%;
    font-weight: bold;
    font-size: 13px;
}

.ios-safari-mock {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px dashed #444;
    scroll-margin-top: 16px;
}

.ios-open-safari-box {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed #444;
}

.ios-open-safari-box ol {
    margin: 0 0 16px;
    padding-left: 20px;
    color: #ccc;
    line-height: 1.8;
    font-size: 14px;
}

.ios-fallback-details {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px dashed #444;
    color: #888;
    font-size: 13px;
}

.ios-fallback-details summary {
    cursor: pointer;
    color: #aaa;
    margin-bottom: 12px;
}

.ios-fallback-details[open] summary {
    margin-bottom: 16px;
}

#link-open-safari {
    text-decoration: none;
    display: block;
}

#btn-ios-open-safari {
    text-decoration: none;
    display: block;
}

.ios-safari-bar {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: #2c2c2e;
    border-radius: 12px;
    padding: 14px 8px;
    margin-bottom: 8px;
}

.ios-safari-bar-modern {
    gap: 6px;
    padding: 10px 12px;
}

.ios-bar-url {
    flex: 1;
    text-align: center;
    font-size: 13px;
    color: #aaa;
    background: #1c1c1e;
    border-radius: 8px;
    padding: 8px 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ios-bar-btn {
    font-size: 13px;
    color: #888;
    padding: 6px 10px;
}

.ios-bar-more {
    background: #f5c518;
    color: #111 !important;
    border-radius: 8px;
    font-weight: bold;
    font-size: 18px;
    line-height: 1;
    min-width: 36px;
    text-align: center;
}

.ios-bar-more.pulse,
.ios-menu-share.pulse,
.ios-share-target.pulse {
    animation: app-pulse 1s ease-in-out infinite;
}

.ios-mock-stage {
    text-align: center;
    color: #888;
    font-size: 12px;
    margin: 0 0 10px;
}

.ios-safari-menu {
    background: #2c2c2e;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 8px;
}

.ios-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: #ddd;
    font-size: 15px;
    border-bottom: 1px solid #3a3a3c;
}

.ios-menu-item:last-child {
    border-bottom: none;
}

.ios-menu-icon {
    width: 22px;
    text-align: center;
    color: #007aff;
}

.ios-menu-share {
    background: rgba(245, 197, 24, 0.15);
    color: #f5c518;
    font-weight: bold;
}

.ios-share-sheet {
    background: #2c2c2e;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 8px;
    text-align: left;
}

.ios-share-apps,
.ios-share-actions {
    font-size: 11px;
    color: #666;
    padding: 8px 4px;
    border-bottom: 1px solid #3a3a3c;
    margin-bottom: 8px;
}

.ios-share-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ios-share-row {
    padding: 12px 10px;
    color: #bbb;
    font-size: 14px;
    border-radius: 8px;
}

.ios-share-target {
    background: rgba(245, 197, 24, 0.15);
    color: #f5c518;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ios-share-target-icon {
    font-size: 18px;
}

.ios-mock-caption {
    text-align: center;
    color: #f5c518;
    font-size: 15px;
    font-weight: bold;
    margin: 0;
}

.ios-float-hint {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
    background: linear-gradient(transparent, rgba(245, 197, 24, 0.95));
    color: #111;
    font-size: 15px;
    font-weight: bold;
    text-align: center;
    pointer-events: none;
    animation: ios-hint-bounce 1.5s ease-in-out infinite;
}

@keyframes ios-hint-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* 下載頁底部留出 Safari 底栏空间 */
body:has(.app-download) .footer-wrap {
    padding-bottom: 80px;
}
