/* Cute 授权印刷台：深海军蓝纸张、紫色油墨与珊瑚色贴纸。 */
:root {
  color-scheme: dark;
  --navy: #161b32;
  --plum: #5d2260;
  --purple: #974292;
  --coral: #f2979b;
  --butter: #ffed9b;
  --paper: #fff8e8;
  --paper-bright: #fffdf6;
  --ink-soft: #59445f;
  --light-muted: #d5bfd2;
  --line-dark: #161b32;
  --font-cjk: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", "Hiragino Sans GB", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --radius-lg: 28px 18px 30px 20px;
  --radius-md: 20px 14px 22px 15px;
  --radius-sm: 13px 10px 14px 9px;
  --shadow-print: 7px 7px 0 var(--plum);
  --shadow-sticker: 4px 4px 0 var(--navy);
  font-family: var(--font-cjk);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
  scroll-behavior: smooth;
  scroll-padding-top: 124px;
  background: var(--navy);
}

body {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--paper);
  background-color: var(--navy);
  background-image:
    linear-gradient(rgba(151, 66, 146, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(151, 66, 146, 0.09) 1px, transparent 1px);
  background-size: 36px 36px;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

html,
body {
  touch-action: manipulation;
}

button,
input {
  font: inherit;
}

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

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3,
strong {
  font-weight: 800;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(38px, 5vw, 68px);
  line-height: 1.04;
  letter-spacing: -0.055em;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(21px, 2vw, 28px);
  line-height: 1.24;
  letter-spacing: -0.035em;
}

h3 {
  line-height: 1.4;
}

mark {
  color: inherit;
  background: none;
}

[hidden] {
  display: none !important;
}

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

.field input:focus-visible,
.generated-card:focus-visible {
  outline-color: var(--purple);
}

::selection {
  color: var(--navy);
  background: var(--coral);
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 2000;
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 9px 16px;
  color: var(--navy);
  border: 2px solid var(--navy);
  border-radius: var(--radius-sm);
  background: var(--butter);
  box-shadow: var(--shadow-sticker);
  font-weight: 800;
  transform: translateY(-180%);
}

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

/* 第二段品牌动态背景：印刷网格始终保留，视频只提供底层气氛。 */
.cloud-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: var(--navy);
}

.cloud-background video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.46;
}

.cloud-background::before,
.cloud-background::after {
  content: "";
  position: absolute;
  inset: 0;
}

.cloud-background::before {
  z-index: 1;
  background-image: radial-gradient(rgba(255, 237, 155, 0.18) 1px, transparent 1px);
  background-size: 18px 18px;
  opacity: 0.24;
}

.cloud-background::after {
  z-index: 2;
  background:
    linear-gradient(112deg, rgba(22, 27, 50, 0.9) 0%, rgba(22, 27, 50, 0.73) 58%, rgba(93, 34, 96, 0.82) 100%);
}

#main-content {
  position: relative;
  z-index: 2;
  min-width: 0;
}

.muted {
  color: var(--light-muted);
}

.small {
  font-size: 13px;
}

