:root {
  --bg: #f3f7fc;
  --bg-accent: #dce8f8;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-alt: #eef4fb;
  --panel-border: #d7e2f0;
  --text: #172334;
  --muted: #617286;
  --muted-strong: #33465d;
  --brand: #2563eb;
  --brand-strong: #1d4ed8;
  --brand-soft: #dbeafe;
  --ok: #177245;
  --error: #c2410c;
  --shadow: 0 24px 60px rgba(16, 34, 62, 0.12);
  --shadow-soft: 0 10px 28px rgba(15, 23, 42, 0.08);
  --line: rgba(148, 163, 184, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "PingFang SC", "SF Pro Display", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 24rem),
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.08), transparent 28rem),
    linear-gradient(180deg, #f8fbff 0%, #f1f6fc 44%, #edf3fa 100%);
}

.page-shell {
  min-height: 100vh;
  padding: 20px 24px 28px;
}

.login-layout {
  min-height: calc(100vh - 48px);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 22px;
}

.login-hero-row {
  width: min(1440px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: stretch;
  gap: 18px;
}

.login-card,
.panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 251, 255, 0.92)),
    var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.login-card {
  width: 100%;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  overflow: hidden;
  margin-inline: auto;
}

.login-ad-card {
  display: grid;
  align-content: space-between;
  gap: 18px;
  padding: 24px 22px;
  border-radius: 24px;
  border: 1px solid rgba(203, 213, 225, 0.95);
  background:
    radial-gradient(circle at top right, rgba(148, 163, 184, 0.12), transparent 10rem),
    radial-gradient(circle at bottom left, rgba(226, 232, 240, 0.55), transparent 10rem),
    linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.94));
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.login-ad-head {
  display: grid;
  gap: 8px;
}

.login-ad-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.login-ad-head h2 {
  margin: 0;
  color: #1e293b;
  font-size: 1.3rem;
  line-height: 1.25;
}

.login-ad-head p {
  margin: 0;
  color: #475569;
  font-size: 0.98rem;
  font-weight: 600;
}

.login-ad-body {
  display: grid;
  gap: 12px;
  color: #334155;
}

.login-ad-body p {
  margin: 0;
  line-height: 1.7;
  color: #475569;
}

.login-ad-points {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.login-ad-points li {
  line-height: 1.55;
  color: #475569;
}

.login-ad-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.96));
  color: #1e40af;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.login-ad-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(15, 23, 42, 0.1);
}

.login-showcase {
  width: min(1440px, 100%);
  display: grid;
  gap: 14px;
  padding: 22px 22px 24px;
  border-radius: 24px;
  border: 1px solid rgba(215, 226, 240, 0.96);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(245, 249, 255, 0.88)),
    rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  margin-inline: auto;
}

.login-showcase-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.login-showcase-head h2 {
  margin: 4px 0 0;
  font-size: 1.45rem;
  line-height: 1.2;
  color: #0f172a;
}

.login-showcase-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(147, 197, 253, 0.8);
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.98), rgba(219, 234, 254, 0.92));
  color: #1d4ed8;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.login-showcase-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.14);
}

.login-showcase-marquee {
  position: relative;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.login-showcase-track {
  display: flex;
  align-items: stretch;
  gap: 18px;
  width: max-content;
  animation: showcase-scroll 56s linear infinite;
}

.login-showcase:hover .login-showcase-track {
  animation-play-state: paused;
}

.slide-preview-card {
  width: 460px;
  flex: 0 0 460px;
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(226, 232, 240, 0.96);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
}

.slide-preview-card img {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid rgba(203, 213, 225, 0.88);
  background: #eff6ff;
}

.slide-preview-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #475569;
  font-size: 12px;
}

.slide-preview-meta strong {
  color: #0f172a;
  font-size: 13px;
}

@keyframes showcase-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(calc(-50% - 9px));
  }
}

