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

:root {
    --bg-color: #050505;
    --card-bg: #0a0f16;
    --text-main: #e0e0e0;
    --text-muted: #b0bec5;
    --accent-cyan: #00f3ff;
    --accent-purple: #bc13fe;
    --accent-blue: #0066ff;
    --gradient-main: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    --glass: rgba(255, 255, 255, 0.05);
    --border-glow: 0 0 10px rgba(0, 243, 255, 0.3);
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    overflow-x: hidden;
    line-height: 1.6;
}

h1,
h2,
h3,
h4 {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(5, 5, 5, 0.8);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 243, 255, 0.4);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 243, 255, 0.6);
}

/* Selection */
::selection {
    background: rgba(0, 243, 255, 0.3);
    color: #fff;
}

/* Header */
header {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    background: radial-gradient(circle at center, #1a1f2e 0%, #050505 70%);
    overflow: hidden;
}

.hero-content {
    z-index: 2;
    text-align: center;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 1s forwards 0.5s;
}

h1 {
    font-size: 4rem;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    text-shadow: 0 0 30px rgba(0, 243, 255, 0.3);
}

.subtitle {
    font-size: 1.5rem;
    color: var(--text-main);
    margin-bottom: 2rem;
    letter-spacing: 4px;
    opacity: 0.9;
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
    opacity: 0.7;
}

/* Sections */
section {
    padding: 6rem 10%;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.section-title {
    font-size: 2.2rem;
    margin-bottom: 3rem;
    display: inline-block;
    position: relative;
    padding-bottom: 12px;
    color: var(--text-main);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--accent-cyan);
    box-shadow: 0 0 10px var(--accent-cyan);
}

/* Cards & Layout */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.card {
    background: linear-gradient(145deg, rgba(15, 20, 28, 0.9) 0%, rgba(10, 15, 22, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 2rem;
    border-radius: 16px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.card:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 243, 255, 0.3);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3), var(--border-glow);
}

.card h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--accent-cyan);
    letter-spacing: 1px;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gradient-main);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s ease;
}

.card:hover::before {
    transform: scaleX(1);
}

/* Text Styles */
p {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.8;
}

strong {
    color: var(--accent-cyan);
    font-weight: 600;
}

a {
    color: var(--accent-cyan);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: #fff;
    text-shadow: 0 0 8px rgba(0, 243, 255, 0.5);
}

code {
    background: rgba(0, 243, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
    font-size: 0.9em;
    color: var(--accent-cyan);
    border: 1px solid rgba(0, 243, 255, 0.15);
}

ul {
    list-style: none;
}

li {
    margin-bottom: 1rem;
    padding-left: 24px;
    position: relative;
    line-height: 1.7;
}

li::before {
    content: '\203A';
    position: absolute;
    left: 6px;
    color: var(--accent-purple);
    font-weight: bold;
}

/* SVG Containers */
.svg-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

svg {
    width: 100%;
    height: auto;
    max-height: 400px;
}

/* Animations */
@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0) translateX(-50%);
    }

    40% {
        transform: translateY(-10px) translateX(-50%);
    }

    60% {
        transform: translateY(-5px) translateX(-50%);
    }
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Specific Component Styles */
.feature-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature-item {
    text-align: center;
    padding: 1.5rem;
    background: var(--glass);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(0, 243, 255, 0.2);
    transform: translateY(-3px);
}

.feature-item h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--accent-cyan);
}

