/* =========================================================
   工具站 全局样式
   沿用 DeepSeek 查询页设计语言：#4d6bfe / #f2f5fa / 圆角卡片
   ========================================================= */
:root {
    --primary-color: #4d6bfe;
    --secondary-color: #3651d4;
    --background-color: #f2f5fa;
    --card-color: #ffffff;
    --text-color: #1e293b;
    --text-light: #64748b;
    --success-color: #10b981;
    --error-color: #ef4444;
    --border: #e2e8f0;
    --radius: 16px;
}
* { margin: 0; padding: 0; box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; }
body { background: var(--background-color); color: var(--text-color); min-height: 100vh;
    display: flex; flex-direction: column; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.mono { font-family: 'SF Mono', 'Roboto Mono', monospace; }
a { color: var(--primary-color); text-decoration: none; }
.empty { text-align: center; color: var(--text-light); padding: 40px 0; }

/* ---------- 顶部导航 ---------- */
.site-header { background: var(--card-color); border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.site-logo { display: flex; align-items: center; gap: 9px; font-size: 1.2rem; font-weight: 800;
    color: var(--text-color); }
.site-logo i { color: var(--primary-color); font-size: 1.3rem; }
.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav a { color: var(--text-light); font-size: 0.95rem; font-weight: 500; transition: color .2s; }
.site-nav a:hover { color: var(--primary-color); }
.nav-cta { background: var(--primary-color); color: #fff !important; padding: 7px 16px;
    border-radius: 9px; }
.nav-cta:hover { background: var(--secondary-color); }
.nav-link-btn { background: none; border: none; padding: 0; cursor: pointer;
    color: var(--text-light); font-size: 0.95rem; font-weight: 500; font-family: inherit; }
.nav-link-btn:hover { color: var(--primary-color); }

/* ---------- 主体 ---------- */
.site-main { flex: 1; padding: 40px 0 60px; }
.hero { text-align: center; margin-bottom: 28px; }
.hero h1 { font-size: 2.1rem; font-weight: 800; letter-spacing: -0.02em; }
.hero p { margin-top: 10px; color: var(--text-light); font-size: 1.02rem; }
.hero-meta { margin-top: 8px !important; font-size: 0.88rem !important; }
.hero-meta strong { color: var(--primary-color); font-weight: 700; }

/* ---------- 首页工具栏：搜索 + 分类 Tab ---------- */
.home-toolbar { margin-bottom: 32px; }
.search-box { position: relative; max-width: 560px; margin: 0 auto 18px; }
.search-box > i.fa-search { position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
    color: var(--text-light); font-size: 0.95rem; pointer-events: none; }
.search-box input { width: 100%; padding: 14px 44px 14px 44px; border: 1px solid var(--border);
    border-radius: 14px; font-size: 0.98rem; background: var(--card-color); outline: none;
    box-shadow: 0 4px 16px rgba(0,0,0,0.04); transition: all .25s; }
.search-box input:focus { border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(77,107,254,0.12); }
.search-clear { position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    width: 28px; height: 28px; border: none; border-radius: 8px; background: #f1f5f9;
    color: var(--text-light); cursor: pointer; display: grid; place-items: center; }
.search-clear:hover { background: #e2e8f0; color: var(--text-color); }
.search-clear[hidden] { display: none; }

.cat-tabs { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.cat-tab { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px;
    border: 1px solid var(--border); border-radius: 999px; background: var(--card-color);
    color: var(--text-light); font-size: 0.88rem; font-weight: 600; cursor: pointer;
    transition: all .2s; }
.cat-tab i { font-size: 0.82rem; opacity: 0.85; }
.cat-tab:hover { border-color: var(--primary-color); color: var(--primary-color); }
.cat-tab.active { background: var(--primary-color); border-color: var(--primary-color);
    color: #fff; box-shadow: 0 4px 14px rgba(77,107,254,0.28); }
.cat-tab.active i { opacity: 1; }
.cat-count { font-size: 0.72rem; font-weight: 700; padding: 1px 7px; border-radius: 999px;
    background: rgba(100,116,139,0.12); color: inherit; min-width: 20px; text-align: center; }
.cat-tab.active .cat-count { background: rgba(255,255,255,0.22); }

/* ---------- 分类分组 ---------- */
.cat-section { margin-bottom: 36px; }
.cat-section[hidden] { display: none; }
.cat-section-head { display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px; padding: 0 2px; }
.cat-section-head h2 { display: flex; align-items: center; gap: 10px; font-size: 1.1rem;
    font-weight: 700; color: var(--text-color); }
.cat-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.cat-section-count { font-size: 0.8rem; font-weight: 600; color: var(--text-light);
    background: #f1f5f9; padding: 3px 10px; border-radius: 999px; }

.filter-empty { text-align: center; padding: 56px 20px; color: var(--text-light); }
.filter-empty[hidden] { display: none; }
.filter-empty i { font-size: 2rem; opacity: 0.4; margin-bottom: 12px; }
.filter-empty p { margin: 8px 0 18px; font-size: 0.98rem; }
.btn-ghost { width: auto; display: inline-flex; padding: 10px 20px; background: transparent;
    color: var(--primary-color); border: 1px solid var(--border); }
.btn-ghost:hover { background: rgba(77,107,254,0.06); border-color: var(--primary-color);
    transform: none; }

/* ---------- 工具卡片网格 ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.tool-card { background: var(--card-color); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 26px 24px; display: flex; flex-direction: column; transition: all .25s ease;
    box-shadow: 0 4px 24px rgba(0,0,0,0.05); color: inherit; }
.tool-card[hidden] { display: none; }
.tool-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(77,107,254,0.14);
    border-color: var(--primary-color); }
.tool-card-top { display: flex; align-items: flex-start; justify-content: space-between;
    gap: 12px; margin-bottom: 16px; }
.tool-icon { width: 48px; height: 48px; border-radius: 12px;
    background: rgba(77,107,254,0.1); color: var(--cat-color, var(--primary-color));
    display: grid; place-items: center; font-size: 1.4rem; flex-shrink: 0; }
.tool-icon.large { width: 64px; height: 64px; font-size: 1.9rem; margin: 0 auto 18px; }
.tool-cat-badge { font-size: 0.72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px;
    background: rgba(77,107,254,0.1); color: var(--cat-color, var(--primary-color));
    white-space: nowrap; }
.tool-name { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; color: var(--text-color); }
.tool-desc { font-size: 0.88rem; color: var(--text-light); line-height: 1.6; flex: 1; }
.tool-go { margin-top: 16px; font-size: 0.85rem; font-weight: 600; color: var(--primary-color); }

/* ---------- 工具详情页 ---------- */
.tool-page { max-width: 620px; margin: 0 auto; }
.tool-page-head { text-align: center; margin-bottom: 28px; }
.tool-page-head h1 { font-size: 1.6rem; font-weight: 800; }
.tool-page-head p { margin-top: 8px; color: var(--text-light); font-size: 0.95rem; }
.card { background: var(--card-color); border-radius: 20px; box-shadow: 0 4px 24px rgba(0,0,0,0.06);
    padding: 34px 30px; border: 1px solid var(--border); }

/* ---------- 表单（沿用 DeepSeek 风格） ---------- */
.form-group { margin-bottom: 22px; }
label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 0.95rem; }
.label-hint { font-weight: 400; color: var(--text-light); font-size: 0.82rem; }
.input-group { position: relative; display: flex; align-items: center; }
input, textarea { width: 100%; padding: 13px 15px; border: 1px solid var(--border); border-radius: 12px;
    font-size: 0.98rem; transition: all .3s; outline: none; background: #f8fafc; color: var(--text-color); }
input { padding-right: 45px; }
textarea { resize: vertical; min-height: 120px; font-family: 'SF Mono', monospace; font-size: .88rem; line-height: 1.7; }
input:focus, textarea:focus { border-color: var(--primary-color); background: #fff;
    box-shadow: 0 0 0 4px rgba(77,107,254,0.1); }
.toggle-password { position: absolute; right: 12px; background: none; border: none; cursor: pointer;
    color: var(--text-light); font-size: 1.05rem; }
.toggle-password:hover { color: var(--primary-color); }

.btn { width: 100%; padding: 14px; background: var(--primary-color); color: #fff; border: none;
    border-radius: 12px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: all .3s;
    display: flex; justify-content: center; align-items: center; gap: 8px; }
.btn:hover { background: var(--secondary-color); transform: translateY(-1px); }
.btn:active { transform: scale(0.98); }
.btn:disabled { background: #94a3b8; cursor: not-allowed; transform: none; }

.mode-tabs { display: flex; gap: 6px; background: #f1f5f9; padding: 5px; border-radius: 12px; margin-bottom: 24px; }
.mode-tab { flex: 1; padding: 10px; border: none; border-radius: 9px; background: transparent;
    color: var(--text-light); font-size: 0.92rem; font-weight: 600; cursor: pointer; transition: all .25s; }
.mode-tab:hover { color: var(--text-color); }
.mode-tab.active { background: #fff; color: var(--primary-color); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

.error-message { color: var(--error-color); margin-top: 12px; font-size: 0.9rem; background: #fef2f2;
    padding: 10px; border-radius: 8px; display: none; text-align: center; }

/* ---------- 结果展示 ---------- */
.result { margin-top: 28px; padding: 22px; border-radius: 16px; background: #f8fafc;
    border: 1px solid var(--border); display: none; }
.result.show { display: block; animation: fadeIn .5s ease; }
.result-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 16px; display: flex;
    align-items: center; gap: 10px; }
.balance-info { display: flex; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid var(--border); }
.balance-info:last-child { border-bottom: none; }
.balance-label { color: var(--text-light); font-size: 0.92rem; }
.balance-value { font-weight: 700; font-family: 'SF Mono', monospace; }
.balance-value.total { color: var(--primary-color); font-size: 1.05rem; }

.batch-result { margin-top: 28px; display: none; }
.batch-result.show { display: block; animation: fadeIn .5s ease; }
.batch-summary { margin-left: auto; font-size: 0.82rem; font-weight: 500; color: var(--text-light); }
.batch-list { display: flex; flex-direction: column; gap: 12px; }
.batch-item { background: #f8fafc; border: 1px solid var(--border); border-radius: 14px; padding: 15px 17px; }
.batch-item-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.batch-key { font-family: 'SF Mono', monospace; font-size: 0.85rem; font-weight: 600;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { flex-shrink: 0; font-size: 0.75rem; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.badge.ok { color: var(--success-color); background: rgba(16,185,129,0.12); }
.badge.err { color: var(--error-color); background: rgba(239,68,68,0.12); }
.batch-row { display: flex; justify-content: space-between; font-size: 0.88rem; padding: 3px 0; }
.batch-row .k { color: var(--text-light); }
.batch-row .v { font-weight: 700; font-family: 'SF Mono', monospace; }
.batch-row .v.total { color: var(--primary-color); }
.batch-err-text { font-size: 0.85rem; color: var(--error-color); }

/* ---------- 17TRACK 配额展示 ---------- */
.field-hint { margin-top: 8px; font-size: 0.82rem; color: var(--text-light); line-height: 1.5; }
.field-hint a { font-weight: 600; }
.quota-hero {
    text-align: center; padding: 18px 12px 16px; margin-bottom: 8px;
    background: linear-gradient(135deg, rgba(77,107,254,0.08), rgba(16,185,129,0.06));
    border-radius: 14px; border: 1px solid rgba(77,107,254,0.12);
}
.quota-hero-label { font-size: 0.88rem; color: var(--text-light); font-weight: 600; margin-bottom: 6px; }
.quota-hero-value {
    font-size: 2.4rem; font-weight: 800; letter-spacing: -0.03em;
    color: var(--primary-color); font-family: 'SF Mono', monospace; line-height: 1.15;
}
.quota-bar {
    height: 8px; background: #e2e8f0; border-radius: 99px; overflow: hidden;
    margin: 14px auto 10px; max-width: 280px;
}
.quota-bar-fill {
    height: 100%; width: 0; border-radius: 99px;
    background: linear-gradient(90deg, #4d6bfe, #10b981);
    transition: width .6s cubic-bezier(0.16, 1, 0.3, 1);
}
.quota-bar-fill.warn { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.quota-bar-fill.danger { background: linear-gradient(90deg, #ef4444, #f97316); }
.quota-hero-sub { font-size: 0.84rem; color: var(--text-light); }
.quota-hero-sub span { font-weight: 700; color: var(--text-color); font-family: 'SF Mono', monospace; }

/* ---------- 登录/注册 ---------- */
.auth-card { max-width: 420px; margin: 30px auto; }
.auth-card h1 { text-align: center; font-size: 1.4rem; margin-bottom: 24px; }
.auth-form { margin-top: 6px; }
.auth-switch { text-align: center; margin-top: 18px; font-size: 0.9rem; color: var(--text-light); }
.captcha-row { display: flex; align-items: center; gap: 10px; }
.captcha-row input { flex: 1; min-width: 0; padding-right: 15px; }
.captcha-img { height: 40px; width: 120px; border-radius: 10px; border: 1px solid var(--border);
    cursor: pointer; background: #f8fafc; flex-shrink: 0; object-fit: cover; }
.captcha-math { height: 40px; min-width: 120px; padding: 0 14px; border-radius: 10px;
    border: 1px solid var(--border); background: #f8fafc; display: grid; place-items: center;
    font-weight: 700; font-family: 'SF Mono', monospace; cursor: pointer; flex-shrink: 0;
    color: var(--primary-color); user-select: none; }
.captcha-refresh { flex-shrink: 0; width: 40px; height: 40px; padding: 0; display: grid; place-items: center;
    border-radius: 10px; margin-right: 0; }

/* ---------- 页头 / 表格 ---------- */
.page-head { margin-bottom: 24px; }
.page-head h1 { font-size: 1.5rem; font-weight: 800; }
.page-head p { color: var(--text-light); margin-top: 6px; font-size: 0.9rem; }
.table-card { padding: 10px 0; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.data-table th { text-align: left; padding: 12px 16px; color: var(--text-light); font-weight: 600;
    border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 12px 16px; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
.data-table tr:last-child td { border-bottom: none; }
.result-cell { max-width: 320px; word-break: break-all; color: var(--text-light); font-size: 0.8rem; }

/* ---------- 页尾 ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 24px 0; text-align: center;
    color: var(--text-light); font-size: 0.85rem; background: var(--card-color); }

.loading { display: none; animation: spin 1s linear infinite; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Open API 文档（单页切换） ---------- */
.api-docs-page { max-width: 1180px; }
.api-hero .api-hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.btn-ghost { background: transparent; color: var(--primary-color); border: 1px solid var(--primary-color);
    padding: 11px 22px; border-radius: 10px; font-weight: 600; display: inline-block; cursor: pointer; font: inherit; }
.btn-ghost:hover { background: rgba(77,107,254,0.08); }
.api-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: start; margin-bottom: 40px; }
.api-side { position: sticky; top: 76px; padding: 16px 14px; max-height: calc(100vh - 96px); display: flex; flex-direction: column; }
.api-side-head { margin-bottom: 10px; flex-shrink: 0; }
.api-side-head h3 { font-size: 0.95rem; margin-bottom: 10px; }
.api-toc-filter { width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px;
    font-size: 0.86rem; background: #f8fafc; outline: none; }
.api-toc-filter:focus { border-color: var(--primary-color); background: #fff; box-shadow: 0 0 0 3px rgba(77,107,254,.12); }
.api-toc { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; min-height: 0;
    padding-right: 4px; scrollbar-width: thin; }
.toc-group { margin-bottom: 10px; }
.toc-group-title { font-size: 0.72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    color: #94a3b8; padding: 8px 8px 4px; display: flex; align-items: center; gap: 6px; }
.toc-count { margin-left: auto; background: #f1f5f9; color: var(--text-light); font-size: 0.7rem;
    padding: 1px 7px; border-radius: 999px; font-weight: 700; letter-spacing: 0; text-transform: none; }
.api-toc .toc-link { font-size: 0.86rem; color: var(--text-light); padding: 7px 10px; border-radius: 8px;
    display: flex; align-items: center; gap: 8px; cursor: pointer; border: none; background: transparent;
    text-align: left; width: 100%; transition: background .15s, color .15s; }
.api-toc .toc-link i { width: 1em; text-align: center; opacity: .75; flex-shrink: 0; }
.api-toc .toc-link:hover { background: #f1f5f9; color: var(--primary-color); }
.api-toc .toc-link.active { background: rgba(77,107,254,0.1); color: var(--primary-color); font-weight: 600; }
.api-toc .toc-tool { font-size: 0.82rem; }
.api-toc .toc-tool-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.api-main { min-width: 0; }
.api-doc-panel { animation: fadeIn .22s ease; }
.api-doc-panel[hidden] { display: none !important; }
.api-panel-head { margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.api-panel-head h2 { font-size: 1.3rem; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.api-panel-head h2 i { color: var(--primary-color); }
.api-panel-head .muted { margin-top: 6px; }
.api-doc-panel h4 { font-size: 0.92rem; margin: 18px 0 8px; color: var(--text-light); font-weight: 700; }
.api-list { margin: 10px 0 0 1.2em; color: var(--text-light); font-size: 0.92rem; line-height: 1.7; }
.api-panel-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px;
    margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.btn-mini { display: inline-flex; align-items: center; gap: 6px; background: #f1f5f9; border: 1px solid var(--border);
    color: var(--text-color); padding: 7px 12px; border-radius: 9px; font-size: 0.84rem; font-weight: 600;
    cursor: pointer; font-family: inherit; text-decoration: none; line-height: 1.2; }
.btn-mini:hover { background: var(--primary-color); color: #fff; border-color: var(--primary-color); }
.api-panel-nav .btn-mini { cursor: pointer; font: inherit; }

.code-block-wrap { position: relative; }
.code-copy-btn { position: absolute; top: 8px; right: 8px; z-index: 2; border: 1px solid rgba(255,255,255,.15);
    background: rgba(15,23,42,.75); color: #e2e8f0; font-size: 0.75rem; padding: 4px 10px;
    border-radius: 8px; cursor: pointer; font-family: inherit; }
.code-copy-btn:hover { background: rgba(77,107,254,.9); border-color: transparent; }
.code-copy-btn.copied { background: #059669; border-color: transparent; }
.code-block { background: #0f172a; color: #e2e8f0; padding: 14px 16px; border-radius: 12px;
    overflow-x: auto; font-size: 0.82rem; line-height: 1.55; white-space: pre-wrap; word-break: break-all; }
.code-block-wrap .code-block { padding-right: 72px; }

.api-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; margin: 8px 0 12px; }
.api-table th, .api-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.api-table th { color: var(--text-light); font-weight: 600; background: #f8fafc; }
.api-table.compact th, .api-table.compact td { padding: 8px 10px; font-size: 0.84rem; }
.api-path { display: inline-flex; align-items: center; gap: 8px; background: #f1f5f9; padding: 6px 12px;
    border-radius: 8px; font-size: 0.88rem; }
.api-path .method { background: var(--primary-color); color: #fff; font-size: 0.72rem; font-weight: 700;
    padding: 2px 8px; border-radius: 6px; }
.api-ep-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 8px;
    padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.api-ep-head .tool-icon { flex-shrink: 0; }
.api-ep-head > div { flex: 1; min-width: 0; }
.api-ep-head h2 { font-size: 1.25rem; font-weight: 800; margin: 0 0 4px; }
.api-ep-head p { color: var(--text-light); font-size: 0.9rem; margin: 4px 0 8px; }
.muted { color: var(--text-light); font-size: 0.9rem; }

/* 接口索引网格（endpoints 页） */
.api-ep-index-group { margin-bottom: 22px; }
.api-ep-index-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 10px;
    display: flex; align-items: center; gap: 8px; color: var(--text-color); }
.api-ep-index-title i { color: var(--primary-color); }
.api-ep-index-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.api-ep-index-card { display: flex; align-items: flex-start; gap: 12px; text-align: left;
    border: 1px solid var(--border); background: #fff; border-radius: 12px; padding: 14px 14px;
    cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; font: inherit; color: inherit; width: 100%; }
.api-ep-index-card:hover { border-color: var(--primary-color); box-shadow: 0 6px 20px rgba(77,107,254,.1);
    transform: translateY(-1px); }
.api-ep-index-card .tool-icon { width: 40px; height: 40px; border-radius: 10px; background: rgba(77,107,254,.1);
    color: var(--primary-color); display: grid; place-items: center; flex-shrink: 0; }
.api-ep-index-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.api-ep-index-meta strong { font-size: 0.92rem; }
.api-ep-index-meta code { font-size: 0.72rem; color: var(--primary-color); background: #f1f5f9;
    padding: 2px 6px; border-radius: 6px; width: fit-content; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.api-ep-index-meta span { font-size: 0.8rem; color: var(--text-light); line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.api-ep-index-arrow { color: #cbd5e1; margin-top: 10px; flex-shrink: 0; }

.tool-head-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.api-toggle-btn.active { background: var(--primary-color); color: #fff; border-color: var(--primary-color); }
.api-callout { margin-bottom: 18px; animation: fadeIn .25s ease; }
.api-callout h3 { font-size: 1.05rem; margin-bottom: 8px; }
.api-key-once { word-break: break-all; }
.api-key-plain-row { display: flex; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.api-key-plain-row code { background: #fff; border: 1px solid #a7f3d0; padding: 8px 12px; border-radius: 8px;
    font-size: 0.85rem; flex: 1; min-width: 200px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; }
.badge-on { background: #ecfdf5; color: #047857; }
.badge-off { background: #f1f5f9; color: #64748b; }
.alert { padding: 12px 16px; border-radius: 10px; font-size: 0.92rem; }
.alert-ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.alert-err { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.table-wrap { overflow-x: auto; }

@media (max-width: 860px) {
    .api-layout { grid-template-columns: 1fr; }
    .api-side { position: static; max-height: none; }
    .api-toc { max-height: 42vh; }
    .api-ep-index-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .site-nav { gap: 14px; }
    .site-nav a { font-size: 0.88rem; }
    .hero h1 { font-size: 1.6rem; }
    .card { padding: 26px 20px; }
    .cat-tabs { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap;
        padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
    .cat-tab { flex-shrink: 0; }
    .cat-section-head h2 { font-size: 1rem; }
    .tool-grid { grid-template-columns: 1fr; }
}

/* ---------- 收藏 / 历史增强 ---------- */
.tool-card-wrap { position: relative; }
.tool-card-wrap[hidden] { display: none !important; }
.tool-card-wrap .tool-card { height: 100%; }
.fav-btn {
    position: absolute; top: 10px; right: 10px; z-index: 3;
    width: 32px; height: 32px; border-radius: 999px; border: 1px solid var(--border);
    background: rgba(255,255,255,.92); color: #94a3b8; cursor: pointer;
    display: grid; place-items: center; padding: 0; font-size: 0.85rem;
    box-shadow: 0 2px 8px rgba(15,23,42,.06); transition: color .15s, background .15s, border-color .15s;
}
.fav-btn:hover { color: #f59e0b; border-color: #fcd34d; }
.fav-btn.is-on { color: #f59e0b; background: #fffbeb; border-color: #fcd34d; }
.fav-btn:disabled { opacity: .6; cursor: wait; }
.fav-btn-page.is-on { color: #b45309; background: #fffbeb; border-color: #fcd34d; }
.fav-section .cat-section-head h2 i { color: #f59e0b; }
.fav-hint { margin: 0 0 18px; font-size: 0.88rem; display: flex; align-items: center; gap: 8px; }

.page-head-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.page-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.history-filter { padding: 14px 16px; margin-bottom: 14px; }
.history-filter-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.history-filter-row label { display: flex; flex-direction: column; gap: 6px; font-size: 0.82rem; color: var(--text-light); min-width: 160px; }
.history-filter-row select {
    border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px;
    font: inherit; background: #fff; color: var(--text-color); min-width: 180px;
}
.nowrap { white-space: nowrap; }
.tiny { font-size: 0.72rem; margin-top: 2px; }
.result-details summary { cursor: pointer; list-style: none; }
.result-details summary::-webkit-details-marker { display: none; }
.result-details summary::after { content: ' 展开'; font-size: 0.75rem; color: var(--primary-color); }
.result-details[open] summary::after { content: ' 收起'; }
.result-full {
    margin: 8px 0 0; padding: 10px 12px; background: #0f172a; color: #e2e8f0;
    border-radius: 10px; font-size: 0.78rem; line-height: 1.5; white-space: pre-wrap; word-break: break-all;
    max-height: 240px; overflow: auto;
}

/* ---------- 余额告警 / API 用量 ---------- */
.alert-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px 14px;
    align-items: end;
}
.alert-form-grid label {
    display: flex; flex-direction: column; gap: 6px;
    font-size: 0.82rem; color: var(--text-light); font-weight: 600;
}
.alert-form-grid input,
.alert-form-grid select {
    border: 1px solid var(--border); border-radius: 10px;
    padding: 9px 12px; font: inherit; color: var(--text-color); background: #fff;
}
.alert-form-grid label:has(input[name="webhook_url"]) {
    grid-column: 1 / -1;
}
.usage-panel { border-top: 1px solid var(--border); padding-top: 20px; }
.usage-stats { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.usage-stat {
    flex: 1; min-width: 100px; background: #f8fafc; border: 1px solid var(--border);
    border-radius: 12px; padding: 12px 14px; text-align: center;
}
.usage-stat-num { font-size: 1.4rem; font-weight: 800; color: var(--text-color); }
.usage-stat-num.ok { color: #047857; }
.usage-stat-num.err { color: #b91c1c; }
.usage-stat-label { font-size: 0.78rem; color: var(--text-light); margin-top: 2px; }
.usage-bars {
    display: flex; align-items: flex-end; gap: 6px; height: 100px;
    padding: 8px 4px 0; overflow-x: auto;
}
.usage-bar-col { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 28px; }
.usage-bar {
    width: 18px; background: linear-gradient(180deg, #6b83ff, var(--primary-color));
    border-radius: 6px 6px 2px 2px; min-height: 4px;
}
.usage-bar-lab { font-size: 0.65rem; color: #94a3b8; }
.usage-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.usage-tool-chip {
    display: inline-flex; align-items: center; gap: 8px;
    border: 1px solid var(--border); border-radius: 999px;
    padding: 6px 12px; font-size: 0.82rem; background: #fff; color: inherit;
}
.usage-tool-chip:hover { border-color: var(--primary-color); color: var(--primary-color); }
.usage-tool-chip span {
    background: #f1f5f9; border-radius: 999px; padding: 1px 8px;
    font-weight: 700; font-size: 0.75rem;
}
.data-table.compact th, .data-table.compact td { padding: 8px 10px; font-size: 0.84rem; }
.badge-on { color: #047857; background: rgba(16,185,129,.12); padding: 2px 8px; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.badge-off { color: #64748b; background: #f1f5f9; padding: 2px 8px; border-radius: 999px; font-size: .75rem; font-weight: 700; }
