
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #0D1B2A 70%, #1B263B 25%, #FF6B35 5%);
    color: #A9B1C0;
    line-height: 1.6;
    overflow-x: hidden; /* 避免横向滚动条 */
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(13, 27, 42, 0.9);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    transition: background-color 0.3s ease;
}

.navbar.scrolled {
    background-color: #0D1B2A;
}

.navbar a {
    color: #A9B1C0;
    text-decoration: none;
    margin: 0 15px;
    transition: color 0.3s ease;
}

.navbar a:hover {
    color: #1B98E0;
}

/* 搜索栏样式 */
.search-bar {
    position: relative;
}

.search-bar input {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    outline: none;
}

.search-bar button {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    background: #1B98E0;
    border: none;
    padding: 0 10px;
    cursor: pointer;
    color: #fff;
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.search-bar button:hover {
    background: #FF6B35;
    transform: scale(1.05);
}

/* 主要容器样式 */
.container {
    max-width: 1200px;
    margin: 100px auto 50px auto; /* 避免导航栏遮挡 */
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* 文章样式 */
article {
    background: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    color: #A9B1C0;
}

article h2, article h3 {
    color: #fff;
    margin-bottom: 15px;
}

article h2 {
    font-size: 2.5em;
}

article h3 {
    font-size: 1.8em;
}

article p {
    margin-bottom: 20px;
}

article pre {
    background: #0D1B2A;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 20px;
}

article code {
    color: #1B98E0;
    font-family: 'Courier New', Courier, monospace;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

th, td {
    border: 1px solid #A9B1C0;
    padding: 12px 15px;
    text-align: left;
}

tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.05);
}

th {
    background-color: #1B98E0;
    color: #fff;
}

/* 图片样式 */
img.decorative {
    width: 100%;
    max-width: 320px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

img.decorative:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

/* 提示信息样式 */
.prompt-message {
    text-align: center;
    font-size: 1.2em;
    color: #FF6B35;
    margin: 20px 0;
}

/* 章节导航样式 */
.chapter-nav {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
}

.chapter-nav a {
    background: #1B98E0;
    color: #fff;
    padding: 10px 15px;
    margin: 5px 0;
    border-radius: 5px;
    text-decoration: none;
    transition: background 0.3s ease, transform 0.3s ease;
}

.chapter-nav a:hover {
    background: #FF6B35;
    transform: translateX(5px);
}

/* 折叠菜单样式 */
.collapsible {
    background-color: #0D1B2A;
    color: #A9B1C0;
    cursor: pointer;
    padding: 10px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 1em;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.collapsible:hover {
    background-color: #1B98E0;
}

.content {
    padding: 0 18px;
    display: none;
    overflow: hidden;
    background-color: #0D1B2A;
    border-radius: 5px;
    margin-bottom: 10px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .chapter-nav {
        display: none;
    }

    .container {
        grid-template-columns: 1fr;
        padding: 10px;
    }

    .search-bar {
        width: 100%;
        margin-top: 10px;
    }
}

/* CSS3代码示例样式 */
.code-example {
    background: #0D1B2A;
    padding: 20px;
    border-radius: 8px;
    position: relative;
    overflow: auto;
}

.code-example::before {
    content: "CSS3代码示例";
    position: absolute;
    top: -20px;
    left: 0;
    background: #FF6B35;
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px 5px 0 0;
    font-size: 0.9em;
}

.code-example code {
    display: block;
    color: #1B98E0;
    font-family: 'Courier New', Courier, monospace;
}

