:root {
  color-scheme: light;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  color: #22342e;
  background: #f1f4ef;
  font-size: 15px;
  --ink: #22342e;
  --muted: #53665e;
  --green: #245443;
  --green-dark: #183e31;
  --border: #d9e2d9;
  --surface: #fcfdf9;
  --wash: #eef3ea;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100svh; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(26px, 3.6vw, 38px); letter-spacing: -.03em; line-height: 1.2; }
h2 { font-size: 19px; line-height: 1.4; }
h3 { font-size: 16px; line-height: 1.4; }
p { line-height: 1.65; }
a { color: var(--green); text-underline-offset: 3px; }
button, .button, input, select, textarea { font: inherit; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 37px; padding: 7px 12px; border: 1px solid var(--border); border-radius: 7px;
  background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none;
}
button:hover:enabled, .button:hover { background: var(--wash); }
button:disabled { opacity: .62; cursor: default; }
button.primary, .button.primary { border-color: var(--green); background: var(--green); color: white; font-weight: 700; }
button.primary:hover:enabled, .button.primary:hover { background: var(--green-dark); }
:focus-visible { outline: 2px solid #32775b; outline-offset: 3px; }
input, select, textarea {
  width: 100%; min-width: 0; padding: 8px 9px; border: 1px solid var(--border); border-radius: 7px;
  background: #fff; color: var(--ink); min-height: 37px;
}
input[type=checkbox], input[type=range] { accent-color: var(--green); }
textarea { resize: vertical; }
label { display: grid; gap: 6px; font-size: 13px; font-weight: 650; color: #395148; }
label :is(input, select, textarea) { font-weight: 450; font-size: 14px; }
.muted { color: var(--muted); }
.notice { padding: 8px 11px; border-radius: 6px; background: #e7f0e6; color: #295143; font-size: 14px; }
.notice.error, .widget-status.error { background: #f8eae5; color: #813d32; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-size: 19px; font-weight: 750; text-decoration: none; color: var(--ink); }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; color: white; background: var(--green); border-radius: 8px; font-size: 18px; }
.wordmark { color: var(--green); font-weight: 750; }
.auth-shell { min-height: 100svh; display: grid; grid-template-rows: auto 1fr; background: #edf3ec; }
.auth-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px clamp(16px, 4vw, 42px); }
.auth-header > a:last-child { font-size: 14px; }
.auth-card {
  place-self: center; width: min(100% - 32px, 424px); margin-bottom: clamp(24px, 8vh, 64px);
  padding: 28px clamp(20px, 5vw, 38px) 34px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface);
}
.auth-card h1 { margin-bottom: 26px; text-align: center; font-size: 29px; }
.auth-card form, .account-form { display: grid; gap: 13px; }
.auth-card form label { gap: 7px; }
.auth-card form input { min-height: 46px; background: #f3f7f2; }
.auth-card form input:focus { background: #fff; }
.auth-card .password-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0; }
.auth-card .password-control input { border-radius: 7px 0 0 7px; }
.auth-card .password-control button { border-left: 0; border-radius: 0 7px 7px 0; padding-inline: 14px; }
.auth-card .password-control :focus-visible { z-index: 1; }
.auth-card form > .primary { min-height: 46px; margin-top: 6px; }
.auth-verification { display: grid; gap: 7px; }
.auth-verification > span { font-size: 13px; font-weight: 650; color: #395148; }
.auth-card .notice { margin-top: 13px; }
.password-control, .input-action { display: flex; align-items: stretch; gap: 5px; }
.password-control button, .input-action button { flex: 0 0 auto; }
.console { min-height: 100svh; display: grid; grid-template-columns: 224px minmax(0, 1fr); }
.sidebar {
  min-width: 0; position: sticky; top: 0; height: 100svh; display: flex; flex-direction: column; gap: 24px;
  padding: 22px 15px; background: #e8eee5; border-right: 1px solid var(--border);
}
.sidebar .brand { margin-left: 5px; }
.navigation { display: grid; gap: 4px; }
.navigation button, .sidebar-footer button { justify-content: flex-start; border-color: transparent; background: transparent; }
.navigation button[aria-current=page] { background: #d6e7d8; color: #204638; font-weight: 750; }
.sidebar-footer { margin-top: auto; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; font-size: 13px; }
.sidebar-footer a { padding: 7px 12px; }
.workspace { width: min(100%, 1360px); margin-inline: auto; padding: clamp(18px, 3.3vw, 44px); }
.workspace-head, .section-head, .head-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.workspace-head { margin-bottom: 22px; }
.workspace .notice { margin-bottom: 12px; }
.screen { display: grid; align-items: start; gap: 15px; }
.section-head .muted, .app-section .muted { font-size: 14px; }
.section-head a { font-size: 14px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.metric-grid > div { display: grid; gap: 6px; padding: 14px 16px; border-inline-end: 1px solid var(--border); }
.metric-grid > div:last-child { border-inline-end: 0; }
.metric-grid span { color: var(--muted); font-size: 13px; }
.metric-grid strong { font-size: 27px; font-variant-numeric: tabular-nums; }
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; white-space: nowrap; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { background: #eaf0e7; font-weight: 700; color: #3e554a; }
tr:last-child td { border-bottom: 0; }
td code { font-size: 12px; }
td .light { color: var(--muted); display: block; font-size: 12px; }
.table-wrap button { min-height: 29px; padding: 3px 8px; }
.table-wrap .table-link { padding-inline: 3px; border-color: transparent; background: transparent; color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.table-wrap .table-link:hover { background: var(--wash); }
.row-actions { display: flex; gap: 6px; }
.app-name { font-weight: 650; }
.internal-label { margin-inline-start: 6px; color: var(--muted); font-size: 12px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pagination > div, .pagination > label, .inline-filter { display: flex; align-items: center; gap: 7px; }
.pagination select { width: auto; }
.pagination [role=status] { font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.inline-filter label { white-space: nowrap; }
.inline-filter button { flex-shrink: 0; }
.active-state { color: #245443; }
.inactive-state { color: #874839; }
.credentials { display: grid; grid-template-columns: minmax(160px,.8fr) minmax(230px,1.4fr) auto; align-items: end; gap: 12px; padding: 16px; background: var(--wash); border-bottom: 1px solid var(--border); }
.credentials label { margin-bottom: 5px; }
.credentials input { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.internal-app { padding: 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.internal-app dl { display: flex; flex-wrap: wrap; gap: 14px 24px; margin-block: 14px; }
.internal-app dt { color: var(--muted); font-size: 13px; }
.internal-app dd { margin: 4px 0 0; }
.tabs { display: flex; gap: 5px; overflow-x: auto; border-bottom: 1px solid var(--border); }
.tabs button { white-space: nowrap; border-color: transparent; background: transparent; border-radius: 0; }
.tabs button[aria-current=true] { border-bottom: 2px solid var(--green); color: var(--green); font-weight: 750; }
.app-section { margin-bottom: 14px; }
.form-grid, .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid { max-width: 820px; }
.filters { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 10px; }
.app-filters { grid-template-columns: minmax(180px, 2fr) repeat(2, minmax(125px, 1fr)) auto; }
.filter-actions { display: flex; gap: 5px; align-items: end; }
.rule-list { display: grid; gap: 6px; margin: 10px 0; }
.rule-row { align-items: end; display: grid; gap: 6px; grid-template-columns: repeat(3, minmax(90px, 1fr)) auto; padding: 7px 0; border-bottom: 1px solid var(--border); }
.action-row { grid-template-columns: minmax(95px,1fr) 94px minmax(125px,1.35fr) 74px 65px auto; }
.rule-row label { font-size: 12px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill,minmax(165px,1fr)); gap: 12px; margin-top: 11px; }
.gallery figure { margin: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.gallery img { display: block; width: 100%; aspect-ratio: 300/220; object-fit: cover; }
.gallery figcaption { padding: 8px; font-size: 13px; overflow-wrap: anywhere; }
.gallery figure div { display: flex; gap: 5px; padding: 0 8px 8px; }
.gallery figure button { min-height: 28px; padding: 3px 6px; font-size: 12px; }
.upload-button:focus-within { outline: 2px solid #32775b; outline-offset: 2px; }
.preview-widget { width: min(100%, 390px); margin-top: 8px; }
#app-preview > :is(p,label) { margin-bottom: 8px; }
#preview-action { max-width: 260px; }
#preview-status { margin-top: 8px; }
.account-form { max-width: 410px; }
dialog { max-width: min(590px, calc(100vw - 20px)); width: 100%; border: 1px solid var(--border); border-radius: 12px; color: var(--ink); padding: 18px; }
dialog::backdrop { background: rgb(29 54 44 / 38%); }
dialog dl { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 5px 8px; font-size: 14px; }
dialog dd { margin: 0; overflow-wrap: anywhere; }

.event-panel { min-width: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.event-filters { padding: 16px 18px 0; }
.event-search { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) auto; gap: 10px; }
.event-advanced { margin-block: 8px; }
.event-advanced summary { width: fit-content; padding: 7px 0; color: var(--green); font-size: 13px; cursor: pointer; }
.event-advanced .filters { margin-top: 4px; margin-bottom: 12px; }
.event-outcomes { display: flex; flex-wrap: wrap; gap: 0 3px; padding-inline: 12px; border-bottom: 1px solid var(--border); }
.event-outcomes button {
  padding-inline: 9px; border: 0; border-radius: 0; border-bottom: 2px solid transparent;
  background: transparent; color: var(--muted); font-size: 13px;
}
.event-outcomes button[aria-pressed=true] { border-bottom-color: var(--green); color: var(--green); font-weight: 750; }
.event-activity { padding: 14px 18px 12px; background: #f8faf6; }
.event-activity-head { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 6px 15px; margin-bottom: 10px; }
.event-activity-head p { margin-top: 3px; font-size: 12px; font-variant-numeric: tabular-nums; }
.event-legend { display: flex; flex-wrap: wrap; gap: 4px 13px; margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: 12px; }
.event-legend li { display: inline-flex; align-items: center; gap: 6px; }
.event-legend li::before { content: ''; width: 9px; height: 9px; border-radius: 2px; background: var(--series); }
[data-series=passed] { --series: #3d8068; }
[data-series=fallback] { --series: #bd7c3d; }
[data-series=failed] { --series: #a45957; }
[data-series=other] { --series: #8ca6a0; }
.event-chart {
  display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 3px; height: 86px;
  background: repeating-linear-gradient(to top, transparent 0 calc(25% - 1px), #e1e8df calc(25% - 1px) 25%);
  border-bottom: 1px solid #c9d8cc;
}
.event-bar { display: flex; flex-direction: column-reverse; min-width: 0; }
.event-bar span { flex: none; background: var(--series); }
.event-bar span:last-child { border-radius: 2px 2px 0 0; }
.event-chart-state { grid-column: 1 / -1; place-self: center; color: var(--muted); font-size: 13px; }
.event-chart-ticks { display: flex; justify-content: space-between; margin-top: 5px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.event-pagination { padding: 9px 18px; border-block: 1px solid var(--border); }
.event-pagination :is(button, select) { min-height: 32px; padding-block: 4px; font-size: 13px; }
.event-table { overflow-x: auto; }
.event-table table { table-layout: fixed; white-space: normal; }
.event-table th { background: #f1f5ee; }
.event-table th:first-child { width: 94px; }
.event-table th:nth-child(2) { width: 136px; }
.event-table th.event-network { width: 19%; }
.event-table th.event-measure { width: 78px; }
.event-table th:last-child { width: 74px; }
.event-table :is(th, td) { padding: 9px 10px; }
.event-table td { overflow-wrap: anywhere; }
.event-table :is(th, td):first-child { padding-inline-start: 18px; }
.event-table :is(th, td):last-child { padding-inline-end: 18px; }
.event-table tbody tr:not(.event-day):hover td { background: #f4f8f2; }
.event-day th { background: #f8faf6; color: var(--muted); font-weight: 650; }
.event-table time, .event-measure { white-space: nowrap; font-variant-numeric: tabular-nums; }
.event-table .event-measure { text-align: right; }
.event-stage { display: block; font-weight: 680; }
.event-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 5px; margin-top: 2px; color: var(--muted); font-size: 12px; }
.event-meta button {
  display: inline; max-width: 100%; min-height: 24px; padding: 0; border: 0; background: transparent;
  color: var(--green); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere;
}
.event-table .event-open { padding-inline: 8px; min-height: 32px; white-space: nowrap; }
.event-tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 6px; border-radius: 5px;
  white-space: nowrap; font-size: 12px; font-weight: 650; color: #465b58; background: #eef2ef;
}
.event-tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.event-tag[data-outcome=passed] { color: #225941; background: #e4f1e8; }
.event-tag:is([data-outcome=fallback], [data-outcome=limited]) { color: #75501d; background: #f5ecda; }
.event-tag:is([data-outcome=failed], [data-outcome=rejected], [data-outcome=blocked]) { color: #843c37; background: #f7e8e4; }
.event-table .light { overflow-wrap: anywhere; }
.event-table td[colspan] { padding-block: 24px; color: var(--muted); }
.event-drawer {
  inset: 0 0 0 auto; margin: 0; max-width: min(100%, 464px); min-height: 100%; max-height: 100%; padding: 0;
  border: 0; border-inline-start: 1px solid var(--border); border-radius: 0; background: var(--surface);
}
.event-drawer-head {
  position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 18px; border-bottom: 1px solid var(--border); background: var(--surface);
}
.event-drawer-head h2 { font-size: 23px; }
.event-drawer-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding: 14px 18px; background: #f0f5ed; }
.event-drawer-summary strong { font-size: 17px; }
.event-details { display: grid; gap: 19px; padding: 18px; }
.event-details section + section { padding-top: 14px; border-top: 1px solid var(--border); }
.event-details h3 { margin-bottom: 8px; }
.event-details dl { grid-template-columns: minmax(90px, auto) minmax(0, 1fr); gap: 8px 14px; margin: 0; }
.event-details dt { color: var(--muted); }
.event-details dd { font-variant-numeric: tabular-nums; }

.public-header { max-width: 1050px; margin: auto; padding: 18px clamp(14px, 3vw, 30px); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.public-header nav { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.landing { width: min(100% - 32px, 560px); margin: clamp(16px, 9vh, 76px) auto; padding: clamp(16px, 5vw, 36px); border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.landing h1 { margin-bottom: 8px; }
.landing #demo-choice { max-width: 260px; }
.landing .demo-widget { margin-top: 16px; }
.landing .notice { margin-top: 12px; }
.docs { width: min(100% - 32px, 890px); margin: 18px auto 45px; }
.docs h1 { margin-bottom: 10px; }
.docs h2 { margin: 30px 0 8px; }
.docs h3 { margin: 14px 0 5px; }
.docs p, .docs li { line-height: 1.7; }
.docs pre { overflow: auto; margin: 10px 0; padding: 13px; border-radius: 8px; color: #eaf3e8; background: #1e382d; font-size: 13px; line-height: 1.6; }
.docs nav { margin-top: 14px; display: flex; gap: 12px; flex-wrap: wrap; font-size: 14px; }
.docs .table-wrap { margin: 9px 0; }
.docs td { white-space: normal; }

.embed-body { min-height: 0; background: transparent; }
.widget-surface { display: flow-root; width: 100%; }
.widget-surface cap-widget {
  display: block;
  --cap-widget-width: 100%;
  --cap-border-radius: 8px;
  --cap-border-color: #a9bdb0;
  --cap-color: #22342e;
}
.widget-panel { padding: 6px 3px; }
.widget-panel > h2 { padding: 0 3px; margin-bottom: 5px; font-size: 15px; }
.slider-slot { width: fit-content; margin-inline: auto; }
.widget-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 7px; }
.widget-actions button, #keyboard-controls button { min-height: 30px; padding: 4px 7px; font-size: 13px; }
#keyboard-controls { margin: 5px 4px; font-size: 13px; }
#keyboard-controls input { padding: 0; }
.widget-status { padding: 5px 7px; font-size: 13px; margin: 3px 0; border-radius: 6px; color: var(--muted); }
.widget-status.success { color: var(--green); background: var(--wash); }
.hosted-body { min-height: 100svh; display: grid; place-items: center; padding: 4px; background: #e8efe6; }
.hosted-body .widget-surface { width: min(100%, 420px); border: 1px solid var(--border); border-radius: 13px; background: var(--surface); padding: clamp(0px, calc(13vw - 41px), 22px); }
#hosted-title { padding: 10px 7px; }
#hosted-title h1 { margin: 4px 0; }
#hosted-start { margin: 8px 7px 10px; }

@media (max-width: 850px) {
  .console { grid-template-columns: 180px minmax(0, 1fr); }
  .credentials { grid-template-columns: minmax(0, 1fr); }
  .credentials > button { justify-self: start; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .action-row { grid-template-columns: repeat(3, minmax(68px, 1fr)); }
  .event-table :is(th, td).event-measure { width: 0; padding: 0; overflow: hidden; visibility: hidden; }
}
@media (max-width: 600px) {
  .console { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; gap: 8px; padding: 10px; border-right: 0; border-bottom: 1px solid var(--border); }
  .navigation { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .navigation button { justify-content: center; padding-inline: 2px; font-size: 13px; }
  .sidebar-footer { flex-direction: row; justify-content: space-between; }
  .workspace { padding: 12px; }
  .overview-head { flex-wrap: wrap; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .metric-grid > div:nth-child(2) { border-inline-end: 0; }
  .metric-grid > div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .form-grid { gap: 8px; }
  .rule-row { grid-template-columns: repeat(2, minmax(85px, 1fr)); }
  .public-header nav { gap: 6px; }
  .event-search { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .event-search .filter-actions { grid-column: 1 / -1; }
  .event-filters, .event-activity, .event-pagination { padding-inline: 10px; }
  .event-chart { height: 62px; }
  .event-pagination, .event-pagination > div { gap: 5px; }
  .event-pagination button { padding-inline: 7px; }
  .event-outcomes { padding-inline: 6px; }
  .event-table th:first-child { width: 65px; }
  .event-table th:nth-child(2) { width: 84px; }
  .event-table th:last-child { width: 54px; }
  .event-table :is(th, td), .event-table :is(th, td):first-child, .event-table :is(th, td):last-child { padding-inline: 6px; }
  .event-table :is(th, td).event-network { width: 0; padding: 0; overflow: hidden; visibility: hidden; white-space: nowrap; }
}
@media (max-width: 400px) {
  .event-date-filter { grid-column: 1 / -1; }
  .event-chart { gap: 2px; }
}
@media (max-width: 390px) {
  .landing .demo-widget { margin-inline: min(0px, calc((100% - 314px) / 2)); }
  #login-captcha { margin-inline: min(0px, calc((100% - 314px) / 2)); }
}
