:root {
  color-scheme: light;
  font-family: "Noto Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 14px;
  color: #202A35;
  background: #F4F7FA;
  letter-spacing: 0;
  --surface: #F4F7FA;
  --white: #FFFFFF;
  --ink: #202A35;
  --blue: #2459E0;
  --teal: #147D83;
  --danger: #D65A45;
  --line: #DFE5EB;
  --muted: #5B6877;
  --sans: "Noto Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --data: Consolas, "Noto Sans SC", "Microsoft YaHei", monospace;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
::selection { background: #DDE7FD; color: var(--ink); }
button, input, select { font: inherit; letter-spacing: 0; }
button, a, input, select { touch-action: manipulation; }
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--white);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.4;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}
button:hover { background: var(--surface); border-color: #AAB7C6; }
button:active { background: #E7ECF2; }
button:disabled { cursor: not-allowed; opacity: .5; }
.primary { background: var(--blue); border-color: var(--blue); color: var(--white); font-weight: 600; }
.primary:hover { background: #1E4CBD; border-color: #1E4CBD; }
.primary:active { background: #1941A4; }
.danger { color: #AD402F; }
.danger:hover { border-color: var(--danger); background: #FCEFEA; }
.icon { width: 40px; height: 40px; padding: 10px; flex: 0 0 40px; }
.icon svg, button svg, a svg { width: 18px; height: 18px; flex-shrink: 0; stroke-width: 1.75px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, .trend:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
a { color: var(--blue); text-decoration: none; text-underline-offset: 4px; }
a:hover { text-decoration: underline; }
input, select {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid #B9C5D2;
  border-radius: 4px;
  background: var(--white);
  color: var(--ink);
  caret-color: var(--blue);
}
input:hover, select:hover { border-color: #899BAE; }
input::placeholder { color: var(--muted); opacity: 1; }
input[readonly] { background: var(--surface); }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: var(--blue); flex-shrink: 0; }
label { display: grid; gap: 8px; min-width: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
h1, h2, h3 { margin: 0; color: var(--ink); font-weight: 600; text-wrap: balance; overflow-wrap: anywhere; }
h1 { font-size: 26px; line-height: 1.35; }
h2 { font-size: 17px; line-height: 1.5; }
h3 { font-size: 15px; line-height: 1.5; }
p { line-height: 1.6; text-wrap: pretty; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.loading { padding: 40px; color: var(--muted); }
.brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; color: var(--ink); font-size: 21px; font-weight: 700; white-space: nowrap; }
.brand:hover { color: var(--ink); text-decoration: none; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex: 0 0 36px; border-radius: 6px; background: var(--blue); color: var(--white); }
.brand-mark svg { width: 22px; height: 22px; stroke-width: 1.75px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 64px; padding: 12px 24px; border-bottom: 1px solid var(--line); background: var(--white); }
.topbar-brand { display: flex; align-items: center; gap: 25px; min-width: 0; }
.workspace-label { padding-left: 24px; border-left: 1px solid var(--line); color: var(--muted); font-size: 13px; white-space: nowrap; }
.topbar .actions { flex-wrap: nowrap; gap: 8px; }
.actions, .toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
.toolbar { justify-content: space-between; margin: 22px 0 14px; gap: 14px; }
.identity { min-width: 0; max-width: 280px; margin-right: 10px; font-size: 13px; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
.layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); min-height: calc(100vh - 65px); background: var(--white); }
.sidebar { display: flex; flex-direction: column; gap: 12px; padding: 26px 12px 18px; border-right: 1px solid var(--line); background: var(--white); min-width: 0; }
.sidebar .section { padding: 0 12px 4px; font-size: 12px; color: var(--muted); }
.workspace-nav { display: grid; gap: 5px; }
.sidebar button { width: 100%; min-height: 42px; justify-content: flex-start; padding: 10px 12px; border: 1px solid transparent; background: transparent; font-size: 13px; }
.sidebar button:hover { background: var(--surface); }
.sidebar button.active { border-color: #D9E4FD; background: #EEF3FE; color: var(--blue); font-weight: 600; }
.sidebar button.active svg { stroke-width: 2px; }
.company-field { padding: 18px 10px 0; border-top: 1px solid var(--line); margin-top: 6px; }
.company-field label { color: var(--muted); }
.company-field select { font-size: 13px; }
.sidebar-home { display: flex; align-items: center; gap: 9px; min-height: 40px; margin-top: auto; padding: 10px 12px; color: var(--muted); font-size: 13px; }
.sidebar-home:hover { color: var(--blue); }
.main { min-width: 0; padding: 30px 36px 48px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 20px; min-width: 0; }
.page-head > div { min-width: 0; }
.page-head p { margin: 7px 0 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.page-head .actions { justify-content: flex-end; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 26px 0; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.metric { min-width: 0; padding: 0 24px; border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric span { color: var(--muted); font-family: var(--sans); font-size: 12px; line-height: 1.5; }
.metric strong { display: block; margin-top: 8px; font-family: var(--data); font-size: 30px; line-height: 1.15; font-weight: 400; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric:nth-child(2) strong { color: var(--teal); }
.metric.warning strong { color: #AD402F; }
.band { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.table-wrap { width: 100%; min-width: 0; overflow: auto; background: var(--white); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); scrollbar-color: #B9C5D2 var(--surface); scrollbar-width: thin; }
.table-wrap:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
#filter-form + .table-wrap table { min-width: 1040px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
th { background: var(--surface); color: var(--muted); font-weight: 600; white-space: nowrap; }
th, td { padding: 12px 14px; border-bottom: 1px solid #E7ECF2; line-height: 1.6; vertical-align: middle; }
td { font-family: var(--data); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #F8FAFC; }
td .actions { gap: 6px; flex-wrap: nowrap; }
td .muted, td .pill { font-family: var(--sans); }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 3px; background: #E8F4F3; color: #116A70; font-size: 12px; line-height: 1.6; white-space: nowrap; }
.pill.off, .pill.shared { color: #A23C2D; background: #FCEFEA; }
.pill.admin { color: #214BB1; background: #EEF3FE; }
.empty { padding: 40px 18px; text-align: left; color: var(--muted); font-family: var(--sans); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.full { grid-column: 1 / -1; }
.form-footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; min-width: 0; }
.filters label { width: 176px; }
.retention { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.retention select { width: 94px; }
.key-box { margin: 18px 0; padding: 16px; border: 1px solid #BDDCDE; border-radius: 4px; background: #E8F4F3; font-family: var(--data); overflow-wrap: anywhere; user-select: all; }
.auth-shell { min-height: 100vh; background: var(--white); }
.auth-topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 88px; padding: 22px 48px; border-bottom: 1px solid var(--line); }
.auth-topbar .brand { font-size: 25px; }
.home-link { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.home-link:hover { color: var(--blue); }
.auth-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px); align-items: start; gap: 88px; max-width: 1080px; margin: 0 auto; padding: 88px 48px 64px; }
.auth-heading { min-width: 0; padding-top: 5px; }
.auth-heading h1 { max-width: 430px; font-size: 32px; line-height: 1.35; font-weight: 600; }
.auth-context { display: flex; align-items: center; gap: 9px; margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.auth-context svg { width: 19px; height: 19px; flex-shrink: 0; color: var(--teal); stroke-width: 1.75px; }
.login { max-width: 440px; min-width: 0; margin: 8vh auto; padding: 32px; }
.auth-login { width: 100%; margin: 0; padding: 5px 0 0; }
.login h1 { margin-bottom: 26px; }
.login form { display: grid; gap: 20px; }
.login label { color: var(--ink); font-size: 14px; }
.login input { min-height: 46px; padding: 11px 12px; }
.login .primary { width: 100%; min-height: 46px; margin-top: 2px; }
.login-footer { display: flex; justify-content: flex-start; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 13px; }
.login-footer a { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; }
.form-error { min-height: 18px; color: #AD402F; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.form-error:empty { display: none; }
.check { display: flex; align-items: center; gap: 9px; min-height: 32px; }
.login-context { margin-bottom: 20px; color: var(--muted); font-size: 13px; }
.report-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 28px; }
.report-grid section { min-width: 0; }
.report-grid .toolbar { margin-top: 0; min-height: 32px; }
.report-grid .table-wrap { max-height: 440px; }
.trend { display: grid; grid-template-columns: repeat(15, minmax(54px, 1fr)); align-items: end; gap: 10px; height: 180px; margin: 20px 0 0; padding: 8px 0 29px; overflow-x: auto; overflow-y: hidden; border-bottom: 1px solid var(--line); scrollbar-color: #B9C5D2 var(--surface); scrollbar-width: thin; }
.trend-item { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-width: 0; height: 100%; }
.trend-item b { padding-bottom: 6px; color: var(--muted); font-family: var(--data); font-size: 12px; font-weight: 400; }
.trend-item .bar { width: 70%; max-width: 42px; min-height: 2px; border-radius: 2px 2px 0 0; background: var(--teal); }
.trend-item small { position: absolute; bottom: -23px; color: var(--muted); font-family: var(--data); font-size: 11px; white-space: nowrap; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; color: var(--muted); font-family: var(--data); font-size: 12px; }
#notice { display: none; position: fixed; right: 24px; bottom: 22px; z-index: 10; max-width: 460px; padding: 13px 18px; border-radius: 5px; background: var(--teal); color: var(--white); line-height: 1.5; overflow-wrap: anywhere; pointer-events: none; box-shadow: 0 6px 24px rgba(32, 42, 53, .14); }
#notice.error { background: #AD402F; }
dialog { width: 540px; max-width: calc(100vw - 24px); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); padding: 26px; overflow: auto; overscroll-behavior: contain; scroll-padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--ink); box-shadow: 0 18px 64px rgba(32, 42, 53, .18); }
dialog::backdrop { background: rgba(32, 42, 53, .28); }
dialog h2 { margin-bottom: 24px; font-size: 20px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.modal-head h2 { margin-top: 6px; }
.release-form { display: grid; grid-template-columns: 156px 200px minmax(180px, 1fr) auto; align-items: end; gap: 14px; padding: 24px 0; }
.release-form input[type=file] { padding: 7px; font-size: 12px; }
input[type=file]::file-selector-button { margin-right: 9px; padding: 3px 8px; border: 0; border-radius: 2px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.hash { color: var(--muted); font-family: var(--data); font-size: 12px; }
.detail-title { max-width: 700px; overflow-wrap: anywhere; }
.audit-detail { max-width: 380px; font-family: var(--data); font-size: 12px; overflow-wrap: anywhere; }
.account-name strong { display: block; font-weight: 600; }
.account-name span { color: var(--muted); font-family: var(--sans); font-size: 12px; }
.account-departure-action { display: inline-flex; margin-left: 2px; padding-left: 8px; border-left: 1px solid var(--line); }
.departure-content { font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.departure-target { margin-top: 0; }
.departure-effects { margin: 14px 0; padding-left: 20px; }
.departure-effects li + li { margin-top: 5px; }
.departure-summary { margin: 16px 0; padding: 10px 0; border-block: 1px solid var(--line); }
.departure-summary > div { display: flex; justify-content: space-between; gap: 16px; padding: 3px 0; }
.departure-summary dt { color: var(--muted); }
.departure-summary dd { margin: 0; font-family: var(--data); font-variant-numeric: tabular-nums; }
.departure-consent { align-items: flex-start; margin-top: 16px; }
.departure-consent input { margin-top: 2px; }
.departure-content .form-error ul { padding-left: 20px; }

@media (min-width: 1600px) {
  .main { padding-right: 48px; padding-left: 48px; }
  .metrics { margin-top: 30px; margin-bottom: 30px; }
}
@media (max-width: 1100px) {
  .topbar { gap: 16px; padding-right: 20px; padding-left: 20px; }
  .workspace-label { display: none; }
  .layout { grid-template-columns: 184px minmax(0, 1fr); }
  .main { padding: 26px 24px 40px; }
  .metric { padding: 0 16px; }
  .report-grid { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .release-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .release-form > button { justify-self: start; }
  .auth-main { gap: 48px; padding-top: 72px; }
}
@media (max-width: 760px) {
  .topbar { gap: 12px; padding: 12px 16px; }
  .topbar .brand { gap: 8px; font-size: 18px; }
  .brand-mark { width: 32px; height: 32px; flex-basis: 32px; }
  .brand-mark svg { width: 20px; height: 20px; }
  .identity { display: none; }
  .topbar .actions { gap: 8px; }
  .topbar .actions button { width: 44px; height: 44px; min-height: 44px; padding: 11px; flex: 0 0 44px; }
  .topbar .actions button .label { display: none; }
  .layout { display: block; }
  .sidebar { display: grid; gap: 0; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar .section, .sidebar-home { display: none; }
  .workspace-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .workspace-nav.customer-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar button { min-width: 0; min-height: 44px; padding: 8px 5px; justify-content: center; gap: 5px; font-size: 12px; }
  .sidebar button svg { width: 16px; height: 16px; }
  .company-field { margin: 8px 0 0; padding: 8px 0 0; }
  .company-field label { grid-template-columns: 36px minmax(0, 1fr); align-items: center; }
  .main { padding: 24px 16px 36px; }
  .page-head { flex-wrap: wrap; gap: 16px; }
  .page-head .actions { justify-content: flex-start; }
  h1 { font-size: 24px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0; margin: 22px 0; }
  .metric { padding: 16px; }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .metric strong { font-size: 28px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .full { grid-column: auto; }
  .release-form { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .filters { width: 100%; gap: 12px; }
  .filters label { width: calc(50% - 6px); }
  .trend { gap: 6px; }
  .toolbar { gap: 12px; }
  th, td { padding: 11px 12px; }
  .table-wrap table { min-width: 600px; }
  .report-grid table { min-width: 380px; }
  .report-grid section:last-child table { min-width: 320px; }
  .retention { width: 100%; }
  button { min-height: 44px; }
  .icon { width: 44px; height: 44px; flex-basis: 44px; }
  input, select { min-height: 44px; }
  .auth-topbar { min-height: 76px; padding: 18px 24px; }
  .auth-topbar .brand { font-size: 21px; }
  .auth-main { grid-template-columns: minmax(0, 1fr); gap: 30px; max-width: 480px; padding: 40px 24px 48px; }
  .auth-heading h1 { font-size: 28px; }
  .auth-context { margin-top: 15px; padding-top: 15px; font-size: 13px; }
  .auth-login { max-width: none; }
  .login { padding: 26px 20px; margin-top: 5vh; }
  .auth-login { padding: 0; margin: 0; }
  dialog { padding: 20px; }
  #notice { right: 14px; bottom: 14px; left: 14px; max-width: none; }
}
@media (max-width: 380px) {
  .topbar { gap: 8px; padding: 10px 12px; }
  .topbar .brand { gap: 5px; font-size: 17px; }
  .brand-mark { width: 30px; height: 30px; flex-basis: 30px; }
  .brand-mark svg { width: 19px; height: 19px; }
  .main { padding-right: 12px; padding-left: 12px; }
  .sidebar { padding-right: 8px; padding-left: 8px; }
  .sidebar button { flex-direction: column; gap: 4px; padding: 7px 3px; min-height: 58px; }
  .metric { padding: 14px 12px; }
  .filters label { width: 100%; }
  .auth-topbar { gap: 12px; padding-right: 18px; padding-left: 18px; }
  .auth-topbar .brand { gap: 7px; font-size: 20px; }
  .home-link { gap: 5px; font-size: 12px; }
  .auth-main { padding-right: 20px; padding-left: 20px; }
  .auth-heading h1 { font-size: 28px; }
  .form-footer { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  button { transition: none; }
}
