:root {
  --radius-shell: 28px;
  --radius-card: 18px;
  --radius-control: 12px;
  --reveal-x: 0px;
  --ease-spring: cubic-bezier(0.2, 0.82, 0.2, 1.08);
  --ease-soft: cubic-bezier(0.22, 1, 0.36, 1);
  --tool-color-1: hsl(148 23% 40%);
  --tool-color-2: hsl(74 25% 44%);
  --tool-color-3: hsl(177 37% 38%);
  --tool-color-4: hsl(209 36% 47%);
  --tool-color-5: hsl(237 23% 51%);
  --tool-color-6: hsl(282 20% 51%);
  --tool-color-7: hsl(337 25% 52%);
  --tool-color-8: hsl(13 36% 53%);
  --tool-color-9: hsl(39 45% 49%);
  --tool-color-10: hsl(203 6% 48%);
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--canvas); scroll-behavior: smooth; }

body {
  display: flow-root;
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text-primary);
  background: var(--canvas);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

button,
input { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

button { color: inherit; }

button:not(:disabled),
a { cursor: pointer; }

img { display: block; max-width: 100%; }

[hidden] { display: none !important; }

.noscript-notice {
  position: relative;
  z-index: 1001;
  width: min(720px, calc(100% - 32px));
  margin: 16px auto 0;
  padding: 12px 16px;
  color: var(--text-primary);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--surface-solid);
  box-shadow: 0 12px 30px var(--shadow);
  font-size: 12px;
  text-align: center;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: var(--radius-control);
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 180ms var(--ease-soft);
}

.skip-link:focus { transform: translateY(0); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.ambient,
.ambient-image,
.ambient-scrim {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.ambient { z-index: 0; overflow: hidden; background: var(--canvas); }

.ambient-image {
  background-position: center;
  background-size: cover;
  opacity: 0;
  transform: scale(1.025);
  transition: opacity 420ms var(--ease-soft), transform 1100ms var(--ease-soft);
}

.ambient-image:first-child { background-image: var(--ambient-image); }
.ambient-image.is-active { opacity: 1; animation: ambientDepth 18s ease-in-out infinite alternate; }
.ambient-scrim { background: var(--scrim); transition: background-color 420ms var(--ease-soft); }

@keyframes ambientDepth {
  from { transform: scale(1.025) translate3d(-0.25%, 0, 0); }
  to { transform: scale(1.065) translate3d(0.4%, -0.35%, 0); }
}

.global-header {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1440px, calc(100% - 64px));
  min-height: 76px;
  margin: 20px auto 0;
  padding: 10px 14px 10px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--header);
  box-shadow: inset 0 1px 0 var(--highlight-soft), var(--shadow-2);
  backdrop-filter: var(--chrome-filter);
  transition: background-color 420ms var(--ease-soft), border-color 420ms var(--ease-soft);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: 50%;
  font-family: Georgia, "Songti SC", serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: inset 0 1px 0 var(--highlight-strong);
}

.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { font-size: 15px; letter-spacing: 0.05em; }
.brand-copy small { color: var(--text-muted); font-size: 10px; letter-spacing: 0.12em; }

.header-actions,
.topbar-actions { display: flex; align-items: center; gap: 12px; }

.version-label {
  color: var(--text-secondary);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.theme-switch {
  display: flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-muted);
}

.theme-choice {
  min-width: 52px;
  min-height: 36px;
  padding: 6px 12px;
  color: var(--text-secondary);
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-size: 13px;
  transition: color 220ms ease, background-color 220ms ease, transform 220ms var(--ease-spring);
}

.theme-choice:hover { color: var(--text-primary); }
.theme-choice:active { transform: scale(0.97); }
.theme-choice.is-active { color: var(--accent-ink); background: var(--accent); box-shadow: 0 5px 16px var(--shadow); }

.login-page {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(390px, 0.84fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
  width: min(1320px, calc(100% - 96px));
  min-height: calc(100dvh - 116px);
  margin: 0 auto;
  padding: 52px 0 76px;
}

.story-panel { min-width: 0; padding: 30px 0 12px; }
.eyebrow,
.section-kicker {
  margin: 0 0 16px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.eyebrow { display: flex; align-items: center; gap: 10px; }
.eyebrow span { width: 30px; height: 1px; background: var(--accent); }

.story-copy h1,
.welcome-copy h1,
.page-intro h1 {
  margin: 0;
  font-family: Georgia, "Songti SC", "STSong", serif;
  font-weight: 500;
  letter-spacing: -0.045em;
}

.story-copy h1 { max-width: 760px; font-size: clamp(58px, 7.2vw, 112px); line-height: 0.98; }

.story-description {
  max-width: 600px;
  margin: 28px 0 0;
  color: var(--text-secondary);
  font-size: clamp(16px, 1.4vw, 20px);
  line-height: 1.8;
}

.identity-stage {
  position: relative;
  width: min(560px, 78%);
  height: 230px;
  margin: 36px 0 16px 7%;
}

.stage-orbit {
  position: absolute;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  opacity: 0.72;
}

.orbit-one { inset: 14px 116px 14px 0; }
.orbit-two { inset: 48px 42px 48px 80px; }
.orbit-one { animation: stageOrbitPulse 5.8s ease-in-out infinite alternate; }
.orbit-two { animation: stageOrbitPulse 7.2s ease-in-out -2.4s infinite alternate-reverse; }

@keyframes stageOrbitPulse {
  from { opacity: 0.48; transform: scale(1); }
  to { opacity: 0.86; transform: scale(1.035); }
}

.stage-avatar {
  position: absolute;
  width: 70px;
  height: 70px;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface-solid);
  box-shadow: 0 18px 36px var(--shadow), inset 0 1px 0 var(--highlight-medium);
  animation: avatarFloat 6.5s ease-in-out infinite;
}

.stage-avatar-main { left: 130px; top: 57px; width: 116px; height: 116px; z-index: 2; }
.stage-avatar-a { left: 8px; top: 78px; animation-delay: -1.6s; }
.stage-avatar-b { left: 286px; top: 12px; width: 58px; height: 58px; animation-delay: -3.2s; }
.stage-avatar-c { left: 314px; bottom: 8px; width: 64px; height: 64px; animation-delay: -4.8s; }

@keyframes avatarFloat {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(-1deg); }
  50% { transform: translate3d(0, -9px, 0) rotate(1deg); }
}

.stage-note {
  position: absolute;
  z-index: 3;
  right: 0;
  top: 78px;
  display: grid;
  gap: 5px;
  width: 190px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-glass);
  box-shadow: inset 0 1px 0 var(--highlight), var(--shadow-1);
  backdrop-filter: var(--chrome-filter);
}

.stage-note strong { font-size: 13px; }
.stage-note span { color: var(--text-secondary); font-size: 11px; line-height: 1.55; }

.story-facts {
  display: grid;
  grid-template-columns: 104px 104px minmax(170px, 1fr);
  gap: 18px;
  align-items: end;
  max-width: 610px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.story-facts div { display: grid; gap: 3px; }
.story-facts strong { font-family: Georgia, serif; font-size: 30px; font-weight: 500; }
.story-facts span,
.story-facts p { color: var(--text-muted); font-size: 11px; line-height: 1.6; }
.story-facts p { margin: 0; }

.login-card {
  position: relative;
  width: min(100%, 470px);
  justify-self: end;
  padding: clamp(28px, 3.5vw, 48px);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-shell);
  background: var(--surface-glass);
  box-shadow: inset 0 1px 0 var(--highlight-card), var(--shadow-3);
  backdrop-filter: var(--chrome-filter);
  transition: background-color 420ms var(--ease-soft), border-color 420ms var(--ease-soft), transform 240ms var(--ease-spring);
}

