/* API站点 - 白色现代风格 v5.0 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 24px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -4px rgba(0,0,0,0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.05), 0 8px 10px -6px rgba(0,0,0,0.05);
    --transition: all 0.2s ease;
    
    /* 后台兼容变量 */
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #6b7280;
    --card-bg: #ffffff;
    --background: #f9fafb;
    --dark-text: #111827;
    --light-text: #6b7280;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--gray-50);
    min-height: 100vh;
    line-height: 1.6;
    color: var(--gray-800);
}

a { text-decoration: none; color: inherit; transition: var(--transition); }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 10px; }
::-webkit-scrollbar-track { background: transparent; }

/* ==================== 导航栏 ==================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--gray-100);
    padding: 0 2rem;
    height: 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-brand { display: flex; align-items: center; gap: 12px; }

.header-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: cover;
    transition: var(--transition);
}

.header-brand:hover .header-logo { transform: scale(1.05); }

.header-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-900);
}

.header-right { display: flex; align-items: center; gap: 8px; }

/* ==================== 按钮 ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

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

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

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

.btn-outline:hover {
    background: var(--gray-100);
    color: var(--gray-900);
    border-color: var(--gray-300);
}

/* ==================== 主容器 ==================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
}

/* ==================== Hero区域 - 左对齐简洁风格 ==================== */
.hero-section {
    padding: 120px 2rem 60px;
    max-width: 1200px;
    margin: 0 auto;
}

.hero-content { max-width: 600px; }

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
    letter-spacing: -0.02em;
    display: inline;
}

.hero-desc {
    font-size: 1.125rem;
    color: var(--gray-500);
    margin-top: 1rem;
    font-weight: 400;
}

/* ==================== Hero Header ==================== */
.hero-header {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: nowrap;
}

/* ==================== 访问量统计 ==================== */
.stats-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    color: var(--gray-600);
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 20px;
    flex-shrink: 0;
}

.stats-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
}

/* ==================== API卡片网格 - 列表式布局 ==================== */
.api-grid {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.api-card {
    background: var(--white);
    padding: 1.25rem 1.5rem;
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 1.5rem;
    transition: var(--transition);
}

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

.api-card-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0;
}

.api-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    line-height: 1.4;
}

.api-card-body { padding: 0; }

.api-description {
    color: var(--gray-500);
    font-size: 0.875rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.api-status {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
}

.status-active {
    background: #ecfdf5;
    color: #059669;
}

.status-maintenance {
    background: #fffbeb;
    color: #d97706;
}

.status-paid {
    background: #eff6ff;
    color: #2563eb;
}

.status-private {
    background: #fef2f2;
    color: #dc2626;
}

.status-doc {
    background: #e9d5ff;
    color: #6b21a8;
}

.api-card-footer { padding: 0; }

.api-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: var(--gray-900);
    color: white;
    font-weight: 500;
    font-size: 0.8rem;
    border-radius: 8px;
    transition: var(--transition);
}

.api-link:hover {
    background: var(--gray-700);
    color: white;
}

.api-link::after { content: '→'; margin-left: 2px; }

/* ==================== API详情页 ==================== */
.banner {
    padding: 120px 2rem 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.banner-content { max-width: 600px; }

.banner-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.banner-subtitle {
    font-size: 1rem;
    color: var(--gray-500);
    margin-top: 0.75rem;
}

.api-detail {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.detail-header {
    padding: 2rem;
    border-bottom: 1px solid var(--gray-100);
}

.detail-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.detail-title::before {
    content: '';
    width: 3px;
    height: 18px;
    background: var(--gray-900);
    border-radius: 2px;
}

.detail-meta-list {
    display: flex;
    flex-direction: column;
}

.meta-row {
    display: flex;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-100);
    gap: 1rem;
}

.meta-row:last-child { border-bottom: none; }

.meta-label {
    font-weight: 500;
    color: var(--gray-500);
    font-size: 0.875rem;
    min-width: 80px;
    flex-shrink: 0;
}

.meta-value {
    color: var(--gray-900);
    word-break: break-all;
    font-size: 0.875rem;
    flex: 1;
}

.meta-value a { color: var(--primary); }
.meta-value a:hover { color: var(--primary-dark); text-decoration: underline; }

/* 兼容旧的卡片式布局 */
.detail-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
}

.detail-section {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--gray-100);
}

