[hidden] { display: none !important; }
body[data-role="guest"] .twin-tools button[aria-expanded],
body[data-role="guest"] .twin-tools button[title="导出当前三维模型 PNG"] { display: none !important; }
.top-actions .session-role {
  padding: 4px 9px;
  border: 1px solid #3e627d;
  border-radius: 6px;
  color: #c4def4;
  font-size: 13px;
  white-space: nowrap;
}
.session-menu { position: relative; flex-shrink: 0; }
.session-menu > summary { cursor: pointer; list-style: none; }
.session-menu > summary::-webkit-details-marker { display: none; }
.session-menu > summary::after { content: '▾'; margin-inline-start: 6px; }
.session-menu[open] > summary { background: #1c3c55; }
.session-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 2;
  display: grid;
  gap: 4px;
  min-width: 122px;
  padding: 5px;
  border: 1px solid #34516a;
  border-radius: 8px;
  background: #12263a;
  box-shadow: 0 8px 18px #050d1880;
}
.session-menu-panel > button {
  display: block;
  width: 100%;
  padding: 6px 9px;
  border: 0;
  border-radius: 4px;
  text-align: left;
  white-space: nowrap;
  font-size: 14px;
  background: transparent;
  color: #d7e9f8;
}
.session-menu-panel > button:hover:enabled { background: #224762; }
.session-menu-panel > .login-error { margin: 4px; font-size: 13px; }
.session-menu :focus-visible { outline: 2px solid #8ce6f6; outline-offset: 2px; }
@media (max-width: 620px) {
  .top-actions .session-role { font-size: 12px; }
  .top-actions .session-role { padding-inline: 5px; }
}

.login-page {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 35% 16%, #163951, transparent 63%), #0a1625;
  color: #e3f2fb;
  font: 16px/1.55 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.login-shell { box-sizing: border-box; max-width: 574px; margin: auto; padding: clamp(24px, 7vh, 88px) 20px 32px; }
.login-brand { display: flex; align-items: center; gap: 15px; margin-bottom: 24px; }
.login-brand img { padding: 7px; background: #102c40; border: 1px solid #326482; border-radius: 13px; }
.login-brand h1 { font-size: 30px; letter-spacing: .05em; margin: 0; }
.login-brand p { color: #a5cee5; margin: 1px 0 0; }
.login-card { padding: clamp(20px, 6vw, 36px); border: 1px solid #32526a; border-radius: 16px; background: #112337; box-shadow: 0 18px 40px #050d1855; }
.login-card h2 { margin: 0 0 21px; font-size: 25px; }
.login-form { display: grid; gap: 8px; }
.login-form input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  margin: 0 0 6px;
  padding: 10px 12px;
  border: 1px solid #49677e;
  border-radius: 8px;
  background: #0b1b2b;
  color: #e3f2fb;
  font: inherit;
}
.login-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 20px; padding-top: 18px; border-top: 1px solid #36536a; }
.login-card button {
  box-sizing: border-box;
  font: inherit;
  border-radius: 8px;
  min-width: 0;
  padding: 14px 8px;
  border: 1px solid #396381;
  background: #142f45;
  color: #e3f2fb;
  cursor: pointer;
}
.login-card button:hover:enabled { background: #1d4660; }
.login-card .login-submit { padding: 10px; background: #60d5ed; color: #092435; font-weight: 700; }
.login-card .login-submit:hover:enabled { background: #8be4f5; }
.login-modes button[aria-pressed="true"] { border-color: #60d5ed; background: #1d4660; }
.login-card button:disabled { cursor: default; opacity: .55; }
.login-card :focus-visible { outline: 2px solid #8ce6f6; outline-offset: 3px; }
.login-modes strong, .login-modes span { display: block; }
.login-modes span, .login-hint { color: #b3cde1; font-size: 14px; }
.login-hint { margin: 14px 0 0; }
.login-error { margin: 12px 0 0; color: #ffb6a8; }
#admin-switch-dialog { box-sizing: border-box; width: min(430px, calc(100% - 32px)); color: #e3f2fb; }
#admin-switch-dialog::backdrop { background: #06101ec2; }
#admin-switch-dialog .login-error { margin: 0; }
.admin-switch-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.admin-switch-actions button { padding: 9px 14px; }
@media (max-width: 380px) {
  .login-modes { grid-template-columns: 1fr; }
}