.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 42px;
  width: 110px;
  height: 1px;
  background: var(--accent);
  opacity: 0.8;
}

.login-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 30px; }
.login-head h2 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 34px; font-weight: 500; }
.login-head .section-kicker { margin-bottom: 8px; }
.auth-description { max-width: 300px; margin: 10px 0 0; color: var(--text-muted); font-size: 11px; line-height: 1.65; }

.avatar-trigger {
  display: grid;
  gap: 6px;
  justify-items: center;
  width: 74px;
  padding: 0;
  color: var(--text-secondary);
  border: 0;
  background: transparent;
  font-size: 10px;
}

.avatar-trigger img {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border: 2px solid var(--accent);
  border-radius: 50%;
  box-shadow: 0 10px 22px var(--shadow);
  transition: transform 260ms var(--ease-spring);
}

.avatar-trigger:hover img { transform: translateY(-3px) scale(1.03); }

.field-label { display: block; margin: 18px 0 8px; color: var(--text-secondary); font-size: 12px; font-weight: 700; }

.field-shell {
  display: flex;
  align-items: center;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface-muted);
  transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.field-shell:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring); }
.field-shell input { width: 100%; min-width: 0; height: 50px; padding: 0 15px; color: var(--text-primary); border: 0; outline: 0; background: transparent; }
.field-shell input::placeholder { color: var(--text-muted); }
.phone-field > span { padding-left: 15px; color: var(--text-secondary); font-size: 13px; }
.phone-field input { padding-left: 11px; }

.field-error { min-height: 18px; margin: 5px 0 0; color: var(--danger); font-size: 11px; line-height: 1.4; }
.share-dialog .field-error:not(:empty) { margin-top: 8px; padding: 9px 11px; border-left: 3px solid var(--danger); border-radius: 6px; background: color-mix(in srgb, var(--danger) 8%, var(--surface-muted)); font-weight: 650; line-height: 1.5; }
.share-dialog input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 14%, transparent); }

.account-message { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; padding: 10px 12px; color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 28%, transparent); border-radius: 10px; background: color-mix(in srgb, var(--danger) 7%, transparent); font-size: 11px; line-height: 1.5; }
.account-message[hidden], .account-message button[hidden], .registration-fields[hidden] { display: none; }
.account-message button { flex: 0 0 auto; padding: 0; color: var(--accent); border: 0; background: transparent; font-size: 11px; font-weight: 700; }
.account-message[data-tone="info"] { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 28%, transparent); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.registration-fields { display: grid; gap: 0; }
.registration-field[hidden] { display: none; }
.registration-note { margin: 0; color: var(--text-muted); font-size: 11px; line-height: 1.6; }

.slider-wrap { margin-top: 18px; }
.slider-head { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--text-secondary); font-size: 12px; }
.slider-head strong { color: var(--text-muted); font-weight: 500; }
.slider-wrap.is-verified .slider-head strong { color: var(--accent); }

.slider-track {
  position: relative;
  height: 52px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface-muted);
}

.slider-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--accent); opacity: 0.18; }
.slider-hint { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-muted); font-size: 12px; pointer-events: none; }

.slider-track input {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0.01;
  cursor: ew-resize;
}

.slider-track::after {
  content: "›";
  position: absolute;
  z-index: 1;
  left: 5px;
  top: 5px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--accent-ink);
  border-radius: 9px;
  background: var(--accent);
  font-size: 24px;
  transform: translateX(var(--slider-offset, 0));
  transition: transform 70ms linear;
  box-shadow: 0 8px 18px var(--shadow);
}

.slider-wrap.is-verified .slider-track::after { content: "✓"; }
.code-row { display: grid; grid-template-columns: minmax(0, 1fr) 126px; gap: 10px; }

.primary-button,
.secondary-button,
.profile-shortcut,
.logout-button,
.mobile-menu {
  min-height: 48px;
  border-radius: var(--radius-control);
  font-weight: 700;
  transition: transform 220ms var(--ease-spring), box-shadow 220ms ease, background-color 220ms ease, border-color 220ms ease;
}

.primary-button {
  padding: 0 20px;
  color: var(--accent-ink);
  border: 1px solid var(--accent);
  background: var(--accent);
  box-shadow: 0 12px 24px var(--accent-shadow), inset 0 1px 0 var(--button-highlight);
}

.secondary-button {
  padding: 0 16px;
  color: var(--text-primary);
  border: 1px solid var(--line);
  background: var(--surface-muted);
}

.primary-button:hover,
.secondary-button:hover,
.profile-shortcut:hover,
.logout-button:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.primary-button:active,
.secondary-button:active,
.profile-shortcut:active,
.logout-button:active { transform: scale(0.985); }
.primary-button:disabled,
.secondary-button:disabled { cursor: not-allowed; opacity: 0.52; transform: none; }
.compact { min-height: 40px; padding: 0 15px; font-size: 12px; }

.login-submit { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 54px; margin-top: 22px; }
.login-submit span { font-size: 25px; font-weight: 400; }
.development-login { margin: 0 0 18px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface-muted); }
.development-login p { display: flex; justify-content: space-between; gap: 10px; margin: 0 0 10px; color: var(--text-primary); font-size: 12px; }
.development-login p span { color: var(--text-muted); font-size: 10px; }
.development-login-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.development-login-actions .secondary-button { min-height: 40px; padding: 0 10px; font-size: 11px; }
.auth-switch { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 15px; color: var(--text-muted); font-size: 11px; }
.auth-switch button { padding: 2px; color: var(--accent); border: 0; border-bottom: 1px solid transparent; background: transparent; font-size: 11px; font-weight: 700; }
.auth-switch button:hover { border-bottom-color: currentColor; }
.prototype-note { margin: 16px 0 0; color: var(--text-muted); font-size: 11px; line-height: 1.6; text-align: center; }
.prototype-note strong { color: var(--text-secondary); }

.reveal { --reveal-x: 0px; opacity: 0; animation: revealIn 1050ms var(--ease-soft) forwards; }
.reveal-1 { --reveal-x: -22px; animation-delay: 60ms; }
.reveal-2 { --reveal-x: -12px; animation-delay: 180ms; }
.reveal-3 { --reveal-x: -8px; animation-delay: 320ms; }
.reveal-4 { --reveal-x: 28px; animation-delay: 120ms; }

