﻿:root {
  color-scheme: light;
  --bg: oklch(0.975 0.006 185);
  --surface: oklch(0.995 0.002 185);
  --surface-soft: oklch(0.955 0.012 178);
  --ink: oklch(0.205 0.022 230);
  --muted: oklch(0.43 0.018 220);
  --line: oklch(0.89 0.012 195);
  --primary: oklch(0.43 0.105 174);
  --primary-ink: oklch(0.23 0.07 174);
  --primary-soft: oklch(0.94 0.035 168);
  --accent: oklch(0.62 0.18 36);
  --accent-strong: oklch(0.56 0.19 33);
  --danger: oklch(0.52 0.17 27);
  --shadow: 0 18px 42px rgba(30, 47, 57, .10);
  --shadow-soft: 0 10px 24px rgba(30, 47, 57, .07);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 14% -8%, oklch(0.91 0.045 175 / .9), transparent 34%),
    radial-gradient(circle at 106% 8%, oklch(0.91 0.045 35 / .58), transparent 32%),
    var(--bg);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 18px 14px calc(96px + env(safe-area-inset-bottom));
}

.login-screen {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px 14px;
  opacity: 0;
  transition: opacity .18s ease;
}

.login-screen.show {
  opacity: 1;
}

.login-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(42, 18, 22, .38);
  backdrop-filter: blur(8px);
}

.login-panel {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  width: min(100%, 420px);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in oklch, var(--surface) 94%, white);
  box-shadow: var(--shadow);
}

.login-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(166, 27, 41, .14);
  border-radius: 50%;
  color: #8c1724;
  background: rgba(255, 250, 247, .92);
  font-size: 22px;
  line-height: 1;
}

.login-panel h1 {
  max-width: 12ch;
}

.admin-login-body {
  background:
    radial-gradient(circle at 20% 12%, rgba(247, 236, 231, .95), transparent 32%),
    radial-gradient(circle at 86% 18%, rgba(166, 27, 41, .16), transparent 30%),
    linear-gradient(135deg, #f7ece7 0%, #fffaf7 52%, #f4e4df 100%);
}

.admin-login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.admin-login-card {
  display: grid;
  gap: 18px;
  width: min(100%, 430px);
  padding: 30px;
  border: 1px solid rgba(166, 27, 41, .18);
  border-radius: 18px;
  background: rgba(255, 250, 247, .9);
  box-shadow: 0 28px 72px rgba(82, 24, 26, .15);
  backdrop-filter: blur(18px);
}

.admin-login-card h1 {
  margin: 4px 0 0;
  font-size: 30px;
  line-height: 1.15;
}

.admin-login-form {
  display: grid;
  gap: 14px;
}

.admin-login-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.admin-login-form input {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(166, 27, 41, .2);
  border-radius: 12px;
  color: var(--ink);
  background: white;
  outline: none;
}

.admin-login-status {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.primary-btn {
  min-height: 50px;
  border: 0;
  border-radius: 14px;
  color: white;
  background: linear-gradient(135deg, #a61b29, #cf6a72);
  box-shadow: 0 16px 30px rgba(166, 27, 41, .22);
  font-weight: 950;
}

.primary-btn:disabled {
  opacity: .72;
  cursor: not-allowed;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 950;
}

.brand-lockup span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 10px 22px color-mix(in oklch, var(--primary) 22%, transparent);
}

.brand-lockup.compact {
  margin-bottom: 6px;
}

.brand-lockup.compact span {
  width: 28px;
  height: 28px;
  font-size: 13px;
}

.admin-logout-btn {
  width: 100%;
  min-height: 42px;
  margin-top: 12px;
  border: 1px solid rgba(166, 27, 41, .2);
  border-radius: 12px;
  color: #8f1426;
  background: rgba(255, 250, 247, .82);
  font-weight: 950;
}

.auth-mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in oklch, var(--primary-soft) 44%, white);
}

.auth-mode-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-weight: 950;
}

.auth-mode-tabs button.active {
  color: white;
  background: var(--primary);
  box-shadow: var(--shadow-soft);
}

.login-panel label,
.code-row label,
.api-config-grid label,
.password-box label,
.template-editor label,
.settings-row label,
.custom-credit-label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.login-panel input,
.api-config-grid input,
.password-box input,
.template-editor input,
.user-grid input,
.user-grid select,
.custom-credit-label input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: white;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.login-panel input,
.api-config-grid input,
.password-box input,
.template-editor input,
.user-grid input,
.user-grid select,
.custom-credit-label input,
select {
  min-height: 46px;
  padding: 0 12px;
}

textarea {
  min-height: 148px;
  resize: vertical;
  padding: 12px;
  line-height: 1.55;
}

input:focus,
select:focus,
textarea:focus {
  border-color: color-mix(in oklch, var(--primary) 70%, white);
  box-shadow: 0 0 0 4px color-mix(in oklch, var(--primary-soft) 64%, transparent);
}

.code-row {
  display: grid;
  grid-template-columns: 1fr 116px;
  gap: 10px;
  align-items: end;
}

.tab-page {
  display: none;
}

.tab-page.active {
  display: block;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 2px 16px;
}

.compact-topbar {
  align-items: center;
  padding-bottom: 14px;
}

.home-top-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  min-width: 0;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid color-mix(in oklch, var(--primary) 26%, var(--line));
  border-radius: 8px;
  color: var(--primary-ink);
  background: var(--primary-soft);
}

.icon-btn.active {
  color: white;
  background: var(--primary);
}

.search-icon {
  position: relative;
  display: block;
  width: 18px;
  height: 18px;
}

.search-icon::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 1px;
  width: 11px;
  height: 11px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.search-icon::after {
  content: "";
  position: absolute;
  right: 1px;
  bottom: 2px;
  width: 8px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(45deg);
  transform-origin: center;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
  text-wrap: balance;
}

h1 {
  color: var(--ink);
  font-size: 29px;
  line-height: 1.1;
}

h2 {
  font-size: 17px;
}

.status-pill,
.small-link,
.admin-badge {
  flex: 0 0 auto;
  border: 1px solid color-mix(in oklch, var(--primary) 26%, var(--line));
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--primary-ink);
  background: var(--primary-soft);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.home-search {
  display: grid;
  width: min(180px, calc(100vw - 210px));
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.home-search input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: color-mix(in oklch, var(--surface) 96%, white);
  outline: none;
  box-shadow: var(--shadow-soft);
}

.home-search[hidden] {
  display: none !important;
}

.home-top-actions:has(.home-search:not([hidden])) .status-pill {
  display: none;
}

.home-empty-state {
  margin-top: 12px;
  padding: 18px;
  text-align: center;
}

.home-workflow-more {
  display: block;
  width: min(220px, 72%);
  min-height: 44px;
  margin: 16px auto 0;
  border: 1px solid color-mix(in oklch, var(--primary) 28%, var(--line));
  border-radius: 8px;
  color: var(--primary-ink);
  background: color-mix(in oklch, var(--surface) 94%, var(--primary-soft));
  font: inherit;
  font-weight: 900;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}

.home-workflow-more[hidden] {
  display: none;
}

.home-workflow-more:active {
  transform: translateY(1px);
}

.home-carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 88%;
  gap: 10px;
  overflow-x: auto;
  margin: 0 0 12px;
  padding-bottom: 2px;
  scroll-snap-type: x mandatory;
}

.carousel-slide {
  position: relative;
  min-height: 132px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: var(--shadow-soft);
  scroll-snap-align: start;
}

.carousel-slide img,
.carousel-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.carousel-slide img {
  object-fit: cover;
}

.carousel-fallback {
  display: grid;
  place-items: center;
  color: rgba(255,255,255,.32);
  font-size: 56px;
  font-weight: 950;
}

.carousel-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(12, 26, 30, .72), rgba(12, 26, 30, .12));
}

.carousel-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  max-width: 82%;
  padding: 18px;
  color: white;
}

.carousel-copy strong {
  font-size: 20px;
  line-height: 1.2;
}

.carousel-copy span {
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255,255,255,.86);
}

.home-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 120px));
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
}

.home-mode-grid button {
  display: grid;
  place-items: center;
  min-height: 48px;
  border: 1px solid color-mix(in oklch, var(--primary) 24%, var(--line));
  border-radius: 8px;
  background: color-mix(in oklch, var(--primary-soft) 54%, white);
  color: var(--ink);
  font-weight: 800;
}

.home-mode-grid button.active {
  color: white;
  background: var(--primary);
  box-shadow: 0 8px 18px color-mix(in oklch, var(--primary) 24%, transparent);
}

.home-media-filter {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 104px));
  justify-content: center;
  gap: 4px;
  width: max-content;
  max-width: 100%;
  margin: -2px auto 14px;
  padding: 4px;
  border: 1px solid color-mix(in oklch, var(--primary) 16%, var(--line));
  border-radius: 8px;
  background: color-mix(in oklch, var(--surface) 92%, var(--primary-soft));
}

.home-media-filter button {
  min-height: 36px;
  padding: 0 18px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 850;
}

.home-media-filter button.active {
  color: var(--primary-ink);
  background: white;
  box-shadow: 0 3px 10px rgba(84, 30, 34, .08);
}

.quick-workflow-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.quick-workflow-card {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  aspect-ratio: 1;
  border: 1px solid color-mix(in oklch, var(--primary) 24%, var(--line));
  border-radius: 8px;
  background: color-mix(in oklch, var(--surface) 96%, white);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
  text-align: center;
}

.quick-workflow-card span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: var(--primary-ink);
  background: var(--primary-soft);
  font-size: 12px;
  font-weight: 950;
}

.quick-workflow-card strong {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.2;
}

.quick-workflow-card small {
  display: -webkit-box;
  max-width: 92%;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.image-group-card {
  position: relative;
  display: grid;
  align-content: end;
  gap: 8px;
  min-height: 132px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid rgba(166, 27, 41, .16);
  border-radius: 18px;
  background:
    radial-gradient(circle at 92% 22%, rgba(166, 27, 41, .16), transparent 35%),
    linear-gradient(145deg, rgba(255, 255, 255, .96), rgba(249, 231, 226, .82));
  color: #3b0d14;
  box-shadow: 0 14px 32px rgba(94, 18, 26, .08);
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.image-group-card::after {
  content: "";
  position: absolute;
  right: -32px;
  bottom: -42px;
  width: 118px;
  height: 118px;
  border: 18px solid rgba(166, 27, 41, .07);
  border-radius: 50%;
}

.image-group-card span,
.image-group-card strong,
.image-group-card small {
  position: relative;
  z-index: 1;
}

.image-group-card span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(166, 27, 41, .12);
  border-radius: 12px;
  color: #a61b29;
  background: rgba(255, 255, 255, .72);
  font-size: 12px;
  font-weight: 950;
}

.image-group-card strong {
  color: #3b0d14;
  font-size: 17px;
  line-height: 1.2;
}

.image-group-card small {
  color: rgba(59, 13, 20, .68);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
}

.image-group-card:active {
  transform: translateY(1px) scale(.99);
}

.image-group-card:hover,
.image-group-card:focus-visible {
  border-color: rgba(166, 27, 41, .32);
  box-shadow: 0 18px 42px rgba(94, 18, 26, .12);
}

.more-group-card {
  position: relative;
  display: grid;
  align-content: end;
  gap: 7px;
  min-height: 118px;
  padding: 14px;
  overflow: hidden;
  border: 1px solid rgba(166, 27, 41, .17);
  border-radius: 18px;
  background:
    radial-gradient(circle at 88% 18%, rgba(166, 27, 41, .12), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(250, 238, 235, .86));
  color: #3b0d14;
  box-shadow: 0 12px 30px rgba(94, 18, 26, .07);
  cursor: pointer;
}

.more-group-card::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -42px;
  width: 108px;
  height: 108px;
  border: 16px solid rgba(166, 27, 41, .06);
  border-radius: 50%;
}

.more-group-card span,
.more-group-card strong,
.more-group-card small {
  position: relative;
  z-index: 1;
}

.more-group-card span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  color: #a61b29;
  background: rgba(255, 255, 255, .72);
  font-size: 12px;
  font-weight: 950;
}

.more-group-card strong {
  color: #3b0d14;
  font-size: 16px;
  line-height: 1.18;
}

.more-group-card small {
  color: rgba(59, 13, 20, .68);
  font-size: 12px;
  font-weight: 820;
  line-height: 1.35;
}

.more-group-card:active {
  transform: translateY(1px) scale(.99);
}

.image-group-header {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(166, 27, 41, .12);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .94), rgba(250, 236, 232, .72));
  box-shadow: 0 12px 28px rgba(94, 18, 26, .06);
}

.image-group-header button {
  min-height: 38px;
  border: 1px solid rgba(166, 27, 41, .18);
  border-radius: 999px;
  padding: 0 13px;
  color: #a61b29;
  background: rgba(255, 255, 255, .78);
  font-size: 13px;
  font-weight: 900;
}

.image-group-header div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.image-group-header strong {
  color: #3b0d14;
  font-size: 18px;
}

.image-group-header small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
}

.category-item,
.tool-card,
.panel,
.result-panel,
.profile-card,
.profile-actions,
.credit-card,
.history-card,
.empty-state,
.template-editor,
.login-panel {
  border-radius: 8px;
}

.category-item,
.tool-card {
  position: relative;
  display: grid;
  place-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  background: color-mix(in oklch, var(--surface) 94%, white);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
  text-align: center;
  font-weight: 900;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.category-item:focus-visible {
  outline: 3px solid color-mix(in oklch, var(--primary) 45%, white);
  outline-offset: 2px;
}

.favorite-btn {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid color-mix(in oklch, var(--accent) 24%, var(--line));
  border-radius: 50%;
  color: var(--accent-strong);
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow-soft);
  font-size: 16px;
  line-height: 1;
}

.favorite-btn.active {
  color: white;
  background: var(--accent-strong);
}

.detail-favorite-btn {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-top: 24px;
  border: 1px solid color-mix(in oklch, var(--accent) 28%, var(--line));
  border-radius: 50%;
  color: var(--accent-strong);
  background: rgba(255,255,255,.9);
  box-shadow: var(--shadow-soft);
  font-size: 22px;
  line-height: 1;
}

.detail-favorite-btn.active {
  color: white;
  background: var(--accent-strong);
}

.category-item {
  display: grid;
  aspect-ratio: 3 / 4;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) auto;
  align-content: stretch;
  gap: 10px;
  padding: 10px;
  overflow: hidden;
}

.category-item.has-media,
.category-item.has-video {
  aspect-ratio: 3 / 4;
  grid-template-rows: 1fr;
  gap: 0;
  padding: 0;
}

.category-thumb {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  min-height: 0;
  overflow: hidden;
  border-radius: 16px;
  background: rgba(255, 255, 255, .62);
}

.category-item.has-media .category-thumb,
.category-item.has-video .category-thumb {
  grid-row: 1;
  height: 100%;
  aspect-ratio: auto;
  border-radius: inherit;
}

.category-item.has-media .category-thumb::after,
.category-item.has-video .category-thumb::after {
  content: "";
  position: absolute;
  inset: 46% 0 0;
  z-index: 1;
  background: linear-gradient(to bottom, rgba(23, 17, 19, 0), rgba(23, 17, 19, .72));
  pointer-events: none;
}

.category-item.has-video {
  align-content: stretch;
  border-color: color-mix(in oklch, var(--primary) 32%, var(--line));
  background: var(--surface);
  color: var(--ink);
}

.category-item:active,
.tool-card:active,
.recharge-option:active {
  transform: translateY(1px) scale(.99);
}

.category-item:hover,
.tool-card:hover {
  border-color: color-mix(in oklch, var(--primary) 45%, var(--line));
  box-shadow: var(--shadow);
}

.category-icon,
.tool-icon,
.action-icon {
  display: grid;
  place-items: center;
  color: var(--primary-ink);
  background: var(--primary-soft);
  font-weight: 900;
}

.category-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  font-size: 15px;
}

.category-video,
.category-image {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  object-fit: cover;
  background: oklch(0.18 0.018 220);
  pointer-events: none;
}

.animated-preview-frame {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
  background: linear-gradient(150deg, #fff8f5, #f3dedb);
}

.video-preview-poster,
.video-preview-animation {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-preview-poster {
  z-index: 0;
}

.video-preview-animation {
  z-index: 1;
  opacity: 0;
  transition: opacity .18s ease;
}

.video-preview-animation.is-ready {
  opacity: 1;
}

.category-item.has-media::after,
.category-item.has-video::after {
  display: none;
}

.category-item strong {
  position: relative;
  z-index: 2;
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 17px;
  line-height: 1.25;
}

.category-item.has-media strong,
.category-item.has-video strong {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 16px 10px 14px;
  color: white;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .42);
}

.tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.asset-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: oklch(0.93 0.01 205);
  margin-bottom: 12px;
}

.asset-tab {
  min-height: 40px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.asset-tab.active {
  color: white;
  background: var(--primary);
  box-shadow: 0 8px 18px color-mix(in oklch, var(--primary) 26%, transparent);
}

.asset-panel {
  display: none;
  gap: 10px;
}

.asset-panel.active {
  display: grid;
}

.storage-warning-banner {
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid rgba(180, 118, 0, .24);
  border-radius: 8px;
  background: rgba(255, 247, 221, .94);
  color: #76510b;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
}

.asset-workflow-card,
.upload-history-card {
  position: relative;
  display: grid;
  gap: 6px;
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow-soft);
  color: var(--ink);
  text-align: left;
}

.asset-workflow-card {
  padding: 14px 48px 14px 14px;
}

.asset-workflow-card strong,
.upload-history-card strong {
  font-size: 15px;
}

.asset-workflow-card span,
.upload-history-card span,
.upload-history-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.upload-history-card {
  grid-template-columns: 64px 1fr;
  align-items: center;
  padding: 8px;
}

.upload-history-card img {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--primary-soft);
}

.upload-history-card .upload-history-file-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 20px;
  font-weight: 900;
}

.generated-asset-card {
  display: grid;
  grid-template-columns: 78px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow-soft);
}

.generated-asset-card img,
.generated-asset-card video {
  width: 78px;
  height: 78px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--primary-soft);
}

.generated-asset-card div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.generated-asset-card strong {
  font-size: 15px;
}

.generated-asset-card span,
.generated-asset-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.generated-asset-card a {
  display: grid;
  place-items: center;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--primary-ink);
  background: var(--primary-soft);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.asset-placeholder {
  display: grid;
  width: 78px;
  height: 78px;
  place-items: center;
  border-radius: 8px;
  color: var(--rose-700);
  font-size: 12px;
  font-weight: 900;
  background: linear-gradient(145deg, rgba(255, 246, 244, .94), rgba(166, 27, 41, .12));
}

.asset-status-running {
  border-color: rgba(166, 27, 41, .34);
}

.asset-status-failed {
  border-color: rgba(166, 27, 41, .46);
  background: rgba(255, 246, 244, .92);
}

.material-quota-card {
  margin: 12px 0;
  padding: 14px;
  border: 1px solid color-mix(in oklch, var(--primary) 20%, var(--line));
  border-radius: 16px;
  background: color-mix(in oklch, var(--surface) 92%, var(--primary-soft));
  box-shadow: var(--shadow-soft);
}

.material-quota-card > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.material-quota-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.material-quota-card p.warning {
  color: #9a5a00;
}

.material-quota-track {
  height: 8px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(166, 27, 41, .1);
}

.material-quota-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width .2s ease;
}

.material-library-panel {
  display: none;
  gap: 14px;
}

.material-library-panel.active {
  display: grid;
}

.material-create-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  box-shadow: var(--shadow-soft);
}

.material-create-card > div:first-child {
  display: grid;
  gap: 3px;
}

.material-create-card small,
.material-create-card label,
.material-trash-note span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.material-create-card label {
  display: grid;
  gap: 6px;
}

.material-create-card input,
.material-create-card textarea,
.material-create-card select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.material-create-card textarea {
  resize: vertical;
}

.material-create-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.material-create-actions > button {
  flex: 1 1 0;
  min-height: 44px;
}

.material-file-field input {
  padding: 8px;
}

.material-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.material-library-card {
  display: grid;
  align-content: start;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  box-shadow: var(--shadow-soft);
}

.material-library-card > img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--primary-soft);
}

.material-library-card-copy {
  display: grid;
  gap: 5px;
  padding: 12px;
}

.material-library-card-copy strong,
.material-library-card-copy span,
.material-library-card-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.material-library-card-copy span,
.material-library-card-copy small {
  color: var(--muted);
  font-size: 11px;
}

.material-library-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 12px 12px;
}

.material-library-actions button,
.material-library-actions a {
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid rgba(166, 27, 41, .2);
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-ink);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

.material-library-actions .danger {
  color: #9b1c2b;
  background: #fff4f4;
}

.material-trash-note {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: 14px;
  background: #fff7e8;
}

.workflow-material-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.workflow-material-actions .secondary-btn {
  flex: 1 1 180px;
  min-height: 44px;
}

.workflow-material-selections,
#clothingSuiteBackgroundSelection {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.workflow-material-selection {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid color-mix(in oklch, var(--primary) 18%, var(--line));
  border-radius: 14px;
  background: color-mix(in oklch, var(--surface) 94%, var(--primary-soft));
}

.workflow-material-selection img {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--primary-soft);
}

.workflow-material-selection span {
  display: grid;
  min-width: 0;
  flex: 1;
}

.workflow-material-selection strong,
.workflow-material-selection small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-material-selection small {
  color: var(--muted);
  font-size: 11px;
}

.workflow-material-selection button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid rgba(166, 27, 41, .2);
  border-radius: 999px;
  color: var(--primary-ink);
  background: var(--primary-soft);
  font-size: 11px;
  font-weight: 850;
}

.suite-background-options {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.suite-background-options > label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.suite-background-options select,
.suite-background-options input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: white;
  font: inherit;
}

.suite-background-policy-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.6;
}

.material-picker-modal[hidden] {
  display: none;
}

.material-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 92;
  display: grid;
  align-items: end;
  justify-items: center;
  padding: 18px 12px calc(88px + env(safe-area-inset-bottom));
}

.material-picker-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(43, 17, 21, .3);
  opacity: 0;
  transition: opacity .18s ease;
}

.material-picker-sheet {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  width: min(100%, 560px);
  max-height: min(78vh, 760px);
  overflow: auto;
  padding: 16px;
  border: 1px solid rgba(166, 27, 41, .16);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .99), rgba(255, 247, 244, .98));
  box-shadow: 0 24px 70px rgba(68, 20, 27, .22);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .18s ease, transform .18s ease;
}

.material-picker-modal.show .material-picker-backdrop,
.material-picker-modal.show .material-picker-sheet {
  opacity: 1;
}

.material-picker-modal.show .material-picker-sheet {
  transform: translateY(0);
}

.material-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.material-picker-head h2 {
  margin: 2px 0 0;
  font-size: 20px;
}

.material-picker-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.6;
}

.material-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.material-picker-grid .empty-state {
  grid-column: 1 / -1;
}

.material-picker-card {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
}

.material-picker-card > img {
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 12px;
  object-fit: cover;
  background: var(--primary-soft);
}

.material-picker-card > strong,
.material-picker-card > small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.material-picker-card > small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.material-picker-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.material-picker-card-actions button {
  flex: 1 1 76px;
  min-height: 44px;
  padding: 0 9px;
  border: 1px solid rgba(166, 27, 41, .2);
  border-radius: 999px;
  color: var(--primary-ink);
  background: var(--primary-soft);
  font-size: 11px;
  font-weight: 850;
}

.material-picker-card-actions button.primary {
  border-color: var(--primary);
  color: white;
  background: var(--primary);
}

