/* 雀月 AI 视觉 · 多彩涂鸦艺术系统 */
:root {
  color-scheme: light;
  --paper: #fff9ec;
  --paper-deep: #f4ead7;
  --white: #fffefa;
  --ink: #201e2d;
  --muted: #736e7d;
  --line: #201e2d;
  --coral: #ff5c35;
  --pink: #ff4f79;
  --yellow: #ffe14a;
  --blue: #42b7ff;
  --mint: #45d8b4;
  --violet: #8c63ff;
  --red: #ec3e45;
  --shadow: 8px 9px 0 var(--ink);
  --shadow-small: 4px 5px 0 var(--ink);
  --radius: 24px;
  --display: "Arial Rounded MT Bold", "PingFang SC", "Microsoft YaHei", sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  font: 14px/1.6 var(--body);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 16px 16px, rgba(32,30,45,.08) 1.4px, transparent 1.5px),
    linear-gradient(94deg, transparent 49.6%, rgba(255,92,53,.055) 49.7%, rgba(255,92,53,.055) 50.3%, transparent 50.4%);
  background-size: 32px 32px, 190px 190px;
}
body::before,
body::after {
  position: fixed;
  z-index: -1;
  content: '';
  pointer-events: none;
  filter: saturate(1.1);
}
body::before {
  width: 320px;
  height: 260px;
  right: -95px;
  top: 100px;
  border-radius: 48% 52% 67% 33% / 35% 48% 52% 65%;
  border: 3px solid rgba(32,30,45,.12);
  background: rgba(66,183,255,.16);
  transform: rotate(14deg);
}
body::after {
  width: 260px;
  height: 220px;
  left: -110px;
  bottom: -70px;
  border-radius: 58% 42% 38% 62% / 51% 34% 66% 49%;
  border: 3px solid rgba(32,30,45,.1);
  background: rgba(255,79,121,.13);
  transform: rotate(-12deg);
}

button, input, select, textarea { color: inherit; font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }
::selection { color: var(--ink); background: var(--yellow); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { border: 2px solid var(--paper); border-radius: 999px; background: var(--ink); }
::-webkit-scrollbar-track { background: transparent; }

#app { min-height: 100vh; }
.app-shell { min-height: 100vh; }
.main { width: min(1540px, 100%); margin: 0 auto; padding: 28px clamp(18px, 4vw, 64px) 70px; }

/* 顶部导航 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  min-height: 88px;
  padding: 12px clamp(18px, 4vw, 64px);
  border-bottom: 3px solid var(--ink);
  background: rgba(255,249,236,.93);
  backdrop-filter: blur(14px);
}
.topbar::after {
  position: absolute;
  right: 12%;
  bottom: -8px;
  width: 75px;
  height: 12px;
  content: '';
  background: var(--yellow);
  clip-path: polygon(0 25%, 100% 0, 92% 100%, 8% 78%);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}
.brand-mark { display: inline-flex; transform: rotate(-5deg); transition: transform .2s ease; }
.brand:hover .brand-mark { transform: rotate(7deg) scale(1.06); }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text strong { font: 900 24px/1 var(--display); letter-spacing: 2px; }
.brand-text small { margin-top: 6px; font: 800 9px/1 var(--display); letter-spacing: 2px; }
.topnav { display: flex; justify-content: center; gap: 9px; }
.top-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border: 2px solid transparent;
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
  transition: transform .15s ease, background .15s ease;
}
.top-link span { font-size: 16px; }
.top-link:hover { transform: rotate(-2deg) translateY(-2px); }
.top-link.active { border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.top-link.coral.active { background: var(--coral); color: white; }
.top-link.violet.active { background: var(--violet); color: white; }
.top-link.mint.active { background: var(--mint); color: var(--ink); }
.topbar-right { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.balance-chip {
  display: flex;
  flex-direction: column;
  min-width: 112px;
  padding: 8px 13px;
  border: 2px solid var(--ink);
  border-radius: 14px 20px 15px 18px;
  background: var(--yellow);
  box-shadow: 3px 4px 0 var(--ink);
  transform: rotate(1deg);
  line-height: 1.15;
}
.balance-chip span { font-size: 9px; font-weight: 900; letter-spacing: 1px; }
.balance-chip b { margin-top: 4px; font: 900 15px var(--display); }
.user-sticker { display: flex; align-items: center; gap: 7px; }
.user-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50% 45% 52% 48%;
  background: var(--mint);
  font: 900 14px var(--display);
}
.username { max-width: 100px; overflow: hidden; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.logout-button {
  padding: 7px 0;
  border: 0;
  border-bottom: 2px solid var(--ink);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}
.logout-button:hover { color: var(--coral); border-color: var(--coral); }

/* 登录入口 */
.auth-wrap {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(390px, .82fr);
  min-height: 100vh;
  overflow: hidden;
  background:
    linear-gradient(90deg, transparent calc(100% - 1px), rgba(32,30,45,.08) 1px) 0 0 / 42px 42px,
    linear-gradient(transparent calc(100% - 1px), rgba(32,30,45,.08) 1px) 0 0 / 42px 42px,
    var(--paper);
}
.auth-poster {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: clamp(28px, 5vw, 72px);
  overflow: hidden;
  border-right: 3px solid var(--ink);
}
.auth-poster::before {
  position: absolute;
  z-index: 0;
  width: 390px;
  height: 390px;
  right: -90px;
  top: 18%;
  content: '';
  border: 3px solid var(--ink);
  border-radius: 48% 52% 35% 65% / 51% 35% 65% 49%;
  background: var(--blue);
  transform: rotate(16deg);
  box-shadow: 18px 20px 0 rgba(140,99,255,.9);
}
.auth-poster::after {
  position: absolute;
  z-index: 0;
  width: 180px;
  height: 70px;
  left: 4%;
  bottom: 13%;
  content: '';
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--pink);
  transform: rotate(-18deg);
}
.poster-top, .poster-copy, .poster-collage, .scribble-line { position: relative; z-index: 1; }
.poster-top { display: flex; align-items: flex-start; justify-content: space-between; }
.auth-brand { display: inline-flex; filter: drop-shadow(5px 6px 0 rgba(32,30,45,.18)); }
.poster-edition {
  padding: 8px 11px;
  border: 2px solid var(--ink);
  background: var(--white);
  box-shadow: 3px 3px 0 var(--ink);
  font: 900 10px var(--display);
  letter-spacing: 1.5px;
  transform: rotate(3deg);
}
.poster-copy { max-width: 700px; margin-top: clamp(65px, 10vh, 120px); }
.eyebrow { display: inline-block; font: 900 11px var(--display); letter-spacing: 2px; }
.tape-label {
  padding: 7px 18px;
  background: var(--yellow);
  clip-path: polygon(2% 12%, 98% 0, 100% 86%, 0 100%);
  transform: rotate(-2deg);
}
.poster-copy h1 {
  max-width: 720px;
  margin: 22px 0 18px;
  font: 950 clamp(50px, 7vw, 104px)/.98 var(--display);
  letter-spacing: -5px;
}
.poster-copy h1 em {
  position: relative;
  z-index: 1;
  color: var(--coral);
  font-style: normal;
  white-space: nowrap;
}
.poster-copy h1 em::after {
  position: absolute;
  z-index: -1;
  right: -8px;
  bottom: 4px;
  left: -6px;
  height: 22%;
  content: '';
  background: var(--yellow);
  transform: rotate(-2deg);
}
.poster-copy > p { max-width: 550px; margin: 0; color: #4f4a58; font-size: 16px; font-weight: 650; }
.poster-collage { display: flex; align-items: flex-end; gap: 14px; margin-top: auto; padding-top: 65px; }
.collage-card {
  display: flex;
  flex-direction: column;
  width: min(175px, 30%);
  min-height: 135px;
  padding: 14px;
  border: 3px solid var(--ink);
  box-shadow: 5px 6px 0 var(--ink);
}
.collage-card:nth-child(1) { transform: rotate(-5deg); }
.collage-card:nth-child(2) { transform: translateY(-16px) rotate(2deg); }
.collage-card:nth-child(3) { transform: rotate(5deg); }
.card-pink { background: var(--pink); color: white; }
.card-yellow { background: var(--yellow); }
.card-blue { background: var(--blue); }
.collage-card span { font: 900 11px var(--display); }
.collage-card b { margin-top: auto; font: 900 24px var(--display); }
.collage-card small { font-weight: 750; }
.scribble-line { margin-top: 30px; font: 900 10px var(--display); letter-spacing: 4px; }
.auth-card {
  position: relative;
  align-self: center;
  width: min(480px, calc(100% - 56px));
  margin: 60px auto;
  padding: clamp(28px, 4vw, 48px);
  border: 3px solid var(--ink);
  border-radius: 27px 18px 32px 22px;
  background: var(--white);
  box-shadow: var(--shadow);
  transform: rotate(1deg);
}
.auth-card::before,
.auth-card::after {
  position: absolute;
  content: '';
  background: rgba(255,225,74,.72);
}
.auth-card::before { width: 88px; height: 24px; left: 28px; top: -14px; transform: rotate(-4deg); }
.auth-card::after { width: 70px; height: 22px; right: 22px; bottom: -12px; transform: rotate(5deg); }
.auth-card-number { color: var(--muted); font: 900 10px var(--display); letter-spacing: 2px; }
.auth-card-head { display: flex; align-items: center; gap: 15px; margin-top: 20px; }
.mini-sun {
  display: grid;
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 25px;
}
.auth-card-head small { display: block; color: var(--muted); font: 850 9px var(--display); letter-spacing: 1.8px; }
.auth-card h2 { margin: 4px 0 0; font: 950 32px/1.15 var(--display); }
.auth-intro { margin: 20px 0 25px; color: var(--muted); font-weight: 650; }
.form-row { display: flex; flex-direction: column; gap: 7px; margin: 14px 0; }
.form-row > label { font-size: 12px; font-weight: 850; }
.form-row input, .form-row select, .form-row textarea,
.studio-select {
  width: 100%;
  min-height: 46px;
  padding: 10px 13px;
  outline: none;
  border: 2px solid var(--ink);
  border-radius: 10px 14px 9px 13px;
  background: var(--white);
  box-shadow: 2px 3px 0 var(--ink);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus, .studio-select:focus {
  background: #fffceb;
  box-shadow: 4px 5px 0 var(--ink);
  transform: translate(-1px, -1px);
}
.doodle-field:nth-of-type(2) input { background: rgba(66,183,255,.08); }
.doodle-field:nth-of-type(3) input { background: rgba(255,79,121,.06); }
.auth-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 24px;
  padding: 14px 18px;
  border: 3px solid var(--ink);
  border-radius: 12px 17px 11px 16px;
  background: var(--coral);
  color: white;
  box-shadow: 5px 6px 0 var(--ink);
  font: 900 16px var(--display);
  transition: transform .15s ease, box-shadow .15s ease;
}
.auth-submit b { font-size: 23px; }
.auth-submit:hover { box-shadow: 3px 3px 0 var(--ink); transform: translate(2px, 3px) rotate(-1deg); }
.demo-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  padding: 10px 12px;
  border: 2px dashed var(--ink);
  border-radius: 10px;
  background: rgba(69,216,180,.15);
}
.demo-note span { padding: 3px 7px; border: 2px solid var(--ink); background: var(--mint); font: 900 9px var(--display); }
.demo-note p { margin: 0; font-size: 12px; }
.auth-switch { display: flex; justify-content: center; gap: 7px; margin-top: 22px; color: var(--muted); font-size: 12px; }
.auth-switch button { padding: 0; border: 0; border-bottom: 2px solid var(--coral); background: transparent; color: var(--coral); font-weight: 850; }
.auth-doodle { position: absolute; z-index: 2; pointer-events: none; font: 900 60px var(--display); }
.auth-doodle-one { right: 46%; top: 8%; color: var(--yellow); transform: rotate(15deg); text-shadow: 2px 2px 0 var(--ink); }
.auth-doodle-two { right: 3%; bottom: 4%; color: var(--violet); transform: rotate(-9deg); }