@keyframes revealIn {
  from { opacity: 0; transform: translate3d(var(--reveal-x), 28px, 0) scale(0.975); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.app-view { position: relative; z-index: 8; min-height: 100dvh; }
.app-view.is-deleting { animation: accountExit 480ms var(--ease-soft) forwards; }
@keyframes accountExit { to { opacity: 0; transform: scale(0.985) translateY(14px); filter: blur(4px); } }

.sidebar {
  position: fixed;
  z-index: 30;
  inset: 18px auto 18px 18px;
  display: flex;
  flex-direction: column;
  width: 254px;
  padding: 22px 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface-glass);
  box-shadow: inset 0 1px 0 var(--highlight), var(--shadow-2);
  backdrop-filter: var(--chrome-filter);
}

.sidebar-brand { padding: 0 6px 20px; border-bottom: 1px solid var(--line); }
.signed-user { display: flex; align-items: center; gap: 12px; margin: 18px 0 8px; padding: 12px; border-radius: 15px; background: var(--surface-muted); }
.signed-user img { width: 42px; height: 42px; object-fit: cover; border: 1px solid var(--line-strong); border-radius: 50%; }
.signed-user div { display: grid; gap: 3px; min-width: 0; }
.signed-user strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.signed-user span { color: var(--accent); font-size: 11px; }
.side-nav { display: grid; gap: 6px; margin-top: 16px; }
.side-nav p { margin: 0 0 6px; padding: 0 9px; color: var(--text-muted); font-size: 10px; font-weight: 700; letter-spacing: 0.14em; }
.nav-item { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 46px; padding: 0 12px; color: var(--text-secondary); border: 1px solid transparent; border-radius: var(--radius-control); background: transparent; text-align: left; transition: transform 180ms var(--ease-spring), color 180ms ease, background-color 180ms ease, border-color 180ms ease; }
.nav-item span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--surface-muted); font-family: Georgia, serif; font-size: 10px; }
.nav-item:hover { color: var(--text-primary); transform: translateX(3px); }
.nav-item.is-active { color: var(--accent-ink); border-color: transparent; background: var(--accent); box-shadow: 0 10px 22px var(--shadow); }
.nav-item.is-active span { background: var(--active-mark); }
.sidebar-note { margin-top: auto; padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-muted); }
.sidebar-note span { color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: 0.1em; }
.sidebar-note p { margin: 8px 0 0; color: var(--text-muted); font-size: 10px; line-height: 1.65; }
.logout-button { min-height: 42px; margin-top: 10px; color: var(--text-secondary); border: 1px solid var(--line); background: transparent; font-size: 12px; }

.app-main { min-height: 100vh; margin-left: 290px; padding: 18px 28px 56px 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 72px; padding: 10px 14px 10px 22px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--header); box-shadow: inset 0 1px 0 var(--highlight-chrome), var(--shadow-2); backdrop-filter: var(--chrome-filter); }
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-left > div { display: grid; gap: 3px; }
.topbar-left strong { font-family: Georgia, "Songti SC", serif; font-size: 19px; font-weight: 500; }
.topbar-left span { color: var(--text-muted); font-size: 10px; }
.profile-shortcut { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 4px 12px 4px 5px; color: var(--text-secondary); border: 1px solid var(--line); background: var(--surface-muted); font-size: 11px; }
.profile-shortcut img { width: 32px; height: 32px; object-fit: cover; border-radius: 50%; }
.mobile-menu { display: none; padding: 0 14px; border: 1px solid var(--line); background: var(--surface-muted); }

.page { width: min(1420px, 100%); margin: 0 auto; padding-top: 28px; }
.welcome-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 30px;
  min-height: 310px;
  padding: clamp(36px, 4.5vw, 68px);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-shell);
  background: var(--hero-surface);
  box-shadow: inset 0 1px 0 var(--highlight-hero), var(--shadow-3);
  backdrop-filter: var(--content-filter);
}

.welcome-copy { position: relative; z-index: 2; align-self: center; }
.welcome-copy h1 { max-width: 720px; font-size: clamp(42px, 5.4vw, 78px); line-height: 1.02; }
.welcome-copy > p:last-child { max-width: 650px; margin: 24px 0 0; color: var(--text-secondary); font-size: 15px; line-height: 1.75; }
.welcome-aside { position: relative; z-index: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-content: center; }
.welcome-stat { display: grid; gap: 8px; min-height: 128px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface-muted); box-shadow: inset 0 1px 0 var(--highlight-soft); }
.welcome-stat strong { font-family: Georgia, serif; font-size: 42px; font-weight: 500; }
.welcome-stat span { color: var(--text-secondary); font-size: 11px; }
.welcome-ring { position: absolute; right: -88px; top: -160px; width: 490px; height: 490px; border: 72px solid var(--line); border-radius: 50%; opacity: 0.38; }

.tool-section { margin-top: 18px; padding: clamp(22px, 3vw, 36px); border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--card-surface); box-shadow: inset 0 1px 0 var(--highlight-chrome), var(--shadow-2); backdrop-filter: var(--content-filter); }
.section-header { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.section-header .section-kicker { margin-bottom: 7px; }
.section-header h2 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 30px; font-weight: 500; }
.section-header > p { max-width: 360px; margin: 0; color: var(--text-secondary); font-size: 11px; line-height: 1.7; text-align: right; }
.command-bar { display: grid; grid-template-columns: auto minmax(160px, 1fr) auto; align-items: center; gap: 16px; margin: 24px 0 20px; padding: 8px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-muted); }
.filter-group { display: flex; gap: 4px; }
.filter-button { min-height: 38px; padding: 0 16px; color: var(--text-secondary); border: 0; border-radius: 10px; background: transparent; font-size: 12px; transition: color 180ms ease, background-color 180ms ease, transform 180ms var(--ease-spring); }
.filter-button:hover { color: var(--text-primary); }
.filter-button:active { transform: scale(0.97); }
.filter-button.is-active { color: var(--accent-ink); background: var(--accent); }
.sort-group { display: flex; justify-self: center; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: color-mix(in srgb, var(--surface-muted) 76%, transparent); box-shadow: inset 0 1px 0 var(--highlight-soft); }
.sort-choice { min-width: 62px; min-height: 30px; padding: 0 14px; color: var(--text-muted); border: 0; border-radius: 999px; background: transparent; font-size: 11px; transition: color 180ms ease, background-color 180ms ease, box-shadow 180ms ease, transform 180ms var(--ease-spring); }
.sort-choice:hover:not(:disabled) { color: var(--text-primary); }
.sort-choice:active:not(:disabled) { transform: scale(0.97); }
.sort-choice.is-active { color: var(--accent-ink); background: var(--accent); box-shadow: 0 3px 10px color-mix(in srgb, var(--accent) 28%, transparent); }
.sort-choice:disabled { cursor: not-allowed; opacity: 0.45; }
.search-box { display: flex; align-items: center; gap: 10px; min-width: min(320px, 38%); min-height: 40px; padding: 0 12px; border-left: 1px solid var(--line); }
.search-box span { color: var(--text-muted); font-size: 10px; letter-spacing: 0.1em; }
.search-box input { width: 100%; min-width: 0; color: var(--text-primary); border: 0; outline: 0; background: transparent; }
.search-box input::placeholder { color: var(--text-muted); }

