:root {
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  color: #101827;
  background: #eef2f7;
  --blue: #1677ff;
  --line: #d9e2ef;
  --muted: #64748b;
  --panel: #ffffff;
  --dark: #202124;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
}

.site-beian {
  position: fixed;
  left: 50%;
  bottom: 4px;
  z-index: 9;
  transform: translateX(-50%);
}

.site-beian a {
  min-height: 18px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  color: #475569;
  background: transparent;
  box-shadow: none;
  font-size: 10px;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  opacity: .72;
}

.site-beian img {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

body.viewer-page .site-beian {
  bottom: 84px;
  z-index: 7;
  pointer-events: none;
}

body.viewer-page .site-beian a {
  min-height: 14px;
  padding: 1px 4px;
  color: rgba(255, 255, 255, .72);
  background: transparent;
  box-shadow: none;
  font-size: 8px;
  opacity: .48;
}

body.viewer-page .site-beian img {
  width: 10px;
  height: 10px;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.home,
.console-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 440px 1fr;
}

.panel {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #0f172a;
  color: #fff;
  font-weight: 800;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
}

.muted {
  color: var(--muted);
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-weight: 700;
}

.field input[type="text"],
.field input[type="password"],
.field input[type="datetime-local"],
.field input[type="number"] {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #ffffff;
  color: #101827;
}

.field input:-webkit-autofill {
  -webkit-text-fill-color: #101827;
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset;
  transition: background-color 9999s ease-in-out 0s;
}

.dropzone {
  position: relative;
  min-height: 168px;
  border: 1px dashed #9fb2ca;
  border-radius: 8px;
  display: grid;
  place-items: center;
  text-align: center;
  background: #f8fafc;
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.dropzone strong {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
}

.primary {
  height: 44px;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
}

.primary:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

.result,
.project-list,
.notice {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.notice {
  background: #f8fafc;
}

.share-row {
  display: grid;
  grid-template-columns: 1fr 70px;
  gap: 8px;
  margin-top: 10px;
}

.share-row input {
  min-width: 0;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
}

.share-row button {
  border-radius: 6px;
  color: #fff;
  background: var(--dark);
  font-weight: 700;
}

.qr {
  width: 150px;
  height: 150px;
  border: 1px solid var(--line);
  margin-top: 12px;
}

.project-list {
  display: grid;
  gap: 10px;
}

.project-list > strong {
  display: none;
}

.project-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.project-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
  padding: 10px 0;
  color: inherit;
  border-top: 1px solid #eef2f7;
}

.project-link {
  display: grid;
  min-width: 0;
  gap: 4px;
  color: inherit;
  text-decoration: none;
}

.project-item:first-child {
  border-top: 0;
}

.project-item strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ghost {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #334155;
  font-weight: 700;
}

.ghost.danger {
  color: #b42318;
  border-color: #fecaca;
}

.link-button {
  display: inline-grid;
  min-height: 34px;
  align-items: center;
  padding: 0 12px;
  text-decoration: none;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(380px, 480px);
  background: #0c1116;
  color: #eef6f7;
}

.login-visual {
  position: relative;
  overflow: hidden;
  min-width: 0;
  background:
    linear-gradient(90deg, rgba(20, 184, 166, .18) 1px, transparent 1px),
    linear-gradient(0deg, rgba(20, 184, 166, .12) 1px, transparent 1px),
    radial-gradient(circle at 18% 18%, rgba(20, 184, 166, .22), transparent 28%),
    #0c1116;
  background-size: 64px 64px, 64px 64px, auto, auto;
}

.login-grid {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, transparent 0 42%, rgba(148, 163, 184, .12) 42% 43%, transparent 43% 100%),
    linear-gradient(25deg, transparent 0 58%, rgba(20, 184, 166, .16) 58% 59%, transparent 59% 100%);
}

.login-hero {
  position: relative;
  z-index: 1;
  width: min(680px, calc(100% - 96px));
  margin: 0 auto;
  min-height: 100vh;
  display: grid;
  align-content: center;
  gap: 18px;
}

.eyebrow {
  color: #2dd4bf;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.login-hero h1 {
  font-size: 54px;
  line-height: 1.05;
}

.login-hero p {
  max-width: 560px;
  color: #b8c7c9;
  font-size: 18px;
  line-height: 1.7;
}

.login-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.login-stats span {
  border: 1px solid rgba(45, 212, 191, .28);
  border-radius: 8px;
  padding: 14px;
  background: rgba(12, 17, 22, .68);
  color: #afc4c5;
}

.login-stats strong {
  display: block;
  color: #f8fafc;
  font-size: 20px;
}

.login-card {
  align-self: stretch;
  display: grid;
  align-content: center;
  gap: 22px;
  padding: 46px;
  background: #f8fafc;
  color: #101827;
  border-left: 1px solid rgba(255, 255, 255, .12);
}

.login-card .brand-mark,
.console-panel .brand-mark,
.admin-sidebar .brand-mark {
  background: #10201f;
  color: #5eead4;
}

.login-card h1,
.login-card h2 {
  font-size: 28px;
}

.login-card .field {
  gap: 12px;
}

.login-error {
  color: #b42318;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 8px;
  padding: 10px 12px;
}

.console-panel {
  background: #f8fafc;
}

.auth-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.auth-user {
  min-width: 0;
  color: #334155;
  font-weight: 700;
}

.auth-actions,
.admin-user-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.stage {
  background:
    linear-gradient(90deg, rgba(15, 23, 42, .78), rgba(15, 23, 42, .2)),
    linear-gradient(90deg, rgba(20, 184, 166, .12) 1px, transparent 1px),
    linear-gradient(0deg, rgba(20, 184, 166, .10) 1px, transparent 1px),
    #151a1f;
  background-size: auto, 60px 60px, 60px 60px, auto;
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  background: #edf2f7;
}

.admin-sidebar {
  padding: 28px;
  background: #0c1116;
  color: #e8f4f2;
  border-right: 1px solid rgba(255, 255, 255, .08);
}

.admin-sidebar .brand {
  align-items: flex-start;
}

.admin-sidebar h1 {
  font-size: 22px;
}

.admin-sidebar .muted {
  color: #8aa2a0;
}

.admin-nav {
  display: grid;
  gap: 8px;
  margin-top: 28px;
}

.admin-nav a {
  padding: 12px;
  border: 1px solid rgba(94, 234, 212, .16);
  border-radius: 8px;
  text-decoration: none;
  color: #d7fffa;
  background: rgba(20, 184, 166, .08);
}

.admin-main {
  min-width: 0;
  padding: 26px;
  display: grid;
  gap: 18px;
  align-content: start;
}

.admin-topbar,
.admin-section,
.admin-metrics article {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.admin-metrics article {
  padding: 16px;
  display: grid;
  gap: 6px;
}

.admin-metrics span {
  color: var(--muted);
  font-weight: 700;
}

.admin-metrics strong {
  font-size: 24px;
  color: #0f172a;
}

.admin-section {
  padding: 18px;
  display: grid;
  gap: 16px;
}

.admin-create-form {
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.admin-list {
  display: grid;
  gap: 6px;
}

.admin-user-main {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.admin-user-validity {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-user-validity input {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
}

.admin-share-line {
  color: #047857;
  font-size: 12px;
  word-break: break-all;
}

.stage {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(15, 23, 42, .78), rgba(15, 23, 42, .2)),
    linear-gradient(90deg, rgba(20, 184, 166, .12) 1px, transparent 1px),
    linear-gradient(0deg, rgba(20, 184, 166, .10) 1px, transparent 1px),
    #151a1f;
  background-size: auto, 60px 60px, 60px 60px, auto;
}

.preview-text {
  position: absolute;
  left: 36px;
  bottom: 36px;
  max-width: 560px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .35);
}

/* 2026 UI refresh: login, upload workspace, and owner operations dashboard. */
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, .72fr);
  background: #071016;
  color: #e8f7f4;
}

.login-product-visual {
  position: relative;
  overflow: hidden;
  min-width: 0;
  padding: clamp(34px, 5vw, 72px);
  display: grid;
  align-content: center;
  gap: 34px;
  background:
    radial-gradient(circle at 18% 18%, rgba(45, 212, 191, .16), transparent 30%),
    radial-gradient(circle at 82% 56%, rgba(14, 165, 233, .12), transparent 32%),
    linear-gradient(135deg, rgba(8, 18, 26, .94), rgba(5, 12, 18, .82));
}

.login-product-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(45, 212, 191, .07) 1px, transparent 1px),
    linear-gradient(0deg, rgba(45, 212, 191, .05) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(90deg, rgba(0, 0, 0, .8), transparent 78%);
}

