/* --- 核心变量：深空极客风 --- */
:root {
    --sidebar-bg: #15171e;        /* 左侧边栏背景 */
    --main-bg: #1b1d24;           /* 主内容区背景 */
    --card-bg: #23262e;           /* 卡片背景 */
    --card-hover: #2b2f38;        /* 卡片悬停 */
    --text-main: #e0e6ed;         /* 主文字 */
    --text-sub: #777d8a;          /* 副文字 */
    --accent: #4e8cff;            /* 提亮色(蓝) */
    --border: #2d313a;            /* 边框色 */
    --sidebar-width: 240px;       /* 侧边栏宽度 */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--main-bg);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden; 
    display: flex;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* --- 1. 左侧侧边栏 (Sidebar) --- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    height: 100%;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    flex-shrink: 0;
    transition: transform 0.3s ease;
    z-index: 100;
}

.logo-area {
    padding: 30px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid var(--border);
}

.logo-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
}

.logo-text h2 { font-size: 18px; font-weight: 700; color: #fff; }
.logo-text p { font-size: 12px; color: var(--text-sub); margin-top: 3px; }

.nav-menu {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
}

.nav-item {
    padding: 12px 25px;
    display: flex;
    align-items: center;
    color: #9aa0ac;
    font-size: 14px;
    transition: all 0.2s;
    cursor: pointer;
    border-left: 3px solid transparent;
}

.nav-item i { margin-right: 12px; width: 20px; text-align: center; }

.nav-item:hover, .nav-item.active {
    background: rgba(78, 140, 255, 0.1);
    color: #fff;
    border-left-color: var(--accent);
}

.nav-category-title {
    padding: 20px 25px 10px;
    font-size: 12px;
    color: #555;
    text-transform: uppercase;
    font-weight: 700;
}

/* --- 2. 右侧主内容区 (Main Content) --- */
.main-content {
    flex: 1;
    height: 100%;
    overflow-y: auto;
    position: relative;
    background-color: var(--main-bg);
}

/* 顶部 Banner 区 */
.top-header {
    background: linear-gradient(to right, #141e30, #243b55), url('https://user0634.cn.imgto.link/public/20251231/042c9cd2ee21c2f6178579552130ad06.avif');
    background-size: cover;
    background-position: center;
    padding: 60px 40px;
    position: relative;
    display: flex;
    justify-content: space-between; 
    align-items: center;
}

.top-header::before {
    content: '';
    position: absolute;
    top:0; left:0; right:0; bottom:0;
    background: rgba(0,0,0,0.4);
}

.header-inner { position: relative; z-index: 2; max-width: 600px; flex: 1; }

.header-inner h1 {
    font-size: 28px;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* 时钟样式 */
.header-clock {
    position: relative;
    z-index: 2;
    text-align: right;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    margin-left: 20px;
}

.clock-time {
    font-size: 48px;
    font-weight: 700;
    font-family: 'Segoe UI', sans-serif; 
    font-variant-numeric: tabular-nums; 
    line-height: 1;
    letter-spacing: 2px;
}

.clock-date {
    font-size: 14px;
    color: rgba(255,255,255,0.8);
    margin-top: 5px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* 搜索框 */
.search-box {
    position: relative;
    width: 100%;
    max-width: 500px;
}
.search-box input {
    width: 100%;
    padding: 15px 20px 15px 50px;
    border-radius: 50px;
    border: none;
    background: rgba(255,255,255,0.9);
    color: #333;
    font-size: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    outline: none;
    transition: all 0.3s;
}
.search-box input:focus {
    background: #fff;
    transform: scale(1.02);
}
.search-box i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

/* 资源列表容器 */
.content-body {
    padding: 40px;
    max-width: 1600px;
    margin: 0 auto;
}

.section-header {
    display: flex;
    align-items: center;
    margin: 40px 0 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.section-header i { margin-right: 10px; color: var(--accent); }
.section-header h3 { font-size: 18px; color: #fff; }
.section-header .tag { 
    margin-left: auto; 
    font-size: 12px; 
    background: #2c2f3b; 
    padding: 2px 8px; 
    border-radius: 4px; 
    color: #666;
}

/* 网格布局 */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.card {
    background: var(--card-bg);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: flex-start;
    transition: transform 0.2s, background 0.2s;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    background: var(--card-hover);
    border-color: rgba(78, 140, 255, 0.3);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.card-icon {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-right: 15px;
    flex-shrink: 0;
}

.card-info { flex: 1; min-width: 0; }
.card-info h4 { 
    font-size: 15px; 
    color: #fff; 
    margin-bottom: 5px; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}
.card-info p { 
    font-size: 12px; 
    color: var(--text-sub); 
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 10px;
    color: #555;
    opacity: 0.5;
}
.highlight .card-badge { color: #ff7675; opacity: 1; font-weight: bold;}

/* 滚动条 */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--main-bg); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

/* 移动端适配 */
@media (max-width: 768px) {
    .sidebar { position: fixed; transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .top-header { flex-direction: column-reverse; padding: 40px 20px; text-align: center; }
    .header-clock { margin-left: 0; margin-bottom: 20px; text-align: center; }
    .clock-time { font-size: 42px; }
    .grid-cards { grid-template-columns: 1fr; }
    
    .menu-toggle {
        position: fixed;
        bottom: 20px; right: 20px;
        width: 50px; height: 50px;
        background: var(--accent);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 20px;
        z-index: 200;
        box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    }
}
@media (min-width: 769px) {
    .menu-toggle { display: none; }
}