/* ApiHub Theme - Modern Style */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --dark: #1e293b;
    --gray-900: #0f172a;
    --gray-800: #1e293b;
    --gray-700: #334155;
    --gray-600: #475569;
    --gray-500: #64748b;
    --gray-400: #94a3b8;
    --gray-300: #cbd5e1;
    --gray-200: #e2e8f0;
    --gray-100: #f1f5f9;
    --gray-50: #f8fafc;
    --white: #ffffff;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--gray-700);
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; transition: all 0.2s; }
a:hover { color: var(--primary-dark); }

.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* ========== Navbar ========== */
.apihub-navbar {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
}

.navbar-brand:hover { color: var(--primary); }
.navbar-brand img { height: 32px; }
.navbar-brand .logo-text { color: inherit; }

.navbar-menu { display: flex; gap: 2px; }

.nav-link {
    padding: 8px 14px;
    border-radius: 6px;
    color: var(--gray-600);
    font-weight: 500;
    font-size: 14px;
    transition: all 0.15s;
}

.nav-link:hover { background: var(--gray-100); color: var(--gray-900); }
.nav-link.active { background: var(--primary); color: white; }

.navbar-search form {
    display: flex;
    background: var(--gray-100);
    border-radius: 6px;
    overflow: hidden;
}

.search-input {
    width: 200px;
    padding: 8px 12px;
    border: none;
    background: transparent;
    font-size: 14px;
    outline: none;
}

.search-input::placeholder { color: var(--gray-400); }

.search-btn {
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 14px;
}

.search-btn:hover { color: var(--gray-600); }

.navbar-toggle { display: none; }


/* ========== Hero Section ========== */
.hero-section {
    background: var(--gray-900);
    padding: 48px 0;
    text-align: center;
}

.hero-content { color: white; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }

.hero-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
}

.hero-subtitle {
    font-size: 16px;
    color: var(--gray-400);
    margin-bottom: 32px;
}

.hero-search {
    width: 100%;
    max-width: 800px;
    margin: 0 auto 32px;
}

.hero-search form {
    display: flex;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.hero-search-input {
    flex: 1;
    padding: 14px 16px;
    border: none;
    font-size: 15px;
    outline: none;
}

.hero-search-btn {
    padding: 14px 24px;
    background: var(--primary);
    color: white;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.hero-search-btn:hover { background: var(--primary-dark); }

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
}

.stat-item { text-align: center; }
.stat-num { display: block; font-size: 32px; font-weight: 700; color: white; }
.stat-label { font-size: 14px; color: var(--gray-400); }

/* ========== Page Header ========== */
.page-header {
    background: var(--gray-50);
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-200);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    margin-bottom: 12px;
    color: var(--gray-500);
}

.breadcrumb a { color: var(--gray-600); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { color: var(--gray-400); }
.breadcrumb .current { color: var(--gray-800); }

.page-title { font-size: 20px; font-weight: 700; margin: 0; color: var(--gray-900); }

/* ========== Main Content ========== */
.main-content { padding: 12px 0; }

.content-wrapper { display: flex; gap: 12px; }
.content-main { flex: 1; min-width: 0; }
.content-sidebar { width: 300px; flex-shrink: 0; }
.content-wrapper.no-sidebar .content-main { max-width: 100%; }


/* ========== API Detail Section ========== */
.api-detail-section,
.api-tester-section,
.api-faq-section {
    background: white;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid var(--gray-200);
}

.api-title-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-100);
}

.api-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.api-badges { display: flex; gap: 8px; }

.badge {
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.badge.method-get { 
    background: linear-gradient(135deg, #10b981 0%, #059669 100%); 
    color: white;
}

.badge.method-post { 
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); 
    color: white;
}

.badge.method-put { 
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); 
    color: white;
}

.badge.method-delete { 
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); 
    color: white;
}

.badge-format { 
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #475569;
    border: 1px solid #cbd5e1;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========== API Blocks ========== */
.api-block {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-100);
}

.api-block:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.block-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.api-description {
    color: var(--gray-600);
    line-height: 1.7;
    font-size: 14px;
}