.login-product-copy,
.login-visual-card {
  position: relative;
  z-index: 1;
}

.login-product-copy {
  max-width: 700px;
  display: grid;
  gap: 18px;
}

.login-product-copy h1 {
  font-size: clamp(40px, 5vw, 66px);
  line-height: 1.06;
  color: #f8fafc;
}

.login-product-copy h1 span {
  display: block;
}

.login-product-copy p {
  max-width: 590px;
  color: #a6c8c4;
  font-size: 18px;
  line-height: 1.75;
}

.login-proof-grid {
  width: min(620px, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.login-proof-grid span {
  min-height: 78px;
  padding: 14px;
  border: 1px solid rgba(94, 234, 212, .24);
  border-radius: 8px;
  background: rgba(9, 22, 30, .74);
  color: #96b8b5;
}

.login-proof-grid strong {
  display: block;
  color: #fff;
  font-size: 22px;
  margin-bottom: 4px;
}

.login-visual-card {
  width: min(560px, 92%);
  min-height: 260px;
  padding: 18px;
  border: 1px solid rgba(94, 234, 212, .18);
  border-radius: 8px;
  background: rgba(5, 12, 18, .72);
  box-shadow: 0 26px 80px rgba(0, 0, 0, .38);
}

.visual-toolbar {
  display: flex;
  gap: 8px;
  padding-bottom: 16px;
}

.visual-toolbar span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #2dd4bf;
  opacity: .78;
}

.visual-model {
  min-height: 170px;
  position: relative;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(148, 163, 184, .12) 1px, transparent 1px),
    linear-gradient(0deg, rgba(148, 163, 184, .08) 1px, transparent 1px),
    rgba(15, 23, 42, .48);
  background-size: 34px 34px;
}

.visual-model span {
  position: absolute;
  display: block;
  border: 1px solid rgba(94, 234, 212, .58);
  background: rgba(20, 184, 166, .10);
  box-shadow: 0 0 34px rgba(45, 212, 191, .12) inset;
}

.visual-model span:nth-child(1) {
  left: 14%;
  top: 42%;
  width: 48%;
  height: 34%;
  transform: skewY(-9deg);
}

.visual-model span:nth-child(2) {
  right: 18%;
  top: 22%;
  width: 30%;
  height: 54%;
  transform: skewY(12deg);
}

.visual-model span:nth-child(3) {
  left: 23%;
  top: 18%;
  width: 42%;
  height: 20%;
  transform: skewX(-24deg);
}

.visual-model span:nth-child(4) {
  right: 11%;
  bottom: 13%;
  width: 16%;
  height: 24%;
  background: rgba(59, 130, 246, .13);
  border-color: rgba(147, 197, 253, .6);
}

.visual-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  color: #a6c8c4;
}

.visual-meta strong {
  color: #7dd3fc;
}

.login-auth-panel {
  display: grid;
  align-content: center;
  gap: 22px;
  padding: clamp(28px, 5vw, 58px);
  background: #f8fafc;
  color: #0f172a;
  box-shadow: -18px 0 70px rgba(0, 0, 0, .18);
}

.login-auth-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.login-auth-head h2 {
  font-size: 32px;
  line-height: 1.1;
}

.login-auth-panel .brand-mark,
.workspace-title .brand-mark,
.ops-brand .brand-mark {
  background: #052e2b;
  color: #67e8f9;
}

