:root {
    --primary-color: #3c979d;
    --secondary-color: #87888a;
    --white-color: #ffffff;
    --text-color: #333333;
    --light-bg: #f7f7f7;
    --border-color: #eaeaea;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    margin: 0;
    padding: 0;
    color: var(--text-color);
    background-color: var(--white-color);
    transition: background-color 0.3s, color 0.3s;
    -webkit-text-size-adjust: 100%;
}

/* 防止iOS设备中输入框自动放大 */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
textarea {
    font-size: 16px; /* 至少16px以避免iOS中自动缩放 */
}

body.dark-mode {
    --white-color: #222;
    --text-color: #eee;
    --light-bg: #333;
    --border-color: #444;
    background-color: var(--white-color);
    color: var(--text-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 顶部导航 */
header {
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.header-container {
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.logo {
    max-width: 240px;
    height: auto;
}

/* 主体布局 */
.main-wrapper {
    display: flex;
    margin-top: 20px;
}

/* 左侧分类导航 */
.sidebar {
    width: 220px;
    margin-right: 30px;
    transition: transform 0.3s;
}

/* 分类导航 */
.category-nav {
    background-color: var(--light-bg);
    padding: 15px;
    border-radius: 5px;
}

.category-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-menu li {
    padding: 10px 15px;
    margin-bottom: 5px;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s;
}

.category-menu li a,
.subcategory-menu li a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.category-menu li.active {
    background-color: var(--primary-color);
    color: white;
}

.category-menu li:hover:not(.active) {
    background-color: rgba(60, 151, 157, 0.1);
}

.subcategory-menu {
    list-style: none;
    padding-left: 15px;
    margin-top: 5px;
}

.subcategory-menu li {
    padding: 8px 10px;
    margin-bottom: 3px;
    font-size: 0.9em;
}

/* 移动端侧边栏控制 */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 5px;
    cursor: pointer;
    z-index: 1010;
    font-size: 1.2rem;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(2px);
    z-index: 1000;
}

.sidebar-close {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: var(--secondary-color);
    font-size: 1.2rem;
    cursor: pointer;
}

/* 内容区域 */
.content-area {
    flex: 1;
}

/* 搜索栏 */
.search-wrapper {
    margin-bottom: 20px;
}

.search-form {
    display: flex;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 10px 15px;
    padding-right: 45px;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
    background-color: var(--white-color);
    color: var(--text-color);
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(60, 151, 157, 0.2);
}

.search-button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    color: var(--primary-color);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.2rem;
}

.search-button:hover {
    color: #2d7278;
}

/* 主题切换 */
.theme-toggle {
    background: none;
    border: none;
    color: var(--secondary-color);
    cursor: pointer;
    font-size: 1.2rem;
    transition: color 0.3s;
}

/* 文章列表 */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.article-card {
    background-color: var(--white-color);
    border-radius: 5px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--border-color);
}

.article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.article-card a {
    text-decoration: none;
    color: inherit;
}

.article-category {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 3px;
    margin-bottom: 10px;
}

.article-title {
    font-size: 1.1rem;
    color: var(--text-color);
    margin: 0 0 10px;
    line-height: 1.4;
}

.article-summary {
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-bottom: 10px;
    line-height: 1.5;
}

.article-date {
    font-size: 0.8rem;
    color: var(--secondary-color);
    text-align: right;
}

/* 底线提示 */
.end-line {
    text-align: center;
    color: var(--secondary-color);
    padding: 30px 0;
    font-size: 0.9rem;
    position: relative;
}

.end-line::before,
.end-line::after {
    content: "";
    display: inline-block;
    width: 100px;
    height: 1px;
    background-color: var(--border-color);
    vertical-align: middle;
    margin: 0 15px;
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 20px 0;
    display: none;
}

.loading .dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--primary-color);
    margin: 0 5px;
    animation: loading 1.4s infinite ease-in-out both;
}

.loading .dot:nth-child(1) {
    animation-delay: -0.32s;
}

.loading .dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes loading {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-wrapper {
        flex-direction: column;
    }
    
    .header-container {
        justify-content: center;
        padding-left: 40px; /* 为侧边栏切换按钮留出空间 */
    }
    
    .logo {
        max-width: 200px;
    }
    
    .sidebar {
        position: fixed;
        top: 70px; /* 避免遮挡顶部logo */
        left: 0;
        height: calc(100% - 70px);
        width: 60%; /* 降低宽度 */
        max-width: 200px; /* 降低最大宽度 */
        background-color: rgba(255, 255, 255, 0.9); /* 增加透明度 */
        z-index: 1001;
        transform: translateX(-100%);
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        padding: 20px;
        overflow-y: auto;
        border-radius: 0 5px 5px 0;
        transition: transform 0.3s ease;
        backdrop-filter: blur(5px); /* 添加模糊效果 */
    }
    
    .dark-mode .sidebar {
        background-color: rgba(34, 34, 34, 0.9); /* 深色模式的透明度 */
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-toggle,
    .sidebar-close {
        display: block;
    }
    
    .sidebar-backdrop.active {
        display: block;
    }
    
    .search-input-container {
        width: 80%;
    }
} 