@font-face {
    font-family: 'CustomFont';
    src: url('/assets/fonts/1.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-hover: #f1f3f7;
    --border: #eef2f6;
    --border-active: #dcdfe6;
    --text-primary: #111827;
    --text-secondary: #4b5565;
    --text-tertiary: #9ca3af;
    --accent: #000000;
    --accent-light: #f3f4f6;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.02), 0 1px 1px rgba(0,0,0,0.02);
    --shadow-md: 0 6px 16px rgba(0,0,0,0.04);
    --radius: 14px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --radius-lg: 20px;
    --font-main: 'CustomFont', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, sans-serif;
}
/* 暗黑模式CSS变量 */
[data-theme="dark"] {
    --bg: #0f172a;
    --surface: #1e293b;
    --surface-hover: #334155;
    --border: #334155;
    --border-active: #475569;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #64748b;
    --accent: #38bdf8;
    --accent-light: #1e293b;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3), 0 1px 1px rgba(0,0,0,0.3);
    --shadow-md: 0 6px 16px rgba(0,0,0,0.5);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes flame-flicker { 
    0%, 100% { transform: scale(1) rotate(-3deg); opacity: 0.9; } 
    25% { transform: scale(1.08) rotate(2deg); opacity: 1; }
    50% { transform: scale(1.12) rotate(4deg); opacity: 0.85; }
    75% { transform: scale(1.05) rotate(-1deg); opacity: 1; }
}
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-size: 14px; transition: background-color 0.3s ease, color 0.3s ease; }
body { 
    font-family: var(--font-main); 
    background-color: var(--bg); 
    color: var(--text-primary); 
    line-height: 1.6; 
    padding-bottom: 20px;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.3s ease, color 0.3s ease;
}
img {
    -webkit-touch-callout: default;
    pointer-events: auto;
}
.top-title-bar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 8px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    border-radius: 24px;
    margin: 12px 16px 0 16px;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
.top-title-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.top-title-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}
.top-title-logo img {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-xs);
}
.top-title-text h2 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}
.top-title-text p {
    font-size: 10px;
    color: var(--text-tertiary);
    margin: 0;
}
.menu-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}
.menu-btn:hover {
    background: var(--surface-hover);
    transform: scale(0.95);
}
.menu-btn svg {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}
.settings-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 320px;
    height: 100%;
    background: var(--surface);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    transition: right 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    border-left: none;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}