.api-description p { margin-bottom: 12px; }
.api-description p:last-child { margin-bottom: 0; }

/* URL Box */
.api-url-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--gray-900);
    padding: 12px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.api-url {
    flex: 1;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 14px;
    color: #a5f3fc;
    word-break: break-all;
    background: none;
}

.btn-copy {
    padding: 8px 16px;
    background: rgba(255,255,255,0.1);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-copy:hover { background: rgba(255,255,255,0.2); }

/* ========== Tables ========== */
.table-responsive { overflow-x: auto; }

.params-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.params-table th,
.params-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--gray-100);
}

.params-table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.params-table tr:last-child td { border-bottom: none; }
.params-table tr:hover td { background: var(--gray-50); }

.params-table code {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

.required-yes {
    background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%);
    color: #991b1b;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.required-no {
    background: var(--gray-100);
    color: var(--gray-500);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
}


/* ========== Code Blocks ========== */
.code-block {
    background: var(--gray-900);
    border-radius: var(--radius-sm);
    padding: 12px;
    overflow-x: auto;
    margin: 0;
}

.code-block code {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #e2e8f0;
    background: none !important;
    padding: 0 !important;
}

/* Code Tabs */
.code-tabs {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.code-tab-nav {
    display: flex;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    padding: 6px 6px 0;
    gap: 4px;
    overflow-x: auto;
}

.code-tab-btn {
    padding: 8px 14px;
    background: transparent;
    border: none;
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    transition: all 0.2s;
    white-space: nowrap;
    text-transform: uppercase;
}

.code-tab-btn:hover { color: var(--gray-700); background: var(--gray-100); }

.code-tab-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 -2px 0 var(--primary) inset;
}

.code-panel { display: none; }
.code-panel.active { display: block; }
.code-panel .code-block { border-radius: 0; border: none; }

/* ========== API Tester ========== */
.api-tester {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.tester-request {
    padding: 12px;
    background: var(--gray-50);
}

.request-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.method-select {
    width: 100px;
    padding: 10px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    font-weight: 600;
    font-size: 13px;
    background: white;
    color: var(--gray-700);
    cursor: pointer;
    outline: none;
}

.method-select:focus { border-color: var(--primary); }

.url-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    font-size: 13px;
    font-family: 'SF Mono', monospace;
    outline: none;
}

.url-input:focus { border-color: var(--primary); }

.btn-send {
    padding: 10px 20px;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

.btn-send:hover { background: #059669; }

/* Request Params */
.request-params h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    margin: 0 0 12px;
}

.params-form { display: grid; gap: 12px; }

.param-row {
    display: grid;
    grid-template-columns: 120px 1fr auto;
    gap: 12px;
    align-items: center;
}

.param-label {
    font-weight: 600;
    font-size: 13px;
    color: var(--gray-700);
}

.param-label .required { color: var(--danger); margin-left: 2px; }

.param-input {
    padding: 8px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    font-size: 13px;
    outline: none;
}

.param-input:focus { border-color: var(--primary); }

.param-desc {
    font-size: 12px;
    color: var(--gray-500);
    max-width: 180px;
}

/* Response */
.tester-response { background: white; }

.response-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid var(--gray-200);
}

.response-header h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
}

.response-info { display: flex; gap: 12px; font-size: 12px; }