.detail-section:last-child { border-bottom: none; }

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 1rem;
}

/* ==================== 表格 ==================== */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
}

.param-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px;
}

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

.param-table th {
    background: var(--gray-50);
    font-weight: 500;
    color: var(--gray-600);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.param-table td { color: var(--gray-700); font-size: 0.9rem; }
.param-table tr:last-child td { border-bottom: none; }
.param-table tr:hover td { background: var(--gray-50); }

.param-table code {
    background: var(--gray-100);
    color: var(--gray-800);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.85rem;
}

.param-required { color: var(--danger) !important; font-weight: 500; }

/* ==================== 代码块 ==================== */
.response-code {
    background: var(--gray-900);
    color: #e5e7eb;
    padding: 1.25rem;
    border-radius: var(--radius-sm);
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.85rem;
    line-height: 1.7;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ==================== 页脚 ==================== */
.footer {
    background: var(--white);
    border-top: 1px solid var(--gray-100);
    padding: 2rem;
    text-align: center;
}

.footer-content { color: var(--gray-500); font-size: 0.875rem; }
.beian { margin-top: 0.5rem; }
.beian a { color: var(--gray-400); font-size: 0.8rem; }
.beian a:hover { color: var(--gray-600); }

/* ==================== 搜索弹窗 ==================== */
.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.search-overlay.show { opacity: 1; visibility: visible; }

.search-container {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    width: 90%;
    max-width: 520px;
    transform: translateY(-20px);
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
}

.search-overlay.show .search-container { transform: translateY(0); }

.search-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    text-align: center;
    margin-bottom: 1.25rem;
}

.search-form { display: flex; flex-direction: column; gap: 0.75rem; }

.search-input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--gray-900);
    transition: var(--transition);
}

.search-input::placeholder { color: var(--gray-400); }
.search-input:focus { outline: none; border-color: var(--gray-400); box-shadow: 0 0 0 3px rgba(0,0,0,0.05); }

.search-btn {
    padding: 0.875rem;
    background: var(--gray-900);
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.search-btn:hover { background: var(--gray-700); }

/* ==================== 悬浮按钮 ==================== */
.floating-actions {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 100;
}

.floating-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--gray-600);
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.floating-btn:hover {
    background: var(--gray-900);
    border-color: var(--gray-900);
    color: white;
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    .header {
        padding: 0 1rem;
        height: 56px;
    }
    
    .header-title { font-size: 1rem; }
    .header-right .btn { padding: 6px 12px; font-size: 0.8rem; }
    
    .hero-section { padding: 80px 1rem 40px; }
    .hero-title { font-size: 1.5rem; }
    .hero-desc { font-size: 1rem; }
    
    .hero-header {
        flex-wrap: nowrap;
        gap: 0.5rem;
    }
    
    .stats-badge {
        padding: 4px 10px;
        font-size: 0.7rem;
    }
    
    .container { padding: 0 1rem 3rem; }
    
    .api-card {
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        gap: 0.5rem 1rem;
        padding: 1rem;
    }
    
    .api-card-header { 
        grid-column: 1;
        grid-row: 1;
    }
    
    .api-status { 
        grid-column: 2;
        grid-row: 1;
        align-self: flex-start;
    }
    
    .api-card-footer { 
        grid-column: 1 / -1;
        grid-row: 2;
    }
    
    .api-link { width: 100%; justify-content: center; }
    
    .banner { padding: 80px 1rem 30px; }
    .banner-title { font-size: 1.75rem; }
    
    .detail-header, .detail-section { padding: 1.25rem; }
    .detail-meta { grid-template-columns: 1fr; }
    
    .meta-row { flex-direction: column; gap: 0.25rem; }
    .meta-label { min-width: auto; }
    
    .floating-actions { bottom: 1.5rem; right: 1rem; }
    .floating-btn { width: 40px; height: 40px; }
}

@media (max-width: 480px) {
    .header-logo { width: 32px; height: 32px; }
    .search-container { padding: 1.25rem; }
    .hero-title { font-size: 1.25rem; }
    
    .stats-badge {
        padding: 3px 8px;
        font-size: 0.65rem;
    }
}

@media (hover: none) {
    .api-card:hover { background: var(--white); }
    .api-card:active { background: var(--gray-50); }
    .btn:active, .floating-btn:active { transform: scale(0.97); }
}
