:root {
    --bg: #f6f7f9;
    --panel: #ffffff;
    --ink: #172033;
    --muted: #647084;
    --line: #dfe4ec;
    --blue: #2563eb;
    --green: #10835b;
    --red: #c2413b;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
}
a { color: inherit; text-decoration: none; }
.topbar {
    height: 64px;
    padding: 0 32px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 5;
}
.brand { font-size: 20px; font-weight: 800; }
nav { display: flex; gap: 10px; align-items: center; }
nav a {
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--muted);
}
nav a.active { background: #eef4ff; color: var(--blue); }
.page { max-width: 1240px; margin: 0 auto; padding: 36px 24px; }
.hero {
    min-height: calc(100vh - 136px);
    display: grid;
    align-items: center;
    background: linear-gradient(135deg, #ffffff 0%, #eef4ff 48%, #edf8f3 100%);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 54px;
}
.hero h1 { font-size: clamp(36px, 6vw, 76px); line-height: 1; margin: 8px 0 22px; max-width: 760px; }
.hero p { max-width: 720px; color: var(--muted); font-size: 18px; line-height: 1.75; }
.eyebrow { color: var(--green); font-weight: 800; letter-spacing: 0; margin: 0 0 8px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border: 0;
    border-radius: 6px;
    background: var(--blue);
    color: white;
    font-weight: 700;
    cursor: pointer;
}
.button.ghost { background: #fff; color: var(--blue); border: 1px solid var(--line); }
.button.small { min-height: 34px; padding: 0 12px; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.auth, .narrow { max-width: 560px; margin: 0 auto; }
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 24px;
}
label { display: grid; gap: 8px; margin: 0 0 16px; font-weight: 700; }
label span, small, .muted { color: var(--muted); font-weight: 400; line-height: 1.55; }
input, textarea, select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 11px 12px;
    font: inherit;
    color: var(--ink);
    background: #fff;
}
textarea { resize: vertical; }
.notice {
    padding: 14px 16px;
    border-radius: 6px;
    margin-bottom: 18px;
    background: #ecfdf5;
    color: var(--green);
    border: 1px solid #bfe8d6;
}
.notice.error {
    background: #fff1f1;
    color: var(--red);
    border-color: #f2c4c1;
}
.section-title {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: end;
    margin-bottom: 22px;
}
.section-title h1 { margin: 0; font-size: 30px; }
.stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}
.stats div {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 20px;
}
.stats strong { display: block; font-size: 28px; }
.stats span { color: var(--muted); }
.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.feature-card {
    display: grid;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    min-height: 118px;
}
.feature-card:hover { border-color: #9bbcff; background: #f8fbff; }
.feature-card strong { font-size: 18px; }
.feature-card span { color: var(--muted); line-height: 1.45; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 13px; }
.table-wrap { overflow: auto; }
.row-actions {
    min-width: 190px;
    white-space: nowrap;
}
.mini-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 9px;
    margin: 0 5px 5px 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--blue);
    background: #fff;
    font-size: 13px;
    font-weight: 700;
}
.mini-button:hover { background: #eef4ff; }
.content-stack { display: grid; gap: 18px; min-width: 0; }
.filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 14px;
    align-items: end;
}
.filters label { margin: 0; }
.section-title.compact { align-items: center; margin-bottom: 14px; }
.section-title.compact h2 { margin: 0; }
.empty {
    padding: 22px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
    background: #fafbfc;
}
.raw-json summary { cursor: pointer; font-weight: 800; }
.tools-panel h2 { margin-top: 0; }
.tool-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 16px;
}
.tool-grid form {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: #fafbfc;
}
.workspace {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}
.sidebar {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    max-height: calc(100vh - 130px);
    overflow: auto;
}
.sidebar h3 { margin: 18px 8px 8px; color: var(--green); font-size: 15px; }
.sidebar a {
    display: grid;
    gap: 4px;
    padding: 10px;
    border-radius: 6px;
}
.sidebar a.active, .sidebar a:hover { background: #eef4ff; }
.sidebar small { font-size: 12px; overflow-wrap: anywhere; }
.operation code {
    display: block;
    padding: 12px;
    margin: 14px 0 20px;
    background: #f0f3f7;
    border-radius: 6px;
    overflow-wrap: anywhere;
}
.api-form { margin-top: 18px; }
.result { margin-top: 24px; }
.report-panel { margin-top: 18px; }
pre {
    background: #111827;
    color: #e5e7eb;
    padding: 18px;
    border-radius: 8px;
    overflow: auto;
    max-height: 520px;
}
.mini {
    margin: 0;
    max-height: 180px;
    white-space: pre-wrap;
}
.badge {
    display: inline-flex;
    min-width: 52px;
    justify-content: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}
.badge.ok { background: #ecfdf5; color: var(--green); }
.badge.bad { background: #fff1f1; color: var(--red); }

@media (max-width: 860px) {
    .topbar { height: auto; padding: 14px 16px; align-items: flex-start; gap: 12px; }
    nav { flex-wrap: wrap; justify-content: flex-end; }
    .page { padding: 22px 14px; }
    .hero { padding: 30px 22px; }
    .section-title, .workspace { display: block; }
    .sidebar { max-height: none; margin-bottom: 16px; }
    .stats { grid-template-columns: 1fr; }
    .feature-grid, .filters, .tool-grid { grid-template-columns: 1fr; }
}