/* Footer */
footer {
    padding: 3rem 2rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    font-size: 0.9rem;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: rgba(10, 15, 22, 0.95);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
table thead tr {
    background: linear-gradient(180deg, #0d1219 0%, #0a0f16 100%);
}
table th {
    padding: 14px 18px;
    text-align: left;
    font-weight: 600;
    color: var(--text-main);
    border-bottom: 1px solid rgba(0, 243, 255, 0.15);
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background: rgba(10, 15, 22, 0.95);
}
table td {
    padding: 13px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    font-size: 0.92rem;
}
table tbody tr {
    transition: all 0.2s ease;
}
table tbody tr:nth-child(odd) {
    background: rgba(0, 0, 0, 0.15);
}
table tbody tr:nth-child(even) {
    background: rgba(10, 15, 22, 0.4);
}
table tbody tr:hover {
    background: rgba(0, 243, 255, 0.06) !important;
}
table tbody tr:hover td {
    color: var(--text-main);
}
table tbody tr:last-child td {
    border-bottom: none;
}
table code {
    background: rgba(0, 243, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    color: var(--accent-cyan);
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, rgba(10, 15, 22, 0.98) 0%, rgba(5, 5, 5, 0.98) 100%);
    backdrop-filter: blur(12px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 2rem 0;
    transform: translateX(0);
    transition: transform 0.3s ease;
    z-index: 1000;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

/* 侧边栏收起状态 */
.sidebar.collapsed {
    transform: translateX(-280px);
}

.sidebar-content {
    padding: 0 1.5rem;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 侧边栏头部样式 */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 1rem;
}
.sidebar-header h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--accent-cyan);
}

/* 折叠按钮 - 固定定位 */
.sidebar-collapse-btn {
    position: fixed;
    top: 2rem;
    left: 248px;
    width: 24px;
    height: 24px;
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: var(--text-muted);
    z-index: 1001;
}
.sidebar-collapse-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--accent-cyan);
    border-color: rgba(0, 243, 255, 0.3);
}
.sidebar-collapse-btn svg {
    width: 14px;
    height: 14px;
    transition: transform 0.3s ease;
}

/* 侧边栏收起时折叠按钮位置 */
.sidebar.collapsed ~ .sidebar-collapse-btn {
    left: 1rem;
}
.sidebar.collapsed ~ .sidebar-collapse-btn svg {
    transform: rotate(180deg);
}

.sidebar h3 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: var(--accent-cyan);
}

.main-content {
    margin-left: 280px;
    transition: margin-left 0.3s ease;
}

/* 侧边栏收起时主内容区域 */
.sidebar.collapsed ~ .sidebar-collapse-btn ~ .main-content,
.main-content.expanded {
    margin-left: 0;
}

/* Sidebar Navigation Styles */
#toc {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 2rem;
    padding-right: 0.5rem;
}

/* TOC滚动条美化 */
#toc::-webkit-scrollbar {
    width: 4px;
}
#toc::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
    border-radius: 2px;
}
#toc::-webkit-scrollbar-thumb {
    background: rgba(0, 243, 255, 0.3);
    border-radius: 2px;
}
#toc::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 243, 255, 0.5);
}

#toc a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 0.88rem;
    display: block;
    border-left: 2px solid transparent;
}

#toc a:hover {
    color: var(--accent-cyan);
    background: rgba(0, 243, 255, 0.08);
    border-left-color: rgba(0, 243, 255, 0.4);
    text-shadow: none;
}

#toc a.active {
    color: var(--accent-cyan);
    background: rgba(0, 243, 255, 0.15);
    border-left: 2px solid var(--accent-cyan);
    font-weight: 500;
}

/* Toggle Button - 移动端菜单按钮 */
.sidebar-toggle {
    position: fixed;
    top: 1rem;
    left: 1rem;
    background: var(--card-bg);
    border: 1px solid rgba(0, 243, 255, 0.3);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: rgba(0, 243, 255, 0.1);
    border-color: var(--accent-cyan);
}

/* Sidebar Toggle State */
.sidebar.open {
    transform: translateX(0);
}

/* Responsive Design */
@media (max-width: 1199px) {
    .sidebar {
        transform: translateX(-280px);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-collapse-btn {
        display: none;
    }
    .sidebar-toggle {
        display: flex;
    }
    .main-content {
        margin-left: 0;
    }
    section {
        padding: 4rem 6%;
    }
}

@media (max-width: 900px) {
    .grid-2 {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    h1 {
        font-size: 2.8rem;
    }
    .section-title {
        font-size: 1.8rem;
    }
    section {
        padding: 3rem 5%;
    }
}

@media (max-width: 600px) {
    h1 {
        font-size: 2rem;
    }
    .subtitle {
        font-size: 1.1rem;
        letter-spacing: 2px;
    }
    .section-title {
        font-size: 1.5rem;
    }
    .card {
        padding: 1.5rem;
    }
    table th,
    table td {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 42px;
    height: 42px;
    background: rgba(13, 18, 28, 0.95);
    border: 1px solid rgba(0, 243, 255, 0.4);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover {
    background: rgba(0, 243, 255, 0.15);
    border-color: var(--accent-cyan);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 243, 255, 0.2);
}
.back-to-top svg {
    width: 18px;
    height: 18px;
    stroke: var(--accent-cyan);
    stroke-width: 2.5;
}