@media (min-width: 760px) {
  .material-create-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .material-create-card > div:first-child,
  .material-create-card .generate-btn,
  .material-create-card [data-material-form-status] {
    grid-column: 1 / -1;
  }

  .material-create-actions {
    grid-column: 1 / -1;
  }

  .material-card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .material-picker-modal {
    align-items: center;
    padding-bottom: 18px;
  }
}

@media (max-width: 480px) {
  .material-picker-grid {
    grid-template-columns: 1fr;
  }
}

.asset-card-actions {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.asset-favorite-btn,
.asset-retry-btn {
  min-height: 30px;
  border: 1px solid rgba(166, 27, 41, .26);
  border-radius: 999px;
  background: rgba(255, 255, 255, .74);
  color: var(--rose-700);
  font-weight: 900;
}

.asset-favorite-btn {
  width: 34px;
  padding: 0;
}

.asset-favorite-btn.active {
  color: #fff;
  background: var(--rose-700);
}

.asset-retry-btn {
  padding: 0 12px;
}

.workflow-guide {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 10px 0 14px;
}

.workflow-guide span {
  min-height: 34px;
  display: grid;
  place-items: center;
  padding: 6px;
  border: 1px solid rgba(166, 27, 41, .14);
  border-radius: 12px;
  color: var(--rose-700);
  background: rgba(255, 246, 244, .72);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.upload-history-card div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.upload-history-card span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-card {
  min-height: 132px;
}

.tool-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
}

.panel,
.result-panel,
.profile-card,
.profile-actions,
.credit-card,
.history-card,
.empty-state {
  border: 1px solid var(--line);
  background: color-mix(in oklch, var(--surface) 94%, white);
  box-shadow: var(--shadow);
}

.panel,
.result-panel {
  padding: 14px;
}

.workflow-sample-panel {
  display: grid;
  gap: 10px;
  margin: 10px 0 12px;
  padding: 12px;
  border: 1px solid rgba(166, 27, 41, .16);
  border-radius: 18px;
  background: rgba(255, 250, 247, .88);
  box-shadow: 0 16px 36px rgba(82, 24, 26, .08);
}

.workflow-sample-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.workflow-sample-head h2 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.25;
}

.workflow-sample-head span {
  flex: 0 0 auto;
  color: #8f1426;
  font-size: 12px;
  font-weight: 950;
}

.workflow-sample-panel video,
.workflow-sample-panel img {
  display: block;
  width: 100%;
  max-height: 62vh;
  aspect-ratio: 9 / 16;
  border-radius: 14px;
  background: rgba(80, 35, 38, .08);
  object-fit: contain;
}

.workflow-sample-panel img {
  height: auto;
  aspect-ratio: auto;
}

.workflow-sample-fallback {
  display: grid;
  min-height: 180px;
  margin: 0;
  place-items: center;
  border-radius: 14px;
  background: rgba(80, 35, 38, .06);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.student-access-gate {
  display: grid;
  gap: 7px;
  margin: 10px 0 12px;
  padding: 15px;
  border: 1px solid rgba(166, 27, 41, .2);
  border-radius: 16px;
  background:
    radial-gradient(circle at 92% 12%, rgba(166, 27, 41, .12), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(247, 236, 231, .88));
  box-shadow: 0 14px 30px rgba(82, 24, 26, .08);
}

.student-access-gate[hidden] {
  display: none;
}

.student-access-gate strong {
  color: var(--primary-ink);
  font-size: 16px;
}

.student-access-gate p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.student-access-gate .secondary-btn {
  width: fit-content;
  min-width: 112px;
  margin-top: 2px;
}

.visitor-preview [data-generation-panel] {
  opacity: .58;
}

.visitor-preview [data-generation-panel] :disabled {
  cursor: not-allowed;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: oklch(0.93 0.01 205);
}

.mode-switch:has(.mode-btn[hidden]) {
  grid-template-columns: 1fr;
}

.mode-btn {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.mode-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 8px 18px color-mix(in oklch, var(--primary) 28%, transparent);
}

.cost-row,
.recharge-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid color-mix(in oklch, var(--primary) 20%, var(--line));
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--muted);
  font-weight: 900;
}

.cost-row {
  margin-top: 10px;
  padding: 10px 12px;
  font-size: 13px;
}

.cost-row strong,
.recharge-head strong,
.credit-card strong {
  color: var(--primary-ink);
}

.cost-row strong {
  font-size: 16px;
}

.step {
  padding-top: 18px;
}

.step-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
}

.step-title span {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  font-size: 13px;
  font-weight: 900;
}

.dual-upload {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.declared-workflow-inputs small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.upload-box {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 142px;
  padding: 20px;
  border: 1.5px dashed color-mix(in oklch, var(--primary) 38%, var(--line));
  border-radius: 8px;
  background: color-mix(in oklch, var(--primary-soft) 52%, white);
  text-align: center;
  transition: border-color .16s ease, background .16s ease;
}

.upload-box.has-preview {
  padding: 0;
  overflow: hidden;
  border-style: solid;
  background: white;
}

.upload-box.has-preview strong,
.upload-box.has-preview small {
  display: none;
}

.upload-box:active {
  background: var(--primary-soft);
}

.upload-box input {
  display: none;
}

.upload-box strong {
  font-size: 17px;
}

.upload-box small {
  color: var(--muted);
  line-height: 1.5;
}

.compact-upload {
  min-height: 132px;
  padding: 14px 10px;
}

.compact-upload strong {
  font-size: 15px;
  line-height: 1.35;
}

.single-preview {
  margin-top: 10px;
}

.upload-box .single-preview {
  width: 100%;
  margin-top: 0;
}

.upload-box .single-preview:empty {
  display: none;
}

.clothing-suite-panel {
  display: grid;
  gap: 22px;
}

.clothing-suite-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 5px;
  padding: 18px;
  border: 1px solid color-mix(in oklch, var(--primary) 18%, var(--line));
  border-radius: 8px;
  background: linear-gradient(135deg, white 0%, color-mix(in oklch, var(--primary-soft) 76%, white) 100%);
}

.clothing-suite-hero::after {
  content: "";
  position: absolute;
  right: -34px;
  bottom: -54px;
  width: 150px;
  aspect-ratio: 1;
  border: 22px solid color-mix(in oklch, var(--primary) 9%, transparent);
  border-radius: 50%;
}

.clothing-suite-hero span,
.clothing-suite-hero p {
  color: var(--muted);
}

.clothing-suite-hero strong {
  position: relative;
  z-index: 1;
  font-size: 22px;
}

.suite-upload-box {
  min-height: 190px;
}

.clothing-suite-output-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.suite-output-card,
.suite-template-card,
.suite-audience-tabs button {
  border: 1px solid var(--line);
  background: white;
  color: var(--text);
}

.suite-output-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 132px;
  padding: 14px 12px;
  border-radius: 8px;
  text-align: left;
}

.suite-output-card.active,
.suite-template-card.active,
.suite-audience-tabs button.active {
  border-color: color-mix(in oklch, var(--primary) 52%, white);
  background: color-mix(in oklch, var(--primary-soft) 58%, white);
  box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--primary) 18%, transparent);
}

.suite-output-card strong {
  padding-right: 24px;
  font-size: 16px;
}

.suite-output-card small,
.suite-template-card small,
.suite-auto-tip {
  color: var(--muted);
  line-height: 1.45;
}

.suite-output-card em {
  margin-top: auto;
  color: var(--primary);
  font-style: normal;
  font-weight: 700;
}

.suite-check {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border: 1px solid color-mix(in oklch, var(--primary) 32%, var(--line));
  border-radius: 50%;
  color: white;
  background: var(--primary);
  font-size: 13px;
}

.suite-output-card:not(.active) .suite-check {
  background: white;
}

.suite-cost-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 8px;
  background: color-mix(in oklch, var(--primary-soft) 52%, white);
}

.suite-model-options[hidden] {
  display: none;
}

.suite-auto-tip {
  margin: -5px 0 12px;
}

.suite-audience-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.suite-audience-tabs button {
  min-height: 42px;
  border-radius: 8px;
  font-weight: 700;
}

.suite-template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.suite-template-card {
  display: grid;
  gap: 4px;
  min-height: 68px;
  padding: 11px 12px;
  border-radius: 8px;
  text-align: left;
}

.suite-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.suite-result-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.suite-result-card figure {
  display: grid;
  place-items: center;
  aspect-ratio: 3 / 4;
  margin: 0;
  background: color-mix(in oklch, var(--primary-soft) 45%, white);
}

.suite-result-card figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.suite-result-card-body {
  display: grid;
  gap: 5px;
  padding: 11px;
}

.suite-result-card-body small {
  color: var(--muted);
}

.suite-result-card-body a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 420px) {
  .clothing-suite-output-grid {
    grid-template-columns: 1fr;
  }

  .suite-output-card {
    min-height: 98px;
  }
}

.preview-item {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: oklch(0.94 0.008 205);
}

.upload-box .preview-item {
  border: 0;
  border-radius: 8px;
}

.preview-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-item[role="button"] {
  cursor: zoom-in;
}

.preview-item[role="button"]:focus-visible {
  outline: 3px solid color-mix(in oklch, var(--primary) 62%, white);
  outline-offset: -3px;
}

.preview-item .preview-remove-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: rgba(19, 27, 32, .72);
  color: white;
  line-height: 1;
}

.preview-item .preview-reselect-btn {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: auto;
  min-width: 76px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 999px;
  background: rgba(19, 27, 32, .78);
  color: white;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.settings-row,
.admin-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding-top: 12px;
}

.setting-row {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 68px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  text-align: left;
}

.settings-panel {
  display: grid;
  gap: 18px;
  padding: 16px;
}

.settings-section {
  display: grid;
  gap: 10px;
}

.settings-section h2 {
  margin: 0 2px;
  color: var(--primary-ink);
  font-size: 14px;
}

.settings-list {
  display: grid;
  border: 1px solid rgba(166, 27, 41, .12);
  border-radius: 18px;
  background: rgba(255, 255, 255, .74);
  overflow: hidden;
  box-shadow: 0 14px 30px rgba(94, 18, 26, .05);
}

.settings-list .setting-row {
  grid-template-columns: 36px minmax(0, 1fr);
  min-height: 72px;
  border: 0;
  border-bottom: 1px solid rgba(166, 27, 41, .1);
  border-radius: 0;
  background: transparent;
}

.settings-list .setting-row:last-child {
  border-bottom: 0;
}

.settings-list button.setting-row::after {
  content: "";
  justify-self: end;
  width: 8px;
  height: 8px;
  border-top: 2px solid rgba(126, 19, 32, .45);
  border-right: 2px solid rgba(126, 19, 32, .45);
  transform: rotate(45deg);
}

.settings-list button.setting-row {
  grid-template-columns: 36px minmax(0, 1fr) 18px;
}

.setting-row strong {
  display: block;
  font-size: 15px;
}

.setting-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.settings-account-icon,
.settings-member-icon,
.settings-token-icon,
.settings-create-icon,
.settings-asset-icon,
.settings-notice-icon,
.settings-help-icon,
.settings-status-icon,
.settings-about-icon {
  border-radius: 13px;
  background:
    radial-gradient(circle at 32% 22%, rgba(255, 255, 255, .78), transparent 32%),
    linear-gradient(145deg, rgba(166, 27, 41, .14), rgba(247, 236, 231, .95));
}

.settings-member-icon,
.settings-token-icon {
  background:
    radial-gradient(circle at 32% 22%, rgba(255, 255, 255, .72), transparent 32%),
    linear-gradient(145deg, #a61b29, #d79492);
}

.settings-status-icon {
  background:
    radial-gradient(circle at 32% 22%, rgba(255, 255, 255, .74), transparent 32%),
    linear-gradient(145deg, #7e1320, #a61b29);
}

.generate-btn,
.download-btn {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 52px;
  margin-top: 16px;
  border: 0;
  border-radius: 8px;
  color: white;
  background: var(--accent-strong);
  box-shadow: 0 12px 22px color-mix(in oklch, var(--accent) 28%, transparent);
  font-weight: 900;
  text-decoration: none;
}

.generate-btn:disabled {
  opacity: .62;
}

.secondary-btn,
.danger-btn,
.back-btn {
  min-height: 42px;
  border-radius: 8px;
  font-weight: 900;
}

.secondary-btn {
  border: 1px solid color-mix(in oklch, var(--primary) 58%, var(--line));
  color: var(--primary-ink);
  background: var(--primary-soft);
}

.danger-btn {
  border: 1px solid color-mix(in oklch, var(--danger) 26%, var(--line));
  color: var(--danger);
  background: oklch(0.96 0.025 30);
  padding: 0 12px;
}

.back-btn {
  flex: 0 0 auto;
  border: 0;
  padding: 0 12px;
  color: white;
  background: var(--primary);
}

.wide-btn {
  width: 100%;
}

.admin-shell {
  width: min(100%, 760px);
}

.pc-admin-shell {
  width: min(100%, 1280px);
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 18px;
  padding: 24px;
}

.pc-admin-shell.admin-pc-layout {
  width: min(100%, 1680px);
  grid-template-columns: 268px minmax(0, 1fr);
  gap: 22px;
  padding: 26px;
}

.admin-sidebar {
  position: sticky;
  top: 24px;
  align-self: start;
  display: grid;
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in oklch, var(--surface) 96%, white);
  box-shadow: var(--shadow);
}

.admin-pc-layout .admin-sidebar {
  min-height: calc(100vh - 52px);
  padding: 18px;
  border-color: rgba(166, 27, 41, .14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(247, 236, 231, .72)),
    var(--surface);
}

.admin-nav {
  display: grid;
  gap: 8px;
}

.admin-nav a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 900;
}

.admin-nav a:hover {
  background: var(--primary-soft);
  color: var(--primary-ink);
}

.admin-nav a.active,
.admin-nav a[aria-current="page"] {
  color: #fff7f3;
  background: linear-gradient(135deg, #a61b29, #7e1320);
  box-shadow: 0 12px 24px rgba(166, 27, 41, .18);
}

.admin-pc-layout .admin-nav a {
  min-height: 46px;
  border: 1px solid transparent;
}

.admin-pc-layout .admin-nav a:hover {
  border-color: rgba(166, 27, 41, .16);
  background: rgba(166, 27, 41, .08);
}

.admin-main {
  min-width: 0;
}

.admin-panel {
  padding: 14px;
}

.admin-pc-layout .admin-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 18px;
}

.admin-hero h1 {
  font-size: 32px;
}

.layout-toggle-btn {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(166, 27, 41, .2);
  border-radius: 999px;
  color: var(--primary-ink);
  background: rgba(255, 255, 255, .86);
  box-shadow: var(--shadow-soft);
  font-weight: 900;
  cursor: pointer;
}

.layout-toggle-btn[aria-pressed="true"] {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.admin-pc-layout .admin-metrics {
  margin-bottom: 0;
}

.admin-metrics div {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in oklch, var(--surface) 94%, white);
  box-shadow: var(--shadow-soft);
}

.admin-metrics span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.admin-metrics strong {
  color: var(--primary-ink);
  font-size: 22px;
  line-height: 1;
}

.admin-block {
  display: none;
  gap: 12px;
  padding: 18px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in oklch, var(--surface) 96%, white);
  box-shadow: var(--shadow-soft);
}

.admin-block.active {
  display: grid;
  animation: admin-section-in .18s ease-out;
}

.admin-pc-layout .admin-block {
  margin-bottom: 0;
  padding: 20px;
  border-color: rgba(166, 27, 41, .12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(255, 250, 248, .9)),
    var(--surface);
}

.admin-pc-layout .api-config-grid,
.admin-pc-layout .category-detail-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-pc-layout .api-config-grid label:first-child,
.admin-pc-layout .api-config-grid label:nth-child(2),
.admin-pc-layout .api-config-grid label:last-child {
  grid-column: span 1;
}

.admin-pc-layout .category-editor-list {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.admin-pc-layout .detail-category-list,
.admin-pc-layout .template-editor-list {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.admin-pc-layout .usage-compass-board {
  grid-template-columns: 300px minmax(0, 1fr);
}

.admin-pc-layout .usage-radar-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.admin-save-dock {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid rgba(166, 27, 41, .15);
  border-radius: 14px;
  background: rgba(255, 250, 247, .94);
  box-shadow: 0 18px 42px rgba(83, 24, 31, .12);
  backdrop-filter: blur(16px);
}

.admin-save-dock span {
  color: #725a5e;
  font-size: 12px;
  font-weight: 900;
}

.admin-save-dock strong {
  display: block;
  margin-top: 2px;
  color: #171113;
  font-size: 18px;
}

.admin-save-dock p {
  margin: 4px 0 0;
  color: #725a5e;
  font-size: 12px;
  font-weight: 800;
}

.admin-save-dock p.error-text {
  color: var(--danger);
}

.admin-save-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.admin-save-actions .secondary-btn {
  min-height: 38px;
  padding: 0 12px;
}

@keyframes admin-section-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.category-editor-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.detail-category-list {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.category-editor-list .template-editor {
  padding: 10px;
}

.category-admin-toolbar {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in oklch, var(--primary-soft) 34%, white);
}

.category-filter-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.category-filter-btn {
  min-height: 40px;
  border: 1px solid color-mix(in oklch, var(--primary) 34%, var(--line));
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.category-filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: var(--shadow-soft);
}

.compact-search-row {
  grid-template-columns: minmax(0, 1fr) 88px;
}

.category-workflow-editor {
  gap: 10px;
  min-height: 132px;
  padding: 12px;
  border-color: color-mix(in oklch, var(--primary) 24%, var(--line));
}

.category-workflow-editor.expanded {
  grid-column: 1 / -1;
  min-height: 0;
  padding: 16px;
}

.category-editor-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.category-editor-title > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.category-editor-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-editor-title small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-workflow-editor.expanded .category-editor-title {
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
}

.category-order {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.category-badge {
  align-self: start;
  justify-self: start;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-ink);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.category-editor-body {
  display: none;
  gap: 12px;
}

.category-workflow-editor.expanded .category-editor-body {
  display: grid;
}

.category-edit-toggle,
.category-workflow-editor .danger-btn {
  min-height: 34px;
  padding: 0 10px;
}

.workflow-editor-section {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in oklch, var(--surface) 94%, white);
}

.workflow-editor-section h3 {
  margin: 0;
  color: var(--primary-ink);
  font-size: 15px;
}

.video-admin-upload input {
  width: 100%;
}

.admin-video-preview {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.home-admin-section {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

.home-admin-section h2 {
  font-size: 16px;
}

#home .template-editor {
  gap: 8px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .74);
}

#home .template-editor .editor-head {
  margin: 0;
}

#home .template-editor .editor-head strong {
  font-size: 14px;
}

#home .category-detail-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

#home .category-detail-grid label {
  font-size: 12px;
}

#home .category-detail-grid input,
#home .category-detail-grid select {
  min-height: 38px;
  border-radius: 10px;
}

#home .category-detail-grid textarea {
  min-height: 74px;
}

#home .admin-image-preview {
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
}

#home .admin-image-preview img {
  width: 96px;
  height: 58px;
  max-height: none;
  border-radius: 12px;
}

#home .admin-image-preview .danger-btn {
  min-height: 34px;
  justify-self: start;
}

.banner-editor-list,
.notice-editor-list,
.quick-editor-list {
  display: grid;
  gap: 8px;
}

.admin-image-preview {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.admin-image-preview img {
  width: 100%;
  max-height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: oklch(0.94 0.008 205);
  object-fit: cover;
}

.admin-video-preview video {
  width: 100%;
  max-height: 160px;
  border-radius: 8px;
  background: oklch(0.94 0.008 205);
  object-fit: contain;
}

.admin-save {
  margin-top: 0;
}

.admin-tip {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.admin-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 10px;
  align-items: center;
}

.admin-search-row input,
.inline-save-row input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: white;
  outline: none;
}

.category-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.category-detail-grid .full {
  grid-column: 1 / -1;
}

.profile-edit-panel {
  margin-top: 12px;
}

.profile-name-editor {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.inline-save-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 10px;
}

.api-config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.api-config-grid label:first-child,
.api-config-grid label:nth-child(2),
.api-config-grid label:last-child {
  grid-column: 1 / -1;
}

.api-config-grid small {
  color: var(--muted);
  line-height: 1.35;
}

.usage-compass-board {
  display: grid;
  grid-template-columns: minmax(240px, 340px) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.usage-compass,
.usage-radar-card,
.compass-providers article {
  border: 1px solid rgba(166, 27, 41, .14);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .92), rgba(247, 236, 231, .72));
  box-shadow: 0 18px 45px rgba(93, 22, 31, .08);
}

.usage-compass {
  display: grid;
  place-items: center;
  min-height: 320px;
  padding: 18px;
  overflow: hidden;
}

.compass-ring {
  position: relative;
  width: min(100%, 278px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(255,255,255,.98) 0 29%, transparent 30%),
    conic-gradient(from -135deg, #8e1f1f 0deg 58deg, #b8753c 58deg 126deg, #a61b29 126deg 184deg, #6f2331 184deg 270deg, #8e1f1f 270deg 360deg);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.72),
    inset 0 0 0 16px rgba(255,255,255,.58),
    0 18px 38px rgba(82, 19, 28, .18);
}

.compass-ring::before,
.compass-ring::after {
  content: "";
  position: absolute;
  inset: 28px;
  border-radius: 50%;
  border: 1px solid rgba(166, 27, 41, .18);
}

.compass-ring::after {
  inset: 54px;
  border-style: dashed;
  opacity: .7;
}

.compass-axis {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #fff;
  background: rgba(83, 18, 28, .9);
  box-shadow: 0 8px 20px rgba(83, 18, 28, .18);
  font-size: 12px;
  font-weight: 900;
}

.compass-axis.north { top: 13px; left: 50%; transform: translateX(-50%); }
.compass-axis.east { right: 13px; top: 50%; transform: translateY(-50%); }
.compass-axis.south { bottom: 13px; left: 50%; transform: translateX(-50%); }
.compass-axis.west { left: 13px; top: 50%; transform: translateY(-50%); }

.compass-needle {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 50%;
  width: 8px;
  height: 92px;
  border-radius: 999px 999px 4px 4px;
  background: linear-gradient(180deg, #a61b29, #53121c);
  box-shadow: 0 10px 18px rgba(83, 18, 28, .24);
  transform: translateX(-50%) rotate(-118deg);
  transform-origin: 50% 100%;
  transition: transform .38s cubic-bezier(.22, 1, .36, 1);
}

.compass-needle::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -11px;
  width: 22px;
  height: 22px;
  border: 5px solid #fff;
  border-radius: 50%;
  background: #a61b29;
  transform: translateX(-50%);
}

.compass-center {
  position: absolute;
  z-index: 5;
  inset: 50%;
  display: grid;
  place-items: center;
  width: 118px;
  height: 118px;
  border: 1px solid rgba(166, 27, 41, .18);
  border-radius: 50%;
  color: var(--primary-ink);
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 16px 28px rgba(83, 18, 28, .12);
  transform: translate(-50%, -50%);
  text-align: center;
}

.compass-center span,
.compass-center small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.compass-center strong {
  color: var(--primary-ink);
  font-size: 30px;
  line-height: .9;
}

.usage-radar-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.usage-radar-card {
  display: grid;
  gap: 8px;
  min-height: 148px;
  padding: 16px;
  align-content: end;
}

.usage-radar-card.primary {
  background: linear-gradient(145deg, rgba(166, 27, 41, .13), rgba(255, 255, 255, .9));
}

.usage-radar-card.danger {
  background: linear-gradient(145deg, rgba(142, 31, 31, .12), rgba(255, 255, 255, .9));
}

.usage-radar-card span,
.compass-providers span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.usage-radar-card strong,
.compass-providers strong {
  color: var(--primary-ink);
  font-size: 28px;
  line-height: 1;
}

.usage-radar-card small {
  color: rgba(83, 18, 28, .68);
  font-size: 12px;
  font-weight: 800;
}

.analytics-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.analytics-overview-grid article,
.analytics-panel {
  border: 1px solid rgba(166, 27, 41, .14);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .9), rgba(255, 246, 242, .78));
  box-shadow: 0 14px 30px rgba(83, 18, 28, .06);
}

