:root {
  --paper: #faf9f6;
  --panel: #f0eee8;
  --white: #fffefa;
  --ink: #252620;
  --muted: #66685e;
  --line: #dbd9d0;
  --red: #8b452f;
  --tint: #f1e6dd;
  --green: #476248;
  --green-tint: #e8eee4;
  --amber: #7b5a2c;
  --amber-tint: #f4ead8;
  --sans: Inter, -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --serif: 'Songti SC', 'Noto Serif CJK SC', Georgia, serif;
  font: 15px/1.55 var(--sans);
  color: var(--ink);
  background: var(--paper);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(240, 238, 232, 0.55), transparent 340px),
    var(--paper);
}
button,
input {
  font: inherit;
  color: inherit;
}
button {
  border: 0;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
}
button:disabled {
  cursor: default;
  opacity: 0.5;
}
button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
h1,
h2,
p,
ul,
dl,
dd {
  margin: 0;
}
h1,
h2 {
  line-height: 1.25;
}
ul {
  padding: 0;
}
.signature {
  display: flex;
  gap: 10px;
  align-items: center;
  white-space: nowrap;
}
.signature strong {
  font: 700 25px/1 var(--serif);
  letter-spacing: 0.025em;
}
.signature > span:last-child {
  color: var(--muted);
  font-size: 13px;
}
.mark {
  display: inline-block;
  width: 28px;
  height: 30px;
  position: relative;
  margin-right: 2px;
}
.mark:before,
.mark:after {
  content: '';
  display: block;
  position: absolute;
  width: 15px;
  height: 22px;
  border: 1.7px solid var(--ink);
  border-radius: 2px 6px 2px 2px;
  transform: skewY(-11deg);
}
.mark:before {
  left: 2px;
  top: 6px;
  background: var(--ink);
}
.mark:after {
  left: 9px;
  top: 2px;
  background: var(--paper);
}
.primary,
.secondary,
.danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
}
.primary {
  color: #fffef9;
  background: var(--ink);
}
.primary:hover {
  background: #424538;
}
.secondary {
  border: 1px solid var(--line);
  background: var(--white);
}
.secondary:hover {
  border-color: #bcb9ae;
}
.danger {
  color: #fffef9;
  background: var(--red);
}
.danger:hover {
  background: #733824;
}
.text-button {
  padding: 5px 7px;
  border-radius: 5px;
  color: var(--muted);
  font-size: 13px;
}
.text-button:hover {
  color: var(--ink);
  background: var(--panel);
}
.eyebrow {
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
}
.lede {
  max-width: 52ch;
  color: var(--muted);
}
.feedback {
  min-height: 1.55em;
  color: var(--red);
  font-size: 13px;
}
.feedback:empty {
  min-height: 0;
}
.portal-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 36px;
}
.portal-header {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 88px;
  border-bottom: 1px solid var(--line);
}
.portal-kicker {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.12em;
}
.account-area {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.account-name {
  color: var(--muted);
  font-size: 13px;
}
.account-name::before {
  content: '登录为 ';
}
.portal-main {
  flex: 1;
  padding: 64px 0 72px;
}
.login-view {
  display: grid;
  grid-template-columns: minmax(0, 440px) minmax(260px, 360px);
  gap: 72px;
  justify-content: center;
  align-items: start;
}
.login-card {
  padding: 36px 38px 32px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  box-shadow: 0 18px 44px -36px rgba(37, 38, 32, 0.6);
}
.login-card h1 {
  margin: 10px 0 14px;
  font: 600 30px/1.22 var(--serif);
  letter-spacing: -0.01em;
}
.login-form {
  display: grid;
  gap: 8px;
  margin-top: 26px;
}
.login-form label,
dialog label {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
input {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
}
input:focus {
  border-color: #a8a496;
  background: #fff;
}
.login-form .primary {
  margin-top: 10px;
}
.account-note {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.trust-note {
  padding-top: 40px;
}
.trust-note h2 {
  margin-bottom: 14px;
  font: 600 17px/1.3 var(--serif);
}
.trust-note ul {
  display: grid;
  gap: 12px;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
}
.trust-note li::marker {
  color: var(--red);
}
.trust-note p {
  margin-top: 20px;
  padding: 16px 18px;
  border-left: 2px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.directory-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  margin-bottom: 30px;
}
.directory-head h1 {
  margin: 8px 0 10px;
  font: 600 34px/1.15 var(--serif);
}
.directory-actions {
  display: flex;
  gap: 10px;
  flex: none;
}
.notice {
  margin-bottom: 18px;
  padding: 12px 16px;
  border-left: 2px solid var(--amber);
  background: var(--amber-tint);
  color: var(--amber);
  font-size: 13px;
}
.host-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.host-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}
.host-card.revoked {
  background: var(--panel);
}
.host-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.host-heading h2 {
  font-size: 19px;
  font-weight: 650;
}
.host-platform {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}
.status-pill {
  flex: none;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.status-online {
  color: var(--green);
  background: var(--green-tint);
}
.status-offline,
.status-revoked {
  color: var(--muted);
  background: var(--panel);
}
.host-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.host-facts dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.host-facts dd {
  margin-top: 3px;
  font-size: 13px;
  font-weight: 600;
}
.fact-ready {
  color: var(--green);
}
.fact-pending {
  color: var(--amber);
}
.host-note {
  color: var(--muted);
  font-size: 12px;
}
.host-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}
.host-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 9px 16px;
  border-radius: 7px;
  color: #fffef9;
  background: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.host-open:hover {
  background: #424538;
}
.host-offline-note {
  color: var(--muted);
  font-size: 12px;
}
.host-actions .danger {
  min-height: 38px;
  margin-left: auto;
  padding: 8px 14px;
  color: var(--red);
  background: transparent;
  border: 1px solid var(--line);
  font-size: 12px;
}
.host-actions .danger:hover {
  border-color: #cbb6ab;
  background: var(--tint);
}
.empty-state {
  padding: 40px 28px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
}
.directory-note {
  max-width: 78ch;
  margin-top: 28px;
  color: var(--muted);
  font-size: 12px;
}
.portal-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 0 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}
dialog {
  width: min(460px, calc(100vw - 32px));
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  color: var(--ink);
}
dialog::backdrop {
  background: rgba(37, 38, 32, 0.34);
}
dialog form {
  display: grid;
  gap: 8px;
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 14px;
}
.dialog-heading h2 {
  margin-top: 5px;
  font: 600 24px/1.2 var(--serif);
}
.close {
  width: 32px;
  height: 32px;
  margin: -4px -4px 0 0;
  border-radius: 50%;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}
.close:hover {
  background: var(--panel);
  color: var(--ink);
}
.dialog-copy {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}
.code-box {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 10px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}
.code-box code {
  flex: 1;
  overflow-wrap: anywhere;
  font: 600 24px/1.2 ui-monospace, 'SFMono-Regular', Menlo, monospace;
  letter-spacing: 0.08em;
}
.code-expiry {
  color: var(--muted);
  font-size: 12px;
}
.global-status {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: min(420px, calc(100vw - 48px));
  padding: 11px 15px;
  border-radius: 8px;
  background: var(--ink);
  color: #fffef9;
  font-size: 13px;
  box-shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.7);
}
@media (max-width: 820px) {
  .portal-shell {
    padding: 0 22px;
  }
  .portal-header {
    gap: 16px;
    min-height: 76px;
  }
  .portal-kicker {
    display: none;
  }
  .portal-main {
    padding: 38px 0 52px;
  }
  .login-view {
    grid-template-columns: 1fr;
    gap: 34px;
  }
  .trust-note {
    padding-top: 0;
  }
  .directory-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 20px;
  }
  .directory-actions {
    width: 100%;
  }
  .directory-actions .primary {
    flex: 1;
  }
  .host-grid {
    grid-template-columns: 1fr;
  }
  .portal-footer {
    flex-direction: column;
    gap: 6px;
  }
}
@media (max-width: 520px) {
  .portal-shell {
    padding: 0 16px;
  }
  .signature > span:last-child {
    display: none;
  }
  .login-card {
    padding: 26px 22px;
  }
  .login-card h1 {
    font-size: 26px;
  }
  .account-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .host-card {
    padding: 20px;
  }
  .host-facts {
    grid-template-columns: 1fr;
  }
}