.login-copy {
  padding: 42px;
  background:
    radial-gradient(circle at top left, rgba(96, 165, 250, 0.3), transparent 18rem),
    radial-gradient(circle at bottom right, rgba(30, 64, 175, 0.22), transparent 22rem),
    linear-gradient(160deg, #123b72 0%, #0f4c81 45%, #0b5a7b 100%);
  color: #eff6ff;
}

.login-copy > p {
  margin: 0;
}

.login-feature-grid {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.login-feature-card {
  padding: 14px 16px;
  border: 1px solid rgba(191, 219, 254, 0.18);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04)),
    rgba(15, 23, 42, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.login-feature-card h2 {
  margin: 0 0 6px;
  font-size: 15px;
  color: #f8fbff;
}

.login-feature-card p {
  margin: 0;
  color: rgba(239, 246, 255, 0.84);
  font-size: 13px;
  line-height: 1.6;
}

.login-workflow {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.login-workflow span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(191, 219, 254, 0.22);
  color: #eff6ff;
  font-size: 12px;
  letter-spacing: 0.02em;
}

.login-copy h1,
.console-title h1 {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.1;
  font-weight: 700;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  width: fit-content;
}

.brand-lockup-image {
  display: block;
  width: 100%;
  height: auto;
}

.brand-lockup-console {
  max-width: 300px;
}

.brand-lockup-form {
  justify-self: center;
  width: 100%;
  max-width: 300px;
  padding: 10px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 32px rgba(15, 23, 42, 0.08);
}

.login-guest-tip {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(59, 130, 246, 0.18);
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.95), rgba(248, 250, 252, 0.92));
  color: #334155;
}

.login-guest-tip strong {
  color: #1e3a8a;
  font-size: 13px;
}

.login-guest-tip span {
  font-weight: 700;
  color: #0f172a;
}

.login-guest-tip small {
  color: #64748b;
  line-height: 1.5;
}

.login-guest-form {
  margin-top: 6px;
}

.login-guest-button {
  width: 100%;
  min-height: 40px;
  border-color: rgba(148, 163, 184, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.96));
  color: #1e3a8a;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.login-guest-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(15, 23, 42, 0.12);
}

.console-title h1 {
  margin: 0;
  color: #0f172a;
  font-family: "PingFang SC", "SF Pro Display", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-shadow: none;
}

.login-form {
  display: grid;
  gap: 14px;
  padding: 38px 40px;
  align-content: center;
}

.login-fields-form {
  display: grid;
  gap: 14px;
}

.dashboard {
  width: min(1360px, 100%);
  margin: 0 auto;
}

.dashboard,
.panel,
.stack-form {
  display: grid;
  gap: 14px;
}

.action-stack {
  display: grid;
  gap: 8px;
}

.action-row-compact {
  min-height: 0;
}

.dashboard-compact {
  gap: 16px;
}

.console-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 2px 2px 4px;
}

.console-title {
  display: grid;
  gap: 4px;
}

.titleplate {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 10px 16px 12px;
  border-radius: 14px;
  border: 1px solid rgba(203, 213, 225, 0.82);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 249, 255, 0.92)),
    linear-gradient(180deg, rgba(59, 130, 246, 0.02), rgba(14, 165, 233, 0.04));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 18px 34px rgba(15, 23, 42, 0.08);
}

.titleplate::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(191, 219, 254, 0.45);
  border-radius: 10px;
  pointer-events: none;
}

.titleplate-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.titleplate-primary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.titleplate-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  max-width: 520px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(191, 219, 254, 0.72);
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.95), rgba(219, 234, 254, 0.88));
  color: #1e3a5f;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.titleplate-status.warning {
  color: #7a541f;
  border-color: rgba(158, 112, 35, 0.35);
}

.titleplate-status.success {
  color: #32573e;
  border-color: rgba(54, 88, 64, 0.28);
}

.titleplate-status.error {
  color: #8f3d32;
  border-color: rgba(152, 63, 51, 0.3);
}

.titleplate-seal {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.28);
  background:
    linear-gradient(180deg, rgba(37, 99, 235, 0.98), rgba(29, 78, 216, 0.98));
  color: #eff6ff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  box-shadow:
    inset 0 1px 0 rgba(191, 219, 254, 0.22),
    0 10px 18px rgba(37, 99, 235, 0.2);
}

