* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #151b2e;
    --bg-tertiary: #1e2536;
    --accent-primary: #00d4aa;
    --accent-secondary: #0096ff;
    --accent-warning: #ff9500;
    --text-primary: #e8eaed;
    --text-secondary: #9aa0a6;
    --text-dim: #5f6368;
    --border-color: #2d3548;
    --hover-bg: #252d42;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: 240px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 24px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.logo {
    padding: 0 24px 24px;
    border-bottom: 1px solid var(--border-color);
}

.logo h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--accent-primary);
    line-height: 1.4;
}

.nav-section {
    margin-bottom: 8px;
}

.nav-category {
    padding: 8px 24px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 16px;
}

.nav-menu {
    list-style: none;
    padding: 0;
}

.nav-item {
    padding: 12px 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.nav-item:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--hover-bg);
    color: var(--accent-primary);
    border-left: 3px solid var(--accent-primary);
}

.nav-item .icon {
    font-size: 18px;
}

.arch-nav-item {
    position: relative;
}

.arch-nav-item .icon {
    position: relative;
    width: 18px;
    height: 22px;
    flex: 0 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
}

.arch-nav-item .icon::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -15px;
    bottom: -15px;
    width: 2px;
    transform: translateX(-50%);
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(255, 255, 255, 0.12) 14%,
        rgba(255, 255, 255, 0.12) 86%,
        transparent 100%
    );
}

.arch-nav-item--start .icon::before {
    top: 50%;
}

.arch-nav-item--end .icon::before {
    bottom: 50%;
}

.arch-nav-item .icon::after {
    content: "";
    position: relative;
    z-index: 1;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--nav-accent);
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 0 0 4px var(--nav-accent-soft);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.arch-nav-item--compare .icon::after {
    width: 12px;
    height: 12px;
    border-radius: 4px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.45) 0 18%, transparent 18% 100%),
        linear-gradient(135deg, var(--nav-accent), rgba(255, 255, 255, 0.18));
    box-shadow: 0 0 0 4px var(--nav-accent-soft);
}

.arch-nav-item.active {
    color: var(--nav-accent);
    border-left-color: var(--nav-accent);
}

.arch-nav-item:hover .icon::after,
.arch-nav-item.active .icon::after {
    transform: scale(1.08);
    box-shadow: 0 0 0 5px var(--nav-accent-soft), 0 0 18px var(--nav-accent-soft);
}

.nav-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.nav-item.disabled:hover {
    background: transparent;
    color: var(--text-secondary);
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: auto;
    margin-right: auto;
    padding: 32px 48px;
    padding-left: calc(240px + 48px);
    padding-right: calc(240px + 48px);
    max-width: calc(1600px + 240px + 240px);
    overflow-x: hidden;
}

@media (max-width: 1200px) {
    .main-content {
        padding-right: 48px;
    }
}

/* 内容区块 */
.content-section {
    display: none;
}

.content-section.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 24px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subsection-title {
    font-size: 24px;
    font-weight: 600;
    margin: 32px 0 16px;
    color: var(--text-primary);
}

/* 总览区 */
.intro-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
}

.intro-box p {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 24px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 24px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
}

/* 概念卡片 */
.concept-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.concept-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    transition: all 0.2s;
}

.concept-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.concept-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: 8px;
}

.concept-card p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* 图表容器 */
.chart-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
    min-height: 400px;
}

/* 格式卡片 */
.format-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.format-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    transition: all 0.2s;
    cursor: pointer;
}

.format-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.format-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.format-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.format-category {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 12px;
    background: var(--bg-tertiary);
    color: var(--accent-primary);
}

