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

:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --danger-color: #dc2626;
    --warning-color: #f59e0b;
    --success-color: #10b981;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-gray: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}


body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: #1f2937;
    background: #f9fafb;
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Header */
.header {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2563eb;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: #6b7280;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: #2563eb;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6rem 0;
    text-align: center;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 3rem;
    opacity: 0.9;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: white;
    color: #2563eb;
}

.btn-primary:hover {
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background: white;
    color: #2563eb;
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 0 6rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #111827;
    margin: 1rem 0;
    text-align: center;
}

.section-description {
    font-size: 1.125rem;
    color: #6b7280;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.section-gray {
    background: #f9fafb;
}

/* Stats Section */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: #2563eb;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #6b7280;
    font-size: 1rem;
    font-weight: 500;
}

.domain-stats {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 2rem;
    margin-bottom: 2rem;
}

.domain-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.domain-stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s;
}

.domain-stat-item:hover {
    border-color: #2563eb;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

.domain-stat-icon {
    font-size: 2rem;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.domain-stat-info {
    flex: 1;
}

.domain-stat-name {
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
}

.domain-stat-count {
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
}

.domain-section {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 2rem;
    margin-bottom: 2rem;
}

.domain-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
    transition: background-color 0.2s;
}

.domain-header:hover {
    background-color: #f9fafb;
    border-radius: 8px;
    padding: 1rem;
    margin: -1rem -1rem 1.5rem -1rem;
}

.domain-expand-icon {
    color: #6b7280;
    font-size: 1rem;
}

.domain-icon {
    font-size: 2rem;
}

.domain-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
}

.domain-count {
    background: #dbeafe;
    color: #1e40af;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-left: auto;
}



