
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-body: #f3f6fc;
    --bg-surface: rgba(255, 255, 255, 0.96);
    --bg-nav: rgba(255, 255, 255, 0.92);
    --text-primary: #0f2b3d;
    --text-secondary: #334155;
    --text-muted: #4a627a;
    --border-light: rgba(148, 163, 184, 0.3);
    --card-bg: #ffffff;
    --card-highlight: #eef2ff;
    --hover-bg: rgba(59, 130, 246, 0.08);
    --link-color: #2563eb;
    --tree-bg: #ffffff;
    --tree-hover: #f1f5f9;
    --footer-bg: rgba(255, 255, 255, 0.85);
    --badge-bg: #eef2ff;
    --badge-text: #2563eb;
    --hero-overlay: linear-gradient(135deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.4) 100%);
}

html[data-theme="dark"] {
    --bg-body: #0a0c12;
    --bg-surface: rgba(22, 26, 35, 0.96);
    --bg-nav: rgba(18, 22, 30, 0.92);
    --text-primary: #eef2ff;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-light: rgba(71, 85, 105, 0.5);
    --card-bg: #1e293b;
    --card-highlight: #2d3a4e;
    --hover-bg: rgba(59, 130, 246, 0.2);
    --link-color: #60a5fa;
    --tree-bg: #1e293b;
    --tree-hover: #2d3a4e;
    --footer-bg: rgba(18, 22, 30, 0.85);
    --badge-bg: #2d3a4e;
    --badge-text: #90cdf4;
    --hero-overlay: linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.6) 100%);
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: var(--bg-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background 0.2s ease, color 0.2s ease;
    color: var(--text-primary);
    -webkit-tap-highlight-color: transparent; /* 移除移动端点击高亮 */
}