.login-form-card {
  padding: 18px;
  border: 1px solid #dbe5ef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .08);
}

.login-submit {
  height: 48px;
}

.login-public-note {
  padding: 14px 16px;
  border: 1px solid #c7f9ed;
  border-radius: 8px;
  background: #ecfdf5;
  color: #075144;
}

.login-public-note p {
  margin-top: 4px;
  color: #35736a;
}

.workspace-shell.console-shell {
  min-height: 100vh;
  display: block;
  background: #eef4f7;
}

.workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px clamp(20px, 4vw, 46px);
  color: #e6fffb;
  background:
    linear-gradient(110deg, rgba(4, 16, 24, .97), rgba(10, 35, 42, .9)),
    linear-gradient(90deg, rgba(94, 234, 212, .1) 1px, transparent 1px);
  background-size: auto, 56px 56px;
}

.workspace-title {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.workspace-title h1 {
  font-size: 28px;
}

.workspace-title p {
  margin-top: 4px;
  color: #a6c8c4;
}

.workspace-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.workspace-actions .ghost,
.ops-topbar .ghost,
.admin-user-actions .ghost {
  min-height: 36px;
  padding: 0 12px;
}

.workspace-grid {
  width: min(1320px, calc(100% - 40px));
  margin: 24px auto 40px;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr);
  gap: 18px;
}

.upload-command-card,
.account-expiry-card,
.workspace-notice,
.workspace-result,
.project-operations-card {
  border: 1px solid #d9e4ee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .07);
}

.upload-command-card {
  grid-row: span 2;
  padding: 24px;
  display: grid;
  gap: 18px;
}

.upload-command-card h2 {
  font-size: 30px;
}

.card-kicker {
  color: #0f766e;
  font-size: 12px;
  font-weight: 900;
}

.account-expiry-card {
  padding: 22px;
  display: grid;
  gap: 10px;
  align-content: start;
  color: #0f172a;
  background:
    linear-gradient(180deg, #ffffff, #f7fbfc);
}

.account-expiry-card h2 {
  font-size: 24px;
}

.account-expiry-card strong {
  padding: 10px 12px;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
}

.account-expiry-card span {
  color: #64748b;
  line-height: 1.65;
}

.workspace-notice {
  padding: 18px;
}

.workspace-result {
  grid-column: 1 / -1;
  padding: 18px;
}

.project-operations-card {
  grid-column: 1 / -1;
  padding: 18px;
}

.project-operations-card .project-list-head {
  padding-bottom: 10px;
  border-bottom: 1px solid #edf2f7;
}

.project-operations-card .project-item {
  padding: 14px 0;
}

.ops-dashboard.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  background: #eef3f7;
}

.ops-sidebar {
  padding: 26px;
  color: #dffaf6;
  background:
    linear-gradient(180deg, #071016, #0c1b22 58%, #081217);
  border-right: 1px solid rgba(255, 255, 255, .08);
}

.ops-brand {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.ops-brand h1 {
  font-size: 22px;
}

.ops-brand p,
.ops-sidebar-note span {
  color: #8fb8b3;
  line-height: 1.55;
}

.ops-nav {
  display: grid;
  gap: 8px;
  margin: 34px 0;
}

.ops-nav a {
  padding: 12px 14px;
  border: 1px solid rgba(94, 234, 212, .18);
  border-radius: 8px;
  text-decoration: none;
  color: #dcfffb;
  background: rgba(20, 184, 166, .07);
}

.ops-sidebar-note {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid rgba(125, 211, 252, .18);
  border-radius: 8px;
  background: rgba(14, 165, 233, .08);
}

.ops-main {
  min-width: 0;
  padding: 24px;
  display: grid;
  gap: 18px;
  align-content: start;
}

.ops-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 18px;
  border: 1px solid #d9e4ee;
  border-radius: 8px;
  background: #fff;
}

.ops-topbar h2 {
  font-size: 22px;
}

.ops-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 18px;
  padding: 24px;
  border-radius: 8px;
  color: #e6fffb;
  background:
    linear-gradient(120deg, rgba(8, 27, 36, .96), rgba(14, 51, 59, .9)),
    linear-gradient(90deg, rgba(94, 234, 212, .12) 1px, transparent 1px);
  background-size: auto, 46px 46px;
}

.ops-hero h1 {
  font-size: 30px;
}

.ops-hero p {
  margin-top: 8px;
  max-width: 820px;
  color: #abd1ce;
  line-height: 1.7;
}

.ops-hero-status {
  align-self: stretch;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px;
  border: 1px solid rgba(94, 234, 212, .2);
  border-radius: 8px;
  background: rgba(6, 78, 59, .22);
}

.ops-hero-status span {
  color: #9bd8d3;
}

.ops-hero-status strong {
  font-size: 22px;
}

.ops-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.ops-metrics article {
  padding: 16px;
  border: 1px solid #d9e4ee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(15, 23, 42, .05);
}

.ops-section {
  padding: 18px;
  border: 1px solid #d9e4ee;
  border-radius: 8px;
  background: #fff;
  display: grid;
  gap: 14px;
}

.ops-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.ops-section-head strong {
  display: block;
  font-size: 22px;
}

.admin-create-form {
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.admin-table-head,
.admin-table-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(280px, 1fr) minmax(210px, auto);
  gap: 14px;
  align-items: center;
}

.admin-project-table,
.admin-project-item {
  grid-template-columns: minmax(220px, 1fr) minmax(230px, .75fr) minmax(240px, 1fr) auto;
}