.format-bits {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.format-bits span {
    background: var(--bg-tertiary);
    padding: 4px 8px;
    border-radius: 4px;
}

/* 位结构预览 */
.bit-preview {
    display: flex;
    height: 32px;
    margin-bottom: 12px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.bit-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: #0a0e1a;
    cursor: help;
    transition: opacity 0.2s;
}

.bit-segment:hover {
    opacity: 0.8;
}

.bit-segment.sign {
    background: #6dd5ed;
}

.bit-segment.exponent {
    background: #50fa7b;
}

.bit-segment.mantissa {
    background: #ff6b9d;
}

/* 可变位结构说明 */
.bit-preview-note {
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    border: 1px dashed var(--border-color);
}

.bit-preview-note span {
    font-size: 12px;
    color: var(--text-dim);
    font-style: italic;
}

/* 位结构可视化（模态框） */
.bit-visualization {
    margin: 16px 0;
    padding: 20px;
    background: var(--bg-primary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 160px;
}

.bit-visualization svg {
    display: block;
    max-width: 100%;
    height: auto;
}

.bit-visualization .bit-preview-note {
    margin: 0;
    height: 60px;
    font-size: 14px;
}

.format-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.5;
}

.format-usage {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.usage-tag {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.usage-tag.training {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.usage-tag.inference {
    border-color: var(--accent-secondary);
    color: var(--accent-secondary);
}

.usage-tag.hpc {
    border-color: var(--accent-warning);
    color: var(--accent-warning);
}

/* 硬件矩阵图例 */
.matrix-legend {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.legend-item .support-level {
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

/* 硬件矩阵 */
.matrix-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    overflow-x: auto;
    width: 100%;
    box-sizing: border-box;
}

.hardware-matrix {
    min-width: 600px;
    border-collapse: collapse;
    font-size: 13px;
}

.hardware-matrix th {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 600;
    padding: 12px;
    text-align: left;
    border: 1px solid var(--border-color);
    position: sticky;
    top: 0;
}

.hardware-matrix td {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.support-level {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.support-full {
    background: var(--accent-primary);
}

.support-partial {
    background: var(--accent-warning);
}

.support-none {
    background: var(--text-dim);
}

.support-native {
    background: var(--accent-primary);
    box-shadow: 0 0 8px var(--accent-primary);
}

/* 选型指南 */
.decision-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.decision-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    transition: all 0.2s;
}

.decision-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.decision-card h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.recommendation {
    font-size: 16px;
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: 8px;
}

.reason {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* 术语表 */
.glossary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.glossary-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
}

.glossary-item h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: 8px;
}

.glossary-item p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* 论文页面 */
.paper-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.paper-tag {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 12px;
    background: var(--bg-tertiary);
    color: var(--accent-primary);
    border: 1px solid var(--border-color);
}

.paper-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
}

.paper-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: 12px;
}

.paper-section p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.paper-io {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.paper-io-item {
    background: var(--bg-tertiary);
    border-radius: 6px;
    padding: 16px;
}

.paper-io-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.paper-io-item.input .paper-io-label {
    color: var(--accent-secondary);
}

.paper-io-item.output .paper-io-label {
    color: var(--accent-primary);
}

.paper-io-item ul {
    list-style: none;
    padding: 0;
}

.paper-io-item li {
    font-size: 14px;
    color: var(--text-secondary);
    padding: 4px 0;
    line-height: 1.5;
}

.paper-designs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 32px;
}

.paper-design-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
}

.paper-design-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.paper-design-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.paper-pipeline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.pipeline-stage {
    flex: 1;
    min-width: 120px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px;
}

.stage-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: 6px;
}

.stage-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.pipeline-arrow {
    color: var(--accent-primary);
    font-size: 18px;
    font-weight: bold;
}

.paper-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.paper-detail {
    background: var(--bg-tertiary);
    border-radius: 6px;
    padding: 10px;
    text-align: center;
}

.detail-label {
    display: block;
    font-size: 11px;
    color: var(--text-dim);
    margin-bottom: 4px;
}

.detail-value {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-primary);
}

.paper-note {
    font-size: 13px;
    color: var(--text-dim);
    font-style: italic;
    line-height: 1.5;
}

.paper-design-full {
    margin-bottom: 20px;
}

.paper-figure {
    margin: 16px 0;
    background: #fff;
    border-radius: 6px;
    padding: 8px;  /* 减少 padding */
    text-align: center;
    border: 1px solid var(--border-color);
    max-width: 100%;
    overflow-x: auto;  /* 允许水平滚动以防溢出 */
}

.paper-figure img {
    max-width: 100%;
    max-height: 80vh;
    height: auto;
    display: block;
    margin: 0 auto;
}

.paper-figure-caption {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 8px;
    font-style: italic;
}