.response-info .status {
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.response-info .status.success { background: #d1fae5; color: #065f46; }
.response-info .status.error { background: #fee2e2; color: #991b1b; }
.response-info .time { color: var(--gray-500); }

.response-body { padding: 12px; }

.response-content {
    background: var(--gray-900);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin: 0;
    max-height: 300px;
    overflow: auto;
}

.response-content code {
    font-family: 'SF Mono', monospace;
    font-size: 12px;
    color: #a5f3fc;
    white-space: pre-wrap;
    word-break: break-all;
}


/* ========== FAQ Accordion ========== */
.faq-accordion {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.faq-item { border-bottom: 1px solid var(--gray-200); }
.faq-item:last-child { border-bottom: none; }

.faq-question {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    cursor: pointer;
    background: white;
    transition: all 0.2s;
}

.faq-question:hover { background: var(--gray-50); }

.faq-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
}

.faq-question .faq-icon {
    background: var(--primary);
    color: white;
}

.faq-question .faq-text {
    flex: 1;
    font-weight: 600;
    font-size: 14px;
    color: var(--gray-800);
}

.faq-question .icon-arrow {
    color: var(--gray-400);
    transition: transform 0.2s;
}

.faq-item.active .faq-question .icon-arrow { transform: rotate(180deg); }

.faq-answer {
    display: none;
    padding: 0 12px 12px 48px;
    color: var(--gray-600);
    font-size: 14px;
    line-height: 1.7;
}

.faq-answer .faq-icon {
    background: var(--success);
    color: white;
    display: inline-flex;
    vertical-align: middle;
    margin-right: 8px;
}

.faq-item.active .faq-answer { display: block; }

/* ========== Sidebar ========== */
.sidebar-widget {
    background: white;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

.widget-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    padding:6px 12px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-800);
}

.widget-content { padding: 12px; }

.category-list, .hot-list, .toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.category-list li, .hot-list li, .toc-list li {
    padding: 8px 0;
    border-bottom: 1px dashed var(--gray-200);
}

.category-list li:last-child,
.hot-list li:last-child,
.toc-list li:last-child { border-bottom: none; }

.category-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--gray-700);
    font-weight: 500;
}

.category-list a:hover { color: var(--primary); }

.cate-count {
    background: var(--gray-100);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    color: var(--gray-500);
}

.hot-list li { display: flex; align-items: center; gap: 8px; }

.hot-rank {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background: var(--gray-100);
    color: var(--gray-500);
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hot-rank.rank-1 { background: #ef4444; color: white; }
.hot-rank.rank-2 { background: #f97316; color: white; }
.hot-rank.rank-3 { background: #eab308; color: white; }

.hot-title {
    flex: 1;
    color: var(--gray-700);
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hot-title:hover { color: var(--primary); }

.toc-list a {
    color: var(--gray-600);
    font-size: 13px;
    display: block;
}

.toc-list a:hover { color: var(--primary); }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }

.tag-item {
    padding: 4px 10px;
    background: var(--gray-100);
    border-radius: 4px;
    font-size: 12px;
    color: var(--gray-600);
    transition: all 0.2s;
}

.tag-item:hover {
    background: var(--primary);
    color: white;
}


/* ========== Article Tags ========== */
.article-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 0;
    border-top: 1px solid var(--gray-200);
    margin-top: 12px;
}

.article-tags .label {
    font-weight: 600;
    color: var(--gray-600);
    font-size: 13px;
}

.article-tags a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--gray-100);
    border-radius: 4px;
    font-size: 12px;
    color: var(--gray-600);
    border: 1px solid var(--gray-200);
    transition: all 0.2s;
}

.article-tags a:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ========== Article Navigation ========== */
.article-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 12px;
}

.nav-prev, .nav-next {
    background: white;
    border-radius: var(--radius-sm);
    padding: 12px;
    border: 1px solid var(--gray-200);
    transition: all 0.2s;
}

.nav-prev:hover, .nav-next:hover {
    border-color: var(--primary);
}

.nav-next { text-align: right; }

.nav-label {
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 4px;
    display: block;
}

.nav-title {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 14px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nav-prev:hover .nav-title,
.nav-next:hover .nav-title { color: var(--primary); }

/* ========== Pagination ========== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.pagination a {
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
}

.pagination a:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination span.current {
    background: var(--primary);
    color: white;
    border: none;
}

.pagination span.dots {
    background: transparent;
    color: var(--gray-400);
    border: none;
}

/* ========== Footer ========== */
.apihub-footer {
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    padding: 24px 0;
}

.footer-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--gray-200);
}

.footer-brand {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.footer-desc {
    color: var(--gray-500);
    line-height: 1.6;
    font-size: 13px;
    max-width: 300px;
}

.footer-social { display: flex; gap: 8px; margin-top: 12px; }

.footer-social a {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--gray-200);
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.15s;
}