/* 创作页：顶部标题 */
.color-studio { position: relative; }
.studio-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 35px;
  margin-bottom: 28px;
  padding: 12px 4px 0;
}
.hero-copy { position: relative; }
.hero-kicker { margin-bottom: 3px; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: 1px; }
.hero-kicker span { display: inline-block; margin-right: 6px; padding: 3px 8px; border: 2px solid var(--ink); background: var(--mint); color: var(--ink); font: 900 9px var(--display); transform: rotate(-2deg); }
.hero-copy h1 { margin: 2px 0 0; font: 950 clamp(38px, 5vw, 68px)/1 var(--display); letter-spacing: -3px; }
.hero-copy h1 em { position: relative; color: var(--coral); font-style: normal; }
.hero-copy h1 em::after { position: absolute; z-index: -1; right: -4px; bottom: 1px; left: -4px; height: 13px; content: ''; background: var(--yellow); transform: rotate(-2deg); }
.hero-copy h1 i { display: inline-block; margin-left: 13px; color: var(--violet); font-size: .55em; font-style: normal; transform: rotate(10deg); }
.hero-copy p { margin: 9px 0 0; color: var(--muted); font-weight: 650; }
.hero-controls { display: flex; align-items: center; gap: 10px; }
.mode-switch {
  display: flex;
  padding: 5px;
  border: 3px solid var(--ink);
  border-radius: 18px 13px 17px 14px;
  background: var(--white);
  box-shadow: 4px 5px 0 var(--ink);
  transform: rotate(-1deg);
}
.mode-switch button {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 86px;
  padding: 10px 14px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  font-weight: 850;
}
.mode-switch button span { font-size: 15px; }
.mode-switch button.active { background: var(--ink); color: white; }
.studio-action {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 0 8px;
  min-width: 112px;
  padding: 9px 12px;
  border: 3px solid var(--ink);
  border-radius: 14px 19px 13px 16px;
  box-shadow: 4px 5px 0 var(--ink);
  text-align: left;
  transition: transform .15s ease, box-shadow .15s ease;
}
.studio-action > span { grid-row: 1 / 3; font-size: 23px; }
.studio-action b { font: 900 13px var(--display); }
.studio-action small { font: 800 8px var(--display); letter-spacing: 1px; }
.studio-action.blue { background: var(--blue); }
.studio-action.yellow { background: var(--yellow); transform: rotate(2deg); }
.studio-action:hover, .studio-action.active { box-shadow: 2px 2px 0 var(--ink); transform: translate(2px, 3px) rotate(-2deg); }

/* 创作页：配方 + 画板 */
.studio-workspace {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: clamp(20px, 3vw, 38px);
  align-items: start;
}
.recipe-panel {
  position: relative;
  padding: 26px 20px 22px;
  border: 3px solid var(--ink);
  border-radius: 20px 28px 18px 25px;
  background: #fffdf6;
  box-shadow: var(--shadow);
}
.recipe-panel::after {
  position: absolute;
  z-index: -1;
  right: -13px;
  bottom: -18px;
  width: 85%;
  height: 40%;
  content: '';
  border: 3px solid var(--ink);
  border-radius: 20px;
  background: var(--violet);
  transform: rotate(2deg);
}
.recipe-tape {
  position: absolute;
  left: 50%;
  top: -15px;
  min-width: 118px;
  padding: 6px 17px;
  background: rgba(255,225,74,.84);
  clip-path: polygon(3% 8%, 98% 0, 100% 88%, 0 100%);
  font: 900 9px var(--display);
  letter-spacing: 2px;
  text-align: center;
  transform: translateX(-50%) rotate(-2deg);
}
.recipe-head { display: flex; align-items: flex-start; justify-content: space-between; padding-bottom: 16px; border-bottom: 3px solid var(--ink); }
.recipe-head small { color: var(--muted); font: 800 9px var(--display); letter-spacing: 1.5px; }
.recipe-head h2 { margin: 3px 0 0; font: 900 20px/1.2 var(--display); }
.recipe-head > span { color: var(--coral); font: 900 26px var(--display); transform: rotate(12deg); }
.setting-group { position: relative; margin: 0; padding: 18px 0 17px 36px; border-bottom: 2px dashed rgba(32,30,45,.35); }
.setting-group > label { display: block; margin-bottom: 9px; font-size: 12px; font-weight: 900; }
.setting-group.numbered::before {
  position: absolute;
  left: 0;
  top: 18px;
  display: grid;
  width: 25px;
  height: 25px;
  content: attr(data-step);
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50% 44% 52% 48%;
  background: var(--yellow);
  font: 900 8px var(--display);
}
.setting-group:nth-of-type(3)::before { background: var(--blue); }
.setting-group:nth-of-type(4)::before { background: var(--pink); color: white; }
.setting-group:nth-of-type(5)::before { background: var(--mint); }
.setting-group:nth-of-type(6)::before { background: var(--violet); color: white; }
.setting-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.setting-switch button,
.resolution-switch button {
  min-height: 38px;
  padding: 7px 8px;
  border: 2px solid var(--ink);
  border-radius: 9px 12px 8px 11px;
  background: var(--white);
  font-size: 11px;
  font-weight: 800;
  box-shadow: 2px 2px 0 var(--ink);
}
.setting-switch button.active { background: var(--pink); color: white; transform: rotate(-1deg); }
.setting-switch button:disabled { cursor: not-allowed; opacity: .35; box-shadow: none; }
.studio-select { min-height: 42px; padding: 8px 11px; border-radius: 9px; font-size: 12px; font-weight: 750; }
.ratio-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.ratio-picker button {
  display: flex;
  min-height: 62px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 3px;
  border: 2px solid transparent;
  border-radius: 9px;
  background: rgba(32,30,45,.045);
}
.ratio-picker button:hover { border-color: var(--ink); }
.ratio-picker button.active { border-color: var(--ink); background: var(--blue); box-shadow: 2px 3px 0 var(--ink); transform: rotate(-2deg); }
.ratio-picker i {
  display: block;
  width: min(25px, calc(18px * var(--rw) / var(--rh)));
  height: min(25px, calc(18px * var(--rh) / var(--rw)));
  min-width: 12px;
  min-height: 12px;
  border: 2px solid currentColor;
  border-radius: 2px;
}
.ratio-picker span { font-size: 10px; font-weight: 850; }
.ratio-picker small { color: rgba(32,30,45,.62); font: 700 8px var(--display); }
.resolution-switch { display: flex; gap: 7px; }
.resolution-switch button { flex: 1; }
.resolution-switch button.active { background: var(--yellow); transform: rotate(2deg); }
.reference-preview {
  position: relative;
  display: flex;
  min-height: 105px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 2px dashed var(--ink);
  border-radius: 12px 17px 11px 15px;
  background: rgba(140,99,255,.08);
  cursor: pointer;
}
.reference-preview.empty { flex-direction: column; }
.reference-preview.empty > span { display: grid; width: 32px; height: 32px; place-items: center; border: 2px solid var(--ink); border-radius: 50%; background: var(--violet); color: white; font-size: 19px; }
.reference-preview p { margin: 5px 0 0; font-size: 11px; font-weight: 850; }
.reference-preview small { color: var(--muted); font-size: 9px; }
.reference-preview img { width: 100%; height: 135px; object-fit: cover; }
.remove-reference { position: absolute; right: 7px; top: 7px; padding: 5px 8px; border: 2px solid var(--ink); border-radius: 999px; background: var(--yellow); font-size: 9px; font-weight: 900; }
.recipe-ticket { display: grid; grid-template-columns: 1fr 1fr; margin-top: 16px; overflow: hidden; border: 2px solid var(--ink); border-radius: 10px; background: var(--paper); }
.recipe-ticket > div { display: flex; flex-direction: column; padding: 10px; }
.recipe-ticket > div + div { border-left: 2px dashed var(--ink); background: rgba(255,92,53,.09); }
.recipe-ticket span { color: var(--muted); font-size: 9px; font-weight: 800; }
.recipe-ticket b, .setting-value { margin-top: 3px; font: 900 13px var(--display); }
.recipe-ticket strong { color: var(--coral); font: 900 17px var(--display); }
.recipe-tip { display: grid; grid-template-columns: auto 1fr; gap: 9px; margin-top: 14px; align-items: start; }
.recipe-tip span { padding: 3px 7px; border: 2px solid var(--ink); background: var(--mint); font: 900 8px var(--display); transform: rotate(-3deg); }
.recipe-tip p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }

.artboard-panel {
  position: relative;
  min-width: 0;
  padding: 23px;
  border: 3px solid var(--ink);
  border-radius: 31px 20px 29px 23px;
  background: var(--white);
  box-shadow: 11px 12px 0 var(--ink);
}
.artboard-panel::before {
  position: absolute;
  z-index: -1;
  inset: -13px 11% auto 8%;
  height: 80px;
  content: '';
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--pink);
  transform: rotate(-2deg);
}
.artboard-tape { position: absolute; z-index: 2; width: 82px; height: 24px; background: rgba(69,216,180,.75); pointer-events: none; }
.tape-left { left: -26px; top: 52px; transform: rotate(-42deg); }
.tape-right { right: -25px; top: 58px; background: rgba(255,225,74,.82); transform: rotate(38deg); }
.artboard-head { display: flex; align-items: flex-end; justify-content: space-between; padding: 0 4px 16px; }
.artboard-head span { color: var(--muted); font: 850 9px var(--display); letter-spacing: 2px; }
.artboard-head h2 { margin: 3px 0 0; font: 950 23px var(--display); }
.color-dots { display: flex; gap: 7px; }
.color-dots i { width: 17px; height: 17px; border: 2px solid var(--ink); border-radius: 50% 45% 55% 48%; }
.color-dots i:nth-child(1) { background: var(--coral); }
.color-dots i:nth-child(2) { background: var(--yellow); transform: translateY(-4px); }
.color-dots i:nth-child(3) { background: var(--blue); }
.color-dots i:nth-child(4) { background: var(--violet); transform: translateY(-3px); }
.canvas-stage { position: relative; }
.canvas-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; padding: 0 4px; color: var(--muted); font-size: 10px; font-weight: 750; }
.canvas-meta > span:first-child { display: flex; align-items: center; gap: 6px; color: var(--ink); }
.canvas-meta i { width: 8px; height: 8px; border: 1.5px solid var(--ink); border-radius: 50%; background: var(--mint); }
.creative-canvas {
  position: relative;
  display: flex;
  min-height: clamp(430px, 54vh, 660px);
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: 15px 23px 13px 20px;
  background-color: #f4f1ec;
  background-image:
    linear-gradient(45deg, rgba(32,30,45,.035) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(32,30,45,.035) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(32,30,45,.035) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(32,30,45,.035) 75%);
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}
.creative-canvas.dragging, .prompt-dock.dragging, .reference-preview.dragging { outline: 6px solid rgba(69,216,180,.45); outline-offset: -7px; }
.canvas-placeholder { position: relative; width: min(620px, 90%); padding: 50px 30px; text-align: center; }
.placeholder-label { display: inline-block; padding: 5px 13px; border: 2px solid var(--ink); background: var(--yellow); box-shadow: 2px 2px 0 var(--ink); font: 900 9px var(--display); letter-spacing: 1.5px; transform: rotate(-2deg); }
.canvas-placeholder h2 { margin: 23px 0 12px; font: 950 clamp(28px, 4vw, 50px)/1.12 var(--display); letter-spacing: -2px; }
.canvas-placeholder p { max-width: 470px; margin: 0 auto; color: var(--muted); font-weight: 650; }
.placeholder-spark { position: absolute; left: 4%; top: 7%; color: var(--pink); font: 900 52px var(--display); text-shadow: 2px 2px 0 var(--ink); transform: rotate(-12deg); }
.placeholder-sun { position: absolute; right: 4%; top: 18%; color: var(--yellow); font-size: 56px; -webkit-text-stroke: 2px var(--ink); transform: rotate(9deg); }
.placeholder-arrow { position: absolute; right: 4%; bottom: 4%; color: var(--blue); font: 900 60px var(--display); transform: rotate(8deg); }
.canvas-placeholder.error .placeholder-spark { position: static; display: grid; width: 60px; height: 60px; margin: 0 auto 18px; place-items: center; border: 3px solid var(--ink); border-radius: 50%; background: var(--red); color: white; text-shadow: none; transform: none; }
.generated-work { display: block; max-width: 100%; max-height: 680px; object-fit: contain; }
.motion-badge { position: absolute; right: 15px; bottom: 15px; padding: 7px 11px; border: 2px solid var(--ink); border-radius: 999px; background: var(--yellow); box-shadow: 2px 3px 0 var(--ink); font-size: 10px; font-weight: 900; }
.canvas-actions { align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; padding: 9px 3px 0; color: var(--muted); font-size: 10px; }
.canvas-actions > div { display: flex; gap: 7px; }
.canvas-actions button, .canvas-actions a { padding: 6px 9px; border: 2px solid var(--ink); border-radius: 8px; background: var(--white); box-shadow: 2px 2px 0 var(--ink); color: var(--ink); font-size: 10px; font-weight: 800; text-decoration: none; }
.creating-state { text-align: center; }
.creating-state > span { display: inline-block; margin-top: 20px; padding: 4px 10px; border: 2px solid var(--ink); background: var(--yellow); font: 900 9px var(--display); letter-spacing: 2px; transform: rotate(-2deg); }
.creating-state h2 { margin: 17px 0 7px; font: 950 32px var(--display); }
.creating-state p { margin: 0; color: var(--muted); }
.paint-loader { position: relative; display: flex; width: 120px; height: 82px; align-items: flex-end; justify-content: center; gap: 7px; margin: 0 auto; }
.paint-loader::after { position: absolute; left: 7px; right: 7px; bottom: -8px; height: 22px; content: ''; border: 3px solid var(--ink); border-radius: 50%; background: rgba(140,99,255,.16); }
.paint-loader i { position: relative; z-index: 1; width: 29px; border: 3px solid var(--ink); border-radius: 50% 50% 45% 55%; animation: paintBounce .85s infinite alternate ease-in-out; }
.paint-loader i:nth-child(1) { height: 53px; background: var(--coral); }
.paint-loader i:nth-child(2) { height: 70px; background: var(--yellow); animation-delay: -.25s; }
.paint-loader i:nth-child(3) { height: 42px; background: var(--blue); animation-delay: -.5s; }
@keyframes paintBounce { to { transform: translateY(-13px) rotate(6deg); } }

