/* 懒洋洋摸金 PADDI 发卡后台：奶油纸张、巧克力描边与手绘贴纸。 */
:root {
  color-scheme: light;
  --page: #ece0c6;
  --paper: #fffaf0;
  --paper-deep: #f4ead6;
  --surface: rgba(255, 250, 240, 0.92);
  --surface-solid: #fffaf0;
  --chocolate: #40251b;
  --cocoa: #6b4534;
  --muted: #755e50;
  --terracotta: #d96343;
  --terracotta-dark: #9d3e29;
  --terracotta-pale: #f8d7c5;
  --honey: #f5c95c;
  --honey-pale: #fbe8a9;
  --sage: #c7d7a8;
  --sage-deep: #355c3b;
  --danger-pale: #f6c7b8;
  --line: rgba(64, 37, 27, 0.26);
  --shadow: 7px 8px 0 rgba(64, 37, 27, 0.18);
  --shadow-small: 3px 4px 0 var(--chocolate);
  --radius-lg: 30px;
  --radius-md: 22px;
  --radius-sm: 14px;
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", system-ui, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

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

body {
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--chocolate);
  background: var(--page);
  font-size: 15px;
  line-height: 1.65;
  font-style: normal;
  -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,
svg {
  display: block;
  max-width: 100%;
}

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

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

h1,
h2,
h3 {
  font-style: normal;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(30px, 3vw, 42px);
  line-height: 1.18;
  letter-spacing: -0.035em;
}

h2 {
  margin-bottom: 0;
  font-size: 23px;
  line-height: 1.3;
}

h3 {
  line-height: 1.4;
}

[hidden] {
  display: none !important;
}

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

::selection {
  color: var(--chocolate);
  background: var(--honey);
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 2000;
  min-height: 44px;
  padding: 9px 16px;
  border: 2px solid var(--chocolate);
  border-radius: 14px;
  background: var(--honey);
  box-shadow: var(--shadow-small);
  transform: translateY(-160%);
}

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

.brand-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: var(--page);
}

.brand-background::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(244, 234, 214, 0.46);
}

.brand-background > img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  filter: saturate(0.82) brightness(0.72);
  transform: scale(1.06);
  animation: background-drift var(--background-duration, 87s) ease-in-out infinite alternate;
  will-change: transform;
}

.brand-background video {
  display: none !important;
}

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

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

.small {
  font-size: 13px;
}

.eyebrow,
.section-kicker {
  display: block;
  margin-bottom: 7px;
  color: var(--terracotta-dark);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: 0.16em;
}

.paddi-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

/* 通用控件 */
.button,
.icon-button,
.day-option,
.dialog-close,
.background-settings-open {
  min-height: 44px;
  border: 2px solid var(--chocolate);
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

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

.button:hover:not(:disabled),
.day-option:hover:not(:disabled),
.background-settings-open:hover:not(:disabled) {
  transform: translate(-1px, -2px) rotate(-0.5deg);
  box-shadow: 5px 6px 0 var(--chocolate);
}

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

.button.primary {
  color: var(--chocolate);
  background: var(--honey);
  box-shadow: var(--shadow-small);
}

.button.primary:hover:not(:disabled) {
  background: #ffda73;
}

.button.secondary {
  color: var(--chocolate);
  background: var(--paper);
  box-shadow: 2px 3px 0 var(--chocolate);
}

.button.secondary:hover:not(:disabled) {
  background: var(--honey-pale);
}

.button.danger {
  color: #672619;
  background: var(--danger-pale);
  box-shadow: 2px 3px 0 #672619;
}

.button.danger:hover:not(:disabled) {
  background: #f9b39e;
}

.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: 14px;
  height: 14px;
  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: 7px;
  color: var(--cocoa);
  font-size: 13px;
  font-weight: 800;
}

.field input {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 11px 14px;
  color: var(--chocolate);
  border: 2px solid var(--chocolate);
  border-radius: var(--radius-sm);
  outline: none;
  background: rgba(255, 253, 247, 0.96);
  font-weight: 600;
  transition: box-shadow 140ms ease, background-color 140ms ease;
}

.field input:focus {
  background: #fff;
  box-shadow: 3px 4px 0 var(--terracotta);
}