.admin-table-head {
  padding: 10px 14px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.admin-table-row {
  padding: 14px;
  border: 1px solid #e7edf4;
  border-radius: 8px;
  background: #fff;
}

.admin-list {
  display: grid;
  gap: 8px;
}

.admin-user-main,
.admin-project-meta {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.admin-project-meta span {
  color: #64748b;
  line-height: 1.45;
}

.admin-user-validity {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-user-validity input {
  width: 190px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
  background: #fff;
}

.admin-user-validity input[type="number"] {
  width: 86px;
}

.project-retention-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.project-retention-control input {
  width: 76px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
  background: #fff;
}

.admin-share-line {
  min-width: 0;
  color: #047857;
  font-size: 12px;
  word-break: break-all;
}

.admin-user-actions {
  justify-content: flex-end;
}

.admin-user-actions-empty {
  color: #64748b;
}

@media (max-width: 1100px) {
  .login-shell,
  .ops-dashboard.admin-shell {
    grid-template-columns: 1fr;
  }

  .login-product-visual {
    min-height: 48vh;
  }

  .workspace-grid,
  .ops-hero,
  .ops-metrics,
  .admin-form-grid,
  .admin-table-head,
  .admin-table-row,
  .admin-project-table,
  .admin-project-item {
    grid-template-columns: 1fr;
  }

  .ops-sidebar {
    display: none;
  }
}

@media (max-width: 720px) {
  .login-proof-grid {
    grid-template-columns: 1fr;
  }

  .login-product-copy h1 {
    font-size: 38px;
  }

  .workspace-header,
  .ops-topbar,
  .ops-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace-grid {
    width: calc(100% - 24px);
  }

  .upload-command-card,
  .account-expiry-card,
  .workspace-notice,
  .workspace-result,
  .project-operations-card,
  .ops-section,
  .ops-hero {
    padding: 16px;
  }
}

/* Layout optimization pass: tighter hierarchy for product-grade daily use. */
.login-shell {
  grid-template-columns: minmax(0, 1fr) minmax(410px, 520px);
  background: #071116;
}

.login-product-visual {
  min-height: 100vh;
  padding: clamp(40px, 6vw, 86px);
  align-content: center;
  gap: 28px;
}

.login-product-visual::before {
  opacity: .65;
  mask-image: linear-gradient(90deg, rgba(0, 0, 0, .7), transparent 82%);
}

.login-masthead {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 16px;
  max-width: 840px;
}

.login-masthead h1 {
  color: #f8fafc;
  font-size: clamp(42px, 4.8vw, 62px);
  line-height: 1.04;
}

.login-masthead p {
  max-width: 620px;
  color: #afd5d0;
  font-size: 18px;
  line-height: 1.7;
}

.login-capability-strip {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(94, 234, 212, .22);
  border-radius: 8px;
  background: rgba(94, 234, 212, .22);
}

.login-capability-strip span {
  display: grid;
  gap: 4px;
  min-height: 74px;
  padding: 15px 16px;
  background: rgba(6, 18, 25, .82);
  color: #9ec6c2;
}

.login-capability-strip strong {
  color: #fff;
  font-size: 18px;
}

.login-auth-panel {
  display: grid;
  place-items: center;
  padding: clamp(26px, 4vw, 54px);
  background:
    linear-gradient(180deg, #f8fafc, #eef4f7);
}

.login-auth-card {
  width: min(438px, 100%);
  display: grid;
  gap: 18px;
}

.login-auth-head {
  align-items: flex-start;
}

.login-auth-head h2 {
  font-size: 30px;
}

.login-form-card {
  padding: 20px;
  border: 1px solid #d9e4ee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .08);
}

.login-public-note {
  border-radius: 8px;
  background: #ecfdf5;
}

.visual-model,
.login-visual-card {
  display: none;
}

.workspace-shell.console-shell {
  background: #eef4f7;
}

.workspace-header {
  padding: 18px clamp(22px, 4vw, 48px);
  background:
    linear-gradient(105deg, #071116, #102f36),
    linear-gradient(90deg, rgba(94, 234, 212, .08) 1px, transparent 1px);
  background-size: auto, 48px 48px;
}

.workspace-title h1 {
  font-size: 24px;
}

.workspace-title p {
  font-size: 14px;
}

.workspace-status-strip {
  width: min(1320px, calc(100% - 40px));
  margin: 18px auto 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid #d7e2ec;
  border-radius: 8px;
  background: #d7e2ec;
}

.workspace-status-strip span {
  display: grid;
  gap: 3px;
  min-height: 64px;
  padding: 12px 14px;
  background: #fff;
  color: #64748b;
}

.workspace-status-strip strong {
  color: #0f172a;
  font-size: 15px;
}

.workspace-main-grid {
  width: min(1320px, calc(100% - 40px));
  margin: 16px auto 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
}

.upload-primary-panel,
.workspace-rail > section,
.project-operations-card,
.workspace-result {
  border: 1px solid #d9e4ee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 36px rgba(15, 23, 42, .06);
}

.upload-primary-panel {
  padding: 22px;
  display: grid;
  gap: 18px;
}

.section-heading {
  display: grid;
  gap: 7px;
}

.section-heading h2 {
  font-size: 28px;
  line-height: 1.2;
}

.upload-form-layout {
  gap: 12px;
}

.workspace-rail {
  display: grid;
  gap: 12px;
}

.workspace-rail > section {
  padding: 16px;
}

.account-expiry-card h2 {
  font-size: 22px;
}

.account-expiry-card p {
  color: #475569;
}

.workspace-note-card {
  display: grid;
  gap: 8px;
}

.password-change-card summary {
  cursor: pointer;
  font-weight: 800;
  color: #0f172a;
}

.password-change-form {
  margin-top: 12px;
}

.password-change-form .ghost {
  min-height: 38px;
}

.workspace-note-card span {
  color: #475569;
  padding-left: 12px;
  border-left: 2px solid #99f6e4;
}

.workspace-result,
.project-operations-card {
  grid-column: 1 / -1;
  padding: 16px;
}

.project-table-head,
.project-table-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, .72fr) auto;
  gap: 14px;
  align-items: center;
}

.project-table-head {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.project-table-row {
  padding: 14px;
  border-top: 1px solid #edf2f7;
}

.project-table-row:first-child {
  border-top: 0;
}

.project-row-meta {
  display: grid;
  gap: 5px;
  color: #64748b;
}

.project-row-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.project-empty-state {
  margin-top: 12px;
  padding: 20px;
  border: 1px dashed #b7c7d8;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
}

.project-empty-state strong {
  display: block;
  color: #0f172a;
  margin-bottom: 6px;
}

.ops-main {
  padding: 20px 24px 34px;
  gap: 14px;
}

.ops-topbar {
  min-height: 64px;
}

.ops-hero {
  padding: 20px 22px;
  grid-template-columns: minmax(0, 1fr) 220px;
}

.ops-hero h1 {
  font-size: 28px;
}

.ops-metrics {
  gap: 10px;
}

.ops-metrics article {
  padding: 14px;
}

.ops-alert-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ops-alert-strip span {
  padding: 12px 14px;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  background: #f0f9ff;
  color: #475569;
}

.ops-alert-strip strong {
  color: #0369a1;
  margin-right: 8px;
}

.admin-create-drawer {
  border: 1px solid #dbe6f0;
  border-radius: 8px;
  background: #f8fafc;
}

.admin-create-drawer summary {
  height: 44px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: #0f172a;
  font-weight: 900;
  cursor: pointer;
}

.admin-create-drawer[open] summary {
  border-bottom: 1px solid #dbe6f0;
}

.admin-create-drawer .admin-create-form {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.admin-table-shell {
  border: 1px solid #dbe6f0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.admin-table-shell .admin-table-head {
  border-radius: 0;
  border: 0;
}

.admin-table-shell .admin-table-row {
  border-width: 1px 0 0;
  border-radius: 0;
  box-shadow: none;
}

.status-pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.status-success {
  color: #047857;
  background: #d1fae5;
}

.status-warning {
  color: #92400e;
  background: #fef3c7;
}

.status-danger {
  color: #b42318;
  background: #fee2e2;
}

.status-neutral {
  color: #475569;
  background: #e2e8f0;
}

@media (max-width: 1100px) {
  .workspace-status-strip,
  .workspace-main-grid,
  .ops-alert-strip {
    grid-template-columns: 1fr;
  }

  .project-table-head,
  .project-table-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-product-visual {
    min-height: auto;
  }

  .login-capability-strip,
  .workspace-status-strip {
    grid-template-columns: 1fr;
  }

  .workspace-main-grid,
  .workspace-status-strip {
    width: calc(100% - 24px);
  }
}

.cad-viewer {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #bfc3c7;
}

.cad-viewer.dark-theme {
  background: #000;
}

#cadCanvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#cadCanvas.camera-pan-ready {
  cursor: grab;
}

#cadCanvas.camera-panning {
  cursor: grabbing;
}

.camera-joystick {
  display: none;
}

.viewer-badge {
  position: absolute;
  left: 16px;
  top: 62px;
  z-index: 3;
  display: grid;
  gap: 4px;
  max-width: min(480px, calc(100vw - 96px));
  padding: 8px 10px;
  border-radius: 4px;
  color: rgba(255, 255, 255, .9);
  background: rgba(32, 33, 36, .4);
  backdrop-filter: blur(6px);
}

.viewer-badge strong {
  font-size: 14px;
}

.viewer-badge span {
  font-size: 12px;
}

.viewer-quality-badge {
  justify-self: start;
  height: 24px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 4px;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.viewer-quality-pass {
  border-color: rgba(134, 239, 172, .7);
  background: rgba(22, 101, 52, .7);
}

.viewer-quality-risk {
  border-color: rgba(251, 191, 36, .85);
  background: rgba(146, 64, 14, .82);
}

.viewer-quality-pending {
  border-color: rgba(203, 213, 225, .65);
  background: rgba(51, 65, 85, .7);
}

.ref-top-toolbar {
  position: absolute;
  top: 12px;
  left: 16px;
  z-index: 8;
  display: flex;
  gap: 8px;
}

.ref-top-toolbar button {
  min-width: 60px;
  height: 40px;
  padding: 0 14px;
  border-radius: 4px;
  background: #2d2d2d;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .12) inset;
}

.ref-top-toolbar button:hover,
.ref-bottom-toolbar button:hover,
.ref-top-toolbar button.active,
.ref-bottom-toolbar button.active {
  background: #171717;
}

.ref-top-toolbar button.active,
.ref-bottom-toolbar button.active {
  background: #1684ff;
  color: #fff;
}

.ref-side-toolbar {
  position: absolute;
  top: 8px;
  right: 16px;
  z-index: 8;
  display: grid;
  gap: 8px;
}

.ref-side-toolbar button {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .96);
  color: #1684ff;
  font-weight: 900;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .12);
}

.tool-icon,
.tool-icon svg {
  display: block;
  width: 22px;
  height: 22px;
}

.tool-icon svg {
  fill: currentColor;
}

.ref-side-toolbar button:hover {
  transform: translateY(-1px);
}

.ref-bottom-toolbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  height: 44px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  background: #2d2d2d;
}

.ref-bottom-toolbar button {
  color: #fff;
  background: transparent;
  font-weight: 700;
}

/* 底部柜名切换栏（view-fly 风格）：横向滚动，一次只看一个柜体 */
.cabinet-strip {
  position: absolute;
  left: 0;
  right: 0;
  max-width: 100vw;
  bottom: 44px;
  z-index: 8;
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  overflow-x: auto;
  overflow-y: hidden;
  background: rgba(20, 20, 20, .82);
  touch-action: pan-x;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  white-space: nowrap;
}

.cabinet-strip button {
  flex: 0 0 auto;
  scroll-snap-align: start;
  padding: 7px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .08);
  color: #e9e9e9;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.cabinet-strip button.active {
  background: #2994ff;
  border-color: #2994ff;
  color: #fff;
}