.titleplate-divider {
  position: relative;
  height: 8px;
}

.titleplate-divider::before,
.titleplate-divider::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  border-radius: 999px;
}

.titleplate-divider::before {
  top: 2px;
  height: 2px;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.04), rgba(37, 99, 235, 0.55), rgba(37, 99, 235, 0.04));
}

.titleplate-divider::after {
  top: 6px;
  height: 1px;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.04), rgba(148, 163, 184, 0.42), rgba(148, 163, 184, 0.04));
}

.console-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.meta-chip,
.panel-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid #d7e2f0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(241, 245, 249, 0.92));
  color: #46576d;
  font-size: 12px;
  font-weight: 600;
}

.meta-chip-wide {
  white-space: nowrap;
  padding: 0 12px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 246, 255, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
  color: #33465d;
}

.user-chip-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7d92;
}

.user-chip-name {
  font-size: 13px;
  font-weight: 700;
  color: #10243b;
}

.user-chip-role {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: #2453b3;
  font-size: 11px;
  font-weight: 700;
}

.guest-mode-banner {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid rgba(251, 191, 36, 0.28);
  background: linear-gradient(180deg, rgba(255, 251, 235, 0.96), rgba(254, 249, 195, 0.84));
  color: #7c5a10;
}

.guest-mode-banner strong {
  color: #854d0e;
}

.guest-locked {
  opacity: 0.55;
  pointer-events: none;
  user-select: none;
}

.guest-readonly-note {
  margin-top: 8px;
  color: #7c5a10;
  font-size: 12px;
  line-height: 1.5;
}

.hero-copy,
.compact-copy,
.panel-head p,
.status-card,
.ghost-link,
.rules-guide-card p,
.rules-example p {
  color: var(--muted);
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: #4f7dbf;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  font-weight: 700;
}

.section-kicker {
  margin-bottom: 4px;
}


.overview-grid,
.grid.two-up,
.rules-guide-grid {
  display: grid;
  gap: 14px;
}

.overview-grid {
  grid-template-columns: 1.1fr 0.9fr;
}

.grid.two-up,
.compact-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rules-guide-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tab-shell {
  display: grid;
  gap: 14px;
}

.workspace-lower-panel {
  margin-top: 2px;
}

.tabbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(241, 245, 249, 0.92)),
    rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow-soft);
}

.tab-button {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #5b6b7d;
  font-size: 13px;
  font-weight: 600;
  box-shadow: none;
}

.tab-button.is-active {
  background: linear-gradient(180deg, #eff6ff, #dbeafe);
  border-color: #93c5fd;
  color: #1d4ed8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.panel {
  padding: 16px 18px;
  border-color: rgba(215, 226, 240, 0.88);
}

.panel-compact {
  gap: 12px;
}

.panel-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.compact-head {
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.panel-head h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}

.panel-head p {
  margin: 0;
  font-size: 13px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted-strong);
}

.compact-form {
  gap: 12px;
}

.panel-subtle {
  gap: 12px;
  padding: 0;
  border-style: dashed;
}

.workspace-shell {
  gap: 16px;
}

.workspace-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.workspace-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  border: 1px solid #d7e2f0;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.94));
}

.workspace-subtab {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  box-shadow: none;
}

.workspace-subtab.is-active {
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  border-color: transparent;
  color: #eff6ff;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.16);
}

.workspace-content-stack {
  display: grid;
  gap: 16px;
}

.workspace-section-panel {
  display: none;
}

.workspace-section-panel.is-active {
  display: block;
}

.admin-user-create-row {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr auto auto;
  gap: 8px;
  align-items: center;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.compact-checkbox {
  min-height: 36px;
  padding: 0 6px;
}

.checkbox-row input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.admin-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.admin-subnav {
  display: grid;
  gap: 8px;
  position: sticky;
  top: 16px;
}

.admin-subtab {
  justify-content: flex-start;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.94));
  border-color: #d7e2f0;
  color: #475569;
  box-shadow: none;
}

.admin-subtab.is-active {
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  border-color: transparent;
  color: #eff6ff;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
}

.admin-content-stack {
  display: grid;
  gap: 16px;
}