.tool-list { display: grid; gap: 10px; }
.tool-row { position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 18px; align-items: center; min-height: 96px; padding: 15px 18px 15px 16px; overflow: visible; border: 1px solid var(--tool-web-line); border-left: 4px solid var(--tool-web-accent); border-radius: 16px; background: var(--tool-web-surface); box-shadow: inset 0 1px 0 var(--highlight-soft); transition: transform 260ms var(--ease-spring), border-color 220ms ease, box-shadow 220ms ease, background-color 220ms ease; }
.tool-row[data-tool-type="LOCAL"] { border-color: var(--tool-local-line); border-left-color: var(--tool-local-accent); background: var(--tool-local-surface); }
.tool-row.is-disabled { opacity: 0.66; border-color: var(--line); border-left-color: var(--text-muted); background: var(--surface-muted); }
.tool-row.is-disabled:hover { transform: none; box-shadow: inset 0 1px 0 var(--highlight-soft); }
.tool-row:hover { z-index: 2; transform: translateX(4px); box-shadow: var(--shadow-1), inset 0 1px 0 var(--highlight-medium); }
.tool-row:active { transform: translateX(1px) scale(0.996); }
.tool-meta { display: flex; align-self: stretch; align-items: center; gap: 9px; }
.tool-index { color: var(--tool-web-accent); font-family: var(--font-display); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; }
.tool-row[data-tool-type="LOCAL"] .tool-index { color: var(--tool-local-accent); }
.tool-color-marker { width: 10px; min-width: 10px; height: 38px; padding: 0; border: 1px solid color-mix(in srgb, var(--text-muted) 22%, transparent); border-radius: 999px; background: var(--tool-color, transparent); box-shadow: inset 0 1px 1px var(--highlight-medium), 0 2px 7px color-mix(in srgb, var(--text-primary) 24%, transparent); transition: width 180ms var(--ease-spring), transform 180ms var(--ease-spring), background-color 180ms ease; }
.tool-color-marker:hover, .tool-color-marker[aria-expanded="true"] { width: 13px; transform: scaleY(1.06); }
.tool-color-menu { position: absolute; z-index: 8; top: 50%; left: 63px; display: flex; align-items: center; gap: 7px; padding: 9px 10px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface-solid); box-shadow: var(--shadow-2); transform: translateY(-50%); }
.color-option { width: 22px; height: 22px; padding: 0; border: 2px solid transparent; border-radius: 999px; background: var(--tool-color, transparent); box-shadow: inset 0 1px 1px var(--highlight-strong), 0 2px 6px color-mix(in srgb, var(--text-primary) 20%, transparent); transition: transform 160ms var(--ease-spring), border-color 160ms ease; }
.color-option:hover { transform: scale(1.15); }
.color-option[aria-selected="true"] { border-color: var(--text-primary); transform: scale(1.08); }
.color-option-clear { display: grid; place-items: center; color: var(--text-muted); border-color: var(--line-strong); background: transparent; font-size: 17px; line-height: 1; }
.color-slot-1 { --tool-color: var(--tool-color-1); }
.color-slot-2 { --tool-color: var(--tool-color-2); }
.color-slot-3 { --tool-color: var(--tool-color-3); }
.color-slot-4 { --tool-color: var(--tool-color-4); }
.color-slot-5 { --tool-color: var(--tool-color-5); }
.color-slot-6 { --tool-color: var(--tool-color-6); }
.color-slot-7 { --tool-color: var(--tool-color-7); }
.color-slot-8 { --tool-color: var(--tool-color-8); }
.color-slot-9 { --tool-color: var(--tool-color-9); }
.color-slot-10 { --tool-color: var(--tool-color-10); }
.tool-row.is-customizable { cursor: grab; }
.tool-row.is-customizable:active { cursor: grabbing; }
.tool-row.is-dragging { opacity: 0.48; transform: scale(0.99); }
.tool-row.is-drop-before,
.tool-row.is-drop-after { z-index: 3; }
.tool-row.is-drop-before::before,
.tool-row.is-drop-after::after {
  content: "";
  position: absolute;
  z-index: 5;
  left: 16px;
  right: 16px;
  height: 3px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--highlight-medium), 0 5px 14px color-mix(in srgb, var(--accent) 30%, transparent);
  pointer-events: none;
  animation: toolDropLineIn 160ms var(--ease-spring) both;
}
.tool-row.is-drop-before::before { top: -7px; }
.tool-row.is-drop-after::after { bottom: -7px; }
@keyframes toolDropLineIn {
  from { opacity: 0; transform: scaleX(0.76); }
  to { opacity: 1; transform: scaleX(1); }
}
.tool-copy { min-width: 0; }
.tool-title-line { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tool-copy h3 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(19px, 1.8vw, 24px); font-weight: 500; line-height: 1.25; }
.tool-type { display: inline-flex; flex: 0 0 auto; justify-content: center; min-width: 44px; padding: 5px 8px; color: var(--tool-web-accent); border: 1px solid var(--tool-web-line); border-radius: 99px; background: var(--tool-web-badge); font-family: "Microsoft YaHei", sans-serif; font-size: 10px; font-weight: 700; letter-spacing: 0.08em; }
.tool-row[data-tool-type="LOCAL"] .tool-type { color: var(--tool-local-accent); border-color: var(--tool-local-line); border-radius: 8px; background: var(--tool-local-badge); }
.tool-status { display: inline-flex; flex: 0 0 auto; padding: 5px 8px; color: var(--text-muted); border: 1px solid var(--line); border-radius: 99px; background: var(--surface-muted); font-size: 10px; font-weight: 700; }
.tool-copy p { max-width: 780px; margin: 7px 0 0; color: var(--text-secondary); font-size: 12px; line-height: 1.65; }
.tool-actions { display: flex; justify-content: flex-end; gap: 8px; white-space: nowrap; }
.tool-action { min-height: 40px; padding: 0 15px; color: var(--text-primary); border: 1px solid var(--line); border-radius: 10px; background: transparent; font-size: 11px; font-weight: 700; transition: transform 180ms var(--ease-spring), color 180ms ease, background-color 180ms ease, border-color 180ms ease; }
.tool-action:hover { transform: translateY(-2px); border-color: var(--accent); }
.tool-action.primary { color: var(--accent-ink); border-color: var(--accent); background: var(--accent); }
.tool-action:disabled { color: var(--text-muted); border-color: var(--line); background: var(--surface-muted); cursor: not-allowed; transform: none; }
.tool-family-row { grid-template-columns: 56px minmax(250px, 0.72fr) minmax(560px, 1.28fr); min-height: 232px; align-items: stretch; }
.tool-family-row .tool-meta { align-items: center; }
.tool-family-copy { align-self: center; }
.tool-family-copy .tool-title-line { flex-wrap: wrap; }
.tool-family-statistics { min-height: 30px; margin-left: auto; padding-inline: 11px; border-radius: 8px; }
.tool-family-scenarios { display: grid; align-content: center; min-width: 0; border-left: 1px solid var(--line); }
.tool-family-scenario { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; min-height: 50px; padding: 6px 0 6px 18px; border-bottom: 1px solid var(--line); }
.tool-family-scenario:last-child { border-bottom: 0; }
.tool-family-identity { display: grid; min-width: 0; gap: 3px; }
.tool-family-identity strong { color: var(--text-primary); font-size: 12px; }
.tool-family-identity span { overflow: hidden; color: var(--text-muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.tool-family-scenario .tool-action { min-height: 34px; padding-inline: 12px; }
.empty-state { grid-column: 1 / -1; padding: 52px 20px; border: 1px dashed var(--line-strong); border-radius: var(--radius-card); color: var(--text-secondary); text-align: center; }
.empty-state strong { display: block; margin-bottom: 8px; color: var(--text-primary); font-family: Georgia, "Songti SC", serif; font-size: 24px; font-weight: 500; }

.surface-enter { opacity: 0; animation: surfaceEnter 720ms var(--ease-soft) forwards; }
.surface-enter:nth-child(2) { animation-delay: 80ms; }
.surface-enter:nth-child(3) { animation-delay: 160ms; }
@keyframes surfaceEnter { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

.page-intro { padding: clamp(30px, 5vw, 64px); border: 1px solid var(--line-strong); border-radius: var(--radius-shell); background: var(--hero-surface); box-shadow: var(--shadow-3); backdrop-filter: var(--content-filter); }
.page-intro h1 { font-size: clamp(42px, 5vw, 74px); }
.page-intro > p:last-child { max-width: 720px; margin: 20px 0 0; color: var(--text-secondary); line-height: 1.8; }
.admin-overview { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.admin-stat { display: grid; gap: 8px; min-height: 118px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--card-surface); box-shadow: var(--shadow-2); backdrop-filter: var(--content-filter); }
.admin-stat span { color: var(--text-muted); font-size: 10px; letter-spacing: 0.06em; }
.admin-stat strong { color: var(--accent); font-family: Georgia, serif; font-size: 38px; font-weight: 500; }
.admin-section { margin-top: 18px; }
.admin-section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 0 4px 4px; }
.admin-section-head h2 { margin: 4px 0 0; font-family: Georgia, "Songti SC", serif; font-size: 27px; font-weight: 500; }
.admin-section-head > span { max-width: 420px; color: var(--text-muted); font-size: 10px; line-height: 1.6; text-align: right; }
.admin-section-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.admin-section-actions > span { max-width: 420px; color: var(--text-muted); font-size: 10px; line-height: 1.6; text-align: right; }
.data-panel { margin-top: 12px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--card-surface); box-shadow: var(--shadow-2); backdrop-filter: var(--content-filter); }
.employee-table { width: 100%; min-width: 740px; border-collapse: collapse; }
.employee-table caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.employee-table th,
.employee-table td { padding: 18px 22px; border-bottom: 1px solid var(--line); text-align: left; }
.employee-table th { color: var(--text-muted); font-size: 10px; letter-spacing: 0.08em; }
.employee-table td { color: var(--text-secondary); font-size: 12px; }
.employee-table td:first-child { color: var(--text-primary); font-weight: 700; }
.employee-table tr:last-child td { border-bottom: 0; }
.role-chip { display: inline-flex; padding: 5px 9px; border: 1px solid var(--line); border-radius: 99px; color: var(--accent); background: var(--surface-muted); font-size: 10px; }
.status-text { color: var(--accent); }
.status-text.is-off { color: var(--text-muted); }
.person-cell { display: flex; align-items: center; gap: 12px; }
.person-cell > div { display: grid; gap: 4px; }
.person-cell span { color: var(--text-muted); font-size: 9px; font-weight: 400; }
.employee-avatar { width: 40px; height: 40px; object-fit: cover; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface-muted); }
.table-action { min-height: 36px; padding: 0 13px; color: var(--text-primary); border: 1px solid var(--line); border-radius: 9px; background: var(--surface-muted); font-size: 10px; font-weight: 700; transition: transform 180ms var(--ease-spring), border-color 180ms ease, color 180ms ease; }
.table-action:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.table-action.danger { color: var(--danger); }
.table-action.danger:hover { color: var(--accent-ink); border-color: var(--danger); background: var(--danger); }
.table-action:disabled { color: var(--text-muted); border-color: var(--line); cursor: not-allowed; transform: none; }
.table-placeholder { color: var(--text-muted); text-align: center; }
.admin-tool-table td:first-child { min-width: 260px; }
.table-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-tool-name { display: grid; gap: 5px; }
.admin-tool-name span { max-width: 460px; color: var(--text-muted); font-size: 10px; font-weight: 400; line-height: 1.5; }

