/* 文档页面样式 */
:root {
    --primary-color: #0066FF;
    --text-color: #333333;
    --border-color: #EAEAEA;
    --bg-light: #F8FAFC;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-color);
    background: #FFFFFF;
    line-height: 1.6;
}

/* 头部样式 */
.doc-header {
    background: var(--bg-light);
    padding: 40px 0;
    border-bottom: 1px solid var(--border-color);
}

.header-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.doc-header h1 {
    margin: 0 0 10px 0;
    font-size: 28px;
    color: #1A1A1A;
}

.doc-meta {
    color: #666666;
    font-size: 14px;
}

.doc-meta span {
    margin-right: 20px;
}

/* 搜索框样式 */
.search-container {
    background: white;
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

.search-box {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 40px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

.search-box i {
    position: absolute;
    left: 32px;
    top: 50%;
    transform: translateY(-50%);
    color: #666666;
}

/* 文档内容样式 */
.doc-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.doc-intro {
    margin-bottom: 40px;
    color: #666666;
}

.doc-section {
    margin-bottom: 40px;
}

.doc-section h2 {
    font-size: 20px;
    margin: 0 0 20px 0;
    color: #1A1A1A;
}

.doc-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.doc-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-color);
    background: var(--bg-light);
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-tap-highlight-color: transparent;
}

.doc-link::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: rgba(0, 102, 255, 0.1);
    border-radius: 8px;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
}

.doc-link:active::after,
.doc-link.touch-active::after {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* 移动端触摸优化 */
@media (hover: none) {
    .doc-link:hover {
        transform: none;
    }
}

.clicked {
    animation: clickPulse 0.2s ease-out;
}

@keyframes clickPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.98);
    }
    100% {
        transform: scale(1);
    }
}

.link-number {
    color: #666666;
    margin-right: 8px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    /* 头部样式调整 */
    .doc-header {
        padding: 20px 0;
    }

    .header-container {
        padding: 0 16px;
    }

    .doc-header h1 {
        font-size: 20px;
        line-height: 1.4;
    }

    .doc-meta {
        font-size: 12px;
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }

    .doc-meta span {
        margin-right: 0;
    }

    /* 搜索框调整 */
    .search-container {
        padding: 12px 0;
    }

    .search-box {
        padding: 0 16px;
    }

    .search-box input {
        padding: 10px 36px;
        font-size: 14px;
        border-width: 1px;
    }

    .search-box i {
        left: 28px;
        font-size: 16px;
    }

    /* 文档内容调整 */
    .doc-container {
        padding: 20px 16px;
    }

    .doc-intro {
        margin-bottom: 24px;
        font-size: 14px;
    }

    .doc-section {
        margin-bottom: 24px;
    }

    .doc-section h2 {
        font-size: 16px;
        margin-bottom: 12px;
        padding: 8px 12px;
        background: var(--bg-light);
        border-radius: 6px;
    }

    .doc-links {
        gap: 8px;
    }

    .doc-link {
        padding: 10px 12px;
        font-size: 14px;
        border-radius: 6px;
        transform: translateZ(0);
    }

    .link-number {
        font-size: 13px;
    }

    /* 触摸优化 */
    .doc-link {
        min-height: 44px;
        touch-action: manipulation;
    }

    /* 滚动优化 */
    .doc-container {
        -webkit-overflow-scrolling: touch;
    }

    /* 间距优化 */
    .doc-section + .doc-section {
        margin-top: 32px;
    }
}

/* 小屏幕手机适配 */
@media (max-width: 375px) {
    .doc-header h1 {
        font-size: 18px;
    }

    .doc-link {
        padding: 8px 10px;
        font-size: 13px;
    }

    .search-box input {
        padding: 8px 32px;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background: #1a1a1a;
        color: #e0e0e0;
    }

    .doc-header {
        background: #262626;
        border-bottom-color: #333;
    }

    .search-container {
        background: #1a1a1a;
        border-bottom-color: #333;
    }

    .search-box input {
        background: #262626;
        border-color: #333;
        color: #e0e0e0;
    }

    .doc-link {
        background: #262626;
    }

    .doc-link:hover {
        background: #333;
    }

    .doc-section h2 {
        color: #e0e0e0;
    }

    .link-number {
        color: #888;
    }
}

/* 安全区域适配 */
@supports(padding: max(0px)) {
    .doc-header,
    .search-container,
    .doc-container {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }
}

/* 动画优化 */
@media (prefers-reduced-motion: reduce) {
    .doc-link {
        transition: none;
    }
}

/* 优化链接加载动画 */
.doc-link:not(.visible) {
    opacity: 0;
    transform: translateY(10px);
}

.doc-link.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* 优化点击状态 */
.doc-link:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

/* 添加加载指示器 */
.doc-link.clicked::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, var(--primary-color), transparent);
    animation: loadingBar 0.5s ease-out forwards;
}

@keyframes loadingBar {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

/* 添加模块导航样式 */
.module-nav {
    background: #FFFFFF;
    border-bottom: 1px solid var(--border-color);
    padding: 83px 0px 0px;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 20px;
}

.module-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    color: #666666;
    text-decoration: none;
    font-size: 15px;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

.module-tab i {
    font-size: 20px;
}

.module-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.module-tab:hover {
    color: var(--primary-color);
}

/* 模块内容样式 */
.module-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.module-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.module-content.active {
    display: block;
}

.module-header {
    margin-bottom: 40px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 10px;
        gap: 10px;
    }

    .module-tab {
        padding: 12px 8px;
        font-size: 13px;
        flex-direction: column;
        gap: 4px;
    }

    .module-tab i {
        font-size: 18px;
    }

    .module-container {
        padding: 20px 16px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
} 