.eyebrow,
.section-kicker {
  display: block;
  margin-bottom: 8px;
  color: var(--coral);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* 控件：统一 44px 触控高度，按下时像贴纸被按回纸面。 */
.button,
.icon-button,
.day-option {
  min-height: 44px;
  border: 2px solid var(--navy);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease, color 150ms ease;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 18px;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
}

.button:hover:not(:disabled),
.day-option:hover:not(:disabled),
.icon-button:hover:not(:disabled) {
  transform: translate(-1px, -1px);
}

.button:active:not(:disabled),
.day-option:active:not(:disabled),
.icon-button:active:not(:disabled) {
  box-shadow: 1px 1px 0 var(--navy);
  transform: translate(2px, 2px);
}

.button.primary {
  color: var(--navy);
  background: var(--coral);
  box-shadow: var(--shadow-sticker);
}

.button.primary:hover:not(:disabled) {
  background: var(--butter);
  box-shadow: 5px 5px 0 var(--navy);
}

.button.secondary {
  color: var(--navy);
  background: var(--paper-bright);
  box-shadow: 3px 3px 0 var(--purple);
}

.button.secondary:hover:not(:disabled) {
  background: var(--butter);
  box-shadow: 4px 4px 0 var(--purple);
}

.button.danger {
  color: var(--paper);
  background: var(--plum);
  box-shadow: 3px 3px 0 var(--coral);
}

.button.danger:hover:not(:disabled) {
  color: var(--navy);
  background: var(--coral);
}

.button.wide {
  width: 100%;
}

.button:disabled,
.icon-button:disabled,
.day-option:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.button[aria-busy="true"]::before {
  content: "";
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.field {
  display: grid;
  min-width: 0;
  gap: 8px;
  color: inherit;
  font-size: 13px;
  font-weight: 800;
}

.field input {
  color-scheme: light;
  width: 100%;
  min-width: 0;
  min-height: 50px;
  padding: 11px 14px;
  color: var(--navy);
  border: 2px solid var(--navy);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--paper-bright);
  box-shadow: 3px 3px 0 rgba(93, 34, 96, 0.28);
  font-size: 16px;
  font-weight: 600;
  transition: box-shadow 150ms ease, background-color 150ms ease;
}

.field input:focus {
  background: #ffffff;
  box-shadow: 4px 4px 0 var(--coral);
}

.field input::placeholder {
  color: #806b82;
  opacity: 1;
}

.password-control {
  position: relative;
  display: block;
}

.password-control input {
  padding-right: 72px;
}

.password-control .icon-button {
  position: absolute;
  top: 3px;
  right: 3px;
  min-width: 62px;
  min-height: 44px;
  padding: 7px 10px;
  color: var(--plum);
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  font-size: 12px;
}

.password-control .icon-button:hover:not(:disabled) {
  background: var(--butter);
  transform: none;
}

.form-message {
  min-height: 0;
  margin: 10px 0 0;
  color: #9d294e;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.form-message:empty {
  display: none;
}

.field-help {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

/* 登录：左七右五的印刷跨页，标题、标记与素材分别错开。 */
.login-shell {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  padding: 52px clamp(20px, 5vw, 72px) 64px;
}

.login-card {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  width: min(1160px, 100%);
  min-width: 0;
  color: var(--navy);
  border: 3px solid var(--navy);
  border-radius: 34px 18px 38px 22px;
  outline: 2px solid var(--butter);
  background: var(--paper);
  box-shadow: 13px 13px 0 var(--purple);
}

.login-card::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 7%;
  z-index: 5;
  width: 42%;
  height: 10px;
  border: 2px solid var(--navy);
  background: linear-gradient(90deg, var(--coral) 0 25%, var(--butter) 25% 50%, var(--purple) 50% 75%, var(--plum) 75% 100%);
}

.login-card::after {
  content: "AUTHORIZATION / HANDLE WITH CARE";
  position: absolute;
  right: 6%;
  bottom: -25px;
  z-index: 5;
  padding: 5px 13px;
  color: var(--navy);
  border: 2px solid var(--navy);
  border-radius: 6px;
  background: var(--butter);
  box-shadow: 3px 3px 0 var(--navy);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  transform: rotate(-2deg);
}

.login-art {
  position: relative;
  display: flex;
  grid-column: 1 / 8;
  min-width: 0;
  min-height: 620px;
  flex-direction: column;
  padding: 36px 42px 30px;
  overflow: hidden;
  color: var(--paper);
  border-right: 3px solid var(--navy);
  border-radius: 30px 0 0 18px;
  background-color: var(--plum);
  background-image: radial-gradient(rgba(242, 151, 155, 0.22) 1.5px, transparent 1.5px);
  background-size: 22px 22px;
}

.login-art::after {
  content: "02";
  position: absolute;
  bottom: -68px;
  left: -16px;
  z-index: 0;
  color: rgba(242, 151, 155, 0.13);
  font-family: var(--font-mono);
  font-size: 250px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.14em;
}

.brand-lockup,
.mobile-brand,
.sidebar-brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.brand-lockup {
  position: relative;
  z-index: 3;
  align-self: flex-start;
  padding: 8px 12px;
  color: var(--navy);
  border: 2px solid var(--navy);
  border-radius: var(--radius-sm);
  background: var(--butter);
  box-shadow: var(--shadow-sticker);
  font-size: 23px;
  font-weight: 900;
  line-height: 1.1;
  transform: rotate(-2deg);
}

.brand-lockup small {
  display: block;
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.13em;
}

.brand-lockup img,
.sidebar-brand img,
.mobile-brand img {
  flex: 0 0 auto;
  object-fit: contain;
}

.print-register {
  position: absolute;
  top: 46px;
  right: 38px;
  z-index: 2;
  display: flex;
  gap: 9px;
}

.print-register span {
  display: block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--coral);
  border-radius: 50%;
}

.print-register span:nth-child(2) {
  border-color: var(--butter);
  border-radius: 2px;
  transform: rotate(12deg);
}

.print-register span:nth-child(3) {
  border-color: var(--paper);
  border-radius: 2px;
  transform: rotate(45deg);
}

.login-art-copy {
  position: relative;
  z-index: 2;
  margin: 94px 0 0 6%;
}

.login-art-copy .eyebrow {
  color: var(--butter);
}

.login-art-copy h2 {
  max-width: 520px;
  margin-bottom: 20px;
  font-size: clamp(36px, 4.2vw, 55px);
  line-height: 1.15;
  letter-spacing: -0.055em;
}