.tool-dialog { width: min(680px, calc(100% - 32px)); }
.tool-access-dialog { width: min(680px, calc(100% - 32px)); }
.share-dialog { width: min(600px, calc(100% - 32px)); }
.danger-dialog { width: min(580px, calc(100% - 32px)); }
.delete-consequences { margin-top: 24px; padding: 18px; border: 1px solid color-mix(in srgb, var(--danger) 34%, var(--line)); border-radius: 14px; background: color-mix(in srgb, var(--danger) 7%, var(--surface-muted)); }
.delete-consequences strong { color: var(--danger); font-size: 14px; }
.delete-consequences p { margin: 8px 0 0; color: var(--text-secondary); font-size: 11px; line-height: 1.7; }
.danger-dialog[open] .delete-consequences { animation: dangerReveal 620ms 120ms var(--ease-soft) both; }
@keyframes dangerReveal { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
.share-note { margin: 8px 0 0; color: var(--text-muted); font-size: 10px; line-height: 1.65; }
.share-result { display: block; margin-top: 14px; padding: 13px 14px; overflow-wrap: anywhere; color: var(--accent); border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface-muted); font-size: 11px; line-height: 1.6; user-select: all; }
.share-result[hidden] { display: none; }
.tool-form-grid { display: grid; grid-template-columns: minmax(140px, 0.34fr) minmax(0, 0.66fr); gap: 12px; }
.tool-form-field { display: grid; gap: 8px; margin-top: 18px; color: var(--text-secondary); font-size: 11px; font-weight: 700; }
.tool-form-field small { color: var(--text-muted); font-size: 9px; font-weight: 400; }
.tool-form-field input,
.tool-form-field select,
.tool-form-field textarea { width: 100%; min-width: 0; color: var(--text-primary); border: 1px solid var(--line); border-radius: var(--radius-control); outline: 0; background: var(--surface-muted); font: inherit; font-weight: 500; }
.tool-form-field input,
.tool-form-field select { height: 48px; padding: 0 14px; }
.tool-form-field textarea { min-height: 108px; padding: 13px 14px; resize: vertical; line-height: 1.6; }
.tool-form-field input:focus,
.tool-form-field select:focus,
.tool-form-field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring); }
.tool-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.employee-tool-selection { margin-top: 18px; }
.employee-tool-selection[hidden] { display: none; }
.employee-tool-selection > p { margin: 9px 2px 0; color: var(--text-muted); font-size: 10px; line-height: 1.6; }
.employee-tool-picker { position: relative; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface-muted); }
.employee-tool-picker[open] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring); }
.employee-tool-picker summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 48px; padding: 0 14px; color: var(--text-secondary); cursor: pointer; font-size: 11px; font-weight: 700; list-style: none; }
.employee-tool-picker summary::-webkit-details-marker { display: none; }
.employee-tool-picker summary::after { content: "⌄"; margin-left: auto; color: var(--accent); font-size: 16px; transition: transform 160ms ease; }
.employee-tool-picker[open] summary::after { transform: rotate(180deg); }
.employee-tool-picker summary strong { color: var(--accent); font-size: 10px; }
.employee-tool-options { display: grid; max-height: 300px; overflow-y: auto; padding: 8px; border-top: 1px solid var(--line); }
.employee-tool-option { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 44px; padding: 8px 10px; border-radius: 9px; color: var(--text-primary); cursor: pointer; font-size: 11px; }
.employee-tool-option:hover { background: color-mix(in srgb, var(--accent) 8%, var(--surface-muted)); }
.employee-tool-option input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.employee-tool-option small { color: var(--text-muted); font-size: 9px; }

