/* ==========================================
   全局公共样式 common.css
   包含：变量重置 布局框架 顶栏 侧边栏 底部 基础动画
   ========================================== */

:root[data-theme="dark"] {
    --bg-base: #0f0f0f;
    --bg-sidebar: #0f0f0f;
    --bg-card: #1f1f1f;
    --bg-hover: #272727;
    --text-main: #f1f1f1;
    --text-sub: #aaaaaa;
    --border-color: #272727;
    --brand-red: #ff0000;
    --input-bg: #121212;
    --input-border: #303030;
    --chip-bg: #272727;
    --chip-active-bg: #f1f1f1;
    --chip-active-text: #0f0f0f;
    --card-glow-border: rgba(255, 255, 255, 0.18);
    --card-glow-shadow: rgba(0, 0, 0, 0.7);
}

:root[data-theme="light"] {
    --bg-base: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-card: #f9f9f9;
    --bg-hover: #e5e5e5;
    --text-main: #0f0f0f;
    --text-sub: #606060;
    --border-color: #e5e5e5;
    --brand-red: #ff0000;
    --input-bg: #ffffff;
    --input-border: #ccc;
    --chip-bg: #0000000d;
    --chip-active-bg: #0f0f0f;
    --chip-active-text: #ffffff;
    --card-glow-border: rgba(0, 0, 0, 0.12);
    --card-glow-shadow: rgba(0, 0, 0, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: "Roboto", "Arial", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.3s, color 0.3s;
}

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

ul, ol {
    list-style: none;
}

img, video {
    max-width: 100%;
    display: block;
}

/* ========== 顶部导航栏 ========== */
.yt-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background-color: var(--bg-base);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-toggle:hover {
    background: var(--bg-hover);
}

.yt-logo {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 18px;
}

.yt-logo i {
    color: var(--brand-red);
    font-size: 24px;
}

.header-center {
    flex: 1;
    max-width: 640px;
    display: flex;
    align-items: center;
    margin: 0 20px;
}

.search-form {
    display: flex;
    width: 100%;
}

.search-input {
    width: 100%;
    height: 40px;
    padding: 0 16px;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 40px 0 0 40px;
    color: var(--text-main);
    font-size: 14px;
    outline: none;
}
.search-input:focus {
    border-color: #1c62b9;
}
.search-btn {
    width: 64px;
    height: 40px;
    background-color: var(--bg-hover);
    border: 1px solid var(--input-border);
    border-left: none;
    border-radius: 0 40px 40px 0;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}
.search-btn:hover {
    background-color: var(--input-border);
}
.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-search-btn {
    display: none !important;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 18px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background-color: var(--bg-hover);
}

.theme-toggle-btn {
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
}
.theme-toggle-btn:hover {
    background-color: var(--input-border);
}
/* ========== 左侧侧边栏 ========== */
.yt-sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    width: 240px;
    background-color: var(--bg-sidebar);
    padding: 12px 8px;
    overflow-y: auto;
    border-right: 1px solid var(--border-color);
    z-index: 900;
    transition: width 0.25s ease, transform 0.25s ease;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--text-main);
    font-size: 14px;
    margin-bottom: 2px;
    white-space: nowrap;
}

.sidebar-item:hover {
    background-color: var(--bg-hover);
}

.sidebar-item.active {
    background-color: var(--bg-hover);
    font-weight: 600;
}

.sidebar-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 12px 0;
}

.sidebar-title {
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-sub);
    text-transform: uppercase;
}

.yt-sidebar.collapsed {
    width: 72px;
    padding: 8px 4px;
}

.yt-sidebar.collapsed .sidebar-item {
    flex-direction: column;
    gap: 6px;
    padding: 14px 0;
    justify-content: center;
}

.yt-sidebar.collapsed .sidebar-item i {
    font-size: 20px;
    width: auto;
}

.yt-sidebar.collapsed .sidebar-item span,
.yt-sidebar.collapsed .sidebar-title {
    display: none;
}

/* ========== 主体内容区基础 ========== */
.yt-main {
    margin-top: 56px;
    margin-left: 240px;
    padding: 10px 12px 24px 12px;
    transition: margin-left 0.25s ease;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 56px);
}

.yt-main.expanded {
    margin-left: 72px;
}

/* ========== 底部 ========== */
.yt-footer {
    margin-top: 36px;
    padding: 20px 0 16px 0;
    border-top: 1px solid var(--border-color);
    color: var(--text-sub);
    font-size: 12px;
    line-height: 1.6;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--text-sub);
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--text-main);
    text-decoration: underline;
}

.footer-disclaimer {
    margin-bottom: 12px;
    max-width: 900px;
    opacity: 0.85;
}

.footer-copyright {
    font-size: 11px;
    color: var(--text-sub);
    opacity: 0.6;
}

/* ========== 通用响应式断点 ========== */
@media (max-width: 1024px) {
    .yt-main {
        margin-left: 0 !important;
        padding: 16px;
    }
    .yt-sidebar {
        transform: translateX(-100%);
        width: 240px !important;
    }
    .yt-sidebar.mobile-open {
        transform: translateX(0);
    }
}

@media (max-width: 768px) {
    .header-center {
        display: none !important;
    }
    .mobile-search-btn {
        display: flex;
    }
    .theme-toggle-btn span,
    #themeText {
        display: none;
    }
}