.admin-section-panel {
  display: none;
}

.admin-section-panel.is-active {
  display: block;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

.admin-form-grid .full-span {
  grid-column: 1 / -1;
}

.table-wrap {
  overflow-x: auto;
}

.admin-user-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  background: rgba(255, 249, 239, 0.5);
  border: 1px solid rgba(154, 119, 78, 0.18);
}

.admin-user-table th,
.admin-user-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(154, 119, 78, 0.14);
  text-align: left;
  white-space: nowrap;
}

.admin-user-table th {
  color: var(--muted-strong);
  font-weight: 700;
  background: rgba(220, 197, 161, 0.28);
}

.table-checkbox-cell {
  width: 42px;
  text-align: center !important;
}

.table-checkbox-cell input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.table-action {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.table-action-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.table-muted {
  color: var(--muted);
  font-size: 12px;
}

.table-primary-text {
  color: var(--text);
  font-weight: 600;
  line-height: 1.45;
  white-space: normal;
  word-break: break-word;
}

.table-meta-lines {
  display: grid;
  gap: 2px;
  margin-top: 4px;
}

.table-meta-line {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  white-space: normal;
}

.links-catalog {
  display: grid;
  gap: 24px;
}

.links-chapter {
  display: grid;
  gap: 14px;
}

.links-chapter-head h3 {
  margin: 0;
  font-size: 20px;
  color: #0f172a;
}

.links-section-card {
  display: grid;
  gap: 14px;
  border: 1px solid #d7e2f0;
  border-radius: 18px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 247, 252, 0.94));
}

.links-section-head h4,
.links-subsection h5,
.links-subgroup h6 {
  margin: 0;
}

.links-section-head h4 {
  font-size: 18px;
  color: #1e3a5f;
}

.links-subsection {
  display: grid;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px dashed #d7e2f0;
}

.links-subsection h5 {
  font-size: 15px;
  color: #334155;
}

.links-subgroup-stack {
  display: grid;
  gap: 12px;
}

.links-subgroup {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(241, 245, 249, 0.7);
  border: 1px solid #e2e8f0;
}

.links-subgroup h6 {
  margin: 0;
  font-size: 14px;
  color: #1e3a5f;
}

.links-group-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.links-grid-compact {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.links-card {
  display: grid;
  gap: 6px;
  padding: 14px 15px;
  border: 1px solid #d7e2f0;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 250, 252, 0.95));
  text-decoration: none;
  color: inherit;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.links-card:hover {
  transform: translateY(-1px);
  border-color: #93c5fd;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.12);
}

.links-card-compact {
  gap: 4px;
  padding: 12px;
}

.links-card-compact strong {
  font-size: 13px;
  line-height: 1.35;
}

.links-card-compact .links-url {
  font-size: 11px;
}

.links-group-card {
  align-content: start;
}

.links-city-card {
  min-width: 0;
  gap: 6px;
}

.links-city-card strong {
  font-size: 12px;
  font-weight: 600;
  color: #2563eb;
  line-height: 1.35;
  word-break: break-all;
}

.links-group-title {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
}

.links-url {
  font-size: 12px;
  color: #2563eb;
  word-break: break-all;
}

.links-description,
.links-note {
  font-size: 12.5px;
  color: #64748b;
  line-height: 1.5;
}

.links-note-stack {
  display: grid;
  gap: 6px;
}

.links-plain-list {
  display: grid;
  gap: 8px;
}

.links-plain-item {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid #d7e2f0;
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.92);
}

.links-plain-item strong {
  font-size: 13px;
  color: #334155;
}

.field-inline {
  max-width: 180px;
}

input[type="text"],
input[type="password"],
input[type="file"],
textarea,
button,
.secondary-button {
  font: inherit;
}

input[type="text"],
input[type="password"],
input[type="file"],
select,
textarea {
  width: 100%;
  border: 1px solid #d4dfec;
  border-radius: 12px;
  padding: 10px 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.94));
  color: var(--text);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="file"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.16);
}

textarea {
  resize: vertical;
}