.field input::placeholder {
  color: #8b7162;
}

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

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

.password-control .icon-button {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 62px;
  min-height: 44px;
  padding: 6px 10px;
  color: var(--terracotta-dark);
  border: 0;
  border-left: 2px solid var(--line);
  border-radius: 0 12px 12px 0;
  background: var(--honey-pale);
  font-size: 12px;
  font-weight: 800;
}

.form-message {
  min-height: 0;
  margin: 8px 0 0;
  color: #963724;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

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

.field-help {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.background-settings-open {
  position: fixed;
  top: 22px;
  right: 24px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 2px 3px 0 var(--chocolate);
  font-size: 12px;
  font-weight: 800;
}

/* 登录窗口 */
.login-shell {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  padding: 84px 24px 36px;
}

.login-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(360px, 0.94fr);
  width: min(1040px, 100%);
  min-width: 0;
  overflow: hidden;
  border: 2px solid var(--chocolate);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 10px 12px 0 rgba(64, 37, 27, 0.22);
}

.window-bar {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: 1fr auto 1fr;
  min-height: 46px;
  align-items: center;
  gap: 12px;
  padding: 8px 18px;
  color: var(--cocoa);
  border-bottom: 2px solid var(--chocolate);
  background: var(--honey-pale);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
}

.window-bar > :last-child {
  text-align: right;
}

.window-dots {
  display: flex;
  gap: 7px;
}

.window-dots i {
  width: 11px;
  height: 11px;
  border: 1.5px solid var(--chocolate);
  border-radius: 50%;
  background: var(--terracotta);
}

.window-dots i:nth-child(2) {
  background: var(--honey);
}

.window-dots i:nth-child(3) {
  background: var(--sage);
}

.login-art {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 570px;
  flex-direction: column;
  padding: 30px 38px 26px;
  overflow: hidden;
  border-right: 2px solid var(--chocolate);
  background: rgba(245, 201, 92, 0.74);
}

.login-art::before {
  content: "PADDI";
  position: absolute;
  right: -14px;
  bottom: 116px;
  color: rgba(64, 37, 27, 0.09);
  font-family: "Arial Rounded MT Bold", "Microsoft YaHei", sans-serif;
  font-size: 102px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.08em;
  transform: rotate(-8deg);
}

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

.brand-lockup {
  position: relative;
  z-index: 2;
  font-size: 23px;
  line-height: 1.15;
}

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

.brand-lockup small {
  margin-top: 5px;
  color: var(--cocoa);
  font-size: 9px;
  letter-spacing: 0.14em;
}

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

.login-art-copy {
  position: relative;
  z-index: 2;
  margin-top: 42px;
}

.login-art-copy h2 {
  margin-bottom: 16px;
  font-size: clamp(29px, 3.3vw, 41px);
  line-height: 1.35;
  letter-spacing: -0.04em;
}

.login-art-copy p {
  max-width: 330px;
  color: var(--cocoa);
  font-weight: 600;
}

.login-mascot {
  position: absolute;
  right: 22px;
  bottom: 42px;
  z-index: 1;
  width: min(270px, 58%);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(5px 8px 0 rgba(64, 37, 27, 0.13));
  transform: rotate(3deg);
}

.art-note {
  position: relative;
  z-index: 3;
  align-self: flex-start;
  margin-top: auto;
  padding: 7px 12px;
  color: var(--chocolate);
  border: 1.5px solid var(--chocolate);
  border-radius: 999px;
  background: var(--paper);
  font-size: 11px;
  font-weight: 700;
  transform: rotate(-1deg);
}

.art-note span {
  color: var(--sage-deep);
}

.login-form-wrap {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 50px 46px;
  background: rgba(255, 250, 240, 0.86);
}

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

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

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

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

.security-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.security-note .paddi-icon {
  width: 17px;
  height: 17px;
  color: var(--sage-deep);
}

.mobile-brand {
  display: none;
}

/* 后台桌面 */
.admin-layout {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  gap: 24px;
  width: min(1520px, 100%);
  min-width: 0;
  margin: 0 auto;
  padding: 24px;
}

.sidebar {
  position: sticky;
  top: 24px;
  display: flex;
  min-width: 0;
  height: calc(100vh - 48px);
  height: calc(100svh - 48px);
  flex-direction: column;
  padding: 24px 16px 18px;
  overflow: hidden;
  border: 2px solid var(--chocolate);
  border-radius: var(--radius-lg);
  background: rgba(255, 250, 240, 0.92);
  box-shadow: var(--shadow);
}

.sidebar::after {
  content: "摸金中";
  position: absolute;
  right: -21px;
  bottom: 108px;
  padding: 4px 26px;
  color: var(--chocolate);
  border: 1.5px solid var(--chocolate);
  background: var(--honey);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  transform: rotate(-90deg);
}

.sidebar-brand {
  min-height: 72px;
  padding: 4px 6px 20px;
  border-bottom: 2px dashed var(--line);
}

.brand-stamp {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  place-items: center;
  border: 2px solid var(--chocolate);
  border-radius: 15px;
  background: var(--terracotta);
  box-shadow: 2px 3px 0 var(--chocolate);
  color: var(--paper);
  font-family: "Arial Rounded MT Bold", sans-serif;
  font-size: 25px;
  font-weight: 900;
  transform: rotate(-4deg);
}

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

.sidebar-brand strong {
  font-size: 20px;
  line-height: 1.25;
}

.sidebar-brand small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.side-nav {
  display: grid;
  gap: 10px;
  margin-top: 25px;
}

.nav-link {
  display: flex;
  min-width: 0;
  min-height: 48px;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  color: var(--cocoa);
  border: 2px solid transparent;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 800;
  transition: transform 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

.nav-link:hover {
  border-color: var(--line);
  background: var(--paper-deep);
  transform: translateX(2px);
}

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

.sidebar-bottom {
  margin-top: auto;
}

.sidebar-bottom p {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.sidebar-bottom p span {
  display: block;
  margin-bottom: 5px;
  overflow-wrap: anywhere;
  color: var(--terracotta-dark);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
  font-weight: 800;
}

.workspace {
  min-width: 0;
  padding: 0 0 20px;
}

.workspace-header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
  padding: 24px 26px;
  border: 2px solid var(--chocolate);
  border-radius: var(--radius-lg);
  background: rgba(255, 250, 240, 0.88);
  box-shadow: var(--shadow);
}

.workspace-title {
  min-width: 0;
}

.workspace-header h1 {
  margin-bottom: 5px;
}

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

.header-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.session-chip,
.soft-badge {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  color: var(--cocoa);
  border: 1.5px solid var(--chocolate);
  border-radius: 999px;
  background: var(--paper);
  font-size: 12px;
  font-weight: 700;
}

.online-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border: 1px solid var(--chocolate);
  border-radius: 50%;
  background: #7ca866;
}

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

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

.section-heading {
  margin: 0 4px 14px;
}

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

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

.stat-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 128px;
  align-items: center;
  gap: 15px;
  padding: 24px 18px;
  overflow: hidden;
  border: 2px solid var(--chocolate);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: 4px 5px 0 rgba(64, 37, 27, 0.82);
}