.analytics-overview-grid article {
  display: grid;
  gap: 8px;
  min-height: 118px;
  padding: 16px;
}

.analytics-overview-grid span,
.analytics-panel-head span,
.analytics-behavior-grid span {
  color: rgba(83, 18, 28, .68);
  font-size: 12px;
  font-weight: 900;
}

.analytics-overview-grid strong {
  color: #7f1022;
  font-size: 32px;
  line-height: 1;
}

.analytics-overview-grid small {
  color: rgba(83, 18, 28, .62);
  font-weight: 800;
}

.analytics-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  gap: 12px;
  margin-bottom: 14px;
}

.analytics-panel {
  min-height: 260px;
  padding: 16px;
}

.analytics-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.analytics-panel-head strong {
  color: var(--primary-ink);
  font-size: 17px;
}

.analytics-bars {
  display: grid;
  grid-template-columns: repeat(30, minmax(8px, 1fr));
  gap: 5px;
  align-items: end;
  height: 180px;
  padding-top: 10px;
}

.analytics-bar-item {
  display: grid;
  gap: 6px;
  align-items: end;
  min-width: 0;
  height: 100%;
}

.analytics-bar-item > span {
  position: relative;
  display: block;
  min-height: 8px;
  border-radius: 999px 999px 4px 4px;
  background: linear-gradient(180deg, rgba(166, 27, 41, .72), rgba(166, 27, 41, .18));
  overflow: hidden;
}

.analytics-bar-item > span i {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: block;
  background: #a61b29;
}

.analytics-bar-item small {
  color: rgba(83, 18, 28, .54);
  font-size: 10px;
  font-weight: 800;
  writing-mode: vertical-rl;
  justify-self: center;
}

.analytics-funnel,
.analytics-rank-list,
.analytics-behavior-grid {
  display: grid;
  gap: 10px;
}

.analytics-funnel article,
.analytics-rank-list article,
.analytics-behavior-grid article {
  border: 1px solid rgba(166, 27, 41, .1);
  border-radius: 12px;
  background: rgba(255, 255, 255, .76);
}

.analytics-funnel article {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.analytics-funnel article div,
.analytics-rank-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.analytics-funnel strong,
.analytics-rank-list strong {
  color: var(--ink);
}

.analytics-funnel span,
.analytics-rank-list span {
  color: #7f1022;
  font-weight: 950;
}

.analytics-funnel em,
.analytics-rank-list em {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: rgba(166, 27, 41, .08);
  overflow: hidden;
}

.analytics-funnel em i,
.analytics-rank-list em i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #a61b29, #e8a1a5);
}

.analytics-funnel small {
  color: rgba(83, 18, 28, .58);
  font-size: 12px;
  font-weight: 800;
}

.analytics-rank-list article {
  grid-template-columns: 28px minmax(0, 1fr) auto;
  padding: 10px;
}

.analytics-rank-list b {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #a61b29;
  background: rgba(166, 27, 41, .08);
  font-size: 12px;
}

.analytics-rank-list article div {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.analytics-rank-list strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-behavior-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.analytics-behavior-grid article {
  display: grid;
  gap: 6px;
  min-height: 82px;
  padding: 12px;
}

.analytics-behavior-grid strong {
  color: #7f1022;
  font-size: 24px;
  line-height: 1;
}

.analytics-behavior-grid small {
  color: rgba(83, 18, 28, .58);
  font-weight: 800;
}

.compass-providers {
  margin-top: 12px;
}

.usage-history-tools {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(360px, 520px);
  gap: 14px;
  align-items: end;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(166, 27, 41, .12);
  border-radius: 14px;
  background: rgba(255, 255, 255, .72);
}

.usage-history-tools strong {
  color: var(--primary-ink);
  font-size: 16px;
}

.usage-history-query {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
}

.usage-history-query input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(166, 27, 41, .2);
  border-radius: 10px;
  background: rgba(255, 255, 255, .96);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  outline: none;
}

.usage-history-query input:focus {
  border-color: rgba(166, 27, 41, .56);
  box-shadow: 0 0 0 3px rgba(166, 27, 41, .1);
}

.usage-history-summary {
  margin-top: 10px;
  color: rgba(83, 18, 28, .74);
  font-size: 13px;
  font-weight: 800;
}

.usage-table {
  overflow-x: auto;
  margin-top: 12px;
  border: 1px solid rgba(166, 27, 41, .12);
  border-radius: 14px;
  background: rgba(255, 255, 255, .78);
}

.usage-table table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 13px;
}

.usage-table th,
.usage-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(166, 27, 41, .08);
  text-align: left;
  white-space: nowrap;
}

.usage-table th {
  color: var(--muted);
  font-size: 12px;
}

.usage-status {
  display: inline-grid;
  padding: 4px 8px;
  border-radius: 999px;
  color: #fff;
  background: #a61b29;
  font-size: 12px;
  font-weight: 900;
}

.usage-status.failed {
  background: #8e1f1f;
}

.usage-status.submitted {
  color: var(--primary);
  background: color-mix(in oklch, var(--primary-soft) 72%, white);
  border: 1px solid color-mix(in oklch, var(--primary) 28%, var(--line));
}

.usage-status.mock {
  color: var(--primary);
  background: rgba(166, 27, 41, .1);
}

.usage-pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.storage-admin-status {
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, .72);
  font-size: 13px;
  font-weight: 800;
}

.storage-admin-status.success-text {
  color: #176b57;
  border-color: rgba(23, 107, 87, .2);
  background: rgba(224, 245, 238, .7);
}

.storage-admin-status.error-text {
  color: #9b2531;
  border-color: rgba(155, 37, 49, .2);
  background: rgba(255, 236, 238, .72);
}

.storage-admin-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.storage-admin-overview article {
  display: grid;
  gap: 7px;
  min-height: 116px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .84);
  box-shadow: 0 10px 28px rgba(36, 61, 55, .05);
}

.storage-admin-overview article span,
.storage-admin-overview article small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.storage-admin-overview article strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1.15;
}

.storage-admin-alert {
  grid-column: 1 / -1;
  padding: 12px 14px;
  border: 1px solid rgba(155, 37, 49, .22);
  border-radius: 12px;
  color: #9b2531;
  background: rgba(255, 236, 238, .78);
  font-size: 13px;
  font-weight: 900;
}

.storage-admin-cleanup {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 14px 0 24px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(247, 250, 248, .88);
}

.storage-admin-cleanup > div,
.storage-cleanup-counts {
  display: flex;
  align-items: center;
  gap: 10px;
}

.storage-admin-cleanup strong,
.storage-admin-cleanup small {
  display: block;
}

.storage-admin-cleanup small,
.storage-cleanup-counts {
  color: var(--muted);
  font-size: 12px;
}

.storage-cleanup-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #c8892e;
  box-shadow: 0 0 0 4px rgba(200, 137, 46, .12);
}

.storage-cleanup-dot.ok {
  background: #23856d;
  box-shadow: 0 0 0 4px rgba(35, 133, 109, .12);
}

.storage-admin-table-head {
  margin-bottom: 10px;
}

.storage-admin-user-table {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .84);
}

.storage-admin-user-table table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 13px;
}

.storage-admin-user-table th,
.storage-admin-user-table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.storage-admin-user-table th {
  color: var(--muted);
  font-size: 12px;
}

.storage-admin-user-table td strong,
.storage-admin-user-table td small {
  display: block;
}

.storage-admin-user-table td small {
  margin-top: 3px;
  color: var(--muted);
}

.storage-admin-user-table td em {
  display: block;
  width: 130px;
  height: 6px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(36, 61, 55, .09);
}

.storage-admin-user-table td em i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.storage-admin-user-table td:last-child {
  display: flex;
  align-items: center;
  gap: 8px;
}

.storage-admin-user-table td label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.storage-admin-user-table input {
  width: 92px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

@media (max-width: 900px) {
  .storage-admin-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .storage-admin-overview {
    grid-template-columns: 1fr;
  }

  .storage-admin-cleanup,
  .storage-cleanup-counts {
    align-items: flex-start;
    flex-direction: column;
  }
}

.usage-pagination[hidden] {
  display: none;
}

@media (max-width: 1180px) {
  .analytics-overview-grid,
  .usage-radar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-main-grid,
  .usage-history-tools {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .analytics-overview-grid,
  .analytics-behavior-grid,
  .usage-radar-grid {
    grid-template-columns: 1fr;
  }

  .analytics-bars {
    gap: 3px;
  }

  .usage-history-query {
    grid-template-columns: 1fr;
  }
}

.usage-pagination button:disabled {
  cursor: not-allowed;
  opacity: .45;
}
.password-box {
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.error-text {
  color: var(--danger);
}

.template-editor-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.template-editor {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  background: white;
}

.user-editor-list {
  display: grid;
  gap: 12px;
}

.user-editor {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow-soft);
}

.user-token-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 6px;
  padding: 5px 10px;
  border: 1px solid color-mix(in oklch, var(--primary) 28%, var(--line));
  border-radius: 999px;
  background: color-mix(in oklch, var(--primary-soft) 68%, white);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.user-editor-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.save-user-btn {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

.user-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.user-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.user-grid input,
.user-grid select {
  min-height: 42px;
}

.user-course-fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in oklch, var(--primary-soft) 28%, white);
}

.user-course-fieldset legend {
  padding: 0 6px;
  color: var(--primary-ink);
  font-size: 13px;
  font-weight: 900;
}

.user-course-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid color-mix(in oklch, var(--primary) 16%, var(--line));
  border-radius: 9px;
  background: white;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.user-course-option input {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
}

.editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.result-panel {
  margin-top: 14px;
}

.profile-page {
  display: none;
  padding-top: 2px;
}

.profile-page.active {
  display: grid;
  gap: 12px;
}

.profile-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: white;
  background: var(--primary);
  font-weight: 900;
  flex: 0 0 auto;
}

.profile-card-main {
  display: grid;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.profile-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.profile-card-head h2 {
  margin: 0;
  font-size: 19px;
}

.profile-identity {
  min-width: 0;
}

.profile-name-line {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.profile-name-line h2 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.profile-edit-icon {
  position: relative;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(166, 27, 41, .16);
  border-radius: 50%;
  background: rgba(247, 236, 231, .74);
  cursor: pointer;
}

.profile-edit-icon::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 8px;
  width: 9px;
  height: 3px;
  border-radius: 999px;
  background: var(--primary);
  transform: rotate(-38deg);
}

.profile-edit-icon::after {
  content: "";
  position: absolute;
  left: 17px;
  top: 14px;
  width: 4px;
  height: 4px;
  border-right: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
  transform: rotate(52deg);
}

.profile-level-chip {
  position: relative;
  display: inline-grid;
  grid-template-columns: 32px minmax(0, auto);
  align-items: center;
  gap: 8px;
  max-width: 142px;
  min-height: 40px;
  border: 1px solid rgba(166, 27, 41, .2);
  border-radius: 999px;
  padding: 4px 12px 4px 5px;
  color: var(--primary-ink);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .82), rgba(247, 236, 231, .82)),
    rgba(247, 236, 231, .9);
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(94, 18, 26, .08), inset 0 1px 0 rgba(255, 255, 255, .7);
  overflow: hidden;
}

.profile-level-chip::after {
  content: "";
  position: absolute;
  right: -18px;
  bottom: -24px;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(166, 27, 41, .12);
  border-radius: 50%;
}

.profile-level-chip span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 50%;
  color: #fff;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, .3), transparent 34%),
    linear-gradient(145deg, #7e1421, #a61b29 62%, #d79492);
  font-size: 11px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 6px 12px rgba(166, 27, 41, .2);
}

.profile-level-chip strong {
  position: relative;
  z-index: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-level-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  border: 1px solid rgba(166, 27, 41, .13);
  border-radius: 12px;
  padding: 9px 11px;
  background:
    linear-gradient(135deg, rgba(166, 27, 41, .08), rgba(247, 236, 231, .7));
}

.profile-level-summary span {
  color: var(--primary-ink);
  font-size: 13px;
  font-weight: 900;
}

.profile-level-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.profile-name-sheet {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(166, 27, 41, .16);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 255, 255, .84);
  box-shadow: 0 22px 48px rgba(94, 18, 26, .13);
}

.profile-name-sheet[hidden] {
  display: none;
}

.name-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.name-sheet-head h2 {
  margin: 3px 0 0;
  font-size: 20px;
}

.sheet-close-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(166, 27, 41, .14);
  border-radius: 50%;
  background: rgba(247, 236, 231, .7);
}

.sheet-close-btn::before,
.sheet-close-btn::after {
  content: "";
  position: absolute;
  left: 11px;
  top: 17px;
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: var(--primary);
}

.sheet-close-btn::before {
  transform: rotate(45deg);
}

.sheet-close-btn::after {
  transform: rotate(-45deg);
}

.profile-name-editor {
  display: grid;
  gap: 8px;
}

.profile-name-editor span {
  color: var(--primary-ink);
  font-size: 13px;
  font-weight: 900;
}

.profile-name-editor input {
  width: 100%;
  min-height: 48px;
}

.name-sheet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.name-sheet-actions .secondary-btn {
  width: 100%;
}

.primary-save-btn {
  color: white;
  background: var(--primary);
  border-color: var(--primary);
}

.credit-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
}

.credit-card strong {
  display: block;
  font-size: 28px;
  line-height: 1;
}

.credit-card .secondary-btn {
  flex: 0 0 auto;
  min-width: 96px;
  padding: 0 12px;
}

.training-credit-note {
  max-width: 120px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
  text-align: right;
}

.student-enrollment-card {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in oklch, var(--surface) 96%, white);
  box-shadow: var(--shadow-soft);
}

.student-enrollment-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.student-enrollment-row:last-child {
  border-bottom: 0;
}

.student-enrollment-row span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.student-enrollment-row strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
  text-align: right;
}

.recharge-head {
  padding: 12px;
}

.recharge-head strong {
  font-size: 22px;
}

.recharge-page {
  display: grid;
  gap: 14px;
  padding-bottom: 92px;
}

.recharge-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.course-pack-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 0;
}

.recharge-option {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 86px;
  border: 1px solid color-mix(in oklch, var(--primary) 26%, var(--line));
  border-radius: 8px;
  background: white;
  color: var(--primary-ink);
}

.recharge-option strong {
  font-size: 23px;
}

.recharge-option span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.course-pack {
  position: relative;
  justify-items: start;
  min-height: 112px;
  padding: 12px 10px;
  overflow: hidden;
  border-radius: 16px;
  background:
    radial-gradient(circle at 90% 0%, rgba(166, 27, 41, .1), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, .92), rgba(247, 236, 231, .74));
  color: #8c1725;
  box-shadow: 0 14px 32px rgba(94, 18, 26, .07);
  text-align: left;
}

.course-pack::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -38px;
  width: 106px;
  height: 106px;
  border: 1px solid rgba(166, 27, 41, .08);
  border-radius: 50%;
}

.course-pack.featured {
  border-color: rgba(166, 27, 41, .34);
  background:
    radial-gradient(circle at 86% 10%, rgba(255, 255, 255, .22), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, .94), rgba(247, 236, 231, .78));
  color: #8c1725;
  box-shadow: 0 14px 32px rgba(94, 18, 26, .07);
}

.course-pack small {
  position: relative;
  z-index: 1;
  width: fit-content;
  padding: 4px 7px;
  border-radius: 999px;
  color: #8c1725;
  background: rgba(166, 27, 41, .1);
  font-size: 11px;
  font-weight: 900;
}

.course-pack.featured small {
  color: #8c1725;
  background: rgba(166, 27, 41, .1);
}

.course-pack strong {
  position: relative;
  z-index: 1;
  margin-top: 2px;
  color: #8c1725;
  font-size: 24px;
  line-height: 1;
}

.course-pack span {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  color: #a61b29;
  font-size: 15px;
  font-weight: 950;
  line-height: 1.15;
}

.course-pack.featured strong,
.course-pack.featured span {
  color: #8c1725;
}

.course-pack em {
  position: relative;
  z-index: 1;
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.45;
}

.course-pack.featured em {
  color: var(--muted);
}

.custom-credit-label {
  margin-top: 14px;
}

.course-pack.selected,
.member-recharge-option.selected {
  outline: 3px solid rgba(166, 27, 41, .20);
  border-color: rgba(166, 27, 41, .50);
  background:
    radial-gradient(circle at 86% 10%, rgba(255, 255, 255, .20), transparent 30%),
    linear-gradient(135deg, #7e1421, #a61b29 62%, #d79492);
  color: #fff7f3;
  box-shadow: 0 20px 42px rgba(94, 18, 26, .20);
}

.course-pack.selected small,
.member-recharge-option.selected small {
  color: #a61b29;
  background: rgba(255, 255, 255, .92);
}

.course-pack.selected strong,
.course-pack.selected span,
.course-pack.selected em,
.member-recharge-option.selected strong,
.member-recharge-option.selected span,
.member-recharge-option.selected em {
  color: #fff7f3;
}

.payment-proof-panel {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(166, 27, 41, .14);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 250, 247, .96), rgba(247, 236, 231, .72));
}

.recharge-balance-hero {
  display: grid;
  gap: 6px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid rgba(166, 27, 41, .16);
  border-radius: 22px;
  background:
    radial-gradient(circle at 88% 20%, rgba(166, 27, 41, .18), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, .94), rgba(249, 229, 223, .86));
  box-shadow: 0 18px 44px rgba(94, 18, 26, .08);
}

.recharge-balance-hero span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.recharge-balance-hero strong {
  color: var(--primary-ink);
  font-size: 38px;
  line-height: 1;
}

.recharge-balance-hero small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.recharge-balance-breakdown {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.recharge-balance-breakdown div {
  display: grid;
  gap: 7px;
  min-height: 76px;
  padding: 13px 10px;
  border: 1px solid rgba(166, 27, 41, .14);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .94), rgba(250, 239, 234, .72));
  box-shadow: 0 10px 24px rgba(94, 18, 26, .05);
}

.recharge-balance-breakdown span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.recharge-balance-breakdown strong {
  color: var(--primary-ink);
  font-size: 20px;
  line-height: 1;
}

.recharge-section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
}

.recharge-section-title strong {
  color: var(--ink);
  font-size: 17px;
}

.recharge-section-title span,
.recharge-validity-tip {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.recharge-validity-tip {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(166, 27, 41, .12);
  border-radius: 14px;
  background: rgba(255, 255, 255, .58);
}

.recharge-sheet {
  display: grid;
  gap: 14px;
  border-color: rgba(166, 27, 41, .12);
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0%, rgba(166, 27, 41, .08), transparent 26%),
    linear-gradient(180deg, rgba(255, 252, 249, .96), rgba(250, 238, 233, .8));
}

.recharge-sheet-head {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: flex-start;
  gap: 12px;
}

.recharge-sheet-head .workflow-heading h1 {
  margin: 0;
  font-size: 28px;
}

.payment-proof-panel p,
.payment-proof-panel small {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.payment-qr-card {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.payment-qr-frame {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 128px;
  overflow: hidden;
  border: 1px solid rgba(166, 27, 41, .18);
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(166, 27, 41, .08) 1px, transparent 1px),
    linear-gradient(rgba(166, 27, 41, .08) 1px, transparent 1px),
    #fffaf7;
  background-size: 16px 16px;
}

.payment-qr-frame img {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: white;
}

.payment-qr-frame img.is-missing {
  display: none;
}

.payment-qr-fallback {
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 12px;
  text-align: center;
  color: #8c1725;
}

.payment-qr-fallback strong,
.payment-qr-fallback span {
  display: block;
}

.payment-qr-fallback span {
  font-size: 12px;
  font-weight: 800;
  color: rgba(94, 18, 26, .62);
}

.payment-receive-box {
  padding: 12px;
  border: 1px dashed rgba(166, 27, 41, .28);
  border-radius: 16px;
  background: rgba(255, 255, 255, .72);
}

.payment-receive-box label,
.payment-receive-box input,
.payment-receive-box small {
  display: block;
}

.payment-receive-box label {
  color: #171113;
  font-weight: 950;
}

.payment-receive-box input {
  width: 100%;
  margin-top: 8px;
  padding: 11px 12px;
  border: 1px solid rgba(166, 27, 41, .18);
  border-radius: 12px;
  color: #7e1421;
  background: rgba(255, 250, 247, .96);
  font-weight: 850;
}

.payment-proof-upload {
  display: grid;
  place-items: center;
  min-height: 74px;
  border: 1px dashed rgba(166, 27, 41, .34);
  border-radius: 16px;
  color: #a61b29;
  background: rgba(255, 255, 255, .72);
  font-weight: 900;
}

.payment-proof-upload input {
  display: none;
}

.payment-proof-preview img {
  display: block;
  width: 100%;
  max-height: 240px;
  object-fit: contain;
  border: 1px solid rgba(166, 27, 41, .14);
  border-radius: 16px;
  background: white;
}

@media (max-width: 420px) {
  .payment-qr-card {
    grid-template-columns: 1fr;
  }

  .payment-qr-frame {
    min-height: 168px;
  }
}

.recharge-order-list {
  display: grid;
  gap: 12px;
}

.recharge-order-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(166, 27, 41, .14);
  border-radius: 16px;
  background: rgba(255, 255, 255, .78);
}

.recharge-order-card.approved {
  border-color: rgba(19, 121, 83, .22);
}

.recharge-order-card.rejected {
  opacity: .72;
}

.recharge-order-card strong,
.recharge-order-card span,
.recharge-order-card small {
  display: block;
}

.recharge-order-card span {
  margin-top: 5px;
  color: var(--primary-ink);
  font-weight: 900;
}

.recharge-order-card small,
.recharge-order-card p {
  margin: 5px 0 0;
  color: var(--muted);
}

.payment-proof-link img,
.payment-proof-empty {
  width: 120px;
  height: 84px;
  border: 1px solid rgba(166, 27, 41, .14);
  border-radius: 12px;
  object-fit: cover;
  background: #fff7f3;
}

.payment-proof-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.recharge-order-actions {
  display: grid;
  gap: 8px;
  min-width: 128px;
}

.home-ui-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 14px;
}

