:root {
    --bg: #f5f7fa;
    --card-bg: #fff;
    --text: #2d3748;
    --text-sub: #718096;
    --accent: #667eea;
    --accent-light: #eef0ff;
    --border: #e2e8f0;
    --shadow: 0 2px 12px rgba(0,0,0,0.06);
    --hover-bg: #f7fafc;
    --radius: 12px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1a202c;
        --card-bg: #2d3748;
        --text: #e2e8f0;
        --text-sub: #a0aec0;
        --accent: #818cf8;
        --accent-light: #2d3368;
        --border: #4a5568;
        --shadow: 0 2px 12px rgba(0,0,0,0.3);
        --hover-bg: #3a4a5c;
    }
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif; 
    background: var(--bg); color: var(--text); 
    height: 100vh; overflow: hidden; 
}
a { text-decoration: none; color: inherit; }

html { scroll-behavior: smooth; }

.layout { display: flex; height: 100vh; max-width: 1920px; margin: 0 auto; }

/* ========== 左侧导航 ========== */
.sidebar {
    width: 210px; background: var(--card-bg); border-right: 1px solid var(--border);
    display: flex; flex-direction: column; padding: 24px 0; flex-shrink: 0; overflow-y: auto;
    transition: transform 0.3s ease;
}
.logo { 
    font-size: 22px; font-weight: 900; background: linear-gradient(135deg, var(--accent), #a78bfa);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; 
    padding: 0 20px 24px; user-select: none;
}
.nav-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 11px 20px; font-size: 13px; font-weight: 600;
    color: var(--text-sub); border-left: 3px solid transparent; transition: all 0.2s;
    cursor: pointer;
}
.nav-item .count {
    font-size: 11px; background: var(--bg); padding: 2px 7px; border-radius: 10px; opacity: 0.7;
}
.nav-item:hover, .nav-item.active { 
    background: var(--accent-light); color: var(--accent); border-left-color: var(--accent); 
}
.nav-item:hover .count, .nav-item.active .count { background: var(--accent); color: #fff; opacity: 1; }

/* 汉堡菜单按钮（移动端） */
.hamburger {
    display: none; position: fixed; top: 16px; left: 16px; z-index: 100;
    width: 40px; height: 40px; border-radius: 10px; background: var(--card-bg);
    border: 1px solid var(--border); align-items: center; justify-content: center;
    cursor: pointer; font-size: 20px;
}
.sidebar-overlay { display: none; }

/* ========== 中间内容 ========== */
.main-content { 
    flex: 1; padding: 32px 40px; overflow-y: auto; background: var(--bg);
    scroll-behavior: smooth;
}
.search-box {
    width: 100%; padding: 15px 20px; border-radius: 12px; border: 2px solid var(--border);
    font-size: 16px; outline: none; background: var(--card-bg); color: var(--text);
    margin-bottom: 32px; transition: all 0.25s; box-shadow: var(--shadow);
}
.search-box:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.search-box::placeholder { color: var(--text-sub); opacity: 0.6; }

/* 标签筛选栏 */
.tag-bar {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin-bottom: 24px; padding: 12px 16px; background: var(--card-bg);
    border-radius: var(--radius); border: 1px solid var(--border);
}
.tag-label { font-size: 13px; font-weight: 700; color: var(--text-sub); margin-right: 4px; }
.tag-chip {
    font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 20px;
    cursor: pointer; user-select: none; border: 1.5px solid var(--border);
    color: var(--text-sub); background: var(--bg); transition: all 0.2s;
}
.tag-chip:hover { border-color: var(--accent); color: var(--accent); }
.tag-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* 无搜索结果 */
.no-results { text-align: center; padding: 60px 20px; color: var(--text-sub); display: none; }
.no-results .icon { font-size: 48px; margin-bottom: 12px; }
.no-results.show { display: block; }

/* 热门徽章 */
.hot-badge { font-size: 14px; vertical-align: middle; }
.card-hot { border-left-color: #f59e0b !important; }
.card-hot:hover { border-color: #f59e0b !important; box-shadow: 0 4px 20px rgba(245, 158, 11, 0.15); }

/* 卡片标签 */
.card-tags {
    display: none; position: absolute; bottom: 8px; right: 12px;
    gap: 4px;
}
.card:hover .card-tags { display: flex; }
.mini-tag {
    font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 10px;
    background: var(--bg); color: var(--text-sub); white-space: nowrap;
}

.section { margin-bottom: 36px; }

/* 快讯区域 */
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.section-header h2 { font-size: 18px; }
.view-all { font-size: 13px; color: var(--accent); font-weight: 600; transition: opacity 0.2s; }
.view-all:hover { opacity: 0.7; }

.news-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.news-item {
    display: flex; gap: 12px; padding: 10px 14px; border-radius: 8px; transition: all 0.2s;
    align-items: center; font-size: 14px;
}
.news-item:hover { background: var(--accent-light); }
.news-date { 
    font-size: 12px; color: var(--text-sub); white-space: nowrap; min-width: 40px; font-weight: 600;
    font-family: 'Consolas', monospace;
}
.news-title { color: var(--text); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 分类标题 */
.category-title { 
    font-size: 18px; font-weight: 800; margin-bottom: 14px; color: var(--text); 
    padding-bottom: 10px; border-bottom: 2px solid var(--border);
    display: flex; align-items: center; gap: 8px;
}
.category-title .badge {
    font-size: 12px; font-weight: 600; background: var(--accent-light); color: var(--accent);
    padding: 2px 10px; border-radius: 20px;
}

/* 卡片网格 — 固定3列 */
.card-grid { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 12px; 
}
.card {
    background: var(--card-bg); border-radius: var(--radius); padding: 16px;
    display: flex; align-items: center; gap: 12px; 
    border: 1px solid var(--border); border-left: 3px solid transparent;
    transition: all 0.2s ease; cursor: pointer; position: relative;
}
.card:hover { 
    transform: translateY(-3px); box-shadow: var(--shadow); 
    border-left-color: var(--accent); border-color: var(--accent) var(--border) var(--border) var(--accent);
}
.card-icon { 
    font-size: 28px; width: 44px; height: 44px; 
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    background: var(--bg); border-radius: 10px;
}
.card-info { min-width: 0; }
.card-info h4 { 
    font-size: 14px; margin-bottom: 4px; font-weight: 700; 
}
.card-info p { 
    font-size: 12px; color: var(--text-sub); line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 搜索高亮 */
.card mark { 
    background: var(--accent-light); color: var(--accent); padding: 1px 3px; border-radius: 3px; 
    font-weight: 700;
}
.card.hidden { display: none; }

.footer { text-align: center; padding: 40px 0 20px; font-size: 12px; color: var(--text-sub); opacity: 0.7; }
.beian { margin-top: 8px; font-size: 12px; color: #939393; }

.beian a { color: #939393; text-decoration: none; }
.beian a:hover { color: #666; }

/* ========== 右侧面板 ========== */
.right-panel {
    width: 280px; background: var(--card-bg); border-left: 1px solid var(--border);
    display: flex; flex-direction: column; flex-shrink: 0;
}
.panel-top {
    flex: 7; border-bottom: 1px solid var(--border); padding: 24px 20px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.analog-clock {
    width: 130px; height: 130px; border: 5px solid var(--text); border-radius: 50%;
    position: relative; margin-bottom: 16px;
}
.analog-clock::after {
    content: ''; position: absolute; width: 8px; height: 8px; background: var(--accent);
    top: 50%; left: 50%; transform: translate(-50%,-50%); border-radius: 50%; z-index: 10;
}
.hand { position: absolute; bottom: 50%; left: 50%; transform-origin: bottom; border-radius: 3px; }
.hand.hour { width: 4px; height: 36px; margin-left: -2px; background: var(--text); }
.hand.min { width: 3px; height: 50px; margin-left: -1.5px; background: var(--text-sub); }
.hand.sec { width: 2px; height: 56px; margin-left: -1px; background: #e53e3e; z-index: 2; }
.digital-clock { font-size: 34px; font-weight: 800; font-family: 'Consolas', monospace; }
.date-display { font-size: 13px; color: var(--text-sub); margin: 8px 0 20px; }
.world-clocks { width: 90%; display: flex; flex-direction: column; gap: 6px; }
.world-item { 
    display: flex; justify-content: space-between; font-size: 12px; color: var(--text-sub); 
    padding: 8px 12px; background: var(--bg); border-radius: 8px; transition: background 0.2s;
}
.world-item:hover { background: var(--accent-light); }
.panel-bottom {
    flex: 3; padding: 16px; display: flex; align-items: center; justify-content: center;
}
.contact-row { display: flex; align-items: center; gap: 12px; }
.qr-code { width: 80px; height: 80px; border-radius: 8px; }

/* ========== 新闻详情页 ========== */
.article { max-width: 720px; margin: 0 auto; }
.article h1 { font-size: 24px; margin-bottom: 8px; }
.article time { color: var(--text-sub); font-size: 13px; }
.article .content { margin-top: 24px; line-height: 1.8; font-size: 15px; }
.article .content a { color: var(--accent); }
.back-link { display: inline-block; margin-bottom: 16px; color: var(--accent); font-weight: 600; font-size: 14px; }

/* ========== 响应式 ========== */
@media (max-width: 1024px) {
    .card-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .hamburger { display: flex; }
    .sidebar {
        position: fixed; left: 0; top: 0; height: 100vh; z-index: 99;
        transform: translateX(-100%); box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay {
        display: block; position: fixed; inset: 0; background: rgba(0,0,0,0.4);
        z-index: 98; opacity: 0; pointer-events: none; transition: opacity 0.3s;
    }
    .sidebar-overlay.show { opacity: 1; pointer-events: auto; }
    .right-panel { display: none; }
    .main-content { padding: 16px; padding-top: 64px; }
    .card-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
    .card { padding: 12px; }
    .card-icon { width: 36px; height: 36px; font-size: 22px; }
}
