:root {
  font-family: "Segoe UI", "Microsoft YaHei UI", system-ui, sans-serif;
  color: #1c2422;
  background: #f2f5f3;
  font-synthesis: none;
  --accent: #205b49;
  --muted: #566460;
  --line: #d9e2dd;
  --surface: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
button {
  cursor: pointer; border: 1px solid transparent; border-radius: 7px;
  padding: .6rem .9rem; background: var(--accent); color: white;
  transition: background .15s ease, transform .15s ease;
}
button:hover { background: #184535; }
button:active { transform: translateY(1px); }
button:disabled { opacity: .62; cursor: wait; }
button.secondary { color: var(--accent); background: var(--surface); border-color: var(--line); }
button.secondary:hover { background: #ecf4ef; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .85rem clamp(1rem, 4vw, 3.5rem); background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand, .account, .actions, .view-header { display: flex; align-items: center; gap: .8rem; }
.brand { font-weight: 680; letter-spacing: -.025em; }
.mark {
  display: inline-grid; place-items: center; width: 2rem; height: 2rem;
  border: 1px solid var(--line); border-radius: 7px; color: var(--accent);
  font: 700 1.1rem ui-monospace, monospace; background: #edf4ef;
}
.account { color: var(--muted); min-width: 0; }
#username { overflow-wrap: anywhere; text-align: right; }
.login {
  margin: clamp(3.5rem, 13vh, 9rem) auto;
  width: min(52rem, calc(100% - 2rem)); align-items: start;
  display: grid; grid-template-columns: 1fr minmax(17rem, .85fr); gap: clamp(2rem, 8vw, 6rem);
}
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.12; letter-spacing: -.05em; margin: 0; }
.context { color: var(--accent); font-size: .84rem; font-weight: 650; }
.muted, .feedback { color: var(--muted); }
form {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 1.5rem; display: grid; gap: .55rem;
}
label { font-weight: 600; font-size: .88rem; }
input {
  padding: .65rem .7rem; margin-bottom: .55rem; border: 1px solid #bccbc3;
  border-radius: 6px; background: #fbfdfb; color: inherit; min-width: 0;
}
form button { margin-top: .35rem; }
.factor { display: grid; gap: .55rem; }
.invitation {
  display: grid; align-items: start; max-width: 30rem; gap: .4rem;
  padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 9px;
  margin-bottom: 1rem;
}
.invitation p { margin: 0; font-size: .85rem; }
.security form { max-width: 32rem; margin-bottom: 1rem; }
.security h2 { margin-block: 1.4rem .5rem; font-size: 1.15rem; }
.security pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.error { color: #8b302b; margin: 0; font-size: .9rem; }
.workspace {
  max-width: 88rem; margin: auto; min-height: calc(100dvh - 4.5rem);
  display: grid; grid-template-columns: minmax(10rem, 13rem) minmax(0, 1fr);
}
.workspace.restricted { display: block; max-width: 52rem; }
aside { padding: 2.3rem 1rem; border-right: 1px solid var(--line); }
nav { display: grid; gap: .3rem; }
nav button { color: var(--muted); background: transparent; text-align: left; white-space: nowrap; }
nav button:hover, nav button[aria-current=page] { color: var(--accent); background: #e2eee7; }
nav button[aria-current=page] { font-weight: 650; }
.content { padding: 2.4rem clamp(1rem, 4vw, 3.5rem); min-width: 0; }
.view-header { justify-content: space-between; flex-wrap: wrap; }
.feedback { margin: 1.05rem 0; min-height: 1.4rem; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.25rem), 1fr)); padding: 1rem 0; border-block: 1px solid var(--line); margin-bottom: 1.4rem; }
.metrics div { padding: .1rem .8rem; }
.metrics div + div { border-left: 1px solid var(--line); }
.metrics p { margin: 0 0 .5rem; color: var(--muted); font-size: .86rem; }
.metrics strong { font-size: clamp(1rem, 2.5vw, 1.55rem); font-variant-numeric: tabular-nums; }
.records { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; overflow: auto; }
.records > p { padding: 1rem 1.2rem; color: var(--muted); }
table { border-collapse: collapse; text-align: left; width: 100%; }
th, td { padding: .85rem 1rem; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
th { font-size: .8rem; color: var(--muted); background: #fafcfb; white-space: nowrap; }
td { font-size: .9rem; min-width: 6rem; }
td button { white-space: nowrap; }
tbody tr:last-child td { border: 0; }
time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.is-online { color: var(--accent); font-weight: 600; }
@media (max-width: 750px) {
  .login, .workspace { grid-template-columns: minmax(0, 1fr); }
  aside { border: 0; border-bottom: 1px solid var(--line); padding: .6rem 1rem; }
  nav { display: flex; overflow-x: auto; }
  .content { padding-top: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  button { transition: none; }
  button:active { transform: none; }
}