@media (max-width: 768px) {
    .paper-designs {
        grid-template-columns: 1fr;
    }

    .paper-io {
        grid-template-columns: 1fr;
    }

    .paper-detail-grid {
        grid-template-columns: 1fr;
    }
}

/* 页面目录索引 - 固定右上角 */
.page-toc {
    position: fixed;
    right: 20px;
    top: 24px;
    width: 190px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 14px;
    z-index: 50;
    display: none;
    opacity: 0;
}

.page-toc.visible {
    display: block !important;
    opacity: 1 !important;
}

.page-toc h3 {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.page-toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.page-toc li {
    padding: 2px 0;
    border-left: 2px solid var(--border-color);
    padding-left: 8px;
}

.page-toc li:hover {
    border-left-color: var(--accent-primary);
}

.page-toc a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 11px;
    line-height: 1.4;
    display: block;
    transition: color 0.2s;
}

.page-toc a:hover {
    color: var(--accent-primary);
}

@media (max-width: 1200px) {
    .page-toc { display: none !important; }
}

/* GPU 架构页面 */
.arch-timeline {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

.arch-gen {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
}

.arch-gen-highlight {
    border-color: var(--accent-primary);
    border-width: 2px;
}

.arch-gen-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.arch-gen-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.arch-sm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.arch-sm-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px;
    text-align: center;
}

.arch-sm-item.highlight {
    border-color: var(--accent-primary);
}

.sm-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 2px;
}

.arch-sm-item.highlight .sm-value {
    color: #50fa7b;
}

.sm-label {
    display: block;
    font-size: 11px;
    color: var(--text-dim);
}

.arch-notes {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.arch-notes strong {
    color: var(--text-primary);
}

.arch-notes code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 13px;
    color: var(--accent-primary);
}

.arch-sub-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--accent-secondary);
    margin: 20px 0 12px;
}

/* 图文并排布局 */
.arch-content-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 16px;
    align-items: start;
}

.arch-text {
    min-width: 0;
}

.arch-figure {
    background: #fff;
    border-radius: 6px;
    padding: 8px;  /* 减少 padding */
    border: 1px solid var(--border-color);
    text-align: center;
    max-width: 100%;
    overflow-x: auto;  /* 允许水平滚动以防溢出 */
}

.arch-figure img {
    max-width: 100%;
    max-height: 80vh;
    height: auto;
    display: block;
    margin: 0 auto;
}

.arch-figure-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: var(--text-dim);
    font-size: 14px;
    text-align: center;
    border: 2px dashed var(--border-color);
    border-radius: 6px;
    background: var(--bg-tertiary);
    line-height: 1.6;
}

