:root {
    --primary: #34dbac;
    --secondary: #73b659;
    --accent: #e74c3c;
    --light: #ecf0f1;
    --dark: #2c3e50;
    --success: #2ecc71;
    --warning: #f39c12;
    --gray: #95a5a6;
    --light-gray: #34495e;
    --border-radius: 12px;
    --shadow: 0 6px 10px rgba(0, 0, 0, 0.3);
    --transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --border: 2px solid rgba(255, 255, 255, 0.1);
}

@font-face {
    font-family: "unifont";
    src: url("./font/unifont-16.0.04.otf");
}

.wikilink{
    background: var(--primary);
    color: white;
    border: 4px solid transparent;
    border-radius: 5px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Consolas, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #caefc9;
    color: var(--light);
    line-height: 1.6;
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 25px;
}
/* 侧边栏样式 - 卡通风格 */
.sidebar {
    background: rgb(51, 54, 54);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 25px 0;
    border: var(--border);
    position: sticky;
    top: 20px;
    height: calc(100vh - 40px);
    overflow-y: auto;
}
/* 滚轮设计 */
.sidebar::-webkit-scrollbar {
    width: 8px;
}
.sidebar::-webkit-scrollbar-thumb {
    background: var(--gray);
    border-radius: var(--border-radius);
}
.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}
.logo {
    padding: 0 20px 20px;
    margin-bottom: 15px;
    border-bottom: 2px dashed rgba(236, 240, 241, 0.2);
    text-align: center;
}

.logo h1 {
    font-size: 2.2rem;
    margin-bottom: 5px;
    background: var(--primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 800;
    letter-spacing: 1px;
}

.logo p {
    color: var(--gray);
    font-size: 0.95rem;
}

.nav-section {
    margin-bottom: 25px;
    padding: 0 15px;
}
.nav-section h3 {
    padding: 0 10px 10px;
    font-size: 0.95rem;
    margin-bottom: 10px;
    color: var(--gray);
    display: flex;
    align-items: center;
    letter-spacing: 1px;
    font-weight: 600;
}

.nav-section h3 i {
    margin-right: 12px;
    font-size: 1.2rem;
    color: var(--primary);
}

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

.nav-links li {
    transition: var(--transition);
    margin: 8px 0;
    border-radius: 8px;
    overflow: hidden;
}

.nav-links li:hover {
    background: rgba(52, 73, 94, 0.5);
    transform: translateX(5px);
}

.nav-links a {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    color: var(--light);
    text-decoration: none;
    transition: var(--transition);
    font-size: 1.05rem;
    font-weight: 600;
}

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

.nav-links a.active {
    background: rgba(52, 152, 219, 0.2);
    color: var(--primary);
    border-left: 4px solid var(--primary);
}

.nav-links a i {
    margin-right: 15px;
    width: 24px;
    text-align: center;
    font-size: 1.3rem;
}

.nav-links .coming-soon {
    position: relative;
}

.nav-links .coming-soon:after {
    content: "On Going";
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--warning);
    color: #fff;
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 700;
}

/* 主内容区样式 */
.main-content {
    padding: 0;
}

.header {
    background: rgba(26, 30, 46, 0.8);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 25px 30px;
    margin-bottom: 30px;
    border: var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
}

.header h2 {
    color: var(--light);
    font-size: 2rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
}