.login-art-copy h2 mark {
  display: inline-block;
  margin-top: 8px;
  padding: 0 10px 3px;
  color: var(--navy);
  border: 2px solid var(--navy);
  border-radius: 8px 5px 9px 4px;
  background: var(--coral);
  box-shadow: 5px 5px 0 var(--butter);
  transform: rotate(-2deg);
}

.login-art-copy p {
  max-width: 330px;
  color: #f0d8e8;
  font-size: 14px;
}

.login-mascot {
  position: absolute;
  right: 18px;
  bottom: 48px;
  z-index: 1;
  width: min(285px, 52%);
  max-height: 270px;
  object-fit: contain;
  filter: drop-shadow(7px 8px 0 rgba(22, 27, 50, 0.45));
  transform: rotate(3deg);
}

.art-note {
  position: relative;
  z-index: 3;
  align-self: flex-start;
  margin-top: auto;
  padding: 7px 12px;
  color: var(--navy);
  border: 2px solid var(--navy);
  border-radius: 99px;
  background: var(--paper);
  box-shadow: 3px 3px 0 var(--coral);
  font-size: 11px;
  font-weight: 700;
}

.login-form-wrap {
  position: relative;
  display: flex;
  grid-column: 8 / 13;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 56px 48px;
  border-radius: 0 14px 34px 0;
  background: var(--paper);
}

.login-form-wrap::before {
  content: "ADMIN ACCESS";
  position: absolute;
  top: 28px;
  right: 18px;
  color: var(--purple);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
  writing-mode: vertical-rl;
}

.login-form-wrap .eyebrow {
  color: var(--purple);
}

.login-form-wrap h1 {
  margin-bottom: 18px;
  font-size: clamp(45px, 5vw, 62px);
  line-height: 1.03;
}

.login-form-wrap h1::after {
  content: "";
  display: block;
  width: 92px;
  height: 10px;
  margin-top: 22px;
  border: 2px solid var(--navy);
  background: var(--coral);
  transform: rotate(-3deg);
}

.login-form-wrap > .muted {
  margin-bottom: 30px;
  color: var(--ink-soft);
}

.login-form-wrap form {
  display: grid;
  gap: 17px;
}

.login-form-wrap .form-message {
  margin: -3px 0 0;
}

.security-note {
  margin: 26px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  text-align: center;
}

.security-note span {
  margin-right: 5px;
  color: var(--purple);
}

.mobile-brand {
  display: none;
}

/* 顶部导航仍使用原 aside.sidebar，工作区保持原 DOM 层级。 */
.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 26px;
  width: min(1500px, 100%);
  min-width: 0;
  margin: 0 auto;
  padding: 20px clamp(16px, 2.5vw, 34px) 36px;
}

.sidebar {
  position: sticky;
  top: 14px;
  z-index: 50;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-width: 0;
  align-items: center;
  gap: 20px;
  padding: 12px 14px;
  border: 2px solid var(--purple);
  border-radius: 18px 25px 17px 23px;
  background: rgba(22, 27, 50, 0.96);
  box-shadow: 7px 7px 0 var(--plum);
}

.sidebar-brand {
  min-height: 56px;
  padding: 2px 20px 2px 4px;
  color: var(--butter);
  border-right: 2px solid var(--plum);
}

.sidebar-brand strong,
.sidebar-brand small {
  display: block;
}

