
/* 基础样式定义 */
:root {
    --primary-color: #4A90E2;
    --secondary-color: #6574CD;
    --background-color: #F8F9FA;
    --text-color: #212529;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-blur: blur(10px);
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition-speed: 0.3s;
}

body {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
    overflow-x: hidden;
}

/* 全局布局设置 */
.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 1440px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

.header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
}

.header h1 {
    font-size: 2rem;
    font-weight: bold;
    letter-spacing: 1px;
}

.navbar {
    display: flex;
    gap: 20px;
}

.navbar a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: bold;
    transition: color var(--transition-speed) ease;
}

.navbar a:hover {
    color: var(--secondary-color);
}

/* 卡片式内容设计 */
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    width: 100%;
}

.card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    padding: 20px;
    transition: transform var(--transition-speed) ease;
}

.card:hover {
    transform: scale(1.05);
}

.card img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

.card h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.card p {
    margin: 0;
}

/* 示例文章样式 */
.article-section {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    padding: 20px;
    margin: 20px 0;
    width: 100%;
}

.article-section h2 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.article-section pre {
    background: rgba(0, 0, 0, 0.1);
    padding: 10px;
    border-radius: 5px;
    overflow-x: auto;
}

.article-section code {
    font-family: 'Courier New', Courier, monospace;
    color: var(--primary-color);
}

.article-section table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.article-section th,
.article-section td {
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 10px;
    text-align: left;
}

.article-section th {
    background: rgba(0, 0, 0, 0.05);
}

/* 动画与交互效果 */
.button {
    background: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background var(--transition-speed) ease;
}

.button:hover {
    background: #3C7DCB;
}

.switch {
    width: 50px;
    height: 25px;
    background: var(--secondary-color);
    border-radius: 15px;
    position: relative;
    cursor: pointer;
    transition: background var(--transition-speed) ease;
}

.switch::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 21px;
    height: 21px;
    background: white;
    border-radius: 50%;
    transition: transform var(--transition-speed) ease;
}

.switch.active::before {
    transform: translateX(25px);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.5rem;
    }

    .card-container {
        grid-template-columns: 1fr;
    }

    .navbar {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    .card {
        padding: 15px;
    }

    .article-section {
        padding: 15px;
    }
}

