:root {
  color-scheme: light;
  --ink: #17211d;
  --ink-muted: #65726c;
  --paper: #ffffff;
  --canvas: #f4f7f5;
  --line: #dce4df;
  --line-strong: #c8d3cc;
  --forest: #102820;
  --forest-soft: #193a2f;
  --teal: #157f67;
  --teal-dark: #0e6652;
  --teal-pale: #e6f5f0;
  --yellow: #efb536;
  --yellow-pale: #fff5da;
  --red: #bf4a45;
  --red-pale: #fbedeb;
  --shadow: 0 10px 28px rgba(20, 46, 36, 0.1);
  font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--canvas); color: var(--ink); }
body { min-width: 320px; }
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--ink-muted); }
.nowrap { white-space: nowrap; }
.flush { margin: 0; }
.fine-print { font-size: 12px; }
.space-top-14 { margin-top: 14px; }
.space-top-16 { margin-top: 16px; }

.auth-view { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 0.95fr) minmax(500px, 1.05fr); }
.auth-brand { background: var(--forest); color: white; padding: 42px clamp(42px, 6vw, 88px); display: flex; flex-direction: column; position: relative; overflow: hidden; }
.auth-brand::after { content: ""; position: absolute; right: -18%; bottom: 12%; width: 72%; aspect-ratio: 1; border: 1px solid rgba(255,255,255,.1); transform: rotate(18deg); }
.auth-brand::before { content: "H3"; position: absolute; right: 5%; bottom: -7%; color: rgba(255,255,255,.035); font-size: min(34vw, 430px); font-weight: 800; line-height: 1; }
.brand-lockup { display: flex; align-items: center; gap: 12px; color: var(--ink); font-weight: 700; }
.brand-lockup--light { color: white; }
.brand-mark { width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; background: var(--yellow); color: var(--forest); border-radius: 6px; font-size: 13px; font-weight: 800; }
.brand-name { font-size: 19px; }
.auth-brand__content { position: relative; z-index: 1; margin: auto 0; max-width: 600px; }
.eyebrow { margin: 0 0 12px; color: var(--teal); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.auth-brand .eyebrow { color: #78d8bd; }
.auth-brand h1 { margin: 0; font-size: clamp(42px, 5vw, 72px); line-height: 1.12; letter-spacing: 0; font-weight: 750; }
.auth-brand__content > p:last-child { max-width: 440px; margin: 28px 0 0; color: #b6c9c1; font-size: 17px; line-height: 1.8; }
.auth-model-strip { position: relative; z-index: 1; min-height: 70px; padding: 13px 16px; display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 12px; border-top: 1px solid rgba(255,255,255,.16); border-bottom: 1px solid rgba(255,255,255,.16); }
.auth-model-strip div { display: flex; flex-direction: column; gap: 3px; }
.auth-model-strip small { color: #94aaa1; }
.auth-model-strip > span:last-child { color: #78d8bd; font-size: 12px; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #36c28f; box-shadow: 0 0 0 3px rgba(54,194,143,.14); }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 48px; background: var(--paper); }
.auth-form-wrap { width: min(420px, 100%); }
.mobile-brand { display: none; margin-bottom: 48px; }
.auth-heading h2 { margin: 0 0 10px; font-size: 30px; }
.auth-heading > p:last-child { margin: 0; color: var(--ink-muted); }
.segmented { display: grid; grid-template-columns: 1fr 1fr; margin: 32px 0 24px; padding: 4px; background: var(--canvas); border: 1px solid var(--line); border-radius: 7px; }
.segmented__item { border: 0; background: transparent; min-height: 38px; border-radius: 5px; color: var(--ink-muted); font-weight: 650; }
.segmented__item.active { background: var(--paper); color: var(--ink); box-shadow: 0 1px 4px rgba(15,40,30,.08); }
.stack-form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; font-size: 13px; font-weight: 650; }
.field input, .field textarea, .field select, .input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 6px; background: white; color: var(--ink); outline: 0; }
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus, .input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(21,127,103,.1); }
.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-strong); border-radius: 6px; padding: 8px 14px; background: var(--paper); color: var(--ink); font-weight: 650; white-space: nowrap; }
.button svg, .icon-button svg, .nav-item svg { width: 17px; height: 17px; stroke-width: 1.8; }
.button:hover { border-color: var(--teal); color: var(--teal-dark); }
.button--primary { background: var(--teal); border-color: var(--teal); color: white; }
.button--primary:hover { background: var(--teal-dark); color: white; border-color: var(--teal-dark); }
.button--danger { color: var(--red); border-color: #e8c7c4; background: var(--red-pale); }
.button--wide { width: 100%; min-height: 46px; }
.button--small { min-height: 32px; padding: 5px 10px; font-size: 12px; }
.button:disabled { opacity: .55; cursor: not-allowed; }
.form-note { color: var(--ink-muted); font-size: 12px; text-align: center; margin: 0; }

.console { min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; width: 244px; background: var(--forest); color: white; display: flex; flex-direction: column; padding: 22px 14px 16px; }
.sidebar__brand { padding: 0 8px 22px; border-bottom: 1px solid rgba(255,255,255,.1); }
.primary-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 20px; }
.nav-item { min-height: 42px; display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border: 0; border-radius: 6px; background: transparent; color: #a9beb5; text-align: left; }
.nav-item:hover { color: white; background: rgba(255,255,255,.06); }
.nav-item.active { color: white; background: var(--forest-soft); box-shadow: inset 3px 0 var(--yellow); }
.nav-divider { height: 1px; background: rgba(255,255,255,.1); margin: 12px 10px; }
.sidebar__footer { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 14px 8px 0; border-top: 1px solid rgba(255,255,255,.1); }
.sidebar-user { min-width: 0; flex: 1; display: flex; align-items: center; gap: 10px; }
.sidebar-user > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sidebar-user strong, .sidebar-user small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user strong { font-size: 13px; }
.sidebar-user small { font-size: 11px; color: #91a79e; }
.avatar { width: 32px; height: 32px; flex: 0 0 auto; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; background: var(--teal); font-size: 11px; font-weight: 800; }
.icon-button { width: 36px; height: 36px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--ink-muted); padding: 0; }
.icon-button:hover { color: var(--teal); border-color: var(--teal); }
.icon-button--dark { border-color: rgba(255,255,255,.12); background: transparent; color: #a9beb5; }
.console-main { grid-column: 2; min-width: 0; }
.topbar { height: 88px; position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 14px clamp(20px, 3vw, 42px); background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); }
.topbar h1 { margin: 3px 0 0; font-size: 22px; }
.breadcrumb { margin: 0; color: var(--ink-muted); font-size: 11px; }
.topbar__actions { display: flex; align-items: center; gap: 12px; }
.service-status { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink-muted); font-size: 12px; background: var(--paper); }
.mobile-menu { display: none; }
.page-area { padding: 28px clamp(20px, 3vw, 42px) 60px; }
.page { display: none; max-width: 1440px; margin: 0 auto; }
.page.active { display: block; }
.page-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.page-intro h2 { margin: 0 0 7px; font-size: 18px; }
.page-intro p { margin: 0; color: var(--ink-muted); line-height: 1.7; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--paper); }
.metric { padding: 20px 22px; border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric__label { display: flex; align-items: center; justify-content: space-between; color: var(--ink-muted); font-size: 12px; }
.metric__label svg { width: 16px; height: 16px; }
.metric strong { display: block; margin-top: 13px; font-size: 27px; }
.metric small { display: block; margin-top: 5px; color: var(--ink-muted); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, .7fr); gap: 22px; margin-top: 22px; align-items: start; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; }
.panel__header { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.panel__header h2, .panel__header h3 { margin: 0; font-size: 14px; }
.panel__body { padding: 18px; }
.model-callout { position: relative; min-height: 218px; overflow: hidden; background: var(--forest); color: white; border-radius: 8px; padding: 24px; display: flex; flex-direction: column; justify-content: space-between; }
.model-callout::before { content: "H3"; position: absolute; right: 22px; top: -9px; font-size: 134px; line-height: 1; font-weight: 800; color: rgba(255,255,255,.06); }
.model-callout__top, .model-callout__bottom { position: relative; z-index: 1; }
.model-callout h2 { margin: 7px 0 8px; font-size: 29px; }
.model-callout p { margin: 0; color: #a9beb5; max-width: 480px; line-height: 1.65; }
.model-callout__bottom { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.model-callout__status { color: #a9beb5; }
.section-subheading { margin: 26px 0 10px; font-size: 15px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 7px; }
.tag { display: inline-flex; align-items: center; min-height: 25px; padding: 3px 8px; border-radius: 5px; background: var(--teal-pale); color: var(--teal-dark); font-size: 11px; font-weight: 650; }
.tag--dark { color: #d6e7df; background: rgba(255,255,255,.1); }
.tag--yellow { background: var(--yellow-pale); color: #805f10; }
.tag--red { background: var(--red-pale); color: var(--red); }
.tag--gray { background: #eef2ef; color: #5f6c66; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; font-size: 12px; }
th { color: var(--ink-muted); background: #f8faf9; font-weight: 650; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td strong { font-size: 13px; }
.table-actions { display: flex; align-items: center; gap: 8px; }
.empty-state { min-height: 210px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; text-align: center; color: var(--ink-muted); }
.empty-state svg { width: 34px; height: 34px; color: var(--line-strong); margin-bottom: 12px; }
.empty-state strong { color: var(--ink); margin-bottom: 6px; }
.notice { display: flex; gap: 10px; padding: 12px 14px; border: 1px solid #ead9a8; border-radius: 6px; background: var(--yellow-pale); color: #6f5614; font-size: 12px; line-height: 1.6; }
.notice svg { width: 17px; height: 17px; flex: 0 0 auto; margin-top: 1px; }
.notice--success { background: var(--teal-pale); color: var(--teal-dark); border-color: #bce0d4; }
.key-secret { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 14px 0; }
.code, code { font-family: "Cascadia Code", Consolas, monospace; }
.code-block { position: relative; margin: 0; padding: 18px; overflow-x: auto; border-radius: 6px; background: #13231d; color: #dcebe4; font: 12px/1.7 "Cascadia Code", Consolas, monospace; white-space: pre; }
.code-wrap { position: relative; }
.code-copy { position: absolute; top: 9px; right: 9px; }
.doc-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 22px; align-items: start; }
.doc-nav { position: sticky; top: 116px; display: flex; flex-direction: column; gap: 3px; border-left: 1px solid var(--line); }
.doc-nav button { border: 0; background: transparent; text-align: left; padding: 8px 13px; color: var(--ink-muted); font-size: 12px; }
.doc-nav button:hover { color: var(--teal); }
.doc-content { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: clamp(22px, 4vw, 44px); }
.doc-content h2 { margin: 0 0 12px; font-size: 24px; }
.doc-content h3 { margin: 34px 0 10px; padding-top: 4px; font-size: 16px; }
.doc-content p, .doc-content li { color: var(--ink-muted); line-height: 1.75; font-size: 13px; }
.endpoint { display: grid; grid-template-columns: 72px 1fr; gap: 10px; align-items: center; padding: 11px 13px; background: #f8faf9; border: 1px solid var(--line); border-radius: 6px; margin: 9px 0; }
.method { display: inline-flex; justify-content: center; color: var(--teal-dark); font-weight: 800; font-size: 11px; }
.model-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .65fr); gap: 22px; }
.spec-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.spec-item { padding: 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.spec-item:nth-child(2n) { border-right: 0; }
.spec-item:nth-last-child(-n+2) { border-bottom: 0; }
.spec-item small { display: block; color: var(--ink-muted); margin-bottom: 6px; }
.admin-grid { display: grid; grid-template-columns: minmax(340px, .7fr) minmax(0, 1.3fr); gap: 22px; align-items: start; }
.inline-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.toast-region { position: fixed; z-index: 100; top: 18px; right: 18px; width: min(360px, calc(100vw - 36px)); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { padding: 12px 14px; border-radius: 6px; background: var(--forest); color: white; box-shadow: var(--shadow); font-size: 13px; animation: toast-in .18s ease-out; }
.toast.error { background: #7b2f2c; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-5px); } }
.modal-backdrop { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(12,25,20,.52); }
.modal { width: min(520px, 100%); max-height: min(720px, calc(100vh - 40px)); overflow: auto; border-radius: 8px; background: white; box-shadow: var(--shadow); }
.modal__header { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.modal__header h2 { margin: 0; font-size: 16px; }
.modal__content { padding: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }

@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .dashboard-grid, .model-layout, .admin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .auth-view { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-panel { min-height: 100vh; padding: 28px 22px; align-items: flex-start; }
  .auth-form-wrap { margin: auto; }
  .mobile-brand { display: flex; }
  .console { display: block; }
  .sidebar { transform: translateX(-100%); transition: transform .18s ease-out; box-shadow: var(--shadow); }
  .console.nav-open .sidebar { transform: translateX(0); }
  .console-main { grid-column: auto; }
  .mobile-menu { display: inline-flex; }
  .topbar { height: 76px; padding: 10px 16px; justify-content: flex-start; }
  .topbar > div:nth-child(2) { min-width: 0; }
  .topbar__actions { margin-left: auto; }
  .topbar__actions .service-status { display: none; }
  .topbar__actions .button { width: 38px; padding: 0; font-size: 0; }
  .page-area { padding: 20px 14px 50px; }
  .doc-grid { grid-template-columns: 1fr; }
  .doc-nav { position: static; flex-direction: row; overflow-x: auto; border-left: 0; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
  .doc-nav button { white-space: nowrap; }
}

@media (max-width: 560px) {
  .metric-grid { grid-template-columns: 1fr; }
  .metric { border-right: 0; border-bottom: 1px solid var(--line); }
  .metric:nth-child(2) { border-bottom: 1px solid var(--line); }
  .metric:last-child { border-bottom: 0; }
  .page-intro { flex-direction: column; }
  .model-callout { min-height: 250px; }
  .model-callout__bottom { align-items: flex-start; flex-direction: column; }
  .spec-list, .inline-fields { grid-template-columns: 1fr; }
  .spec-item, .spec-item:nth-child(2n) { border-right: 0; border-bottom: 1px solid var(--line); }
  .spec-item:last-child { border-bottom: 0; }
  .auth-heading h2 { font-size: 26px; }
  .modal { max-height: calc(100vh - 20px); }
}
