:root {
  --ink: #192743;
  --muted: #526078;
  --accent: #bb390c;
  --action: #ff7848;
  --action-hover: #ff925f;
  --action-pressed: #ec693c;
  --action-ink: #231e2b;
  --ground: #faf7f0;
  --surface: #fff;
  --topbar: #fffdf8;
  --subtle: #fdf0dc;
  --line: #dbe0e8;
  --control-line: #768194;
  --nav: #17243e;
  --nav-text: #fff9ea;
  --nav-muted: #d1dbef;
  --nav-hover: #2e405f;
  --selected: #ffda57;
  --good: #253f96;
  --good-surface: #eaf0ff;
  --bad: #a62944;
  --bad-surface: #fae3e5;
  --bad-hover: #f6cfd5;
  --warn: #75501d;
  --warn-surface: #fff4dc;
  --focus: #254ee9;
  --focus-inverse: #b6c5ff;
  --table: #f4f5fb;
  --radius: 12px;
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  font-synthesis: none;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--ground);
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
a {
  color: var(--accent);
  text-underline-offset: 4px;
}
button:disabled {
  cursor: wait;
  opacity: 0.6;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
::selection {
  background: var(--selected);
  color: var(--ink);
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 1.75rem;
  line-height: 1.3;
  letter-spacing: -0.025em;
}
h2 {
  font-size: 1.2rem;
}
h3 {
  font-size: 1.05rem;
}
small,
.muted {
  color: var(--muted);
}
small {
  font-size: 0.8125rem;
}
button,
.button {
  border: 0;
  border-radius: 8px;
  min-height: 44px;
  padding: 10px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--action);
  color: var(--action-ink);
  text-decoration: none;
  font-weight: 600;
  transition:
    background 0.16s ease,
    opacity 0.16s ease;
}
button:hover:enabled,
.button:hover {
  background: var(--action-hover);
}
button:active:enabled,
.button:active {
  background: var(--action-pressed);
}
button.secondary,
.button.secondary {
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--control-line);
}
button.secondary:hover:enabled,
.button.secondary:hover {
  background: var(--subtle);
}
button.ghost {
  background: transparent;
  color: var(--good);
}
button.ghost:hover:enabled {
  background: var(--good-surface);
}
button.danger {
  background: var(--bad-surface);
  color: var(--bad);
}
button.danger:hover:enabled {
  background: var(--bad-hover);
}
.compact {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.875rem;
}
.wide {
  width: 100%;
}
.skip {
  position: fixed;
  top: -80px;
  left: 20px;
  z-index: 9;
  padding: 10px;
  background: white;
}
.skip:focus {
  top: 16px;
}
.loading {
  padding: 12vh 8vw;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}
.brand img {
  width: 38px;
  height: 38px;
  flex: none;
  transform: rotate(-5deg);
}
.brand strong {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
#app:has(> .entry) {
  display: grid;
  align-items: center;
  min-height: 100vh;
}
.entry {
  width: min(930px, calc(100% - 64px));
  margin: 32px auto;
  display: grid;
  grid-template-columns: minmax(0, 44fr) minmax(0, 56fr);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.entry-side {
  background: var(--nav);
  color: var(--nav-text);
  padding: 38px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  min-height: 490px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.entry-side::after {
  content: "";
  position: absolute;
  inset: auto -5% -10px;
  height: 20px;
  background: var(--selected);
  transform: rotate(-4deg);
  pointer-events: none;
}
.entry-side .brand {
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  position: relative;
}
.entry-side .brand::before {
  content: "";
  position: absolute;
  inset: 16px auto auto 30px;
  width: 108px;
  height: 108px;
  background: var(--selected);
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
}
.entry-side .brand img {
  width: 112px;
  height: 112px;
  transform: rotate(-9deg);
}
.entry-side .brand strong {
  font-size: 2rem;
  line-height: 1.2;
}
.entry-side h1 {
  font-size: 1.9rem;
  line-height: 1.3;
  margin-bottom: 12px;
}
.entry-side p,
.entry-side footer {
  color: var(--nav-muted);
}
.entry-side p {
  max-width: 30ch;
}
.entry-side footer {
  font-size: 0.8125rem;
}
.sidebar :focus-visible,
.entry-side :focus-visible {
  outline-color: var(--focus-inverse);
}
.entry-body {
  display: grid;
  align-content: center;
  padding: 48px clamp(26px, 5vw, 68px);
  background: var(--surface);
}
.entry-form {
  width: min(100%, 400px);
}
.entry-form h2 {
  font-size: 1.7rem;
  margin-bottom: 8px;
}
.entry-form > p:not(.form-note) {
  color: var(--muted);
  margin-bottom: 24px;
}
.entry-tabs {
  display: flex;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}
.entry-tabs a {
  color: var(--muted);
  padding: 10px 0;
  text-decoration: none;
  min-height: 44px;
}
.entry-tabs a[aria-current] {
  color: var(--accent);
  font-weight: 700;
  border-bottom: 2px solid var(--accent);
}
label {
  font-weight: 600;
  font-size: 0.875rem;
  display: block;
  margin-bottom: 7px;
}
input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--control-line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface);
  color: var(--ink);
  caret-color: var(--accent);
}
textarea {
  min-height: 88px;
  resize: vertical;
}
input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  accent-color: var(--accent);
}
.field {
  margin: 0 0 20px;
}
.field small {
  display: block;
  margin-top: 6px;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.inline-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}