.sidebar-brand strong {
  font-size: 25px;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.sidebar-brand small {
  margin-top: 5px;
  color: var(--coral);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.side-nav {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.nav-link {
  display: inline-flex;
  min-width: 0;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 9px 14px;
  color: var(--light-muted);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  transition: color 150ms ease, background-color 150ms ease, transform 150ms ease;
}

.nav-link > span {
  color: var(--coral);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.nav-link:hover {
  color: var(--butter);
  background: var(--plum);
}

.nav-link.active {
  color: var(--navy);
  border-color: var(--navy);
  background: var(--butter);
  box-shadow: 3px 3px 0 var(--coral);
  transform: rotate(-1deg);
}

.nav-link.active > span {
  color: var(--plum);
}

.sidebar-bottom {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-bottom p {
  margin: 0;
  color: var(--light-muted);
  font-size: 11px;
  white-space: nowrap;
}

.sidebar-bottom .button {
  min-width: 100px;
  padding: 8px 13px;
  font-size: 12px;
}

.workspace {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  min-width: 0;
  align-items: stretch;
  gap: 22px;
}

.workspace > * {
  min-width: 0;
}

.workspace-header {
  position: relative;
  display: flex;
  grid-column: 1 / -1;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 4px 24px;
  border-bottom: 2px dashed rgba(242, 151, 155, 0.42);
}

.workspace-header::after {
  content: "+";
  position: absolute;
  right: 2px;
  bottom: -14px;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  color: var(--navy);
  border: 2px solid var(--navy);
  border-radius: 50%;
  background: var(--coral);
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.workspace-header h1 {
  margin-bottom: 10px;
  color: var(--paper);
  font-size: clamp(48px, 6vw, 78px);
}

.workspace-header h1 > span {
  color: var(--coral);
}

.workspace-header p {
  margin-bottom: 0;
  color: var(--light-muted);
}

.header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  padding-bottom: 5px;
}

.session-chip,
.soft-badge {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 7px 13px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.session-chip {
  color: var(--butter);
  border: 2px solid var(--purple);
  border-radius: 99px;
  background: rgba(93, 34, 96, 0.65);
}

.online-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border: 2px solid var(--navy);
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 2px var(--coral);
}

.section-block,
.panel {
  scroll-margin-top: 124px;
}

.section-heading,
.panel-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-heading {
  margin: 0 2px 16px;
  color: var(--paper);
}

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

#overview {
  grid-column: 1 / 9;
  grid-row: 2;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
}

.stat-card {
  display: flex;
  min-width: 0;
  min-height: 126px;
  align-items: center;
  gap: 14px;
  padding: 20px 17px;
  color: var(--navy);
  border: 2px solid var(--navy);
  border-radius: var(--radius-md);
  box-shadow: 5px 5px 0 var(--plum);
}

.stat-card > div {
  min-width: 0;
}

.stat-card span:not(.stat-icon) {
  display: block;
  font-size: 12px;
  font-weight: 800;
}

.stat-card strong {
  display: block;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: clamp(28px, 3vw, 39px);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.stat-icon {
  display: grid;
  width: 43px;
  height: 43px;
  flex: 0 0 auto;
  place-items: center;
  border: 2px solid var(--navy);
  border-radius: 50%;
  background: var(--paper-bright);
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 900;
  transform: rotate(-5deg);
}

.stat-total {
  background: var(--butter);
}

.stat-active {
  color: var(--paper);
  background: var(--purple);
}

.stat-active .stat-icon {
  color: var(--navy);
  background: var(--butter);
}

.stat-unused {
  background: var(--coral);
}

.stat-unused .stat-icon {
  background: var(--butter);
}

.stat-revoked {
  color: var(--paper);
  background: var(--plum);
}

.stat-revoked .stat-icon {
  color: var(--navy);
  background: var(--coral);
}

/* display:contents 让原生成区与流程区直接参与十二列印刷网格。 */
.dashboard-grid {
  display: contents;
}

.panel {
  min-width: 0;
  padding: 26px;
  color: var(--navy);
  border: 3px solid var(--navy);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-print);
}

.generator-panel {
  grid-column: 1 / 9;
  grid-row: 3;
  background: var(--butter);
}

.generator-panel .section-kicker,
.cards-panel .section-kicker {
  color: var(--plum);
}

.soft-badge {
  flex: 0 0 auto;
  color: var(--paper);
  border: 2px solid var(--navy);
  border-radius: 99px;
  background: var(--purple);
  box-shadow: 3px 3px 0 var(--navy);
  transform: rotate(2deg);
}

.days-fieldset {
  min-width: 0;
  margin: 26px 0 20px;
  padding: 0;
  border: 0;
}

.days-fieldset legend {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 800;
}

.day-options {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
}

.day-option {
  min-width: 0;
  padding: 8px 6px;
  color: var(--navy);
  background: var(--paper-bright);
  box-shadow: 2px 2px 0 rgba(93, 34, 96, 0.42);
  font-size: 13px;
  font-weight: 800;
}

.day-option:hover:not(:disabled) {
  background: var(--coral);
  box-shadow: 3px 3px 0 var(--navy);
}

.day-option.selected {
  color: var(--paper);
  background: var(--plum);
  box-shadow: 3px 3px 0 var(--coral);
  transform: rotate(-1deg);
}

.generate-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 14px;
}

.custom-days {
  max-width: 280px;
}

.input-with-unit {
  position: relative;
  display: block;
}

.input-with-unit input {
  padding-right: 44px;
}

.input-with-unit > span {
  position: absolute;
  top: 50%;
  right: 16px;
  color: var(--plum);
  font-weight: 800;
  transform: translateY(-50%);
  pointer-events: none;
}

.generate-row > .button {
  min-width: 142px;
  min-height: 50px;
}

.flow-panel {
  position: relative;
  display: flex;
  grid-column: 9 / 13;
  grid-row: 2 / 4;
  flex-direction: column;
  overflow: hidden;
  color: var(--paper);
  border-color: var(--coral);
  background: var(--plum);
  box-shadow: 7px 7px 0 var(--purple);
}

.flow-panel .section-kicker {
  color: var(--butter);
}

.flow-panel h2 {
  max-width: 230px;
}

.flow-list {
  display: grid;
  gap: 25px;
  margin: 32px 0 28px;
  padding: 0;
  list-style: none;
}

.flow-list li {
  position: relative;
  display: flex;
  min-width: 0;
  gap: 13px;
}

.flow-list li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 41px;
  bottom: -24px;
  left: 17px;
  border-left: 2px dashed var(--coral);
}

.flow-list li > span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--navy);
  border: 2px solid var(--navy);
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 2px 2px 0 var(--butter);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 900;
}