.profile-layout { display: grid; grid-template-columns: minmax(260px, 0.36fr) minmax(0, 0.64fr); gap: 16px; margin-top: 18px; }
.profile-card,
.security-card { border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--card-surface); box-shadow: var(--shadow-2); backdrop-filter: var(--content-filter); }
.profile-card { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 360px; padding: 30px; text-align: center; }
.profile-card img { width: 112px; height: 112px; object-fit: cover; border: 3px solid var(--accent); border-radius: 50%; box-shadow: 0 18px 36px var(--shadow); }
.profile-avatar-button { display: grid; justify-items: center; gap: 10px; padding: 4px 8px; color: var(--accent); border: 0; border-radius: 18px; background: transparent; cursor: pointer; font: inherit; }
.profile-avatar-button img { transition: transform 160ms ease, box-shadow 160ms ease; }
.profile-avatar-button span { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; }
.profile-avatar-button:hover img { transform: translateY(-2px) scale(1.02); box-shadow: 0 22px 42px var(--shadow-deep); }
.profile-avatar-button:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 4px; }
.profile-card p { margin: 20px 0 5px; color: var(--text-muted); font-size: 10px; letter-spacing: 0.1em; }
.profile-card h2 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 30px; font-weight: 500; }
.profile-card > span { margin-top: 7px; color: var(--accent); font-size: 12px; }
.security-card { padding: 28px; }
.security-card h2 { margin: 0 0 22px; font-family: Georgia, "Songti SC", serif; font-size: 26px; font-weight: 500; }
.security-list { display: grid; gap: 10px; }
.security-item { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 82px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-muted); }
.security-item > div { display: grid; gap: 6px; }
.security-item strong { font-size: 12px; }
.security-item span { color: var(--text-muted); font-size: 10px; }
.security-item b { color: var(--accent); font-size: 11px; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 18px; padding: 18px; border: 1px solid color-mix(in srgb, var(--danger) 42%, var(--line)); border-radius: 14px; background: color-mix(in srgb, var(--danger) 7%, var(--surface-muted)); }
.danger-zone > div { display: grid; gap: 6px; }
.danger-zone strong { color: var(--danger); font-size: 12px; }
.danger-zone span { max-width: 520px; color: var(--text-muted); font-size: 10px; line-height: 1.6; }
.danger-button { min-height: 44px; padding: 0 18px; flex: 0 0 auto; color: var(--accent-ink); border: 1px solid var(--danger); border-radius: var(--radius-control); background: var(--danger); font-weight: 700; transition: transform 220ms var(--ease-spring), box-shadow 220ms ease, opacity 180ms ease; }
.danger-button:hover { transform: translateY(-2px); box-shadow: 0 12px 24px var(--shadow); }
.danger-button:active { transform: scale(0.975); }
.danger-button:disabled { cursor: not-allowed; opacity: 0.52; transform: none; }

.modal {
  width: min(760px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  margin: auto;
  padding: 26px;
  overflow: auto;
  color: var(--text-primary);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-shell);
  background: var(--surface-solid);
  box-shadow: var(--shadow-3), inset 0 1px 0 var(--highlight);
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  transition: opacity 240ms var(--ease-soft), transform 300ms var(--ease-spring), display 240ms allow-discrete, overlay 240ms allow-discrete;
}

.modal[open] { opacity: 1; transform: translateY(0) scale(1); }
@starting-style { .modal[open] { opacity: 0; transform: translateY(14px) scale(0.98); } }
.modal::backdrop { background: var(--overlay-modal); backdrop-filter: blur(8px); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.dialog-head .section-kicker { margin-bottom: 6px; }
.dialog-head h3 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 30px; font-weight: 500; }
.dialog-head span { display: block; margin-top: 7px; color: var(--text-muted); font-size: 11px; }
.close-button { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 auto; color: var(--text-secondary); border: 1px solid var(--line); border-radius: 12px; background: var(--surface-muted); font-size: 22px; }
.avatar-dialog { width: min(1100px, calc(100% - 40px)); padding: 36px 40px 28px; }
.avatar-dialog .dialog-head h3 { font-size: 40px; }
.avatar-dialog .dialog-head span { font-size: 13px; }
.avatar-dialog .close-button { border-radius: 50%; }
.avatar-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); column-gap: 24px; row-gap: 30px; margin: 32px 0 28px; }
.avatar-option { min-width: 0; min-height: 166px; padding: 0 4px; color: var(--text-secondary); border: 0; border-radius: 0; outline: 0; background: transparent; font-size: 13px; transition: transform 220ms var(--ease-spring), color 180ms ease; }
.avatar-option img { width: 128px; height: 128px; margin: 0 auto 11px; padding: 4px; object-fit: cover; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-solid); box-shadow: inset 0 1px 0 var(--highlight); transition: border-color 180ms ease, box-shadow 180ms ease; }
.avatar-option span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar-option:hover { transform: translateY(-3px); color: var(--text-primary); }
.avatar-option:hover img { border-color: var(--line-strong); box-shadow: inset 0 1px 0 var(--highlight), 0 12px 25px var(--shadow); }
.avatar-option:focus-visible img { box-shadow: 0 0 0 3px var(--focus-ring); }
.avatar-option.is-selected { color: var(--accent); }
.avatar-option.is-selected img { border-color: var(--accent); box-shadow: 0 0 0 2px var(--surface-solid), 0 0 0 4px var(--accent), 0 14px 28px var(--shadow); }
.avatar-dialog-foot { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-top: 24px; border-top: 1px solid var(--line); }
.avatar-dialog-foot .compact { min-height: 48px; padding: 0 22px; font-size: 13px; }
.avatar-dialog-foot > .primary-button { min-width: 176px; }
.round-nav { display: flex; align-items: center; gap: 18px; }
.round-nav span { min-width: 82px; color: var(--text-secondary); font-size: 12px; text-align: center; }

.tutorial-dialog { width: min(620px, calc(100% - 32px)); }
.tutorial-steps { display: grid; gap: 10px; margin: 24px 0; }
.tutorial-steps > div { display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-muted); }
.tutorial-steps b { color: var(--accent); font-family: Georgia, serif; font-size: 18px; }
.tutorial-steps p { display: grid; gap: 5px; margin: 0; }
.tutorial-steps strong { font-size: 12px; }
.tutorial-steps span { color: var(--text-secondary); font-size: 10px; line-height: 1.6; }
.tutorial-dialog > .primary-button { width: 100%; }

.loading-layer { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; background: var(--overlay-loading); backdrop-filter: blur(14px); }
.loading-card { display: grid; justify-items: center; width: min(320px, calc(100% - 40px)); padding: 36px; border: 1px solid var(--line-strong); border-radius: var(--radius-shell); background: var(--surface-solid); box-shadow: var(--shadow-3); text-align: center; }
.loading-orbit { width: 52px; height: 52px; margin-bottom: 20px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: loadingSpin 900ms linear infinite; }
.loading-card strong { font-family: Georgia, "Songti SC", serif; font-size: 22px; font-weight: 500; }
.loading-card p { margin: 8px 0 0; color: var(--text-muted); font-size: 11px; }
@keyframes loadingSpin { to { transform: rotate(360deg); } }

.toast-region { position: fixed; z-index: 120; right: 24px; bottom: 24px; display: grid; gap: 10px; width: min(360px, calc(100% - 48px)); }
.toast { padding: 15px 18px; color: var(--text-primary); border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface-solid); box-shadow: var(--shadow-1); animation: toastIn 320ms var(--ease-spring); }
.toast strong { display: block; margin-bottom: 4px; color: var(--accent); font-size: 11px; }
.toast span { color: var(--text-secondary); font-size: 11px; line-height: 1.5; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }

.brand-mark,
.story-copy h1,
.story-facts strong,
.login-head h2,
.topbar-left strong,
.welcome-copy h1,
.welcome-stat strong,
.section-header h2,
.tool-index,
.tool-copy h3,
.empty-state strong,
.page-intro h1,
.profile-card h2,
.security-card h2,
.dialog-head h3,
.tutorial-steps b,
.loading-card strong { font-family: var(--font-display); }

.story-copy h1,
.login-head h2,
.topbar-left strong,
.welcome-copy h1,
.section-header h2,
.tool-copy h3,
.empty-state strong,
.page-intro h1,
.profile-card h2,
.security-card h2,
.dialog-head h3,
.loading-card strong {
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
}

[data-theme="tech"] .global-header,
[data-theme="tech"] .login-card,
[data-theme="tech"] .sidebar,
[data-theme="tech"] .topbar {
  border-color: var(--highlight-strong);
  border-radius: 26px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--highlight-strong) 58%, transparent), transparent 40%),
    linear-gradient(180deg, transparent 58%, color-mix(in srgb, var(--accent) 4%, transparent)),
    var(--header);
  box-shadow:
    inset 0 1px 0 var(--highlight-strong),
    inset 0 -1px 0 color-mix(in srgb, var(--accent) 9%, transparent),
    var(--shadow-2);
  backdrop-filter: var(--chrome-filter);
}