.form-error {
  background: var(--bad-surface);
  color: var(--bad);
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 18px;
  overflow-wrap: anywhere;
}
.form-success {
  color: var(--good);
  background: var(--good-surface);
  padding: 14px;
  border-radius: 8px;
  margin-bottom: 18px;
}
.form-note {
  margin-top: 20px;
  color: var(--muted);
  font-size: 0.875rem;
}
.login-preference {
  margin: 16px 0 22px;
}
.login-preference .inline-label {
  margin-bottom: 4px;
}
.login-preference small {
  display: block;
  margin-inline-start: 28px;
  line-height: 1.55;
}
.client-download {
  display: grid;
  justify-items: start;
  gap: 10px;
}
.client-download strong, .client-download li {
  overflow-wrap: anywhere;
}
.client-download summary {
  cursor: pointer;
}
.shell {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 30px 18px;
  background: var(--nav);
  color: var(--nav-text);
  display: flex;
  flex-direction: column;
}
.sidebar .brand {
  padding: 0 8px 30px;
}
.portal-label {
  margin: 0 12px 12px;
  font-size: 0.8125rem;
  color: var(--nav-muted);
}
.sidebar nav {
  display: grid;
  gap: 6px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 46px;
  padding: 10px 14px;
  color: var(--nav-muted);
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.9375rem;
}
.nav-link:hover {
  background: var(--nav-hover);
  color: var(--nav-text);
}
.nav-link[aria-current] {
  background: var(--selected);
  color: var(--ink);
  font-weight: 700;
}
.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sidebar-bottom {
  margin-top: auto;
  padding: 22px 8px 0;
  color: var(--nav-muted);
  font-size: 0.8125rem;
}
.workspace {
  min-width: 0;
}
.topbar {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 40px;
  background: var(--topbar);
  border-bottom: 1px solid var(--line);
}
.topbar small {
  display: block;
}
.topbar .identity {
  display: flex;
  align-items: center;
  gap: 16px;
}
.avatar {
  width: 38px;
  height: 38px;
  background: var(--good-surface);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--good);
  font-weight: 700;
}
.main-content {
  padding: 34px 40px 56px;
  max-width: 1480px;
  margin: auto;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 26px;
}
.page-heading p {
  color: var(--muted);
  margin-top: 8px;
  font-size: 0.9375rem;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}