.flow-list li:nth-child(2) > span {
  background: var(--butter);
  transform: rotate(5deg);
}

.flow-list strong {
  display: block;
  color: var(--butter);
  font-size: 16px;
}

.flow-list p {
  margin: 3px 0 0;
  color: #edd6e6;
  font-size: 12px;
  line-height: 1.65;
}

.flow-stamp {
  display: grid;
  width: 112px;
  height: 112px;
  align-self: flex-end;
  place-items: center;
  margin-top: auto;
  color: var(--coral);
  border: 2px dashed var(--coral);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.45;
  letter-spacing: 0.06em;
  text-align: center;
  transform: rotate(-9deg);
}

/* JS 动态卡密列表：所有原类名均有独立印刷样式。 */
.cards-panel {
  grid-column: 1 / -1;
  grid-row: 4;
  background: var(--paper);
  box-shadow: 8px 8px 0 var(--purple);
}

.cards-heading {
  align-items: flex-start;
}

.cards-heading p {
  margin: 7px 0 0;
}

.cards-panel .muted {
  color: var(--ink-soft);
}

.cards-list {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.license-card {
  min-width: 0;
  padding: 20px;
  color: var(--navy);
  border: 2px solid var(--navy);
  border-radius: 18px 12px 20px 13px;
  background: var(--paper-bright);
  box-shadow: 4px 4px 0 rgba(151, 66, 146, 0.45);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.license-card:nth-child(even) {
  border-radius: 12px 20px 13px 18px;
}

.license-card:hover {
  box-shadow: 6px 6px 0 rgba(151, 66, 146, 0.6);
  transform: translateY(-1px);
}

.license-card-header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 2px dashed rgba(93, 34, 96, 0.3);
}

.license-hint {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--plum);
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.025em;
}

.status-badge {
  display: inline-flex;
  min-height: 32px;
  flex: 0 0 auto;
  align-items: center;
  padding: 4px 11px;
  color: var(--navy);
  border: 2px solid var(--navy);
  border-radius: 99px;
  font-size: 11px;
  font-weight: 900;
}

.status-active {
  background: var(--butter);
}

.status-unused {
  background: var(--coral);
}

.status-revoked {
  color: var(--paper);
  background: var(--plum);
}

.status-expired {
  background: #d9cad9;
}

.license-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px 20px;
  margin: 0;
}

.license-meta > div {
  min-width: 0;
}

.license-meta dt {
  margin-bottom: 3px;
  color: #745d76;
  font-size: 11px;
  font-weight: 700;
}

.license-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--navy);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.license-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 2px dashed rgba(93, 34, 96, 0.3);
}

.license-actions .button {
  min-height: 44px;
  padding: 9px 15px;
  font-size: 12px;
}

.loading-state,
.empty-state {
  padding: 44px 20px;
  color: var(--ink-soft);
  text-align: center;
}

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  font-size: 13px;
  font-weight: 700;
}