.modern-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-nav);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.8rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.nav-logo-area {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.nav-logo-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.nav-brand-text {
    font-weight: 700;
    font-size: 1.25rem;
    background: linear-gradient(135deg, #1e4a76, #3b82f6);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    letter-spacing: -0.3px;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    background: var(--hover-bg);
    padding: 0.3rem;
    border-radius: 60px;
    backdrop-filter: blur(4px);
}

.nav-link {
    padding: 0.5rem 1.2rem;
    border-radius: 40px;
    font-weight: 550;
    font-size: 0.95rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.nav-link:active {
    transform: scale(0.96);
}

.nav-link:hover {
    background: rgba(59, 130, 246, 0.12);
    color: var(--link-color);
}

.nav-link.active {
    background: #3b82f6;
    color: white;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

.theme-toggle {
    background: var(--hover-bg);
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    backdrop-filter: blur(4px);
    color: var(--text-secondary);
    -webkit-tap-highlight-color: transparent;
}

.theme-toggle:active {
    transform: scale(0.92);
}

.theme-toggle:hover {
    background: rgba(59, 130, 246, 0.3);
    transform: scale(1.05);
}

.main-content {
    flex: 1;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.hero-section {
    border-radius: 2rem;
    overflow: hidden;
    margin-bottom: 2rem;
    position: relative;
    background-image: url('pic.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 20px 35px -12px rgba(0, 0, 0, 0.2);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--hero-overlay);
    backdrop-filter: brightness(0.92);
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 2rem;
}

.hero-logo {
    width: 110px;
    height: 110px;
    object-fit: contain;
    margin-bottom: 1.2rem;
    filter: drop-shadow(0 8px 20px rgba(0,0,0,0.3));
    background: rgba(255,255,255,0.5);
    border-radius: 30px;
    padding: 10px;
    backdrop-filter: blur(4px);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: white;
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.hero-sub {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.9);
    font-weight: 500;
}

.page-container {
    background: var(--bg-surface);
    border-radius: 2rem;
    box-shadow: 0 20px 35px -12px rgba(0, 0, 0, 0.08);
    padding: 2rem 2rem;
    transition: background 0.2s;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(125deg, #0f2b3d, #2563eb);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    margin-bottom: 1.5rem;
    border-left: 5px solid #3b82f6;
    padding-left: 1rem;
}

/* 树型目录样式 */
.tree-view {
    margin: 1.5rem 0;
    background: var(--tree-bg);
    border-radius: 1.2rem;
    padding: 0.8rem;
    border: 1px solid var(--border-light);
}

.tree-node {
    margin-left: 0;
    list-style: none;
    user-select: none;
}

.tree-node .tree-node {
    margin-left: 1.8rem;
}

.tree-node-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
    border-radius: 0.8rem;
    cursor: pointer;
    transition: background 0.2s;
    font-weight: 550;
    color: var(--text-primary);
    -webkit-tap-highlight-color: transparent;
}

.tree-node-header:active {
    transform: scale(0.98);
}

.tree-node-header:hover {
    background: var(--tree-hover);
}

.tree-toggle {
    font-size: 0.8rem;
    width: 1.5rem;
    display: inline-block;
    color: var(--text-muted);
}

.tree-icon {
    font-size: 1.2rem;
    width: 1.8rem;
}

.tree-name {
    flex: 1;
    font-weight: 500;
}

.tree-leaf-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem 0.6rem 2rem;
    border-radius: 0.8rem;
    text-decoration: none;
    color: var(--text-secondary);
    transition: all 0.2s;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.tree-leaf-item:active {
    transform: scale(0.98);
}

.tree-leaf-item:hover {
    background: var(--tree-hover);
    transform: translateX(4px);
}

.tree-leaf-item a {
    text-decoration: none;
    color: inherit;
    display: contents;
}

.tree-path {
    font-size: 0.7rem;
    background: var(--badge-bg);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    color: var(--badge-text);
    font-family: monospace;
}

.tree-arrow {
    color: var(--text-muted);
    font-size: 1rem;
}

.disabled-item {
    opacity: 0.6;
    cursor: default;
    filter: grayscale(0.1);
}

.disabled-item:hover {
    transform: none;
    background: transparent;
}

.coming-item {
    cursor: pointer;
}

.coming-name, .disabled-name {
    color: var(--text-muted);
}

.tree-badge {
    font-size: 0.65rem;
    background: var(--badge-bg);
    padding: 0.2rem 0.6rem;
    border-radius: 30px;
    color: var(--badge-text);
}

/* 更新日志等原有组件适配深色 */
.update-card {
    background: var(--card-bg);
    border-radius: 1.2rem;
    padding: 1.2rem 1.5rem;
    border-left: 4px solid #3b82f6;
    transition: all 0.2s;
    color: var(--text-secondary);
    -webkit-tap-highlight-color: transparent;
}

.update-card:active {
    transform: scale(0.98);
}

.update-date {
    font-size: 0.75rem;
    color: #3b82f6;
    font-weight: 600;
}

.update-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stats-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.badge-count {
    background: var(--badge-bg);
    padding: 0.2rem 0.8rem;
    border-radius: 30px;
    font-weight: 500;
    color: var(--badge-text);
}

.site-footer {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto 1.5rem;
    background: var(--footer-bg);
    backdrop-filter: blur(12px);
    border-radius: 1.8rem;
    padding: 1.6rem 2rem;
    border: 1px solid var(--border-light);
}

.footer-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1.5rem;
}

.footer-col p {
    margin: 0.35rem 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.contact-row {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--hover-bg);
    padding: 0.2rem 1rem;
    border-radius: 40px;
    cursor: pointer;
    color: var(--link-color);
    font-size: 0.8rem;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.contact-link:active {
    transform: scale(0.96);
}

.contact-link:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
}

hr {
    margin: 1rem 0;
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-light), transparent);
}

.copyright {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

@media (max-width: 768px) {
    .nav-container {
        padding: 0.6rem 1rem;
        gap: 0.8rem;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
    }
    
    .nav-logo-area {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        gap: 0.6rem;
    }
    
    .nav-logo-icon {
        width: 28px;
        height: 28px;
    }
    
    .nav-brand-text {
        font-size: 1rem;
    }
    
    .theme-toggle {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
        flex-shrink: 0;
    }
    
    .nav-links {
        width: 100%;
        justify-content: center;
        padding: 0.4rem;
        gap: 0.5rem;
        display: flex;
        flex-wrap: nowrap;
        order: 3;
    }
    
    .nav-link {
        padding: 0.4rem 0.9rem;
        font-size: 0.85rem;
        flex: 0 0 auto;
        text-align: center;
        white-space: nowrap;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .hero-section {
        min-height: 300px;
        border-radius: 1.2rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-content {
        padding: 1rem;
    }
    
    .hero-logo {
        width: 60px;
        height: 60px;
        margin-bottom: 0.8rem;
        border-radius: 20px;
        padding: 8px;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-sub {
        font-size: 0.9rem;
    }
    
    .page-container {
        padding: 1.2rem;
        border-radius: 1.2rem;
    }
    
    .section-title {
        font-size: 1.3rem;
        margin-bottom: 1rem;
        padding-left: 0.8rem;
    }
    
    .tree-view {
        padding: 0.5rem;
        margin: 1rem 0;
    }
    
    .tree-node .tree-node {
        margin-left: 1rem;
    }
    
    .tree-node-header {
        padding: 0.5rem 0.6rem;
        gap: 0.4rem;
    }
    
    .tree-toggle {
        font-size: 0.7rem;
        width: 1.2rem;
    }
    
    .tree-icon {
        font-size: 1rem;
        width: 1.5rem;
    }
    
    .tree-name {
        font-size: 0.9rem;
    }
    
    .tree-leaf-item {
        padding: 0.5rem 0.6rem 0.5rem 1.5rem;
        gap: 0.4rem;
    }
    
    .tree-path {
        display: none;
    }
    
    .tree-badge {
        font-size: 0.55rem;
        padding: 0.15rem 0.5rem;
    }
    
    .update-card {
        padding: 1rem;
        margin-bottom: 0.8rem;
    }
    
    .update-title {
        font-size: 1rem;
    }
    
    .update-date {
        font-size: 0.7rem;
    }
    
    .stats-bar {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
        margin-top: 1.5rem;
        padding-top: 0.8rem;
    }
    
    .site-footer {
        padding: 1rem 1.2rem;
        margin: 0 0.8rem 1rem;
        border-radius: 1.2rem;
    }
    
    .footer-grid {
        flex-direction: column;
        gap: 1rem;
    }
    
    .footer-col {
        text-align: center;
    }
    
    .footer-col p {
        font-size: 0.8rem;
    }
    
    .contact-row {
        justify-content: center;
        gap: 1rem;
    }
    
    .contact-link {
        padding: 0.15rem 0.8rem;
        font-size: 0.75rem;
    }
    
    .copyright {
        font-size: 0.7rem;
    }
    
    .nav-link,
    .theme-toggle,
    .tree-node-header,
    .tree-leaf-item,
    .contact-link,
    .update-card {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .nav-link {
        min-height: 38px;
    }
    
    .theme-toggle {
        min-height: 36px;
    }
    
    .tree-node-header,
    .tree-leaf-item {
        min-height: 44px;
    }
    
    .contact-link {
        min-height: 32px;
    }
    
    .tree-view {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tree-node {
        min-width: max-content;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0.5rem 0.8rem;
    }
    
    .nav-brand-text {
        font-size: 0.95rem;
    }
    
    .nav-logo-icon {
        width: 24px;
        height: 24px;
    }
    
    .nav-link {
        padding: 0.35rem 0.7rem;
        font-size: 0.75rem;
    }
    
    .theme-toggle {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    
    .hero-section {
        min-height: 250px;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .hero-sub {
        font-size: 0.8rem;
    }
    
    .hero-logo {
        width: 50px;
        height: 50px;
    }
    
    .section-title {
        font-size: 1.2rem;
    }
    
    .page-container {
        padding: 0.8rem;
    }
    
    .tree-node-header {
        padding: 0.4rem 0.5rem;
    }
    
    .tree-leaf-item {
        padding: 0.4rem 0.5rem 0.4rem 1.2rem;
    }
    
    .tree-icon {
        font-size: 0.9rem;
        width: 1.3rem;
    }
    
    .tree-name {
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        min-height: 200px;
    }
    
    .hero-logo {
        width: 45px;
        height: 45px;
    }
    
    .hero-title {
        font-size: 1.3rem;
    }
    
    .nav-links {
        width: auto;
    }
    
    .main-content {
        padding: 0.8rem;
    }
}