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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0f0f23;
    color: #e2e8f0;
    line-height: 1.6;
    font-size: 14px;
}

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    background: linear-gradient(135deg, #1e1e3f, #2d2d5f);
    border-bottom: 1px solid #334155;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-text h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 0.125rem;
}

.brand-text span {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.version-badge {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.status-badge {
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.online {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.main {
    display: flex;
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.sidebar {
    width: 320px;
    background: #1a1a2e;
    border-right: 1px solid #334155;
    display: flex;
    flex-direction: column;
    height: 94vh;
    overflow: hidden;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

/* 桌面版侧边栏滚动条样式 */
@media (min-width: 1025px) {
    .sidebar-nav::-webkit-scrollbar {
        width: 8px;
    }

    .sidebar-nav::-webkit-scrollbar-track {
        background: #1a1a2e;
        border-radius: 4px;
    }

    .sidebar-nav::-webkit-scrollbar-thumb {
        background: #334155;
        border-radius: 4px;
    }

        .sidebar-nav::-webkit-scrollbar-thumb:hover {
            background: #475569;
        }
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #334155;
}

.search-wrapper {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    background: #0f0f23;
    border: 1px solid #475569;
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-input::placeholder {
    color: #64748b;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    fill: #64748b;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.nav-section {
    margin-bottom: 2rem;
}

.nav-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

.api-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.api-category {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.api-category:first-child {
    margin-top: 0;
}

.category-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.5rem 0.75rem;
    background: rgba(30, 30, 63, 0.3);
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.api-item {
    background: rgba(30, 30, 63, 0.5);
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.api-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: transparent;
    transition: background 0.2s ease;
}

.api-item:hover {
    background: rgba(30, 30, 63, 0.8);
    border-color: #6366f1;
    transform: translateX(2px);
}

.api-item:hover::before {
    background: #6366f1;
}

.api-item.active {
    background: rgba(99, 102, 241, 0.1);
    border-color: #6366f1;
}

.api-item.active::before {
    background: #6366f1;
}

.api-name {
    font-weight: 500;
    color: #f8fafc;
    font-size: 0.75rem;
    line-height: 1.3;
    flex: 1;
}

.api-method {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 3px;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.method-get { background: rgba(34, 197, 94, 0.2); color: #86efac; }
.method-post { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.method-put { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.method-delete { background: rgba(239, 68, 68, 0.3); color: #f87171; }

.content {
    flex: 1;
    background: #0f0f23;
}

.content-wrapper {
    padding: 2rem;
    max-width: 1000px;
    height: 94vh;
    overflow-y: auto;
}

/* 桌面版滚动条样式 */
@media (min-width: 1025px) {
    .content-wrapper::-webkit-scrollbar {
        width: 8px;
    }
    
    .content-wrapper::-webkit-scrollbar-track {
        background: #1a1a2e;
        border-radius: 4px;
    }
    
    .content-wrapper::-webkit-scrollbar-thumb {
        background: #334155;
        border-radius: 4px;
    }
    
    .content-wrapper::-webkit-scrollbar-thumb:hover {
        background: #475569;
    }
}

/* 手机版保持原样 */
@media (max-width: 1024px) {
    .content-wrapper {
        height: auto;
        overflow-y: visible;
    }

    /* 手机版布局优化 */
    .main-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        max-height: 50vh;
        overflow: hidden;
        border-right: none;
        border-bottom: 1px solid #334155;
    }

    .sidebar-nav {
        max-height: calc(50vh - 120px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .content {
        flex: 1;
        min-height: 50vh;
    }

    .content-wrapper {
        padding: 1rem;
    }
}

.welcome-container {
    text-align: center;
    padding: 4rem 2rem;
}

.welcome-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 1rem;
}

.welcome-header p {
    font-size: 1.125rem;
    color: #94a3b8;
    margin-bottom: 3rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-card {
    background: rgba(30, 30, 63, 0.5);
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.feature-card:hover {
    background: rgba(30, 30, 63, 0.8);
    border-color: #6366f1;
    transform: translateY(-4px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #f8fafc;
    margin-bottom: 0.75rem;
}

.feature-card p {
    color: #94a3b8;
    line-height: 1.6;
}

.api-header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #334155;
}

.api-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 1rem;
}

.api-url {
    background: rgba(30, 30, 63, 0.5);
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 1rem;
    margin: 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: 'JetBrains Mono', monospace;
}

.api-description {
    font-size: 1.125rem;
    color: #94a3b8;
    line-height: 1.7;
}

.section {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #f8fafc;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 2px;
}

.param-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(30, 30, 63, 0.3);
    border: 1px solid #334155;
    border-radius: 8px;
    overflow: hidden;
    margin: 1rem 0;
}

.param-table th,
.param-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #334155;
}

.param-table th {
    background: rgba(30, 30, 63, 0.8);
    font-weight: 600;
    color: #f8fafc;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.param-table td {
    color: #e2e8f0;
    font-size: 0.875rem;
}

.param-table tr:last-child td {
    border-bottom: none;
}

.param-required {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.param-optional {
    background: rgba(148, 163, 184, 0.2);
    color: #cbd5e1;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.code-block {
    background: #1e1e1e;
    border: 1px solid #3c3c3c;
    border-radius: 8px;
    overflow: hidden;
    margin: 1.5rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.code-header {
    background: #2d2d30;
    padding: 1rem;
    border-bottom: 1px solid #3c3c3c;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.code-header span {
    font-size: 0.875rem;
    font-weight: 600;
    color: #cccccc;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.copy-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.copy-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.code-content {
    padding: 1.5rem;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    overflow-x: auto;
    color: #d4d4d4;
    background: #1e1e1e;
    border-radius: 0 0 8px 8px;
}

/* VSCode风格代码高亮 */
.code-content pre {
    margin: 0;
    color: #d4d4d4;
}

/* JSON语法高亮 */
.json-key { color: #9cdcfe; }
.json-string { color: #ce9178; }
.json-number { color: #b5cea8; }
.json-boolean { color: #569cd6; }
.json-null { color: #569cd6; }
.json-punctuation { color: #d4d4d4; }

/* JavaScript语法高亮 */
.js-keyword { color: #569cd6; }
.js-string { color: #ce9178; }
.js-function { color: #dcdcaa; }
.js-variable { color: #9cdcfe; }
.js-comment { color: #6a9955; font-style: italic; }
.js-operator { color: #d4d4d4; }

/* Shell/cURL语法高亮 */
.shell-command { color: #569cd6; }
.shell-option { color: #9cdcfe; }
.shell-string { color: #ce9178; }
.shell-variable { color: #4fc1ff; }

/* HTTP语法高亮 */
.http-method { color: #569cd6; font-weight: bold; }
.http-url { color: #ce9178; }
.http-header { color: #9cdcfe; }
.http-value { color: #ce9178; }

/* 通用语法高亮 */
.keyword { color: #569cd6; font-weight: 500; }
.string { color: #ce9178; }
.number { color: #b5cea8; }
.comment { color: #6a9955; font-style: italic; }
.function { color: #dcdcaa; }
.variable { color: #9cdcfe; }
.operator { color: #d4d4d4; }
.punctuation { color: #d4d4d4; }
.property { color: #9cdcfe; }
.boolean { color: #569cd6; }
.null { color: #569cd6; }

/* 特定语言高亮 */
.lang-java .type { color: #4ec9b0; }
.lang-swift .type { color: #4ec9b0; }
.lang-go .type { color: #4ec9b0; }
.lang-csharp .type { color: #4ec9b0; }
.lang-php .variable { color: #9cdcfe; }
.lang-python .decorator { color: #4fc1ff; }
.lang-ruby .symbol { color: #4fc1ff; }

/* 行号样式 */
.code-line {
    display: block;
    padding-left: 1rem;
    position: relative;
}

.code-line::before {
    content: attr(data-line);
    position: absolute;
    left: -2rem;
    color: #858585;
    font-size: 0.75rem;
    text-align: right;
    width: 1.5rem;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 1px solid #334155;
    margin-bottom: 1.5rem;
    background: rgba(30, 30, 63, 0.3);
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    gap: 0.25rem;
    padding: 0.5rem;
}

.tab {
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    min-width: fit-content;
}

.tab:hover {
    background: rgba(99, 102, 241, 0.1);
    color: #c7d2fe;
}

.tab.active {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    border-bottom-color: #6366f1;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

@media (max-width: 1024px) {
    .main {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        max-height: 50vh;
        height: auto;
        overflow: hidden;
        border-right: none;
        border-bottom: 1px solid #334155;
    }

    .sidebar-nav {
        max-height: calc(50vh - 120px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-content {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .content-wrapper {
        padding: 1rem;
    }
    
    .welcome-header h2 {
        font-size: 2rem;
    }
    
    .api-title {
        font-size: 2rem;
    }
}