.header h2 i {
    color: var(--primary);
    background: rgba(52, 152, 219, 0.2);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.breadcrumb {
    display: flex;
    color: var(--gray);
    font-size: 1rem;
    align-items: center;
}

.breadcrumb a {
    color: var(--light);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 600;
}

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

.breadcrumb span {
    margin: 0 12px;
    color: var(--gray);
}

.content-card {
    background: rgba(26, 30, 46, 0.8);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 30px;
    margin-bottom: 30px;
    border: var(--border);
    backdrop-filter: blur(10px);
}

.content-card h3 {
    color: var(--light);
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(236, 240, 241, 0.1);
    font-weight: 800;
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    gap: 15px;
}

.content-card h3 i {
    color: var(--primary);
}

.exercise {
    background: rgba(52, 73, 94, 0.4);
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 25px;
    border-left: 5px solid var(--primary);
}

.exercise-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.exercise-title h4 {
    color: var(--light);
    font-size: 1.4rem;
    font-weight: 700;
}

.badge {
    background: var(--primary);
    color: white;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: 0 4px 0 rgba(23, 98, 145, 0.8);
}

.code-block {
    background: #1e293b;
    color: #f8fafc;
    border-radius: var(--border-radius);
    padding: 20px;
    margin: 20px 0;
    overflow-x: auto;
    font-family: 'Fira Code', monospace;
    font-size: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 4px 15px rgba(0, 0, 0, 0.4);
}

.code-block pre {
    margin: 0;
}

.output {
    background: rgba(46, 204, 113, 0.1);
    border-left: 5px solid var(--success);
    padding: 20px;
    margin: 20px 0;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    font-family: monospace;
    white-space: pre;
}

.hint {
    background: rgba(243, 156, 18, 0.1);
    border-left: 5px solid var(--warning);
    padding: 20px;
    margin: 20px 0;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.toggle-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: var(--transition);
    font-weight: 700;
    margin-top: 15px;
    box-shadow: 0 4px 0 rgba(23, 98, 145, 0.8);
}

.toggle-btn:hover {
    transform: translateY(3px);
    box-shadow: 0 2px 0 rgba(23, 98, 145, 0.8);
}

.toggle-btn i {
    margin-right: 10px;
    transition: transform 0.3s ease;
}

.toggle-btn.open i {
    transform: rotate(180deg);
}

.details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.details.open {
    max-height: 2000px;
}

.file-structure {
    background: rgba(31, 41, 55, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 20px;
    font-family: 'Fira Code', monospace;
    margin: 25px 0;
    line-height: 1.8;
    font-size: 0.95rem;
}

.file-structure .dir {
    color: var(--primary);
    font-weight: 700;
}

.file-structure .file {
    color: var(--success);
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.stat-card {
    background: rgba(52, 152, 219, 0.15);
    border-radius: var(--border-radius);
    padding: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: var(--border);
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-align: center;
    backdrop-filter: blur(5px);
}

.stat-card:nth-child(2) {
    background: rgba(155, 89, 182, 0.15);
}

.stat-card:nth-child(3) {
    background: rgba(46, 204, 113, 0.15);
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.stat-card i {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--primary);
}

.stat-card:nth-child(2) i {
    color: var(--secondary);
}

.stat-card:nth-child(3) i {
    color: var(--success);
}

.stat-card h4 {
    font-size: 1.2rem;
    margin-bottom: 12px;
    color: var(--light);
    font-weight: 600;
}

.stat-card p {
    font-size: 2.2rem;
    font-weight: 800;
    color: white;
}

.footer {
    text-align: center;
    padding: 30px 0 20px;
    color: var(--gray);
    font-size: 0.95rem;
    margin-top: 20px;
    font-weight: 600;
}

.controls {
    display: flex;
    gap: 15px;
    margin: 25px 0;
}

.controls button {
    flex: 1;
    background: var(--primary);
    color: white;
    border: none;
    padding: 16px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 700;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 1.05rem;
    box-shadow: 0 5px 0 rgba(23, 98, 145, 0.8);
}

.controls button:hover {
    transform: translateY(3px);
    box-shadow: 0 2px 0 rgba(23, 98, 145, 0.8);
}

.controls button:nth-child(2) {
    background: var(--secondary);
    box-shadow: 0 5px 0 rgba(109, 65, 128, 0.8);
}

.controls button:nth-child(2):hover {
    box-shadow: 0 2px 0 rgba(109, 65, 128, 0.8);
}

.controls button:nth-child(3) {
    background: var(--success);
    box-shadow: 0 5px 0 rgba(33, 145, 81, 0.8);
}

.controls button:nth-child(3):hover {
    box-shadow: 0 2px 0 rgba(33, 145, 81, 0.8);
}

@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: relative;
        top: 0;
        height: auto;
        margin-bottom: 20px;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
    body {
        grid-template-columns: 1fr;
    }
}