.floating-menu {
  position: absolute;
  z-index: 11;
  min-width: 140px;
  padding: 6px;
  border-radius: 4px;
  background: rgba(32, 33, 36, .95);
  box-shadow: 0 16px 36px rgba(0, 0, 0, .2);
}

.floating-menu button {
  width: 100%;
  height: 34px;
  border-radius: 3px;
  color: #fff;
  background: transparent;
  text-align: left;
  padding: 0 10px;
}

.floating-menu button:hover,
.floating-menu button.active {
  background: rgba(255, 255, 255, .12);
}

.floating-menu button.active {
  color: #7cc2ff;
}

.floating-menu-label {
  height: 28px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  color: rgba(255, 255, 255, .62);
  font-size: 12px;
  font-weight: 700;
}

.floating-menu-label.with-line {
  margin-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, .16);
}

.ref-bottom-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 44px;
  z-index: 9;
  max-height: 333px;
  min-height: 220px;
  display: grid;
  grid-template-rows: auto 1fr;
  background: rgba(245, 247, 249, .96);
  border-top: 1px solid rgba(0, 0, 0, .12);
  box-shadow: 0 -18px 50px rgba(15, 23, 42, .18);
}

.ref-bottom-sheet header {
  height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  border-bottom: 1px solid #dde5ee;
}