.home-ui-workbench {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.home-ui-preview-panel {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 12px;
}

.preview-phone {
  display: grid;
  gap: 12px;
  width: 100%;
  min-height: 680px;
  max-height: calc(100vh - 92px);
  overflow: auto;
  padding: 16px;
  border: 1px solid rgba(166, 27, 41, .18);
  border-radius: 28px;
  background:
    radial-gradient(circle at 92% 0%, rgba(166, 27, 41, .14), transparent 28%),
    linear-gradient(180deg, #fffaf7, #f8ebe7);
  box-shadow: 0 24px 70px rgba(91, 18, 28, .16);
}

.preview-phone-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.preview-phone-head strong,
.preview-phone-head span {
  display: block;
}

.preview-phone-head strong {
  color: #171113;
  font-size: 18px;
}

.preview-phone-head span,
.preview-phone-head em {
  color: #8f1426;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.preview-phone-head em {
  padding: 6px 10px;
  border: 1px solid rgba(166, 27, 41, .18);
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
}

.preview-carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 86%;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.preview-banner {
  position: relative;
  display: grid;
  align-content: end;
  min-height: 120px;
  overflow: hidden;
  padding: 16px;
  border: 1px solid rgba(166, 27, 41, .12);
  border-radius: 18px;
  background:
    radial-gradient(circle at 88% 22%, rgba(166, 27, 41, .22), transparent 31%),
    linear-gradient(135deg, #fff, #f3deda);
}

.preview-banner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-banner.has-image::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 56%;
  background: linear-gradient(180deg, transparent, rgba(42, 12, 17, .5));
}

.preview-banner > span {
  position: absolute;
  top: 12px;
  left: 12px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  color: #a61b29;
  background: white;
  font-weight: 950;
}

.preview-banner div {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 4px;
}

.preview-banner strong,
.preview-banner small {
  color: #7e1421;
}

.preview-banner.has-image strong,
.preview-banner.has-image small {
  color: white;
}

.preview-quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.preview-quick-grid article,
.preview-group,
.preview-workflow {
  border: 1px solid rgba(166, 27, 41, .14);
  border-radius: 16px;
  background: rgba(255, 255, 255, .68);
}

.preview-quick-grid article {
  display: grid;
  place-items: center;
  gap: 5px;
  min-height: 94px;
  padding: 10px 8px;
  text-align: center;
}

.preview-quick-grid span,
.preview-group span,
.preview-workflow span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  color: #a61b29;
  background: rgba(166, 27, 41, .08);
  font-size: 12px;
  font-weight: 950;
}

.preview-quick-grid strong,
.preview-group strong,
.preview-workflow strong {
  color: #171113;
  font-size: 13px;
}

.preview-quick-grid small,
.preview-group small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.preview-mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 16px;
  background: rgba(166, 27, 41, .08);
}

.preview-mode-tabs button {
  min-height: 42px;
  border: 0;
  border-radius: 13px;
  color: #321015;
  background: transparent;
  font-weight: 950;
}

.preview-mode-tabs button.active {
  color: white;
  background: #a61b29;
}

.preview-category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.preview-group {
  display: grid;
  gap: 6px;
  min-height: 132px;
  padding: 14px;
}

.preview-workflow {
  display: grid;
  gap: 8px;
  padding: 8px;
}

.preview-workflow div {
  display: grid;
  place-items: center;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 14px;
  background: #fff7f3;
}

.preview-workflow img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-empty,
.preview-back-group {
  grid-column: 1 / -1;
}

.preview-empty {
  padding: 20px;
  border: 1px dashed rgba(166, 27, 41, .22);
  border-radius: 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, .64);
  text-align: center;
}

.preview-back-group {
  min-height: 36px;
  border: 1px solid rgba(166, 27, 41, .18);
  border-radius: 12px;
  color: #8f1426;
  background: white;
  font-weight: 950;
}

.home-ui-control-stack {
  display: grid;
  gap: 14px;
}

.home-ui-panel {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid rgba(166, 27, 41, .14);
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0%, rgba(166, 27, 41, .07), transparent 30%),
    rgba(255, 255, 255, .72);
}

.compact-head {
  align-items: center;
  margin-bottom: 0;
}

.home-ui-list {
  display: grid;
  gap: 10px;
}

.home-ui-row,
.home-ui-card,
.home-workflow-chip {
  border: 1px solid rgba(166, 27, 41, .12);
  border-radius: 14px;
  background: rgba(255, 250, 247, .82);
  box-shadow: 0 10px 24px rgba(94, 18, 26, .05);
}

.home-ui-row {
  display: grid;
  grid-template-columns: 56px 1fr 72px 86px;
  gap: 8px;
  align-items: end;
  padding: 9px;
}

.home-ui-id {
  display: grid;
  place-items: center;
  min-height: 42px;
  border-radius: 12px;
  color: #8f1426;
  background: rgba(166, 27, 41, .08);
  font-weight: 950;
}

.home-ui-card {
  padding: 10px;
}

.home-ui-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.home-ui-mini-grid .full {
  grid-column: 1 / -1;
}

.home-ui-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.home-ui-panel input,
.home-ui-panel textarea,
.home-ui-panel select {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(166, 27, 41, .16);
  border-radius: 10px;
  padding: 0 10px;
  color: #321015;
  background: white;
  outline: none;
}

.home-ui-panel textarea {
  min-height: 66px;
  padding: 10px;
  resize: vertical;
}

.home-workflow-map {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 8px;
}

.home-workflow-chip {
  display: grid;
  gap: 6px;
  padding: 9px;
}

.home-workflow-chip strong {
  color: #171113;
  font-size: 14px;
}

.home-workflow-chip small {
  color: var(--muted);
  font-size: 11px;
  word-break: break-all;
}

@media (max-width: 980px) {
  .home-ui-workbench {
    grid-template-columns: 1fr;
  }

  .home-ui-preview-panel {
    position: static;
  }

  .home-ui-editor-grid {
    grid-template-columns: 1fr;
  }

  .home-ui-row {
    grid-template-columns: 1fr;
  }
}

.profile-actions {
  display: grid;
  overflow: hidden;
}

.profile-actions button,
.profile-actions a {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 0 16px;
  color: var(--ink);
  background: white;
  text-align: left;
  font-weight: 900;
  text-decoration: none;
}

.profile-actions button:last-child,
.profile-actions a:last-child {
  border-bottom: 0;
}

.level-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 112px;
  padding: 18px;
  border: 1px solid rgba(166, 27, 41, .18);
  border-radius: 18px;
  color: #fff;
  background:
    radial-gradient(circle at 84% 20%, rgba(247, 236, 231, .25), transparent 28%),
    linear-gradient(135deg, #5b0d18 0%, #a61b29 55%, #d9a5a7 100%);
  box-shadow: 0 20px 42px rgba(94, 18, 26, .18);
  overflow: hidden;
}

.level-card::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -42px;
  width: 128px;
  height: 128px;
  border: 1px solid rgba(255, 255, 255, .26);
  border-radius: 50%;
}

.level-card h2 {
  position: relative;
  margin: 4px 0 5px;
  font-size: 22px;
}

.level-card p {
  position: relative;
  margin: 0;
}

.level-card .eyebrow {
  color: rgba(255, 255, 255, .78);
}

.level-card > span,
.level-hero > span {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 58px;
  height: 58px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22);
}

.level-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 150px;
  padding: 22px;
  border-radius: 22px;
  color: #fff;
  background:
    radial-gradient(circle at 12% 0%, rgba(247, 236, 231, .22), transparent 31%),
    linear-gradient(140deg, #4e0b15 0%, #a61b29 58%, #f0c7c0 100%);
  box-shadow: 0 24px 48px rgba(94, 18, 26, .2);
  overflow: hidden;
}

.level-hero::after {
  content: "";
  position: absolute;
  right: -54px;
  bottom: -76px;
  width: 190px;
  height: 190px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 50%;
}

.level-hero h2 {
  position: relative;
  margin: 6px 0;
  font-size: 30px;
}

.level-hero p {
  position: relative;
  margin: 0;
  color: rgba(255, 255, 255, .82);
}

.level-hero .eyebrow {
  color: rgba(255, 255, 255, .7);
}

.level-progress-panel {
  margin-top: 14px;
}

.level-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 900;
}

.level-progress-track {
  height: 10px;
  margin: 14px 0 10px;
  border-radius: 999px;
  background: rgba(166, 27, 41, .1);
  overflow: hidden;
}

.level-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #a61b29, #e2a8a4);
  transition: width .28s ease;
}

.member-plan-section {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.recharge-member-section {
  padding-top: 14px;
  border-top: 1px solid rgba(166, 27, 41, .12);
}

.point-ledger-panel {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(166, 27, 41, .12);
}

.point-ledger-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.point-ledger-list article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(166, 27, 41, .14);
  border-radius: 14px;
  background: rgba(255, 255, 255, .7);
}

.point-ledger-list article div {
  display: grid;
  gap: 2px;
}

.point-ledger-list strong {
  color: var(--ink);
  font-size: 13px;
}

.point-ledger-list small {
  color: var(--muted);
  font-weight: 800;
}

.point-ledger-list span {
  color: var(--rose-700);
  font-weight: 900;
  white-space: nowrap;
}

.point-ledger-list span.minus {
  color: var(--ink-soft);
}

.member-plan-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
}

.member-plan-head strong {
  color: var(--ink);
  font-size: 18px;
}

.member-plan-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.member-plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.member-plan-card {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 148px;
  padding: 15px;
  overflow: hidden;
  border: 1px solid rgba(166, 27, 41, .15);
  border-radius: 20px;
  background:
    radial-gradient(circle at 92% 12%, rgba(166, 27, 41, .12), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, .95), rgba(249, 232, 227, .78));
  box-shadow: 0 14px 34px rgba(94, 18, 26, .08);
  appearance: none;
  font: inherit;
  text-align: left;
}

.member-recharge-option {
  cursor: pointer;
}

.member-plan-card::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -42px;
  width: 112px;
  height: 112px;
  border: 18px solid rgba(166, 27, 41, .06);
  border-radius: 50%;
}

.member-plan-card small,
.member-plan-card strong,
.member-plan-card span,
.member-plan-card em {
  position: relative;
  z-index: 1;
}

.member-plan-card small {
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  color: #a61b29;
  background: rgba(166, 27, 41, .1);
  font-size: 12px;
  font-weight: 950;
}

.member-plan-card strong {
  color: #7e1421;
  font-size: 28px;
  line-height: 1;
}

.member-plan-card span {
  color: #a61b29;
  font-size: 15px;
  font-weight: 950;
}

.member-plan-card em {
  color: rgba(59, 13, 20, .66);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
  line-height: 1.45;
}

.member-plan-card.supreme {
  border-color: rgba(166, 27, 41, .3);
  background:
    radial-gradient(circle at 88% 14%, rgba(255, 255, 255, .24), transparent 32%),
    linear-gradient(135deg, #5b0d18, #a61b29 58%, #d79492);
}

.member-plan-card.supreme small {
  color: #a61b29;
  background: rgba(255, 255, 255, .9);
}

.member-plan-card.supreme strong,
.member-plan-card.supreme span,
.member-plan-card.supreme em {
  color: #fff;
}

.level-benefits {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.level-benefits article {
  min-height: 92px;
  padding: 14px 10px;
  border: 1px solid rgba(166, 27, 41, .15);
  border-radius: 16px;
  background: rgba(255, 255, 255, .74);
  box-shadow: 0 14px 28px rgba(94, 18, 26, .06);
}

.level-benefits span {
  display: block;
  width: 22px;
  height: 22px;
  margin-bottom: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a61b29, #f1c3bd);
}

.level-benefits strong {
  display: block;
  font-size: 13px;
  line-height: 1.35;
}

.level-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.level-list-item {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 12px;
  border: 1px solid rgba(166, 27, 41, .12);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .88), rgba(247, 236, 231, .58)),
    rgba(255, 255, 255, .72);
  box-shadow: 0 12px 26px rgba(94, 18, 26, .05);
  overflow: hidden;
}

.level-list-item.active {
  border-color: rgba(166, 27, 41, .32);
  background:
    radial-gradient(circle at 88% 18%, rgba(166, 27, 41, .12), transparent 26%),
    linear-gradient(135deg, rgba(166, 27, 41, .1), rgba(247, 236, 231, .92));
  box-shadow: 0 16px 34px rgba(94, 18, 26, .1);
}

.level-list-item > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #fff;
  background: #a61b29;
  font-size: 13px;
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 8px 16px rgba(166, 27, 41, .16);
}

.level-list-item strong,
.level-list-item small,
.level-list-item em {
  display: block;
}

.level-list-item strong {
  font-size: 15px;
}

.level-list-item small {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
}

.level-list-item em {
  width: fit-content;
  margin-top: 8px;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--primary);
  background: rgba(166, 27, 41, .08);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.level-list-item b {
  align-self: start;
  padding: 5px 8px;
  border: 1px solid rgba(166, 27, 41, .16);
  border-radius: 999px;
  color: var(--primary);
  background: rgba(255, 255, 255, .76);
  font-size: 11px;
  white-space: nowrap;
}

.level-list-item.active b {
  color: #fff;
  background: #a61b29;
}

.action-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .86), rgba(247, 236, 231, .72));
  box-shadow: inset 0 0 0 1px rgba(166, 27, 41, .12);
}

.settings-action-icon::before {
  content: "";
  width: 17px;
  height: 17px;
  border: 2px solid var(--primary);
  border-radius: 50%;
  box-shadow: 0 -8px 0 -6px var(--primary), 0 8px 0 -6px var(--primary), 8px 0 0 -6px var(--primary), -8px 0 0 -6px var(--primary);
}

.settings-action-icon::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
}

.logout-action-icon::before {
  content: "";
  width: 15px;
  height: 14px;
  border: 2px solid var(--primary);
  border-right: 0;
  border-radius: 4px 0 0 4px;
}

.logout-action-icon::after {
  content: "";
  position: absolute;
  right: 8px;
  width: 13px;
  height: 2px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 4px -4px 0 -1px var(--primary), 4px 4px 0 -1px var(--primary);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  width: min(100%, 520px);
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: color-mix(in oklch, var(--surface) 90%, transparent);
  box-shadow: 0 -10px 28px rgba(30, 47, 57, .08);
  backdrop-filter: blur(16px);
  transform: translateX(-50%);
}

.bottom-nav-item {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 56px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 900;
}

.bottom-nav-item.active {
  color: var(--primary-ink);
  background: var(--primary-soft);
}

.nav-icon {
  position: relative;
  display: block;
  width: 22px;
  height: 22px;
}

.home-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 8px;
  width: 14px;
  height: 10px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 2px;
}

.home-icon::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 3px;
  width: 12px;
  height: 12px;
  border-left: 2px solid currentColor;
  border-top: 2px solid currentColor;
  transform: rotate(45deg);
}

.profile-icon::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 3px;
  width: 8px;
  height: 8px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.profile-icon::after {
  content: "";
  position: absolute;
  left: 4px;
  bottom: 3px;
  width: 14px;
  height: 8px;
  border: 2px solid currentColor;
  border-radius: 10px 10px 3px 3px;
}

.history-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 3px;
  width: 14px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.history-icon::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 8px;
  width: 8px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor;
}

.community-icon::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 4px;
  width: 16px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 7px;
}

.community-icon::after {
  content: "";
  position: absolute;
  left: 8px;
  bottom: 3px;
  width: 7px;
  height: 7px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-28deg);
}

.community-page {
  position: relative;
  padding-bottom: 138px;
}

.community-stream-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 12px;
}

.community-stream-head strong {
  color: var(--primary-ink);
  font-size: 18px;
}

.community-stream-head span {
  color: var(--muted);
  font-size: 13px;
}

.community-fab {
  position: fixed;
  left: 50%;
  bottom: calc(86px + env(safe-area-inset-bottom));
  z-index: 21;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  color: white;
  background: linear-gradient(145deg, #a61b29, #7e1320);
  box-shadow: 0 18px 34px rgba(126, 19, 32, .28);
  font-size: 34px;
  font-weight: 500;
  line-height: 1;
  transform: translateX(-50%);
}

.community-fab:active {
  transform: translateX(-50%) scale(.96);
}

.community-compose-sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  align-items: end;
  padding: 18px 14px calc(16px + env(safe-area-inset-bottom));
}

.community-compose-sheet[hidden] {
  display: none;
}

.community-compose-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(34, 20, 22, .34);
  backdrop-filter: blur(6px);
}

.community-compose {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  width: min(100%, 520px);
  margin: 0 auto;
  border-radius: 24px 24px 18px 18px;
  box-shadow: 0 24px 58px rgba(65, 20, 26, .22);
}

.community-compose-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.community-compose-head strong {
  display: block;
  color: var(--primary-ink);
  font-size: 18px;
}

.community-compose-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.community-compose-head .icon-btn {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(166, 27, 41, .16);
  border-radius: 50%;
  color: var(--primary);
  background: rgba(247, 236, 231, .66);
  font-size: 22px;
  line-height: 1;
}

.community-upload {
  display: grid;
  place-items: center;
  min-height: 92px;
  border: 1px dashed rgba(166, 27, 41, .32);
  border-radius: 18px;
  color: var(--primary);
  background: rgba(247, 236, 231, .58);
  font-weight: 900;
}

.community-upload input {
  display: none;
}

.community-preview {
  margin: 0;
}

.community-compose textarea {
  width: 100%;
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, .86);
  font: inherit;
  resize: vertical;
}

.community-feed {
  display: grid;
  gap: 14px;
  margin-top: 0;
}

.community-post {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(166, 27, 41, .12);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .92), rgba(247, 236, 231, .62)),
    white;
  box-shadow: 0 16px 34px rgba(83, 24, 31, .08);
  overflow: hidden;
}

.community-post-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.community-post-head > span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #7e1320, #a61b29);
  font-weight: 900;
}

.community-post-head strong,
.community-post-head small {
  display: block;
}

.community-post-head small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.community-post img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 18px;
  background: rgba(247, 236, 231, .8);
}

.community-post p {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.community-post.official {
  border-color: rgba(166, 27, 41, .22);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .96), rgba(247, 236, 231, .82)),
    white;
}

.invite-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  margin: 8px 0;
  padding: 10px 12px;
  border: 1px solid rgba(166, 27, 41, .18);
  border-radius: 16px;
  background:
    radial-gradient(circle at 88% 14%, rgba(166, 27, 41, .14), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, .92), rgba(247, 236, 231, .72));
  box-shadow: 0 10px 22px rgba(83, 24, 31, .06);
  overflow: hidden;
}

.invite-card::after {
  content: "";
  position: absolute;
  right: -26px;
  bottom: -42px;
  width: 92px;
  height: 92px;
  border: 1px solid rgba(166, 27, 41, .1);
  border-radius: 50%;
}

.invite-card div,
.invite-card button {
  position: relative;
  z-index: 1;
}

.invite-card span {
  display: inline-grid;
  width: fit-content;
  margin-bottom: 3px;
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--primary);
  background: rgba(166, 27, 41, .08);
  font-size: 11px;
  font-weight: 900;
}

.invite-card strong {
  display: block;
  color: var(--primary-ink);
  font-size: 16px;
  line-height: 1.1;
  letter-spacing: .02em;
}

.invite-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.45;
}

.invite-card .secondary-btn {
  flex: 0 0 auto;
  min-width: 58px;
  min-height: 34px;
  padding: 0 10px;
}

.profile-invite-card {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  margin: 8px 0;
}

.profile-invite-card .invite-icon {
  position: relative;
  z-index: 1;
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background:
    radial-gradient(circle at 70% 18%, rgba(255, 255, 255, .86), transparent 20%),
    linear-gradient(145deg, #a61b29, #7e1320);
  box-shadow: 0 8px 18px rgba(126, 19, 32, .14);
}

.profile-invite-card .invite-icon::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 13px;
  width: 16px;
  height: 12px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .92);
}

.profile-invite-card .invite-icon::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 9px;
  width: 3px;
  height: 18px;
  border-radius: 999px;
  background: #a61b29;
  box-shadow: -6px 5px 0 -1px #a61b29, 6px 5px 0 -1px #a61b29;
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.result-message {
  margin: 12px 0;
  color: var(--muted);
  line-height: 1.55;
}

.loader {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 3px solid color-mix(in oklch, var(--accent) 20%, white);
  border-top-color: var(--accent);
  animation: spin 900ms linear infinite;
}

.result-media img,
.result-media video {
  display: block;
  width: 100%;
  max-height: 62vh;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: oklch(0.94 0.008 205);
}

.hidden {
  display: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }
}

@media (max-width: 460px) {
  .dual-upload,
  .api-config-grid,
  .usage-compass-board,
  .usage-history-tools,
  .usage-history-query,
  .usage-radar-grid,
  .usage-provider-grid,
  .category-editor-list,
  .user-grid,
  .admin-metrics,
  .category-detail-grid,
  .password-box {
    grid-template-columns: 1fr;
  }

  .user-course-fieldset {
    grid-template-columns: 1fr;
  }

  .category-filter-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .category-editor-title {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .admin-save-dock {
    position: static;
    grid-template-columns: 1fr;
  }

  .admin-save-actions {
    justify-content: stretch;
  }

  .admin-save-actions .secondary-btn {
    flex: 1 1 130px;
  }
}

@media (min-width: 461px) and (max-width: 900px) {
  .pc-admin-shell {
    grid-template-columns: 1fr;
    padding: 16px 12px 80px;
  }

  .admin-sidebar {
    position: static;
  }

  .admin-nav {
    grid-template-columns: repeat(5, 1fr);
  }

  .category-editor-list,
  .admin-metrics,
  .usage-compass-board,
  .usage-history-tools {
    grid-template-columns: 1fr 1fr;
  }

  .usage-radar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-category-list {
    grid-template-columns: 1fr;
  }

  .pc-admin-shell.admin-pc-layout,
  .admin-pc-layout .admin-panel {
    grid-template-columns: 1fr;
  }

  .admin-pc-layout .admin-metrics {
    grid-column: 1 / -1;
  }
}

@media (max-width: 360px) {
  .settings-row,
  .admin-actions,
  .code-row {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 24px;
  }
}

/* Zhiyi AI mobile product refresh */
body {
  background:
    linear-gradient(180deg, #f4fbf8 0%, #fbfaf6 44%, #f7fbfc 100%),
    var(--bg);
}

.app-shell {
  padding-inline: 18px;
}

.login-screen {
  background:
    linear-gradient(145deg, rgba(220, 246, 237, .78), rgba(255, 249, 240, .78) 48%, rgba(235, 247, 250, .72)),
    #f8fbf8;
}

.login-panel {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border-color: rgba(33, 99, 87, .16);
  border-radius: 18px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 28px 70px rgba(20, 54, 50, .14);
  backdrop-filter: blur(18px);
}

.login-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, #0b775f, #ef7d52, #d8a33f);
}

.brand-lockup {
  gap: 10px;
  letter-spacing: .02em;
}

.brand-lockup span {
  border-radius: 12px;
  background: linear-gradient(140deg, #075f50, #159a7c 58%, #f09b5d);
  box-shadow: 0 12px 26px rgba(9, 112, 91, .24);
}

.brand-lockup.compact span {
  border-radius: 10px;
}

.auth-mode-tabs,
.asset-tabs,
.mode-switch {
  border: 1px solid rgba(19, 82, 72, .10);
  border-radius: 14px;
  background: rgba(12, 85, 73, .07);
}

.auth-mode-tabs button,
.asset-tab,
.mode-btn {
  border-radius: 11px;
}

.auth-mode-tabs button.active,
.asset-tab.active,
.mode-btn.active,
.home-mode-grid button.active {
  background: linear-gradient(135deg, #066b58, #0c8a70);
  box-shadow: 0 12px 26px rgba(8, 111, 91, .20);
}

input,
select,
textarea {
  border-color: rgba(29, 82, 76, .14);
  border-radius: 13px;
  background: rgba(255, 255, 255, .92);
}

.topbar {
  padding-top: 16px;
}

.eyebrow {
  color: #52645f;
  font-size: 12px;
  letter-spacing: .04em;
}

h1 {
  font-size: 30px;
  font-weight: 950;
}

.icon-btn,
.status-pill,
.small-link,
.admin-badge {
  border-color: rgba(9, 111, 91, .16);
  border-radius: 999px;
  background: rgba(226, 246, 238, .86);
  box-shadow: 0 8px 20px rgba(29, 68, 63, .07);
}

.home-carousel {
  grid-auto-columns: 92%;
  gap: 12px;
  margin-bottom: 14px;
}

.carousel-slide {
  min-height: 154px;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 22px 48px rgba(23, 61, 58, .16);
}

.carousel-slide::after {
  background:
    linear-gradient(90deg, rgba(8, 28, 28, .78), rgba(8, 28, 28, .24) 58%, rgba(8, 28, 28, .08)),
    linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,0));
}

.carousel-copy {
  padding: 20px;
}

.carousel-copy strong {
  font-size: 22px;
  font-weight: 950;
}

.quick-workflow-grid,
.home-mode-grid,
.category-grid,
.tool-grid {
  gap: 12px;
}

.quick-workflow-card {
  border-color: rgba(16, 101, 88, .14);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(246,251,249,.90)),
    white;
  box-shadow: 0 16px 34px rgba(26, 67, 62, .10);
}