.footer-social a:hover {
    background: var(--primary);
    color: white;
}

.footer-col { min-width: 120px; }

.footer-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-links li { margin-bottom: 8px; }

.footer-links a {
    color: var(--gray-500);
    font-size: 13px;
    transition: all 0.15s;
}

.footer-links a:hover { color: var(--primary); }

.footer-bottom {
    padding-top: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--gray-500);
}

.footer-bottom a { color: var(--gray-500); }
.footer-bottom a:hover { color: var(--primary); }

/* ========== API Cards (Index Page) ========== */
.api-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.api-card {
    background: white;
    border-radius: 10px;
    border: 1px solid var(--gray-200);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    position: relative;
}

.api-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), #8b5cf6);
    opacity: 0;
    transition: opacity 0.3s;
}

.api-card:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.12);
    transform: translateY(-2px);
}

.api-card:hover::before {
    opacity: 1;
}

.api-card-header {
    padding: 16px 16px 12px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.api-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
    color: white;
}

.api-card-icon.iconfont {
    font-size: 22px;
}

.api-card-meta { 
    flex: 1; 
    min-width: 0;
    padding-top: 2px;
}

.api-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0 0 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.api-card-title a { 
    color: inherit;
    transition: color 0.2s;
}

.api-card-title a:hover { 
    color: var(--primary);
}

.api-card-badges { 
    display: flex; 
    gap: 6px; 
    flex-wrap: wrap;
}

.api-card-badges .badge {
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    letter-spacing: 0.3px;
}

.api-card-body {
    padding: 0 16px 16px;
    flex: 1;
}

.api-card-desc {
    color: var(--gray-600);
    font-size: 13px;
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

.api-card-footer {
    padding: 12px 16px;
    background: linear-gradient(to bottom, transparent, rgba(248, 250, 252, 0.8));
    border-top: 1px solid rgba(226, 232, 240, 0.6);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.api-card-info {
    display: flex;
    gap: 14px;
    font-size: 12px;
    color: var(--gray-500);
    flex-wrap: wrap;
}

.api-card-info span { 
    display: flex; 
    align-items: center; 
    gap: 4px;
    white-space: nowrap;
}

.api-card-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.api-card-link:hover { 
    gap: 6px;
    color: #4f46e5;
}

/* ========== Category Navigation ========== */
.category-nav {
    background: white;
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid var(--gray-200);
}

.category-nav-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.category-nav-list li { margin: 0; }

.category-nav-list a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--gray-100);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-600);
    transition: all 0.2s;
}

.category-nav-list a:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

.category-nav-list a.active {
    background: var(--primary);
    color: white;
}

.category-nav-list .count {
    background: rgba(0,0,0,0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
}

.category-nav-list a.active .count {
    background: rgba(255,255,255,0.2);
}

/* ========== List Page ========== */
.list-card {
    background: white;
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.list-header {
    background: var(--gray-50);
    padding: 12px;
    border-bottom: 1px solid var(--gray-200);
}

.list-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.list-desc {
    color: var(--gray-500);
    font-size: 13px;
    margin-top: 4px;
}

.list-count {
    background: var(--gray-200);
    color: var(--gray-600);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}

.list-body {
    padding: 12px;
}

.list-body .api-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.list-body .api-card {
    flex-direction: row;
    align-items: center;
}

.list-body .api-card-header {
    padding: 0;
    flex-shrink: 0;
}

.list-body .api-card-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
}

.list-body .api-card-body {
    flex: 1;
    padding: 0 12px;
}

.list-body .api-card-desc {
    -webkit-line-clamp: 1;
    margin: 0;
}

.list-body .api-card-footer {
    background: none;
    border: none;
    padding: 0;
    flex-shrink: 0;
}

.list-body .api-card-info {
    display: none;
}

/* ========== 404 Error Page ========== */
.error-page {
    text-align: center;
    padding: 60px 12px;
}

.error-code {
    font-size: 100px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 12px;
}

.error-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 12px;
}