.loading-dot {
  width: 19px;
  height: 19px;
  border: 3px solid var(--coral);
  border-top-color: var(--plum);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.empty-state img {
  width: 116px;
  height: 100px;
  margin: 0 auto 10px;
  object-fit: contain;
}

.empty-state h3 {
  margin-bottom: 6px;
  color: var(--plum);
  font-size: 20px;
}

.empty-state p {
  margin-bottom: 20px;
  font-size: 13px;
}

/* 安全设置右缩进两列，形成工作台最后一块非对称印版。 */
.password-panel {
  position: relative;
  display: grid;
  grid-column: 3 / 13;
  grid-row: 5;
  grid-template-columns: minmax(220px, 0.78fr) minmax(0, 1.22fr);
  gap: 42px;
  color: var(--paper);
  border-color: var(--butter);
  background: var(--purple);
  box-shadow: 8px 8px 0 var(--plum);
}

.password-intro {
  position: relative;
  min-width: 0;
}

.password-intro .section-kicker {
  color: var(--butter);
}

.password-intro p {
  max-width: 350px;
  margin: 14px 0 0;
  color: #f0d8e8;
  font-size: 13px;
}

.security-seal {
  display: grid;
  width: 94px;
  height: 94px;
  place-items: center;
  margin-top: 28px;
  color: var(--navy);
  border: 2px solid var(--navy);
  border-radius: 50%;
  background: var(--butter);
  box-shadow: 4px 4px 0 var(--coral);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.4;
  text-align: center;
  transform: rotate(8deg);
}

.password-form {
  display: grid;
  min-width: 0;
  gap: 15px;
}

.password-form .field {
  color: var(--paper);
}

.password-form .field-help,
.password-form .form-message {
  margin-top: -4px;
}

.password-form .field-help {
  color: #f3ddeb;
}

.password-form .form-message {
  color: var(--butter);
}

.password-form .button {
  justify-self: start;
}

.workspace-footer {
  grid-column: 1 / -1;
  padding: 14px 10px 0;
  color: var(--light-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.03em;
  text-align: center;
}

/* 原生 dialog 保留，复制与确认按钮样式沿用同一贴纸系统。 */
.dialog {
  color-scheme: light;
  width: min(540px, calc(100% - 32px));
  max-width: 100%;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 32px;
  overflow: auto;
  color: var(--navy);
  border: 3px solid var(--navy);
  border-radius: 28px 17px 30px 19px;
  outline: 2px solid var(--butter);
  background: var(--paper);
  box-shadow: 10px 10px 0 var(--purple);
}

.dialog::backdrop {
  background: rgba(22, 27, 50, 0.82);
}

.dialog .section-kicker {
  color: var(--plum);
}

.dialog h2 {
  margin-bottom: 12px;
  color: var(--plum);
  font-size: 28px;
}

.dialog > p {
  margin-bottom: 20px;
  color: var(--ink-soft);
  font-size: 13px;
}

.dialog-decoration,
.confirm-symbol {
  display: grid;
  width: 56px;
  height: 56px;
  margin-bottom: 20px;
  place-items: center;
  color: var(--navy);
  border: 2px solid var(--navy);
  border-radius: 50%;
  background: var(--butter);
  box-shadow: var(--shadow-sticker);
  font-family: var(--font-mono);
  font-size: 27px;
  font-weight: 900;
  transform: rotate(-6deg);
}

.confirm-symbol {
  background: var(--coral);
  transform: rotate(5deg);
}

.generated-card {
  display: block;
  width: 100%;
  min-height: 72px;
  padding: 19px 15px;
  overflow-wrap: anywhere;
  color: var(--plum);
  border: 2px dashed var(--plum);
  border-radius: var(--radius-sm);
  background: var(--butter);
  font-family: var(--font-mono);
  font-size: clamp(15px, 4vw, 20px);
  font-weight: 900;
  line-height: 1.55;
  text-align: center;
  user-select: all;
}

.dialog .form-message {
  margin: 12px 0 0;
  text-align: center;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 26px;
}

.card-dialog .dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

/* 页面提示 */
.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1200;
  display: grid;
  width: min(390px, calc(100% - 40px));
  gap: 12px;
  pointer-events: none;
}

.toast {
  min-width: 0;
  padding: 13px 16px;
  color: var(--navy);
  border: 2px solid var(--navy);
  border-radius: var(--radius-sm);
  background: var(--paper);
  box-shadow: 5px 5px 0 var(--purple);
  font-size: 13px;
  font-weight: 750;
  overflow-wrap: anywhere;
  animation: toast-in 180ms ease-out;
}

.toast.success {
  background: var(--butter);
}

.toast.error {
  background: var(--coral);
}

.noscript-message {
  position: fixed;
  right: 20px;
  bottom: 20px;
  left: 20px;
  z-index: 2000;
  margin: 0;
  padding: 16px;
  color: var(--navy);
  border: 2px solid var(--navy);
  border-radius: var(--radius-sm);
  background: var(--coral);
  box-shadow: 5px 5px 0 var(--purple);
  font-weight: 800;
  text-align: center;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 1024 附近：主区八列缩为七列，流程仍保持独立辅助栏。 */
@media (max-width: 1180px) {
  .admin-layout {
    gap: 22px;
  }

  .sidebar {
    gap: 12px;
  }

  .sidebar-brand {
    padding-right: 13px;
  }

  .sidebar-bottom p {
    display: none;
  }

  .nav-link {
    padding-inline: 11px;
  }

  .workspace {
    gap: 18px;
  }

  #overview,
  .generator-panel {
    grid-column: 1 / 8;
  }

  .flow-panel {
    grid-column: 8 / 13;
  }

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

  .stat-card {
    min-height: 104px;
  }

  .password-panel {
    grid-column: 2 / 13;
    gap: 28px;
  }

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

/* 768 附近：登录改为上下跨页，后台保留七比五的非对称主辅关系。 */
@media (max-width: 900px) {
  html {
    scroll-padding-top: 142px;
  }

  .login-shell {
    padding: 36px 24px 48px;
  }

  .login-card {
    grid-template-columns: minmax(0, 1fr);
    width: min(720px, 100%);
  }

  .login-art {
    grid-column: 1;
    min-height: 350px;
    padding: 28px 32px;
    border-right: 0;
    border-bottom: 3px solid var(--navy);
    border-radius: 30px 14px 0 0;
  }

  .login-art::after {
    right: -8px;
    bottom: -55px;
    left: auto;
    font-size: 190px;
  }

  .login-art-copy {
    margin: 48px 0 0;
  }

  .login-art-copy h2 {
    max-width: 470px;
    font-size: 39px;
  }

  .login-art-copy p {
    margin-bottom: 0;
  }

  .login-mascot {
    right: 22px;
    bottom: 25px;
    width: 200px;
    max-height: 190px;
  }

  .art-note {
    margin-top: 22px;
  }

  .login-form-wrap {
    grid-column: 1;
    padding: 42px 48px;
    border-radius: 0 0 34px 18px;
  }

  .login-form-wrap h1 br {
    display: none;
  }

  .section-block,
  .panel {
    scroll-margin-top: 142px;
  }

  #overview {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .generator-panel {
    grid-column: 1 / 8;
    grid-row: 3;
  }

  .flow-panel {
    grid-column: 8 / 13;
    grid-row: 3;
  }

  .flow-stamp {
    width: 90px;
    height: 90px;
    font-size: 10px;
  }

  .password-panel {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr);
  }

  .password-intro p {
    max-width: 560px;
  }

  .security-seal {
    position: absolute;
    right: 4px;
    bottom: 0;
    margin: 0;
  }
}

/* 窄平板与手机：回到单栏，但不退化成通用侧栏模板。 */
@media (max-width: 760px) {
  html {
    scroll-padding-top: 22px;
  }

  .admin-layout {
    gap: 18px;
    padding: 12px 14px 28px;
  }

  .sidebar {
    position: relative;
    top: auto;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 12px;
  }

  .sidebar-brand {
    grid-column: 1;
    grid-row: 1;
    border-right: 0;
  }

  .side-nav {
    display: grid;
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .sidebar-bottom {
    grid-column: 2;
    grid-row: 1;
  }

  .workspace {
    display: flex;
    flex-direction: column;
    gap: 18px;
  }

  .dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .generator-panel,
  .flow-panel {
    grid-column: 1;
    grid-row: auto;
  }

  .workspace-header {
    padding: 16px 2px 22px;
  }

  .workspace-header h1 {
    font-size: clamp(45px, 9vw, 64px);
  }

  .section-block,
  .panel {
    scroll-margin-top: 22px;
  }

  .flow-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
  }

  .flow-list li:not(:last-child)::after {
    top: 17px;
    right: -12px;
    bottom: auto;
    left: auto;
    width: 20px;
    border-top: 2px dashed var(--coral);
    border-left: 0;
  }

  .flow-stamp {
    position: absolute;
    top: 20px;
    right: 22px;
    width: 78px;
    height: 78px;
    margin: 0;
    font-size: 9px;
  }

  .flow-panel h2 {
    max-width: calc(100% - 90px);
  }
}

@media (max-width: 640px) {
  body {
    font-size: 14px;
  }

  .login-shell {
    padding: 26px 16px 38px;
  }

  .login-card {
    box-shadow: 9px 9px 0 var(--purple);
  }

  .login-card::after {
    display: none;
  }

  .login-art {
    min-height: 320px;
    padding: 25px;
  }

  .login-art-copy {
    margin-top: 44px;
  }

  .login-art-copy h2 {
    font-size: 34px;
  }

  .login-art-copy p {
    max-width: 260px;
    font-size: 12px;
  }

  .login-mascot {
    right: 10px;
    width: 155px;
    max-height: 155px;
  }

  .print-register {
    top: 37px;
    right: 26px;
  }

  .login-form-wrap {
    padding: 36px 28px;
  }

  .sidebar {
    padding: 10px;
  }

  .sidebar-brand {
    min-height: 48px;
    padding: 0;
  }

  .sidebar-brand img {
    width: 40px;
    height: 40px;
  }

  .sidebar-brand strong {
    font-size: 21px;
  }

  .sidebar-brand small {
    margin-top: 3px;
    font-size: 9px;
  }

  .sidebar-bottom .button {
    width: auto;
    min-width: 88px;
    padding-inline: 10px;
  }

  .nav-link {
    padding: 8px 7px;
    font-size: 12px;
  }

  .nav-link > span {
    display: none;
  }

  .workspace-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
    padding-bottom: 0;
  }

  .panel {
    padding: 21px;
  }

  .stats-grid {
    gap: 11px;
  }

  .stat-card {
    min-height: 108px;
    gap: 10px;
    padding: 15px 13px;
  }

  .stat-icon {
    width: 37px;
    height: 37px;
    font-size: 17px;
  }

  .generator-panel .panel-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

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

  .generate-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .custom-days {
    max-width: none;
  }

  .generate-row > .button {
    width: 100%;
  }

  .flow-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }

  .flow-list li:not(:last-child)::after {
    top: 41px;
    right: auto;
    bottom: -21px;
    left: 17px;
    width: 0;
    border-top: 0;
    border-left: 2px dashed var(--coral);
  }

  .flow-stamp {
    width: 70px;
    height: 70px;
  }

  .cards-heading {
    flex-direction: column;
  }

  .cards-heading .button {
    width: 100%;
  }

  .license-card {
    padding: 16px;
  }

  .license-hint {
    font-size: 14px;
  }

  .license-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
  }

  .license-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .license-actions .button:only-child {
    grid-column: 1 / -1;
  }

  .password-form .button {
    width: 100%;
    justify-self: stretch;
  }

  .security-seal {
    position: static;
    width: 80px;
    height: 80px;
    margin-top: 22px;
  }

  .dialog {
    padding: 26px 21px;
  }

  .card-dialog .dialog-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .dialog-actions .button {
    width: 100%;
  }

  .toast-region {
    right: 12px;
    bottom: 12px;
    width: calc(100% - 24px);
  }
}