#sheetTitle {
  font-size: 16px;
  font-weight: 800;
}

.ref-bottom-sheet header button,
.sheet-actions button,
.note-form button {
  min-height: 28px;
  border-radius: 4px;
  padding: 0 12px;
  color: #fff;
  background: #2d2d2d;
  font-weight: 700;
}

#sheetBody {
  min-height: 0;
  overflow: auto;
  padding: 12px;
}

.sheet-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.room-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.room-tabs button {
  height: 30px;
  border-radius: 4px;
  padding: 0 14px;
  color: #fff;
  background: #2994ff;
  font-weight: 700;
}

.cabinet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}

.cabinet-card {
  min-height: 76px;
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid #d4dde9;
  border-radius: 4px;
  background: #fff;
}

.cabinet-card span {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.cabinet-card strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.cabinet-card small {
  color: #52647a;
}

.cabinet-card button {
  height: 30px;
  border-radius: 4px;
  background: #111827;
  color: #fff;
  padding: 0 10px;
  font-weight: 700;
}

.material-table-wrap {
  overflow: auto;
  border: 1px solid #d4dde9;
  background: #fff;
}

.material-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.material-table th,
.material-table td {
  height: 34px;
  padding: 0 10px;
  border-bottom: 1px solid #e8eef5;
  text-align: left;
  white-space: nowrap;
}

.material-table th {
  position: sticky;
  top: 0;
  background: #f1f5f9;
  z-index: 1;
}

.material-table tbody tr[data-panel-key] {
  cursor: pointer;
}

.material-table tbody tr[data-panel-key]:hover,
.material-table tbody tr.active {
  background: #e9f4ff;
}

.material-table button {
  height: 24px;
  border-radius: 4px;
  padding: 0 8px;
  color: #fff;
  background: #111827;
  font-size: 12px;
}

.material-section-title {
  margin: 8px 0 10px;
  font-size: 14px;
}

.small-table {
  margin-bottom: 12px;
}

.small-table .material-table {
  font-size: 12px;
}

.sheet-hint {
  color: #64748b;
  padding: 10px 0;
}

.diagnostics-quality {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #d4dde9;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
}

.diagnostics-quality-ok {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.diagnostics-quality-warn {
  border-color: #fbbf24;
  background: #fffbeb;
  color: #92400e;
}

.diagnostics-quality-danger {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #991b1b;
}

.diagnostics-quality-high {
  background: #fef2f2;
  color: #991b1b;
}

.diagnostics-quality-medium {
  background: #fffbeb;
  color: #92400e;
}

.diagnostics-quality-pass {
  background: #f0fdf4;
  color: #166534;
}

.diagnostics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 12px;
}

.diagnostics-table {
  max-height: 150px;
}

.diagnostic-json {
  max-height: 150px;
  overflow: auto;
  margin: 0;
  padding: 10px;
  border: 1px solid #d4dde9;
  border-radius: 4px;
  background: #0f172a;
  color: #dbeafe;
  font: 12px/1.5 Consolas, "Courier New", monospace;
  white-space: pre-wrap;
}

.note-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 80px;
  gap: 8px;
  margin-bottom: 12px;
}

.note-form.note-editor {
  grid-template-columns: 1fr;
}

.note-editor label {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.note-editor textarea {
  min-height: 74px;
  resize: vertical;
  border: 1px solid #d4dde9;
  border-radius: 4px;
  padding: 8px 10px;
  font: inherit;
}

.note-form input {
  height: 36px;
  border: 1px solid #d4dde9;
  border-radius: 4px;
  padding: 0 10px;
}

.note-list {
  display: grid;
  gap: 8px;
}

.note-list article {
  padding: 10px;
  border: 1px solid #d4dde9;
  border-radius: 4px;
  background: #fff;
}

.note-list article strong {
  color: #475569;
  font-size: 12px;
}

.note-list article small,
.note-list article a {
  display: block;
  margin-top: 6px;
  color: #475569;
  font-size: 12px;
}

.qr-panel {
  position: absolute;
  right: 70px;
  top: 54px;
  z-index: 10;
  width: 360px;
  padding: 14px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 18px 44px rgba(15, 23, 42, .2);
}

.board-lookup-panel {
  position: absolute;
  right: 70px;
  top: 102px;
  z-index: 10;
  width: 360px;
  max-height: calc(100vh - 150px);
  overflow: auto;
  padding: 14px;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, .22);
}

.qr-panel header,
.board-lookup-panel header,
.detail-dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.qr-panel header button,
.board-lookup-panel header button,
.detail-dialog header button {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  color: #fff;
  background: #111827;
}

.board-lookup-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 8px;
  margin-bottom: 10px;
}

.board-lookup-form input {
  min-width: 0;
  height: 36px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 0 10px;
  font: inherit;
}

.board-lookup-form button,
.board-lookup-actions button {
  min-height: 36px;
  border-radius: 4px;
  padding: 0 12px;
  color: #fff;
  background: #111827;
  font-weight: 800;
}