.prompt-dock {
  position: relative;
  margin-top: 18px;
  padding: 18px 18px 15px;
  border: 3px solid var(--ink);
  border-radius: 13px 20px 12px 17px;
  background: #fff5bf;
  box-shadow: 5px 6px 0 var(--ink);
  transform: rotate(-.3deg);
}
.prompt-paperclip { position: absolute; right: 23px; top: -17px; color: var(--violet); font: 900 42px/1 var(--display); transform: rotate(13deg); }
.prompt-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; font-size: 9px; font-weight: 900; letter-spacing: 1px; }
.studio-prompt { width: 100%; min-height: 92px; padding: 10px 0; resize: vertical; outline: 0; border: 0; border-bottom: 2px dashed rgba(32,30,45,.48); background: transparent; font-size: 15px; font-weight: 650; line-height: 1.7; }
.studio-prompt::placeholder { color: rgba(32,30,45,.48); }
.prompt-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; padding-top: 12px; }
.prompt-tools { display: flex; gap: 8px; }
.reference-chip, .prompt-tool {
  padding: 7px 10px;
  border: 2px solid var(--ink);
  border-radius: 8px 11px 7px 10px;
  background: var(--white);
  box-shadow: 2px 2px 0 var(--ink);
  font-size: 10px;
  font-weight: 850;
}
.reference-chip.has-image { background: var(--mint); }
.generate-main {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 10px;
  min-width: 195px;
  padding: 12px 15px;
  border: 3px solid var(--ink);
  border-radius: 12px 17px 11px 15px;
  background: var(--coral);
  color: white;
  box-shadow: 5px 6px 0 var(--ink);
  text-align: left;
  transition: transform .15s ease, box-shadow .15s ease;
}
.generate-main .button-star { grid-row: 1 / 3; align-self: center; font-size: 25px; }
.generate-main strong { font: 900 15px var(--display); }
.generate-main small { font-size: 8px; font-weight: 800; letter-spacing: .5px; }
.generate-main:hover:not(:disabled) { box-shadow: 2px 2px 0 var(--ink); transform: translate(3px, 4px) rotate(1deg); }
.generate-main:disabled { cursor: wait; filter: grayscale(.4); opacity: .65; }