/* 375–520：登录保留独立品牌签与错位标题，所有数据区双列收纳。 */
@media (max-width: 520px) {
  .login-shell {
    padding: 24px 14px 34px;
  }

  .login-art {
    display: none;
  }

  .login-form-wrap {
    min-height: 570px;
    padding: 34px 27px 30px;
    border-radius: 30px 14px 34px 18px;
  }

  .login-form-wrap::before {
    top: 104px;
    right: 15px;
  }

  .mobile-brand {
    display: flex;
    align-self: flex-start;
    gap: 10px;
    margin-bottom: 54px;
    padding: 7px 11px;
    color: var(--navy);
    border: 2px solid var(--navy);
    border-radius: var(--radius-sm);
    background: var(--butter);
    box-shadow: 3px 3px 0 var(--coral);
    font-size: 19px;
    font-weight: 900;
    line-height: 1.1;
    transform: rotate(-2deg);
  }

  .mobile-brand small {
    display: block;
    margin-top: 4px;
    color: var(--plum);
    font-size: 10px;
    letter-spacing: 0.12em;
  }

  .login-form-wrap h1 {
    font-size: 52px;
  }

  .login-form-wrap h1 br {
    display: initial;
  }

  .login-form-wrap > .muted {
    margin-bottom: 24px;
  }

  .admin-layout {
    padding: 10px 12px 26px;
  }

  .section-heading {
    align-items: flex-start;
  }

  .section-heading > .small {
    padding-top: 4px;
    text-align: right;
  }

  .stat-card strong {
    font-size: 30px;
  }

  .license-card-header {
    align-items: flex-start;
  }

  .status-badge {
    padding-inline: 9px;
  }
}