button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  background:
    linear-gradient(180deg, #3b82f6, #2563eb);
  color: #f8fbff;
  text-decoration: none;
  cursor: pointer;
  transition: transform 150ms ease, opacity 150ms ease, box-shadow 150ms ease;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
  font-size: 13px;
  font-weight: 600;
}

.secondary-button {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.94));
  border-color: #d7e2f0;
  color: #33465d;
  box-shadow: none;
}

.danger-button {
  background:
    linear-gradient(180deg, rgba(255, 247, 237, 0.98), rgba(254, 215, 170, 0.55));
  border-color: #fdba74;
  color: #9a3412;
}

button[hidden],
.secondary-button[hidden] {
  display: none;
}

button:hover,
.secondary-button:hover,
.ghost-link:hover,
.tab-button:hover {
  transform: translateY(-1px);
}

.ghost-link {
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid #d7e2f0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.94));
  font-size: 13px;
}

.action-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.inline-field {
  display: grid;
  gap: 4px;
  max-width: 320px;
}

.inline-field-grow {
  flex: 1 1 320px;
  max-width: none;
}

.inline-field span {
  font-size: 12px;
  color: #64748b;
}

.inline-field input {
  min-width: 0;
}

.generate-config-row {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}

.mode-switch-field {
  display: grid;
  gap: 4px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.mode-switch-field legend {
  padding: 0;
  font-size: 12px;
  color: #64748b;
  margin-bottom: 4px;
}

.mode-switch {
  display: inline-flex;
  align-items: center;
  padding: 4px;
  border-radius: 14px;
  border: 1px solid #d7e2f0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.mode-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-switch label {
  min-width: 58px;
  padding: 7px 14px;
  border-radius: 9px;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.mode-switch input:checked + label {
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  color: #eff6ff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
}

.mode-switch label:hover {
  transform: translateY(-1px);
}

.action-row-wrap {
  flex-wrap: wrap;
}

.status-card,
.code-block,
.rules-editor {
  border-radius: 14px;
  padding: 12px 13px;
  border: 1px solid #d7e2f0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.94));
}

.status-card {
  min-height: 60px;
  white-space: pre-wrap;
  font-size: 12.5px;
  line-height: 1.5;
}

.overview-grid .panel {
  padding-top: 12px;
  padding-bottom: 12px;
}

.overview-grid .status-card {
  min-height: 58px;
  padding: 10px 12px;
}

.code-block,
.rules-editor {
  min-height: 220px;
  margin: 0;
  overflow: auto;
  font-family: "SFMono-Regular", "Menlo", "Consolas", monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.rules-editor {
  min-height: 400px;
}

#parse-result,
#detect-result,
#generate-result,
#embedding-result,
#vector-query-result {
  height: 360px;
  max-height: 58vh;
  overflow-y: auto;
  overflow-x: auto;
}

.rules-guide-card,
.rules-example {
  border-radius: 16px;
  border: 1px solid #d7e2f0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 247, 252, 0.92));
  padding: 14px;
}

.rules-guide-card h3,
.rules-example-title {
  margin: 0 0 6px;
  font-size: 13px;
}

.rules-example-code {
  margin: 8px 0 0;
  padding: 12px;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.96));
  border: 1px solid #d7e2f0;
  overflow: auto;
  font-family: "SFMono-Regular", "Menlo", "Consolas", monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.panel.section-updated,
.code-block.section-updated {
  animation: resultGlow 1.5s ease;
}

.panel.section-updated {
  border-color: #93c5fd;
  box-shadow: 0 18px 38px rgba(37, 99, 235, 0.12), 0 0 0 4px rgba(96, 165, 250, 0.14);
}

.code-block.section-updated {
  border-color: #93c5fd;
  background:
    linear-gradient(180deg, rgba(239, 246, 255, 0.98), rgba(219, 234, 254, 0.92));
}

@keyframes resultGlow {
  0% {
    transform: translateY(6px);
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.16);
  }

  35% {
    transform: translateY(0);
    box-shadow: 0 0 0 8px rgba(59, 130, 246, 0.1);
  }

  100% {
    transform: translateY(0);
    box-shadow: 0 0 0 0 rgba(36, 88, 143, 0);
  }
}

