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

/* 核心字体策略：英文数字用 Nunito，中文使用系统默认（苹方/微软雅黑等） */
body,
button,
input,
textarea,
.btn,
.copy-btn,
.token-display,
.endpoint,
.method,
.desc-badge,
.response-demo,
.footer-note,
.markdown-desc,
.param-table,
.base-url,
.badge {
    font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans CJK SC", system-ui, sans-serif;
}

/* 代码块保留等宽字体，但英文数字依然保持 Nunito 风格，代码专用字体保持可读性 */
code,
pre,
.endpoint,
.token-display,
.base-url {
    font-family: "Nunito", "SF Mono", "JetBrains Mono", "Cascadia Code", monospace;
}

body {
    background: #f5f7fb;
    color: #0f172a;
    line-height: 1.5;
    padding: 1rem;
    min-height: 100vh;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    width: 100%;
}

/* 手机端为主, 同时适配大屏幕居中 */
@media (min-width: 768px) {
    body {
        padding: 2rem 1.5rem;
    }

    .container {
        max-width: 980px;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1100px;
    }
}

/* 头部区域自适应 */
.doc-header {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e2edf2;
    padding-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 640px) {
    .doc-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-end;
    }
}

.title-section h1 {
    font-weight: 800;
    font-size: 1.65rem;
    background: linear-gradient(135deg, #1e293b, #2d4a7c);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    letter-spacing: -0.2px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.title-section p {
    color: #475569;
    margin-top: 0.2rem;
    font-size: 0.9rem;
}

.badge {
    background: #eef2ff;
    color: #1e40af;
    padding: 0.2rem 0.7rem;
    border-radius: 30px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
}

.base-url {
    background: #f1f5f9;
    border-radius: 18px;
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    border: 1px solid #e2e8f0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    word-break: break-all;
}

.base-url span {
    color: #3b82f6;
    font-weight: 700;
}

/* 鉴权卡片 (移动优先) */
.auth-token-section {
    background: linear-gradient(105deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 28px;
    border: 1px solid #e2edf2;
    padding: 1rem 1.2rem;
    margin-bottom: 1.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

@media (min-width: 540px) {
    .auth-token-section {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
    }
}

.auth-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.token-display {
    font-family: monospace;
    background: #0f172a;
    color: #e2e8f0;
    padding: 0.5rem 1rem;
    border-radius: 48px;
    font-size: 0.7rem;
    word-break: break-all;
    flex: 1;
    min-width: 180px;
}

.btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    border: none;
    background: #3b82f6;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.btn-outline {
    background: white;
    border: 1px solid #cbd5e1;
    color: #1e293b;
}

/* 搜索栏 */
.search-bar {
    margin: 1rem 0 1.5rem;
}

.search-bar input {
    width: 100%;
    padding: 0.75rem 1.2rem;
    border-radius: 48px;
    border: 1px solid #cbd5e6;
    background: white;
    font-size: 0.9rem;
    font-family: "Nunito", system-ui;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
    transition: all 0.2s;
}

/* 网格移动端单列，平板双列 */
.api-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (min-width: 680px) {
    .api-grid {
        grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
        gap: 1.8rem;
    }
}

.api-card {
    background: white;
    border-radius: 28px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03), 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #eef2f8;
    overflow: hidden;
    transition: all 0.2s ease;
}

.card-header {
    background: #ffffff;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid #edf2f7;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.6rem;
}

.method {
    font-weight: 800;
    font-size: 0.7rem;
    padding: 0.2rem 0.75rem;
    border-radius: 40px;
    background: #eef2ff;
    color: #1e40af;
}

.method.post {
    background: #dcfce7;
    color: #15803d;
}

.method.get {
    background: #e0f2fe;
    color: #0369a1;
}

.endpoint {
    font-family: monospace;
    font-size: 0.85rem;
    font-weight: 600;
    background: #f8fafc;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    word-break: break-all;
}

.desc-badge {
    margin-left: auto;
    font-size: 0.65rem;
    background: #f1f5f9;
    padding: 0.2rem 0.7rem;
    border-radius: 30px;
    color: #334155;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.card-body {
    padding: 1.2rem;
}

.markdown-desc {
    margin-bottom: 1.2rem;
    font-size: 0.85rem;
    color: #1e293b;
    background: #fafcff;
    padding: 0.7rem;
    border-radius: 20px;
    border-left: 3px solid #3b82f6;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.param-table {
    width: 100%;
    font-size: 0.8rem;
    border-collapse: collapse;
    margin: 1rem 0;
    background: #f9fafb;
    border-radius: 18px;
    overflow: hidden;
}

.param-table th {
    text-align: left;
    padding: 0.6rem 0.8rem;
    background: #f1f5f9;
    font-weight: 700;
    width: 28%;
}

.param-table td {
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid #eef2f6;
}

pre {
    background: #0f172a;
    padding: 0.9rem;
    border-radius: 18px;
    overflow-x: auto;
    margin: 0.9rem 0;
    font-size: 0.7rem;
}

code {
    font-family: "Nunito", "SF Mono", monospace;
    font-size: 0.7rem;
}

.copy-btn {
    background: #1e293b;
    border: none;
    color: white;
    padding: 0.25rem 0.8rem;
    border-radius: 40px;
    font-size: 0.65rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.1s;
    float: right;
    margin-top: -1.6rem;
    margin-right: 0.3rem;
    position: relative;
    top: -0.2rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    z-index: 5;
}

.response-demo {
    background: #f1f5f9;
    border-radius: 18px;
    padding: 0.7rem;
    font-family: monospace;
    font-size: 0.7rem;
    margin-top: 0.9rem;
    border: 1px solid #e2e8f0;
}

.footer-note {
    text-align: center;
    margin-top: 2rem;
    padding: 1.5rem 1rem;
    background: #f1f5f9;
    border-radius: 28px;
    color: #475569;
    font-size: 0.8rem;
    border: 1px solid #e2e8f0;
}

.highlight {
    background: #fef9c3;
    color: #854d0e;
    padding: 0 2px;
    border-radius: 8px;
}

.svg-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    display: inline-block;
    flex-shrink: 0;
}

.icon-md {
    width: 20px;
    height: 20px;
}

/* 对齐优化，手机端无溢出 */
.param-table td,
.param-table th {
    word-break: break-word;
}

button {
    background: none;
    border: none;
}

@media (max-width: 480px) {
    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .desc-badge {
        margin-left: 0;
    }

    .btn-group {
        width: 100%;
        justify-content: space-between;
    }

    .token-display {
        font-size: 0.65rem;
    }
}