.board-lookup-actions {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.board-lookup-actions [data-start-board-scan],
.board-lookup-actions [data-stop-board-scan] {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
}

.board-lookup-actions [data-scan-board-image] {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
}

.board-scan-preview {
  overflow: hidden;
  margin-bottom: 10px;
  border-radius: 4px;
  background: #0f172a;
}

.board-scan-preview video {
  display: block;
  width: 100%;
  max-height: 240px;
  object-fit: cover;
}

.board-lookup-panel [data-board-lookup-status] {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 4px;
  color: #475569;
  background: #f1f5f9;
  font-size: 12px;
  line-height: 1.4;
}

.board-lookup-panel .board-lookup-ok {
  color: #166534;
  background: #dcfce7;
}

.board-lookup-panel .board-lookup-warn {
  color: #92400e;
  background: #fffbeb;
}

.board-lookup-results {
  display: grid;
  gap: 8px;
}

.board-lookup-results button {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 58px;
  padding: 8px 10px;
  border: 1px solid #d4dde9;
  border-radius: 4px;
  color: #111827;
  background: #fff;
  text-align: left;
}

.board-lookup-results button.active,
.board-lookup-results button:hover {
  border-color: #1684ff;
  background: #e9f4ff;
}

.board-lookup-results strong,
.board-lookup-results span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-lookup-results span {
  color: #52647a;
  font-size: 12px;
}

.qr-panel img {
  display: block;
  width: 132px;
  height: 132px;
  margin: 6px auto;
  border: 1px solid #e2e8f0;
}

.qr-panel p {
  word-break: break-all;
  color: #475569;
  font-size: 12px;
}

.qr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 10px 0;
}

.qr-grid figure {
  margin: 0;
  text-align: center;
  color: #475569;
  font-size: 12px;
}

.qr-single {
  display: grid;
  place-items: center;
  margin: 8px 0;
}

.qr-single figure {
  margin: 0;
  text-align: center;
  color: #475569;
  font-size: 12px;
}

.qr-fallback {
  display: grid;
  gap: 4px;
  margin: 10px 0;
  padding: 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 4px;
  color: #475569;
  background: #f8fafc;
  text-align: center;
}

.qr-fallback strong {
  color: #0f172a;
}

.share-link {
  max-height: 48px;
  overflow: auto;
}

.share-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.share-actions button {
  min-height: 30px;
  border-radius: 4px;
  color: #fff;
  background: #2d2d2d;
  font-weight: 700;
  font-size: 12px;
}

.board-info-panel {
  position: absolute;
  left: 8px;
  top: 166px;
  z-index: 9;
  width: 232px;
  max-height: none;
  overflow: visible;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, .22);
  padding: 8px;
  font-size: 11px;
}

.board-info-panel.collapsed {
  width: 220px;
  max-height: none;
  overflow: visible;
  padding: 7px 8px;
}

.board-info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 5px;
}

.board-info-header strong {
  min-width: 0;
  overflow: hidden;
  color: #111827;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-info-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
}

.board-info-header button {
  flex: 0 0 auto;
  min-height: 22px;
  border-radius: 4px;
  padding: 0 6px;
  color: #fff;
  background: #1f2937;
  font-size: 10px;
  font-weight: 800;
}

.board-info-summary {
  margin: 0;
  color: #475569;
  font-size: 10px;
  line-height: 1.25;
  word-break: break-word;
}

.board-info-panel dl,
.detail-dialog dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 6px;
  margin: 0;
  font-size: 13px;
}

.board-info-panel dl {
  font-size: 11px;
  line-height: 1.25;
}

.board-info-panel dt,
.detail-dialog dt {
  color: #64748b;
  white-space: nowrap;
}

.board-info-panel dd,
.detail-dialog dd {
  min-width: 0;
  margin: 0;
  word-break: break-word;
}

.detail-dialog {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, .34);
}

.detail-dialog article {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 80px);
  overflow: auto;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, .28);
  padding: 16px;
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 66px;
  z-index: 20;
  transform: translateX(-50%);
  min-width: 120px;
  padding: 10px 16px;
  border-radius: 4px;
  text-align: center;
  color: #fff;
  background: rgba(17, 24, 39, .88);
}

.empty-3d {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 30px;
}

.empty-card {
  max-width: 680px;
  padding: 24px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 20px 60px rgba(15, 23, 42, .18);
}

@media (max-width: 900px) {
  .home {
    grid-template-columns: 1fr;
  }

  .stage {
    min-height: 420px;
  }

  .viewer-badge {
    display: none;
  }

  .ref-top-toolbar {
    left: 6px;
    top: 6px;
    gap: 3px;
  }

  .ref-top-toolbar button {
    min-width: 26px;
    height: 22px;
    padding: 0 5px;
    font-size: 10px;
  }

  .ref-side-toolbar {
    right: 8px;
  }

  .ref-bottom-toolbar {
    grid-template-columns: repeat(6, 1fr);
    height: 24px;
  }

  .ref-bottom-toolbar button {
    padding: 0 2px;
    font-size: 10px;
  }

  .ref-bottom-sheet {
    bottom: 24px;
  }

  .cabinet-strip {
    bottom: 24px;
    gap: 4px;
    padding: 4px 6px;
  }

  .cabinet-strip button {
    padding: 4px 8px;
    font-size: 10px;
  }

  body.viewer-page .site-beian {
    bottom: 58px;
  }

  body.viewer-page .site-beian a {
    min-height: 12px;
    padding: 1px 3px;
    font-size: 7px;
  }

  body.viewer-page .site-beian img {
    width: 9px;
    height: 9px;
  }

  .qr-panel {
    right: 44px;
    top: 44px;
    width: min(220px, calc(100vw - 58px));
    padding: 8px;
    font-size: 11px;
  }

  .qr-panel img {
    width: 96px;
    height: 96px;
  }

  .qr-panel header,
  .board-lookup-panel header {
    gap: 6px;
    margin-bottom: 6px;
  }

  .qr-panel header button,
  .board-lookup-panel header button {
    width: 22px;
    height: 22px;
  }

  .board-lookup-panel {
    right: 44px;
    top: 44px;
    width: min(220px, calc(100vw - 58px));
    max-height: calc(100vh - 96px);
    padding: 8px;
    font-size: 11px;
  }

  .board-lookup-form {
    grid-template-columns: minmax(0, 1fr) 48px;
    gap: 4px;
    margin-bottom: 6px;
  }

  .board-lookup-form input {
    height: 34px;
    padding: 0 6px;
    font-size: 16px;
  }

  .board-lookup-form button,
  .board-lookup-actions button {
    min-height: 24px;
    padding: 0 6px;
    font-size: 10px;
  }

  .board-lookup-actions {
    gap: 4px;
    margin-bottom: 6px;
  }

  .board-scan-preview video {
    max-height: 120px;
  }

  .board-lookup-panel [data-board-lookup-status] {
    margin-bottom: 6px;
    padding: 4px 6px;
    font-size: 10px;
  }

  .board-lookup-results {
    gap: 4px;
  }

  .board-lookup-results button {
    min-height: 34px;
    padding: 4px 6px;
    font-size: 10px;
  }

  .board-info-panel {
    top: 56px;
    left: 6px;
    width: min(232px, calc(100vw - 68px));
    max-height: none;
    overflow: visible;
    padding: 7px;
    font-size: 10px;
  }

  .board-info-panel.collapsed {
    width: min(210px, calc(100vw - 92px));
  }
}