@media (max-width: 380px) {
  .login-form-wrap {
    min-height: 550px;
    padding: 30px 22px 26px;
  }

  .mobile-brand {
    margin-bottom: 42px;
  }

  .login-form-wrap h1 {
    font-size: 48px;
  }

  .header-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .header-actions .button,
  .session-chip {
    width: 100%;
  }

  .sidebar-brand small {
    display: none;
  }

  .sidebar-bottom .button {
    min-width: 82px;
    font-size: 11px;
  }

  .nav-link {
    font-size: 11px;
  }

  .panel {
    padding: 18px;
  }

  .stat-card {
    gap: 8px;
    padding: 13px 10px;
  }

  .stat-card span:not(.stat-icon) {
    font-size: 11px;
  }

  .stat-icon {
    width: 34px;
    height: 34px;
  }

  .section-heading {
    flex-direction: column;
    gap: 5px;
  }

  .section-heading > .small {
    padding-top: 0;
    text-align: left;
  }

  .license-actions {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (pointer: coarse) {
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .cloud-background video {
    display: none;
  }

  .button:hover:not(:disabled),
  .day-option:hover:not(:disabled),
  .icon-button:hover:not(:disabled),
  .license-card:hover {
    transform: none;
  }
}

/* 用户单图标素材：装饰不接管鼠标，也不进入表单与列表阅读区。 */
.sticker-decor {
  position: absolute;
  z-index: 1;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(4px 5px 0 rgba(22, 27, 50, 0.24));
}
.workspace-sticker {
  top: -18px;
  right: 8px;
  width: 78px;
  transform: rotate(4deg);
}
.generator-panel { position: relative; }
.generator-sticker {
  top: 19px;
  right: 190px;
  width: 62px;
  transform: rotate(-6deg);
}
.flow-sticker {
  bottom: 25px;
  left: 22px;
  width: 70px;
  transform: rotate(6deg);
}
@media (max-width: 1180px) {
  .workspace-sticker { top: -13px; width: 68px; }
  .generator-sticker { right: 170px; width: 50px; }
  .flow-sticker { width: 56px; }
}
@media (max-width: 900px) {
  .workspace-sticker { top: -10px; width: 60px; }
  .generator-sticker, .flow-sticker { display: none; }
}
@media (max-width: 760px) {
  .workspace-sticker { display: none; }
}
