:root {
  color-scheme: light;
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  color: #1b2440;
  background: #f5f7fb;
  --muted: #5a6780;
  --line: #e0e6f0;
  --action: #5144d9;
  --action-dark: #4336bc;
  --rail: #151a32;
  --panel: #fff;
  --radius: 12px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body, h1, h2, h3, p, dl, dd { margin: 0; }
body { min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button, select, input[type="file"] { cursor: pointer; }
button:disabled { cursor: default; }
a { color: var(--action); }
small { font-size: .82rem; }
.subtle { color: var(--muted); }
:focus-visible { outline: 2px solid #7468f0; outline-offset: 3px; }

.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .50rem .84rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #33415c;
  font-weight: 620;
  font-size: .91rem;
  text-decoration: none;
  white-space: nowrap;
}
.button:hover:not(:disabled) { background: #f2f4fb; }
.button.primary { background: var(--action); border-color: var(--action); color: #fff; }
.button.primary:hover:not(:disabled) { background: var(--action-dark); border-color: var(--action-dark); }
.button.primary:disabled { opacity: .46; }
.button.subtle-action { background: #f6f5fe; color: var(--action-dark); border-color: #ebe8fd; }
.button.danger { color: #a12637; border-color: #f0c9cf; }
.button.wide { width: 100%; }

.brand { color: #fff; text-decoration: none; display: flex; align-items: center; gap: 12px; font-size: 1rem; font-weight: 650; }
.brand-mark {
  align-items: center; justify-content: center; display: inline-flex; flex: 0 0 34px;
  height: 34px; border-radius: 9px; background: #6558ec; color: #fff; font-size: 1.15rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22);
}
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, .92fr) minmax(400px, 1fr); background: #fff; }
.login-intro {
  color: #fff; background: radial-gradient(ellipse at 100% 100%, #373278, transparent 65%), #171d35;
  display: flex; flex-direction: column; justify-content: center; position: relative;
  padding: 8vw; min-height: 620px;
}
.login-intro .brand { position: absolute; left: 8vw; top: 42px; }
.intro-copy { max-width: 450px; }
.intro-copy h1 { font-size: clamp(2.15rem, 4.1vw, 4.15rem); line-height: 1.17; letter-spacing: -.04em; }
.intro-copy p { color: #c3cae3; margin-top: 24px; line-height: 1.75; max-width: 28rem; }
.login-pane { display: grid; place-items: center; padding: clamp(1.35rem, 5vw, 4rem); }
.login-form { width: min(100%, 420px); display: grid; gap: 16px; }
.login-form h2 { font-size: 1.95rem; letter-spacing: -.035em; }
.login-form h2 + p { margin-top: -10px; font-size: .91rem; }
.role-tabs { display: grid; gap: 4px; grid-template-columns: 1fr 1fr; background: #eef0f8; padding: 4px; border-radius: 9px; margin: 4px 0; }
.role-tabs button { border: 0; border-radius: 7px; background: transparent; color: var(--muted); padding: .65rem .25rem; font-weight: 620; }
.role-tabs button[aria-pressed="true"] { color: var(--action-dark); background: #fff; box-shadow: 0 1px 5px #21305916; }
.key-button {
  display: flex; gap: 12px; align-items: center; width: 100%; text-align: left;
  border: 1px dashed #a7a0e3; border-radius: 10px; background: #f8f7ff; color: #342b83; padding: 13px;
}
.key-button:hover { border-color: var(--action); }
.key-icon { padding: .22rem .6rem; border-radius: 6px; background: #ebe7ff; font-size: 1.3rem; flex-shrink: 0; }
.key-button strong, .key-button small { display: block; overflow-wrap: anywhere; }
.key-button small { color: #5b567c; margin-top: 3px; }
.key-button.valid { border: 1px solid #9fd5bc; background: #f0faf5; color: #156747; }
.key-button.valid .key-icon { background: #dff3e9; }
label { display: grid; gap: .42rem; font-size: .9rem; font-weight: 620; }
input:not([type="checkbox"]), select, textarea {
  width: 100%; min-width: 0; border: 1px solid #ced7e7; border-radius: 8px;
  color: #1b2440; background: #fff; min-height: 43px; padding: .62rem .7rem;
}
textarea { resize: vertical; }
.feedback { font-size: .88rem; line-height: 1.55; }
.feedback:empty { display: none; }
.feedback.error { color: #ab2639; }
.feedback.success { color: #13744f; }

.console { display: grid; grid-template-columns: 225px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  min-width: 0; display: flex; flex-direction: column; gap: 26px; background: var(--rail); color: #e7e9f6;
  padding: 23px 15px 15px; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { margin-left: 6px; }
.navigation { display: grid; gap: 5px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 8px;
  background: transparent; border: 1px solid transparent; color: #bec6df; text-align: left; font-weight: 550;
}
.nav-item:hover { color: #fff; background: #ffffff0e; }
.nav-item[aria-current="page"] { color: #fff; background: #322a66; border-color: #5a4d98; }
.nav-icon { display: inline-flex; align-items: center; justify-content: center; width: 21px; color: #bbafff; }
.profile {
  margin-top: auto; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  gap: 8px; padding: 12px 6px 0; border-top: 1px solid #ffffff20; min-width: 0;
}
.profile strong, .profile small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile strong { font-size: .80rem; }
.profile small { font-size: .74rem; color: #c2c9e1; margin-top: 4px; }
.avatar { background: #372d7c; color: #e6e0ff; width: 29px; height: 29px; display: grid; place-items: center; border-radius: 7px; font-weight: 700; }
.button.sign-out { min-height: 29px; background: transparent; color: #e8ebf7; border-color: #acb7e244; font-size: .75rem; padding: 4px 6px; }
.button.sign-out:hover { background: #ffffff17; }
.topbar {
  height: 61px; padding: 0 clamp(18px, 3.5vw, 40px); display: flex; align-items: center;
  justify-content: space-between; gap: 10px; background: #fff; border-bottom: 1px solid var(--line); font-size: .89rem;
}
.separator { margin: 0 9px; color: #a0a9bd; }
.mode { display: inline-flex; align-items: center; gap: 6px; color: #4b5872; white-space: nowrap; }
.mode-dot { width: 7px; height: 7px; background: #7e6be3; border-radius: 50%; }
.view { width: min(100%, 1540px); margin: 0 auto; padding: 34px clamp(18px, 3.5vw, 40px) 42px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 24px; }
.page-heading h1 { font-size: clamp(1.65rem, 2.8vw, 2.25rem); letter-spacing: -.038em; }
.page-heading p { color: var(--muted); margin-top: 8px; line-height: 1.6; }
.page-heading .button { margin-top: 3px; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 23px; }
.metric { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.metric span { color: var(--muted); font-size: .88rem; }
.metric strong { display: block; font-size: 1.65rem; margin-top: 5px; font-variant-numeric: tabular-nums; }
.panel { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); overflow: hidden; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 17px; }
.toolbar h2 { font-size: 1.03rem; white-space: nowrap; }
.toolbar-controls { display: flex; gap: 8px; }
.toolbar input { width: min(28vw, 280px); min-width: 120px; }
.toolbar select { width: 7rem; flex: 0 0 7rem; }
.toolbar input, .toolbar select { min-height: 37px; padding-block: .45rem; font-size: .86rem; }
.project-row {
  display: grid; grid-template-columns: minmax(190px, 1.7fr) minmax(82px, .63fr) minmax(112px, .9fr) minmax(104px, .8fr) minmax(90px, .6fr);
  align-items: center; gap: 12px; padding: 14px 17px; border-top: 1px solid #edf0f6; min-height: 69px;
}
.project-columns { background: #f8f9fd; color: #586783; min-height: 41px; font-weight: 620; font-size: .83rem; }
.project-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.type-icon {
  display: inline-grid; place-items: center; background: #eeeafd; color: #483bb1; border-radius: 8px;
  width: 37px; height: 37px; flex: 0 0 37px; font-size: .76rem; font-weight: 750;
}
.type-icon.service { background: #e4f2fd; color: #166b9b; }
.project-name { font-weight: 680; color: #202b48; overflow-wrap: anywhere; }
.project-meta, .version-text { color: var(--muted); font-size: .78rem; margin-top: 3px; overflow-wrap: anywhere; }
.state { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 8px; font-size: .79rem; font-weight: 630; background: #eff1f6; color: #516078; white-space: nowrap; }
.state::before { content: ""; display: block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.state.published, .state.success { background: #e8f7ee; color: #176a48; }
.state.offline, .state.failure { background: #fcebee; color: #a23245; }
.state.managed { background: #edf0ff; color: #4034b0; }
.project-row .button { min-height: 34px; font-size: .82rem; }
.row-actions { justify-self: end; }
.row-end { text-align: right; }
.muted-inline { color: var(--muted); font-size: .82rem; }
.provider-notice { padding: 10px 13px; border-radius: 8px; border: 1px solid #ecd8a4; background: #fff8e4; color: #735114; margin-bottom: 14px; }
.access-summary { font-weight: 650; color: #3e377d; }
.frame-panel iframe { display: block; border: 0; width: 100%; min-height: 65vh; background: #fff; }
.empty { padding: 38px 20px; text-align: center; color: var(--muted); font-size: .97rem; line-height: 1.6; }
.empty.error { color: #a12637; }
.data-table { width: 100%; border-collapse: collapse; font-size: .87rem; }
.data-table th { background: #f8f9fd; color: #52617b; text-align: left; font-weight: 630; white-space: nowrap; }
.data-table th, .data-table td { border-top: 1px solid #edf0f6; padding: 12px 14px; vertical-align: top; }
.data-table td { overflow-wrap: anywhere; }
.table-scroll { overflow-x: auto; }
.account-table { min-width: 495px; }
.audit-table { min-width: 860px; }
.audit-table td:nth-child(1) { white-space: nowrap; }
.audit-table td:nth-child(5) { min-width: 180px; max-width: 320px; }
.diff-line { line-height: 1.55; white-space: pre-wrap; }
.diff-line + .diff-line { margin-top: 5px; }
.diff-before { color: #8f3846; }
.diff-after { color: #22654c; }
.take-more { text-align: center; padding: 16px; border-top: 1px solid #edf0f6; }

.dialog { padding: 0; max-height: 88vh; width: min(560px, calc(100% - 24px)); border-radius: 14px; border: 1px solid #dbe2ef; color: inherit; box-shadow: 0 20px 60px #12213c36; }
.dialog::backdrop { background: #141b3a69; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 21px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { font-size: 1.2rem; overflow-wrap: anywhere; }
.close { background: transparent; color: #4c5772; font-size: 1.45rem; line-height: 1; border-radius: 6px; border: 0; padding: 5px 8px; }
.close:hover { background: #eef0f8; }
.dialog-body { padding: 18px 21px; display: grid; gap: 13px; }
.dialog-body p { line-height: 1.6; }
.dialog-footer { display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); padding: 13px 21px; }
.dialog .feedback { margin: 0 21px 15px; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.field-pair, .child-data { display: grid; gap: 11px; grid-template-columns: 1fr 1fr; }
.details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 19px; }
.details-grid dt, .child-data dt { color: var(--muted); font-size: .83rem; margin-bottom: 4px; }
.details-grid dd, .child-data dd { font-weight: 650; overflow-wrap: anywhere; }
.native-panel + .native-panel { margin-top: 16px; }
.native-panel-body { display: grid; gap: 12px; padding: 16px 18px; }
.native-panel-body > .button { justify-self: start; }
.native-host, .native-path code { overflow-wrap: anywhere; }
.native-path { display: grid; gap: 4px; }
.native-task-table { min-width: 680px; }
.native-files { max-height: 340px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; }
.native-files :is(th, td) { padding: 8px 10px; }
.native-files td:nth-child(3) { white-space: nowrap; }
.native-files input[type="checkbox"] { width: auto; }
.native-controls, .native-pagination { align-items: center; }
.native-list { display: grid; gap: 4px; margin: 6px 0 2px; padding-inline-start: 24px; overflow-wrap: anywhere; }
.version-list { display: grid; gap: 6px; font-size: .89rem; }
.version-entry { display: flex; justify-content: space-between; gap: 12px; padding: 8px 9px; border: 1px solid #eaeef6; border-radius: 8px; }
.choice { display: flex; align-items: center; gap: .65rem; min-height: 35px; line-height: 1.5; }
.choice input { min-width: 16px; min-height: 16px; accent-color: var(--action); }
.upload-progress { width: 100%; accent-color: var(--action); }
.toast { position: fixed; bottom: 21px; right: 22px; z-index: 3; color: #fff; background: #1b3354; padding: 10px 15px; border-radius: 8px; box-shadow: 0 4px 24px #12213c33; max-width: min(420px, 90vw); }
.error-page, .child-page { max-width: 760px; margin: min(10vh, 90px) auto 0; padding: 20px; }
.error-page h1, .child-page h1 { font-size: clamp(1.55rem, 3vw, 2.2rem); margin-bottom: 12px; }
.error-page p, .child-page header p { color: var(--muted); margin-bottom: 8px; }
.child-page header { margin: 32px 0 23px; }
.child-data > div { padding: 15px; background: #fff; border-radius: 10px; border: 1px solid var(--line); }
.eyebrow { font-weight: 700; font-size: .84rem; color: var(--action-dark); }

@media (max-width: 1020px) {
  .console { grid-template-columns: 195px minmax(0, 1fr); }
  .view { padding-inline: 20px; }
  .project-row { grid-template-columns: minmax(148px, 1.35fr) minmax(80px, .62fr) minmax(95px, .75fr) minmax(86px, .65fr); gap: 8px; padding-inline: 12px; }
  .column-version { display: none; }
}
@media (max-width: 740px) {
  .login { grid-template-columns: 1fr; }
  .login-intro { min-height: 185px; padding: 22px 20px 23px; justify-content: flex-start; gap: 18px; }
  .login-intro .brand { position: static; }
  .intro-copy h1 { font-size: 1.75rem; }
  .intro-copy br { display: none; }
  .intro-copy p { margin-top: 8px; font-size: .93rem; }
  .login-pane { padding-block: 24px; }
  .login-form { gap: 13px; }
  .console { display: block; }
  .sidebar { position: static; height: auto; gap: 12px; padding: 13px 15px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .sidebar .brand { margin-left: 0; font-size: .88rem; gap: 8px; }
  .sidebar .brand-mark { height: 27px; flex-basis: 27px; }
  .profile { grid-column: 2; grid-row: 1; margin: 0; border: 0; padding: 0; grid-template-columns: minmax(0, 1fr) auto; }
  .profile .avatar { display: none; }
  .profile div { max-width: 125px; }
  .navigation { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 5px; }
  .nav-item { font-size: .83rem; padding: 6px 9px; gap: 5px; }
  .topbar { height: 47px; padding-inline: 15px; }
  .view { padding: 22px 14px; }
  .page-heading { margin-bottom: 17px; align-items: center; }
  .page-heading p { font-size: .88rem; }
  .metrics { gap: 7px; margin-bottom: 14px; }
  .metric { padding: 10px; }
  .metric span { font-size: .78rem; }
  .metric strong { font-size: 1.35rem; }
  .toolbar { padding: 12px; flex-wrap: wrap; }
  .toolbar-controls { width: 100%; }
  .toolbar input { width: 100%; }
  .project-columns { display: none; }
  .project-row { grid-template-columns: 1fr auto; min-height: 0; padding: 12px; gap: 10px 6px; }
  .project-row .column-version { display: none; }
}
@media (max-width: 360px) {
  .brand { font-size: .83rem; }
  .field-pair, .details-grid { grid-template-columns: 1fr; }
  .profile div { max-width: 95px; }
}