.error-desc {
    font-size: 15px;
    color: var(--gray-500);
    margin-bottom: 24px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.error-actions { display: flex; justify-content: center; gap: 12px; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: white;
}

.btn-outline {
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ========== Search Page ========== */
.search-header {
    margin-bottom: 12px;
}

.search-keyword {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.search-result-count {
    font-size: 14px;
    color: var(--gray-500);
}

/* ========== Sidebar Ads ========== */
.sidebar-ad-widget {
    background: white;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

.sidebar-ad-widget .widget-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    padding: 6px 12px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-800);
}

.sidebar-ad-widget .widget-content {
    padding: 12px;
}

.sidebar-ad {
    background: linear-gradient(135deg, #f8f9ff 0%, #fff 100%);
    border: 2px dashed var(--primary);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    transition: all 0.2s;
}

.sidebar-ad:hover {
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
    transform: translateY(-2px);
}

.sidebar-ad a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.sidebar-ad img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
}

/* ========== Responsive Design ========== */
@media (max-width: 1024px) {
    .content-wrapper { flex-direction: column; }
    .content-sidebar { width: 100%; }
    .footer-main { flex-wrap: wrap; }
}

@media (max-width: 768px) {
    .navbar-menu { display: none; }
    .navbar-search { display: none; }
    .navbar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        background: var(--gray-100);
        border: none;
        border-radius: 4px;
        cursor: pointer;
        font-size: 18px;
    }
    
    .hero-title { font-size: 24px; }
    .hero-subtitle { font-size: 14px; }
    .hero-stats { gap: 24px; }
    .stat-num { font-size: 24px; }
    
    .api-detail-section,
    .api-tester-section,
    .api-faq-section { padding: 12px; }
    
    .api-title { font-size: 18px; }
    .api-title-bar { flex-direction: column; align-items: flex-start; }
    
    .request-bar { flex-direction: column; }
    .method-select { width: 100%; }
    
    .param-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .param-desc { max-width: 100%; }
    
    .article-nav { grid-template-columns: 1fr; }
    .nav-next { text-align: left; }
    
    .footer-main { flex-direction: column; gap: 24px; }
    .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
    
    .api-cards { grid-template-columns: 1fr; }
    
    .error-code { font-size: 80px; }
    .error-title { font-size: 20px; }
    .error-actions { flex-direction: column; }
}

@media (max-width: 480px) {
    .container { padding: 0 12px; }
    .hero-section { padding: 24px 0; }
    .hero-title { font-size: 20px; }
    .hero-search form { flex-direction: column; border-radius: 4px; }
    .hero-search-input { border-bottom: 1px solid var(--gray-200); }
    .hero-search-btn { border-radius: 0 0 4px 4px; }
    
    .code-tab-btn { padding: 6px 10px; font-size: 11px; }
    
    .pagination a, .pagination span {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
        font-size: 12px;
    }
}

/* ========== Utility Classes ========== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.hidden { display: none !important; }

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

.fade-in { animation: fadeIn 0.3s ease-out; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading { animation: pulse 1.5s infinite; }

/* ========== Scrollbar ========== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ========== Selection ========== */
::selection { background: var(--primary-light); color: white; }


/* ========== API List (Category/Tag Pages) ========== */
.api-list {
    display: flex;
    flex-direction: column;
}

.api-list-item {
    padding: 16px;
    border-bottom: 1px solid var(--gray-100);
    transition: all 0.15s;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.api-list-item:last-child { border-bottom: none; }

.api-list-item:hover {
    background: var(--gray-50);
}

.api-list-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    color: white;
}

.api-list-content {
    flex: 1;
    min-width: 0;
}

.item-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 6px;
}

.item-title a { color: var(--gray-900); }
.item-title a:hover { color: var(--primary); }