[data-theme="tech"] .ambient-scrim {
  background:
    radial-gradient(circle at 16% 4%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 30rem),
    radial-gradient(circle at 88% 10%, color-mix(in srgb, var(--tool-local-accent) 13%, transparent), transparent 28rem),
    var(--scrim);
}

[data-theme="tech"] .theme-switch,
[data-theme="tech"] .command-bar,
[data-theme="tech"] .profile-shortcut,
[data-theme="tech"] .signed-user {
  border-color: color-mix(in srgb, var(--highlight-strong) 72%, var(--line));
  border-radius: 18px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--highlight-strong) 50%, transparent), transparent 46%),
    var(--surface-glass);
  box-shadow: inset 0 1px 0 var(--highlight-chrome), 0 8px 26px var(--shadow);
  backdrop-filter: var(--chrome-filter);
}

[data-theme="tech"] .theme-choice,
[data-theme="tech"] .filter-button,
[data-theme="tech"] .tool-action,
[data-theme="tech"] .table-action,
[data-theme="tech"] .mobile-menu,
[data-theme="tech"] .logout-button { border-radius: 999px; }

[data-theme="tech"] .welcome-panel,
[data-theme="tech"] .page-intro {
  border-radius: 34px;
  background: var(--hero-surface);
  box-shadow: inset 0 1px 0 var(--highlight-hero), var(--shadow-3);
  backdrop-filter: none;
}

[data-theme="tech"] .tool-section,
[data-theme="tech"] .admin-stat,
[data-theme="tech"] .data-panel {
  border-color: color-mix(in srgb, var(--line) 82%, var(--highlight-card));
  border-radius: 26px;
  background: var(--card-surface);
  box-shadow: inset 0 1px 0 var(--highlight-card), var(--shadow-1);
  backdrop-filter: none;
}

[data-theme="dark"] .tool-row { backdrop-filter: blur(18px) saturate(1.08); }
[data-theme="light"] .tool-row { box-shadow: inset 0 1px 0 var(--highlight-card), 0 8px 24px var(--shadow); }
[data-theme="tech"] .tool-row {
  border-radius: 22px;
  box-shadow: inset 0 1px 0 var(--highlight-card), 0 8px 28px var(--shadow);
  backdrop-filter: none;
}
[data-theme="tech"] .tool-row:hover { transform: translateY(-2px) scale(1.002); box-shadow: inset 0 1px 0 var(--highlight-strong), var(--shadow-2); }
[data-theme="tech"] .tool-row:active { transform: translateY(0) scale(0.992); }
[data-theme="tech"] .tool-index { font-family: "Microsoft YaHei", sans-serif; letter-spacing: 0.14em; }
[data-theme="comfort"] .tool-row { border-radius: 22px 12px 12px 22px; }
[data-theme="comfort"] .tool-type { font-family: var(--font-display); }

@media (max-width: 1180px) {
  .login-page { grid-template-columns: minmax(0, 1fr) 420px; width: min(1080px, calc(100% - 64px)); gap: 40px; }
  .identity-stage { width: 100%; margin-left: 0; transform: scale(0.88); transform-origin: left center; }
  .story-copy h1 { font-size: clamp(58px, 7vw, 82px); }
  .sidebar { width: 226px; }
  .app-main { margin-left: 262px; }
  .welcome-panel { grid-template-columns: minmax(0, 1fr) 300px; }
  .admin-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-family-row { grid-template-columns: 56px minmax(220px, 0.62fr) minmax(430px, 1.38fr); }
}

@media (min-width: 980px) and (max-height: 960px) {
  .global-header { min-height: 64px; margin-top: 12px; padding-block: 7px; }
  .global-header .brand-mark { width: 40px; height: 40px; }
  .global-header .theme-choice { min-height: 32px; padding-block: 4px; }
  .login-page { height: calc(100dvh - 76px); min-height: 0; padding: 8px 0 0; }
  .story-panel { padding: 0; }
  .eyebrow { margin-bottom: 10px; }
  .story-copy h1 { font-size: clamp(52px, 6vw, 76px); line-height: 0.94; }
  .story-description { max-width: 540px; margin-top: 14px; font-size: 14px; line-height: 1.6; }
  .identity-stage { width: 560px; max-width: 100%; height: 172px; margin: 14px 0 6px 0; transform: scale(0.74); transform-origin: left center; }
  .story-facts { max-width: 530px; gap: 12px; padding-top: 10px; }
  .story-facts strong { font-size: 25px; }
  .login-card { padding: 22px 28px; }
  .login-head { margin-bottom: 16px; }
  .login-head h2 { font-size: 30px; }
  .field-label { margin: 11px 0 6px; }
  .field-error { min-height: 14px; margin-top: 3px; }
  .slider-wrap { margin-top: 10px; }
  .login-submit { min-height: 48px; margin-top: 14px; }
  .auth-switch { margin-top: 10px; }
  .prototype-note { margin-top: 10px; line-height: 1.4; }
}

@media (min-width: 980px) and (max-height: 740px) {
  .global-header { min-height: 56px; margin-top: 8px; padding-block: 5px; }
  .global-header .brand-mark { width: 36px; height: 36px; }
  .login-page { height: calc(100dvh - 64px); padding-top: 6px; }
  .login-head { min-height: 68px; margin-bottom: 9px; }
  .login-head h2 { font-size: 27px; }
  .login-head .auth-description { margin-top: 6px; }
  .avatar-trigger { width: 66px; }
  .avatar-trigger img { width: 48px; height: 48px; }
  .login-card { padding: 14px 22px; }
  .development-login { margin-bottom: 8px; padding: 8px; }
  .development-login p { margin-bottom: 6px; }
  .development-login-actions .secondary-button { min-height: 34px; }
  .field-label { margin-top: 7px; margin-bottom: 4px; }
  .field-shell,
  .code-row { min-height: 44px; }
  .field-shell input { height: 42px; }
  .slider-wrap { margin-top: 6px; }
  .slider-head { margin-bottom: 5px; }
  .slider-track { height: 44px; }
  .slider-track input { height: 44px; }
  .slider-track::after { width: 36px; height: 36px; }
  .field-error { min-height: 10px; margin-top: 1px; }
  .login-submit { min-height: 44px; margin-top: 8px; }
  .auth-switch,
  .prototype-note { margin-top: 6px; }
}

@media (max-width: 979px) {
  .global-header { width: calc(100% - 36px); }
  .login-page { grid-template-columns: 1fr; width: min(700px, calc(100% - 40px)); padding-top: 34px; }
  .story-panel { padding-top: 0; }
  .story-copy h1 { font-size: clamp(54px, 12vw, 84px); }
  .story-description { max-width: 620px; }
  .identity-stage { width: 560px; max-width: 100%; margin-bottom: 4px; transform: none; }
  .login-card { width: 100%; justify-self: stretch; }
  .sidebar { inset: 12px auto 12px 12px; width: min(280px, calc(100% - 46px)); transform: translateX(calc(-100% - 22px)); visibility: hidden; transition: transform 300ms var(--ease-soft), visibility 300ms; }
  .sidebar.is-open { transform: translateX(0); visibility: visible; }
  .sidebar-overlay { position: fixed; z-index: 25; inset: 0; background: var(--overlay-sidebar); backdrop-filter: blur(5px); }
  .app-main { margin-left: 0; padding: 12px 12px 42px; }
  .mobile-menu { display: block; }
  .welcome-panel { grid-template-columns: 1fr; }
  .welcome-aside { grid-template-columns: 1fr 1fr; max-width: 430px; }
  .tool-row { grid-template-columns: 56px minmax(0, 1fr) auto; }
  .tool-family-row { grid-template-columns: 56px minmax(0, 1fr); }
  .tool-family-scenarios { grid-column: 2; border-top: 1px solid var(--line); border-left: 0; }
  .tool-family-scenario { padding-left: 0; }
  .avatar-dialog { padding-inline: 30px; }
  .avatar-grid { column-gap: 12px; row-gap: 18px; }
  .avatar-option { min-height: 116px; font-size: 10px; }
  .avatar-option img { width: 84px; height: 84px; margin-bottom: 8px; }
}

