/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    position: relative;
    overflow-x: hidden; /* 防止水平滚动条 */
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    width: 100%;
}

a {
    text-decoration: none;
    color: #0066cc;
}

a:hover {
    text-decoration: underline;
}

/* 头部样式 */
header {
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px 0;
    margin-bottom: 30px;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    color: #2c3e50;
    font-size: 24px;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    color: #555;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

nav ul li a:hover, nav ul li a.active {
    color: #0066cc;
    background-color: #f0f7ff;
    text-decoration: none;
}

/* 主要内容区域 */
main {
    flex: 1;
    padding-bottom: 50px;
}

section {
    margin-bottom: 40px;
    background-color: #fff;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* 问题卡片样式 */
.problem-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

.problem-card {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.problem-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.problem-card h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.problem-card p {
    color: #666;
    margin-bottom: 15px;
    font-size: 14px;
}

.difficulty {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 10px;
}

.easy {
    background-color: #e7f5e7;
    color: #28a745;
}

.medium {
    background-color: #fff3cd;
    color: #ffc107;
}

.hard {
    background-color: #f8d7da;
    color: #dc3545;
}

.btn {
    display: inline-block;
    background-color: #0066cc;
    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.btn:hover {
    background-color: #0056b3;
    text-decoration: none;
}

/* 分类列表样式 */
.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.category-item {
    background-color: #f0f7ff;
    color: #0066cc;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.category-item:hover {
    background-color: #0066cc;
    color: white;
    text-decoration: none;
}

/* 页脚样式 */
footer {
    background-color: #2c3e50;
    color: #fff;
    padding: 20px 0;
    text-align: center;
    width: 100%;
    margin-top: auto; /* 确保页脚在内容较少时也位于底部 */
}

footer a {
    color: #8be9fd;
}

/* 修复底部白边问题 */
body::after {
    content: "";
    display: block;
    height: 0;
    clear: both;
}

/* 确保页面内容填满整个视口高度 */
#app, .page-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 确保页脚紧贴底部 */
footer {
    margin-top: auto;
    padding-bottom: 0;
}

/* 移除可能导致白边的元素样式 */
html, body {
    overflow-x: hidden;
}

/* 代码示例样式 */
pre, code {
    font-family: 'Fira Code', 'Consolas', 'Courier New', monospace;
    font-size: 15px;
    line-height: 1.5;
    background-color: #282c34;
    color: #abb2bf;
    border-radius: 8px;
    overflow-x: auto;
}

pre {
    padding: 0;
    margin: 20px 0;
}

code {
    padding: 20px;
    display: block;
    white-space: pre;
    tab-size: 4;
    -moz-tab-size: 4;
    -o-tab-size: 4;
    -webkit-tab-size: 4;
}

/* LeetCode示例样式 */
.leetcode-example {
    background-color: #282c34;
    color: #abb2bf;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    font-family: 'Fira Code', 'Consolas', 'Courier New', monospace;
    overflow-x: auto;
}

.leetcode-example .input,
.leetcode-example .output,
.leetcode-example .explanation {
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
}

.leetcode-example .label {
    font-weight: bold;
    color: #e5c07b;
    min-width: 60px;
    display: inline-block;
    margin-right: 10px;
}

.leetcode-example .content {
    white-space: pre;
    font-family: 'Fira Code', 'Consolas', 'Courier New', monospace;
}

/* 响应式设计 */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
    }
    
    nav ul {
        margin-top: 15px;
    }
    
    .problem-cards {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .leetcode-example .input,
    .leetcode-example .output,
    .leetcode-example .explanation {
        flex-direction: column;
    }
    
    .leetcode-example .label {
        margin-bottom: 5px;
    }
}

/* 添加更大屏幕的响应式设计 */
@media (min-width: 1600px) {
    .container {
        max-width: 1600px;
    }
    
    .problem-cards {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
} 