/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

.site-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.site-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 导航栏样式 */
.nav {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.nav-item {
    padding: 1rem 1.5rem;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.nav-item:hover {
    color: #667eea;
    border-bottom-color: #667eea;
}

.nav-item.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

/* 主内容区样式 */
.main-content {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
    min-height: calc(100vh - 300px);
}

/* 卡片样式 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.card {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.card-title {
    font-size: 1.5rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.card-description {
    color: #666;
    line-height: 1.8;
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* 欢迎区域样式 */
.welcome-section {
    text-align: center;
    padding: 3rem 0;
}

.welcome-title {
    font-size: 2rem;
    color: #333;
    margin-bottom: 1rem;
}

.welcome-text {
    font-size: 1.1rem;
    color: #666;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
}

/* 底部样式 */
.footer {
    background-color: #333;
    color: #fff;
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

.footer-beian {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #555;
}

.footer-beian a {
    color: #aaa;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-beian a:hover {
    color: #fff;
    text-decoration: underline;
}

.beian-number {
    display: block;
    margin-bottom: 0.5rem;
}

.beian-link {
    display: block;
    font-size: 0.9rem;
}

/* 页面标题样式 */
.page-title {
    font-size: 2rem;
    color: #333;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid #667eea;
}

/* 内容区块样式 */
.content-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.content-section h2 {
    color: #667eea;
    margin-bottom: 1rem;
}

.content-section p {
    color: #666;
    line-height: 1.8;
    margin-bottom: 1rem;
}

/* 示例展示区域 */
.demo-area {
    background: #f9f9f9;
    border: 2px dashed #667eea;
    padding: 2rem;
    margin: 1rem 0;
    border-radius: 8px;
}

.demo-label {
    font-weight: 600;
    color: #667eea;
    margin-bottom: 0.5rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .site-title {
        font-size: 1.8rem;
    }

    .nav-content {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .nav-item {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: 0 1rem;
    }
}

/* 统计区域样式 */
.stats-section {
    margin: 3rem 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #666;
    font-size: 1rem;
}

/* 通用区块样式 */
.section {
    margin: 3rem 0;
}

.section-title {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 1.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 3px solid #667eea;
}

/* 卡片标签样式 */
.card-tags {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background: #f0f0f0;
    color: #667eea;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* 学习路线样式 */
.learning-path {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.path-item {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid #eee;
}

.path-item:last-child {
    border-bottom: none;
}

.path-step {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
}

.path-content h3 {
    color: #667eea;
    margin-bottom: 0.5rem;
}

.path-content p {
    color: #666;
    margin-bottom: 0.8rem;
    line-height: 1.6;
}

.path-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.path-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* 更新列表样式 */
.update-list {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.update-item {
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.update-item:last-child {
    border-bottom: none;
}

.update-date {
    color: #999;
    font-size: 0.9rem;
    white-space: nowrap;
    min-width: 100px;
}

.update-text {
    color: #666;
    flex: 1;
}

.update-tag {
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.update-tag.new {
    background: #48bb78;
    color: white;
}

/* 子导航样式 */
.sub-nav {
    background: white;
    padding: 1rem 0;
    margin-bottom: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.sub-nav-content {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    padding: 0 1rem;
}

.sub-nav-item {
    padding: 0.6rem 1.2rem;
    background: #f0f0f0;
    color: #666;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.sub-nav-item:hover,
.sub-nav-item.active {
    background: #667eea;
    color: white;
}

/* 代码块样式 */
.code-block {
    background: #2d3748;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1rem 0;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    position: relative;
}

.code-block .comment {
    color: #68d391;
}

.code-block .property {
    color: #63b3ed;
}

.code-block .value {
    color: #f6ad55;
}

.code-block .selector {
    color: #f687b3;
}

.copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #4a5568;
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.3s ease;
}

.copy-btn:hover {
    background: #667eea;
}

/* 技巧卡片样式 */
.technique-card {
    background: #f9f9f9;
    border-left: 4px solid #667eea;
    padding: 1.5rem;
    margin: 1rem 0;
    border-radius: 0 8px 8px 0;
}

.technique-card h3 {
    color: #667eea;
    margin-bottom: 0.5rem;
}

.technique-card p {
    color: #666;
    line-height: 1.8;
    margin-bottom: 0.5rem;
}

/* 工具卡片样式 */
.tool-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}

.tool-card:hover {
    transform: translateX(5px);
}

.tool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.tool-name {
    font-size: 1.3rem;
    color: #667eea;
    font-weight: 600;
}

.tool-category {
    background: #f0f0f0;
    color: #667eea;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
}

.tool-description {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.tool-features {
    list-style: none;
    margin-bottom: 1rem;
}

.tool-features li {
    color: #666;
    padding: 0.3rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.tool-features li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #48bb78;
    font-weight: 600;
}

.tool-link {
    display: inline-block;
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.tool-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* 案例卡片样式 */
.case-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
}

.case-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
}

.case-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.case-difficulty {
    display: inline-block;
    background: rgba(255, 255, 255, 0.3);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
}

.case-content {
    padding: 2rem;
}

.case-steps {
    counter-reset: step;
    list-style: none;
}

.case-steps li {
    counter-increment: step;
    padding: 1rem 0 1rem 3rem;
    position: relative;
    border-left: 2px solid #eee;
    margin-left: 1rem;
}

.case-steps li:before {
    content: counter(step);
    position: absolute;
    left: -1rem;
    width: 2rem;
    height: 2rem;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.case-steps li:last-child {
    border-left: 2px solid transparent;
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    display: none;
    z-index: 999;
}

.back-to-top:hover {
    background: #764ba2;
    transform: translateY(-3px);
}

.back-to-top.show {
    display: block;
}

/* 进度条 */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    z-index: 1000;
    transition: width 0.1s ease;
}

/* 主题切换按钮 */
.theme-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-size: 1.2rem;
    z-index: 101;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

/* 暗色主题 */
body.dark-theme {
    background-color: #1a202c;
    color: #e2e8f0;
}

body.dark-theme .header {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
}

body.dark-theme .nav,
body.dark-theme .sub-nav {
    background-color: #2d3748;
}

body.dark-theme .nav-item,
body.dark-theme .sub-nav-item {
    color: #e2e8f0;
}

body.dark-theme .nav-item:hover,
body.dark-theme .sub-nav-item:hover {
    color: #667eea;
}

body.dark-theme .card,
body.dark-theme .stat-card,
body.dark-theme .content-section,
body.dark-theme .tool-card,
body.dark-theme .case-content,
body.dark-theme .learning-path,
body.dark-theme .update-list {
    background: #2d3748;
}

body.dark-theme .card-title,
body.dark-theme .section-title,
body.dark-theme .page-title,
body.dark-theme .tool-name {
    color: #e2e8f0;
}

body.dark-theme .card-description,
body.dark-theme .welcome-text,
body.dark-theme .tool-description,
body.dark-theme .update-text {
    color: #a0aec0;
}

body.dark-theme .tag,
body.dark-theme .tool-category {
    background: #4a5568;
}

body.dark-theme .technique-card {
    background: #2d3748;
}

body.dark-theme .demo-area {
    background: #1a202c;
}

body.dark-theme .theme-toggle {
    background: #2d3748;
    color: #e2e8f0;
}

/* 响应式扩展 */
@media (max-width: 768px) {
    .site-title {
        font-size: 1.8rem;
    }

    .nav-content {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .nav-item {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: 0 1rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .path-item {
        flex-direction: column;
        gap: 1rem;
    }

    .update-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .tool-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* 工具类 */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }