:root {
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #25313a;
  background: #f6f7f5;
  color-scheme: light;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 214px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 28px 15px; background: #fff; border-right: 1px solid #e7e9e4; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 11px 44px; }
.brand-mark, .dialog-icon { width: 40px; height: 40px; display: grid; place-items: center; padding-right: 4px; border-radius: 11px; background: #dce9ee; color: #315b70; font-size: 23px; font-weight: 800; letter-spacing: -4px; }
.brand-mark span, .dialog-icon span { color: #6a98a9; }
.brand strong { display: block; font-size: 15px; letter-spacing: 1.5px; line-height: 1.25; }
.brand small { display: block; margin-top: 4px; color: #9ba7a9; font-size: 8px; letter-spacing: 1.3px; }
.nav-caption { padding: 0 14px; margin-bottom: 12px; color: #a3aaac; font-size: 10px; letter-spacing: 1px; }
.sidebar nav { display: grid; gap: 3px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 9px; color: #728087; font-size: 12px; transition: background .18s, color .18s; }
.nav-item span { width: 18px; font-size: 16px; text-align: center; }
.nav-item:hover, .nav-item.active { background: #edf3f5; color: #315b70; }
.sidebar-bottom { display: flex; align-items: center; gap: 11px; margin-top: auto; padding: 22px 13px 0; border-top: 1px solid #e8ebe9; }
.sidebar-bottom strong, .sidebar-bottom small { display: block; }
.sidebar-bottom strong { font-size: 11px; font-weight: 600; }
.sidebar-bottom small { margin-top: 4px; color: #98a2a4; font-size: 10px; }
.local-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: #5ba480; box-shadow: 0 0 0 4px #e8f5ec; }

main { min-width: 0; }
.topbar { height: 65px; display: flex; align-items: center; justify-content: space-between; padding: 0 42px; border-bottom: 1px solid #e7e9e4; background: #fff; color: #718188; font-size: 12px; }
.crumb span { padding: 0 8px; color: #c2cbcb; }
.top-actions { display: flex; align-items: center; gap: 21px; }
.text-button { padding: 5px 0; border: 0; background: none; color: #5d7987; font-size: 11px; }
.text-button:hover { color: #244e63; text-decoration: underline; }
.content { width: 100%; min-width: 0; margin: 0; padding: 32px clamp(22px, 2.7vw, 52px) 28px; }
.intro { display: flex; justify-content: space-between; align-items: center; min-height: 180px; margin-bottom: 26px; }
.eyebrow, .section-index { color: #647f8c; font-size: 11px; font-weight: 700; letter-spacing: 1.2px; }
.eyebrow { display: flex; align-items: center; gap: 9px; }
.eyebrow-line { width: 20px; height: 1px; background: #8ba7b3; }
.intro h1 { margin: 14px 0 11px; font-size: clamp(34px, 4vw, 49px); font-weight: 700; line-height: 1.2; letter-spacing: -1.6px; }
.intro h1 em { color: #527586; font-style: normal; }
.intro p { margin: 0; color: #637881; font-size: 14px; line-height: 1.8; }
.hero-art { position: relative; width: 190px; height: 150px; flex: none; margin: 0 35px; opacity: .6; }
.orbit { position: absolute; inset: 14px; border: 1px solid #d5e1e5; border-radius: 50%; }
.orbit-b { inset: -10px; border-color: #e2e9ea; }
.core { position: absolute; left: 66px; top: 47px; width: 58px; height: 58px; display: grid; place-items: center; border-radius: 17px; background: #dce9ee; color: #557d90; font-size: 33px; font-weight: 800; }
.sat { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: #90b2bd; }
.s1 { top: 38px; left: 17px; }.s2 { top: 50px; right: 4px; }.s3 { bottom: 6px; left: 51px; }

.endpoint-panel, .provider-card, .surface, .settings-row { background: #fff; border: 1px solid #e4e9e7; box-shadow: 0 2px 12px #2a424b08; }
.endpoint-panel { display: flex; align-items: center; gap: 16px; padding: 19px 21px; border-radius: 13px; }
.endpoint-icon { width: 41px; height: 41px; display: grid; place-items: center; flex: none; border-radius: 10px; background: #e9f1f4; color: #557c8e; font-size: 20px; }
.endpoint-copy { display: grid; gap: 5px; min-width: 0; flex: 1; }
.endpoint-copy small { color: #758a92; font-size: 11px; font-weight: 700; letter-spacing: 1px; }
.endpoint-copy code { overflow: hidden; color: #33434d; font-size: 15px; text-overflow: ellipsis; }
.copy-button, .outline-button { padding: 10px 14px; border: 1px solid #d3e0e5; border-radius: 8px; background: #f8fbfb; color: #456b7d; font-size: 11px; font-weight: 600; white-space: nowrap; }
.copy-button:hover, .outline-button:hover { background: #eaf3f5; border-color: #acc8d2; }
.copy-button span { margin-left: 8px; }

.section-heading { display: flex; align-items: end; justify-content: space-between; margin: 44px 0 19px; }
.section-heading h2, .surface h2, .settings-row h2 { margin: 7px 0; color: #26353d; font-size: 21px; font-weight: 650; letter-spacing: -.5px; }
.section-heading p, .settings-row p { margin: 0; color: #6e828a; font-size: 12px; line-height: 1.7; }
.count-pill { padding: 7px 10px; border: 1px solid #d7e7de; border-radius: 30px; background: #f0f8f2; color: #57856b; font-size: 11px; white-space: nowrap; }
.provider-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.provider-card { min-height: 172px; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(17px, 1.3vw, 24px); border-radius: 12px; transition: border-color .18s, box-shadow .18s; }
.provider-card:hover { border-color: #bed1d6; box-shadow: 0 6px 20px #2a424b12; }
.card-top, .card-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.provider-logo { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; font-size: 20px; font-weight: 750; }
.openai-logo { background: #e6f2ea; color: #45906a; font-size: 25px; }
.qwen-logo { background: #f2eaf5; color: #a47db5; }
.deepseek-logo { background: #e7ecf9; color: #6d83be; }
.badge { padding: 5px 7px; border: 1px solid #e5e9e8; border-radius: 6px; background: #f8f9f8; color: #94a0a4; font-size: 10px; white-space: nowrap; }
.badge.connected { border-color: #d2e8db; background: #f0f8f2; color: #4d8b68; }
.provider-card h3 { margin: 12px 0 4px; font-size: 16px; font-weight: 650; }
.provider-card p { margin: 0; color: #6f838b; font-size: 12px; line-height: 1.6; }
.card-foot { padding-top: 12px; border-top: 1px solid #edf0ee; }
.model-prefix { color: #768b93; font: 11px Consolas, monospace; }
.card-link { padding: 0; border: 0; background: none; color: #3d6c80; font-size: 11px; white-space: nowrap; }
.card-link:hover { text-decoration: underline; }

.two-column { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 16px; margin-top: 29px; }
.surface { min-width: 0; padding: 22px; border-radius: 12px; }
.surface-head { display: flex; align-items: end; justify-content: space-between; gap: 8px; }
.surface-head h2 { margin-bottom: 0; }
.tiny-note { color: #788c94; font-size: 11px; text-align: right; }
.mini-button { padding: 7px 9px; border: 1px solid #d7e4e8; border-radius: 7px; background: #f8fbfb; color: #476e80; font-size: 11px; white-space: nowrap; }
.mini-button:hover { background: #eaf3f5; }
.mini-button:disabled { opacity: .55; cursor: wait; }
.surface-desc { margin: 17px 0; color: #70848c; font-size: 12px; line-height: 1.7; }
.catalog-message { color: #758a93; font-size: 11px; line-height: 1.6; }
.model-list { display: grid; align-content: start; gap: 5px; min-height: 70px; max-height: 277px; overflow: auto; margin: 14px 0; padding-right: 4px; }
.catalog-group { margin: 8px 0 2px; color: #85979e; font-size: 10px; font-weight: 700; letter-spacing: .8px; }
.catalog-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 10px 11px; border: 1px solid #e5ebec; border-radius: 8px; background: #fbfcfc; text-align: left; }
.catalog-item:hover { border-color: #a9c4cf; background: #f0f7f9; }
.catalog-item strong { overflow: hidden; color: #31464f; font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.catalog-item span { overflow: hidden; color: #84959b; font: 10px Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.custom-models { padding-top: 12px; border-top: 1px solid #edf0ee; }
.custom-models summary { color: #64808c; font-size: 11px; cursor: pointer; }
.custom-models p { color: #86999f; font-size: 11px; }
.custom-model-list { display: flex; flex-wrap: wrap; gap: 7px; margin: 11px 0; }
.model-chip { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border: 1px solid #dce6e8; border-radius: 7px; background: #f7fafb; color: #516873; font: 11px Consolas, monospace; }
.model-chip button { padding: 0; border: 0; background: none; color: #93a4aa; font-size: 15px; line-height: 1; }
.empty-models { color: #7e9299; font-size: 12px; }
.inline-form { display: flex; gap: 8px; }
.inline-form input, .test-form select, .test-form textarea, .dialog input { min-width: 0; padding: 10px 12px; border: 1px solid #dce4e5; border-radius: 8px; outline: none; background: #fff; color: #2f4048; }
.inline-form input:focus, .test-form select:focus, .test-form textarea:focus, .dialog input:focus { border-color: #87a9b8; box-shadow: 0 0 0 3px #dcebef; }
.inline-form input { flex: 1; font-size: 11px; }
.inline-form button { padding: 0 13px; border: 0; border-radius: 8px; background: #dce9ee; color: #3b6173; font-size: 11px; font-weight: 650; white-space: nowrap; }
.inline-form button:hover { background: #c9dfe8; }
.test-form { display: grid; gap: 8px; margin-top: 20px; }
.test-form label, .dialog label { color: #5e747d; font-size: 12px; font-weight: 600; }
.test-form select, .test-form textarea { width: 100%; font-size: 12px; resize: vertical; }
.model-help { margin: -2px 0 7px; color: #85989f; font-size: 10px; }
.test-form textarea { margin-bottom: 4px; }
.test-form button, .primary-button { display: flex; justify-content: space-between; padding: 11px 14px; border: 0; border-radius: 8px; background: #446e81; color: #fff; font-size: 11px; font-weight: 600; }
.test-form button:hover, .primary-button:hover { background: #315b6f; }
.test-form button:disabled { opacity: .5; cursor: wait; }
.test-result { margin-top: 15px; padding: 13px; border: 1px solid #dce6e8; border-radius: 8px; background: #f8fbfb; }
.result-label { color: #688493; font-size: 10px; letter-spacing: 1px; }
.test-result pre { max-height: 230px; overflow: auto; margin: 8px 0 0; color: #394c53; font: 11px/1.7 Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 28px; padding: 22px; border-radius: 12px; }
.access-panel { margin-top: 24px; }
.access-panel h3 { margin: 23px 0 9px; color: #3b5662; font-size: 12px; }
.key-list { display: grid; gap: 8px; margin-top: 16px; color: #81939a; font-size: 11px; }
.key-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border: 1px solid #e2e9e9; border-radius: 8px; background: #fbfcfc; }
.key-row div { display: grid; gap: 4px; min-width: 0; }
.key-row span:first-child { color: #38525e; font-weight: 650; }
.key-row span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usage-cards { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 8px; margin-top: 17px; }
.usage-card { display: grid; gap: 5px; padding: 12px; border: 1px solid #e3ebeb; border-radius: 9px; background: #f8fbfb; }
.usage-card span:first-child { color: #86999f; font-size: 10px; }
.usage-card span:last-child { color: #345264; font-size: 18px; font-weight: 650; }
.usage-table { overflow-x: auto; border: 1px solid #e5ebec; border-radius: 8px; }
.usage-row { display: grid; grid-template-columns: minmax(150px,2fr) repeat(5,minmax(70px,1fr)); min-width: 650px; padding: 9px 11px; gap: 8px; border-top: 1px solid #edf1f1; color: #566e77; font-size: 10px; }
.usage-row:first-child { border-top: 0; }
.usage-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usage-header { background: #f5f9f9; color: #799099; font-weight: 650; }
.usage-empty { padding: 16px; color: #99a8ad; font-size: 11px; }
footer { padding: 34px 2px 4px; color: #b4bfc0; font-size: 9px; letter-spacing: 1.5px; }
footer span { padding: 0 8px; }

@media (min-width: 1500px) {
  .content { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 18px; align-items: start; }
  .intro { grid-column: span 7; min-height: 148px; margin-bottom: 0; }
  .hero-art { margin-right: 8px; }
  .endpoint-panel { grid-column: span 5; align-self: center; }
  .section-heading, .provider-grid, .two-column, .access-panel, .settings-row, footer { grid-column: 1 / -1; }
  .section-heading { margin-top: 22px; }
  .provider-grid { gap: 18px; }
  .surface { padding: 26px; }
  .model-list { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 390px; }
  .catalog-group { grid-column: 1 / -1; }
}

.overlay { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: #26343d72; backdrop-filter: blur(5px); }
.dialog { position: relative; display: grid; gap: 11px; width: min(100%, 460px); padding: 32px; border: 1px solid #e2e9e8; border-radius: 17px; background: #fff; box-shadow: 0 24px 80px #273d4d3b; }
.login-dialog { width: min(100%, 430px); }
.dialog-icon { margin-bottom: 9px; }
.dialog h2 { margin: 3px 0; color: #283b43; font-size: 23px; letter-spacing: -.7px; }
.dialog p { margin: 0 0 10px; color: #84959b; font-size: 11px; line-height: 1.7; }
.dialog input { width: 100%; font-size: 12px; }
.dialog .primary-button { margin-top: 7px; }
.close-button { position: absolute; top: 12px; right: 17px; padding: 0; border: 0; background: none; color: #98a7ab; font-size: 24px; }
.field-hint { margin: 0 !important; color: #91a0a3 !important; font-size: 10px !important; }
.form-error { min-height: 12px; color: #bb655d; font-size: 11px; }
.new-key { display: block; padding: 14px; border: 1px solid #d8e5e8; border-radius: 8px; background: #f7fafb; color: #375c70; font: 12px/1.7 Consolas, monospace; word-break: break-all; }
.toast { position: fixed; right: 25px; bottom: 22px; z-index: 30; padding: 10px 15px; border: 1px solid #d9e5e8; border-radius: 8px; background: #fff; box-shadow: 0 9px 35px #273d4d26; color: #3d687a; font-size: 11px; font-weight: 600; opacity: 0; transform: translateY(8px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1250px) {
  .provider-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-art { display: none; }
}
@media (max-width: 940px) {
  .app-shell { display: block; }
  .sidebar { position: relative; height: auto; display: flex; flex-direction: row; align-items: center; padding: 12px 22px; border-right: 0; border-bottom: 1px solid #e7e9e4; }
  .brand { padding: 0; margin-right: auto; }
  .brand-mark { width: 34px; height: 34px; font-size: 20px; }
  .nav-caption, .sidebar-bottom { display: none; }
  .sidebar nav { display: flex; gap: 1px; }
  .nav-item { gap: 6px; padding: 8px; font-size: 10px; }
  .nav-item span { font-size: 14px; }
  .topbar { height: 47px; padding: 0 28px; }
  .content { padding: 28px; }
  .provider-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .intro { min-height: 140px; }
  .intro h1 { font-size: 38px; }
}
@media (max-width: 680px) {
  .sidebar { padding: 11px 17px; }
  .brand strong { font-size: 13px; }
  .brand small { display: none; }
  .sidebar nav { gap: 0; }
  .nav-item { padding: 7px; font-size: 0; }
  .nav-item span { font-size: 16px; }
  .topbar { padding: 0 20px; }
  .content { padding: 26px 18px; }
  .intro { min-height: 133px; }
  .intro h1 { font-size: 34px; }
  .intro p { font-size: 11px; }
  .endpoint-panel { gap: 10px; padding: 14px; }
  .endpoint-icon { display: none; }
  .endpoint-copy code { font-size: 11px; }
  .copy-button { padding: 8px; font-size: 10px; }
  .section-heading { margin-top: 37px; }
  .provider-grid { gap: 10px; }
  .provider-grid { grid-template-columns: 1fr; }
  .provider-card { min-height: 172px; padding: 13px; }
  .card-foot { align-items: flex-start; flex-direction: column; }
  .two-column { grid-template-columns: 1fr; }
  .surface { padding: 19px; }
  .settings-row { align-items: flex-start; flex-direction: column; }
  .usage-cards { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dialog { padding: 26px; }
}
