.api-doc {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.doc-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.doc-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.doc-title h1 {
    margin: 0;
    font-size: 2rem;
}

.doc-meta {
    display: flex;
    gap: 2rem;
    color: #6e6e73;
    font-size: 0.9rem;
}

.doc-section {
    margin-bottom: 2rem;
}

.doc-section h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.endpoint-box {
    background: #f5f5f7;
    padding: 1rem;
    border-radius: var(--border-radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.endpoint-box code {
    font-family: monospace;
    font-size: 1rem;
    flex: 1;
}

.endpoint-box button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: opacity 0.2s;
    margin-left: 0.5rem;
}

.endpoint-box button:hover {
    opacity: 0.9;
}

.endpoint-box button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.endpoint-box .visit-btn {
    background: #4CAF50; /* 使用不同的颜色区分访问按钮 */
}

.copy-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: opacity 0.2s;
}

.copy-btn:hover {
    opacity: 0.9;
}

.params-table table {
    width: 100%;
    border-collapse: collapse;
}

.params-table th,
.params-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.params-table th {
    background: #f5f5f7;
    font-weight: 500;
}

.response-example {
    background: #f5f5f7;
    padding: 1rem;
    border-radius: var(--border-radius);
    overflow-x: auto;
    position: relative;
    padding-top: 3rem; /* 为复制按钮留出空间 */
}

.response-example code {
    font-family: monospace;
    white-space: pre;
}

/* 添加请求方法的样式 */
.doc-title .method {
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    color: white;
    font-weight: 500;
}

.doc-title .method.get {
    background: #4CAF50;  /* 绿色 */
}

.doc-title .method.post {
    background: #2196F3;  /* 蓝色 */
}

.doc-title .method.put {
    background: #FF9800;  /* 橙色 */
}

.doc-title .method.delete {
    background: #F44336;  /* 红色 */
}

.doc-title .method.patch {
    background: #9C27B0;  /* 紫色 */
}

/* 修改 JSON 查看器样式 */
.json-viewer {
    font-family: Monaco, Consolas, monospace;
    font-size: 14px;
    line-height: 1.6;
    background: #f8f9fa;
    border-radius: var(--border-radius);
    overflow-x: auto;
    padding: 1rem;
    white-space: pre;
}

.json-viewer .json-line {
    display: flex;
    align-items: flex-start;
}

.json-viewer .line-number {
    color: #6c757d;
    padding-right: 1rem;
    user-select: none;
    min-width: 3em;
    text-align: right;
}

.json-viewer .content {
    flex: 1;
    font-family: Monaco, Consolas, monospace; /* 确保等宽字体 */
}

/* 确保空格不会被压缩 */
.json-viewer .content span {
    white-space: pre;
}

/* JSON 语法高亮颜色 */
.json-viewer .json-key { color: #2e86de; }
.json-viewer .json-string { color: #10ac84; }
.json-viewer .json-number { color: #ee5253; }
.json-viewer .json-boolean { color: #ff9f43; }
.json-viewer .json-null { color: #8395a7; }
.json-viewer .json-mark { color: #576574; }

/* 复制按钮样式 */
.response-example .copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.response-example .copy-btn:hover {
    opacity: 0.9;
} 