.item-desc {
    color: var(--gray-500);
    font-size: 13px;
    line-height: 1.5;
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item-url {
    background: var(--gray-100);
    padding: 6px 10px;
    border-radius: 4px;
    margin-bottom: 8px;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-url code {
    font-family: 'SF Mono', monospace;
    font-size: 12px;
    color: var(--gray-600);
    background: none;
}

.item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    font-size: 12px;
    color: var(--gray-400);
}

.meta-method {
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
}

.meta-method.method-get { background: #dcfce7; color: #166534; }
.meta-method.method-post { background: #dbeafe; color: #1e40af; }
.meta-method.method-put { background: #fef3c7; color: #92400e; }
.meta-method.method-delete { background: #fee2e2; color: #991b1b; }

.meta-format {
    padding: 2px 8px;
    background: var(--gray-100);
    border-radius: 4px;
    font-size: 11px;
}

.meta-category {
    padding: 2px 8px;
    background: var(--primary);
    color: white;
    border-radius: 4px;
    font-size: 11px;
}

.meta-views, .meta-date {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Page Header Enhancements */
.page-desc {
    margin-top: 4px;
    opacity: 0.9;
    font-size: 14px;
}

.page-meta {
    margin-top: 8px;
    font-size: 13px;
    opacity: 0.8;
}

/* No Content State */
.no-content {
    text-align: center;
    padding: 48px 12px;
    background: white;
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
}

.no-content-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.no-content p {
    color: var(--gray-500);
    font-size: 15px;
    margin: 0;
}


/* ========== 广告样式 ========== */

/* Hero 广告位 */
.hero-section {
    position: relative;
}

.hero-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    gap: 20px;
    padding: 0 20px;
}

.hero-ads-container {
    width: 300px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}

.hero-ads-left {
    order: 1;
}

.hero-content-wrapper {
    flex: 1;
    order: 2;
    min-width: 0;
}

.hero-content {
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-ads-right {
    order: 3;
}

.hero-ads {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10;
}

.hero-ad-item {
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-ad-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hero-ad-item a {
    display: block;
    width: 100%;
    height: 100%;
}

.hero-ad-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-ad-item > div,
.hero-ad-item > a > div {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 列表广告卡片 */
.ad-card {
    position: relative;
    border: 2px dashed var(--primary) !important;
    background: linear-gradient(135deg, #f8f9ff 0%, #fff 100%) !important;
}

.ad-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    z-index: 2;
}

.ad-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.ad-card-body {
    padding: 16px !important;
}

.ad-card-body img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

/* 浮动广告 */
.float-ad {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: calc((100vw - 1280px) / 2);
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    z-index: 999;
    transition: transform 0.3s;
}

.float-ad-left {
    left: 10px;
}

.float-ad-right {
    right: 10px;
}

.float-ad:hover {
    transform: translateY(-50%) scale(1.05);
}

.float-ad a {
    display: block;
    width: 100%;
}

.float-ad img {
    width: 100%;
    height: auto;
    display: block;
}

.float-ad-close {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.float-ad:hover .float-ad-close {
    opacity: 1;
}

.float-ad-close:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* 内容广告 */
.content-ad {
    margin: 24px 0;
    padding: 16px;
    background: linear-gradient(135deg, #f8f9ff 0%, #fff 100%);
    border: 2px dashed var(--primary);
    border-radius: 8px;
    position: relative;
}

.content-ad .ad-label {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.content-ad a {
    display: block;
    text-decoration: none;
}

.content-ad img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

/* 评论区广告 */
.comment-ad-section {
    margin-top: 12px;
}

.comment-ad {
    background: linear-gradient(135deg, #f8f9ff 0%, #fff 100%);
    border: 2px dashed var(--primary);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.comment-ad a {
    display: block;
    text-decoration: none;
}

.comment-ad img {
    width: 100%;
    height: auto;
    display: block;
}

/* 响应式调整 */
@media (max-width: 1400px) {
    .hero-ads-container {
        display: none;
    }
    
    .float-ad {
        display: none;
    }
}

@media (max-width: 768px) {
    .ad-card {
        grid-column: 1 / -1;
    }
    
    .content-ad {
        margin: 16px 0;
        padding: 12px;
    }
}

/* 广告图标 */
.icon-ad::before {
    content: "📢";
}