.quick-workflow-card span,
.category-icon,
.tool-icon,
.action-icon {
  border-radius: 12px;
  color: #075f50;
  background: linear-gradient(180deg, #dff8ee, #caefe2);
}

.home-mode-grid {
  padding: 4px;
  border-radius: 16px;
  background: rgba(14, 88, 76, .07);
}

.home-mode-grid button {
  min-height: 48px;
  border: 0;
  border-radius: 13px;
  background: transparent;
}

.home-search input {
  min-height: 48px;
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(26, 67, 62, .08);
}

.category-item,
.tool-card,
.panel,
.result-panel,
.profile-card,
.profile-actions,
.credit-card,
.history-card,
.empty-state,
.template-editor,
.login-panel {
  border-radius: 18px;
}

.category-item,
.tool-card {
  border-color: rgba(16, 101, 88, .15);
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(247, 252, 250, .92)),
    white;
  box-shadow: 0 16px 36px rgba(30, 69, 64, .10);
}

.category-item {
  padding: 10px;
}

.category-item.has-media,
.category-item.has-video {
  border: 1px solid rgba(16, 101, 88, .15);
  box-shadow: 0 16px 36px rgba(30, 69, 64, .10);
  padding: 0;
}

.category-video,
.category-image {
  border-radius: 16px;
}

.category-item.has-media::after,
.category-item.has-video::after {
  display: none;
}

.favorite-btn,
.detail-favorite-btn {
  border-color: rgba(235, 108, 78, .24);
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 12px 24px rgba(37, 55, 52, .12);
}

.detail-favorite-btn {
  width: 48px;
  height: 48px;
  margin-top: 18px;
}

.panel,
.result-panel,
.profile-card,
.profile-actions,
.credit-card,
.history-card,
.empty-state {
  border-color: rgba(30, 89, 81, .13);
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 20px 48px rgba(27, 64, 60, .11);
}

.panel,
.result-panel {
  padding: 16px;
}

.cost-row,
.recharge-head {
  border-color: rgba(8, 124, 98, .16);
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(216, 245, 233, .95), rgba(241, 250, 246, .88));
}

.step-title span {
  background: linear-gradient(135deg, #0b2330, #0b6b58);
  box-shadow: 0 8px 16px rgba(11, 35, 48, .16);
}

.upload-box {
  border-color: rgba(8, 124, 98, .34);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(234, 249, 243, .92), rgba(248, 252, 250, .92));
}

