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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #0a0a1a;
    color: #e0e0e0;
    min-height: 100vh;
    line-height: 1.6;
}

a { color: #4fc3f7; text-decoration: none; transition: color 0.3s; }
a:hover { color: #81d4fa; }

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

/* ========== 顶部设置栏 ========== */
.settings-bar {
    background: linear-gradient(135deg, #1a1a3a, #0d0d2b);
    border-bottom: 1px solid rgba(79, 195, 247, 0.15);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-name {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, #ff9800, #ff6f00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.version-badge {
    display: inline-block;
    padding: 2px 8px;
    margin-left: 8px;
    background: linear-gradient(135deg, #4fc3f7, #29b6f6);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(79, 195, 247, 0.3);
}

.setting-btn {
    padding: 8px 18px;
    border: 1px solid rgba(79, 195, 247, 0.3);
    border-radius: 20px;
    background: rgba(79, 195, 247, 0.1);
    color: #4fc3f7;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.setting-btn:hover {
    background: rgba(79, 195, 247, 0.2);
    border-color: #4fc3f7;
}

/* ========== 设置面板 ========== */
.settings-panel {
    background: rgba(20, 20, 40, 0.98);
    border-bottom: 1px solid rgba(79, 195, 247, 0.15);
    padding: 25px 0;
    animation: slideDown 0.3s ease;
}

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

.setting-group {
    margin-bottom: 20px;
}

.setting-group h3 {
    font-size: 16px;
    color: #fff;
    margin-bottom: 12px;
}

.setting-hint {
    font-size: 12px;
    color: #888;
    font-weight: normal;
}

.setting-tabs {
    display: none;
}

.st-tab {
    display: none;
}

.tag-list {
    display: none;
}

.tag-item {
    display: none;
}

.source-options {
    display: flex;
    gap: 20px;
}

.source-option {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #aaa;
}

.source-option input[type="radio"] { accent-color: #4fc3f7; }

.setting-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.setting-save-btn {
    padding: 10px 28px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #4fc3f7, #29b6f6);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.setting-save-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 195, 247, 0.3);
}

.setting-close-btn {
    padding: 10px 28px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    background: transparent;
    color: #888;
    font-size: 14px;
    cursor: pointer;
}

/* 密码解锁 */
.unlock-section {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.unlock-input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid rgba(79, 195, 247, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
}

.unlock-input:focus {
    border-color: #4fc3f7;
    background: rgba(255, 255, 255, 0.1);
}

.unlock-input::placeholder {
    color: #666;
}

.unlock-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #4fc3f7, #29b6f6);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.unlock-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 195, 247, 0.3);
}

.unlock-hint {
    font-size: 12px;
    color: #888;
    margin: 0;
}

.unlock-hint.unlocked {
    color: #4caf50;
}

/* 锁定状态 */
.setting-group.locked {
    opacity: 0.5;
    pointer-events: none;
    filter: blur(2px);
}

.setting-group.locked .st-tab,
.setting-group.locked .source-option {
    cursor: not-allowed;
}

/* ========== 公告栏 ========== */
.announcement-bar {
    background: linear-gradient(135deg, #ff6f00, #ff8f00);
    color: #fff;
    padding: 8px 0;
    font-size: 13px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.announcement-bar .container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.announcement-content {
    flex: 1;
    text-align: center;
}

.announcement-item {
    margin: 4px 0;
    font-size: 13px;
    line-height: 1.6;
}

.announcement-item:first-child {
    margin-top: 0;
}

.announcement-item:last-child {
    margin-bottom: 0;
}

.announcement-text strong { color: #fff; text-shadow: 0 0 8px rgba(255,255,255,0.5); }

.announcement-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ========== 搜索区域 ========== */
.search-section {
    background: linear-gradient(135deg, rgba(79, 195, 247, 0.08), rgba(41, 182, 246, 0.05));
    padding: 40px 0;
    text-align: center;
    border-bottom: 1px solid rgba(79, 195, 247, 0.1);
}

.search-box h2 { font-size: 24px; margin-bottom: 18px; color: #fff; }

.search-form {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    gap: 10px;
}

.search-form input {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid rgba(79, 195, 247, 0.3);
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 16px;
    outline: none;
    transition: all 0.3s;
}

.search-form input:focus {
    border-color: #4fc3f7;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 20px rgba(79, 195, 247, 0.2);
}

.search-form input::placeholder { color: #666; }

.search-form button {
    padding: 14px 32px;
    border: none;
    border-radius: 30px;
    background: linear-gradient(135deg, #4fc3f7, #29b6f6);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    white-space: nowrap;
}

.search-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(79, 195, 247, 0.4);
}

/* ========== 当前筛选标签栏 ========== */
.active-tags-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px 0 5px;
    flex-wrap: wrap;
    font-size: 13px;
}

.active-tags-label { color: #888; }

.active-tags { display: flex; gap: 6px; flex-wrap: wrap; }

.active-tag {
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}

.active-tag.yellow { background: rgba(255, 152, 0, 0.15); color: #ff9800; border: 1px solid rgba(255, 152, 0, 0.3); }
.active-tag.normal { background: rgba(79, 195, 247, 0.15); color: #4fc3f7; border: 1px solid rgba(79, 195, 247, 0.3); }

.no-tags { color: #666; font-size: 12px; }

.active-tags-mode { color: #888; font-size: 12px; margin-left: auto; }

/* ========== 视频网格 ========== */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    padding: 20px 0;
}

.video-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(79, 195, 247, 0.15);
    border-color: rgba(79, 195, 247, 0.3);
}

.video-card .card-img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; background: linear-gradient(135deg, #1a1a3a, #0a0a1a); }

.video-card .card-img-container { position: relative; overflow: hidden; }

.video-card .card-img-container::after {
    content: '▶';
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 36px; color: #fff;
    background: rgba(79, 195, 247, 0.8);
    width: 55px; height: 55px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s; opacity: 0;
}

.video-card:hover .card-img-container::after { transform: translate(-50%, -50%) scale(1); opacity: 1; }

.video-card .card-badge {
    position: absolute; top: 8px; right: 8px;
    padding: 2px 8px; border-radius: 8px;
    font-size: 11px; font-weight: 600;
    background: linear-gradient(135deg, #ff6f00, #ff8f00);
    color: #fff; max-width: 100px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.video-card .card-info { padding: 10px; }
.video-card .card-title { font-size: 13px; font-weight: 600; color: #fff; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-card .card-meta { font-size: 11px; color: #888; display: flex; justify-content: space-between; }

/* 文字模式行 */
.text-row {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    cursor: pointer;
    transition: background 0.2s;
    gap: 15px;
    grid-column: 1 / -1;
}

.text-row:hover { background: rgba(79, 195, 247, 0.05); }

.text-title { flex: 1; font-size: 14px; color: #e0e0e0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-type { font-size: 12px; color: #ff9800; width: 80px; text-align: center; flex-shrink: 0; }
.text-date { font-size: 12px; color: #666; width: 100px; text-align: right; flex-shrink: 0; }

/* ========== 加载/错误/空状态 ========== */
.loading, .error-msg, .empty-msg {
    text-align: center;
    padding: 60px 20px;
    color: #888;
    font-size: 16px;
    grid-column: 1 / -1;
}

.loading::after {
    content: '';
    display: block;
    width: 36px; height: 36px;
    margin: 12px auto 0;
    border: 3px solid rgba(79, 195, 247, 0.1);
    border-top-color: #4fc3f7;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.error-msg { color: #ff6f00; }
.error-msg .error-icon, .empty-msg .empty-icon { font-size: 42px; display: block; margin-bottom: 12px; }

/* ========== 分页 ========== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 25px 0;
    flex-wrap: wrap;
}

.page-btn {
    padding: 7px 14px;
    border: 1px solid rgba(79, 195, 247, 0.2);
    border-radius: 6px;
    background: transparent;
    color: #aaa;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
}

.page-btn:hover { border-color: #4fc3f7; color: #4fc3f7; }
.page-btn.active { background: linear-gradient(135deg, #4fc3f7, #29b6f6); color: #fff; border-color: transparent; }
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ========== 底部 ========== */
.footer {
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(79, 195, 247, 0.1);
    padding: 25px 0;
    text-align: center;
    font-size: 13px;
    color: #666;
}

.footer p { margin-bottom: 6px; }
.footer-links a { color: #888; margin: 0 4px; }
.footer-links a:hover { color: #4fc3f7; }

/* ========== 播放器页面 ========== */
.player-section { padding: 20px 0; }
.player-wrapper { max-width: 900px; margin: 0 auto; }

.player-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(79, 195, 247, 0.2);
}

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

.player-placeholder {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: #666;
}

.player-placeholder .placeholder-icon { font-size: 56px; margin-bottom: 12px; }
.player-placeholder h3 { font-size: 18px; color: #888; margin-bottom: 6px; }
.player-placeholder p { font-size: 13px; color: #555; }

.player-tips { text-align: center; padding: 8px; font-size: 13px; color: #ff9800; margin-top: 8px; }

/* 视频信息 */
.video-info {
    max-width: 900px; margin: 18px auto; padding: 18px;
    background: rgba(255, 255, 255, 0.03); border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.video-info h2 { font-size: 20px; color: #fff; margin-bottom: 8px; }

.video-meta {
    display: flex; gap: 10px; flex-wrap: wrap;
    font-size: 12px; color: #888; margin-bottom: 8px;
}

.video-meta span {
    padding: 2px 8px; background: rgba(79, 195, 247, 0.1);
    border-radius: 4px; color: #4fc3f7;
}

.video-desc { font-size: 13px; color: #999; line-height: 1.8; }

/* 播放线路 */
.play-links { max-width: 900px; margin: 18px auto; }
.play-links h3 { font-size: 16px; color: #fff; margin-bottom: 12px; }
.links-list { display: flex; flex-wrap: wrap; gap: 6px; }

.play-link-btn {
    padding: 7px 16px;
    border: 1px solid rgba(79, 195, 247, 0.2);
    border-radius: 6px;
    background: transparent;
    color: #aaa;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.play-link-btn:hover { border-color: #4fc3f7; color: #4fc3f7; background: rgba(79, 195, 247, 0.1); }
.play-link-btn.active { background: linear-gradient(135deg, #4fc3f7, #29b6f6); color: #fff; border-color: transparent; }

/* 解析接口 */
.parse-section { max-width: 900px; margin: 18px auto; }
.parse-section h3 { font-size: 16px; color: #fff; margin-bottom: 12px; }
.parse-buttons { display: flex; gap: 8px; flex-wrap: wrap; }

.parse-btn {
    padding: 8px 20px;
    border: 1px solid rgba(79, 195, 247, 0.2);
    border-radius: 6px;
    background: transparent;
    color: #aaa;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
}

.parse-btn:hover { border-color: #4fc3f7; color: #4fc3f7; }
.parse-btn.active { background: linear-gradient(135deg, #4fc3f7, #29b6f6); color: #fff; border-color: transparent; }

/* 解析链接 */
.parse-url-section { max-width: 900px; margin: 18px auto; }
.parse-url-section h3 { font-size: 16px; color: #fff; margin-bottom: 12px; }

.parse-url-box { display: flex; gap: 8px; align-items: center; }

.parse-url-input {
    flex: 1; padding: 10px 14px;
    border: 1px solid rgba(79, 195, 247, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    color: #4fc3f7; font-size: 12px;
    outline: none; cursor: pointer;
    font-family: 'Courier New', monospace;
}

.parse-url-input:focus { border-color: #4fc3f7; }

.copy-btn, .open-btn {
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    border: 1px solid;
}

.copy-btn {
    border-color: rgba(79, 195, 247, 0.3);
    background: rgba(79, 195, 247, 0.1);
    color: #4fc3f7;
}

.copy-btn:hover { background: rgba(79, 195, 247, 0.2); border-color: #4fc3f7; }
.copy-btn.copied { background: rgba(76, 175, 80, 0.2); border-color: #4caf50; color: #4caf50; }

.open-btn {
    border-color: rgba(255, 152, 0, 0.3);
    background: rgba(255, 152, 0, 0.1);
    color: #ff9800;
}

.open-btn:hover { background: rgba(255, 152, 0, 0.2); border-color: #ff9800; }

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .video-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
    .search-box h2 { font-size: 20px; }
    .search-form { flex-direction: column; }
    .search-form button { width: 100%; }
    .settings-row { flex-direction: column; gap: 8px; }
    .parse-url-box { flex-wrap: wrap; }
    .parse-url-input { min-width: 100%; }
    .text-title { font-size: 13px; }
    .text-type { width: 60px; font-size: 11px; }
    .text-date { width: 70px; font-size: 11px; }
}

@media (max-width: 480px) {
    .video-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .video-card .card-info { padding: 6px; }
    .video-card .card-title { font-size: 12px; }
}

/* ========== 版本更新弹窗 ========== */
.version-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.version-modal-content {
    background: linear-gradient(135deg, #1a1a3a, #0d0d2b);
    border: 1px solid rgba(79, 195, 247, 0.3);
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(79, 195, 247, 0.3);
    animation: slideUp 0.4s ease;
}

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

.version-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(79, 195, 247, 0.15);
    background: linear-gradient(135deg, rgba(79, 195, 247, 0.1), rgba(41, 182, 246, 0.05));
}

.version-modal-header h2 {
    font-size: 22px;
    color: #fff;
    margin: 0;
}

.version-modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.version-modal-close:hover {
    background: rgba(255, 107, 0, 0.3);
    transform: rotate(90deg);
}

.version-modal-body {
    padding: 24px;
}

.version-info {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(79, 195, 247, 0.15);
}

.version-info h3 {
    font-size: 28px;
    color: #4fc3f7;
    margin: 0 0 8px 0;
    background: linear-gradient(135deg, #4fc3f7, #29b6f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.version-date {
    font-size: 13px;
    color: #888;
    margin: 0;
}

.version-section {
    margin-bottom: 20px;
}

.version-section h4 {
    font-size: 16px;
    color: #fff;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.version-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.version-section li {
    padding: 8px 12px;
    margin-bottom: 6px;
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid #4fc3f7;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 14px;
    line-height: 1.6;
}

.version-section li:last-child {
    margin-bottom: 0;
}

.version-modal-footer {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid rgba(79, 195, 247, 0.15);
    background: rgba(0, 0, 0, 0.2);
}

.version-btn-primary {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #4fc3f7, #29b6f6);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.version-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(79, 195, 247, 0.4);
}

.version-btn-secondary {
    flex: 1;
    padding: 12px 24px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    background: transparent;
    color: #888;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.version-btn-secondary:hover {
    border-color: #4fc3f7;
    color: #4fc3f7;
    background: rgba(79, 195, 247, 0.1);
}

.version-btn-skip {
    flex: 1;
    padding: 12px 24px;
    border: 1px solid rgba(255, 152, 0, 0.3);
    border-radius: 8px;
    background: rgba(255, 152, 0, 0.1);
    color: #ff9800;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.version-btn-skip:hover {
    background: rgba(255, 152, 0, 0.2);
    border-color: #ff9800;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

/* 响应式 */
@media (max-width: 768px) {
    .version-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .version-modal-header {
        padding: 16px 20px;
    }
    
    .version-modal-header h2 {
        font-size: 18px;
    }
    
    .version-modal-body {
        padding: 20px;
    }
    
    .version-info h3 {
        font-size: 24px;
    }
    
    .version-modal-footer {
        padding: 16px 20px;
        flex-wrap: wrap;
    }
    
    .version-btn-primary,
    .version-btn-secondary,
    .version-btn-skip {
        flex: 1 1 100%;
        padding: 10px 20px;
        font-size: 14px;
    }
}