.stat-card:nth-child(odd) {
  transform: rotate(-0.4deg);
}

.stat-card:nth-child(even) {
  transform: rotate(0.4deg);
}

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

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

.stat-card strong {
  display: block;
  margin-top: 1px;
  font-size: 35px;
  line-height: 1.2;
}

.stat-card > small {
  position: absolute;
  top: 10px;
  right: 11px;
  color: var(--cocoa);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.stat-icon {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  place-items: center;
  border: 1.5px solid var(--chocolate);
  border-radius: 15px;
  background: rgba(255, 250, 240, 0.55);
  font-size: 22px;
  font-weight: 800;
}

.stat-total {
  background: #f6d68b;
}

.stat-active {
  background: #d7e2ba;
}

.stat-unused {
  background: #f9e8b5;
}

.stat-revoked {
  background: #efc4b2;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(270px, 0.85fr);
  gap: 18px;
  margin-top: 22px;
}

.panel {
  position: relative;
  min-width: 0;
  padding: 26px;
  border: 2px solid var(--chocolate);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.generator-panel {
  padding-right: 154px;
}

.generator-panel .panel-heading {
  min-height: 98px;
  align-items: flex-start;
}

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

.generator-mascot {
  position: absolute;
  top: 14px;
  right: 18px;
  width: 124px;
  height: 124px;
  object-fit: contain;
  filter: drop-shadow(3px 5px 0 rgba(64, 37, 27, 0.12));
  transform: rotate(4deg);
}

.soft-badge {
  position: absolute;
  top: 100px;
  right: 18px;
  min-height: 30px;
  padding: 3px 10px;
  background: var(--honey-pale);
  font-size: 10px;
  transform: rotate(-2deg);
}

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

.days-fieldset legend {
  margin-bottom: 9px;
  color: var(--cocoa);
  font-size: 13px;
  font-weight: 800;
}

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

.day-option {
  min-width: 0;
  padding: 8px 6px;
  color: var(--cocoa);
  border-radius: 13px;
  background: var(--paper);
  box-shadow: 2px 2px 0 var(--chocolate);
  font-size: 13px;
  font-weight: 800;
}

.day-option.selected {
  color: var(--chocolate);
  background: var(--terracotta-pale);
  box-shadow: 2px 3px 0 var(--terracotta-dark);
}

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

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

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

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

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

.flow-panel {
  background: rgba(244, 234, 214, 0.94);
}

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

.flow-list li {
  position: relative;
  display: flex;
  min-width: 0;
  gap: 12px;
  padding: 13px 0;
  border-top: 1.5px dashed var(--line);
}

.flow-list li > span {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--chocolate);
  border: 1.5px solid var(--chocolate);
  border-radius: 50%;
  background: var(--honey);
  font-size: 12px;
  font-weight: 900;
  transform: rotate(-4deg);
}

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

.flow-list li:nth-child(3) > span {
  background: var(--sage);
}

.flow-list strong {
  display: block;
  font-size: 14px;
}

.flow-list p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

/* 卡密列表 */
.cards-panel {
  margin-top: 22px;
}

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

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

.cards-list {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.license-card {
  min-width: 0;
  padding: 19px;
  border: 2px solid var(--chocolate);
  border-radius: 20px;
  background: rgba(255, 253, 247, 0.88);
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.license-card:nth-child(odd) {
  border-radius: 24px 19px 22px 18px;
}

.license-card:hover {
  box-shadow: 4px 5px 0 rgba(64, 37, 27, 0.16);
  transform: translateY(-1px);
}

.license-card-header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.license-hint {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--chocolate);
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

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

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

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

.status-revoked {
  background: var(--danger-pale);
}

.status-expired {
  background: #ded5c7;
}

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

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

.license-meta dt {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 11px;
}

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

.license-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 17px;
  padding-top: 15px;
  border-top: 2px dashed var(--line);
}

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

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

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

.loading-dot {
  width: 18px;
  height: 18px;
  border: 2px solid var(--terracotta-pale);
  border-top-color: var(--terracotta-dark);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.empty-state {
  border-top: 2px dashed var(--line);
}

.empty-state .empty-mascot {
  width: 132px;
  height: 118px;
  margin: 0 auto 8px;
  object-fit: contain;
  filter: drop-shadow(3px 4px 0 rgba(64, 37, 27, 0.1));
  transform: rotate(-2deg);
}

.empty-state h3 {
  margin-bottom: 5px;
  color: var(--chocolate);
  font-size: 18px;
}

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

/* 安全设置 */
.password-panel {
  display: grid;
  grid-template-columns: minmax(230px, 0.8fr) minmax(0, 1.2fr);
  gap: 44px;
  margin-top: 22px;
}

.password-intro p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.security-tape {
  display: inline-block;
  margin-top: 24px;
  padding: 6px 12px;
  border: 1.5px solid var(--chocolate);
  background: var(--honey-pale);
  font-size: 11px;
  font-weight: 800;
  transform: rotate(-2deg);
}

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

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

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

.workspace-footer {
  padding: 30px 10px 8px;
  color: var(--cocoa);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

/* 对话框与反馈贴纸 */
.dialog {
  width: min(530px, calc(100% - 32px));
  max-width: 100%;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 30px;
  overflow: auto;
  color: var(--chocolate);
  border: 2px solid var(--chocolate);
  border-radius: 28px;
  background: var(--paper);
  box-shadow: 9px 11px 0 rgba(64, 37, 27, 0.32);
}

.dialog::backdrop {
  background: rgba(48, 28, 20, 0.5);
  backdrop-filter: blur(4px);
}

.dialog h2 {
  margin-bottom: 10px;
  font-size: 26px;
}

.dialog > p {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 13px;
}

.dialog-sticker,
.confirm-art-wrap {
  position: relative;
  width: fit-content;
  margin-bottom: 14px;
}

.dialog-sticker > img {
  width: 116px;
  height: 92px;
  object-fit: contain;
  transform: rotate(-3deg);
}

.dialog-decoration,
.confirm-symbol {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 2px solid var(--chocolate);
  border-radius: 50%;
  font-size: 20px;
  font-weight: 900;
}

.dialog-decoration {
  position: absolute;
  right: -8px;
  bottom: 0;
  background: var(--sage);
}

.confirm-art {
  width: 90px;
  height: 90px;
  object-fit: contain;
  transform: rotate(3deg);
}

.confirm-symbol {
  position: absolute;
  right: -7px;
  bottom: 1px;
  background: var(--honey);
}

.generated-card {
  display: block;
  width: 100%;
  min-height: 66px;
  padding: 18px 14px;
  overflow-wrap: anywhere;
  color: var(--chocolate);
  border: 2px dashed var(--terracotta-dark);
  border-radius: 16px;
  background: var(--honey-pale);
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: clamp(15px, 4vw, 20px);
  font-weight: 900;
  line-height: 1.5;
  text-align: center;
  user-select: all;
}

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

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

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

.dialog-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.dialog-close {
  display: grid;
  width: 44px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  background: var(--terracotta-pale);
  box-shadow: 2px 3px 0 var(--chocolate);
}

.dialog-close:hover {
  background: var(--honey);
}

.background-dialog {
  width: min(560px, calc(100% - 32px));
}

.background-setting {
  padding: 18px 0;
  border-top: 2px dashed var(--line);
}

.background-setting-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  font-weight: 800;
}

.background-setting-head output {
  min-width: 66px;
  padding: 3px 9px;
  border: 1.5px solid var(--chocolate);
  border-radius: 999px;
  background: var(--honey-pale);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  text-align: center;
}

.background-range {
  width: 100%;
  min-height: 44px;
  margin: 0;
  accent-color: var(--terracotta);
  cursor: pointer;
}

.background-range::-webkit-slider-runnable-track {
  height: 10px;
  border: 1.5px solid var(--chocolate);
  border-radius: 999px;
  background: var(--paper-deep);
}

.background-range::-webkit-slider-thumb {
  width: 24px;
  height: 24px;
  margin-top: -8.5px;
  border: 2px solid var(--chocolate);
  border-radius: 50%;
  background: var(--honey);
  box-shadow: 2px 2px 0 var(--chocolate);
  -webkit-appearance: none;
}

.background-range::-moz-range-track {
  height: 8px;
  border: 1.5px solid var(--chocolate);
  border-radius: 999px;
  background: var(--paper-deep);
}

.background-range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border: 2px solid var(--chocolate);
  border-radius: 50%;
  background: var(--honey);
  box-shadow: 2px 2px 0 var(--chocolate);
}

.range-labels {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
}

.background-settings-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 18px;
  border-top: 2px dashed var(--line);
}

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

.toast {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  min-width: 0;
  align-items: center;
  gap: 12px;
  padding: 11px 15px 11px 10px;
  color: var(--chocolate);
  border: 2px solid var(--chocolate);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 5px 6px 0 rgba(64, 37, 27, 0.3);
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
  animation: toast-in 180ms ease-out;
}

.toast img {
  width: 48px;
  height: 44px;
  object-fit: contain;
}

.toast.success {
  background: #e4ebce;
}

.toast.error {
  background: #f8d4c4;
}

.noscript-message {
  position: fixed;
  right: 20px;
  bottom: 20px;
  left: 20px;
  z-index: 2000;
  margin: 0;
  padding: 16px;
  color: var(--chocolate);
  border: 2px solid var(--chocolate);
  border-radius: 18px;
  background: var(--danger-pale);
  text-align: center;
}

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

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

@keyframes background-drift {
  from { transform: scale(1.06) translate3d(-0.6%, -0.4%, 0); }
  to { transform: scale(1.1) translate3d(0.7%, 0.5%, 0); }
}

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

@media (max-width: 1220px) {
  .admin-layout {
    grid-template-columns: 218px minmax(0, 1fr);
    gap: 18px;
    padding: 18px;
  }

  .sidebar {
    top: 18px;
    height: calc(100vh - 36px);
    height: calc(100svh - 36px);
  }

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

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

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

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

  .flow-list li {
    align-items: flex-start;
    border-top: 0;
    border-left: 1.5px dashed var(--line);
    padding: 4px 12px;
  }

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

@media (max-width: 900px) {
  html {
    scroll-padding-top: 16px;
  }

  .background-settings-open {
    top: 14px;
    right: 16px;
  }

  .login-shell {
    padding: 78px 16px 24px;
  }

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

  .window-bar {
    grid-template-columns: 1fr auto;
  }

  .window-bar > :last-child {
    display: none;
  }

  .login-art {
    display: none;
  }

  .login-form-wrap {
    min-height: 510px;
    padding: 42px 34px;
  }

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

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

  .mobile-brand strong {
    font-size: 20px;
  }

  .mobile-brand small {
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 0.08em;
  }

  .admin-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    padding: 72px 14px 14px;
  }

  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    height: auto;
    align-items: center;
    gap: 12px;
    padding: 13px;
    border-radius: 24px;
  }

  .sidebar::after {
    display: none;
  }

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

  .brand-stamp {
    width: 42px;
    height: 42px;
  }

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

  .sidebar-brand small,
  .sidebar-bottom p {
    display: none;
  }

  .side-nav {
    display: flex;
    min-width: 0;
    justify-content: center;
    gap: 6px;
    margin: 0;
  }

  .nav-link {
    min-height: 44px;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    font-size: 12px;
  }

  .nav-link .paddi-icon {
    display: none;
  }

  .sidebar-bottom {
    margin: 0;
  }

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

  .sidebar-bottom .paddi-icon {
    display: none;
  }

  .workspace-header {
    padding: 22px;
  }

  .password-panel {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
}

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

  h1 {
    font-size: 30px;
  }

  h2 {
    font-size: 21px;
  }

  .background-settings-open {
    padding: 8px 12px;
  }

  .background-settings-open span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .admin-layout {
    padding-right: 9px;
    padding-left: 9px;
  }

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

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

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

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

  .nav-link {
    padding: 8px 5px;
    text-align: center;
  }

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

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

  .stats-grid {
    gap: 11px;
  }

  .stat-card {
    min-height: 110px;
    gap: 10px;
    padding: 19px 13px;
    border-radius: 20px;
  }

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

  .stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 18px;
  }

  .panel {
    padding: 20px;
    border-radius: 24px;
  }

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

  .generator-panel {
    padding-right: 20px;
    padding-top: 142px;
  }

  .generator-panel .panel-heading {
    min-height: 0;
  }

  .generator-mascot {
    top: 10px;
    right: 14px;
    width: 112px;
    height: 112px;
  }

  .soft-badge {
    top: 48px;
    right: auto;
    left: 20px;
  }

  .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: 0;
  }

  .flow-list li {
    border-top: 1.5px dashed var(--line);
    border-left: 0;
    padding: 13px 0;
  }

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

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

  .license-card {
    padding: 16px;
  }

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

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

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

  .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;
  }

  .dialog {
    padding: 24px 20px;
    border-radius: 24px;
  }

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

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

  .background-settings-footer {
    align-items: stretch;
    flex-direction: column;
  }

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

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

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

  .stat-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .session-chip {
    white-space: normal;
  }

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

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

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

@keyframes paddi-admin-breathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-5px) scale(1.025); }
}

.login-mascot,
.generator-mascot,
.empty-state .empty-mascot,
.dialog-sticker > img,
.confirm-art-wrap img {
  animation: paddi-admin-breathe 5.2s ease-in-out infinite;
  transform-origin: 50% 82%;
}

.generator-mascot,
.dialog-sticker > img { animation-delay: -2.2s; }

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

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

  .brand-background > img {
    animation: none !important;
    transform: scale(1.06);
    will-change: auto;
  }
}
