:root {
  --green: #175b46;
  --green-dark: #104735;
  --green-soft: #e9f3ef;
  --ink: #17231e;
  --muted: #748079;
  --bg: #f3f6f4;
  --surface: #ffffff;
  --line: #e0e7e3;
  --danger: #b9413c;
  --danger-soft: #faeae8;
  --success: #217452;
  --success-soft: #e3f2ea;
  --warning: #8a6730;
  --warning-soft: #fff7e7;
  --shadow: 0 8px 28px rgba(25, 51, 40, .055);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { min-height: 100vh; margin: 0; color: var(--ink); background: var(--bg); font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0, 1fr); }

.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 26px 16px 20px; border-right: 1px solid var(--line); background: var(--surface); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 9px 30px; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: white; background: var(--green); font-size: 17px; font-weight: 700; }
.brand-copy strong, .brand-copy span { display: block; }
.brand-copy strong { font-size: 16px; font-weight: 600; letter-spacing: .03em; }
.brand-copy span { margin-top: 3px; color: #98a19c; font-size: 8px; letter-spacing: .15em; }
.api-nav { display: grid; gap: 5px; }
.controller-group { border-radius: 8px; }
.controller-menu { width: 100%; height: 42px; display: grid; grid-template-columns: minmax(0, 1fr) 20px 12px; align-items: center; gap: 7px; border: 0; border-radius: 8px; padding: 0 10px; color: #58665f; background: transparent; text-align: left; transition: background .15s, color .15s; }
.controller-menu:hover { color: var(--green); background: #f4f8f6; }
.controller-group.current > .controller-menu { color: var(--green); font-weight: 550; }
.controller-name { min-width: 0; font: 600 12px/1.35 ui-monospace, Consolas, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.controller-count { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 9px; color: #8c9791; background: #f0f3f1; font-size: 8px; }
.controller-arrow { color: #99a39e; font-size: 17px; line-height: 1; transform: rotate(0deg); transition: transform .15s; }
.controller-menu[aria-expanded="true"] .controller-arrow { transform: rotate(90deg); }
.endpoint-menu { position: relative; display: grid; gap: 2px; margin: 2px 0 8px 10px; padding-left: 12px; }
.endpoint-menu::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 1px; background: var(--line); }
.endpoint-menu[hidden] { display: none; }
.nav-item { position: relative; width: 100%; border: 0; border-radius: 7px; padding: 9px 10px; display: block; color: var(--muted); background: transparent; text-align: left; transition: background .15s, color .15s; }
.nav-item:hover { color: var(--green); background: #f4f8f6; }
.nav-item.active { color: var(--green); background: var(--green-soft); }
.nav-copy strong, .nav-copy span { display: block; }
.nav-copy strong { font-size: 13px; font-weight: 550; }
.nav-copy span { max-width: 170px; margin-top: 4px; color: #929d97; font: 10px/1.35 ui-monospace, Consolas, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 18px 10px 0; border-top: 1px solid var(--line); }
.status-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #39a976; box-shadow: 0 0 0 4px #e5f5ed; }
.sidebar-foot strong, .sidebar-foot span { display: block; }
.sidebar-foot strong { font-size: 10px; font-weight: 500; }
.sidebar-foot span { margin-top: 2px; color: #a0a9a4; font-size: 8px; word-break: break-all; }

.main-content { min-width: 0; padding: 38px clamp(28px, 5vw, 70px) 22px; }
.topbar { max-width: 1120px; margin: 0 auto 28px; display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.eyebrow { margin: 0 0 7px; color: var(--green); font-size: 9px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: clamp(26px, 3vw, 36px); font-weight: 550; letter-spacing: -.025em; }
.subtitle { margin: 0; color: var(--muted); font-size: 12px; }
.swagger-link { flex: 0 0 auto; padding: 9px 13px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: var(--surface); font-size: 10px; text-decoration: none; transition: border-color .15s, color .15s; }
.swagger-link:hover { color: var(--green); border-color: #a8c4b9; }
.workspace { max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(285px, .8fr); gap: 18px; align-items: start; }
.form-card, .result-panel { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.form-card { padding: clamp(24px, 3.5vw, 36px); }
.card-head { display: grid; grid-template-columns: 48px 1fr; gap: 15px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.api-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 11px; color: white; background: var(--green); font-size: 15px; font-weight: 600; }
.card-title h2 { margin-bottom: 5px; font-size: 19px; font-weight: 550; }
.card-title p { margin-bottom: 10px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.method-line { display: flex; align-items: center; gap: 8px; }
.method-badge { padding: 4px 6px; border-radius: 4px; color: var(--green); background: var(--green-soft); font: 700 8px/1 ui-monospace, monospace; }
.method-badge.get { color: #356ea8; background: #e6f0fa; }
.form-fields.empty { margin-top: 0; }
.method-line code { color: #8c9691; font-size: 9px; }
.form-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; margin-top: 25px; }
.field.full { grid-column: 1 / -1; }
.field label { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 7px; font-size: 11px; font-weight: 550; }
.field label span { color: #a3aca7; font-size: 9px; font-weight: 400; }
.input-wrap { position: relative; }
.input-wrap.has-action { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid var(--line); border-radius: 7px; outline: 0; color: var(--ink); background: #fbfcfb; transition: border-color .15s, box-shadow .15s, background .15s; }
.field input, .field select { height: 40px; padding: 0 11px; }
.field select { cursor: pointer; }
.field select:disabled { cursor: wait; color: #87918c; }
.field textarea { min-height: 100px; padding: 14px 46px 14px 14px; resize: vertical; line-height: 1.65; }
.field input::placeholder, .field textarea::placeholder { color: #abb4af; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: #7cab99; background: white; box-shadow: 0 0 0 3px rgba(23,91,70,.08); }
.field.invalid input, .field.invalid textarea, .field.invalid select { border-color: var(--danger); }
.field-error { min-height: 14px; margin-top: 4px; color: var(--danger); font-size: 9px; }
.reveal-button { position: absolute; top: 7px; right: 7px; border: 0; padding: 5px 6px; color: var(--muted); background: transparent; font-size: 9px; }
.field-action { min-width: 112px; height: 40px; border: 1px solid var(--green); border-radius: 7px; padding: 0 13px; color: var(--green); background: var(--green-soft); font-size: 10px; font-weight: 550; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.field-action:hover:not(:disabled) { color: white; background: var(--green); }
.field-action:disabled { cursor: default; border-color: var(--line); color: #8e9993; background: #f0f3f1; }
.form-hint { margin-top: 15px; padding: 10px 12px; border-radius: 6px; color: var(--warning); background: var(--warning-soft); font-size: 10px; line-height: 1.6; white-space: pre-line; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
.button { height: 38px; border-radius: 7px; padding: 0 17px; font-size: 10px; font-weight: 550; transition: background .15s, border-color .15s; }
.button.secondary { border: 1px solid var(--line); color: var(--muted); background: white; }
.button.secondary:hover { border-color: #b6c4bd; }
.button.primary { min-width: 102px; border: 1px solid var(--green); color: white; background: var(--green); }
.button.primary:hover { border-color: var(--green-dark); background: var(--green-dark); }
.button:disabled { cursor: wait; opacity: .65; }
.spinner { display: none; width: 12px; height: 12px; margin-left: 6px; border: 2px solid rgba(255,255,255,.4); border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: middle; }
.button.loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.result-panel { position: sticky; top: 24px; overflow: hidden; }
.result-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 20px 15px; border-bottom: 1px solid var(--line); }
.result-head h2 { margin: 0; font-size: 15px; font-weight: 550; }
.icon-button { border: 1px solid var(--line); border-radius: 6px; padding: 5px 9px; color: var(--muted); background: white; font-size: 9px; }
.icon-button:disabled { cursor: default; opacity: .4; }
.result-empty { min-height: 286px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; color: var(--muted); text-align: center; }
.empty-symbol { width: 44px; height: 44px; display: grid; place-items: center; margin-bottom: 13px; border-radius: 50%; color: var(--green); background: var(--green-soft); font-size: 22px; }
.result-empty strong { color: var(--ink); font-size: 11px; font-weight: 550; }
.result-empty p { margin: 5px 0 0; font-size: 9px; }
.result-content { padding: 20px; }
.result-status { display: inline-flex; margin-bottom: 17px; padding: 6px 9px; border-radius: 6px; font-size: 9px; font-weight: 600; }
.result-status.success { color: var(--success); background: var(--success-soft); }
.result-status.error { color: var(--danger); background: var(--danger-soft); }
.result-meta { margin: 0 0 15px; display: grid; gap: 9px; }
.result-meta div { display: flex; justify-content: space-between; gap: 12px; }
.result-meta dt { color: var(--muted); font-size: 9px; }
.result-meta dd { margin: 0; max-width: 70%; font: 9px/1.4 ui-monospace, Consolas, monospace; text-align: right; word-break: break-all; }
.result-content pre { min-height: 105px; margin: 0; padding: 13px; border: 1px solid var(--line); border-radius: 7px; color: #33423b; background: #f7f9f8; font: 10px/1.7 ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
footer { max-width: 1120px; margin: 20px auto 0; color: #9da6a1; font-size: 9px; text-align: center; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 10; padding: 9px 13px; border-radius: 7px; color: white; background: var(--green); box-shadow: var(--shadow); font-size: 10px; opacity: 0; pointer-events: none; transform: translateY(7px); transition: .18s; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 215px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
  .workspace { grid-template-columns: 1fr; }
  .result-panel { position: static; }
}
@media (max-width: 600px) {
  .app-shell { display: block; }
  .sidebar { position: static; height: auto; padding: 12px 14px; overflow: visible; }
  .brand { justify-content: flex-start; padding: 0 0 11px; }
  .brand-copy { display: block; }
  .api-nav { max-height: 260px; overflow-y: auto; }
  .sidebar-foot { display: none; }
  .main-content { padding: 23px 15px 18px; }
  .topbar { display: block; margin-bottom: 20px; }
  .swagger-link { display: inline-block; margin-top: 14px; }
  .card-head { grid-template-columns: 42px 1fr; }
  .api-icon { width: 42px; height: 42px; }
  .form-fields { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
}