.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.navbar {
    background: var(--bg-white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 0;
}

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

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

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

.btn-primary {
    background: white;
    color: var(--primary-color);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background: white;
    color: var(--primary-color);
}


.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-card {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
}


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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.attack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.attack-card {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.attack-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.attack-card h4 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.attack-card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* 步骤 */
.steps {
    margin-top: 3rem;
}

.step {
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
    align-items: flex-start;
}

.step-number {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
}

.step-content {
    flex: 1;
}

.step-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.step-content pre {
    background: var(--text-primary);
    color: #f9fafb;
    padding: 1.5rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin-top: 1rem;
}

.step-content code {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
}

.docs-link {
    text-align: center;
    margin-top: 3rem;
    padding: 2rem;
    background: var(--bg-gray);
    border-radius: 1rem;
}

.docs-link a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}

.docs-link a:hover {
    text-decoration: underline;
}

/* 页脚 */
.footer {
    background: var(--text-primary);
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.footer-section p {
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.footer-section a:hover {
    opacity: 1;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.8;
}

/* Task Categories */
.task-categories {
    margin-top: 3rem;
}

.expand-icon {
    font-size: 1.25rem;
    transition: transform 0.3s;
    color: var(--primary-color);
}

.task-header.active .expand-icon {
    transform: rotate(180deg);
}

.task-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}

.task-content.active {
    max-height: 2000px;
    transition: max-height 0.6s ease-in;
}

.task-list {
    padding: 0 1.5rem 1.5rem;
}

.task-item {
    background: var(--bg-gray);
    padding: 1.25rem;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary-color);
}

.task-item:last-child {
    margin-bottom: 0;
}

.task-item h4 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.task-item p {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.task-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-server {
    background: #dbeafe;
    color: #1e40af;
}

.badge-host {
    background: #fef3c7;
    color: #92400e;
}

.badge-user {
    background: #fce7f3;
    color: #9f1239;
}

.task-count {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Leaderboard Tables */
.leaderboard-tabs {
    margin-top: 2rem;
}

.table-container {
    overflow-x: auto;
    margin-top: 2rem;
    background: var(--bg-white);
    border-radius: 1rem;
    box-shadow: var(--shadow);
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.leaderboard-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.leaderboard-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.leaderboard-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.leaderboard-table tbody tr:hover {
    background: var(--bg-gray);
}

.leaderboard-table tbody tr:last-child td {
    border-bottom: none;
}

.model-name {
    font-weight: 600;
    color: var(--primary-color);
}

.highlight {
    background: #eff6ff;
    font-weight: 700;
    color: var(--text-primary);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hero-title {
        font-size: 1.5rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .nav-menu {
        flex-direction: column;
        gap: 1rem;
    }

    .features-grid,
    .security-cards,
    .insights-grid,
    .attack-grid {
        grid-template-columns: 1fr;
    }

    .results-images {
        grid-template-columns: 1fr;
    }

    .step {
        flex-direction: column;
    }

    .step-number {
        margin: 0 auto;
    }

    .task-header h3 {
        font-size: 1.125rem;
    }

    .leaderboard-table {
        font-size: 0.75rem;
    }

    .leaderboard-table th,
    .leaderboard-table td {
        padding: 0.5rem;
    }
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

::selection {
    background: var(--primary-color);
    color: white;
}

/* Baseline (No-attack) integration styles */
.baseline-toolbar .btn-switch {
    padding: 0.45rem 0.9rem;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #374151;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all .15s ease-in-out;
}

.baseline-toolbar .btn-switch:hover {
    background: #f8fafc;
}

.baseline-toolbar .btn-switch.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

tr.no-attack-detail td {
    background: #fcfcfd;
    padding: 0.75rem 1rem;
}

.baseline-detail-card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
    padding: 0.75rem 0.75rem 0.5rem 0.75rem;
}

.baseline-detail-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
}

table.no-attack-inline {
    width: auto;
    border-collapse: collapse;
    font-size: 0.85rem;
}

table.no-attack-inline th,
table.no-attack-inline td {
    border: 1px solid #e5e7eb;
    padding: 0.35rem 0.6rem;
    text-align: center;
    white-space: nowrap;
}

/* Per-row toggle chevron for baseline details */
.row-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.15rem 0.35rem;
    margin-right: 0.35rem;
    color: var(--primary-color);
}

.row-toggle:focus {
    outline: 2px solid rgba(37, 99, 235, 0.35);
    border-radius: 6px;
}

.row-toggle .chevron {
    transition: transform 0.2s ease;
}

.row-toggle[aria-expanded="true"] .chevron {
    transform: rotate(90deg);
}

/* Results & Analysis Tables */
.subsection-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 2.5rem 0 0 0;
}

.results-tables .table-container {
    margin-bottom: 2rem;
    overflow-x: auto;
    background: #fafaf9;
    border-radius: 12px;
    border: 1px solid #e5e5e5;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.results-tables .leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.results-tables .leaderboard-table th {
    background: #0d9dda;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 1rem 0.75rem;
    text-align: center;
    border-bottom: 1px solid #e5e5e5;
    position: sticky;
    top: 0;
    vertical-align: middle;
    height: 40px;
    white-space: nowrap;
}

.results-tables .leaderboard-table {
    border-collapse: collapse;
    width: 100%;
}


.results-tables .leaderboard-table thead tr:nth-child(2) th:nth-child(2n+1),
.results-tables .leaderboard-table thead tr:nth-child(3) th:nth-child(4n+1),
.results-tables .leaderboard-table tbody td:nth-child(4n+1),
.results-tables .attack-results-table tbody td:nth-child(2n+1) {
    border-right: 2px solid #ddd;
}

.results-tables .leaderboard-table th:first-child {
    text-align: left;
    min-width: 200px;
}

.results-tables .leaderboard-table thead tr:first-child th {
    font-size: 0.9rem;
    font-weight: 700;
    padding: 1.2rem 0.75rem;
    border-right: 2px solid #ddd;
}

.results-tables .leaderboard-table thead tr:last-child th {
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.8rem 0.75rem;
    background: #0a7ba8;
}

.results-tables .leaderboard-table thead th {
    text-align: center !important;
    vertical-align: middle;
}

.results-tables .leaderboard-table thead th:first-child {
    text-align: left !important;
}

.results-tables .leaderboard-table td {
    padding: 1rem 0.75rem;
    text-align: center;
    border-bottom: 1px solid #e5e5e5;
}

.results-tables .leaderboard-table tbody tr:nth-child(even) {
    background: rgba(13, 157, 218, 0.03);
}

.results-tables .leaderboard-table tbody tr:hover {
    background: rgba(13, 157, 218, 0.06);
}

.results-tables .leaderboard-table tbody tr:last-child td {
    border-bottom: none;
}

.results-tables .model-name {
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
}

.results-tables .highlight {
    font-weight: 700;
    background: rgb(239, 246, 255);
    border-radius: 4px;
    padding: 2px 6px;
}

.results-tables .leaderboard-table tbody tr td:first-child strong {
    background: #f3f4f6;
    color: #374151;
    font-weight: 700;
    padding: 0.5rem;
    border-radius: 4px;
    display: block;
    text-align: center;
}

@media (max-width: 768px) {
    .subsection-title {
        font-size: 1.25rem;
    }

    .results-tables .leaderboard-table {
        font-size: 0.75rem;
    }

    .results-tables .leaderboard-table th,
    .results-tables .leaderboard-table td {
        padding: 0.5rem;
    }
}

/* Extracted from inline styles */

/* Example Image */
.example-image {
    text-align: center;
    margin: 3rem 0;
}

.example-image img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.image-caption {
    margin-top: 1rem;
    color: #6b7280;
    font-style: italic;
    font-size: 0.875rem;
}

/* Task Categories */
.task-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.task-category {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    transition: all 0.2s;
}

.task-category:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

.task-header {
    padding: 2rem;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.task-icon {
    font-size: 2rem;
}

.task-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
}

.task-content {
    padding: 2rem;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.task-item {
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.task-item h4 {
    color: #111827;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.task-item p {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.task-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-server {
    background: #dbeafe;
    color: #1e40af;
}

.badge-host {
    background: #fef3c7;
    color: #92400e;
}

.badge-user {
    background: #fee2e2;
    color: #991b1b;
}

.task-count {
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Leaderboard */
.leaderboard-tabs {
    margin-top: 3rem;
}

.tab-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.tab-button {
    padding: 0.875rem 1.75rem;
    border: 2px solid #e5e7eb;
    background: white;
    color: #374151;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    font-size: 1rem;
}

.tab-button:hover {
    border-color: #2563eb;
    background: #eff6ff;
    color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.tab-button.active {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    border-color: #2563eb;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
    transform: translateY(-2px);
}

.tab-label {
    font-weight: 600;
    font-size: 1rem;
}

.tab-percentage {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.625rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
}

.tab-button:not(.active) .tab-percentage {
    background: #f3f4f6;
    color: #6b7280;
    padding: 0.25rem 0.625rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
}

.tab-button:hover:not(.active) .tab-percentage {
    background: #dbeafe;
    color: #2563eb;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Insights */
.insights {
    margin-top: 3rem;
    background: white;
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.insights h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 2rem;
    text-align: center;
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.insight-card {
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.insight-card h4 {
    color: #111827;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.insight-card p {
    color: #6b7280;
    font-size: 0.875rem;
}

/* Security Section */

.section-warning {
    padding: 1rem;
    background: #fef2f2;
    border-top: 4px solid #ef4444;
}

.security-notice {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #fecaca;
}

.security-icon {
    font-size: 2rem;
}

.security-notice h3 {
    color: #dc2626;
    font-size: 1.25rem;
    font-weight: 600;
}

.security-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 1rem 0;
}

.security-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.security-card.critical {
    border-color: #fecaca;
    background: #fef2f2;
}

.security-card h4 {
    color: #111827;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.security-card p,
.security-card li {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.security-card ul {
    padding-left: 1.5rem;
}

/* Results */
.results-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.result-image {
    text-align: center;
}

.result-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Attack Types */
.attack-tabs {
    margin-top: 3rem;
}

.attack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.attack-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s;
}

.attack-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.attack-card h4 {
    color: #111827;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.attack-card p {
    color: #6b7280;
    font-size: 0.875rem;
}

/* Getting Started */
.steps {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 3rem;
}

.step {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.step-number {
    background: #2563eb;
    color: white;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.step-content h3 {
    color: #111827;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.step-content pre {
    background: #1f2937;
    color: #f3f4f6;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.875rem;
}

.docs-link {
    text-align: center;
    margin-top: 3rem;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.docs-link a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}

.docs-link a:hover {
    text-decoration: underline;
}

/* Footer */
.footer {
    background: #1f2937;
    color: white;
    padding: 3rem 0 2rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: white;
}

.footer-section p {
    color: #d1d5db;
    font-size: 0.875rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: #d1d5db;
    text-decoration: none;
    font-size: 0.875rem;
}

.footer-section ul li a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #374151;
    color: #9ca3af;
    font-size: 0.875rem;
}

/* Main Layout */
.main-container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - 80px);
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid #e5e7eb;
    padding: 0;
    position: sticky;
    top: 80px;
    height: calc(100vh - 80px);
    overflow: hidden;
    margin-top: 30px;
    transition: transform 0.3s ease, width 0.3s ease;
}

.sidebar-content {
    padding: 2rem 1.5rem;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
}

.sidebar-content::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

.sidebar.hidden {
    transform: translateX(-100%);
    width: 0;
    padding: 0;
    border-right: none;
    overflow: visible;
}

.sidebar.hidden .sidebar-content {
    opacity: 0;
    pointer-events: none;
}

.sidebar-toggle {
    position: absolute;
    top: 50%;
    right: -15px;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: #f3f4f6;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.sidebar-toggle i {
    color: #6b7280;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.sidebar.hidden .sidebar-toggle {
    right: -15px;
    top: 50%;
    transform: translateY(-50%);
    background: #2563eb;
    border-color: #2563eb;
}

.sidebar.hidden .sidebar-toggle:hover {
    background: #1d4ed8;
}

.sidebar.hidden .sidebar-toggle i {
    color: white;
}

.sidebar.hidden+.content {
    margin-left: 0;
}

.search-box {
    position: relative;
    margin-bottom: 2rem;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

.domain-nav {
    list-style: none;
}

.domain-nav-item {
    margin-bottom: 0.5rem;
}

.domain-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #6b7280;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
}

.domain-nav-link:hover,
.domain-nav-link.active {
    background: #eff6ff;
    color: #2563eb;
}

.domain-nav-icon {
    font-size: 1.25rem;
}

/* Content */
.content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
}

.page-description {
    font-size: 1.125rem;
    color: #6b7280;
    margin-bottom: 2rem;
}


.tasks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, opacity 0.3s ease-out;
    opacity: 0;
}

.tasks-grid.expanded {
    max-height: 10000px;
    opacity: 1;
    transition: max-height 0.6s ease-in, opacity 0.4s ease-in;
}

.tasks-grid.collapsed {
    max-height: 0;
    opacity: 0;
}

.task-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.2s;
    cursor: pointer;
}

.task-card:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
    transform: translateY(-2px);
}

.task-id {
    font-size: 0.875rem;
    font-weight: 600;
    color: #2563eb;
    margin-bottom: 0.5rem;
}

.task-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.task-category {
    display: inline-block;
    background: #fef3c7;
    color: #92400e;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.task-question {
    color: #374151;
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.task-footer {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.attack-badge {
    background: #fee2e2;
    color: #991b1b;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.view-btn {
    margin-left: auto;
    background: #2563eb;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.view-btn:hover {
    background: #1d4ed8;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #111827;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.json-viewer {
    background: #1f2937;
    color: #f3f4f6;
    padding: 1.5rem;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.loading {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
}

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}


@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}
/* ========== 移动端 / 平板自适应（在现有样式基础上追加） ========== */

/* 平板及以下：主布局与侧栏 */
@media (max-width: 1024px) {
    .header-container,
    .main-content,
    .footer-content {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .main-container {
        flex-direction: column;
        min-height: auto;
    }

    .sidebar {
        width: 100%;
        max-width: 100%;
        height: auto;
        max-height: min(50vh, 320px);
        position: relative;
        top: 0;
        margin-top: 0;
        border-right: none;
        border-bottom: 1px solid var(--border-color, #e5e7eb);
    }

    .sidebar-content {
        max-height: min(45vh, 280px);
        padding: 1rem 1.25rem;
    }

    .sidebar.hidden {
        max-height: 0;
        border-bottom: none;
        overflow: hidden;
    }

    .sidebar.hidden .sidebar-content {
        opacity: 0;
        pointer-events: none;
    }

    .sidebar-toggle {
        right: 12px;
        top: auto;
        bottom: -14px;
        transform: none;
    }

    .content {
        padding: 1.25rem 1rem;
        overflow-x: hidden;
    }

    .tasks-grid {
        grid-template-columns: 1fr;
    }

    .page-title {
        font-size: clamp(1.5rem, 5vw, 2rem);
    }

    .section-title {
        font-size: clamp(1.5rem, 5vw, 2rem);
    }
}

@media (max-width: 768px) {
    /* 修正大屏-only 的内边距，避免横向滚动 */
    .section {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* 与 .nav-menu 并列：若页面用的是 .nav-links */
    .nav-links {
        flex-wrap: wrap;
        gap: 0.75rem 1.25rem;
        justify-content: center;
        width: 100%;
    }

    .nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    .logo {
        width: 100%;
        text-align: center;
    }

    .hero {
        padding: 3rem 0;
    }

    .hero-title {
        font-size: clamp(1.75rem, 6vw, 2.25rem);
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-buttons .btn {
        justify-content: center;
        width: 100%;
        max-width: 320px;
        margin-left: auto;
        margin-right: auto;
    }

    .stats {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .domain-header {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .domain-count {
        margin-left: 0;
    }

    .tab-buttons {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    .tab-button {
        flex: 1 1 calc(50% - 0.5rem);
        min-width: 140px;
        justify-content: center;
        padding: 0.65rem 1rem;
        font-size: 0.9rem;
    }

    .results-images {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        height: 100%;
        border-radius: 0;
    }

    .modal-header,
    .modal-body {
        padding: 1rem;
    }

    .baseline-toolbar {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .baseline-toolbar .btn-switch {
        flex: 1 1 auto;
        min-height: 44px;
    }

    .security-notice {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .task-header {
        flex-wrap: wrap;
    }

    .task-meta {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .view-btn {
        margin-left: 0;
        width: 100%;
        min-height: 44px;
    }

    .task-footer {
        flex-direction: column;
        align-items: stretch;
    }
}

/* 窄屏手机 */
@media (max-width: 480px) {
    .stats {
        grid-template-columns: 1fr;
    }

    .tab-button {
        flex: 1 1 100%;
        min-width: 0;
    }

    .features-grid,
    .task-categories,
    .insights-grid,
    .attack-grid,
    .security-cards {
        grid-template-columns: 1fr;
    }

    .domain-stats-grid {
        grid-template-columns: 1fr;
    }

    .step {
        gap: 1rem;
    }

    .step-number {
        width: 48px;
        height: 48px;
        font-size: 1.125rem;
    }
}

/* 横屏小高度：避免侧栏占满屏 */
@media (max-width: 1024px) and (max-height: 500px) {
    .sidebar,
    .sidebar-content {
        max-height: 200px;
    }
}
/* Get Started：代码块在窄屏下不撑破布局，长行在 pre 内横向滚动
   原因：.steps 为 flex-direction:column 时，.step 作为 flex 子项默认 min-width:auto，
   会被超长 pre 内容在「横向」上撑开；仅给 .step-content 设 min-width:0 不够。
   code 设 width:max-content 让最宽一行决定内部宽度，从而触发 pre 的 overflow-x。 */
#getting-started .steps {
    min-width: 0;
    width: 100%;
}

#getting-started .steps > .step {
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

.steps .step,
.step-content {
    min-width: 0;
}

#getting-started .step-content {
    width: 100%;
    max-width: 100%;
}

.step-content pre,
.step pre {
    width: 100%;
    max-width: 100%;
    margin: 0;
    margin-top: 1rem;
    padding: 1rem 1.1rem;
    border-radius: 8px;
    box-sizing: border-box;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-gutter: stable;
}

.step-content pre code,
.step pre code {
    display: block;
    width: max-content;
    min-width: 100%;
    white-space: pre;
    word-break: normal;
    overflow-wrap: normal;
    font-size: 0.85rem;
    line-height: 1.45;
}

/* Copy：横向滚动仅在 .code-scroll；按钮在 .code-with-copy 上 absolute，不随滚动。
   不用 scrollbar-gutter:stable + pre 用 max(100%,max-content)，避免无滚动条时按钮跑出深蓝底 */
.code-with-copy {
    position: relative;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    z-index: 0;
}

.step-content .code-with-copy {
    margin-top: 1rem;
}

.code-with-copy .code-scroll {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    /* 不要用 scrollbar-gutter: stable：无横向滚动时会在右侧留出「槽位」，
       pre 变窄而 Copy 仍贴容器右缘，按钮会跑出深蓝背景；有滚动条时视觉又对齐了 */
}

.step-content .code-with-copy .code-scroll pre {
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 2.5rem;
    /* 由外层 div 负责滚动，pre 自身不建立横向滚动条 */
    overflow-x: visible;
    overflow-y: visible;
    /* 短代码至少铺满一行宽（避免 pre 窄于容器、按钮相对容器右对齐时看起来「溢出」） */
    width: max(100%, max-content);
    max-width: none;
    box-sizing: border-box;
}

.code-with-copy .copy-button {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 2;
    max-width: calc(100% - 1rem);
    padding: 0.35rem 0.75rem;
    background: rgba(255, 255, 255, 0.92);
    color: #1f2937;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 0.35rem;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.25s ease, background 0.2s ease, color 0.2s ease;
}

.code-with-copy:hover .copy-button,
.code-with-copy:focus-within .copy-button {
    opacity: 1;
}

.code-with-copy .copy-button.copy-button--success {
    background: #10b981;
    color: #fff;
    border-color: #059669;
    opacity: 1;
}

@media (hover: none) {
    .code-with-copy .copy-button {
        opacity: 0.9;
    }
}