/* 作品抽屉 */
.drawer-mask { position: fixed; z-index: 80; inset: 0; display: none; background: rgba(32,30,45,.35); backdrop-filter: blur(3px); }
.drawer-mask.open { display: block; }
.works-drawer {
  position: fixed;
  z-index: 81;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(460px, 94vw);
  padding: 32px 24px 20px;
  overflow: hidden;
  border-left: 3px solid var(--ink);
  background: var(--paper);
  box-shadow: -10px 0 0 rgba(32,30,45,.12);
  transform: translateX(105%);
  transition: transform .28s cubic-bezier(.2,.8,.2,1);
}
.works-drawer.open { transform: translateX(0); }
.works-drawer::before { position: absolute; z-index: -1; width: 170px; height: 170px; right: -55px; top: 120px; content: ''; border: 3px solid var(--ink); border-radius: 50%; background: var(--blue); }
.drawer-scribble { margin-bottom: 12px; color: var(--coral); font: 900 9px var(--display); letter-spacing: 3px; }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; padding-bottom: 18px; border-bottom: 3px solid var(--ink); }
.drawer-head small { color: var(--muted); font: 800 9px var(--display); letter-spacing: 1.5px; }
.drawer-head h2 { margin: 4px 0 0; font: 950 30px var(--display); }
.icon-button { width: 36px; height: 36px; margin-left: 5px; border: 2px solid var(--ink); border-radius: 50%; background: var(--yellow); box-shadow: 2px 2px 0 var(--ink); font-size: 17px; font-weight: 900; }
.drawer-filters { display: flex; gap: 7px; padding: 16px 0; }
.drawer-filters button { padding: 7px 12px; border: 2px solid var(--ink); border-radius: 999px; background: var(--white); font-size: 10px; font-weight: 850; }
.drawer-filters button.active { background: var(--pink); color: white; box-shadow: 2px 2px 0 var(--ink); transform: rotate(-2deg); }
.drawer-list { height: calc(100% - 130px); padding: 5px 6px 20px; overflow-y: auto; }
.work-card {
  display: grid;
  grid-template-columns: 92px 1fr auto;
  gap: 12px;
  align-items: center;
  width: calc(100% - 8px);
  margin: 0 0 16px;
  padding: 9px;
  border: 2px solid var(--ink);
  border-radius: 10px 15px 9px 13px;
  background: var(--white);
  box-shadow: 4px 4px 0 var(--ink);
  text-align: left;
}
.work-card.tilt-0 { transform: rotate(-1deg); }
.work-card.tilt-1 { transform: rotate(1deg); }
.work-card.tilt-2 { transform: rotate(-.4deg); }
.work-card:hover { background: #fff8ca; transform: translateY(-2px) rotate(0); }
.work-thumb { padding: 4px 4px 12px; background: white; border: 1.5px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.work-card img { display: block; width: 100%; height: 70px; object-fit: cover; }
.work-card p { overflow: hidden; margin: 0 0 5px; font-size: 11px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.work-card span { color: var(--muted); font-size: 9px; }
.work-card > small { color: var(--coral); font: 900 10px var(--display); }
.drawer-empty { display: flex; flex-direction: column; align-items: center; padding: 85px 20px; color: var(--muted); text-align: center; }
.drawer-empty > span { color: var(--violet); font-size: 46px; }
.drawer-empty b { margin-top: 8px; color: var(--ink); font: 900 18px var(--display); }
.drawer-empty small { margin-top: 5px; }

/* 弹窗、灵感卡与作品查看 */
.modal-overlay { position: fixed; z-index: 100; inset: 0; display: grid; padding: 20px; place-items: center; overflow-y: auto; background: rgba(32,30,45,.46); opacity: 0; backdrop-filter: blur(4px); transition: opacity .2s ease; }
.modal-overlay.show { opacity: 1; }
.modal {
  position: relative;
  max-height: calc(100vh - 40px);
  padding: clamp(22px, 4vw, 36px);
  overflow-y: auto;
  border: 3px solid var(--ink);
  border-radius: 19px 28px 17px 24px;
  background: var(--white);
  box-shadow: 10px 11px 0 var(--ink);
  transform: translateY(14px) rotate(.5deg);
  transition: transform .2s ease;
}
.modal-overlay.show .modal { transform: translateY(0) rotate(0); }
.modal::before { position: absolute; width: 90px; height: 22px; left: 50%; top: -11px; content: ''; background: rgba(255,225,74,.8); transform: translateX(-50%) rotate(-2deg); }
.modal h3 { margin: 0 0 16px; font: 950 25px var(--display); }
.modal > div > p { color: var(--muted); }
.idea-dialog-head span { display: inline-block; padding: 4px 9px; border: 2px solid var(--ink); background: var(--mint); font: 900 9px var(--display); letter-spacing: 1.5px; transform: rotate(-2deg); }
.idea-dialog-kicker { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.idea-dialog-kicker .idea-draw-count { border: 0; background: transparent; color: var(--muted); letter-spacing: 1px; transform: none; }
.idea-dialog-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.idea-dialog-head h2 { margin: 14px 0 6px; font: 950 clamp(27px, 4vw, 42px)/1.1 var(--display); }
.idea-dialog-head p { margin: 0 0 22px; color: var(--muted); }
.idea-redraw-button { flex: 0 0 auto; margin-bottom: 22px; white-space: nowrap; }
.idea-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.idea-card {
  position: relative;
  display: flex;
  min-height: 210px;
  flex-direction: column;
  align-items: flex-start;
  padding: 18px;
  border: 3px solid var(--ink);
  border-radius: 13px 18px 12px 16px;
  box-shadow: 5px 6px 0 var(--ink);
  text-align: left;
  transition: transform .16s ease, box-shadow .16s ease;
}
.idea-card:nth-child(odd) { transform: rotate(-1deg); }
.idea-card:nth-child(even) { transform: rotate(1deg); }
.idea-card:hover { z-index: 1; box-shadow: 8px 9px 0 var(--ink); transform: translateY(-5px) rotate(-1deg); }
.color-pink { background: #ff8ba8; }
.color-blue { background: #86d2ff; }
.color-yellow { background: #ffea70; }
.color-violet { background: #a98dff; }
.color-coral { background: #ff7b5d; }
.color-mint { background: #74e3c2; }
.idea-card > span { display: grid; width: 34px; height: 34px; place-items: center; border: 2px solid var(--ink); border-radius: 50%; background: var(--white); font: 900 10px var(--display); }
.idea-card > small { position: absolute; right: 15px; top: 15px; font: 900 9px var(--display); letter-spacing: 2px; }
.idea-card h3 { margin: 25px 0 7px; font: 950 25px var(--display); }
.idea-card p { margin: 0; color: rgba(32,30,45,.74); font-size: 11px; line-height: 1.7; }
.idea-card b { margin-top: auto; padding-top: 18px; font-size: 10px; }
.work-viewer { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(250px, .75fr); gap: 25px; align-items: center; }
.work-viewer-image { padding: 10px 10px 34px; border: 3px solid var(--ink); background: var(--white); box-shadow: 6px 7px 0 var(--ink); transform: rotate(-1deg); }
.work-viewer-image img { display: block; width: 100%; max-height: 68vh; object-fit: contain; }
.work-viewer-info > small { color: var(--coral); font: 900 9px var(--display); letter-spacing: 2px; }
.work-viewer-info h2 { margin: 7px 0 15px; font: 950 30px var(--display); }
.work-viewer-info > div { display: flex; flex-wrap: wrap; gap: 6px; }
.work-viewer-info > div span { padding: 5px 8px; border: 2px solid var(--ink); border-radius: 999px; background: var(--yellow); font-size: 9px; font-weight: 850; }
.work-viewer-info p { margin: 20px 0; line-height: 1.9; }

/* 通用按钮、表单、提示 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  border: 2px solid var(--ink);
  border-radius: 9px 13px 8px 11px;
  background: var(--ink);
  color: white;
  box-shadow: 3px 3px 0 rgba(32,30,45,.22);
  font-weight: 850;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px) rotate(-1deg); }
.btn.accent { background: var(--coral); box-shadow: 3px 4px 0 var(--ink); }
.btn.ghost { background: var(--white); color: var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.btn.danger-ghost { background: #fff1f0; color: var(--red); box-shadow: 2px 2px 0 var(--ink); }
.btn.small { min-height: 30px; padding: 5px 9px; font-size: 10px; }
.actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check-row { display: flex; flex-direction: row; flex-wrap: wrap; gap: 12px; }
.check-row label { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border: 2px solid var(--ink); border-radius: 8px; background: rgba(69,216,180,.12); cursor: pointer; }
.check-row input { accent-color: var(--coral); }
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

#toasts { position: fixed; z-index: 150; right: 22px; top: 105px; display: flex; width: min(360px, calc(100vw - 36px)); flex-direction: column; gap: 10px; pointer-events: none; }
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 3px solid var(--ink);
  border-radius: 11px 16px 10px 14px;
  background: var(--white);
  box-shadow: 5px 6px 0 var(--ink);
  font-weight: 750;
  opacity: 0;
  transform: translateX(20px) rotate(2deg);
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translateX(0) rotate(-1deg); }
.toast > span { display: grid; flex: 0 0 27px; width: 27px; height: 27px; place-items: center; border: 2px solid var(--ink); border-radius: 50%; background: var(--blue); font-weight: 900; }
.toast.success > span { background: var(--mint); }
.toast.error > span { background: var(--red); color: white; }

/* 管理台 */
.admin-page { position: relative; }
.admin-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; padding: 18px 3px 28px; }
.admin-kicker { display: inline-block; padding: 5px 10px; border: 2px solid var(--ink); background: var(--blue); font: 900 9px var(--display); letter-spacing: 1.5px; transform: rotate(-2deg); }
.admin-hero h1 { margin: 13px 0 5px; font: 950 clamp(37px, 5vw, 65px)/1 var(--display); letter-spacing: -3px; }
.admin-hero h1 em { position: relative; color: var(--violet); font-style: normal; white-space: nowrap; }
.admin-hero h1 em::after { position: absolute; z-index: -1; right: -4px; bottom: 2px; left: -4px; height: 13px; content: ''; background: var(--yellow); transform: rotate(-1deg); }
.admin-hero p { margin: 12px 0 0; color: var(--muted); font-weight: 650; }
.admin-sticker { display: flex; width: 180px; min-height: 115px; flex-direction: column; justify-content: center; padding: 16px; border: 3px solid var(--ink); border-radius: 15px 23px 14px 19px; background: var(--pink); color: white; box-shadow: 6px 7px 0 var(--ink); transform: rotate(4deg); }
.admin-sticker span { font: 900 9px var(--display); letter-spacing: 2px; }
.admin-sticker b { margin-top: 7px; font: 950 20px var(--display); }
.admin-sticker small { margin-top: 4px; font: 800 8px var(--display); letter-spacing: 1px; }
.page-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin-bottom: 24px; }
.page-tab {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0 12px;
  padding: 14px 16px;
  border: 3px solid var(--ink);
  border-radius: 13px 19px 12px 16px;
  background: var(--white);
  box-shadow: 4px 5px 0 var(--ink);
  text-align: left;
  transition: transform .15s ease;
}
.page-tab:nth-child(2) { transform: rotate(-.8deg); }
.page-tab:nth-child(3) { transform: rotate(.7deg); }
.page-tab > span { grid-row: 1 / 3; display: grid; width: 38px; height: 38px; place-items: center; border: 2px solid var(--ink); border-radius: 50%; background: var(--paper-deep); font: 900 10px var(--display); }
.page-tab b { font: 900 14px var(--display); }
.page-tab small { color: var(--muted); font: 800 8px var(--display); letter-spacing: 1.5px; }
.page-tab.active:nth-child(1) { background: var(--yellow); }
.page-tab.active:nth-child(2) { background: var(--mint); }
.page-tab.active:nth-child(3) { background: var(--violet); color: white; }
.page-tab.active > span { background: var(--white); color: var(--ink); }
.admin-body { min-height: 420px; }
.admin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 0 15px; padding: 0 3px; }
.meta-row { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 700; }
.meta-row b { display: grid; min-width: 38px; height: 38px; padding: 0 8px; place-items: center; border: 2px solid var(--ink); border-radius: 50%; background: var(--yellow); color: var(--ink); font: 900 13px var(--display); }
.toolbar-note { color: var(--muted); font-size: 11px; }
.table-card { overflow: auto; border: 3px solid var(--ink); border-radius: 17px 25px 16px 21px; background: var(--white); box-shadow: 7px 8px 0 var(--ink); }
table { width: 100%; border-collapse: collapse; min-width: 820px; }
th, td { padding: 14px 15px; border-bottom: 2px solid rgba(32,30,45,.14); text-align: left; vertical-align: middle; }
th { background: var(--paper-deep); font: 900 10px var(--display); letter-spacing: .5px; white-space: nowrap; }
tbody tr:nth-child(even) { background: rgba(66,183,255,.045); }
tbody tr:hover { background: rgba(255,225,74,.18); }
tbody tr:last-child td { border-bottom: 0; }
td { font-size: 11px; }
.tag { display: inline-block; padding: 4px 8px; border: 2px solid var(--ink); border-radius: 999px; background: var(--yellow); font-size: 9px; font-weight: 850; white-space: nowrap; }
.tag.on { background: var(--mint); }
.tag.off { background: #ffb3b5; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.amount-pos { color: #078366; font-weight: 900; }
.amount-neg { color: var(--red); font-weight: 900; }

/* 响应式 */
@media (max-width: 1180px) {
  .topbar { gap: 16px; }
  .topnav { justify-content: flex-start; }
  .username { display: none; }
  .studio-workspace { grid-template-columns: 285px minmax(0, 1fr); gap: 24px; }
  .recipe-panel { padding-inline: 16px; }
  .setting-group { padding-left: 32px; }
  .hero-controls { flex-wrap: wrap; justify-content: flex-end; }
  .studio-action { min-width: 104px; }
}

@media (max-width: 920px) {
  .topbar { grid-template-columns: auto 1fr; min-height: 78px; }
  .topnav { order: 3; grid-column: 1 / -1; justify-content: center; margin: -3px 0 -7px; }
  .topbar-right { justify-self: end; }
  .main { padding-top: 24px; }
  .studio-hero { align-items: flex-start; flex-direction: column; }
  .hero-controls { width: 100%; justify-content: flex-start; }
  .studio-workspace { grid-template-columns: 1fr; }
  .recipe-panel { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 22px; }
  .recipe-head, .recipe-tape, .recipe-ticket, .recipe-tip { grid-column: 1 / -1; }
  .setting-group { min-width: 0; }
  .artboard-panel { padding: 20px; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-poster { min-height: 650px; border-right: 0; border-bottom: 3px solid var(--ink); }
  .poster-copy { margin-top: 65px; }
  .poster-copy h1 { font-size: clamp(52px, 10vw, 88px); }
  .auth-card { margin: 80px auto; }
  .auth-doodle-one { right: 8%; top: 4%; }
  .admin-hero { align-items: flex-start; }
  .admin-sticker { width: 150px; }
}

@media (max-width: 700px) {
  .topbar { padding: 10px 15px; }
  .brand-text small, .user-sticker, .logout-button { display: none; }
  .brand-text strong { font-size: 20px; }
  .balance-chip { min-width: 96px; }
  .top-link { padding: 7px 11px; font-size: 12px; }
  .main { padding: 20px 13px 55px; }
  .studio-hero { margin-bottom: 22px; }
  .hero-copy h1 { font-size: 44px; }
  .hero-controls { display: grid; grid-template-columns: 1fr 1fr; }
  .mode-switch { grid-column: 1 / -1; }
  .mode-switch button { flex: 1; justify-content: center; }
  .studio-action { min-width: 0; }
  .recipe-panel { display: block; box-shadow: 6px 7px 0 var(--ink); }
  .artboard-panel { padding: 15px; box-shadow: 6px 7px 0 var(--ink); }
  .artboard-tape { display: none; }
  .creative-canvas { min-height: 390px; }
  .canvas-placeholder { padding: 38px 10px; }
  .placeholder-sun { right: -2%; font-size: 43px; }
  .placeholder-spark { left: -1%; font-size: 42px; }
  .prompt-bottom { align-items: stretch; flex-direction: column; }
  .prompt-tools { justify-content: space-between; }
  .prompt-tools button { flex: 1; }
  .generate-main { width: 100%; }
  .canvas-actions { align-items: flex-start; flex-direction: column; }
  .canvas-actions > div { flex-wrap: wrap; }
  .auth-poster { min-height: 710px; padding: 25px 21px 45px; }
  .poster-copy h1 { font-size: 54px; letter-spacing: -4px; }
  .poster-copy > p { font-size: 14px; }
  .poster-collage { gap: 8px; padding-top: 65px; }
  .collage-card { min-height: 118px; padding: 10px; }
  .collage-card b { font-size: 19px; }
  .collage-card small { font-size: 9px; }
  .auth-card { width: calc(100% - 28px); margin: 60px auto; padding: 28px 22px; box-shadow: 6px 7px 0 var(--ink); }
  .idea-grid { grid-template-columns: 1fr; }
  .idea-dialog-title { align-items: stretch; flex-direction: column; gap: 0; }
  .idea-redraw-button { align-self: flex-start; margin: -8px 0 20px; }
  .work-viewer { grid-template-columns: 1fr; }
  .page-tabs { grid-template-columns: 1fr; }
  .page-tab { min-height: 66px; }
  .admin-hero { flex-direction: column; }
  .admin-sticker { width: 160px; align-self: flex-end; margin-top: -22px; }
  .admin-toolbar { align-items: flex-start; flex-direction: column; }
  .admin-toolbar .btn { width: 100%; }
  .form-grid-2, .price-grid { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .brand-mark svg { width: 40px; height: 40px; }
  .balance-chip { min-width: 86px; padding: 7px 10px; }
  .balance-chip b { font-size: 13px; }
  .topnav { gap: 3px; }
  .hero-copy h1 { font-size: 39px; }
  .studio-action { padding: 8px; }
  .ratio-picker { grid-template-columns: repeat(2, 1fr); }
  .creative-canvas { min-height: 350px; }
  .canvas-placeholder h2 { font-size: 29px; }
  .prompt-dock { padding: 15px 13px; }
  .poster-copy h1 { font-size: 47px; }
  .poster-collage { align-items: stretch; }
  .collage-card { width: 33.33%; }
  .collage-card span { font-size: 8px; }
  .collage-card b { font-size: 16px; }
  .scribble-line { letter-spacing: 2px; }
}

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

/* 避免抽屉阴影与手绘错位在窄屏产生横向滚动 */
html { overflow-x: hidden; }
.works-drawer { pointer-events: none; }
.works-drawer.open { pointer-events: auto; }

@media (max-width: 700px) {
  .brand-text small, .user-sticker { display: none; }
  .logout-button { display: inline-block; padding: 6px 2px; font-size: 10px; }
  .topbar-right { gap: 8px; }
}

@media (max-width: 420px) {
  .logout-button { width: 26px; overflow: hidden; color: transparent; white-space: nowrap; }
  .logout-button::before { content: '↗'; color: var(--ink); font-size: 16px; }
}

/* 用户资料弹窗 */
.user-sticker {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}
.user-sticker:hover .username { color: var(--coral); }
.user-avatar { overflow: hidden; }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-dialog > h2 { margin: 14px 0 7px; font: 950 29px/1.15 var(--display); }
.profile-dialog > p { margin: 0 0 20px; color: var(--muted); font-size: 12px; }
.profile-kicker { display: inline-block; padding: 4px 9px; border: 2px solid var(--ink); background: var(--mint); font: 900 9px var(--display); letter-spacing: 1.5px; transform: rotate(-2deg); }
.profile-avatar-row { display: flex; align-items: center; gap: 14px; margin: 10px 0 21px; padding: 12px; border: 2px dashed var(--ink); border-radius: 13px 17px 11px 15px; background: rgba(66,183,255,.08); }
.profile-avatar-preview { display: grid; width: 74px; height: 74px; flex: 0 0 74px; place-items: center; overflow: hidden; border: 3px solid var(--ink); border-radius: 47% 53% 45% 55%; background: var(--yellow); box-shadow: 3px 3px 0 var(--ink); cursor: pointer; font: 950 25px var(--display); }
.profile-avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-row b { display: block; font: 900 17px var(--display); }
.profile-avatar-row small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.profile-hint { padding: 9px 11px; border-left: 4px solid var(--violet); background: rgba(140,99,255,.1); color: var(--muted); font-size: 10px; }

@media (max-width: 700px) {
  .user-sticker { display: flex; }
  .username { display: none; }
}
.profile-remove-avatar { margin-top: 7px; padding: 2px 0; border: 0; border-bottom: 1px solid var(--coral); background: transparent; color: var(--coral); font-size: 10px; font-weight: 800; }

/* 账户安全与修改密码 */
.profile-password-button {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: 15px;
  padding: 11px 13px;
  border: 2px solid var(--ink);
  border-radius: 11px 16px 10px 14px;
  background: rgba(255,225,74,.22);
  box-shadow: 2px 3px 0 var(--ink);
  text-align: left;
}
.profile-password-button > span { display: grid; width: 36px; height: 36px; place-items: center; border: 2px solid var(--ink); border-radius: 50%; background: var(--violet); color: white; font: 900 18px var(--display); }
.profile-password-button b { display: block; font: 900 12px var(--display); }
.profile-password-button small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.profile-password-button i { font: 900 20px var(--display); font-style: normal; }
.profile-password-button:hover { background: var(--yellow); transform: rotate(-.5deg); }
.password-dialog > h2 { margin: 14px 0 7px; font: 950 29px/1.15 var(--display); }
.password-dialog > p { margin: 0 0 20px; color: var(--muted); font-size: 12px; }
.password-kicker { background: var(--violet); color: white; }
.password-security-tip { display: grid; grid-template-columns: auto 1fr; gap: 9px; align-items: center; margin-top: 16px; padding: 10px 11px; border: 2px dashed var(--ink); border-radius: 9px; background: rgba(69,216,180,.12); }
.password-security-tip b { padding: 3px 7px; border: 2px solid var(--ink); background: var(--mint); font: 900 8px var(--display); white-space: nowrap; }
.password-security-tip span { color: var(--muted); font-size: 10px; }

/* 全站系统公告 */
.system-banner {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px clamp(18px, 4vw, 64px);
  border-bottom: 3px solid var(--ink);
  background: var(--yellow);
  font-size: 12px;
}
.system-banner b { padding: 3px 8px; border: 2px solid var(--ink); background: var(--white); font: 900 9px var(--display); letter-spacing: 1px; transform: rotate(-2deg); }
.system-banner.maintenance { background: var(--pink); color: white; }
.system-banner.maintenance b { color: var(--ink); background: var(--yellow); }
.auth-system-notice { display: flex; gap: 8px; margin: -6px 0 18px; padding: 9px 10px; border: 2px dashed var(--ink); border-radius: 9px; background: rgba(255,225,74,.2); color: var(--muted); font-size: 10px; }
.auth-system-notice b { color: var(--ink); white-space: nowrap; }
.auth-system-notice.maintenance { background: rgba(255,79,121,.15); }
.auth-registration-closed { margin-top: 20px; color: var(--muted); font-size: 11px; font-weight: 750; text-align: center; }

/* 管理后台：系统设置 */
.page-tabs { grid-template-columns: repeat(4, 1fr); }
.page-tab.active:nth-child(4) { background: var(--blue); color: var(--ink); }
.system-settings-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; padding: 0 3px; }
.system-settings-toolbar span { color: var(--violet); font: 900 9px var(--display); letter-spacing: 2px; }
.system-settings-toolbar h2 { margin: 4px 0 0; font: 950 27px var(--display); }
.system-save-button { min-width: 175px; }
.system-save-button:disabled { cursor: wait; opacity: .55; }
.system-status-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin-bottom: 18px; }
.system-status-card { display: flex; min-height: 105px; flex-direction: column; justify-content: center; padding: 15px 17px; border: 3px solid var(--ink); border-radius: 13px 19px 12px 16px; background: var(--white); box-shadow: 4px 5px 0 var(--ink); }
.system-status-card:nth-child(2) { transform: rotate(-.5deg); }
.system-status-card:nth-child(3) { transform: rotate(.6deg); }
.system-status-card.on { background: rgba(69,216,180,.38); }
.system-status-card.off { background: rgba(255,79,121,.25); }
.system-status-card.warning { background: var(--yellow); }
.system-status-card span { font: 900 8px var(--display); letter-spacing: 1.7px; }
.system-status-card b { margin-top: 7px; font: 950 18px var(--display); }
.system-status-card small { margin-top: 3px; color: rgba(32,30,45,.68); font-size: 9px; }
.system-settings-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.system-settings-card { position: relative; padding: 20px; border: 3px solid var(--ink); border-radius: 16px 24px 15px 20px; background: var(--white); box-shadow: 6px 7px 0 var(--ink); }
.system-settings-card:nth-child(2) { transform: rotate(.35deg); }
.system-settings-card:nth-child(3) { transform: rotate(-.3deg); }
.system-settings-card::after { position: absolute; z-index: -1; width: 70px; height: 18px; left: 50%; top: -10px; content: ''; background: rgba(255,225,74,.78); transform: translateX(-50%) rotate(-2deg); }
.account-settings::after { background: rgba(69,216,180,.75); }
.creation-settings::after { background: rgba(66,183,255,.72); }
.storage-settings::after { background: rgba(140,99,255,.58); }
.system-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 17px; padding-bottom: 13px; border-bottom: 3px solid var(--ink); }
.system-card-head > span { display: grid; width: 38px; height: 38px; place-items: center; border: 2px solid var(--ink); border-radius: 50%; background: var(--yellow); font: 900 10px var(--display); }
.account-settings .system-card-head > span { background: var(--mint); }
.creation-settings .system-card-head > span { background: var(--blue); }
.storage-settings .system-card-head > span { background: var(--violet); color: white; }
.system-card-head small { display: block; color: var(--muted); font: 850 8px var(--display); letter-spacing: 1.6px; }
.system-card-head h2 { margin: 2px 0 0; font: 950 20px var(--display); }
.system-settings-card textarea { min-height: 86px; resize: vertical; }
.system-toggle { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 11px 0; padding: 12px; border: 2px solid var(--ink); border-radius: 10px 15px 9px 13px; background: var(--paper); cursor: pointer; }
.system-toggle.mint { background: rgba(69,216,180,.12); }
.system-toggle.blue { background: rgba(66,183,255,.12); }
.system-toggle.pink { background: rgba(255,79,121,.1); }
.toggle-copy b { display: block; font: 900 12px var(--display); }
.toggle-copy small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.toggle-switch { position: relative; flex: 0 0 50px; width: 50px; height: 28px; }
.toggle-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.toggle-switch i { position: absolute; inset: 0; border: 2px solid var(--ink); border-radius: 999px; background: #d8d4cf; box-shadow: 2px 2px 0 var(--ink); transition: background .18s ease; }
.toggle-switch i::after { position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; content: ''; border: 2px solid var(--ink); border-radius: 50%; background: var(--white); transition: transform .18s ease; }
.toggle-switch input:checked + i { background: var(--mint); }
.toggle-switch input:checked + i::after { transform: translateX(21px); }
.system-setting-note { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; margin-top: 12px; padding: 11px; border: 2px dashed var(--ink); border-radius: 9px; background: rgba(140,99,255,.08); }
.system-setting-note b { padding: 3px 7px; border: 2px solid var(--ink); background: var(--violet); color: white; font: 900 8px var(--display); white-space: nowrap; }
.system-setting-note p { margin: 0; color: var(--muted); font-size: 10px; }
.settings-load-error { padding: 50px; border: 3px dashed var(--ink); border-radius: 16px; color: var(--muted); text-align: center; }

@media (max-width: 920px) {
  .page-tabs { grid-template-columns: repeat(2, 1fr); }
  .system-settings-layout { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .system-banner { align-items: flex-start; justify-content: flex-start; }
  .system-status-grid { grid-template-columns: 1fr; }
  .system-status-card:nth-child(n) { transform: none; }
  .system-settings-toolbar { align-items: stretch; flex-direction: column; }
  .system-save-button { width: 100%; }
}

/* 本轮增强：钱包、完整用户编辑、S3 配置与分页 */
.balance-chip { color: var(--ink); text-align: left; cursor: pointer; transition: transform .16s ease, box-shadow .16s ease; }
.balance-chip:hover { box-shadow: 1px 2px 0 var(--ink); transform: translate(2px, 2px) rotate(-1deg); }
.balance-chip:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; }

/* 作品夹内容必须允许 Grid 子项收缩，提示词最多展示两行 */
.work-card { grid-template-columns: 92px minmax(0, 1fr) auto; overflow: hidden; }
.work-card > div { min-width: 0; }
.work-card p {
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.work-card span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.page-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.page-tab:nth-child(4) { transform: rotate(-.45deg); }
.page-tab.active:nth-child(4) { background: var(--blue); color: var(--ink); }

.admin-user-cell { display: flex; align-items: center; gap: 9px; min-width: 150px; }
.admin-user-cell > div { display: flex; min-width: 0; flex-direction: column; }
.admin-user-cell small { max-width: 150px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.admin-user-avatar { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; overflow: hidden; border: 2px solid var(--ink); border-radius: 50%; background: var(--mint); font-weight: 900; }
.admin-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.modal-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.modal-title-row small { color: var(--violet); font: 900 9px var(--display); letter-spacing: 2px; }
.modal-title-row h3 { margin-top: 4px; }
.admin-avatar-editor { display: flex; align-items: center; gap: 16px; margin: 14px 0 18px; padding: 12px; border: 2px dashed var(--ink); border-radius: 14px; background: var(--paper-deep); }
.admin-avatar-editor > div:last-child { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.admin-avatar-editor small { width: 100%; color: var(--muted); }
.admin-avatar-preview { display: grid; width: 76px; height: 76px; flex: 0 0 76px; place-items: center; overflow: hidden; border: 3px solid var(--ink); border-radius: 50% 45% 52% 48%; background: var(--yellow); font: 950 26px var(--display); box-shadow: 3px 4px 0 var(--ink); }
.admin-avatar-preview img { width: 100%; height: 100%; object-fit: cover; }

.pagination-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; padding: 12px 14px; border: 2px solid var(--ink); border-radius: 12px 17px 11px 15px; background: var(--paper-deep); }
.pagination-bar > span { color: var(--muted); font-weight: 800; }
.pagination-bar > div { display: flex; align-items: center; gap: 12px; }
.pagination-bar > div > b { min-width: 54px; text-align: center; font: 900 11px var(--display); }
.table-empty { padding: 34px; color: var(--muted); text-align: center; }

.system-status-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.s3-settings { grid-column: 1 / -1; }
.s3-actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.s3-actions small { color: var(--muted); }

.wallet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 15px; border-bottom: 3px solid var(--ink); }
.wallet-head small { color: var(--coral); font: 900 9px var(--display); letter-spacing: 2px; }
.wallet-head h2 { margin: 4px 0; font: 950 30px var(--display); }
.wallet-head p { margin: 0; color: var(--muted); font-size: 12px; }
.wallet-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; margin: 17px 0; }
.wallet-summary > div { display: flex; min-height: 104px; flex-direction: column; justify-content: center; padding: 14px 18px; border: 3px solid var(--ink); border-radius: 14px 20px 13px 17px; box-shadow: 4px 5px 0 var(--ink); }
.wallet-balance-card { background: var(--yellow); transform: rotate(-.5deg); }
.wallet-spent-card { background: var(--mint); transform: rotate(.45deg); }
.wallet-summary span { font-size: 10px; font-weight: 900; }
.wallet-summary b { margin: 4px 0; font: 950 26px var(--display); }
.wallet-summary small { color: var(--muted); font: 850 8px var(--display); letter-spacing: 1.5px; }
.wallet-filters { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.wallet-filters button { padding: 7px 11px; border: 2px solid var(--ink); border-radius: 999px; background: var(--white); font-size: 10px; font-weight: 850; }
.wallet-filters button.active { background: var(--violet); color: white; box-shadow: 2px 2px 0 var(--ink); }
.wallet-list { display: grid; gap: 8px; min-height: 170px; }
.wallet-row { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 11px 12px; border: 2px solid rgba(32,30,45,.22); border-radius: 11px 15px 10px 13px; background: var(--white); }
.wallet-type { padding: 5px 7px; border: 2px solid var(--ink); border-radius: 999px; background: var(--blue); text-align: center; font-size: 9px; font-weight: 900; }
.wallet-type.recharge { background: var(--mint); }
.wallet-type.deduct { background: #ffb3b5; }
.wallet-row-copy { display: flex; min-width: 0; flex-direction: column; }
.wallet-row-copy b, .wallet-row-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wallet-row-copy small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.wallet-row > strong { white-space: nowrap; }
.wallet-empty, .wallet-loading { display: flex; min-height: 170px; align-items: center; justify-content: center; flex-direction: column; gap: 5px; color: var(--muted); text-align: center; }
.wallet-empty span { font-size: 28px; }
.wallet-support-note { display: flex; gap: 8px; margin-top: 12px; padding: 10px 12px; border-left: 4px solid var(--coral); background: #fff3df; font-size: 11px; }

@media (max-width: 920px) {
  .page-tabs, .system-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .page-tabs { gap: 8px; }
  .page-tab { padding: 10px; }
  .page-tab > span { width: 30px; height: 30px; }
  .wallet-summary { grid-template-columns: 1fr; }
  .wallet-row { grid-template-columns: 58px minmax(0, 1fr); }
  .wallet-row > strong { grid-column: 2; }
  .pagination-bar { align-items: stretch; flex-direction: column; }
  .pagination-bar > div { justify-content: space-between; }
  .admin-avatar-editor { align-items: flex-start; }
}

/* 弹窗显示期间固定页面，滚动仅发生在弹窗遮罩内部 */
html.modal-open,
body.modal-open { overflow: hidden; overscroll-behavior: none; }
body.modal-open { position: fixed; right: 0; left: 0; width: 100%; }

/* 顶部账户区域：钱包、个人资料和退出统一为卡片 */
.topbar-right { gap: 9px; }
.topbar-card {
  display: flex;
  min-height: 54px;
  align-items: center;
  gap: 9px;
  padding: 7px 11px;
  border: 2px solid var(--ink);
  border-radius: 13px 18px 12px 16px;
  background: var(--white);
  box-shadow: 3px 4px 0 var(--ink);
  color: var(--ink);
  line-height: 1.1;
  text-align: left;
  transform: none;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.topbar-card:hover { box-shadow: 1px 2px 0 var(--ink); transform: translate(2px, 2px); }
.topbar-card:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; }
.topbar-card-copy { display: flex; min-width: 0; flex-direction: column; }
.topbar-card-copy b { max-width: 105px; overflow: hidden; font: 900 13px var(--display); text-overflow: ellipsis; white-space: nowrap; }
.topbar-card-copy small { margin-top: 4px; color: var(--muted); font: 850 8px var(--display); letter-spacing: 1px; white-space: nowrap; }
.wallet-card { min-width: 122px; justify-content: space-between; background: var(--yellow); }
.wallet-card .topbar-card-copy { flex-direction: column; }
.wallet-card .topbar-card-copy small { order: 0; margin: 0 0 4px; color: var(--ink); font-size: 9px; }
.wallet-card .topbar-card-copy b { order: 1; font-size: 16px; }
.wallet-card > i { font: 900 23px/1 var(--display); font-style: normal; }
.user-card { min-width: 126px; background: var(--paper-deep); }
.user-card .user-avatar { flex: 0 0 36px; }
.logout-card { min-width: 96px; background: #ffe3dc; }
.logout-icon { display: grid; width: 31px; height: 31px; place-items: center; border: 2px solid var(--ink); border-radius: 50%; background: var(--coral); color: white; font: 900 16px var(--display); }

/* 用户充值申请 */
.wallet-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wallet-summary > div,
.wallet-summary > button { display: flex; min-height: 104px; flex-direction: column; justify-content: center; padding: 14px 18px; border: 3px solid var(--ink); border-radius: 14px 20px 13px 17px; box-shadow: 4px 5px 0 var(--ink); text-align: left; }
.wallet-recharge-card { background: var(--blue); transform: rotate(-.25deg); }
.wallet-recharge-card:hover:not(:disabled) { box-shadow: 2px 3px 0 var(--ink); transform: translate(2px, 2px) rotate(.25deg); }
.wallet-recharge-card:disabled { cursor: not-allowed; filter: grayscale(.6); opacity: .6; }
.wallet-recharge-card span { font-size: 10px; font-weight: 900; }
.wallet-recharge-card b { margin: 4px 0; font: 950 19px var(--display); }
.wallet-recharge-card small { color: var(--muted); font: 850 8px var(--display); letter-spacing: 1.5px; }
.wallet-section-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 19px 0 10px; }
.wallet-section-title small { color: var(--violet); font: 900 8px var(--display); letter-spacing: 1.5px; }
.wallet-section-title h3 { margin: 2px 0 0; font: 950 18px var(--display); }
.wallet-section-title > span { color: var(--muted); font-size: 10px; }
.wallet-transaction-title { padding-top: 15px; border-top: 2px dashed rgba(32,30,45,.24); }
.wallet-transaction-title .wallet-filters { margin: 0; justify-content: flex-end; }
.wallet-request-list { display: grid; gap: 7px; }
.wallet-request-row { display: grid; grid-template-columns: 115px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 10px 11px; border: 2px solid rgba(32,30,45,.2); border-radius: 10px 14px 9px 12px; background: rgba(255,255,255,.72); }
.wallet-request-row > div { display: flex; min-width: 0; flex-direction: column; }
.wallet-request-row > div > b { font: 900 13px var(--display); }
.wallet-request-row small { margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.wallet-request-reference span { overflow: hidden; font-size: 10px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.wallet-request-empty { padding: 18px; border: 2px dashed rgba(32,30,45,.24); border-radius: 12px; color: var(--muted); text-align: center; }
.request-status { padding: 5px 8px; border: 2px solid var(--ink); border-radius: 999px; font-size: 9px; font-weight: 900; white-space: nowrap; }
.request-status.pending { background: var(--yellow); }
.request-status.approved { background: var(--mint); }
.request-status.rejected { background: #ffb3b5; }
.request-status.cancelled { background: var(--paper-deep); color: var(--muted); }
.recharge-dialog .modal-title-row { margin-bottom: 14px; }
.recharge-instruction { padding: 12px 14px; border: 2px solid var(--ink); border-radius: 11px 16px 10px 13px; background: rgba(66,183,255,.13); }
.recharge-instruction b { font: 900 11px var(--display); }
.recharge-instruction p { margin: 5px 0 0; color: var(--muted); font-size: 11px; white-space: pre-wrap; }
.recharge-presets { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin-bottom: 8px; }
.recharge-presets button { padding: 8px 5px; border: 2px solid var(--ink); border-radius: 9px 12px 8px 11px; background: var(--white); font-size: 10px; font-weight: 900; }
.recharge-presets button.active { background: var(--yellow); box-shadow: 2px 2px 0 var(--ink); transform: translate(-1px, -1px); }
.recharge-security-note { display: grid; grid-template-columns: auto 1fr; gap: 9px; align-items: center; margin-top: 13px; padding: 10px 11px; border-left: 4px solid var(--mint); background: rgba(69,216,180,.12); }
.recharge-security-note span { display: grid; width: 25px; height: 25px; place-items: center; border: 2px solid var(--ink); border-radius: 50%; background: var(--mint); font-weight: 900; }
.recharge-security-note p { margin: 0; color: var(--muted); font-size: 10px; }

@media (max-width: 1180px) {
  .topbar-card-copy small { display: none; }
  .user-card, .logout-card { min-width: auto; }
  .logout-card .topbar-card-copy { display: none; }
}
@media (max-width: 920px) {
  .wallet-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .topbar-right { gap: 7px; }
  .topbar-card { min-height: 48px; padding: 6px 8px; }
  .wallet-card { min-width: 105px; }
  .user-card .topbar-card-copy, .logout-card .topbar-card-copy { display: none; }
  .user-card { min-width: auto; }
}
@media (max-width: 700px) {
  .topbar-right .topbar-card { display: flex; }
  .user-card, .logout-card { padding: 5px; }
  .user-card .user-avatar { width: 32px; height: 32px; flex-basis: 32px; }
  .logout-icon { width: 30px; height: 30px; }
  .wallet-summary { grid-template-columns: 1fr; }
  .wallet-request-row { grid-template-columns: 92px minmax(0, 1fr) auto; }
  .wallet-request-row > .btn { grid-column: 2 / -1; justify-self: end; }
  .wallet-section-title { align-items: flex-start; flex-direction: column; }
  .wallet-transaction-title .wallet-filters { justify-content: flex-start; }
}
@media (max-width: 480px) {
  .wallet-card { min-width: 90px; }
  .wallet-card > i { display: none; }
  .wallet-card .topbar-card-copy b { font-size: 13px; }
  .recharge-presets { grid-template-columns: repeat(3, 1fr); }
}

/* 管理后台财务中心与充值审核 */
.billing-toolbar { align-items: center; }
.billing-switch { display: inline-flex; gap: 6px; padding: 5px; border: 2px solid var(--ink); border-radius: 999px; background: var(--paper-deep); }
.billing-switch button { padding: 7px 13px; border: 0; border-radius: 999px; background: transparent; font-size: 10px; font-weight: 900; }
.billing-switch button.active { border: 2px solid var(--ink); background: var(--yellow); box-shadow: 2px 2px 0 var(--ink); }
.recharge-admin-filterbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 13px; }
.recharge-admin-filterbar > span { color: var(--muted); font-size: 10px; font-weight: 800; }
.recharge-status-filters { display: flex; flex-wrap: wrap; gap: 7px; }
.recharge-status-filters button { padding: 6px 11px; border: 2px solid var(--ink); border-radius: 999px; background: var(--white); font-size: 9px; font-weight: 900; }
.recharge-status-filters button.active { background: var(--violet); color: white; box-shadow: 2px 2px 0 var(--ink); }
.table-subtext { display: block; margin-top: 2px; color: var(--muted); font-size: 8px; }
.order-code { font-size: 9px; font-weight: 800; white-space: nowrap; }
.payment-reference-cell { display: flex; max-width: 230px; flex-direction: column; }
.payment-reference-cell b, .payment-reference-cell small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.payment-reference-cell small { margin-top: 3px; color: var(--muted); }
.review-result { display: block; max-width: 160px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.btn.danger { background: var(--red); color: white; }
.recharge-review-dialog > h3 { margin-top: 13px; }
.review-order-summary { display: grid; gap: 7px; margin: 14px 0; padding: 12px; border: 2px dashed var(--ink); border-radius: 11px; background: var(--paper-deep); }
.review-order-summary > div { display: grid; grid-template-columns: 115px minmax(0, 1fr); gap: 8px; }
.review-order-summary span { color: var(--muted); font-size: 9px; }
.review-order-summary b { overflow-wrap: anywhere; font-size: 10px; }
.review-warning { padding: 10px 12px; border-left: 4px solid var(--coral); background: #fff1e9; color: var(--muted); font-size: 10px; }

@media (max-width: 700px) {
  .billing-toolbar, .recharge-admin-filterbar { align-items: stretch; flex-direction: column; }
  .billing-switch { width: 100%; }
  .billing-switch button { flex: 1; }
}
@media (max-width: 420px) {
  .topbar .brand-text { display: none; }
  .wallet-card { min-width: 82px; }
}

/* 作品详情中的长提示词独立滚动，避免撑高整个弹窗 */
.work-viewer-info { min-width: 0; }
.work-viewer-prompt {
  max-height: clamp(120px, 24vh, 220px);
  margin: 18px 0;
  padding: 11px 13px;
  overflow: auto;
  overscroll-behavior: contain;
  border: 2px dashed rgba(32,30,45,.35);
  border-radius: 10px 14px 9px 12px;
  background: var(--paper-deep);
  line-height: 1.8;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
  scrollbar-gutter: stable;
}
.work-viewer-prompt:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; }
@media (max-width: 700px) {
  .work-viewer-prompt { max-height: min(180px, 22vh); }
}

/* 公告中心：用户端顶部提示、公告详情与管理后台 */
.page-tabs { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.page-tab:nth-child(5) { transform: rotate(.4deg); }
.page-tab.active:nth-child(4) { background: var(--blue); color: var(--ink); }
.page-tab.active:nth-child(5) { background: var(--pink); color: white; }

.system-banner.announcement {
  min-width: 0;
  background: var(--blue);
}
.system-banner.announcement.level-success { background: var(--mint); }
.system-banner.announcement.level-warning { background: var(--yellow); }
.system-banner.announcement.level-urgent { background: var(--pink); color: white; }
.system-banner.announcement.level-urgent b { color: var(--ink); }
.announcement-banner-title {
  flex: 0 0 auto;
  max-width: min(32vw, 380px);
  overflow: hidden;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.system-banner.announcement > small {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  opacity: .82;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.announcement-banner-button {
  flex: 0 0 auto;
  padding: 5px 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font-size: 9px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 2px 2px 0 var(--ink);
}
.announcement-banner-button:hover { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }

.modal:has(.announcement-center) { overflow: hidden; }
.announcement-center {
  display: flex;
  height: min(680px, calc(100vh - 88px));
  min-height: 0;
  flex-direction: column;
}
.announcement-center-head {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 16px;
  border-bottom: 3px solid var(--ink);
}
.announcement-center-head small { color: var(--violet); font: 900 9px var(--display); letter-spacing: 1.8px; }
.announcement-center-head h2 { margin: 3px 0 2px; font: 950 clamp(25px, 4vw, 34px)/1.15 var(--display); }
.announcement-center-head p { margin: 0; color: var(--muted); font-size: 11px; }
.announcement-center-head > div:last-child { display: flex; gap: 7px; }
.announcement-center-layout {
  display: grid;
  min-height: 0;
  flex: 1;
  grid-template-columns: minmax(210px, .8fr) minmax(0, 1.65fr);
  gap: 17px;
  padding-top: 17px;
  overflow: hidden;
}
.announcement-list {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  gap: 9px;
  padding: 2px 7px 8px 2px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.announcement-list-item {
  position: relative;
  display: flex;
  width: 100%;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
  padding: 12px;
  overflow: hidden;
  border: 2px solid rgba(32,30,45,.3);
  border-radius: 10px 15px 9px 13px;
  background: var(--paper);
  text-align: left;
}
.announcement-list-item:hover { border-color: var(--ink); transform: translateY(-1px); }
.announcement-list-item.active { border: 3px solid var(--ink); background: var(--white); box-shadow: 3px 4px 0 var(--ink); }
.announcement-list-item.level-success.active { background: rgba(69,216,180,.14); }
.announcement-list-item.level-warning.active { background: rgba(255,225,74,.2); }
.announcement-list-item.level-urgent.active { background: rgba(255,79,121,.12); }
.announcement-list-item > div { display: flex; align-items: center; gap: 6px; }
.announcement-list-item i,
.announcement-admin-card-head i {
  padding: 2px 6px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--yellow);
  font-size: 8px;
  font-style: normal;
  font-weight: 900;
}
.announcement-list-item > b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.announcement-list-item > small { overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.announcement-level {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--blue);
  font-size: 8px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}
.announcement-level.success { background: var(--mint); }
.announcement-level.warning { background: var(--yellow); }
.announcement-level.urgent { background: var(--pink); color: white; }
.announcement-detail {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  padding: 20px;
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: 15px 22px 14px 19px;
  background: var(--white);
  box-shadow: 5px 6px 0 var(--ink);
}
.announcement-detail::after {
  position: absolute;
  right: -19px;
  top: -22px;
  width: 75px;
  height: 75px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--blue);
  content: '';
  opacity: .45;
}
.announcement-detail.level-success::after { background: var(--mint); }
.announcement-detail.level-warning::after { background: var(--yellow); }
.announcement-detail.level-urgent::after { background: var(--pink); }
.announcement-detail-meta { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; }
.announcement-detail-meta > b { font-size: 9px; }
.announcement-detail h2 { position: relative; z-index: 1; margin: 14px 0 3px; padding-right: 34px; font: 950 clamp(22px, 3vw, 31px)/1.2 var(--display); overflow-wrap: anywhere; }
.announcement-detail > small { position: relative; z-index: 1; color: var(--muted); font-size: 9px; }
.announcement-content {
  position: relative;
  z-index: 1;
  min-height: 0;
  margin-top: 16px;
  padding: 15px 16px;
  flex: 1;
  overflow: auto;
  overscroll-behavior: contain;
  border: 2px dashed rgba(32,30,45,.4);
  border-radius: 11px 16px 10px 14px;
  background: var(--paper);
  line-height: 1.85;
  overflow-wrap: anywhere;
  white-space: normal;
  scrollbar-gutter: stable;
}
.announcement-empty,
.announcement-admin-empty {
  display: flex;
  min-height: 300px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 7px;
  text-align: center;
}
.announcement-empty > span,
.announcement-admin-empty > span { color: var(--coral); font-size: 48px; }
.announcement-empty small,
.announcement-admin-empty p { margin: 0; color: var(--muted); }

.announcement-toolbar .meta-row b { background: var(--blue); }
.announcement-admin-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.announcement-admin-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 310px;
  flex-direction: column;
  padding: 19px;
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: 15px 23px 14px 19px;
  background: var(--white);
  box-shadow: 5px 6px 0 var(--ink);
}
.announcement-admin-card::before { position: absolute; inset: 0 auto 0 0; width: 8px; background: var(--blue); content: ''; }
.announcement-admin-card.level-success::before { background: var(--mint); }
.announcement-admin-card.level-warning::before { background: var(--yellow); }
.announcement-admin-card.level-urgent::before { background: var(--pink); }
.announcement-admin-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.announcement-admin-card-head > div { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.announcement-admin-card-head > small { color: var(--muted); font-size: 8px; white-space: nowrap; }
.announcement-admin-status { padding: 3px 7px; border: 2px solid var(--ink); border-radius: 999px; font-size: 8px; font-weight: 900; white-space: nowrap; }
.announcement-admin-status.active { background: var(--mint); }
.announcement-admin-status.scheduled { background: var(--blue); }
.announcement-admin-status.expired { background: var(--paper-deep); color: var(--muted); }
.announcement-admin-status.off { background: #ffb3b5; }
.announcement-admin-card > h2 { margin: 17px 0 6px; font: 950 22px/1.2 var(--display); overflow-wrap: anywhere; }
.announcement-admin-card > p {
  display: -webkit-box;
  min-height: 4.8em;
  margin: 0 0 15px;
  overflow: hidden;
  color: var(--muted);
  line-height: 1.6;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.announcement-schedule { display: grid; gap: 4px; margin-top: auto; padding: 10px 12px; border: 2px dashed rgba(32,30,45,.35); border-radius: 9px 13px 8px 11px; background: var(--paper); }
.announcement-schedule span { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.announcement-admin-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; margin-top: 14px; }

.announcement-editor textarea { min-height: 150px; resize: vertical; }
.announcement-editor .form-grid-2 { align-items: start; }
.announcement-char-count { text-align: right; }
.announcement-checks { display: grid; gap: 8px; }
.announcement-checks > label { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border: 2px solid var(--ink); border-radius: 9px 13px 8px 11px; background: var(--paper); cursor: pointer; }
.announcement-checks input { width: 18px; height: 18px; accent-color: var(--violet); }
.announcement-checks span { display: flex; min-width: 0; flex-direction: column; }
.announcement-checks b { font-size: 10px; }
.announcement-checks small { color: var(--muted); font-size: 8px; }
.announcement-preview { display: grid; gap: 10px; margin: 14px 0; padding: 12px; overflow: hidden; border: 2px solid var(--ink); border-radius: 9px 15px 8px 12px; background: var(--blue); }
.announcement-preview.level-success { background: var(--mint); }
.announcement-preview.level-warning { background: var(--yellow); }
.announcement-preview.level-urgent { background: var(--pink); color: white; }
.announcement-preview-head { display: flex; align-items: center; gap: 9px; min-width: 0; }
.announcement-preview-head > b { flex: 0 0 auto; padding: 3px 7px; border: 2px solid var(--ink); background: var(--white); color: var(--ink); font-size: 8px; white-space: nowrap; }
.announcement-preview-title { min-width: 0; overflow: hidden; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.announcement-preview-content { max-height: 220px; padding: 12px 13px; overflow: auto; border: 2px dashed rgba(32,30,45,.35); border-radius: 9px 13px 8px 11px; background: var(--paper); color: var(--ink); }
.announcement-settings-link { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 15px; padding: 12px 13px; border: 2px dashed var(--ink); border-radius: 10px 15px 9px 13px; background: rgba(66,183,255,.12); }
.announcement-settings-link b { font: 900 11px var(--display); }
.announcement-settings-link p { margin: 2px 0 0; color: var(--muted); font-size: 9px; }
.announcement-settings-link .btn { flex: 0 0 auto; }

@media (max-width: 1100px) {
  .page-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 920px) {
  .page-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .announcement-admin-list { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .system-banner.announcement { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; }
  .system-banner.announcement > small { display: none; }
  .announcement-banner-title { max-width: none; }
  .announcement-center { height: calc(100vh - 76px); }
  .announcement-center-head p { display: none; }
  .announcement-center-layout { grid-template-columns: 1fr; grid-template-rows: 142px minmax(0, 1fr); gap: 12px; }
  .announcement-list { padding-right: 3px; }
  .announcement-list-item { padding: 9px 10px; }
  .announcement-detail { padding: 15px; box-shadow: 3px 4px 0 var(--ink); }
  .announcement-content { margin-top: 11px; padding: 12px; }
  .announcement-settings-link { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 520px) {
  .page-tabs { grid-template-columns: 1fr; }
  .system-banner.announcement { grid-template-columns: auto minmax(0, 1fr); }
  .announcement-banner-button { grid-column: 1 / -1; width: 100%; }
  .announcement-center-head { gap: 8px; }
  .announcement-center-head .icon-button:first-child { display: none; }
  .announcement-admin-card-head { align-items: flex-start; flex-direction: column; }
  .announcement-editor .form-grid-2 { grid-template-columns: 1fr; }
}

/* 作品详情提示词复制 */
.work-viewer-prompt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 8px;
}
.work-viewer-prompt-head > b { font: 900 11px var(--display); }
.work-viewer-prompt-head + .work-viewer-prompt { margin-top: 0; }
.work-viewer-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.work-viewer-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.work-viewer-actions svg { width: 15px; height: 15px; }
@media (max-width: 520px) {
  .work-viewer-prompt-head { align-items: flex-start; }
  .work-viewer-actions { flex-direction: column; }
  .work-viewer-actions .btn { width: 100%; }
}

/* 充值申请中的支付宝 / 微信收款码 */
.recharge-qr-section {
  margin: 14px 0 17px;
  padding: 13px;
  border: 2px solid var(--ink);
  border-radius: 12px 17px 10px 14px;
  background: rgba(255,225,74,.16);
}
.recharge-qr-section-head,
.recharge-qr-admin-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}
.recharge-qr-section-head b,
.recharge-qr-admin-head b { font: 900 12px var(--display); }
.recharge-qr-section-head p,
.recharge-qr-admin-head p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.recharge-qr-section-head > span,
.recharge-qr-admin-head > span { color: var(--violet); font: 900 8px var(--display); letter-spacing: 1.4px; white-space: nowrap; }
.recharge-qr-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.recharge-qr-option {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 2px solid var(--ink);
  border-radius: 10px 14px 9px 12px;
  background: var(--white);
  text-align: left;
  box-shadow: 2px 3px 0 var(--ink);
}
.recharge-qr-option:hover:not(:disabled) { transform: translate(1px, 1px); box-shadow: 1px 2px 0 var(--ink); }
.recharge-qr-option:disabled { cursor: not-allowed; filter: grayscale(.65); opacity: .6; }
.recharge-qr-option > span {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  font: 950 16px var(--display);
}
.recharge-qr-option.alipay > span { background: var(--blue); }
.recharge-qr-option.wechat > span { background: var(--mint); }
.recharge-qr-option > div { display: flex; min-width: 0; flex-direction: column; }
.recharge-qr-option b,
.recharge-qr-option small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recharge-qr-option b { font-size: 10px; }
.recharge-qr-option small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.payment-qr-dialog p { margin: 12px 0 0; color: var(--muted); font-size: 10px; text-align: center; }
.payment-method-badge { padding: 4px 8px; border: 2px solid var(--ink); border-radius: 999px; font-size: 9px; font-weight: 900; }
.payment-method-badge.alipay { background: var(--blue); }
.payment-method-badge.wechat { background: var(--mint); }
.payment-qr-image {
  display: grid;
  min-height: 260px;
  place-items: center;
  padding: 15px;
  border: 3px solid var(--ink);
  border-radius: 13px 18px 11px 15px;
  background: var(--paper-deep);
  box-shadow: 4px 5px 0 var(--ink);
}
.payment-qr-image img { display: block; width: min(100%, 330px); max-height: 58vh; object-fit: contain; image-rendering: auto; }
.recharge-qr-admin {
  margin-top: 16px;
  padding: 13px;
  border: 2px dashed var(--ink);
  border-radius: 11px 16px 10px 14px;
  background: rgba(69,216,180,.08);
}
.recharge-qr-admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.qr-code-uploader { min-width: 0; padding: 11px; border: 2px solid var(--ink); border-radius: 10px 14px 9px 12px; background: var(--white); }
.qr-code-uploader-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.qr-code-uploader-head b { font-size: 11px; }
.qr-code-uploader-head span { color: var(--muted); font-size: 8px; font-weight: 850; }
.qr-code-uploader-body { display: flex; align-items: center; gap: 10px; }
.qr-code-preview { display: grid; width: 100px; height: 100px; flex: 0 0 100px; place-items: center; overflow: hidden; border: 2px dashed rgba(32,30,45,.45); border-radius: 8px 12px 7px 10px; background: var(--paper-deep); color: var(--muted); font-size: 9px; text-align: center; }
.qr-code-preview img { display: block; width: 100%; height: 100%; object-fit: contain; }
.qr-code-uploader-actions { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; gap: 8px; }
.qr-code-uploader-actions input[type="file"] { width: 100%; min-width: 0; font-size: 9px; }
.qr-code-uploader > small { display: block; margin-top: 8px; color: var(--muted); font-size: 8px; }
@media (max-width: 700px) {
  .recharge-qr-options,
  .recharge-qr-admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .recharge-qr-section-head,
  .recharge-qr-admin-head { flex-direction: column; gap: 4px; }
  .recharge-qr-admin-head > span { display: none; }
  .qr-code-uploader-body { align-items: flex-start; flex-direction: column; }
  .qr-code-preview { width: 130px; height: 130px; flex-basis: 130px; }
  .qr-code-uploader-actions { width: 100%; }
}

/* 系统设置按列排列，避免左侧卡片被右侧高卡片撑出巨大空白 */
.system-settings-layout {
  align-items: start;
}
.system-settings-column {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 18px;
}
@media (max-width: 920px) {
  .system-settings-column { gap: 18px; }
}

/* 管理台使用概览 */
.page-tabs { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.page-tab:nth-child(6) { transform: rotate(-.5deg); }
.page-tab.active:nth-child(1) { background: var(--yellow); color: var(--ink); }
.page-tab.active:nth-child(2) { background: var(--mint); color: var(--ink); }
.page-tab.active:nth-child(3) { background: var(--blue); color: var(--ink); }
.page-tab.active:nth-child(4) { background: var(--violet); color: white; }
.page-tab.active:nth-child(5) { background: var(--pink); color: white; }
.page-tab.active:nth-child(6) { background: var(--coral); color: white; }
.usage-toolbar { align-items: flex-end; padding: 14px 16px; border: 3px solid var(--ink); border-radius: 13px 19px 12px 16px; background: var(--white); box-shadow: 4px 5px 0 var(--ink); }
.usage-toolbar > div:first-child { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.usage-toolbar > div:first-child b { font: 950 17px var(--display); }
.usage-toolbar > div:first-child span { color: var(--muted); font-size: 9px; }
.usage-range-filters { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.usage-range-filters button { padding: 7px 11px; border: 2px solid var(--ink); border-radius: 999px; background: var(--paper); font-size: 9px; font-weight: 900; }
.usage-range-filters button.active { background: var(--ink); color: white; box-shadow: 2px 2px 0 var(--violet); }
.usage-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin: 20px 0; }
.usage-summary-card { display: flex; min-height: 125px; flex-direction: column; justify-content: center; padding: 17px 18px; border: 3px solid var(--ink); border-radius: 14px 20px 13px 17px; box-shadow: 5px 6px 0 var(--ink); }
.usage-summary-card:nth-child(2) { transform: rotate(-.5deg); }
.usage-summary-card:nth-child(4) { transform: rotate(.5deg); }
.usage-summary-card.yellow { background: var(--yellow); }
.usage-summary-card.mint { background: var(--mint); }
.usage-summary-card.violet { background: var(--violet); color: white; }
.usage-summary-card.blue { background: var(--blue); }
.usage-summary-card span { font: 900 8px var(--display); letter-spacing: 1.8px; }
.usage-summary-card b { margin-top: 8px; overflow-wrap: anywhere; font: 950 clamp(23px, 3vw, 35px)/1 var(--display); }
.usage-summary-card small { margin-top: 7px; color: currentColor; font-size: 9px; opacity: .72; }
.usage-panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; margin-bottom: 22px; }
.usage-panel { min-width: 0; padding: 18px; border: 3px solid var(--ink); border-radius: 15px 22px 14px 18px; background: var(--white); box-shadow: 6px 7px 0 var(--ink); }
.usage-panel:nth-child(2) { transform: rotate(.25deg); }
.usage-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding-bottom: 13px; border-bottom: 2px dashed rgba(32,30,45,.3); }
.usage-panel-head small { color: var(--violet); font: 900 8px var(--display); letter-spacing: 1.7px; }
.usage-panel-head h2 { margin: 4px 0 0; font: 950 22px var(--display); }
.usage-panel-head > span { padding: 4px 8px; border: 2px solid var(--ink); border-radius: 999px; background: var(--yellow); font-size: 8px; font-weight: 900; white-space: nowrap; }
.usage-model-list, .usage-activity-list { display: grid; gap: 8px; margin-top: 13px; }
.usage-model-card { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 10px 11px; border: 2px solid var(--ink); border-radius: 9px 13px 8px 11px; background: var(--paper); }
.usage-model-card > div { display: flex; min-width: 0; flex-direction: column; }
.usage-model-card b, .usage-model-card small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usage-model-card b { font-size: 10px; }
.usage-model-card small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.usage-model-card strong { display: grid; width: 30px; height: 30px; place-items: center; border: 2px solid var(--ink); border-radius: 50%; background: var(--blue); font-size: 10px; }
.usage-model-card > span { color: var(--muted); font-size: 9px; font-weight: 850; white-space: nowrap; }
.usage-activity-list article { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 9px; padding: 8px 3px; border-bottom: 1px dashed rgba(32,30,45,.25); }
.usage-activity-dot { width: 9px; height: 9px; border: 2px solid var(--ink); border-radius: 50%; background: var(--mint); }
.usage-activity-list article > div { display: flex; min-width: 0; flex-direction: column; }
.usage-activity-list b, .usage-activity-list small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usage-activity-list b { font-size: 10px; }
.usage-activity-list small { color: var(--muted); font-size: 8px; }
.usage-activity-list time { color: var(--muted); font-size: 8px; white-space: nowrap; }
.usage-activity-list strong { font-size: 9px; white-space: nowrap; }
.usage-empty { padding: 28px 15px; color: var(--muted); font-size: 10px; text-align: center; }
.usage-users-toolbar { margin-top: 4px; }
.usage-table-card table { min-width: 930px; }
.user-usage-page { max-width: 1240px; margin: 0 auto; }
.user-usage-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; margin-bottom: 22px; padding: 18px 3px 12px; }
.usage-kicker { display: inline-block; padding: 5px 10px; border: 2px solid var(--ink); background: var(--mint); font: 900 9px var(--display); letter-spacing: 1.6px; transform: rotate(-2deg); }
.user-usage-hero h1 { margin: 14px 0 5px; font: 950 clamp(37px, 5vw, 62px)/1 var(--display); letter-spacing: -3px; }
.user-usage-hero h1 em { position: relative; color: var(--coral); font-style: normal; white-space: nowrap; }
.user-usage-hero h1 em::after { position: absolute; z-index: -1; right: -4px; bottom: 1px; left: -4px; height: 12px; content: ''; background: var(--yellow); transform: rotate(-1deg); }
.user-usage-hero p { margin: 12px 0 0; color: var(--muted); font-weight: 650; }
.user-usage-hero .usage-range-filters { flex: 0 0 auto; }
.user-usage-summary { margin-top: 0; }
.user-usage-panels { margin-top: 8px; }
.user-usage-panels .usage-activity-list article { grid-template-columns: auto minmax(0, 1fr) auto; }
.admin-usage-panels .usage-activity-list article { grid-template-columns: auto minmax(0, 1fr) auto auto; }
@media (max-width: 820px) {
  .user-usage-hero { align-items: flex-start; flex-direction: column; }
  .user-usage-hero .usage-range-filters { justify-content: flex-start; }
}

@media (max-width: 1180px) {
  .page-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .usage-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .usage-toolbar { align-items: flex-start; flex-direction: column; }
  .usage-range-filters { justify-content: flex-start; }
  .usage-panels { grid-template-columns: 1fr; }
  .usage-panel:nth-child(n), .usage-summary-card:nth-child(n) { transform: none; }
}
@media (max-width: 620px) {
  .page-tabs, .usage-summary-grid { grid-template-columns: 1fr; }
  .usage-range-filters { display: grid; width: 100%; grid-template-columns: repeat(2, 1fr); }
  .usage-range-filters button { width: 100%; }
  .usage-activity-list article { grid-template-columns: auto minmax(0, 1fr) auto; }
  .usage-activity-list time { display: none; }
}

/* 公告改为右上角未读提醒与历史中心 */
.announcement-card {
  position: relative;
  min-width: 92px;
  background: var(--blue);
}
.announcement-card.has-unread {
  background: var(--yellow);
  animation: announcement-card-pop .48s ease both;
}
.announcement-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50% 45% 52% 48%;
  background: var(--white);
}
.announcement-icon svg { width: 21px; height: 21px; overflow: visible; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.2; }
.announcement-badge {
  position: absolute;
  right: -7px;
  top: -8px;
  display: grid;
  min-width: 23px;
  height: 23px;
  padding: 0 5px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--pink);
  color: white;
  font: 900 9px var(--display);
  box-shadow: 2px 2px 0 var(--ink);
}
.announcement-badge[hidden] { display: none; }
@keyframes announcement-card-pop {
  0% { transform: rotate(0) scale(.92); }
  55% { transform: rotate(-2deg) scale(1.05); }
  100% { transform: rotate(0) scale(1); }
}

.announcement-list-item.read { opacity: .72; }
.announcement-list-item.read.active { opacity: 1; }
.announcement-list-item.unread > b { font-weight: 950; }
.announcement-unread-label { background: var(--pink) !important; color: white; }
.announcement-expired-label { background: var(--paper-deep) !important; color: var(--muted); }
.announcement-read-all {
  align-self: center;
  padding: 7px 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--mint);
  font-size: 9px;
  font-weight: 900;
  box-shadow: 2px 2px 0 var(--ink);
}
.announcement-read-all:hover { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }

.modal:has(.announcement-unread-dialog) { overflow: hidden; }
.announcement-unread-dialog { min-height: 0; }
.announcement-unread-card {
  position: relative;
  padding: 4px;
  overflow: hidden;
}
.announcement-unread-card::after {
  position: absolute;
  right: -34px;
  top: -36px;
  width: 110px;
  height: 110px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--blue);
  content: '';
  opacity: .7;
}
.announcement-unread-card.level-success::after { background: var(--mint); }
.announcement-unread-card.level-warning::after { background: var(--yellow); }
.announcement-unread-card.level-urgent::after { background: var(--pink); }
.announcement-unread-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.announcement-unread-head > div { display: flex; flex-wrap: wrap; gap: 7px; }
.announcement-unread-head i {
  padding: 3px 7px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--yellow);
  font-size: 8px;
  font-style: normal;
  font-weight: 900;
}
.announcement-unread-kicker {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 22px;
  color: var(--violet);
  font: 900 9px var(--display);
  letter-spacing: 1.7px;
}
.announcement-unread-card h2 {
  position: relative;
  z-index: 1;
  margin: 7px 0 4px;
  padding-right: 46px;
  font: 950 clamp(25px, 5vw, 36px)/1.16 var(--display);
  overflow-wrap: anywhere;
}
.announcement-unread-time { position: relative; z-index: 1; color: var(--muted); font-size: 9px; }
.announcement-unread-content {
  position: relative;
  z-index: 1;
  max-height: min(270px, 38vh);
  margin-top: 16px;
  padding: 16px 17px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 2px dashed rgba(32,30,45,.34);
  border-radius: 12px 18px 11px 15px;
  background: var(--paper-deep);
  font-size: 12px;
  line-height: 1.85;
  white-space: normal;
  overflow-wrap: anywhere;
}
.announcement-unread-actions {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 18px;
}

@media (max-width: 1180px) {
  .announcement-card { min-width: auto; }
  .announcement-card .topbar-card-copy { display: none; }
}
@media (max-width: 700px) {
  .announcement-card { padding: 5px; }
  .announcement-icon { width: 32px; height: 32px; flex-basis: 32px; }
  .announcement-badge { right: -5px; top: -7px; }
  .announcement-unread-actions { flex-direction: column-reverse; }
  .announcement-unread-actions .btn { width: 100%; }
}
@media (max-width: 480px) {
  .announcement-center-head .announcement-read-all { display: none; }
}

/* 公告 Markdown 排版 */
.markdown-body { color: inherit; }
.markdown-body > :first-child { margin-top: 0 !important; }
.markdown-body > :last-child { margin-bottom: 0 !important; }
.markdown-body p { margin: 0 0 12px; }
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  margin: 20px 0 9px;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 950;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.markdown-body h1 { font-size: 24px; }
.markdown-body h2 { font-size: 21px; }
.markdown-body h3 { font-size: 18px; }
.markdown-body h4 { font-size: 15px; }
.markdown-body h5,
.markdown-body h6 { font-size: 13px; }
.markdown-body strong { font-weight: 950; }
.markdown-body em { color: var(--violet); }
.markdown-body del { opacity: .62; }
.markdown-body a {
  color: #0769b2;
  font-weight: 900;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.markdown-body a:hover { color: var(--coral); }
.markdown-body ul,
.markdown-body ol { margin: 10px 0 14px; padding-left: 24px; }
.markdown-body li { margin: 6px 0; padding-left: 3px; }
.markdown-body li::marker { color: var(--coral); font-weight: 900; }
.markdown-body .markdown-task { display: flex; align-items: flex-start; gap: 7px; padding-left: 0; list-style: none; }
.markdown-body .markdown-task input { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 4px; accent-color: var(--mint); }
.markdown-body blockquote {
  margin: 13px 0;
  padding: 10px 13px;
  border-left: 5px solid var(--violet);
  border-radius: 0 10px 10px 0;
  background: rgba(140,99,255,.09);
  color: var(--muted);
}
.markdown-body blockquote blockquote { margin-left: 8px; }
.markdown-body code {
  padding: 2px 6px;
  border: 1.5px solid rgba(32,30,45,.28);
  border-radius: 6px;
  background: rgba(32,30,45,.08);
  color: #c43258;
  font: 800 .9em/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  overflow-wrap: anywhere;
}
.markdown-body pre {
  max-width: 100%;
  margin: 13px 0;
  padding: 13px 14px;
  overflow: auto;
  border: 2px solid var(--ink);
  border-radius: 10px 14px 9px 12px;
  background: #262333;
  color: #fff8e8;
  box-shadow: 3px 3px 0 rgba(32,30,45,.28);
}
.markdown-body pre code { padding: 0; border: 0; background: transparent; color: inherit; white-space: pre; overflow-wrap: normal; }
.markdown-body hr { height: 0; margin: 18px 0; border: 0; border-top: 2px dashed rgba(32,30,45,.4); }
.markdown-body img {
  display: block;
  max-width: 100%;
  max-height: 360px;
  margin: 13px auto;
  border: 2px solid var(--ink);
  border-radius: 10px 15px 9px 13px;
  object-fit: contain;
  box-shadow: 3px 4px 0 var(--ink);
}
.markdown-table-wrap { max-width: 100%; margin: 13px 0; overflow-x: auto; border: 2px solid var(--ink); border-radius: 10px; }
.markdown-body table { width: 100%; min-width: 420px; background: var(--white); }
.markdown-body th,
.markdown-body td { padding: 8px 10px; font-size: 10px; }
.markdown-body th { background: var(--yellow); }

@media (max-width: 600px) {
  .markdown-body h1 { font-size: 21px; }
  .markdown-body h2 { font-size: 19px; }
  .markdown-body h3 { font-size: 16px; }
  .markdown-body table { min-width: 340px; }
}