.dual-upload {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-upload {
  min-height: 128px;
  padding-inline: 8px;
}

.generate-btn,
.download-btn {
  min-height: 54px;
  border-radius: 15px;
  background: linear-gradient(135deg, #eb7047, #c85236);
  box-shadow: 0 16px 30px rgba(213, 88, 55, .25);
}

.secondary-btn,
.danger-btn,
.back-btn {
  border-radius: 13px;
}

.back-btn {
  background: linear-gradient(135deg, #075f50, #0a8069);
  box-shadow: 0 12px 24px rgba(9, 112, 91, .18);
}

.profile-avatar {
  background: linear-gradient(135deg, #075f50, #159a7c 60%, #f09b5d);
  box-shadow: 0 14px 28px rgba(9, 112, 91, .18);
}

.profile-actions {
  overflow: hidden;
}

.profile-actions button,
.profile-actions a,
.setting-row,
.asset-workflow-card,
.upload-history-card,
.generated-asset-card {
  background: rgba(255, 255, 255, .94);
}

.bottom-nav {
  bottom: 10px;
  width: min(calc(100% - 24px), 496px);
  padding: 7px;
  border: 1px solid rgba(23, 89, 80, .12);
  border-radius: 22px;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 18px 44px rgba(20, 54, 50, .18);
  backdrop-filter: blur(18px);
}

.bottom-nav-item {
  min-height: 58px;
  border-radius: 17px;
}

.bottom-nav-item.active {
  color: #075f50;
  background: linear-gradient(180deg, #e4f8ef, #d6f2e7);
}

/* Warm AI visual direction */
body {
  background:
    linear-gradient(180deg, #fff8f1 0%, #fffdf8 44%, #f7fbf8 100%),
    var(--bg);
}

.login-screen {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 239, 221, .92), rgba(255, 250, 243, .88) 45%, rgba(238, 248, 242, .86)),
    #fffaf3;
}

.login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(170, 98, 53, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(170, 98, 53, .055) 1px, transparent 1px),
    linear-gradient(135deg, rgba(242, 139, 78, .16), transparent 36%, rgba(29, 120, 96, .10) 72%, transparent);
  background-size: 34px 34px, 34px 34px, 100% 100%;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.8), rgba(0,0,0,.18) 72%, transparent);
}

.login-panel {
  z-index: 1;
  border-color: rgba(190, 104, 54, .18);
  background: rgba(255, 252, 247, .90);
  box-shadow: 0 30px 80px rgba(121, 67, 38, .16);
}

.login-panel::before {
  background: linear-gradient(90deg, #c65e32, #f1a55f, #1c8a72);
}

.brand-lockup span,
.profile-avatar {
  background: linear-gradient(140deg, #bd5730, #ee9b5a 54%, #16856f);
  box-shadow: 0 14px 28px rgba(191, 91, 48, .24);
}

.auth-mode-tabs,
.asset-tabs,
.mode-switch,
.home-mode-grid {
  border-color: rgba(191, 99, 48, .12);
  background: rgba(255, 231, 210, .52);
}

.auth-mode-tabs button.active,
.asset-tab.active,
.mode-btn.active,
.home-mode-grid button.active {
  background: linear-gradient(135deg, #c65e32, #e9864d);
  box-shadow: 0 13px 28px rgba(200, 94, 50, .22);
}

input,
select,
textarea {
  border-color: rgba(145, 87, 52, .16);
  background: rgba(255, 253, 249, .96);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(203, 95, 48, .54);
  box-shadow: 0 0 0 4px rgba(246, 180, 124, .20);
}

.eyebrow,
.muted-text,
.admin-tip,
.carousel-copy span,
.quick-workflow-card small,
.asset-workflow-card span,
.upload-history-card span,
.upload-history-card small,
.generated-asset-card span,
.generated-asset-card small,
.setting-row small {
  color: #685b51;
}

.icon-btn,
.status-pill,
.small-link,
.admin-badge {
  border-color: rgba(193, 96, 47, .16);
  color: #7c3f24;
  background: rgba(255, 235, 217, .88);
  box-shadow: 0 9px 22px rgba(122, 73, 42, .09);
}

.carousel-slide {
  background: linear-gradient(135deg, #8f3f24, #e07a43 55%, #e4b05f);
  box-shadow: 0 24px 52px rgba(126, 67, 37, .18);
}

.carousel-slide::after {
  background:
    linear-gradient(90deg, rgba(51, 25, 16, .70), rgba(92, 46, 26, .24) 58%, rgba(92, 46, 26, .08)),
    linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,0));
}

.quick-workflow-card,
.category-item,
.tool-card,
.panel,
.result-panel,
.profile-card,
.profile-actions,
.credit-card,
.history-card,
.empty-state {
  border-color: rgba(164, 95, 55, .14);
  background:
    linear-gradient(180deg, rgba(255, 254, 250, .98), rgba(255, 249, 242, .93)),
    white;
  box-shadow: 0 18px 42px rgba(112, 75, 48, .10);
}

.quick-workflow-card span,
.category-icon,
.tool-icon,
.action-icon {
  color: #8a4327;
  background: linear-gradient(180deg, #fff0df, #f8d4b4);
}

.favorite-btn,
.detail-favorite-btn {
  color: #c65e32;
  border-color: rgba(198, 94, 50, .24);
}

.favorite-btn.active,
.detail-favorite-btn.active {
  color: white;
  background: linear-gradient(135deg, #c65e32, #ec8550);
}

.cost-row,
.recharge-head {
  border-color: rgba(198, 94, 50, .18);
  background: linear-gradient(90deg, rgba(255, 232, 210, .95), rgba(255, 248, 240, .92));
}

.cost-row strong,
.recharge-head strong,
.credit-card strong {
  color: #74391f;
}

.step-title span {
  background: linear-gradient(135deg, #3a2118, #bf5b31);
  box-shadow: 0 8px 16px rgba(120, 58, 32, .18);
}

.upload-box {
  border-color: rgba(198, 94, 50, .32);
  background:
    linear-gradient(180deg, rgba(255, 243, 232, .94), rgba(255, 253, 248, .94));
}

.generate-btn,
.download-btn {
  background: linear-gradient(135deg, #df7243, #bf4f2e);
  box-shadow: 0 17px 34px rgba(196, 82, 45, .25);
}

.secondary-btn {
  border-color: rgba(198, 94, 50, .30);
  color: #7c3f24;
  background: #fff0df;
}

.back-btn {
  background: linear-gradient(135deg, #8b4729, #c76238);
  box-shadow: 0 12px 24px rgba(143, 65, 36, .18);
}

.bottom-nav {
  border-color: rgba(168, 91, 50, .14);
  background: rgba(255, 252, 247, .88);
  box-shadow: 0 20px 48px rgba(113, 70, 43, .18);
}

.bottom-nav-item.active {
  color: #8a4327;
  background: linear-gradient(180deg, #fff0df, #f8ddc4);
}

.carousel-copy span {
  color: rgba(255, 255, 255, .88);
}

/* Reference palette: paper ivory, clay brown, olive green */
body {
  background:
    linear-gradient(180deg, #faf3e9 0%, #fffaf3 45%, #f7f0e6 100%),
    #faf3e9;
  color: #151511;
}

.login-screen {
  background:
    linear-gradient(135deg, rgba(250, 243, 233, .96), rgba(255, 250, 242, .92) 46%, rgba(226, 222, 207, .90)),
    #faf3e9;
}

.login-screen::before {
  background:
    linear-gradient(rgba(92, 97, 77, .075) 1px, transparent 1px),
    linear-gradient(90deg, rgba(92, 97, 77, .075) 1px, transparent 1px),
    linear-gradient(135deg, rgba(168, 112, 63, .18), transparent 38%, rgba(92, 97, 77, .16) 74%, transparent);
  background-size: 34px 34px, 34px 34px, 100% 100%;
}

.login-panel {
  border-color: rgba(92, 97, 77, .20);
  background:
    linear-gradient(180deg, rgba(255, 252, 247, .94), rgba(250, 243, 233, .92));
  box-shadow: 0 30px 80px rgba(46, 43, 31, .18);
}

.login-panel::before {
  background: linear-gradient(90deg, #5c614d, #a8703f, #151511);
}

.brand-lockup span,
.profile-avatar {
  color: #fffaf3;
  background: linear-gradient(140deg, #151511, #5c614d 54%, #a8703f);
  box-shadow: 0 14px 28px rgba(92, 97, 77, .25);
}

.auth-mode-tabs,
.asset-tabs,
.mode-switch,
.home-mode-grid {
  border-color: rgba(92, 97, 77, .16);
  background: rgba(92, 97, 77, .10);
}

.auth-mode-tabs button.active,
.asset-tab.active,
.mode-btn.active,
.home-mode-grid button.active {
  color: #faf3e9;
  background: linear-gradient(135deg, #5c614d, #3f4435);
  box-shadow: 0 13px 28px rgba(92, 97, 77, .24);
}

input,
select,
textarea {
  border-color: rgba(92, 97, 77, .20);
  background: rgba(255, 252, 247, .96);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(168, 112, 63, .60);
  box-shadow: 0 0 0 4px rgba(168, 112, 63, .18);
}

.eyebrow,
.muted-text,
.admin-tip,
.quick-workflow-card small,
.asset-workflow-card span,
.upload-history-card span,
.upload-history-card small,
.generated-asset-card span,
.generated-asset-card small,
.setting-row small {
  color: #5c614d;
}

.icon-btn,
.status-pill,
.small-link,
.admin-badge {
  border-color: rgba(92, 97, 77, .18);
  color: #3f4435;
  background: rgba(250, 243, 233, .88);
  box-shadow: 0 9px 22px rgba(46, 43, 31, .10);
}

.carousel-slide {
  background: linear-gradient(135deg, #151511, #5c614d 54%, #a8703f);
  box-shadow: 0 24px 52px rgba(46, 43, 31, .20);
}

.carousel-slide::after {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .76), rgba(21, 21, 17, .28) 58%, rgba(21, 21, 17, .10)),
    linear-gradient(180deg, rgba(250, 243, 233, .10), rgba(250, 243, 233, 0));
}

.carousel-copy span {
  color: rgba(250, 243, 233, .90);
}

.quick-workflow-card,
.category-item,
.tool-card,
.panel,
.result-panel,
.profile-card,
.profile-actions,
.credit-card,
.history-card,
.empty-state {
  border-color: rgba(92, 97, 77, .16);
  background:
    linear-gradient(180deg, rgba(255, 252, 247, .98), rgba(250, 243, 233, .94)),
    #faf3e9;
  box-shadow: 0 18px 42px rgba(46, 43, 31, .11);
}

.quick-workflow-card span,
.category-icon,
.tool-icon,
.action-icon {
  color: #3f4435;
  background: linear-gradient(180deg, rgba(250, 243, 233, .95), rgba(213, 205, 184, .82));
}

.favorite-btn,
.detail-favorite-btn {
  color: #a8703f;
  border-color: rgba(168, 112, 63, .30);
}

.favorite-btn.active,
.detail-favorite-btn.active {
  color: #faf3e9;
  background: linear-gradient(135deg, #a8703f, #7f552f);
}

.cost-row,
.recharge-head {
  border-color: rgba(92, 97, 77, .18);
  background: linear-gradient(90deg, rgba(229, 221, 205, .96), rgba(250, 243, 233, .92));
}

.cost-row strong,
.recharge-head strong,
.credit-card strong {
  color: #151511;
}

.step-title span {
  background: linear-gradient(135deg, #151511, #5c614d);
  box-shadow: 0 8px 16px rgba(46, 43, 31, .18);
}

.upload-box {
  border-color: rgba(92, 97, 77, .36);
  background:
    linear-gradient(180deg, rgba(250, 243, 233, .94), rgba(255, 252, 247, .94));
}

.generate-btn,
.download-btn {
  color: #faf3e9;
  background: linear-gradient(135deg, #a8703f, #7a4f2d);
  box-shadow: 0 17px 34px rgba(122, 79, 45, .26);
}

.secondary-btn {
  border-color: rgba(92, 97, 77, .30);
  color: #3f4435;
  background: #faf3e9;
}

.back-btn {
  color: #faf3e9;
  background: linear-gradient(135deg, #5c614d, #3f4435);
  box-shadow: 0 12px 24px rgba(92, 97, 77, .22);
}

.bottom-nav {
  border-color: rgba(92, 97, 77, .18);
  background: rgba(255, 252, 247, .90);
  box-shadow: 0 20px 48px rgba(46, 43, 31, .20);
}

.bottom-nav-item.active {
  color: #3f4435;
  background: linear-gradient(180deg, rgba(229, 221, 205, .95), rgba(250, 243, 233, .96));
}

.brand-lockup span,
.profile-avatar {
  color: #faf3e9;
  background:
    linear-gradient(145deg, #151511 0%, #3b3024 44%, #a8703f 100%);
  box-shadow: 0 14px 28px rgba(63, 48, 34, .26);
}

/* Reference palette: lithospermum pink and amaranth red */
body {
  background:
    linear-gradient(180deg, #f7ece7 0%, #fff8f5 46%, #f4e7e2 100%),
    #f7ece7;
  color: #171113;
}

.login-screen {
  background:
    linear-gradient(135deg, rgba(247, 236, 231, .96), rgba(255, 249, 246, .92) 48%, rgba(232, 210, 207, .88)),
    #f7ece7;
}

.login-screen::before {
  background:
    linear-gradient(rgba(166, 27, 41, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(166, 27, 41, .055) 1px, transparent 1px),
    linear-gradient(135deg, rgba(166, 27, 41, .14), transparent 38%, rgba(73, 40, 44, .10) 74%, transparent);
  background-size: 34px 34px, 34px 34px, 100% 100%;
}

.login-panel {
  border-color: rgba(166, 27, 41, .18);
  background:
    linear-gradient(180deg, rgba(255, 250, 247, .95), rgba(247, 236, 231, .93));
  box-shadow: 0 30px 80px rgba(83, 24, 31, .16);
}

.login-panel::before {
  background: linear-gradient(90deg, #a61b29, #f7ece7, #171113);
}

.brand-lockup span,
.profile-avatar {
  color: #f7ece7;
  background: linear-gradient(145deg, #171113 0%, #651721 45%, #a61b29 100%);
  box-shadow: 0 14px 28px rgba(166, 27, 41, .24);
}

.auth-mode-tabs,
.asset-tabs,
.mode-switch,
.home-mode-grid {
  border-color: rgba(166, 27, 41, .14);
  background: rgba(166, 27, 41, .07);
}

.auth-mode-tabs button.active,
.asset-tab.active,
.mode-btn.active,
.home-mode-grid button.active {
  color: #fff7f3;
  background: linear-gradient(135deg, #a61b29, #7e1320);
  box-shadow: 0 13px 28px rgba(166, 27, 41, .22);
}

input,
select,
textarea {
  border-color: rgba(94, 45, 50, .18);
  background: rgba(255, 250, 247, .96);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(166, 27, 41, .56);
  box-shadow: 0 0 0 4px rgba(166, 27, 41, .14);
}

.eyebrow,
.muted-text,
.admin-tip,
.quick-workflow-card small,
.asset-workflow-card span,
.upload-history-card span,
.upload-history-card small,
.generated-asset-card span,
.generated-asset-card small,
.setting-row small {
  color: #725a5e;
}

.icon-btn,
.status-pill,
.small-link,
.admin-badge {
  border-color: rgba(166, 27, 41, .15);
  color: #7e1320;
  background: rgba(247, 236, 231, .90);
  box-shadow: 0 9px 22px rgba(83, 24, 31, .09);
}

.carousel-slide {
  background: linear-gradient(135deg, #171113, #7e1320 54%, #a61b29);
  box-shadow: 0 24px 52px rgba(83, 24, 31, .19);
}

.carousel-slide::after {
  background:
    linear-gradient(90deg, rgba(23, 17, 19, .76), rgba(83, 24, 31, .28) 58%, rgba(83, 24, 31, .10)),
    linear-gradient(180deg, rgba(247, 236, 231, .10), rgba(247, 236, 231, 0));
}

.carousel-copy span {
  color: rgba(255, 247, 243, .90);
}

.carousel-slide.has-image::after {
  display: none;
}

.quick-workflow-card,
.category-item,
.tool-card,
.panel,
.result-panel,
.profile-card,
.profile-actions,
.credit-card,
.history-card,
.empty-state {
  border-color: rgba(166, 27, 41, .13);
  background:
    linear-gradient(180deg, rgba(255, 250, 247, .98), rgba(247, 236, 231, .94)),
    #f7ece7;
  box-shadow: 0 18px 42px rgba(83, 24, 31, .10);
}

.quick-workflow-card span,
.category-icon,
.tool-icon,
.action-icon {
  color: #7e1320;
  background: linear-gradient(180deg, #fff7f3, #ead2cf);
}

.profile-actions .action-icon {
  color: #7e1320;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .92), transparent 28%),
    linear-gradient(180deg, #fff7f3, #ead2cf);
  box-shadow:
    inset 0 0 0 1px rgba(166, 27, 41, .20),
    0 8px 18px rgba(126, 19, 32, .08);
}

.profile-actions .settings-action-icon::before {
  border-color: #a61b29;
  box-shadow:
    0 -8px 0 -6px #a61b29,
    0 8px 0 -6px #a61b29,
    8px 0 0 -6px #a61b29,
    -8px 0 0 -6px #a61b29;
}

.profile-actions .settings-action-icon::after,
.profile-actions .logout-action-icon::after {
  background: #a61b29;
}

.profile-actions .logout-action-icon::before {
  border-color: #a61b29;
}

.favorite-btn,
.detail-favorite-btn {
  color: #a61b29;
  border-color: rgba(166, 27, 41, .28);
}

.favorite-btn.active,
.detail-favorite-btn.active {
  color: #fff7f3;
  background: linear-gradient(135deg, #a61b29, #7e1320);
}

.quick-workflow-card {
  isolation: isolate;
  overflow: hidden;
  place-items: stretch;
  align-content: stretch;
  justify-items: start;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 4px;
  padding: 14px 12px 12px;
  border-color: rgba(166, 27, 41, .16);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.44) 0 12%, rgba(255,255,255,0) 32%),
    radial-gradient(circle at 84% 14%, rgba(166, 27, 41, .16), transparent 34%),
    linear-gradient(145deg, rgba(255, 250, 247, .98), rgba(247, 236, 231, .90) 58%, rgba(235, 214, 211, .82));
  box-shadow: 0 18px 42px rgba(83, 24, 31, .10), inset 0 1px 0 rgba(255,255,255,.88);
  text-align: left;
}

.quick-workflow-card:nth-child(2) {
  background:
    linear-gradient(145deg, rgba(255,255,255,.40) 0 12%, rgba(255,255,255,0) 32%),
    radial-gradient(circle at 84% 14%, rgba(126, 19, 32, .15), transparent 34%),
    linear-gradient(145deg, rgba(255, 249, 246, .98), rgba(246, 229, 222, .90) 56%, rgba(166, 27, 41, .13));
}

.quick-workflow-card:nth-child(3) {
  background:
    linear-gradient(145deg, rgba(255,255,255,.42) 0 12%, rgba(255,255,255,0) 32%),
    radial-gradient(circle at 84% 14%, rgba(166, 27, 41, .13), transparent 34%),
    linear-gradient(145deg, rgba(255, 250, 247, .98), rgba(248, 232, 227, .90) 54%, rgba(126, 19, 32, .12));
}

.quick-workflow-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  z-index: 0;
  border-radius: 14px;
  border: 1px solid rgba(166, 27, 41, .08);
  background:
    linear-gradient(180deg, rgba(255,255,255,.38), rgba(255,255,255,0)),
    radial-gradient(circle at 100% 0, rgba(166, 27, 41, .07), transparent 42%);
}

.quick-workflow-card::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -34px;
  z-index: 0;
  width: 76px;
  height: 76px;
  border-radius: 999px;
  border: 18px solid rgba(166, 27, 41, .08);
}

.quick-workflow-card > * {
  position: relative;
  z-index: 1;
}

.quick-workflow-card span {
  width: 26px;
  height: 26px;
  color: #a61b29;
  border: 1px solid rgba(166, 27, 41, .10);
  background: rgba(247, 236, 231, .86);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72), 0 8px 18px rgba(83, 24, 31, .06);
}

.quick-workflow-card strong {
  align-self: end;
  color: #171113;
  font-size: 15px;
  line-height: 1.18;
}

.quick-workflow-card small {
  max-width: 100%;
  color: #725a5e;
  font-size: 10.5px;
  line-height: 1.28;
}

.cost-row,
.recharge-head {
  border-color: rgba(166, 27, 41, .16);
  background: linear-gradient(90deg, rgba(239, 219, 215, .96), rgba(247, 236, 231, .92));
}

.cost-row strong,
.recharge-head strong,
.credit-card strong {
  color: #171113;
}

.step-title span {
  background: linear-gradient(135deg, #171113, #a61b29);
  box-shadow: 0 8px 16px rgba(83, 24, 31, .18);
}

.upload-box {
  border-color: rgba(166, 27, 41, .30);
  background:
    linear-gradient(180deg, rgba(247, 236, 231, .94), rgba(255, 250, 247, .94));
}

.generate-btn,
.download-btn {
  color: #fff7f3;
  background: linear-gradient(135deg, #a61b29, #7e1320);
  box-shadow: 0 17px 34px rgba(166, 27, 41, .24);
}

.secondary-btn {
  border-color: rgba(166, 27, 41, .25);
  color: #7e1320;
  background: #f7ece7;
}

.back-btn {
  color: #fff7f3;
  background: linear-gradient(135deg, #171113, #7e1320);
  box-shadow: 0 12px 24px rgba(83, 24, 31, .20);
}

.bottom-nav {
  border-color: rgba(166, 27, 41, .14);
  background: rgba(255, 250, 247, .90);
  box-shadow: 0 20px 48px rgba(83, 24, 31, .18);
}

.bottom-nav-item.active {
  color: #7e1320;
  background: linear-gradient(180deg, rgba(247, 236, 231, .96), rgba(236, 214, 210, .92));
}

.login-panel > * {
  position: relative;
  z-index: 1;
}

.login-panel::after {
  content: "";
  position: absolute;
  right: -52px;
  top: 54px;
  width: 220px;
  height: 220px;
  background: url("/assets/zhiyi-logo-mark.png") center / contain no-repeat;
  opacity: .055;
  pointer-events: none;
}

.brand-lockup span,
.brand-lockup.compact span {
  overflow: hidden;
  color: transparent;
  background: linear-gradient(145deg, #fff9f6, #f7ece7);
  box-shadow: 0 12px 24px rgba(166, 27, 41, .14);
}

.brand-lockup span img {
  display: block;
  width: 112%;
  height: 112%;
  object-fit: contain;
  transform: translateY(1px);
}

/* Softer detail controls: remove near-black from small action icons */
.back-btn,
.step-title span {
  color: #fff7f3;
  background: linear-gradient(135deg, #a61b29, #8e1724);
  box-shadow: 0 10px 22px rgba(166, 27, 41, .22);
}

.mode-btn.active,
.generate-btn,
.download-btn {
  background: linear-gradient(135deg, #a61b29, #941826);
}

/* Recharge page final theme lock: keep all payment choices in the zhiyi red palette. */
.recharge-page .course-pack,
.recharge-page .member-plan-card {
  border-color: rgba(166, 27, 41, .18);
  background:
    radial-gradient(circle at 88% 8%, rgba(166, 27, 41, .12), transparent 32%),
    linear-gradient(145deg, rgba(255, 250, 247, .98), rgba(247, 236, 231, .86));
  color: #7e1421;
}

.recharge-page .course-pack small,
.recharge-page .member-plan-card small {
  color: #a61b29;
  background: rgba(166, 27, 41, .10);
}

.recharge-page .course-pack span,
.recharge-page .member-plan-card span {
  color: #a61b29;
}

.recharge-page .course-pack strong,
.recharge-page .member-plan-card strong {
  color: #7e1421;
}

.recharge-page .member-plan-card.supreme:not(.selected) strong {
  color: #7e1421;
}

.recharge-page .member-plan-card.supreme:not(.selected) span {
  color: #a61b29;
}

.recharge-page .member-plan-card.supreme:not(.selected) em {
  color: rgba(59, 13, 20, .66);
}

.recharge-page .course-pack.selected,
.recharge-page .member-plan-card.selected {
  border-color: rgba(166, 27, 41, .54);
  background:
    radial-gradient(circle at 86% 10%, rgba(255, 255, 255, .20), transparent 30%),
    linear-gradient(135deg, #7e1421, #a61b29 62%, #d79492);
  color: #fff7f3;
}

.recharge-page .course-pack.selected small,
.recharge-page .member-plan-card.selected small {
  color: #a61b29;
  background: rgba(255, 255, 255, .92);
}

.recharge-page .course-pack.selected strong,
.recharge-page .course-pack.selected span,
.recharge-page .course-pack.selected em,
.recharge-page .member-plan-card.selected strong,
.recharge-page .member-plan-card.selected span,
.recharge-page .member-plan-card.selected em {
  color: #fff7f3;
}

/* Zhiyi 2026 student app refinement */
:root {
  --zhiyi-red: #a61b29;
  --zhiyi-red-dark: #7e1421;
  --zhiyi-red-soft: #f3dedd;
  --zhiyi-page: #f8f3f2;
  --zhiyi-surface: #fffdfc;
  --zhiyi-ink: #24191c;
  --zhiyi-muted: #6f5b60;
  --zhiyi-line: rgba(126, 20, 33, .13);
  --zhiyi-shadow: 0 12px 32px rgba(82, 28, 35, .08);
}

body {
  min-height: 100dvh;
  background:
    linear-gradient(180deg, #fbf7f6 0%, var(--zhiyi-page) 52%, #f5ecea 100%);
  color: var(--zhiyi-ink);
}

.app-shell {
  width: min(100%, 540px);
  padding: 12px 16px calc(100px + env(safe-area-inset-bottom));
}

.compact-topbar {
  min-height: 56px;
  padding: 4px 2px 12px;
}

.compact-topbar .brand-lockup {
  gap: 9px;
  margin-bottom: 1px;
}

.compact-topbar .brand-lockup.compact span {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(166, 27, 41, .12);
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(126, 20, 33, .09);
}

.compact-topbar .brand-lockup strong {
  color: var(--zhiyi-ink);
  font-size: 16px;
}

.compact-topbar .eyebrow {
  margin: 0 0 0 43px;
  color: var(--zhiyi-muted);
  font-size: 11px;
  font-weight: 750;
}

.home-top-actions {
  gap: 7px;
}

.icon-btn.search-toggle-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--zhiyi-line);
  border-radius: 50%;
  color: var(--zhiyi-red-dark);
  background: var(--zhiyi-surface);
  box-shadow: 0 6px 18px rgba(82, 28, 35, .06);
}

.status-pill {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-color: var(--zhiyi-line);
  color: var(--zhiyi-red-dark);
  background: rgba(255, 253, 252, .9);
  box-shadow: none;
}

.home-search input {
  min-height: 40px;
  border-color: var(--zhiyi-line);
  border-radius: 14px;
  box-shadow: none;
}

.home-carousel {
  grid-auto-columns: 92%;
  gap: 12px;
  margin: 0 -2px 14px;
  padding: 0 2px 3px;
  scrollbar-width: none;
}

.home-carousel::-webkit-scrollbar {
  display: none;
}

.carousel-slide {
  aspect-ratio: 15 / 7;
  min-height: 0;
  border: 1px solid rgba(126, 20, 33, .1);
  border-radius: 18px;
  background: #f2e4e2;
  box-shadow: 0 10px 28px rgba(82, 28, 35, .09);
}

.carousel-slide img {
  object-position: center;
}

.carousel-slide::after,
.carousel-slide.has-image::after {
  display: block;
  background: linear-gradient(90deg, rgba(255, 253, 252, .98) 0%, rgba(255, 249, 247, .88) 35%, rgba(255, 249, 247, .18) 64%, transparent 80%);
}

.carousel-copy {
  align-content: center;
  gap: 6px;
  width: 54%;
  max-width: 54%;
  min-height: 100%;
  padding: 17px 14px;
  color: var(--zhiyi-ink);
}

.carousel-copy strong {
  color: var(--zhiyi-red-dark);
  font-size: 18px;
  line-height: 1.18;
}

.carousel-copy span,
.carousel-slide.has-image .carousel-copy span {
  color: #624d52;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.45;
}

.quick-workflow-grid {
  gap: 8px;
  margin-bottom: 12px;
}

.quick-workflow-card,
.quick-workflow-card:nth-child(2),
.quick-workflow-card:nth-child(3) {
  aspect-ratio: auto;
  min-height: 108px;
  grid-template-rows: auto 1fr auto;
  align-content: stretch;
  gap: 5px;
  padding: 11px 10px;
  border: 1px solid var(--zhiyi-line);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .98), rgba(249, 237, 235, .88));
  box-shadow: 0 7px 20px rgba(82, 28, 35, .055);
}

.quick-workflow-card::before,
.quick-workflow-card::after {
  display: none;
}

.quick-workflow-card span {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 8px;
  color: var(--zhiyi-red);
  background: var(--zhiyi-red-soft);
  box-shadow: none;
  font-size: 11px;
}

.quick-workflow-card strong {
  align-self: end;
  color: var(--zhiyi-ink);
  font-size: 14px;
  line-height: 1.2;
}

.quick-workflow-card small {
  max-width: 100%;
  color: var(--zhiyi-muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
}

.home-mode-grid {
  position: sticky;
  top: 8px;
  z-index: 9;
  grid-template-columns: repeat(3, minmax(0, 120px));
  justify-content: center;
  gap: 4px;
  margin: 0 0 14px;
  padding: 4px;
  border: 1px solid rgba(126, 20, 33, .08);
  border-radius: 15px;
  background: rgba(246, 232, 229, .92);
  box-shadow: 0 8px 22px rgba(82, 28, 35, .06);
  backdrop-filter: blur(14px);
}

.home-mode-grid button {
  min-height: 42px;
  border: 0;
  border-radius: 11px;
  color: #4f3b40;
  background: transparent;
  box-shadow: none;
}

.home-mode-grid button.active {
  color: #fff9f7;
  background: var(--zhiyi-red);
  box-shadow: 0 7px 18px rgba(166, 27, 41, .2);
}

.category-grid {
  gap: 12px;
}

.image-group-card,
.more-group-card {
  min-height: 112px;
  align-content: end;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--zhiyi-line);
  border-radius: 16px;
  background: linear-gradient(155deg, #fffdfc 0%, #f7e9e7 100%);
  box-shadow: 0 8px 24px rgba(82, 28, 35, .055);
}

.image-group-card:nth-child(2n),
.more-group-card:nth-child(2n) {
  background: linear-gradient(155deg, #fffdfc 0%, #f2e1df 100%);
}

.image-group-card::after,
.more-group-card::after {
  right: -24px;
  bottom: -38px;
  width: 88px;
  height: 88px;
  border-width: 12px;
  border-color: rgba(166, 27, 41, .045);
}

.image-group-card span,
.more-group-card span {
  width: 25px;
  height: 25px;
  border: 0;
  border-radius: 8px;
  color: var(--zhiyi-red);
  background: rgba(255, 255, 255, .72);
  box-shadow: none;
}

.image-group-card strong,
.more-group-card strong {
  color: var(--zhiyi-ink);
  font-size: 15px;
}

.image-group-card small,
.more-group-card small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--zhiyi-muted);
  font-size: 11px;
  font-weight: 700;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.image-group-header {
  padding: 10px;
  border-color: var(--zhiyi-line);
  border-radius: 16px;
  background: var(--zhiyi-surface);
  box-shadow: 0 6px 18px rgba(82, 28, 35, .05);
}

.image-group-header button {
  min-height: 40px;
  border-radius: 11px;
  color: var(--zhiyi-red-dark);
  background: #f7e8e6;
}

.category-item {
  border-color: var(--zhiyi-line);
  border-radius: 16px;
  background: var(--zhiyi-surface);
  box-shadow: 0 8px 24px rgba(82, 28, 35, .07);
}

.category-thumb,
.category-video,
.category-image {
  border-radius: 13px;
}

.category-item.has-media,
.category-item.has-video {
  border-radius: 16px;
}

.category-item.has-media strong,
.category-item.has-video strong {
  padding: 18px 12px 13px;
  font-size: 15px;
  text-shadow: 0 2px 10px rgba(34, 15, 19, .4);
}

.panel,
.result-panel,
.profile-card,
.profile-actions,
.credit-card,
.history-card,
.empty-state {
  border-color: var(--zhiyi-line);
  border-radius: 20px;
  background: var(--zhiyi-surface);
  box-shadow: var(--zhiyi-shadow);
}

.bottom-nav {
  bottom: 10px;
  width: min(calc(100% - 24px), 516px);
  gap: 2px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  border: 1px solid rgba(126, 20, 33, .11);
  border-radius: 22px;
  background: rgba(255, 253, 252, .94);
  box-shadow: 0 14px 40px rgba(82, 28, 35, .14);
}

.bottom-nav-item {
  min-height: 56px;
  border-radius: 15px;
  color: #59484c;
  font-size: 11px;
  font-weight: 800;
  transition: color .18s ease, background .18s ease, transform .18s ease;
}

.bottom-nav-item.active {
  color: var(--zhiyi-red-dark);
  background: #f3e1df;
}

.bottom-nav-item:active,
.quick-workflow-card:active,
.home-mode-grid button:active,
.image-group-card:active,
.more-group-card:active {
  transform: scale(.97);
}

.login-screen {
  min-height: 100dvh;
  background:
    linear-gradient(180deg, rgba(255, 253, 252, .95), rgba(246, 234, 232, .94)),
    #f8f3f2;
}

.login-screen::before {
  background:
    radial-gradient(circle at 16% 14%, rgba(166, 27, 41, .14), transparent 28%),
    radial-gradient(circle at 90% 4%, rgba(166, 27, 41, .08), transparent 32%),
    url("/assets/zhiyi-logo-mark.png") 112% 108% / 72% auto no-repeat;
  mask-image: none;
  opacity: .65;
}

.login-panel {
  gap: 15px;
  padding: 24px 20px;
  border: 1px solid rgba(126, 20, 33, .12);
  border-radius: 24px;
  background: rgba(255, 253, 252, .94);
  box-shadow: 0 24px 64px rgba(82, 28, 35, .13);
  backdrop-filter: blur(18px);
}

.login-panel::before {
  height: 4px;
  background: var(--zhiyi-red);
}

.login-panel::after {
  opacity: .035;
}

.auth-mode-tabs {
  gap: 3px;
  padding: 4px;
  border-color: rgba(126, 20, 33, .1);
  border-radius: 14px;
  background: #f4e5e3;
}

.auth-mode-tabs button {
  min-height: 42px;
  border-radius: 10px;
}

.auth-mode-tabs button.active {
  background: var(--zhiyi-red);
  box-shadow: 0 7px 18px rgba(166, 27, 41, .18);
}

.login-panel input {
  min-height: 48px;
  border-color: rgba(126, 20, 33, .15);
  border-radius: 12px;
}

@media (max-width: 380px) {
  .app-shell {
    padding-inline: 12px;
  }

  .quick-workflow-card {
    min-height: 102px;
    padding-inline: 8px;
  }

  .carousel-copy strong {
    font-size: 16px;
  }

  .carousel-copy span {
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Zhiyi admin workflow compact editor */
.pc-admin-shell,
.pc-admin-shell.admin-pc-layout {
  width: min(100%, 1680px);
  max-width: none;
  grid-template-columns: 268px minmax(0, 1fr);
}

.admin-main,
.admin-panel,
.admin-block.active,
.category-editor-list {
  min-width: 0;
}

.admin-save-dock {
  position: static;
  top: auto;
  z-index: auto;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(83, 24, 31, .07);
  backdrop-filter: none;
}

.admin-save-actions .secondary-btn {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 12px;
}

.carousel-slide::after,
.carousel-slide.has-image::after {
  display: none;
}

.carousel-slide img {
  object-fit: cover;
}

.admin-pc-layout .category-editor-list,
.category-editor-list {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.category-workflow-editor {
  min-height: 88px;
  padding: 10px;
  border-color: rgba(166, 27, 41, .12);
  border-radius: 14px;
  background: rgba(255, 253, 252, .92);
  box-shadow: 0 8px 22px rgba(82, 28, 35, .055);
}

.category-workflow-editor.expanded {
  grid-column: 1 / -1;
  width: 100%;
  padding: 10px;
}

.admin-pc-layout .category-workflow-editor.expanded,
.category-editor-list .category-workflow-editor.expanded {
  grid-column: 1 / -1;
}

.category-editor-title {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.category-workflow-editor:not(.expanded) .category-editor-title {
  grid-template-columns: minmax(0, 1fr) auto;
}

.category-workflow-editor:not(.expanded) .category-badge,
.category-workflow-editor:not(.expanded) .danger-btn {
  display: none;
}

.category-workflow-editor.expanded .category-editor-title {
  grid-template-columns: minmax(0, 1fr) auto auto auto;
}

.category-order {
  font-size: 11px;
}

.category-editor-title strong {
  font-size: 15px;
}

.category-editor-title small {
  font-size: 11px;
}

.category-edit-toggle,
.category-workflow-editor .danger-btn {
  min-height: 30px;
  border-radius: 10px;
  padding: 0 9px;
  font-size: 12px;
}

.category-editor-body {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 8px;
  align-items: start;
}

.workflow-editor-section {
  gap: 6px;
  padding: 9px;
  border-color: rgba(166, 27, 41, .12);
  border-radius: 12px;
  background: rgba(255, 253, 252, .72);
}

.workflow-editor-section h3 {
  margin: 0;
  font-size: 13px;
  line-height: 1.2;
}

.compact-workflow-section,
.workflow-editor-section:has(.category-mode-input) {
  grid-column: span 1;
}

.workflow-editor-section:has(.category-prompt-input) {
  grid-column: span 1;
  grid-row: auto;
}

.workflow-editor-section:has(.category-prompt-input) textarea {
  min-height: 96px;
  height: 112px;
}

.workflow-editor-section:has(.category-image-input),
.workflow-editor-section:has(.category-video-input) {
  grid-column: span 1;
}

.video-admin-upload {
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.category-image-preview,
.admin-video-preview {
  max-height: 86px;
  overflow: auto;
}

.category-image-preview img,
.admin-video-preview video {
  max-height: 72px;
  object-fit: cover;
}

.category-editor-body .save-category-btn {
  grid-column: 1 / -1;
  justify-self: end;
  width: min(220px, 100%);
  min-height: 40px;
}

.category-detail-grid {
  gap: 8px;
}

.category-detail-grid input,
.category-detail-grid select {
  min-height: 38px;
}

.home-ui-card select[data-sync-category-id] {
  min-height: 40px;
}

/* Compact home UI mode settings */
.home-ui-panel.mode-admin-panel {
  grid-column: 1 / -1;
  gap: 8px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 253, 252, .94);
  box-shadow: 0 8px 20px rgba(82, 28, 35, .045);
}

.home-ui-panel.mode-admin-panel .compact-head {
  align-items: center;
  padding-bottom: 2px;
}

.home-ui-panel.mode-admin-panel .compact-head h2 {
  font-size: 15px;
  line-height: 1.2;
}

.home-ui-panel.mode-admin-panel .admin-tip {
  margin: 3px 0 0;
  font-size: 12px;
}

.home-ui-panel.mode-admin-panel .home-ui-list {
  gap: 6px;
}

.home-ui-row.mode-admin-row {
  grid-template-columns: 32px minmax(160px, 1fr) 70px 86px;
  gap: 6px;
  align-items: end;
  min-height: 0;
  padding: 7px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(255, 247, 245, .7));
  box-shadow: none;
}

.home-ui-row.mode-admin-row .home-ui-id {
  min-height: 34px;
  border-radius: 10px;
  font-size: 0;
}

.home-ui-row.mode-admin-row .home-ui-id::first-letter {
  font-size: 0;
}

.home-ui-row.mode-admin-row .home-ui-id::after {
  color: #a61b29;
  font-size: 12px;
  font-weight: 950;
}

.home-ui-row.mode-admin-row .home-ui-id {
  color: transparent;
}

.home-ui-row.mode-admin-row:nth-child(1) .home-ui-id::after {
  content: "图";
}

.home-ui-row.mode-admin-row:nth-child(2) .home-ui-id::after {
  content: "视";
}

.home-ui-row.mode-admin-row:nth-child(3) .home-ui-id::after {
  content: "更";
}

.home-ui-row.mode-admin-row label {
  gap: 4px;
  font-size: 11px;
}

.home-ui-row.mode-admin-row input,
.home-ui-row.mode-admin-row select {
  min-height: 34px;
  border-radius: 9px;
  font-size: 13px;
}

.home-ui-row.mode-admin-row input[type="number"] {
  text-align: center;
  font-weight: 900;
}

@media (max-width: 900px) {
  .category-editor-body {
    grid-template-columns: 1fr;
  }

  .workflow-editor-section,
  .compact-workflow-section,
  .workflow-editor-section:has(.category-mode-input),
  .workflow-editor-section:has(.category-prompt-input),
  .workflow-editor-section:has(.category-image-input),
  .workflow-editor-section:has(.category-video-input),
  .category-editor-body .save-category-btn {
    grid-column: 1;
  }
}

/* Student app interaction refresh: gift modal, discover tab and active carousel */
.gift-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 22px;
}

.gift-modal[hidden] {
  display: none !important;
}

.gift-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(30, 10, 14, .38);
  backdrop-filter: blur(10px);
}

.gift-card {
  position: relative;
  display: grid;
  gap: 12px;
  width: min(100%, 360px);
  padding: 26px 22px 22px;
  overflow: hidden;
  border: 1px solid rgba(166, 27, 41, .16);
  border-radius: 24px;
  background:
    radial-gradient(circle at 88% 12%, rgba(166, 27, 41, .20), transparent 30%),
    radial-gradient(circle at 12% 88%, rgba(247, 236, 231, .95), transparent 36%),
    linear-gradient(155deg, #fffdfc, #f7e8e6);
  color: var(--zhiyi-ink);
  box-shadow: 0 28px 80px rgba(62, 16, 24, .24);
  transform: translateY(10px) scale(.97);
  opacity: 0;
  transition: transform .18s ease, opacity .18s ease;
}

.gift-modal.show .gift-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.gift-card::after {
  content: "";
  position: absolute;
  right: -44px;
  bottom: -58px;
  width: 170px;
  height: 170px;
  border: 24px solid rgba(166, 27, 41, .06);
  border-radius: 50%;
  pointer-events: none;
}

.gift-kicker {
  width: max-content;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--zhiyi-red-dark);
  background: rgba(166, 27, 41, .10);
  font-size: 12px;
  font-weight: 900;
}

.gift-card h2 {
  margin: 0;
  color: var(--zhiyi-red-dark);
  font-size: 30px;
  line-height: 1.1;
}

.gift-card p {
  margin: 0 0 4px;
  color: #63494e;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.7;
}

.gift-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(166, 27, 41, .14);
  border-radius: 50%;
  color: var(--zhiyi-red-dark);
  background: rgba(255, 253, 252, .82);
  font-size: 20px;
  font-weight: 700;
}

.home-carousel {
  scroll-behavior: smooth;
}

.carousel-slide {
  scroll-snap-align: center;
}

.quick-workflow-card,
.quick-workflow-card:nth-child(2),
.quick-workflow-card:nth-child(3) {
  position: relative;
  min-height: 116px;
  padding: 12px 11px;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255,255,255,.86), rgba(255,255,255,0) 34%),
    radial-gradient(circle at 88% 18%, rgba(166, 27, 41, .13), transparent 35%),
    linear-gradient(155deg, #fffdfc, #f6e7e5);
}

.quick-workflow-card::before,
.quick-workflow-card::after {
  display: block;
  content: "";
  position: absolute;
  pointer-events: none;
}

.quick-workflow-card::before {
  right: -30px;
  bottom: -42px;
  width: 94px;
  height: 94px;
  border: 14px solid rgba(166, 27, 41, .055);
  border-radius: 50%;
}

.quick-workflow-card::after {
  display: none;
}

.quick-workflow-card > * {
  position: relative;
  z-index: 1;
}

.discover-page {
  display: none;
}

.discover-page.active {
  display: block;
}

.discover-page .simple-topbar {
  padding: 2px 2px 6px;
}

.discover-page .simple-topbar .eyebrow {
  display: none;
}

.discover-page .simple-topbar h1 {
  font-size: 27px;
  line-height: 1.04;
}

.section-title-row span {
  color: var(--zhiyi-muted);
  font-size: 12px;
  font-weight: 750;
}

.discover-section {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.discover-tabs-section {
  gap: 6px;
  margin-bottom: 8px;
}

.discover-media-filter {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(64px, 1fr));
  gap: 4px;
  width: min(100%, 248px);
  padding: 4px;
  border: 1px solid rgba(166, 27, 41, .1);
  border-radius: 12px;
  background: rgba(166, 27, 41, .045);
}

.discover-media-btn {
  min-height: 32px;
  padding: 6px 12px;
  border: 0;
  border-radius: 9px;
  color: var(--zhiyi-muted);
  background: transparent;
  font-weight: 800;
}

.discover-media-btn.active {
  color: #fff;
  background: var(--zhiyi-red);
  box-shadow: 0 5px 12px rgba(166, 27, 41, .16);
}

.section-title-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
}

.section-title-row strong {
  color: var(--zhiyi-ink);
  font-size: 17px;
}

.discover-grid {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scrollbar-width: none;
}

.discover-grid::-webkit-scrollbar {
  display: none;
}

.discover-tab {
  position: relative;
  flex: 0 0 auto;
  padding: 0 0 9px;
  border: 0;
  color: rgba(28, 29, 31, .48);
  background: transparent;
  font-size: 21px;
  font-weight: 950;
  white-space: nowrap;
}

.discover-tab::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: transparent;
}

.discover-tab.active {
  color: var(--zhiyi-ink);
}

.discover-tab.active::after {
  background: var(--zhiyi-red);
}

.discover-quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.discover-feed-card {
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(166, 27, 41, .12);
  border-radius: 14px;
  background: rgba(255, 255, 255, .74);
  box-shadow: 0 10px 24px rgba(82, 28, 35, .055);
  text-align: left;
}

.discover-feed-card figure {
  position: relative;
  margin: 0;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: linear-gradient(150deg, #fff8f5, #f3dedb);
}

.discover-feed-card img,
.discover-feed-card video,
.discover-feed-fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.discover-feed-fallback {
  display: grid;
  place-items: center;
  color: var(--zhiyi-red);
  font-size: 28px;
  font-weight: 950;
  background:
    radial-gradient(circle at 78% 22%, rgba(166, 27, 41, .14), transparent 30%),
    linear-gradient(145deg, #fffaf7, #f2dedb);
}

.discover-feed-card figure > i {
  position: absolute;
  top: 7px;
  left: 7px;
  padding: 3px 6px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 6px;
  color: rgba(255, 255, 255, .86);
  background: rgba(48, 26, 28, .16);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  backdrop-filter: blur(6px);
}

.discover-play {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(52, 39, 39, .42);
  backdrop-filter: blur(8px);
}

.discover-play::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 9px;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 11px solid #fff;
}

.discover-feed-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 46px;
  padding: 8px 10px 9px;
}

.discover-feed-meta > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.discover-feed-meta strong {
  overflow: hidden;
  color: var(--zhiyi-ink);
  font-size: 13.5px;
  font-weight: 900;
  line-height: 1.22;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.discover-feed-meta small {
  overflow: hidden;
  color: rgba(82, 28, 35, .56);
  font-size: 10.5px;
  font-weight: 750;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.discover-feed-meta span {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 999px;
  color: rgba(82, 28, 35, .72);
  background: rgba(255, 244, 241, .95);
  box-shadow: inset 0 0 0 1px rgba(166, 27, 41, .08);
  font-size: 10.5px;
  font-weight: 850;
}

.bottom-nav {
  grid-template-columns: repeat(5, 1fr);
  max-width: 540px;
}

.bottom-nav-item {
  min-height: 54px;
  gap: 3px;
  padding: 4px 2px;
  font-size: 10px;
}

.nav-icon {
  width: 20px;
  height: 20px;
}

.discover-icon::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.discover-icon::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 5px;
  width: 3px;
  height: 10px;
  border-radius: 99px;
  background: currentColor;
  transform: rotate(35deg);
}

/* Workflow ZIP import assistant */
.quick-workflow-import {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid rgba(166, 27, 41, 0.18);
  border-radius: 20px;
  background:
    radial-gradient(circle at 92% 8%, rgba(166, 27, 41, 0.1), transparent 32%),
    linear-gradient(145deg, rgba(255,255,255,0.95), rgba(247,236,231,0.78));
}

.quick-workflow-import label {
  display: grid;
  gap: 7px;
  color: #5c1b26;
  font-weight: 850;
}

.quick-workflow-import input,
.quick-workflow-import select,
.quick-workflow-import textarea {
  width: 100%;
  border: 1px solid rgba(166, 27, 41, 0.2);
  border-radius: 12px;
  background: rgba(255,255,255,0.86);
  color: #1d0f13;
  font: inherit;
  font-weight: 750;
  padding: 11px 12px;
}

.quick-workflow-import textarea {
  min-height: 122px;
  resize: vertical;
  line-height: 1.55;
}

.quick-workflow-prompt {
  grid-column: 1 / -1;
}

.quick-workflow-import .wide-btn {
  grid-column: 1 / -1;
  min-height: 48px;
}

.quick-workflow-discover-note {
  grid-column: 1 / -1;
  margin: -2px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(166, 27, 41, .14);
  border-radius: 14px;
  color: #6a1b28;
  background: rgba(255, 255, 255, .62);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.55;
}

.workflow-import-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 2px;
  color: #8c1728;
  font-weight: 900;
}

.workflow-import-divider::before,
.workflow-import-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: rgba(166, 27, 41, 0.16);
}

.workflow-import-panel {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(280px, 1.1fr);
  gap: 14px;
  margin-top: 14px;
}

.workflow-import-drop,
.workflow-import-guide,
.workflow-import-preview {
  border: 1px solid rgba(166, 27, 41, 0.2);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255,255,255,0.92), rgba(247,236,231,0.72));
  padding: 16px;
}

.workflow-import-drop {
  display: grid;
  gap: 10px;
  align-content: center;
}

.workflow-import-drop input {
  border: 1px dashed rgba(166, 27, 41, 0.38);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255,255,255,0.82);
}

.workflow-import-drop strong,
.workflow-import-guide strong {
  color: #7c1020;
  font-size: 18px;
}

.workflow-import-drop span {
  color: #6a4449;
  line-height: 1.6;
}

.workflow-import-guide.collapsed pre {
  display: none;
}

.workflow-import-guide pre {
  margin: 10px 0 0;
  white-space: pre-wrap;
  color: #6a1b28;
  font: 600 13px/1.7 Consolas, "Microsoft YaHei", sans-serif;
}

.workflow-import-guide-tree {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.workflow-import-guide-tree p {
  margin: 0;
  color: #4b1018;
  font-weight: 950;
}

.workflow-import-guide-section {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid rgba(166, 27, 41, .12);
  border-radius: 14px;
  background: rgba(255, 255, 255, .58);
}

.workflow-import-guide-section span {
  color: #8c1728;
  font-size: 13px;
  font-weight: 950;
}

.workflow-import-guide-section pre {
  margin: 0;
  color: #6a1b28;
  font: 650 12px/1.62 Consolas, "Microsoft YaHei", sans-serif;
}

.workflow-import-guide-tree small {
  color: #6a4449;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.55;
}

.workflow-import-preview {
  margin-top: 14px;
}

.workflow-import-warnings {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.workflow-import-warnings span {
  border-radius: 999px;
  background: rgba(166, 27, 41, 0.08);
  color: #8c1728;
  padding: 7px 10px;
  font-weight: 700;
}

.workflow-import-table {
  display: grid;
  gap: 6px;
}

.workflow-import-row {
  display: grid;
  grid-template-columns: 80px 110px 140px minmax(220px, 1fr) 160px;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(166, 27, 41, 0.12);
  border-radius: 12px;
  background: rgba(255,255,255,0.72);
  padding: 10px 12px;
}

.workflow-import-row.head {
  color: #7c1020;
  font-weight: 800;
  background: rgba(166, 27, 41, 0.07);
}

.workflow-import-row span {
  color: #6a4449;
}

.workflow-import-row strong {
  color: #1d0f13;
}

@media (max-width: 760px) {
  .workflow-import-panel,
  .workflow-import-row,
  .quick-workflow-import {
    grid-template-columns: 1fr;
  }
}

/* Zhiyi student workflow surface polish */
.quick-workflow-grid {
  gap: 11px;
}

.quick-workflow-card,
.quick-workflow-card:nth-child(2),
.quick-workflow-card:nth-child(3) {
  border-color: rgba(166, 27, 41, .14);
  background:
    radial-gradient(circle at 80% 26%, rgba(166, 27, 41, .10), transparent 34%),
    linear-gradient(154deg, rgba(255, 253, 251, .98) 0%, rgba(250, 239, 236, .94) 58%, rgba(245, 225, 222, .88) 100%);
  box-shadow: 0 10px 26px rgba(82, 28, 35, .065), inset 0 1px 0 rgba(255, 255, 255, .86);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.quick-workflow-card::before {
  display: block;
  inset: auto -22px -28px auto;
  width: 82px;
  height: 82px;
  border: 13px solid rgba(166, 27, 41, .045);
  border-radius: 999px;
  background: transparent;
}

.quick-workflow-card span {
  background: rgba(250, 225, 224, .88);
}

.quick-workflow-card:hover,
.quick-workflow-card:focus-visible,
.category-item:hover,
.category-item:focus-visible,
.discover-feed-card:hover,
.discover-feed-card:focus-visible {
  border-color: rgba(166, 27, 41, .24);
  box-shadow: 0 16px 34px rgba(82, 28, 35, .10), inset 0 1px 0 rgba(255, 255, 255, .86);
  transform: translateY(-1px);
}

.category-grid,
.discover-quick-grid {
  gap: 13px;
}

.category-item,
.discover-feed-card,
.image-group-card,
.more-group-card {
  border-color: rgba(166, 27, 41, .13);
  background: linear-gradient(160deg, rgba(255, 253, 251, .96), rgba(249, 236, 233, .88));
  box-shadow: 0 10px 28px rgba(82, 28, 35, .065);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.category-thumb,
.category-video,
.category-image,
.discover-feed-card figure {
  border-radius: 14px;
}

.discover-feed-card {
  background: linear-gradient(180deg, rgba(255, 253, 251, .98), rgba(248, 235, 232, .9));
}

.discover-feed-meta {
  background: linear-gradient(180deg, rgba(255, 255, 255, .78), rgba(250, 240, 237, .78));
}

.upload-box {
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.upload-box.has-preview {
  border-color: rgba(166, 27, 41, .18);
  background: rgba(255, 252, 250, .92);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .58);
}
/* Multi outfit workflow */
.multi-outfit-panel {
  display: grid;
  gap: 14px;
  margin: 16px 0;
}

.compact-step-title {
  margin-bottom: 0;
}

.multi-outfit-upload {
  min-height: 128px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255,255,255,.92), rgba(247,236,231,.82));
}

.multi-outfit-upload small {
  display: block;
  margin-top: 8px;
  color: rgba(79, 34, 38, .62);
  font-weight: 700;
}

.multi-outfit-preview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.multi-outfit-thumb {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1px solid rgba(166, 27, 41, .16);
  border-radius: 14px;
  background: rgba(255,255,255,.68);
}

.multi-outfit-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.multi-outfit-thumb span,
.multi-outfit-thumb button {
  position: absolute;
  top: 8px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.multi-outfit-thumb span {
  left: 8px;
  color: #a61b29;
  background: rgba(255,255,255,.86);
}

.multi-outfit-thumb button {
  right: 8px;
  color: #fff;
  background: rgba(70, 30, 34, .72);
}

.multi-outfit-settings {
  grid-template-columns: 1fr 1fr;
}

.check-row {
  flex-direction: row !important;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: #a61b29;
}

.multi-result-main,
.multi-result-segments,
.multi-result-images {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.multi-result-main video,
.multi-result-segments video {
  width: 100%;
  border-radius: 16px;
  background: #1b1113;
}

.multi-result-main a,
.multi-result-segments a {
  display: inline-flex;
  justify-content: center;
  padding: 11px 14px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #a61b29, #c84d5b);
  font-weight: 900;
  text-decoration: none;
}

.multi-result-images {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.multi-result-images figure {
  margin: 0;
  overflow: hidden;
  border-radius: 14px;
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(166, 27, 41, .12);
}

.multi-result-images img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
}

.multi-result-images figcaption,
.multi-result-segments span {
  padding: 8px 10px;
  color: #5b252b;
  font-weight: 900;
}

.multi-result-segments article {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 16px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(166, 27, 41, .12);
}

.generated-assets-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (min-width: 560px) {
  .generated-assets-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.generated-assets-grid .generated-asset-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  gap: 7px;
  min-width: 0;
  padding: 7px;
  border-radius: 16px;
  border: 1px solid rgba(166, 27, 41, .14);
  background:
    radial-gradient(circle at 82% 18%, rgba(166, 27, 41, .10), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(255, 246, 244, .88));
  box-shadow: 0 12px 26px rgba(73, 24, 31, .08);
  cursor: pointer;
}

.generated-assets-grid .generated-asset-card:focus-visible {
  outline: 3px solid rgba(166, 27, 41, .22);
  outline-offset: 2px;
}

.generated-assets-grid .generated-asset-card img,
.generated-assets-grid .generated-asset-card video,
.generated-assets-grid .asset-placeholder {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  object-fit: cover;
}

.generated-assets-grid .generated-asset-card > div {
  gap: 3px;
}

.generated-assets-grid .generated-asset-card strong {
  overflow: hidden;
  color: #2b1115;
  font-size: 13px;
  font-weight: 950;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.generated-assets-grid .generated-asset-card span,
.generated-assets-grid .generated-asset-card small {
  overflow: hidden;
  color: #7b6063;
  font-size: 10px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.generated-assets-grid .asset-card-status {
  justify-self: start;
  max-width: 100%;
  padding: 3px 7px;
  border-radius: 999px;
  color: #8f1426;
  background: rgba(166, 27, 41, .08);
  font-size: 10px;
  font-weight: 950;
}

.generated-assets-grid .asset-card-actions {
  position: absolute;
  top: 9px;
  right: 9px;
  display: none !important;
  gap: 5px;
  margin: 0;
}

.generated-assets-grid .asset-favorite-btn,
.generated-assets-grid .asset-retry-btn,
.generated-assets-grid .generated-asset-card a {
  min-height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 8px 18px rgba(55, 18, 23, .12);
}

.generated-assets-grid .asset-favorite-btn {
  width: 28px;
}

.generated-assets-grid .asset-retry-btn,
.generated-assets-grid .generated-asset-card a {
  display: none;
}

.asset-preview-modal[hidden] {
  display: none;
}

.asset-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  align-items: end;
  justify-items: center;
  padding: 18px 12px calc(92px + env(safe-area-inset-bottom));
}

.asset-preview-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(43, 17, 21, .26);
  opacity: 0;
  transition: opacity .18s ease;
}

.asset-preview-sheet {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  max-height: min(78vh, 760px);
  overflow: auto;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(166, 27, 41, .15);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(255, 246, 244, .96));
  box-shadow: 0 24px 70px rgba(68, 20, 27, .20);
  transform: translateY(18px);
  opacity: 0;
  transition: transform .18s ease, opacity .18s ease;
}

.asset-preview-modal.show .asset-preview-backdrop,
.asset-preview-modal.show .asset-preview-sheet {
  opacity: 1;
}

.asset-preview-modal.show .asset-preview-sheet {
  transform: translateY(0);
}

.asset-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.asset-preview-head h2 {
  margin: 2px 0 0;
  color: #1f1013;
  font-size: 20px;
  font-weight: 950;
}

.asset-preview-media {
  display: grid;
  place-items: center;
  min-height: 180px;
  overflow: hidden;
  border-radius: 18px;
  background: rgba(255, 236, 232, .72);
}

.asset-preview-media img,
.asset-preview-media video {
  display: block;
  width: 100%;
  max-height: 54vh;
  object-fit: contain;
}

.asset-preview-placeholder {
  min-height: 180px;
  display: grid;
  place-items: center;
  color: #a61b29;
  font-weight: 950;
}

.asset-preview-meta {
  display: grid;
  gap: 5px;
}

.asset-preview-meta span {
  color: #a61b29;
  font-weight: 950;
}

.asset-preview-meta small,
.asset-preview-meta p {
  margin: 0;
  color: #765d61;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

body {
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: -18%;
  z-index: 0;
  pointer-events: none;
}

body::before {
  opacity: .42;
  background:
    repeating-linear-gradient(112deg, rgba(166, 27, 41, .035) 0 1px, transparent 1px 18px),
    repeating-linear-gradient(28deg, rgba(255, 255, 255, .30) 0 1px, transparent 1px 24px);
  transform: translate3d(-1.5%, -1%, 0);
  animation: zhiyiAmbientDrift 28s cubic-bezier(0.25, 1, 0.5, 1) infinite alternate;
}

body::after {
  opacity: .36;
  background:
    linear-gradient(118deg, transparent 8%, rgba(255, 255, 255, .42) 26%, transparent 44%),
    linear-gradient(62deg, transparent 18%, rgba(166, 27, 41, .055) 45%, transparent 72%);
  transform: translate3d(2%, 1%, 0);
  animation: zhiyiAmbientSheen 34s cubic-bezier(0.22, 1, 0.36, 1) infinite alternate;
}

#loginScreen,
#appShell {
  position: relative;
  z-index: 1;
}

@keyframes zhiyiAmbientDrift {
  from {
    transform: translate3d(-1.5%, -1%, 0) rotate(.001deg);
  }
  to {
    transform: translate3d(1.8%, 1.2%, 0) rotate(.001deg);
  }
}

@keyframes zhiyiAmbientSheen {
  from {
    transform: translate3d(2%, 1%, 0) scale(1);
  }
  to {
    transform: translate3d(-2%, -1.4%, 0) scale(1.03);
  }
}

@media (prefers-reduced-motion: reduce) {
  body::before,
  body::after {
    animation: none;
    transform: none;
  }
}

/* Product smart generator */
.product-generator-panel {
  display: grid;
  gap: 16px;
  background:
    radial-gradient(circle at 88% 8%, rgba(166, 27, 41, .12), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(253, 244, 241, .92));
}

.product-generator-hero {
  padding: 18px;
  border: 1px solid rgba(166, 27, 41, .16);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(166, 27, 41, .96), rgba(247, 236, 231, .92));
  color: #fff;
  box-shadow: 0 18px 38px rgba(166, 27, 41, .18);
}

.product-generator-hero span,
.product-generator-hero p {
  display: block;
  margin: 0;
  font-size: 13px;
  font-weight: 850;
  opacity: .88;
}

.product-generator-hero strong {
  display: block;
  margin: 6px 0;
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: 0;
}

.product-upload-box {
  min-height: 180px;
}

.product-upload-box small,
.product-prompt-label {
  color: #765d61;
  font-size: 13px;
  font-weight: 800;
}

.product-type-grid,
.product-template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.product-choice,
.product-template-card {
  border: 1px solid rgba(166, 27, 41, .18);
  border-radius: 16px;
  padding: 13px;
  text-align: left;
  color: #230b10;
  background:
    radial-gradient(circle at 88% 22%, rgba(166, 27, 41, .10), transparent 34%),
    rgba(255, 250, 247, .88);
  box-shadow: 0 10px 24px rgba(97, 36, 39, .07);
}

.product-choice.active,
.product-template-card.active {
  border-color: rgba(166, 27, 41, .72);
  background:
    radial-gradient(circle at 92% 18%, rgba(255, 255, 255, .26), transparent 30%),
    linear-gradient(135deg, #a61b29, #c95e66);
  color: #fff;
}

.product-choice strong,
.product-template-card span {
  display: block;
  font-size: 15px;
  font-weight: 950;
}

.product-choice small,
.product-template-card small {
  display: block;
  margin-top: 5px;
  color: inherit;
  opacity: .75;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 800;
}

.product-template-card strong {
  display: inline-flex;
  margin-top: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .55);
  color: #a61b29;
  font-size: 12px;
  font-weight: 950;
}

.product-template-card.active strong {
  background: rgba(255, 255, 255, .18);
  color: #fff;
}

.product-prompt-label {
  display: grid;
  gap: 8px;
}

.product-prompt-label textarea {
  width: 100%;
  min-height: 118px;
  border: 1px solid rgba(166, 27, 41, .18);
  border-radius: 16px;
  padding: 13px;
  color: #230b10;
  background: rgba(255, 250, 247, .9);
  resize: vertical;
}

/* Deferred login: keep the public app visible and present authentication as a modal. */
.login-screen {
  position: fixed;
  z-index: 1000;
  inset: 0;
  min-height: 0;
  overflow: hidden;
  background: transparent;
}

.login-screen::before {
  display: none;
}

.login-backdrop {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(45, 20, 24, .42);
  backdrop-filter: blur(9px);
}

.login-panel {
  position: relative;
  z-index: 1;
  max-height: calc(100dvh - 28px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.login-close {
  z-index: 3;
}

.remember-login-row {
  display: grid !important;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 11px !important;
  min-height: 48px;
  padding: 8px 2px;
  cursor: pointer;
}

.remember-login-row input {
  width: 20px !important;
  height: 20px !important;
  margin: 0;
  accent-color: #8f1624;
}

.remember-login-row input:focus-visible {
  outline: 3px solid rgba(143, 22, 36, .24);
  outline-offset: 3px;
}

.remember-login-row span {
  display: grid;
  gap: 2px;
}

.remember-login-row strong {
  color: #351015;
  font-size: 14px;
}

.remember-login-row small {
  color: #7a6064;
  font-size: 12px;
  line-height: 1.45;
}

/* 2026-07-20 product audit: consistent, trustworthy media and empty states. */
.bottom-nav-item.active {
  border-color: transparent !important;
  outline: 0 !important;
  box-shadow: none !important;
  color: #8f1624 !important;
  background: #f3e1df !important;
}

.clothing-suite-hero {
  border-color: rgba(166, 27, 41, .16);
  background: linear-gradient(135deg, #fffdfc 0%, #f5e4e2 100%);
}

.clothing-suite-hero::after {
  border-color: rgba(166, 27, 41, .08);
}

.suite-output-card.active,
.suite-template-card.active,
.suite-audience-tabs button.active {
  border-color: rgba(166, 27, 41, .46);
  background: #f7e7e5;
  box-shadow: inset 0 0 0 1px rgba(166, 27, 41, .12);
}

.discover-feed-meta > span {
  flex: 0 0 auto;
  color: #8f1624;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.workflow-media-fallback {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  align-content: center;
  gap: 7px;
  background: linear-gradient(155deg, #fffdfc, #f3e1df);
  color: #8f1624;
}

.workflow-media-fallback img {
  width: 42px !important;
  height: 42px !important;
  object-fit: contain !important;
  opacity: .82;
}

.workflow-media-fallback span {
  font-size: 12px;
  font-weight: 900;
}

.community-empty-state {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-height: 240px;
  padding: 42px 28px;
  border: 1px solid rgba(166, 27, 41, .13);
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 24%, rgba(166, 27, 41, .08), transparent 34%),
    rgba(255, 253, 252, .88);
  text-align: center;
  box-shadow: 0 16px 38px rgba(82, 28, 35, .08);
}

.community-empty-state strong {
  color: #2b1115;
  font-size: 19px;
}

.community-empty-state p {
  max-width: 260px;
  color: #786267;
  font-size: 13px;
  line-height: 1.6;
}

.community-empty-state button {
  margin-top: 6px;
  padding: 11px 18px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: #a61b29;
  font-weight: 900;
}

.tab-page {
  padding-bottom: calc(104px + env(safe-area-inset-bottom));
}

/* Zhiyi student desktop workstation */
.desktop-nav-brand,
.desktop-nav-account {
  display: none;
}

/* Temporarily disabled: remove the impossible max-width clause to restore the
   student desktop workstation. Admin pages are unaffected. */
@media (min-width: 1024px) and (max-width: 0px) {
  body {
    background:
      linear-gradient(135deg, rgba(166, 27, 41, .025), transparent 34%),
      #f7f6f6;
  }

  .app-shell {
    width: min(calc(100% - 48px), 1440px);
    max-width: none;
    min-height: 100dvh;
    margin: 0 auto;
    padding: 24px 0 48px;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    align-items: start;
    gap: 32px;
  }

  .tab-page {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    padding: 0 0 48px;
  }

  .tab-page.active {
    display: block;
  }

  .bottom-nav {
    position: sticky;
    inset: 24px auto auto;
    grid-column: 1;
    grid-row: 1;
    width: 220px;
    max-width: none;
    height: calc(100dvh - 48px);
    min-height: 620px;
    margin: 0;
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
    border: 1px solid rgba(126, 20, 33, .1);
    border-radius: 18px;
    background: rgba(255, 253, 252, .96);
    box-shadow: 0 18px 52px rgba(64, 32, 38, .09);
    transform: none;
    backdrop-filter: blur(18px);
  }

  .desktop-nav-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 0 2px 18px;
    padding: 4px 4px 18px;
    border-bottom: 1px solid rgba(126, 20, 33, .1);
  }

  .desktop-nav-brand > span {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(166, 27, 41, .12);
    border-radius: 12px;
    background: #fff;
  }

  .desktop-nav-brand img {
    width: 34px;
    height: 34px;
    object-fit: contain;
  }

  .desktop-nav-brand div,
  .desktop-nav-account div {
    min-width: 0;
    display: grid;
    gap: 2px;
  }

  .desktop-nav-brand strong {
    color: var(--zhiyi-ink);
    font-size: 16px;
    line-height: 1.2;
  }

  .desktop-nav-brand small,
  .desktop-nav-account small {
    overflow: hidden;
    color: var(--zhiyi-muted);
    font-size: 11px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .bottom-nav-item {
    width: 100%;
    min-height: 48px;
    padding: 0 13px;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    border-radius: 11px;
    font-size: 13px;
  }

  .bottom-nav-item .nav-icon {
    width: 21px;
    height: 21px;
  }

  .bottom-nav-item:hover {
    color: var(--zhiyi-red-dark);
    background: rgba(243, 225, 223, .58);
  }

  .bottom-nav-item.active {
    color: #fff !important;
    background: var(--zhiyi-red) !important;
  }

  .desktop-nav-account {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding: 13px 10px;
    border: 1px solid rgba(126, 20, 33, .09);
    border-radius: 12px;
    background: #f8eeec;
  }

  .desktop-nav-account > span {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--zhiyi-red);
    font-size: 13px;
    font-weight: 900;
  }

  .desktop-nav-account strong {
    color: var(--zhiyi-ink);
    font-size: 12px;
  }

  .compact-topbar,
  .simple-topbar {
    min-height: 68px;
    margin-bottom: 14px;
    padding: 4px 2px 14px;
    align-items: center;
    border-bottom: 1px solid rgba(126, 20, 33, .09);
  }

  .compact-topbar .brand-lockup.compact span {
    width: 40px;
    height: 40px;
  }

  .compact-topbar .brand-lockup strong {
    font-size: 18px;
  }

  .compact-topbar .eyebrow {
    margin-left: 49px;
  }

  .home-search {
    width: 300px;
  }

  .home-search input {
    min-height: 42px;
  }

  .home-carousel {
    grid-auto-columns: minmax(460px, 54%);
    gap: 14px;
    margin-bottom: 18px;
    padding-bottom: 5px;
  }

  .carousel-slide {
    aspect-ratio: 16 / 6;
    border-radius: 16px;
  }

  .quick-workflow-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
  }

  .quick-workflow-card,
  .quick-workflow-card:nth-child(2),
  .quick-workflow-card:nth-child(3) {
    min-height: 118px;
    padding: 16px;
  }

  .quick-workflow-card strong {
    font-size: 15px;
  }

  .quick-workflow-card small {
    font-size: 11px;
  }

  .home-mode-grid {
    top: 16px;
    width: fit-content;
    grid-template-columns: repeat(3, 150px);
    justify-content: start;
    margin-bottom: 18px;
  }

  .category-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
  }

  .category-item.has-media,
  .category-item.has-video {
    aspect-ratio: 3 / 4;
  }

  .image-group-card,
  .more-group-card {
    min-height: 148px;
  }

  .discover-grid {
    justify-content: flex-start;
    overflow: visible;
    flex-wrap: wrap;
  }

  .discover-quick-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
  }

  .community-feed {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
  }

  .generated-assets-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
  }

  .asset-tabs {
    width: fit-content;
    grid-template-columns: repeat(4, minmax(130px, 1fr));
  }

  #workflowDetail .panel,
  #toolDetail .panel,
  #workflowDetail .result-panel,
  #toolDetail .result-panel {
    max-width: none;
  }

  #workflowDetail .upload-grid,
  #workflowDetail .dual-upload {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .workflow-sample-panel {
    width: min(100%, 720px);
    margin-inline: auto;
  }

  .profile-page,
  .tools-page,
  .community-page,
  .discover-page {
    max-width: none;
  }

  .profile-card,
  .credit-card,
  .profile-actions,
  .invite-card {
    max-width: 900px;
  }

  .community-fab {
    right: max(32px, calc((100vw - 1440px) / 2 + 32px));
    bottom: 28px;
  }

  .login-panel {
    width: min(430px, calc(100% - 40px));
  }
}

/* Foolproof workflow UX: recoverable filters and clear disabled states. */
.home-media-filter button:disabled {
  color: var(--muted);
  background: var(--surface-soft);
  cursor: not-allowed;
  opacity: .58;
}

.home-empty-state {
  justify-items: center;
  gap: 8px;
  text-align: center;
}

.home-empty-state strong,
.home-empty-state span {
  display: block;
}

.home-empty-state span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.home-empty-state button {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid color-mix(in oklch, var(--accent) 30%, var(--line));
  border-radius: 8px;
  color: var(--accent-strong);
  background: var(--surface);
  font-weight: 700;
}

.generation-options-panel {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid color-mix(in oklch, var(--primary) 24%, var(--line));
  border-radius: 8px;
  background: color-mix(in oklch, var(--primary-soft) 45%, var(--surface));
}

.fixed-video-action-panel {
  display: flex;
  gap: 14px;
  align-items: stretch;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid color-mix(in oklch, var(--accent) 24%, var(--line));
  border-radius: 8px;
  background: color-mix(in oklch, var(--surface) 86%, var(--accent) 4%);
}

.fixed-video-action-panel[hidden] {
  display: none;
}

.fixed-video-action-panel video {
  width: 92px;
  min-height: 152px;
  flex: 0 0 92px;
  border-radius: 8px;
  background: var(--ink);
  object-fit: cover;
}

.fixed-video-action-copy {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 8px;
  align-content: center;
}

.fixed-video-action-heading {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.fixed-video-action-heading span,
.fixed-video-action-camera span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.fixed-video-action-heading h2 {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.35;
  text-wrap: balance;
}

.fixed-video-action-heading > strong {
  min-width: max-content;
  padding: 5px 8px;
  border-radius: 8px;
  color: var(--accent-strong);
  background: color-mix(in oklch, var(--accent) 10%, var(--surface));
  font-size: 12px;
}

.fixed-video-action-copy > p,
.fixed-video-action-camera p,
.fixed-video-action-copy > small {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.fixed-video-action-camera {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.fixed-video-action-camera p {
  margin-top: 3px;
}

.fixed-video-action-copy > small {
  color: var(--primary-ink);
  font-size: 12px;
}

.generation-options-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.generation-options-heading strong {
  color: var(--primary-ink);
  font-size: 15px;
}

.generation-options-heading small {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.generation-options-panel .generation-settings {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-top: 0;
}

.generation-options-panel select {
  min-width: 0;
}

.tryon-background-panel {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid color-mix(in oklch, var(--primary) 18%, var(--line));
}

.tryon-background-panel[hidden],
.tryon-background-settings > [hidden] {
  display: none;
}

.tryon-background-heading strong,
.tryon-background-heading small {
  display: block;
}

.tryon-background-heading strong {
  color: var(--ink);
  font-size: 14px;
}

.tryon-background-heading small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.generation-options-panel .tryon-background-settings {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding-top: 0;
}

.tryon-background-description {
  grid-column: 1 / -1;
}

.tryon-background-description input {
  width: 100%;
}

.workflow-advanced {
  margin-top: 12px;
  border-top: 1px solid var(--line);
}

.workflow-advanced > summary {
  min-height: 44px;
  padding: 12px 2px;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}

.workflow-advanced-body {
  display: grid;
  gap: 14px;
  padding: 0 0 12px;
}

.workflow-prompt-step {
  margin: 0;
}

@media (max-width: 360px) {
  .fixed-video-action-panel {
    align-items: start;
    flex-direction: column;
  }

  .fixed-video-action-panel video {
    width: 100%;
    min-height: 190px;
    flex-basis: auto;
    aspect-ratio: 9 / 16;
  }
  .generation-options-panel .generation-settings {
    grid-template-columns: 1fr 1fr;
  }

  .generation-options-panel .tryon-background-settings {
    grid-template-columns: 1fr;
  }

  .tryon-background-description {
    grid-column: auto;
  }

  .generation-options-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .generation-options-heading small {
    text-align: left;
  }
}

.generation-promise {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 13px;
  line-height: 1.55;
}

.detail-view-open .bottom-nav {
  display: none;
}

.detail-view-open .app-shell {
  padding-bottom: calc(28px + env(safe-area-inset-bottom));
}

.field-feedback,
.field-error {
  min-height: 0;
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.5;
}

.field-feedback:empty,
.field-error:empty {
  display: none;
}

.upload-pass + .field-feedback,
.upload-pass ~ .field-feedback {
  color: var(--primary);
}

.upload-warning + .field-feedback,
.upload-warning ~ .field-feedback {
  color: var(--accent-strong);
}

.upload-blocking + .field-feedback,
.upload-blocking ~ .field-feedback,
.field-error {
  color: var(--danger);
}

.upload-blocking {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 2px color-mix(in oklch, var(--danger) 12%, transparent);
}

.generated-asset-meta {
  display: grid;
  gap: 3px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  font-size: 13px;
  line-height: 1.45;
}

.generated-asset-meta strong {
  color: var(--text);
}

.generated-asset-meta span {
  color: var(--muted);
}

.asset-load-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 14px;
  padding: 13px 14px;
  border: 1px solid rgba(118, 103, 83, 0.16);
  border-radius: 14px;
  background: rgba(255, 252, 247, 0.92);
  color: #5f574c;
  font-size: 13px;
}

.asset-load-failed {
  border-color: rgba(178, 78, 61, 0.2);
  color: #8b3f33;
}

.asset-load-state .asset-retry-btn {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: inherit;
}

.wechat-image-preview[hidden] {
  display: none !important;
}

.wechat-image-preview {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #11100f;
  color: #fff;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}

.wechat-image-preview-head,
.wechat-image-preview-foot {
  position: relative;
  z-index: 2;
  padding: 12px 16px;
  background: rgba(17, 16, 15, 0.96);
}

.wechat-image-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.wechat-image-preview-head button,
.wechat-image-preview-nav button {
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.wechat-image-preview-stage {
  min-height: 0;
  overflow: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 14px 12px;
  -webkit-overflow-scrolling: touch;
}

#wechatImagePreviewImg {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  flex: 0 0 auto;
  pointer-events: auto;
  -webkit-touch-callout: default;
  -webkit-user-select: auto;
  user-select: auto;
}

.wechat-image-preview-foot {
  text-align: center;
}

.wechat-image-preview-foot p {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.wechat-image-preview-foot small {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.68);
}

.wechat-image-preview-nav {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
}

.wechat-image-preview-nav button:disabled {
  opacity: 0.36;
}

html.wechat-image-preview-open,
html.wechat-image-preview-open body {
  overflow: hidden;
}

.generated-assets-grid .asset-card-actions.asset-visible-actions {
  position: static;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 2px 0 0;
}

.generated-assets-grid .asset-card-actions.asset-visible-actions button,
.generated-assets-grid .asset-card-actions.asset-visible-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 32px;
  padding: 0 7px;
  border: 1px solid rgba(143, 20, 38, 0.2);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.9);
  color: #7f1727;
  box-shadow: none;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.design-workflow-panel {
  display: grid;
  gap: 16px;
  margin-top: 18px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.design-analysis-row,
.design-output-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.design-analysis-row h2 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  text-wrap: balance;
}

.design-analysis-row p,
.design-analysis-summary {
  max-width: 65ch;
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.6;
  text-wrap: pretty;
}

.design-analysis-row .secondary-btn {
  min-width: 120px;
  min-height: 44px;
  flex: 0 0 auto;
}

.design-copy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.design-copy-grid label,
.design-output-row label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: .88rem;
  font-weight: 650;
}

.design-copy-grid label.wide {
  grid-column: 1 / -1;
}

.design-copy-grid input,
.design-output-row select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 500;
}

.design-copy-grid input:focus,
.design-output-row select:focus {
  border-color: var(--primary);
  outline: 3px solid color-mix(in oklch, var(--primary) 20%, transparent);
  outline-offset: 1px;
}

.design-output-row {
  align-items: end;
}

.design-output-row > label {
  width: min(150px, 42%);
}

.design-output-row > div {
  display: grid;
  gap: 6px;
  text-align: right;
}

.design-output-row span {
  color: var(--muted);
  font-size: .82rem;
}

.design-output-row strong {
  font-size: .92rem;
}

.design-confirm-row {
  min-height: 44px;
  align-items: center;
  line-height: 1.45;
}

.design-confirm-row input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

#designGenerateBtn:disabled {
  cursor: not-allowed;
  opacity: .55;
}

@media (max-width: 380px) {
  .design-analysis-row {
    align-items: stretch;
    flex-direction: column;
  }

  .design-analysis-row .secondary-btn {
    width: 100%;
  }

  .design-copy-grid {
    grid-template-columns: 1fr;
  }

  .design-copy-grid label.wide {
    grid-column: auto;
  }
}

/* Five-entry student shortcut rail */
.quick-workflow-shell {
  position: relative;
  min-width: 0;
  margin-bottom: 14px;
}

.quick-workflow-grid {
  display: flex;
  gap: 11px;
  overflow-x: auto;
  margin-bottom: 0;
  padding: 2px 1px 8px;
  scroll-padding-inline: 1px;
  scroll-snap-type: x mandatory;
  overscroll-behavior-inline: contain;
}

.quick-workflow-card,
.quick-workflow-card:nth-child(2),
.quick-workflow-card:nth-child(3) {
  flex: 0 0 calc((100% - 22px) / 2.45);
  min-width: 0;
  scroll-snap-align: start;
}

.quick-workflow-arrow {
  display: none;
}

@media (min-width: 761px) {
  .quick-workflow-shell {
    padding-inline: 46px;
    margin-bottom: 18px;
  }

  .quick-workflow-grid {
    gap: 14px;
    padding-block: 4px 10px;
    scroll-padding-inline: 0;
  }

  .quick-workflow-card,
  .quick-workflow-card:nth-child(2),
  .quick-workflow-card:nth-child(3) {
    flex-basis: clamp(220px, 28%, 292px);
    min-height: 118px;
    padding: 16px;
  }

  .quick-workflow-arrow {
    position: absolute;
    z-index: 2;
    top: 50%;
    display: grid;
    width: 38px;
    height: 46px;
    place-items: center;
    border: 1px solid color-mix(in oklch, var(--primary) 24%, var(--line));
    border-radius: 8px;
    color: var(--primary-ink);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    font-size: 24px;
    line-height: 1;
    transform: translateY(-58%);
  }

  .quick-workflow-arrow-prev {
    left: 0;
  }

  .quick-workflow-arrow-next {
    right: 0;
  }

  .quick-workflow-arrow:hover,
  .quick-workflow-arrow:focus-visible {
    border-color: color-mix(in oklch, var(--primary) 52%, var(--line));
    outline: 3px solid color-mix(in oklch, var(--primary) 16%, transparent);
    outline-offset: 2px;
  }

  .quick-workflow-arrow:disabled {
    cursor: default;
    opacity: .35;
  }
}

@media (prefers-reduced-motion: reduce) {
  .quick-workflow-grid {
    scroll-behavior: auto;
  }
}

/* 商品一键成套：上传识别 → 确认信息 → 选择提示词 → 设置生成 */
.product-generator-panel {
  gap: 18px;
  background: var(--surface);
}

.product-generator-hero {
  border-color: #72142f;
  border-radius: 12px;
  background: #7d1734;
  box-shadow: 0 12px 28px rgba(74, 14, 34, .16);
}

.product-suite-progress {
  position: sticky;
  z-index: 3;
  top: 8px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in oklch, var(--surface) 96%, transparent);
  box-shadow: var(--shadow-soft);
}

.product-suite-progress button {
  display: grid;
  min-width: 0;
  min-height: 52px;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  text-align: left;
}

.product-suite-progress button span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 800;
}

.product-suite-progress button strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-suite-progress button[aria-current="step"] {
  border-color: color-mix(in oklch, #8b1837 36%, var(--line));
  color: #681229;
  background: #fff1f4;
}

.product-suite-progress button[aria-current="step"] span {
  color: #fff;
  background: #8b1837;
}

.product-suite-progress button:focus-visible,
.product-suite-scheme-card:focus-within,
.product-suite-copy-grid input:focus,
.product-suite-copy-grid select:focus,
.product-suite-output-grid select:focus,
.product-prompt-label textarea:focus {
  outline: 3px solid color-mix(in oklch, #8b1837 22%, transparent);
  outline-offset: 2px;
}

.product-suite-step {
  display: grid;
  gap: 16px;
  padding-top: 4px;
}

.product-suite-step[hidden] {
  display: none;
}

.product-suite-step .step-title {
  align-items: flex-start;
}

.product-suite-step .step-title div {
  display: grid;
  gap: 4px;
}

.product-suite-step .step-title h2,
.product-suite-step .step-title p {
  margin: 0;
}

.product-suite-step .step-title p {
  max-width: 68ch;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.product-suite-notice {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid color-mix(in oklch, var(--primary) 20%, var(--line));
  border-radius: 8px;
  color: var(--primary-ink);
  background: var(--primary-soft);
  font-size: 13px;
  line-height: 1.6;
}

.product-suite-copy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.product-suite-copy-grid label,
.product-suite-output-grid label,
.product-suite-quality {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.product-suite-copy-grid label.wide {
  grid-column: 1 / -1;
}

.product-suite-copy-grid .product-suite-selling-point-hint {
  grid-column: 1 / -1;
  margin: -0.15rem 0 0;
  padding: 0.65rem 0.8rem;
  border-radius: 0.75rem;
  color: #715525;
  background: #fff8e8;
  font-size: 0.82rem;
  line-height: 1.55;
}

.product-suite-copy-grid input,
.product-suite-copy-grid select,
.product-suite-output-grid select,
.product-suite-quality select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
  font-weight: 500;
}

.product-suite-confirm-row {
  min-height: 48px;
  align-items: center;
  line-height: 1.5;
}

.product-suite-confirm-row input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.product-suite-scheme-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.product-suite-scheme-card {
  position: relative;
  display: grid;
  min-width: 0;
  gap: 10px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(30, 47, 57, .06);
  cursor: pointer;
}

.product-suite-scheme-card.is-selected {
  border-color: #8b1837;
  background: #fff5f7;
  box-shadow: 0 0 0 2px rgba(139, 24, 55, .10);
}

.product-suite-scheme-card > input {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 20px;
  height: 20px;
  accent-color: #8b1837;
}

.product-suite-scheme-index {
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  color: #681229;
  background: #ffe8ee;
  font-size: 12px;
  font-weight: 800;
}

.product-suite-scheme-card > strong {
  padding-right: 28px;
  font-size: 16px;
}

.product-suite-scheme-card dl,
.product-suite-scheme-card dl div {
  display: grid;
  gap: 4px;
}

.product-suite-scheme-card dl {
  gap: 9px;
  margin: 0;
}

.product-suite-scheme-card dl div {
  grid-template-columns: 38px minmax(0, 1fr);
}

.product-suite-scheme-card dt,
.product-suite-scheme-card dd {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.product-suite-scheme-card dt {
  color: #681229;
  font-weight: 800;
}

.product-suite-scheme-card dd {
  color: var(--muted);
}

.product-suite-scheme-card details {
  border-top: 1px solid var(--line);
  padding-top: 9px;
}

.product-suite-scheme-card summary {
  min-height: 32px;
  color: #681229;
  font-size: 12px;
  font-weight: 800;
}

.product-suite-scheme-card details p {
  max-height: 180px;
  overflow: auto;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.product-suite-inline-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.product-suite-inline-actions > button {
  min-height: 46px;
}

.product-suite-output-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.product-suite-output-grid fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.product-suite-output-grid fieldset.product-suite-full-detail-settings {
  grid-template-columns: 1fr;
}

.product-suite-output-grid legend {
  padding: 0 6px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
}

.product-suite-output-grid fieldset p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.product-suite-quality {
  grid-column: 1 / -1;
  width: min(280px, 100%);
}

.product-suite-estimate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 16px;
  padding: 13px 15px;
  border: 1px solid #e2c8cf;
  border-radius: 9px;
  color: #5f3e47;
  background: #fff7f9;
  font-size: 13px;
}

.product-suite-estimate strong {
  color: #681229;
  font-size: 15px;
}

.product-suite-result-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.product-suite-download-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

#productSuiteDownloadAllBtn {
  width: auto;
  min-height: 44px;
  padding-inline: 22px;
}

#productSuiteDownloadHint {
  color: var(--muted);
  font-size: 12px;
}

.product-suite-result-card {
  display: grid;
  align-content: start;
  gap: 11px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.product-suite-result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.product-suite-result-head div {
  display: grid;
  gap: 3px;
}

.product-suite-result-head small,
.product-suite-result-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.product-suite-result-head > span {
  flex: 0 0 auto;
  color: var(--primary-ink);
  font-size: 12px;
  font-weight: 800;
}

.product-suite-result-card[data-status="failed"] .product-suite-result-head > span {
  color: var(--danger);
}

.product-suite-result-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  background: var(--surface-soft);
  object-fit: contain;
}

.product-suite-result-card[data-output-type="detail"] img {
  aspect-ratio: 2 / 3;
  object-fit: contain;
}

.product-suite-result-card a {
  display: grid;
  min-height: 44px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: #7d1734;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 720px) {
  .product-suite-progress {
    position: static;
  }

  .product-suite-progress button {
    min-height: 58px;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 3px;
    padding-inline: 4px;
    text-align: center;
  }

  .product-suite-progress button strong {
    max-width: 100%;
    font-size: 11px;
  }

  .product-suite-copy-grid,
  .product-suite-output-grid {
    grid-template-columns: 1fr;
  }

  .product-suite-copy-grid label.wide,
  .product-suite-quality {
    grid-column: auto;
  }

  .product-suite-scheme-list {
    display: grid;
    grid-template-columns: 1fr;
  }

  .product-suite-scheme-card {
    width: 100%;
  }

  .product-suite-inline-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .product-suite-output-grid fieldset {
    grid-template-columns: 1fr;
  }

  .product-suite-output-grid fieldset p {
    grid-column: auto;
  }

  .product-suite-estimate {
    align-items: flex-start;
    flex-direction: column;
  }

  .product-suite-download-actions {
    align-items: stretch;
    flex-direction: column;
  }

  #productSuiteDownloadAllBtn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .product-suite-scheme-list,
  .product-suite-progress {
    scroll-behavior: auto;
  }
}