.status-card.success {
  color: var(--ok);
}

.status-card.error,
.flash-error {
  color: var(--error);
}

.status-card.warning {
  color: #b45309;
}

.flash-stack {
  width: min(1360px, 100%);
  margin: 0 auto 14px;
}

.flash {
  padding: 12px 14px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 247, 252, 0.94));
  border: 1px solid var(--panel-border);
}

.usage-toolbar {
  display: flex;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.usage-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.usage-summary-card {
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 249, 255, 0.92));
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.usage-summary-label {
  font-size: 13px;
  color: var(--muted);
}

.usage-summary-card strong {
  font-size: 24px;
  color: var(--ink-strong);
}

.usage-chart-box {
  min-height: 260px;
  border: 1px dashed var(--panel-border);
  border-radius: 16px;
  padding: 16px;
  background: rgba(248, 251, 255, 0.75);
}

.usage-chart-empty {
  color: var(--muted);
}

.usage-trend-svg {
  width: 100%;
  height: 220px;
  display: block;
}

.usage-trend-axis {
  stroke: rgba(148, 163, 184, 0.8);
  stroke-width: 1;
}

.usage-trend-line {
  fill: none;
  stroke: #2563eb;
  stroke-width: 3;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.usage-trend-point {
  fill: #2563eb;
}

.usage-trend-label-row {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}

.usage-pie-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  align-items: center;
}

.usage-pie-donut {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  margin: 0 auto;
  position: relative;
}

.usage-pie-donut::after {
  content: "";
  position: absolute;
  inset: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(203, 213, 225, 0.75);
}

.usage-pie-legend {
  display: grid;
  gap: 10px;
}

.usage-pie-legend-item {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.usage-pie-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.usage-pie-legend strong {
  font-weight: 700;
  color: var(--ink-strong);
}

@media (max-width: 1080px) {
  .overview-grid,
  .grid.two-up,
  .compact-grid,
  .admin-shell,
  .admin-config-grid,
  .admin-form-grid,
  .rules-guide-grid,
  .login-card {
    grid-template-columns: 1fr;
  }

  .login-hero-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .login-showcase-head {
    align-items: start;
    flex-direction: column;
  }

  .admin-subnav {
    position: static;
  }

  .links-grid-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .links-group-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .console-bar {
    flex-direction: column;
  }

  .console-meta {
    justify-content: flex-start;
  }

  .titleplate-top {
    flex-wrap: wrap;
  }

  .titleplate-primary {
    width: 100%;
    flex-wrap: wrap;
  }

  .titleplate-status {
    max-width: 100%;
  }

  .usage-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .usage-pie-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding: 14px;
  }

  .login-layout {
    align-content: start;
    gap: 18px;
  }

  .login-hero-row {
    width: 100%;
    gap: 14px;
  }

  .login-card {
    background: transparent;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
    gap: 14px;
    overflow: visible;
  }

  .login-copy,
  .login-form,
  .login-ad-card {
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
  }

  .login-copy {
    padding: 28px 22px;
  }

  .brand-lockup-form {
    max-width: min(280px, 100%);
    padding: 8px 10px;
  }

  .brand-lockup-console {
    max-width: 220px;
  }

  .login-form {
    padding: 22px 18px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.92)),
      var(--panel);
    border: 1px solid var(--panel-border);
  }

  .login-ad-card {
    padding: 20px 18px;
  }

  .panel {
    padding: 14px;
  }

  .action-row {
    flex-wrap: wrap;
  }

  .admin-user-create-row {
    grid-template-columns: 1fr;
  }

  .tabbar {
    gap: 6px;
  }

  .tab-button {
    flex: 1 1 calc(50% - 6px);
  }

  .usage-toolbar,
  .usage-summary-grid {
    grid-template-columns: 1fr;
  }

  .slide-preview-card {
    width: 360px;
    flex-basis: 360px;
  }

  .usage-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  #parse-result,
  #detect-result,
  #generate-result,
  #embedding-result,
  #vector-query-result,
  .rules-editor {
    height: 300px;
    max-height: none;
  }
}