.panel-head {
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.panel-body {
  padding: 24px;
}
.toolbar {
  display: flex;
  gap: 12px;
  padding: 18px 24px;
  align-items: center;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
}
.toolbar input {
  max-width: 340px;
}
.toolbar select {
  width: 150px;
}
.table-wrap {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.875rem;
  text-align: left;
  font-variant-numeric: tabular-nums;
}
th {
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
  background: var(--table);
}
th,
td {
  padding: 15px 22px;
  border-bottom: 1px solid var(--line);
}
tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: var(--topbar);
}
td small {
  display: block;
}
td .row-actions {
  display: flex;
  gap: 4px;
}
.table-main {
  font-weight: 600;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 5px;
  padding: 3px 8px;
  background: var(--table);
  color: var(--muted);
  font-size: 0.75rem;
  white-space: nowrap;
  font-weight: 600;
}
.badge.good {
  background: var(--good-surface);
  color: var(--good);
}
.badge.bad {
  background: var(--bad-surface);
  color: var(--bad);
}
.badge.warn {
  background: var(--warn-surface);
  color: var(--warn);
}
.empty {
  padding: 54px 28px;
  text-align: center;
  color: var(--muted);
}
.empty h3 {
  color: var(--ink);
  margin-bottom: 8px;
}
.empty button {
  margin-top: 20px;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  color: var(--muted);
  font-size: 0.875rem;
}
.pagination div {
  display: flex;
  gap: 8px;
}
.summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  padding: 22px 0;
  margin-bottom: 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.summary-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-right: 24px;
}
.summary-item strong {
  font-size: 1.65rem;
  font-variant-numeric: tabular-nums;
}
.summary-item span {
  color: var(--muted);
  font-size: 0.875rem;
}
.notice {
  background: var(--warn-surface);
  color: var(--warn);
  padding: 16px 20px;
  border-radius: 8px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 24px;
}
.details {
  margin: 0;
}
.details > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.details > div:last-child {
  border-bottom: 0;
}
.details dt {
  color: var(--muted);
  font-size: 0.875rem;
}
.details dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
  overflow-wrap: anywhere;
}
.feature-list {
  list-style: none;
  padding: 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.plan-banner {
  background: var(--good-surface);
  padding: 28px;
  color: var(--ink);
  border-radius: 12px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.plan-banner h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}
.plan-banner p {
  color: var(--muted);
}
.security-row {
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}
.security-row:last-child {
  border-bottom: 0;
}
.security-row p {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 6px;
  max-width: 65ch;
}
.section-form {
  max-width: 600px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  text-decoration: none;
  font-size: 0.875rem;
}
dialog {
  border: 0;
  padding: 0;
  border-radius: 14px;
  width: min(540px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  color: var(--ink);
  box-shadow: 0 16px 48px rgb(25 39 67 / 22%);
}
dialog::backdrop {
  background: rgb(23 36 62 / 52%);
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}
.dialog-body {
  padding: 24px;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}
.secret {
  font-family: Consolas, monospace;
  word-break: break-all;
  display: block;
  background: var(--good-surface);
  padding: 16px;
  border-radius: 8px;
  font-size: 0.95rem;
  margin: 16px 0;
  user-select: all;
}
.codes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  list-style: none;
  padding: 0;
  font-family: Consolas, monospace;
  font-size: 0.875rem;
  user-select: all;
}
.codes li {
  padding: 8px;
  background: var(--table);
  border-radius: 6px;
}
.qr {
  display: block;
  width: 200px;
  height: 200px;
  margin: 18px auto;
}
.device-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.device-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.device-list li:last-child {
  border: 0;
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 20px);
  z-index: 20;
  background: var(--nav);
  color: var(--nav-text);
  padding: 12px 20px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  max-width: calc(100vw - 40px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
[hidden] {
  display: none !important;
}
.mobile-nav {
  display: none;
}
.skeleton {
  height: 180px;
  background: var(--table);
  border-radius: 12px;
}
.field-hint {
  margin-top: 12px;
  font-size: 0.8125rem;
  color: var(--muted);
}
.break {
  overflow-wrap: anywhere;
}
.stack {
  display: grid;
  gap: 18px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
@media (max-width: 1000px) {
  .shell {
    grid-template-columns: 190px 1fr;
  }
  .sidebar {
    padding: 26px 12px;
  }
  .main-content {
    padding: 28px 24px;
  }
  .topbar {
    padding: 0 24px;
  }
  .content-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 700px) {
  .entry {
    width: min(440px, calc(100% - 32px));
    grid-template-columns: minmax(0, 1fr);
    margin-block: 16px;
  }
  .entry-side {
    min-height: 0;
    padding: 18px 20px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .entry-side::after,
  .entry-side .brand::before,
  .entry-side > div:not(:first-child),
  .entry-side footer {
    display: none;
  }
  .entry-side .brand {
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }
  .entry-side .brand img {
    width: 35px;
    height: 35px;
  }
  .entry-side .brand strong {
    font-size: 1.375rem;
  }
  .entry-body {
    padding: 28px 20px;
  }
  .shell {
    display: block;
  }
  .sidebar {
    position: static;
    height: auto;
    padding: 18px 20px;
  }
  .sidebar .brand {
    padding: 0;
  }
  .portal-label,
  .sidebar-bottom {
    display: none;
  }
  .sidebar nav {
    display: flex;
    overflow: auto;
    margin-top: 18px;
    gap: 8px;
  }
  .nav-link {
    white-space: nowrap;
    padding: 8px 12px;
    min-height: 44px;
  }
  .nav-link .icon {
    display: none;
  }
  .topbar {
    height: 68px;
    padding: 0 20px;
  }
  .main-content {
    padding: 24px 18px;
  }
  .page-heading {
    gap: 16px;
    flex-wrap: wrap;
  }
  .page-heading h1 {
    font-size: 1.5rem;
  }
  .panel-head,
  .panel-body,
  .security-row {
    padding: 20px;
  }
  .toolbar {
    padding: 16px;
    gap: 10px;
  }
  .toolbar input {
    max-width: none;
    flex: 1;
    min-width: 150px;
  }
  .toolbar select {
    width: 110px;
  }
  th,
  td {
    padding: 12px 16px;
  }
  .field-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .summary-strip {
    gap: 12px;
  }
  .summary-item {
    margin: 0;
    flex: 1 1 40%;
    gap: 8px;
  }
  .summary-item strong {
    font-size: 1.4rem;
  }
  .plan-banner {
    align-items: flex-start;
    flex-direction: column;
    padding: 22px;
  }
  .identity .avatar {
    display: none;
  }
  .codes {
    grid-template-columns: 1fr;
  }
  .security-row {
    flex-wrap: wrap;
  }
  .notice {
    align-items: flex-start;
    flex-direction: column;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

.inverse-link {
  color: inherit;
}
.block {
  display: block;
}
fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 0 0 20px;
}
legend {
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0 5px;
}

.topbar > div:first-child {
  min-width: 0;
  flex: 1;
}
.topbar .identity {
  min-width: 0;
  max-width: 65%;
  flex: 0 1 auto;
}
.topbar .identity > div:not(.avatar) {
  min-width: 0;
}
.identity strong,
.identity small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.identity .avatar,
.identity button {
  flex-shrink: 0;
}

.page-heading > div {
  min-width: 0;
}
.page-heading h1,
.plan-banner h2 {
  overflow-wrap: anywhere;
}
