/* --- CSS 变量定义 (方便主题切换) --- */
:root {
    --bg-color: #1a202c;
    --surface-color: #2d3748;
    --primary-color: #4299e1;
    --text-color: #e2e8f0;
    --text-muted-color: #a0aec0;
    --border-color: #4a5568;
    --accent-gradient: linear-gradient(90deg, #4299e1, #38b2ac);
    --shadow-color: rgba(0, 0, 0, 0.25);
}

/* --- 基础与重置样式 --- */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.7;
    margin: 0;
    padding: 2rem 1rem;
    -webkit-text-size-adjust: 100%; /* 防止移动端字体自动缩放 */
    scroll-behavior: smooth; /* 全局平滑滚动 */
}

/* --- 自定义滚动条 --- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background-color: var(--primary-color);
}

/* --- 主容器与标题 --- */
.container {
    max-width: 960px;
    margin: 0 auto;
    background-color: var(--surface-color);
    border-radius: 16px;
    box-shadow: 0 10px 30px var(--shadow-color);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.main-header {
    background: var(--accent-gradient);
    color: white;
    padding: 2rem;
    text-align: center;
}

.main-header h1 {
    margin: 0;
    font-size: 2.5em;
    font-weight: 700;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}

.main-header .subtitle {
    margin: 0.25rem 0 0;
    font-size: 1.3em;
    font-weight: 400;
    opacity: 0.9;
}

/* --- 标签页导航 --- */
.tab-nav {
    display: flex;
    background-color: var(--bg-color);
}

.tab-link {
    flex-grow: 1;
    padding: 1rem;
    border: none;
    outline: none;
    cursor: pointer;
    font-size: 1.2em;
    font-weight: 500;
    color: var(--text-muted-color);
    background-color: transparent;
    position: relative;
    transition: color 0.3s ease, background-color 0.3s ease;
}

.tab-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--accent-gradient);
    transition: width 0.3s ease;
}

.tab-link:hover {
    color: var(--text-color);
}

.tab-link.active {
    color: white;
    font-weight: 700;
}

.tab-link.active::after {
    width: 70%;
}

/* --- 标签页内容 --- */
.tab-content {
    display: none;
    padding: 2rem;
    animation: fadeIn 0.6s ease-in-out;
}

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

/* --- 内容排版 --- */
h2 {
    font-size: 1.8em;
    color: white;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    margin-top: 0;
    margin-bottom: 1.5rem;
}

/* --- 插件卡片样式 --- */
.plugin-card {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.plugin-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.plugin-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25em;
    font-weight: 700;
    color: white;
    margin-top: 0;
    margin-bottom: 1rem;
}

.plugin-header .icon {
    width: 24px;
    height: 24px;
    fill: var(--primary-color);
    flex-shrink: 0;
}

.plugin-card p, .plugin-card ul {
    color: var(--text-muted-color);
    margin-bottom: 1rem;
}

.plugin-card ul {
    padding-left: 1.5rem;
    margin-bottom: 0;
}

.plugin-card li {
    margin-bottom: 0.75rem;
    line-height: 1.8;
}

.plugin-card li strong {
    color: var(--text-color);
}

/* --- 特殊元素样式 --- */
code, .code-inline {
    background-color: var(--border-color);
    color: #90cdf4;
    padding: 0.2em 0.5em;
    border-radius: 6px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    font-size: 0.9em;
    word-break: break-all; /* 强制代码块内换行 */
}

.command-block {
    background-color: #141922;
    padding: 1rem;
    border-radius: 8px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    font-size: 0.9em;
    line-height: 1.6;
    border: 1px solid var(--border-color);
    margin-top: 1rem;
}

.api-category h5 {
    font-size: 1.1em;
    color: var(--text-muted-color);
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.api-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.api-grid .code-inline {
    transition: background-color 0.3s, color 0.3s;
    cursor: default;
}

/* 使跳转链接更具交互性 */
.api-grid a.code-inline {
    cursor: pointer;
    text-decoration: none;
}

.api-grid .code-inline:hover {
    background-color: var(--primary-color);
    color: white;
}

.notice {
    background-color: rgba(250, 240, 137, 0.1);
    border-left: 4px solid #f6e05e;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    border-radius: 8px;
    color: #faf089;
}

.notice strong {
    color: white;
}

/* --- 折叠区域样式 --- */
.collapsible-section {
    background-color: #141922;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 1.5rem;
    overflow: hidden;
}
.collapsible-section summary {
    padding: 1rem;
    font-weight: 700;
    color: var(--text-color);
    cursor: pointer;
    outline: none;
    display: block;
    position: relative;
    transition: background-color 0.2s ease;
}
.collapsible-section summary::marker {
    color: var(--primary-color);
}
.collapsible-section summary:hover {
    background-color: rgba(255, 255, 255, 0.05);
}
.command-list {
    padding: 0 1.5rem 1.5rem 1.5rem;
    margin: 0;
    list-style-type: none;
    color: var(--text-muted-color);
}
.command-list li {
    margin-bottom: 0.8rem;
    line-height: 1.6;
}
.command-list li:last-child {
    margin-bottom: 0;
}
.command-list .code-inline {
    margin-right: 0.75em;
}

/* --- 移动端响应式优化 --- */
@media screen and (max-width: 768px) {
    body {
        padding: 0; /* 移除body边距，让容器占满 */
    }

    .container {
        border-radius: 0;
        border: none;
        box-shadow: none;
    }

    .main-header {
        padding: 1.5rem 1rem;
    }
    .main-header h1 {
        font-size: 1.8em;
    }
    
    .main-header .subtitle {
        font-size: 1.1em;
        margin-top: 0.1rem;
    }
    
    .tab-link {
        font-size: 1em;
        padding: 0.8rem 0.5rem;
    }

    /* 核心改动：缩小移动端的内容边距 */
    .tab-content {
        padding: 1.5rem 1rem; 
    }

    .plugin-card {
        padding: 1.25rem 1rem;
    }
    
    .plugin-header {
        font-size: 1.15em;
    }
}