@media (max-width: 680px) {
  .global-header { align-items: stretch; min-height: 68px; margin-top: 10px; padding: 8px 9px 8px 12px; flex-wrap: wrap; gap: 8px; }
  .header-actions { width: 100%; }
  .header-actions .theme-switch { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; }
  .header-actions .theme-choice { min-width: 0; }
  .brand-copy small,
  .version-label { display: none; }
  .brand-mark { width: 40px; height: 40px; }
  .theme-choice { min-width: 46px; min-height: 34px; padding: 5px 9px; }
  .login-page { width: calc(100% - 28px); min-height: auto; padding: 38px 0 60px; }
  .story-copy h1 { font-size: clamp(49px, 15.3vw, 72px); }
  .story-description { margin-top: 20px; font-size: 15px; }
  .identity-stage { height: 185px; margin-top: 24px; transform: scale(0.78); transform-origin: left center; }
  .story-facts { grid-template-columns: 82px 82px 1fr; gap: 12px; }
  .story-facts strong { font-size: 25px; }
  .login-card { padding: 24px 18px; border-radius: 22px; }
  .login-head h2 { font-size: 30px; }
  .code-row { grid-template-columns: minmax(0, 1fr) 112px; }
  .topbar { min-height: 64px; padding: 8px; }
  .topbar-left > div { display: none; }
  .topbar-actions { gap: 6px; }
  .topbar-actions .theme-switch { display: flex; padding: 3px; }
  .topbar-actions .theme-choice { min-width: 38px; min-height: 32px; padding: 4px 7px; font-size: 10px; }
  .profile-shortcut span { display: none; }
  .profile-shortcut { padding-right: 5px; }
  .page { padding-top: 12px; }
  .welcome-panel { min-height: 0; padding: 30px 22px; border-radius: 22px; }
  .welcome-copy h1 { font-size: 42px; }
  .welcome-copy > p:last-child { font-size: 13px; }
  .welcome-aside { max-width: none; }
  .welcome-stat { min-height: 96px; padding: 16px; }
  .welcome-stat strong { font-size: 34px; }
  .tool-section { padding: 20px 14px; border-radius: 20px; }
  .section-header { align-items: start; flex-direction: column; gap: 8px; }
  .section-header > p { text-align: left; }
  .command-bar { display: flex; align-items: stretch; flex-direction: column; }
  .filter-group { display: grid; grid-template-columns: repeat(3, 1fr); }
  .sort-group, .tool-color-marker, .tool-color-menu { display: none; }
  .search-box { width: 100%; min-width: 0; min-height: 42px; border-top: 1px solid var(--line); border-left: 0; }
  .tool-list { gap: 9px; }
  .tool-row { grid-template-columns: 22px minmax(0, 1fr); gap: 8px; min-height: 0; padding: 14px 12px; }
  .tool-meta { padding-top: 3px; }
  .tool-index { font-size: 9px; }
  .tool-title-line { gap: 7px; }
  .tool-copy h3 { font-size: 16px; }
  .tool-type { min-width: 36px; padding: 3px 5px; font-size: 9px; }
  .tool-copy p { display: -webkit-box; margin-top: 5px; overflow: hidden; font-size: 10px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .tool-actions { grid-column: 2; justify-content: flex-start; gap: 4px; }
  .tool-action { min-height: 34px; padding: 0 9px; border-radius: 8px; font-size: 10px; }
  .tool-family-row { grid-template-columns: 22px minmax(0, 1fr); }
  .tool-family-scenarios { grid-column: 2; }
  .tool-family-scenario { grid-template-columns: 1fr; gap: 7px; padding: 9px 0; }
  .tool-family-scenario .tool-actions { grid-column: auto; }
  .tool-family-statistics { margin-left: 0; }
  .page-intro { padding: 30px 22px; border-radius: 22px; }
  .page-intro h1 { font-size: 42px; }
  .admin-overview { gap: 8px; }
  .admin-stat { min-height: 92px; padding: 16px; }
  .admin-stat strong { font-size: 30px; }
  .admin-section-head { align-items: flex-start; flex-direction: column; gap: 8px; }
  .admin-section-head > span { text-align: left; }
  .admin-section-actions { width: 100%; align-items: flex-start; flex-direction: column; }
  .admin-section-actions > span { text-align: left; }
  .admin-section-actions .primary-button { width: 100%; }
  .tool-form-grid { grid-template-columns: 1fr; gap: 0; }
  .profile-layout { grid-template-columns: 1fr; }
  .security-card { padding: 18px; }
  .security-item { align-items: flex-start; flex-direction: column; gap: 9px; }
  .danger-zone { align-items: stretch; flex-direction: column; }
  .danger-button { width: 100%; }
  .modal { padding: 20px 14px; border-radius: 22px; }
  .avatar-dialog { width: calc(100% - 20px); }
  .dialog-head h3 { font-size: 26px; }
  .avatar-grid { gap: 6px; }
  .avatar-option { min-height: 86px; padding: 7px 2px 5px; font-size: 9px; }
  .avatar-option img { width: 48px; height: 48px; }
  .avatar-dialog-foot { align-items: stretch; flex-direction: column; }
  .round-nav { justify-content: space-between; }
  .round-nav .secondary-button { padding: 0 11px; }
  .toast-region { right: 14px; bottom: 14px; width: calc(100% - 28px); }
}

@media (max-width: 400px) {
  .brand-copy strong { max-width: 128px; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
  .theme-choice { min-width: 42px; }
  .identity-stage { display: none; }
  .story-facts { margin-top: 30px; }
  .story-facts p { display: none; }
  .login-head { margin-bottom: 22px; }
  .avatar-trigger { width: 64px; }
  .code-row { grid-template-columns: 1fr; }
  .code-row .secondary-button { width: 100%; }
  .development-login-actions { grid-template-columns: 1fr; }
  .avatar-option { min-height: 78px; }
  .avatar-option img { width: 44px; height: 44px; }
  .avatar-option span { font-size: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

@media (prefers-reduced-transparency: reduce) {
  .global-header,
  .login-card,
  .sidebar,
  .topbar,
  .welcome-panel,
  .tool-section,
  .page-intro,
  .admin-stat,
  .admin-section,
  .data-panel,
  .profile-card,
  .security-card,
  .stage-note { background: var(--surface-solid); backdrop-filter: none; }

  .modal::backdrop,
  .loading-layer,
  .sidebar-overlay { backdrop-filter: none; }

  [data-theme="tech"] .global-header,
  [data-theme="tech"] .login-card,
  [data-theme="tech"] .sidebar,
  [data-theme="tech"] .topbar,
  [data-theme="tech"] .theme-switch,
  [data-theme="tech"] .command-bar,
  [data-theme="tech"] .profile-shortcut,
  [data-theme="tech"] .signed-user {
    background: var(--surface-solid);
    backdrop-filter: none;
  }
}