@media (max-width: 900px) and (pointer: coarse) {
  .camera-joystick {
    position: absolute;
    right: 18px;
    bottom: calc(76px + env(safe-area-inset-bottom));
    z-index: 7;
    display: block;
    width: 88px;
    height: 88px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .45);
    border-radius: 50%;
    background: rgba(15, 23, 42, .36);
    box-shadow: 0 10px 28px rgba(15, 23, 42, .28), inset 0 1px 0 rgba(255, 255, 255, .18);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    transition: background-color 120ms ease, box-shadow 120ms ease;
  }

  .camera-joystick-knob {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, .62);
    border-radius: 50%;
    background: rgba(255, 255, 255, .78);
    box-shadow: 0 4px 12px rgba(15, 23, 42, .3);
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: background-color 120ms ease, box-shadow 120ms ease;
  }

  .camera-joystick.active {
    background: rgba(22, 132, 255, .32);
    box-shadow: 0 12px 30px rgba(15, 23, 42, .34), inset 0 0 0 2px rgba(41, 148, 255, .28);
  }

  .camera-joystick.active .camera-joystick-knob {
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 5px 16px rgba(15, 23, 42, .38);
  }
}

@media (max-width: 900px) and (pointer: coarse) and (orientation: landscape) {
  .camera-joystick {
    right: 60px;
    bottom: calc(38px + env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  .camera-joystick,
  .camera-joystick-knob {
    transition: none;
  }
}

/* ===== 登录与账号管理 ===== */
@media (max-width: 1100px) {
  .admin-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .login-shell,
  .console-shell,
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .login-visual {
    min-height: 320px;
  }

  .login-hero {
    min-height: 320px;
    width: min(100% - 36px, 640px);
  }

  .login-hero h1 {
    font-size: 34px;
  }

  .login-card,
  .panel,
  .admin-main,
  .admin-sidebar {
    padding: 20px;
  }

  .login-stats,
  .admin-form-grid,
  .admin-metrics {
    grid-template-columns: 1fr;
  }

  .auth-bar,
  .project-item {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }
}

.material-library-shell .material-library-grid {
  grid-template-columns: minmax(280px, .55fr) minmax(0, 1.45fr);
}

.material-library-shell .material-library-list-card {
  grid-column: auto;
}

.material-library-shell .material-library-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

.material-library-shell .material-upload-queue {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

.material-library-shell .material-library-list-heading {
  margin-bottom: 14px;
}

.material-library-shell .material-bulk-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid #dbe4ee;
  border-radius: 8px;
  background: #f8fafc;
}

.material-library-shell .material-bulk-actions button {
  min-height: 36px;
  margin-left: auto;
  padding: 0 14px;
}

.material-library-shell .material-select-all,
.material-library-shell .material-card-select,
.material-library-shell .material-default-roles label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.material-library-shell .material-select-all input,
.material-library-shell .material-card-select input,
.material-library-shell .material-default-roles input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #2563eb;
}

.material-library-shell .material-card-select {
  justify-self: start;
}

.material-library-shell .material-default-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  min-width: 0;
}

.material-library-shell .material-bulk-error {
  margin: -4px 0 14px;
  color: #b42318;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.material-library-shell .material-library-item {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto auto auto 1fr auto;
  align-content: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}

.material-library-shell .material-upload-item {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  align-content: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}

.material-library-shell .material-thumb {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #e2e8f0;
  object-fit: cover;
}

.material-library-shell .material-upload-preview {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #e2e8f0;
  object-fit: cover;
}

.material-library-shell .material-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.material-library-shell .material-library-meta strong {
  display: -webkit-box;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.material-library-shell .material-library-meta,
.material-library-shell .material-rename-form,
.material-library-shell .material-upload-item .field {
  min-width: 0;
}

.material-library-shell .material-library-meta small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.material-library-shell .material-upload-source {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.material-library-shell .material-rename-form input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.material-library-shell .material-upload-item input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.material-library-shell .material-card-actions {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.material-library-shell .material-card-actions button {
  flex: 1 1 64px;
  max-width: 100%;
  min-height: 38px;
}

.material-library-shell .material-upload-item > button {
  min-width: 0;
  max-width: 100%;
}

.material-library-shell .material-card-error {
  margin: 0;
  color: #b42318;
  font-size: 12px;
  overflow-wrap: anywhere;
}

@media (max-width: 1100px) {
  .material-library-shell .material-library-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .material-library-shell .material-library-list-card {
    grid-column: 1;
  }
}

@media (max-width: 720px) {
  .material-library-shell .workspace-header,
  .material-library-shell .workspace-title,
  .material-library-shell .workspace-actions {
    width: 100%;
  }

  .material-library-shell .workspace-title {
    align-items: flex-start;
  }

  .material-library-shell .workspace-title > div:last-child {
    min-width: 0;
  }

  .material-library-shell .workspace-title p {
    overflow-wrap: anywhere;
  }

  .material-library-shell .workspace-actions .ghost {
    flex: 1 1 120px;
  }
}
