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

:root {
    --bg-color: #f8f9fa;
    --text-color: #333333;
    --primary-color: #2c5282;
    --border-color: #e5e7eb;
    --code-bg: #f1f5f9;
    --level-l: #ef4444;
    --level-m: #f59e0b;
    --level-h: #10b981;
}

body {
    font-family: 'Microsoft YaHei', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    font-size: 14px;
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.nav-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    gap: 24px;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 92px 24px 48px;
}

.section {
    margin-bottom: 32px;
    background: white;
    border-radius: 8px;
    padding: 24px;
    border: 1px solid var(--border-color);
}

.section h2 {
    font-size: 24px;
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-color);
}

.subsection {
    margin-bottom: 24px;
}

.subsection:last-child {
    margin-bottom: 0;
}

.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-color);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
}

.collapsible-header:hover {
    background: #e8eaed;
}

.collapsible-header h3 {
    font-size: 18px;
    color: var(--primary-color);
    margin: 0;
}

.toggle-icon {
    font-size: 12px;
    transition: transform 0.3s;
}

.collapsible-header.active .toggle-icon {
    transform: rotate(180deg);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding: 0 16px;
}

.collapsible-content.expanded {
    max-height: none;
    padding: 16px;
}

.intro-text {
    margin-bottom: 16px;
    color: #666;
}

.table-wrapper {
    overflow-x: auto;
    margin: 16px 0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.data-table th,
.data-table td {
    padding: 8px 12px;
    text-align: left;
    border: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-color);
    font-weight: 600;
    color: var(--primary-color);
    white-space: nowrap;
}

.data-table tr:hover {
    background: #f8fafc;
}

.data-table code {
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 11px;
}

.dimension-group {
    margin-bottom: 20px;
}

.dimension-group h4 {
    font-size: 16px;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.dimension-cards {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.dimension-card {
    flex: 1;
    min-width: 150px;
    background: var(--bg-color);
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
}

.dim-code {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.dim-name {
    font-size: 13px;
    color: #666;
}

.interpret-group {
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-color);
    border-radius: 6px;
}

.interpret-group h4 {
    font-size: 15px;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.interpret-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.interpret-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
}

.level-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-weight: 600;
    font-size: 12px;
    color: white;
    flex-shrink: 0;
}

.level-l {
    background: var(--level-l);
}

.level-m {
    background: var(--level-m);
}

.level-h {
    background: var(--level-h);
}

.code-block {
    position: relative;
    margin: 16px 0;
    background: #1e293b;
    border-radius: 6px;
    overflow: hidden;
}

.code-block pre {
    padding: 16px;
    overflow-x: auto;
    margin: 0;
}

.code-block code {
    color: #e2e8f0;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    line-height: 1.5;
}

.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.copy-btn.copied {
    background: #10b981;
    border-color: #10b981;
}

.code-title {
    margin-top: 20px;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--primary-color);
}

.feature-list {
    margin: 12px 0;
    padding-left: 24px;
}

.feature-list li {
    margin-bottom: 8px;
}

.note {
    background: #fef3c7;
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid #f59e0b;
    margin: 12px 0;
    font-size: 13px;
}

.flow-step {
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg-color);
    border-radius: 6px;
}

.flow-step h4 {
    font-size: 15px;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.rule-box {
    margin-bottom: 20px;
}

.rule-box h4 {
    font-size: 15px;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.formula-box {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #bfdbfe;
    margin: 16px 0;
}

.formula {
    font-size: 18px;
    font-family: 'Consolas', 'Monaco', monospace;
    color: var(--primary-color);
    text-align: center;
    padding: 16px;
    background: white;
    border-radius: 6px;
    margin-bottom: 16px;
}

.formula-explanation {
    font-size: 13px;
}

.formula-explanation ul {
    margin-top: 8px;
    padding-left: 20px;
}

.flowchart {
    background: var(--bg-color);
    padding: 20px;
    border-radius: 6px;
    margin: 16px 0;
}

.flow-node {
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    padding: 12px 20px;
    text-align: center;
    margin: 12px auto;
    max-width: 300px;
    font-weight: 500;
}

.node-sub {
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 4px;
    font-weight: normal;
}

.flow-arrow {
    text-align: center;
    color: var(--primary-color);
    font-size: 13px;
    margin: 8px 0;
}

.flow-branches {
    margin-left: 20px;
}

.flow-branch {
    margin: 8px 0;
}

.branch-arrow {
    color: var(--primary-color);
    font-size: 13px;
}

.branch-result {
    margin-left: 24px;
    font-size: 13px;
    color: #666;
}

.sub-question {
    margin-top: 8px;
    padding: 12px;
    background: white;
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
}

.footer {
    text-align: center;
    padding: 24px;
    color: #666;
    font-size: 13px;
    border-top: 1px solid var(--border-color);
    margin-top: 32px;
}

@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        height: auto;
        padding: 12px 16px;
    }

    .nav-title {
        margin-bottom: 12px;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
    }

    .container {
        padding-top: 120px;
        padding-left: 16px;
        padding-right: 16px;
    }

    .section {
        padding: 16px;
    }

    .section h2 {
        font-size: 20px;
    }

    .collapsible-header h3 {
        font-size: 16px;
    }

    .dimension-card {
        min-width: 100%;
    }

    .data-table {
        font-size: 11px;
    }

    .data-table th,
    .data-table td {
        padding: 6px 8px;
    }
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    max-width: 640px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

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

.modal-title {
    font-size: 22px;
    color: var(--primary-color);
    padding: 24px 24px 16px;
    border-bottom: 2px solid var(--border-color);
    text-align: center;
}

.modal-body {
    padding: 20px 24px;
    max-height: calc(85vh - 140px);
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.8;
}

.modal-body h4 {
    color: var(--primary-color);
    margin-top: 16px;
    margin-bottom: 8px;
    font-size: 14px;
}

.modal-body h4:first-of-type {
    margin-top: 12px;
}

.modal-body p {
    margin-bottom: 8px;
    color: #555;
}

.modal-highlight {
    margin-top: 20px !important;
    padding: 12px;
    background: #fef3c7;
    border-left: 3px solid #f59e0b;
    border-radius: 4px;
    font-weight: 500;
    color: #92400e !important;
}

.modal-footer {
    padding: 16px 24px 24px;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 48px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: #1e3a5f;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(44, 82, 130, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .modal-title {
        font-size: 18px;
        padding: 20px 16px 12px;
    }
    
    .modal-body {
        padding: 16px;
        font-size: 12px;
    }
    
    .modal-footer {
        padding: 12px 16px 20px;
    }
    
    .btn-primary {
        padding: 10px 36px;
        font-size: 14px;
    }
}