.settings-sidebar.open { right: 0; }
.settings-sidebar-header {
    padding: 24px 20px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 10;
    border-radius: var(--radius-lg) 0 0 0;
}
.settings-sidebar-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}
.close-settings {
    width: 36px;
    height: 36px;
    border-radius: 30px;
    border: 1px solid var(--border);
    background: var(--surface-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}
.close-settings:hover { background: var(--border); transform: rotate(90deg); }
.close-settings svg { width: 16px; height: 16px; stroke: var(--text-secondary); }
.settings-content { padding: 20px; flex: 1; }
.settings-group { margin-bottom: 24px; }
.settings-group-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.settings-group-title svg { width: 14px; height: 14px; stroke: var(--accent); }
.settings-item {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
    border: 1px solid var(--border);
    cursor: pointer;
}
.settings-item:hover {
    background: var(--surface-hover);
    transform: translateX(-2px);
    border-color: var(--border-active);
}
.settings-item-left { display: flex; align-items: center; gap: 12px; }
.settings-item-left svg { width: 18px; height: 18px; color: var(--text-secondary); }
.settings-item-text { font-weight: 500; font-size: 13px; }
.settings-item-desc { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }
.settings-footer {
    padding: 16px 20px 24px;
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-tertiary);
    text-align: center;
}
#settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
#settings-overlay.show { opacity: 1; visibility: visible; }
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}
.modal-overlay.active { visibility: visible; opacity: 1; }
.modal-container {
    background: var(--surface);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 450px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-md);
    animation: modalFadeIn 0.3s ease;
    border: 1px solid var(--border);
}
.modal-container::-webkit-scrollbar { width: 4px; }
.modal-container::-webkit-scrollbar-track { background: var(--border); border-radius: 4px; }
.modal-container::-webkit-scrollbar-thumb { background: var(--border-active); border-radius: 4px; }
@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.modal-header {
    padding: 20px 24px 12px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 18px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 10;
}
.modal-header svg {
    cursor: pointer;
    width: 22px;
    height: 22px;
    stroke: var(--text-tertiary);
    transition: 0.2s;
}
.modal-header svg:hover { stroke: var(--text-primary); transform: rotate(90deg); }
.modal-image {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    display: block;
}
.modal-body {
    padding: 20px 24px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.8;
    letter-spacing: 0.3px;
    word-break: break-word;
    white-space: pre-wrap;
}
.modal-body p {
    margin-bottom: 12px;
}
.modal-body p:last-child {
    margin-bottom: 0;
}
.modal-footer {
    padding: 16px 24px 20px;
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid var(--border);
    background: var(--surface);
    position: sticky;
    bottom: 0;
}
.modal-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 28px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: 0.2s;
}
.modal-btn:hover { opacity: 0.85; transform: scale(0.97); }
.search-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}
.search-modal-overlay.active {
    visibility: visible;
    opacity: 1;
}
.search-modal-container {
    background: var(--surface);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 520px;
    height: 70vh;
    max-height: 550px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalFadeIn 0.25s ease;
}
.search-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.search-modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}
.close-search {
    width: 32px;
    height: 32px;
    border-radius: 30px;
    border: 1px solid var(--border);
    background: var(--surface-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}
.close-search:hover {
    background: var(--border);
    transform: rotate(90deg);
}
.close-search svg {
    width: 16px;
    height: 16px;
    stroke: var(--text-secondary);
}
.search-modal-body {
    padding: 16px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.search-input-full {
    width: 100%;
    height: 42px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: 30px;
    font-size: 14px;
    font-family: inherit;
    background: var(--bg);
    color: var(--text-primary);
    outline: none;
    transition: 0.2s;
    flex-shrink: 0;
}
.search-input-full:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(0,0,0,0.05);
}
.search-stats {
    padding: 10px 0;
    font-size: 11px;
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
    flex-shrink: 0;
}
.search-results-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
}
.search-results-list::-webkit-scrollbar {
    width: 4px;
}
.search-results-list::-webkit-scrollbar-track {
    background: var(--border);
    border-radius: 4px;
}
.search-results-list::-webkit-scrollbar-thumb {
    background: var(--border-active);
    border-radius: 4px;
}
.search-result-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: 0.2s;
}
.search-result-item:hover {
    background: var(--surface-hover);
    border-color: var(--border-active);
    transform: translateX(2px);
}
.search-result-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-xs);
    object-fit: cover;
    background: var(--accent-light);
    -webkit-touch-callout: default;
}
.search-result-info {
    flex: 1;
    min-width: 0;
}
.search-result-name {
    font-weight: 700;
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.search-result-desc {
    font-size: 11px;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-result-badge {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 20px;
    background: var(--accent-light);
    color: var(--text-secondary);
    white-space: nowrap;
}
.no-results {
    text-align: center;
    color: var(--text-tertiary);
    padding: 30px 20px;
    font-size: 13px;
}
.content-wrapper { padding: 20px; max-width: 1200px; margin: 0 auto; }

.announcement-bar { 
    background: var(--accent-light); 
    color: var(--accent); 
    padding: 10px 14px; 
    border-radius: var(--radius-sm); 
    margin-bottom: 20px; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    flex-wrap: wrap; 
    gap: 8px; 
    animation: fadeIn 0.5s ease; 
    font-size: 12px; 
}
.announcement-content { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.announcement-content svg { flex-shrink: 0; width: 16px; height: 16px; }
.announcement-time { font-size: 10px; color: var(--text-secondary); background: rgba(0,0,0,0.05); padding: 2px 6px; border-radius: 20px; }

.api-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.api-card { 
    background: var(--surface); 
    border-radius: var(--radius); 
    border: 1px solid var(--border); 
    box-shadow: var(--shadow-sm); 
    padding: 16px; 
    display: flex; 
    flex-direction: row; 
    gap: 12px; 
    transition: all 0.3s ease; 
    animation: fadeIn 0.5s ease forwards; 
}
.api-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-active); }
.api-card-left { flex-shrink: 0; width: 48px; height: 48px; }
.api-icon-img { 
    width: 48px; 
    height: 48px; 
    border-radius: var(--radius-sm); 
    object-fit: cover; 
    background: var(--accent-light);
    -webkit-touch-callout: default;
}
.api-card-right { flex: 1; min-width: 0; }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.api-name { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.status-badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 10px; font-weight: 600; }
.status-green { background-color: #dcfce7; color: #166534; }
.status-red { background-color: #fee2e2; color: #991b1b; }
.status-yellow { background-color: #fef9c3; color: #854d0e; }
.status-gray { background-color: #f3f4f6; color: #374151; }
.api-description { color: var(--text-secondary); margin-bottom: 10px; font-size: 12px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-footer { border-top: 1px solid var(--border); padding-top: 10px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.api-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.meta-item { display: flex; align-items: center; color: var(--text-tertiary); font-size: 10px; font-weight: 500; }
.meta-item svg { margin-right: 3px; width: 12px; height: 12px; }
.call-count { font-weight: 700; display: flex; align-items: center; gap: 2px; }
.fire-icon { width: 12px; height: 12px; margin-left: 2px; animation: flame-flicker infinite; display: inline-block; transform-origin: center bottom; }
.btn-details { 
    background: var(--accent); 
    color: #fff; 
    padding: 5px 12px; 
    border-radius: 20px; 
    text-decoration: none; 
    font-weight: 500; 
    transition: all 0.2s; 
    white-space: nowrap; 
    font-size: 11px; 
}
.btn-details:hover { opacity: 0.85; transform: translateY(-1px); }
.float-search-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 52px;
    height: 52px;
    border-radius: 26px;
    background: var(--accent);
    color: white;
    border: none;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 998;
    transition: all 0.2s ease;
}
.float-search-btn:hover { transform: scale(1.05); background: #1e293b; }
.float-search-btn svg { width: 22px; height: 22px; stroke: white; stroke-width: 2; }
/* 悬浮暗黑模式切换按钮 */
.float-theme-btn {
    position: fixed;
    bottom: 92px; /* 与搜索按钮保持40px间距 */
    right: 24px;
    width: 52px;
    height: 52px;
    border-radius: 26px;
    background: var(--accent);
    color: white;
    border: none;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 998;
    transition: all 0.2s ease;
}
.float-theme-btn:hover { transform: scale(1.05); background: #1e293b; }
.float-theme-btn svg { width: 22px; height: 22px; stroke: white; stroke-width: 2; }
/* 暗黑模式下按钮背景色调整 */
[data-theme="dark"] .float-search-btn:hover,
[data-theme="dark"] .float-theme-btn:hover {
    background: #0ea5e9;
}
.page-footer { text-align: center; padding: 20px; font-size: 11px; color: var(--text-tertiary); border-top: 1px solid var(--border); margin-top: 20px; }
@media (max-width: 768px) { 
    .api-grid { grid-template-columns: 1fr; } 
    .content-wrapper { padding: 12px; } 
    .announcement-bar { flex-direction: column; align-items: flex-start; } 
    .float-search-btn { bottom: 20px; right: 20px; width: 48px; height: 48px; }
    .float-theme-btn { bottom: 84px; right: 20px; width: 48px; height: 48px; }
    .top-title-bar { margin: 8px 8px 0 8px; padding: 6px 16px; }
    .settings-sidebar { border-radius: 16px 0 0 16px; }
    .search-modal-container { width: 95%; height: 75vh; }
    .modal-container { width: 92%; max-width: none; }
    .modal-body { padding: 16px 20px; line-height: 1.7; }
}