.arch-figure-half {
    background: #fff;
    border-radius: 6px;
    padding: 12px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.arch-figure-half img {
    max-width: 100%;
    height: auto;
}

@media (max-width: 900px) {
    .arch-content-row {
        grid-template-columns: 1fr;
    }

    .page-toc ul {
        columns: 1;
    }
}

.arch-list {
    list-style: none;
    padding: 0;
    margin: 8px 0;
}

.arch-list li {
    padding: 4px 0 4px 16px;
    position: relative;
}

.arch-list li::before {
    content: '>';
    position: absolute;
    left: 0;
    color: var(--accent-primary);
    font-weight: bold;
}

.arch-list-ol {
    padding: 0 0 0 24px;
    margin: 8px 0;
    list-style: decimal;
}

.arch-list-ol li {
    padding: 4px 0;
    color: var(--text-primary);
}

.arch-list-ol li::marker {
    color: var(--accent-primary);
    font-weight: bold;
}

.arch-sublist {
    padding: 0 0 0 20px;
    margin: 4px 0;
}

.arch-sublist li {
    padding: 3px 0;
    position: relative;
}

.arch-sublist li::before {
    content: none;
}

ul.arch-sublist {
    list-style: disc;
}

ul.arch-sublist li::marker {
    color: var(--accent-primary);
}

ol.arch-sublist {
    list-style: decimal;
}

ol.arch-sublist li::marker {
    color: var(--accent-primary);
    font-weight: bold;
}

.arch-notes a,
.arch-list a,
.arch-list-ol a,
.arch-sublist a {
    color: var(--accent-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.arch-notes a:visited,
.arch-list a:visited,
.arch-list-ol a:visited,
.arch-sublist a:visited {
    color: var(--accent-primary);
}

.arch-notes a:hover,
.arch-list a:hover,
.arch-list-ol a:hover,
.arch-sublist a:hover {
    opacity: 0.8;
}

/* 图片放大 Lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    cursor: zoom-out;
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 92vw;
    max-height: 92vh;
    border-radius: 4px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

/* 可点击放大的图片 */
.arch-figure img,
.arch-figure-half img,
.paper-figure img {
    cursor: zoom-in;
}

/* 全宽图片容器 */
.full-width-figure {
    width: 100%;
    margin: 16px 0;
    text-align: center;
    overflow-x: auto;
    padding: 8px 0;
}

.full-width-figure img {
    max-width: 100%;
    max-height: 80vh;
    height: auto;
    display: block;
    margin: 0 auto;
    cursor: zoom-in;  /* 添加放大光标 */
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 200px;
    }

    .main-content {
        margin-left: 200px;
        padding: 24px 16px;
    }

    .section-title {
        font-size: 24px;
    }

    .subsection-title {
        font-size: 20px;
    }

    .format-cards,
    .decision-cards,
    .glossary-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .sidebar {
        width: 60px;
    }

    .sidebar .nav-item span:not(.icon) {
        display: none;
    }

    .logo h2 {
        font-size: 14px;
    }

    .main-content {
        margin-left: 60px;
        padding: 16px;
    }

    .filter-bar {
        flex-direction: column;
    }

    .search-input,
    .filter-select {
        width: 100%;
    }
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 26, 0.9);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease-in;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 32px;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 32px;
    font-weight: 300;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--accent-primary);
}

.modal-header {
    margin-bottom: 24px;
}

.modal-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 8px;
}

.modal-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.modal-section {
    margin-bottom: 24px;
}

.modal-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-section h3::before {
    content: '';
    width: 4px;
    height: 18px;
    background: var(--accent-primary);
    border-radius: 2px;
}

.modal-section p,
.modal-section ul {
    color: var(--text-secondary);
    line-height: 1.8;
}

.modal-section ul {
    list-style: none;
    padding: 0;
}

.modal-section li {
    padding: 8px 0;
    padding-left: 20px;
    position: relative;
}

.modal-section li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent-primary);
}

.bit-structure {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
    margin: 16px 0;
}

.bit-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.bit-item .label {
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.bit-item .value {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-primary);
}

.code-example {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin: 12px 0;
    overflow-x: auto;
}

.code-example pre {
    margin: 0;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
}

.code-example .comment {
    color: var(--text-dim);
    font-style: italic;
}

.code-example .keyword {
    color: #ff79c6;
    font-weight: 600;
}

.code-example .string {
    color: #50fa7b;
}

.code-example .function {
    color: var(--accent-secondary);
}

.code-example .type {
    color: #8be9fd;
}

.code-example .number {
    color: #bd93f9;
}

.code-lang-label {
    display: inline-block;
    background: var(--bg-primary);
    color: var(--accent-primary);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.pros-cons > div {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
}

.pros-cons h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.pros-cons .pros h4 {
    color: var(--accent-primary);
}

.pros-cons .cons h4 {
    color: var(--accent-warning);
}

.hardware-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.hardware-chip {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 6px 14px;
    font-size: 13px;
    color: var(--text-secondary);
}

.hardware-chip.native {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* 硬件矩阵工具提示 */
.hw-tooltip {
    position: absolute;
    background: var(--bg-secondary);
    border: 1px solid var(--accent-primary);
    border-radius: 6px;
    padding: 12px;
    font-size: 13px;
    color: var(--text-primary);
    pointer-events: none;
    z-index: 100;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    display: none;
}

.hw-tooltip.active {
    display: block;
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 24px;
        max-height: 95vh;
    }

    .modal-title {
        font-size: 24px;
    }

    .pros-cons {
        grid-template-columns: 1fr;
    }

    .bit-structure {
        grid-template-columns: repeat(2, 1fr);
    }
}
