/* bootstrap-learning.css 当发网Bootstrap学习频道 */

/* ===== CSS 变量定义 ===== */
:root {
    --primary-color: #82255E;
    --primary-dark: #6a1e4c;
    --secondary-color: #B83B6A;
    --accent-color: #D1C39D;
    --dark-color: #2A101B;
    --light-color: #D9D0CA;
    --white: #FFFFFF;
    --gray-light: #f5f5f5;
    --gray-medium: #e0e0e0;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --font-family: "微软雅黑", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --border-radius: 10px;
    --transition: all 0.3s ease;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 15px rgba(0, 0, 0, 0.15);
}

/* ===== 基础重置和布局 ===== */
body,
h1,
h2,
h3,
h4,
p,
ul,
li,
article,
header,
footer,
main,
nav,
div {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: #333;
    background-color: var(--gray-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    margin: 0 auto;
    padding: 0 15px;
}

/* ===== 头部和导航模块 ===== */
header {
    background-color: var(--primary-color);
    color: var(--accent-color);
    text-align: center;
    padding: 1.5rem 1rem;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.header-content {
    position: relative;
    z-index: 1;
}

header h1 {
    font-size: 1.8rem;
    font-weight: 900;
    margin: 0 0 0.5rem 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

header p {
    font-size: 1rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.header-links,
.footer-nav-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.header-links a,
.footer-nav-links a {
    color: var(--accent-color);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 1px solid var(--accent-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-size: 0.9rem;
}

.header-links a:hover,
.footer-nav-links a:hover {
    background-color: var(--accent-color);
    color: var(--primary-color);
}

.main-nav {
    background-color: var(--dark-color);
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.nav-menu {
    display: flex;
    list-style: none;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0;
    margin: 0;
    transition: var(--transition);
}

.nav-menu li {
    margin: 0;
}

.nav-menu a {
    display: block;
    color: var(--light-color);
    text-decoration: none;
    padding: 0.8rem 1.2rem;
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.95rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-menu a:hover,
.nav-menu a.active {
    background-color: var(--primary-color);
    color: var(--accent-color);
}

.hamburger {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    margin-left: auto;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    transition: var(--transition);
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--accent-color);
    margin: 3px 0;
    transition: var(--transition);
    border-radius: 2px;
}

/* ===== 主内容区域模块 ===== */
main {
    background-color: var(--secondary-color);
    padding: 1.5rem 1rem;
    flex-grow: 1;
}

.hero-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 3rem;
}

.hero-content {
    background-color: var(--accent-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.hero-content h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.hero-content p {
    color: var(--dark-color);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--dark-color);
}

.hero-visual {
    display: flex;
    justify-content: center;
}

.code-preview {
    background-color: var(--dark-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 500px;
}

.code-header {
    background-color: #1a1a1a;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.code-title {
    color: var(--light-color);
    font-size: 0.9rem;
    font-weight: 500;
}

.code-content {
    padding: 1rem;
}

.code-content pre {
    margin: 0;
    overflow-x: auto;
}

.code-content code {
    display: block;
    color: var(--light-color);
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre;
}

/* ===== 学习路径模块 ===== */
.learning-path {
    margin-bottom: 3rem;
}

.learning-path h2 {
    color: var(--accent-color);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.8rem;
}

.path-steps {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.path-step {
    background-color: var(--accent-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: var(--transition);
}

.path-step:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.step-number {
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    color: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 1rem;
}

.path-step h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.path-step p {
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.step-link {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--accent-color);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.step-link:hover {
    background-color: var(--primary-dark);
}

/* ===== 特色卡片模块 ===== */
.featured-cards {
    margin-bottom: 3rem;
}

.featured-cards h2 {
    color: var(--accent-color);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.8rem;
}

.cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.featured-card {
    background-color: var(--accent-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.featured-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.card-icon {
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.featured-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.featured-card p {
    color: var(--dark-color);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.card-link {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--accent-color);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.card-link:hover {
    background-color: var(--primary-dark);
}

/* ===== 快速链接模块 ===== */
.quick-links {
    margin-bottom: 2rem;
}

.quick-links h2 {
    color: var(--accent-color);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.8rem;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.quick-link {
    background-color: var(--accent-color);
    padding: 1rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.quick-link:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.link-title {
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.link-desc {
    color: var(--dark-color);
    font-size: 0.9rem;
}

/* ===== 内容区域模块 ===== */
.content-section {
    background-color: var(--accent-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.content-section h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.6rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.content-section h3 {
    color: var(--primary-dark);
    margin: 1.5rem 0 1rem 0;
    font-size: 1.3rem;
}

.content-section p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.content-section ul,
.content-section ol {
    margin: 0 0 1rem 1.5rem;
}

.content-section li {
    margin-bottom: 0.5rem;
}

.code-example {
    background-color: var(--dark-color);
    color: var(--light-color);
    border-radius: var(--border-radius);
    margin: 1rem 0;
    overflow: hidden;
}

.code-content {
    padding: 1rem;
    overflow-x: auto;
}

.code-content pre {
    margin: 0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.code-content code {
    display: block;
    white-space: pre;
}

.line-number {
    display: inline-block;
    width: 2.5em;
    padding-right: 1em;
    margin-right: 1em;
    color: #6c757d;
    text-align: right;
    border-right: 1px solid #444;
    user-select: none;
}

.example-preview {
    background-color: var(--white);
    border: 1px solid var(--gray-medium);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
}

.tip-box {
    background-color: #e8f4fd;
    border-left: 4px solid #2196F3;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.warning-box {
    background-color: #ffebee;
    border-left: 4px solid #f44336;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.success-box {
    background-color: #d4edda;
    border-left: 4px solid var(--success-color);
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.info-box {
    background-color: #d1ecf1;
    border-left: 4px solid var(--info-color);
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

/* ===== 表格和列表模块 ===== */
.syntax-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background-color: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.syntax-table th,
.syntax-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-medium);
}

.syntax-table th {
    background-color: var(--primary-color);
    color: var(--accent-color);
    font-weight: 600;
}

.syntax-table tr:last-child td {
    border-bottom: none;
}

.syntax-table tr:hover {
    background-color: var(--gray-light);
}

.browser-support {
    background-color: var(--white);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin: 1rem 0;
    border-left: 4px solid #4CAF50;
}

.support-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.support-browser {
    width: 100px;
    font-weight: bold;
}

.support-version {
    flex: 1;
}

.tag-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
    margin: 1rem 0;
}

.tag-item {
    background-color: var(--white);
    padding: 0.5rem;
    border-radius: 4px;
    border-left: 3px solid var(--primary-color);
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
}

/* ===== 表单模块 ===== */
.form-preview {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-medium);
    margin: 1rem 0;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--gray-medium);
    border-radius: 4px;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(130, 37, 94, 0.2);
}

.example-image {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

/* ===== 交互演示模块 ===== */
.interactive-demo {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-medium);
    margin: 1rem 0;
}

.demo-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.demo-button {
    background-color: var(--primary-color);
    color: var(--accent-color);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.demo-button:hover {
    background-color: var(--primary-dark);
}

.demo-output {
    background-color: var(--gray-light);
    padding: 1rem;
    border-radius: var(--border-radius);
    min-height: 100px;
}

/* ===== Bootstrap特定样式模块 ===== */
.code-content .tag {
    color: #e06c75;
}

.code-content .attr {
    color: #d19a66;
}

.code-content .value {
    color: #98c379;
}

.code-content .comment {
    color: #5c6370;
}

.component-demo {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-medium);
    margin: 1rem 0;
}

.component-preview {
    padding: 1rem;
    border: 1px dashed var(--gray-medium);
    border-radius: 4px;
    margin-bottom: 1rem;
}

.bootstrap-class {
    background-color: var(--primary-color);
    color: var(--accent-color);
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
}

.class-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.5rem;
    margin: 1rem 0;
}

.class-item {
    background-color: var(--white);
    padding: 0.75rem;
    border-radius: 4px;
    border-left: 3px solid var(--info-color);
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
}

.variable-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    margin: 1rem 0;
}

.variable-item {
    background-color: var(--white);
    padding: 0.75rem;
    border-radius: 4px;
    border-left: 3px solid var(--warning-color);
}

.variable-name {
    font-family: 'Courier New', monospace;
    color: var(--primary-color);
    font-weight: bold;
}

.variable-value {
    color: var(--dark-color);
    margin-left: 1rem;
}

/* ===== 功能组件模块 ===== */
.copy-code-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.copy-code-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.copy-code-btn.copied {
    background: #28a745;
}

.copy-code-btn svg {
    width: 14px;
    height: 14px;
}

.code-content.collapsed {
    max-height: 0;
    overflow: hidden;
}

.code-content {
    transition: max-height 0.3s ease-out;
}

.quick-nav.visible {
    opacity: 1;
    transform: translateY(0);
}

.quick-nav {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

/* ===== 搜索功能模块 ===== */
.search-box {
    margin: 20px 0;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    box-sizing: border-box;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--gray-medium);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-hover);
    z-index: 15;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.search-box {
    position: relative;
    z-index: 20;
}

.quick-nav {
    position: relative;
    z-index: 10;
    margin-top: 15px;
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.search-category-header {
    padding: 8px 15px;
    background-color: var(--primary-color);
    color: var(--accent-color);
    font-weight: bold;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--primary-dark);
}

.search-result-item {
    padding: 10px 15px;
    border-bottom: 1px solid var(--gray-light);
    cursor: pointer;
    transition: var(--transition);
    outline: none;
}

.search-result-item:hover,
.search-result-item:focus {
    background-color: var(--gray-light);
}

.search-result-title {
    font-weight: bold;
    margin-bottom: 4px;
    color: var(--primary-color);
}

.search-result-desc {
    font-size: 0.9rem;
    margin-bottom: 4px;
    color: var(--dark-color);
}

.search-result-meta {
    font-size: 0.8rem;
    color: var(--secondary-color);
}

.search-no-results {
    padding: 15px;
    text-align: center;
    color: var(--dark-color);
}

mark {
    background-color: #ffeb3b;
    color: #000;
    padding: 0 2px;
    border-radius: 2px;
}

.reference-category {
    margin-bottom: 2rem;
}

.reference-section {
    background: var(--accent-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.quick-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}

.quick-nav a {
    background: var(--primary-color);
    color: var(--accent-color);
    padding: 8px 16px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.quick-nav a:hover {
    background: var(--primary-dark);
}

.tag-badge {
    display: inline-block;
    background: var(--dark-color);
    color: var(--light-color);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    margin-right: 5px;
}

.compatibility-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.compatibility-table th,
.compatibility-table td {
    padding: 8px;
    text-align: center;
    border: 1px solid var(--gray-medium);
}

.compatibility-table th {
    background: var(--primary-color);
    color: var(--accent-color);
}

.supported {
    background: #d4edda;
    color: #155724;
}

.partial {
    background: #fff3cd;
    color: #856404;
}

.unsupported {
    background: #f8d7da;
    color: #721c24;
}

/* ===== 底部导航模块 ===== */
.footer-nav {
    background-color: var(--primary-color);
    padding: 1rem 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

footer {
    background-color: var(--dark-color);
    color: var(--light-color);
    text-align: center;
    padding: 1.25rem 1rem;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

footer p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

footer a {
    color: var(--light-color);
    text-decoration: none;
    transition: var(--transition);
}

footer a:hover {
    text-decoration: underline;
    color: var(--accent-color);
}

/* ===== 滚动进度条样式 ===== */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    z-index: 1000;
    transition: width 0.1s ease;
    pointer-events: none;
}

/* ===== 搜索相关样式 ===== */
.search-loading {
    padding: 15px;
    text-align: center;
    color: var(--dark-color);
}

.search-history-item,
.search-popular-item {
    padding: 10px 15px;
    border-bottom: 1px solid var(--gray-light);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.search-history-item:hover,
.search-popular-item:hover {
    background-color: var(--gray-light);
}

.search-history-icon {
    margin-right: 8px;
    color: var(--secondary-color);
}

.search-history-remove {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-history-remove:hover {
    color: var(--danger-color);
}

.search-popular-count {
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    margin-right: 8px;
}

.search-stats {
    padding: 8px 15px;
    font-size: 0.9rem;
    color: var(--dark-color);
    background-color: var(--gray-light);
    border-bottom: 1px solid var(--gray-medium);
}

.search-result-more {
    padding: 10px 15px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--dark-color);
    border-top: 1px solid var(--gray-light);
}

.show-all-results {
    color: var(--primary-color);
    text-decoration: none;
}

.show-all-results:hover {
    text-decoration: underline;
}

.touch-active {
    background-color: var(--gray-medium) !important;
}

/* ===== 表格响应式包装 ===== */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ===== 懒加载图片样式 ===== */
img.lazy {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img.lazy.loaded {
    opacity: 1;
}

/* ===== 组件演示悬停效果 ===== */
.component-demo.demo-hover {
    box-shadow: 0 0 0 2px var(--primary-color);
    transition: box-shadow 0.3s ease;
}

/* ===== 表单验证样式 ===== */
.needs-validation .form-control:invalid {
    border-color: var(--danger-color);
}

.needs-validation .form-control:valid {
    border-color: var(--success-color);
}

.was-validated .form-control:invalid {
    border-color: var(--danger-color);
}

.was-validated .form-control:valid {
    border-color: var(--success-color);
}

/* ===== 自定义样式模块 ===== */
.bg-custom-primary {
    background-color: var(--primary-color) !important;
}

.bg-custom-secondary {
    background-color: var(--secondary-color) !important;
}

.bg-custom-accent {
    background-color: var(--accent-color) !important;
    color: var(--dark-color) !important;
}

/* ===== 响应式设计模块 ===== */

/* 小屏幕设备 (576px 以上) */
@media (min-width: 576px) {
    .container {
        max-width: 540px;
        padding: 0 15px;
    }

    header {
        padding: 1.75rem 1rem;
    }

    header h1 {
        font-size: 2rem;
    }

    header p {
        font-size: 1.05rem;
    }

    main {
        padding: 1.75rem 1rem;
    }

    .hero-content {
        padding: 2.5rem;
    }

    .hero-content h2 {
        font-size: 2rem;
    }

    .path-step {
        padding: 2rem;
    }

    .featured-card {
        padding: 2rem;
    }

    .quick-link {
        padding: 1.25rem;
    }

    .content-section {
        padding: 1.75rem;
    }

    footer {
        padding: 1.5rem 1rem;
    }
}

/* 平板设备 (768px 以上) */
@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }

    header {
        padding: 2rem 1rem;
    }

    header h1 {
        font-size: 2.25rem;
    }

    header p {
        font-size: 1.1rem;
    }

    main {
        padding: 2rem 1rem;
    }

    .hero-section {
        flex-direction: row;
        align-items: center;
    }

    .hero-content {
        flex: 1;
        text-align: left;
    }

    .hero-stats {
        justify-content: flex-start;
    }

    .hero-visual {
        flex: 1;
        justify-content: flex-end;
    }

    .path-steps {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .path-step {
        flex: 1;
        min-width: 200px;
    }

    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .links-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .content-section {
        padding: 2rem;
    }

    .tag-list {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .class-list {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

/* 桌面设备 (992px 以上) */
@media (min-width: 992px) {
    .container {
        max-width: 960px;
        padding: 0 15px;
    }

    header {
        padding: 2.5rem 1rem;
    }

    header h1 {
        font-size: 2.5rem;
    }

    main {
        padding: 2.5rem 1rem;
    }

    .hamburger {
        display: none;
    }

    .nav-menu {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        gap: 0;
    }

    .nav-menu a {
        padding: 0.8rem 0.6rem;
        font-size: 0.9rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .hero-content {
        padding: 3rem;
    }

    .hero-content h2 {
        font-size: 2.2rem;
    }

    .path-step {
        padding: 2.5rem 1.5rem;
    }

    .featured-card {
        padding: 2.5rem;
    }

    .quick-link {
        padding: 1.5rem;
    }

    .content-section {
        padding: 2.25rem;
    }

    .links-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 大屏幕设备 (1200px 以上) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }

    header h1 {
        font-size: 2.8rem;
    }

    .hero-content h2 {
        font-size: 2.5rem;
    }

    .content-section {
        padding: 2.5rem;
    }

    .nav-menu a {
        padding: 0.8rem 0.8rem;
    }
}

/* 超大屏幕设备 (1400px 以上) */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }

    header {
        padding: 3rem 1rem;
    }

    .hero-content {
        padding: 4rem;
    }

    .content-section {
        padding: 3rem;
    }
}

/* 移动设备导航菜单 (991px 以下) */
@media (max-width: 991px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--dark-color);
        flex-direction: column;
        transform: translateY(-10px);
        opacity: 0;
        visibility: hidden;
        z-index: 99;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
        display: flex;
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-menu li {
        width: 100%;
        text-align: center;
    }

    .nav-menu a {
        padding: 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .hamburger.active {
        transform: translateY(-50%) rotate(90deg);
    }

    .syntax-table {
        display: block;
        overflow-x: auto;
    }

    .tag-list {
        grid-template-columns: 1fr;
    }

    .class-list {
        grid-template-columns: 1fr;
    }
}

/* 移动设备搜索优化 */
@media (max-width: 768px) {
    .search-result-title {
        font-size: 0.9rem;
    }

    .search-result-desc {
        font-size: 0.8rem;
    }
}

/* 可访问性优化 */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .path-step:hover,
    .featured-card:hover,
    .quick-link:hover {
        transform: none;
    }

    .hamburger span {
        transition: none;
    }

    .reading-progress {
        transition: none;
    }
}

@media (prefers-contrast: more) {
    :root {
        --primary-color: #000000;
        --secondary-color: #333333;
        --accent-color: #ffffff;
        --dark-color: #000000;
        --light-color: #ffffff;
        --gray-light: #ffffff;
    }

    .path-step,
    .featured-card,
    .quick-link {
        border: 2px solid #000;
    }
}

/* 打印样式优化 */
@media print {
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    .path-step,
    .featured-card,
    .quick-link {
        border: 1px solid #000;
        page-break-inside: avoid;
        margin-bottom: 1rem;
    }

    a[href]:after {
        content: " (" attr(href) ")";
    }

    header,
    footer {
        background: white !important;
        color: black !important;
    }

    .hamburger,
    .nav-menu {
        display: none !important;
    }

    .code-example {
        background: white !important;
        color: black !important;
        border: 1px solid #000;
    }

    .code-content code {
        color: black !important;
    }

    .reading-progress {
        display: none !important;
    }
}