:root {
  color-scheme: light;
  --bg: #fafaf7;
  --surface: #ffffff;
  --surface-2: #f3f3ef;
  --surface-3: #ececea;
  --line: rgba(10, 10, 10, 0.08);
  --line-strong: rgba(10, 10, 10, 0.14);
  --text: #0a0a0a;
  --text-2: #1f1f1f;
  --muted: #5a5a5a;
  --muted-2: #8a8a8a;
  --primary: #236f5a;
  --primary-strong: #155440;
  --primary-soft: rgba(35, 111, 90, 0.10);
  --accent: #b43f2e;
  --gold: #b88324;
  --info: #2b5fb5;
  --success: #1f7a55;
  --warning: #b88324;
  --danger: #b43f2e;
  --shadow: 0 8px 24px rgba(10, 10, 10, 0.04);
  --shadow-soft: 0 4px 14px rgba(10, 10, 10, 0.035);
  --shadow-card: 0 2px 8px rgba(10, 10, 10, 0.04);
  --shadow-hover: 0 14px 36px rgba(10, 10, 10, 0.06);
  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --control-height: 40px;
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);
  --grad-signature: linear-gradient(135deg, #0a0a0a 0%, #1a3a2f 45%, #236f5a 100%);
  --grad-soft: linear-gradient(180deg, rgba(35, 111, 90, 0.06) 0%, rgba(35, 111, 90, 0) 80%);
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  font-family: "Inter", "Inter var", "HarmonyOS Sans SC", "MiSans", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11", "ss01";
  font-size: 14px;
  letter-spacing: -0.005em;
}

:root {
  --assistant-stage-width: min(1840px, calc(100vw - 180px));
  --assistant-promo-width: clamp(340px, 18vw, 430px);
  --assistant-gap: clamp(36px, 2.4vw, 58px);
  --assistant-content-width: calc(var(--assistant-stage-width) - var(--assistant-promo-width) - var(--assistant-gap));
  --assistant-chat-height: 700px;
  --assistant-composer-height: 146px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c0e0d;
  --surface: #161816;
  --surface-2: #1c1f1d;
  --surface-3: #262a28;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.12);
  --text: #f1f2ee;
  --text-2: #d8dad5;
  --muted: #9aa39d;
  --muted-2: #6c736e;
  --primary: #65bd9d;
  --primary-strong: #80d3b5;
  --primary-soft: rgba(101, 189, 157, 0.14);
  --accent: #e37b65;
  --gold: #d6a447;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.42);
  --shadow-soft: 0 4px 16px rgba(0, 0, 0, 0.32);
  --shadow-card: 0 2px 10px rgba(0, 0, 0, 0.28);
  --shadow-hover: 0 16px 40px rgba(0, 0, 0, 0.5);
  --grad-signature: linear-gradient(135deg, #050606 0%, #0f231d 45%, #1e5b4a 100%);
  --grad-soft: linear-gradient(180deg, rgba(101, 189, 157, 0.08) 0%, rgba(101, 189, 157, 0) 80%);
}

* {
  box-sizing: border-box;
}

html {
  font-size: clamp(14px, 0.28vw + 13px, 16px);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 0;
  box-shadow: var(--focus-ring);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 108px 1fr;
  transition: grid-template-columns 0.2s ease;
  /* 左侧 108px 持续黑底（sticky sidebar 滚动到底也保持） */
  background: linear-gradient(to right, #0a0a0a 108px, transparent 108px);
}
body.sidebar-collapsed .app-shell { background: none; }

.platform-shell {
  background: #f5f5f7;
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 0 1fr;
}

.sidebar {
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  background: #0a0a0a;
  color: #e4e4e1;
  padding: 22px 10px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 10;
  transition: transform 0.2s var(--ease-out), padding 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}

.sidebar-toggle {
  position: absolute;
  top: 82px;
  right: -13px;
  width: 26px;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 22px rgba(26, 42, 36, 0.08);
  z-index: 20;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.sidebar-toggle:hover {
  background: var(--surface-2);
  border-color: color-mix(in srgb, var(--primary) 36%, var(--line));
  color: var(--primary);
  transform: translateX(1px);
}

.sidebar-toggle span {
  display: block;
  font-size: 24px;
  line-height: 1;
  transform: translateY(-1px);
}

body.sidebar-collapsed .sidebar {
  transform: translateX(-100%);
  padding-left: 0;
  padding-right: 0;
  border-right-color: transparent;
  overflow: visible;
}

body.sidebar-collapsed .sidebar > :not(.sidebar-toggle) {
  display: none;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

body.sidebar-collapsed .sidebar-toggle {
  right: -38px;
}

body.sidebar-collapsed .sidebar-toggle:hover {
  transform: translateX(-1px);
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.brand-home,
.top-brand-home {
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 0;
  cursor: pointer;
}

.brand-home {
  border-radius: 8px;
}

.brand-home:hover,
.top-brand-home:hover {
  opacity: 0.82;
}

.brand-logo {
  width: 54px;
  height: 54px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  padding: 4px;
}

.brand div {
  display: none;
}

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

.nav-item,
.ghost-button,
.primary-button,
.outline-button,
.icon-button,
.mode-tab,
.tag-cloud button,
.quick-prompt {
  border: 1px solid transparent;
  border-radius: 8px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text);
  background: transparent;
}

.nav-item {
  justify-content: center;
  flex-direction: column;
  min-height: 66px;
  padding: 8px 4px;
  color: #8c918e;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0;
  gap: 6px;
  border-radius: 10px;
  transition: background 0.15s var(--ease-out), color 0.15s var(--ease-out);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f1f2ee;
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-item svg,
.top-actions svg,
.tool-title svg,
.composer-tools svg,
.search-wrap svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  justify-items: center;
  gap: 10px;
}

.sidebar-tool {
  position: relative;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #9aa39e;
  display: grid;
  place-items: center;
  transition: background 0.15s var(--ease-out), color 0.15s var(--ease-out);
}

.sidebar-tool:hover {
  color: #f1f2ee;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-tool svg {
  width: 16px;
  height: 16px;
}

.tool-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #ff3b30;
}

.settings-entry {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  min-height: 46px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.settings-entry:hover {
  background: var(--surface-2);
}

.settings-entry svg {
  width: 18px;
  height: 18px;
}

.status-pill {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 20%, transparent);
}

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

.topbar {
  min-height: 64px;
  display: grid;
  grid-template-columns: auto minmax(280px, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.top-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 236px;
}

.top-brand-logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  padding: 4px;
}

.top-brand strong,
.top-brand span {
  display: block;
}

.top-brand strong {
  line-height: 1.2;
}

.top-brand span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.search-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 10px;
  height: 40px;
  transition: background 0.15s var(--ease-out), border-color 0.15s var(--ease-out);
}

.search-wrap:focus-within {
  background: var(--surface);
  border-color: var(--line-strong);
}

.search-wrap svg {
  color: var(--muted-2);
}

.search-wrap input {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  width: 100%;
  font-family: inherit;
  font-size: 13.5px;
}

.search-wrap input::placeholder {
  color: var(--muted-2);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-actions .ghost-button,
.top-actions .primary-button {
  min-height: 38px;
  padding: 0 16px;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.top-actions .ghost-button svg,
.top-actions .primary-button svg {
  width: 16px;
  height: 16px;
}

/* ============ Landing page (minimalist refresh) ============ */
.landing-page {
  --lp-bg: #fafaf7;
  --lp-bg-alt: #ffffff;
  --lp-ink: #0a0a0a;
  --lp-ink-2: #1f1f1f;
  --lp-mute: #5a5a5a;
  --lp-mute-2: #8a8a8a;
  --lp-line: rgba(10, 10, 10, 0.08);
  --lp-line-strong: rgba(10, 10, 10, 0.14);
  --lp-dark: #0a0a0a;
  --lp-dark-ink: #fafaf7;
  min-height: 100vh;
  background: var(--lp-bg);
  color: var(--lp-ink);
  font-family: "Inter", "HarmonyOS Sans SC", "MiSans", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  letter-spacing: -0.005em;
}

.landing-page * {
  box-sizing: border-box;
}

.landing-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 6vw;
  background: rgba(250, 250, 247, 0.86);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--lp-line);
}

.landing-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0;
  color: var(--lp-ink);
}

.landing-logo img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.landing-nav-links {
  display: flex;
  gap: 32px;
  font-size: 14px;
  color: var(--lp-mute);
}

.landing-nav-links a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

.landing-nav-links a:hover {
  color: var(--lp-ink);
}

.landing-enter {
  min-height: auto;
  border: 1px solid var(--lp-ink);
  background: var(--lp-ink);
  color: var(--lp-bg);
  border-radius: 999px;
  padding: 9px 20px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  transition: background 0.18s ease, color 0.18s ease;
}

.landing-enter:hover {
  background: var(--lp-bg);
  color: var(--lp-ink);
}

/* Hero slide */
.landing-slide-primary {
  height: auto;
  min-height: auto;
  cursor: pointer;
  background: var(--lp-bg);
  padding: clamp(80px, 12vh, 160px) 6vw clamp(80px, 14vh, 200px);
  border-bottom: 1px solid var(--lp-line);
  overflow: visible;
}

.landing-slide-primary .landing-copy {
  display: block;
  height: auto;
  min-height: auto;
  text-align: left;
  padding: 0;
  max-width: 1120px;
  margin: 0 auto;
}

.landing-eyebrow {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lp-mute);
  margin: 0 0 28px;
  font-weight: 500;
}

.landing-slide-primary .landing-copy h1 {
  font-size: clamp(44px, 7.2vw, 104px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0 0 28px;
  color: var(--lp-ink);
  text-wrap: balance;
}

.landing-slide-primary .landing-copy p {
  font-size: clamp(17px, 1.7vw, 22px);
  line-height: 1.5;
  color: var(--lp-mute);
  max-width: 720px;
  margin: 0 0 36px;
  font-weight: 400;
}

.landing-hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.landing-hero-cue {
  font-size: 13px;
  color: var(--lp-mute-2);
  letter-spacing: 0.04em;
}

/* Features section */
.landing-features {
  background: var(--lp-bg-alt);
  padding: clamp(80px, 12vh, 160px) 6vw;
  border-bottom: 1px solid var(--lp-line);
}

.landing-section-head {
  max-width: 1120px;
  margin: 0 auto clamp(48px, 7vh, 96px);
}

.landing-section-head h2,
.landing-slide-secondary h2 {
  font-size: clamp(34px, 4.8vw, 64px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.024em;
  margin: 0;
  color: var(--lp-ink);
  text-wrap: balance;
}

.landing-features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  max-width: 1120px;
  margin: 0 auto;
  border-top: 1px solid var(--lp-line-strong);
  border-left: 1px solid var(--lp-line-strong);
}

.landing-feature {
  background: var(--lp-bg-alt);
  padding: clamp(36px, 5vw, 64px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-right: 1px solid var(--lp-line-strong);
  border-bottom: 1px solid var(--lp-line-strong);
}

.landing-feature-no {
  font-family: "JetBrains Mono", "IBM Plex Mono", "SF Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--lp-mute-2);
  margin-bottom: 6px;
}

.landing-feature h3 {
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--lp-ink);
}

.landing-feature p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--lp-mute);
  margin: 0;
}

/* Engines section */
.landing-engines {
  padding: clamp(80px, 10vh, 130px) 6vw;
  text-align: center;
  background: var(--lp-bg);
  border-bottom: 1px solid var(--lp-line);
}

.landing-engines .landing-eyebrow {
  margin: 0 0 28px;
}

.landing-engines-list {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: clamp(28px, 5vw, 64px);
  flex-wrap: wrap;
  font-size: clamp(22px, 3vw, 38px);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--lp-ink-2);
}

.landing-engines-meta {
  font-size: 14px;
  color: var(--lp-mute);
  margin: 0;
}

/* Members CTA (dark inverted block) */
.landing-slide-secondary {
  cursor: pointer;
  background: var(--lp-dark);
  color: var(--lp-dark-ink);
  height: auto;
  min-height: auto;
  padding: clamp(96px, 16vh, 200px) 6vw;
  border-bottom: 1px solid var(--lp-dark);
  overflow: visible;
}

.landing-slide-secondary .landing-copy {
  display: block;
  height: auto;
  min-height: auto;
  text-align: left;
  padding: 0;
  max-width: 1120px;
  margin: 0 auto;
}

.landing-slide-secondary .landing-eyebrow {
  color: rgba(250, 250, 247, 0.6);
}

.landing-slide-secondary h2 {
  color: var(--lp-dark-ink);
  margin-bottom: 28px;
}

.landing-slide-secondary p {
  font-size: clamp(17px, 1.7vw, 22px);
  line-height: 1.55;
  color: rgba(250, 250, 247, 0.74);
  max-width: 720px;
  margin: 0 0 36px;
}

.landing-hero-cue-inverse {
  color: rgba(250, 250, 247, 0.7);
}

/* Footer */
.landing-footer {
  padding: 36px 6vw;
  background: var(--lp-bg);
}

.landing-footer-row {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: var(--lp-mute);
}

.landing-footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--lp-ink);
}

.landing-footer-brand img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* Backward-compatible no-ops for old classes still referenced elsewhere */
.landing-slide,
.landing-poster,
.landing-posters {
  background: none;
}

.primary-button {
  background: var(--text);
  color: var(--bg);
  padding: 0 18px;
  border-radius: 10px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: background 0.16s var(--ease-out), color 0.16s var(--ease-out), transform 0.05s ease;
}

.primary-button:hover {
  background: var(--text-2);
}

.primary-button:active {
  transform: scale(0.98);
}

.primary-button[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

.ghost-button,
.outline-button,
.icon-button {
  border-color: var(--line);
  background: var(--surface);
  padding: 0 14px;
  border-radius: 10px;
  font-weight: 500;
  transition: background 0.15s var(--ease-out), border-color 0.15s var(--ease-out), color 0.15s var(--ease-out);
}

.icon-button {
  width: 38px;
  height: 38px;
  padding: 0;
}

.outline-button:hover,
.ghost-button:hover,
.icon-button:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
}

.wide {
  width: 100%;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.assistant-layout,
.designer-layout,
.version-analysis-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
}

.assistant-layout {
  width: var(--assistant-stage-width);
  max-width: 100%;
  margin: 0 auto;
  grid-template-columns: var(--assistant-promo-width) var(--assistant-content-width);
  align-items: start;
  justify-content: center;
  gap: var(--assistant-gap);
}

.assistant-promo-column {
  display: grid;
  gap: 16px;
  width: var(--assistant-promo-width);
  max-width: 100%;
}

.assistant-promo-column img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 1;
  object-fit: cover;
  background: #070b14;
}

.chat-column,
.designer-workbench,
.version-workbench,
.tool-panel,
.payment-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.chat-column {
  min-height: 640px;
  display: flex;
  flex-direction: column;
}

#assistantPanel .chat-column {
  background: transparent;
  border: 0;
  box-shadow: none;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  min-width: 0;
  width: var(--assistant-content-width);
  max-width: 100%;
}

#assistantPanel .section-head,
#assistantPanel .mode-tabs,
#assistantPanel .image-script-panel,
#assistantPanel .chat-log-shell,
#assistantPanel .composer {
  width: var(--assistant-content-width);
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

#assistantPanel .section-head,
#assistantPanel .mode-tabs,
#assistantPanel .chat-log-shell,
#assistantPanel .composer {
  background: var(--surface);
  border: 1px solid var(--line);
}

#assistantPanel .section-head,
#assistantPanel .mode-tabs {
  display: none;
}

#assistantPanel .section-head {
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  margin-top: 0;
}

#assistantPanel .mode-tabs {
  border-top: 0;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

#assistantPanel .chat-log-shell {
  position: relative;
  border-radius: var(--radius-md);
  height: var(--assistant-chat-height);
  min-height: var(--assistant-chat-height);
  max-height: var(--assistant-chat-height);
  flex: 0 0 auto;
  overflow: hidden;
  resize: none;
}

#assistantPanel .chat-log-shell.expanded {
  height: 760px;
  min-height: 760px;
  max-height: 760px;
}

#assistantPanel .chat-log {
  height: 100%;
  overflow-y: auto;
  padding-bottom: 58px;
}

.chat-expand-button {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: transparent;
  display: grid;
  place-items: center;
}

.chat-expand-button::before,
.chat-expand-button::after {
  content: "";
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 14px;
  height: 14px;
  border-right: 2px solid #7a8580;
  border-bottom: 2px solid #7a8580;
  transform: rotate(0deg);
}

.chat-expand-button::after {
  right: 12px;
  bottom: 12px;
  width: 8px;
  height: 8px;
  opacity: 0.65;
}

.chat-expand-button:hover::before,
.chat-expand-button:hover::after {
  border-color: var(--primary-strong);
}

#assistantPanel .composer {
  border-radius: var(--radius-md);
  height: var(--assistant-composer-height);
  min-height: var(--assistant-composer-height);
  max-height: var(--assistant-composer-height);
  flex: 0 0 auto;
}

.designer-workbench,
.version-workbench {
  min-height: calc(100vh - 100px);
  min-width: 0;
}

.section-head {
  padding: 22px 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.section-head.compact {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
  padding: 18px 22px;
}

.section-head h1 {
  font-size: clamp(22px, 2vw, 28px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.section-head p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
  line-height: 1.55;
}

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

h1 {
  font-size: 24px;
  line-height: 1.2;
}

.section-head p,
.payment-box p,
.auth-box p {
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.55;
}

.quota-box {
  min-width: 110px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  text-align: right;
}

.quota-box span,
.usage-line span,
.manual-card p,
.plan-card p {
  color: var(--muted);
  font-size: 13px;
}

.quota-box strong {
  display: block;
  font-size: 20px;
}

.mode-tabs {
  display: flex;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.designer-toolbar {
  display: flex;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.mode-tab {
  min-width: 86px;
  background: var(--surface-2);
  color: var(--muted);
  padding: 0 12px;
  white-space: nowrap;
}

.mode-tab.active {
  background: color-mix(in srgb, var(--primary) 16%, var(--surface));
  border-color: color-mix(in srgb, var(--primary) 36%, var(--line));
  color: var(--text);
}

.image-script-panel {
  margin: 16px 24px 0;
  border: 1px dashed color-mix(in srgb, var(--primary) 34%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--primary) 6%, var(--surface));
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.image-script-panel strong,
.image-script-panel span {
  display: block;
}

.image-script-panel span {
  color: var(--muted);
  margin-top: 5px;
  line-height: 1.55;
}

.image-script-preview {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.image-script-preview img {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.image-script-preview span {
  margin: 0;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-log {
  flex: 1;
  padding: 22px 24px;
  display: grid;
  align-content: start;
  gap: 14px;
  overflow: auto;
}

.message {
  max-width: 100%;
  border: 0;
  border-radius: 0;
  padding: 0 0 16px;
  line-height: 1.48;
  white-space: pre-wrap;
}

.message.assistant {
  background: transparent;
}

.message.user {
  margin-left: 0;
  background: transparent;
}

.message code {
  display: block;
  margin-top: 0;
  padding: 12px;
  overflow-x: auto;
  background: color-mix(in srgb, var(--text) 8%, transparent);
  border-radius: 6px;
  color: var(--text);
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
}

.composer {
  border-top: 1px solid var(--line);
  padding: 18px 24px 30px;
  background: var(--surface);
}

.composer textarea,
.designer-form textarea,
.version-input-card textarea,
.auth-box textarea,
.auth-box input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  resize: vertical;
  padding: 12px;
  outline: 0;
}

.composer textarea {
  min-height: 150px;
  line-height: 1.65;
}

.composer textarea:focus,
.designer-form textarea:focus,
.version-input-card textarea:focus,
.auth-box textarea:focus,
.auth-box input:focus {
  border-color: var(--primary);
}

.designer-form {
  display: grid;
  gap: 0;
  padding: 14px 18px 18px;
  border-bottom: 1px solid var(--line);
}

.design-chat-composer {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 10px;
  box-shadow: 0 12px 26px rgba(26, 42, 36, 0.07);
}

.design-mode-switch {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.design-mode-option {
  min-width: 0;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 92%, var(--surface-2));
  color: var(--text);
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  text-align: left;
}

.design-mode-option svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.design-mode-option span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.design-mode-option strong,
.design-mode-option small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.design-mode-option strong {
  font-size: 13px;
}

.design-mode-option small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.design-mode-option.active {
  border-color: color-mix(in srgb, var(--primary) 68%, var(--line));
  background: color-mix(in srgb, var(--primary) 13%, var(--surface));
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--primary) 86%, transparent);
}

.design-mode-option.active svg,
.design-mode-option.active strong {
  color: var(--primary-strong);
}

.design-chat-tabs {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.design-chat-tabs .mode-tab {
  min-height: 30px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
}

.designer-form textarea {
  min-height: 142px;
  border: 0;
  background: color-mix(in srgb, var(--surface) 88%, var(--surface-2));
  resize: vertical;
}

.designer-form textarea.drag-over,
.designer-form textarea:focus {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 54%, var(--line)), var(--focus-ring);
}

.designer-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
}

.designer-fields,
.custom-size-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.design-option-area {
  min-width: 0;
  grid-template-columns: minmax(112px, 0.75fr) minmax(132px, 0.9fr) minmax(120px, 0.9fr) minmax(130px, 1fr) 36px 36px;
  align-items: end;
  gap: 7px;
  padding-top: 2px;
}

.design-chat-controls {
  grid-template-columns: minmax(104px, 0.8fr) minmax(132px, 1fr) minmax(112px, 0.85fr) 36px 36px;
  align-items: end;
  gap: 7px;
  padding-top: 2px;
}

.design-fullset-fields {
  grid-column: span 2;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 94%, var(--surface-2));
  display: grid;
  grid-template-columns: repeat(3, minmax(max-content, 1fr));
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
}

.design-fullset-fields > span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.design-fullset-fields label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.design-fullset-fields input {
  width: 14px;
  height: 14px;
  min-height: 14px;
  accent-color: var(--primary);
}

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

.designer-form select,
.designer-form input {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
}

.design-reference-panel {
  display: grid;
  gap: 6px;
}

.design-reference-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 28px;
}

.design-reference-list > span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.design-reference-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 90px) 22px;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 4px;
  max-width: 176px;
}

.design-reference-item img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 6px;
  background: #f5f5f7;
}

.design-reference-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.design-reference-item .ghost-button {
  width: 22px;
  min-height: 22px;
  padding: 0;
}

.design-upload-button,
.design-submit-button {
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 999px;
}

.design-upload-button svg,
.design-submit-button svg {
  width: 16px;
  height: 16px;
}

.design-output {
  padding: 18px;
  color: var(--muted);
}

.design-result {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 16px;
  display: grid;
  gap: 12px;
}

.design-result h3 {
  margin: 0;
  color: var(--text);
}

.design-result p {
  line-height: 1.65;
}

.design-result code {
  display: block;
  overflow-x: auto;
  border-radius: 8px;
  background: color-mix(in srgb, var(--text) 8%, transparent);
  color: var(--text);
  padding: 12px;
  font-family: Consolas, "Courier New", monospace;
  line-height: 1.6;
}

.design-package-button {
  justify-self: start;
  min-height: 36px;
  gap: 7px;
}

.generated-design-image {
  display: block;
  width: 100%;
  max-height: min(72vh, 720px);
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5f5f7;
}

.composer-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.version-input-card .composer-tools {
  justify-content: flex-end;
}

.select-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  min-height: 40px;
  background: var(--surface);
}

.select-wrap select {
  border: 0;
  background: transparent;
  color: var(--text);
  outline: 0;
}

.context-column {
  display: grid;
  gap: 14px;
  align-content: start;
}

.tool-panel {
  padding: 16px;
}

.member-card {
  display: grid;
  gap: 16px;
}

.member-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--primary) 15%, var(--surface));
  color: var(--primary-strong);
  font-weight: 800;
}

.member-card-head span,
.account-detail span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 4px;
}

.member-card-head strong {
  display: block;
  font-size: 20px;
  line-height: 1.2;
}

.account-detail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-2);
}

.tier {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  min-width: 76px;
  min-height: 28px;
  color: var(--gold);
  background: var(--surface);
  font-size: 13px;
}

.usage-line {
  display: grid;
  gap: 7px;
}

progress {
  width: 100%;
  accent-color: var(--primary);
}

.tool-title {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.quick-prompts,
.manual-snippets {
  display: grid;
  gap: 8px;
}

.quick-prompt {
  justify-content: flex-start;
  text-align: left;
  min-height: auto;
  padding: 10px;
  border-color: var(--line);
  background: transparent;
  line-height: 1.45;
}

.quick-prompt:hover {
  background: var(--surface-2);
}

.snippet {
  border-left: 3px solid var(--primary);
  padding: 9px 10px;
  background: var(--surface-2);
  border-radius: 0 8px 8px 0;
  line-height: 1.5;
  font-size: 13px;
}

.manual-grid,
.pricing-grid,
.resource-grid,
.script-list,
.command-list {
  display: grid;
  gap: 12px;
}

.manual-card,
.plan-card,
.version-card,
.script-card,
.command-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.empty-state {
  min-height: 96px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 82%, var(--surface-2));
  color: var(--muted);
  display: grid;
  place-items: center;
  padding: 18px;
  text-align: center;
  line-height: 1.6;
}

.loading-state {
  color: var(--primary);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-cloud button {
  min-height: 32px;
  padding: 0 10px;
  border-color: var(--line);
  color: var(--muted);
}

.rank-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 10px;
}

.rank-list li {
  padding-left: 4px;
}

.rank-list span {
  display: inline-block;
  min-width: 96px;
}

.rank-list strong {
  color: var(--primary);
}

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

.version-upload-area,
.version-input-card,
.version-result {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.version-dropzone {
  border: 1px dashed color-mix(in srgb, var(--primary) 48%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--primary) 5%, var(--surface-2));
  padding: 22px;
  display: grid;
  gap: 10px;
  color: var(--muted);
}

.version-dropzone.dragging {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
}

.version-dropzone svg {
  width: 28px;
  height: 28px;
  color: var(--primary);
}

.version-dropzone strong {
  color: var(--text);
  font-size: 18px;
}

.version-dropzone span {
  line-height: 1.6;
}

.version-upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

#versionArchiveInput,
#versionFolderInput {
  display: none;
}

.version-file-summary {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  line-height: 1.65;
}

.version-file-summary strong {
  color: var(--text);
}

.version-file-summary span {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.version-input-card {
  display: grid;
  gap: 10px;
}

.version-input-card label {
  color: var(--text);
  font-weight: 700;
}

.version-result {
  border-bottom: 0;
}

.version-report-card {
  display: grid;
  gap: 16px;
}

.version-report-card h2 {
  font-size: 22px;
}

.version-report-card > p,
.analysis-section p {
  color: var(--muted);
  line-height: 1.7;
}

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

.version-chat-output {
  display: grid;
  gap: 12px;
}

.analysis-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 14px;
}

.analysis-section h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.analysis-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.analysis-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  background: var(--surface);
}

.analysis-table th,
.analysis-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  line-height: 1.6;
}

.analysis-table th {
  background: var(--surface-2);
  color: var(--text);
  white-space: nowrap;
}

.analysis-table td {
  color: var(--muted);
}

.analysis-table tr:last-child td {
  border-bottom: 0;
}

.version-side-panel {
  display: grid;
  align-content: start;
  gap: 14px;
}

.active-manual {
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface-2);
}

.active-manual span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 4px;
}

.active-manual strong {
  display: block;
  font-size: 18px;
}

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

.manual-summary div,
.version-stats div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.manual-summary span,
.version-stats span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 5px;
}

.manual-summary strong,
.version-stats strong {
  display: block;
  font-size: 18px;
}

.manual-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

#manualPanel {
  padding-top: 0;
}

.admin-nav-item:not(.admin-visible) {
  display: none !important;
}

.manual-tab {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  padding: 0 14px;
}

.manual-tab.active,
.manual-tab:hover {
  background: color-mix(in srgb, var(--primary) 14%, var(--surface));
  border-color: color-mix(in srgb, var(--primary) 42%, var(--line));
  color: var(--text);
}

.manual-browser {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.manual-menu {
  position: sticky;
  top: 92px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.manual-category-list {
  display: grid;
  gap: 8px;
}

.manual-category {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  padding: 0 10px;
  color: var(--muted);
}

.manual-category.active,
.manual-category:hover {
  background: color-mix(in srgb, var(--primary) 13%, var(--surface));
  border-color: color-mix(in srgb, var(--primary) 40%, var(--line));
  color: var(--text);
}

.manual-category span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manual-category strong {
  font-size: 12px;
  color: var(--muted);
}

.manual-reader {
  display: grid;
  gap: 12px;
}

.manual-entry {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.manual-entry h3 {
  margin: 10px 0 8px;
  font-size: 18px;
}

.manual-entry p {
  color: var(--muted);
  line-height: 1.6;
}

.manual-body {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: Consolas, "Microsoft YaHei", monospace;
  font-size: 13px;
}

.task-market-page {
  display: grid;
  gap: 16px;
}

.task-market-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

.task-market-stats article {
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
  display: grid;
  align-content: center;
  gap: 5px;
  box-shadow: var(--shadow);
}

.task-market-stats span,
.task-market-stats small,
.task-market-toolbar span,
.task-card p,
.task-tech-card span,
.task-review-list p,
.task-rule-card p {
  color: var(--muted);
}

.task-market-stats strong {
  font-size: 24px;
  line-height: 1;
}

.task-market-tabs {
  overflow-x: auto;
  padding-bottom: 2px;
}

.task-market-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px;
  align-items: start;
}
/* 删除右侧栏后全宽布局 */
.task-market-layout.fullwidth { grid-template-columns: 1fr; }

.task-market-main,
.task-market-side {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.task-market-toolbar {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.task-market-toolbar div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.task-list {
  grid-template-columns: 1fr;
}

.task-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
  display: grid;
  gap: 12px;
  box-shadow: var(--shadow);
}

.task-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.task-card-head h3 {
  margin: 6px 0 0;
  font-size: 18px;
  line-height: 1.35;
}

.task-card-head > strong {
  color: var(--primary-strong);
  white-space: nowrap;
  font-size: 18px;
}

.task-card p {
  line-height: 1.65;
}

.task-meta,
.task-card-actions,
.task-tech-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.task-meta span,
.task-tech-meta span {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.task-meta svg {
  width: 14px;
  height: 14px;
}

.task-requirements {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 4px;
  line-height: 1.55;
}

.small-button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.task-tech-list {
  display: grid;
  gap: 10px;
}

.task-tech-card,
.task-rule-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
  display: grid;
  gap: 10px;
  box-shadow: var(--shadow);
}

.task-tech-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.task-tech-head div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.task-rating {
  min-height: 30px;
  border: 1px solid color-mix(in srgb, #f5b93f 52%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, #f5b93f 12%, var(--surface));
  color: #8a5a00 !important;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 9px;
  font-weight: 900;
}

.task-rating svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.task-tech-meta b {
  color: var(--text);
}

.task-review-list {
  border-top: 1px solid var(--line);
  padding-top: 8px;
  display: grid;
  gap: 6px;
}

.task-review-list p {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
}

.task-rule-card p {
  margin: 0;
  line-height: 1.65;
}

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

.script-filter {
  align-self: start;
}

.resource-topline {
  min-height: 26px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.version-card h3,
.script-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.version-card p,
.script-card p {
  color: var(--muted);
  line-height: 1.58;
}

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

.compact-list {
  margin-bottom: 14px;
}

.script-card {
  display: grid;
  gap: 14px;
}

.script-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.command-card {
  display: grid;
  gap: 14px;
}

.planner-status {
  min-height: 34px;
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
  color: var(--primary-strong);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.planner-status svg {
  width: 15px;
  height: 15px;
}

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

.planner-form {
  display: grid;
  gap: 14px;
  align-self: start;
}

.planner-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.planner-form select,
.planner-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 0 12px;
  outline: 0;
}

.planner-form select {
  min-height: 38px;
}

.planner-form textarea {
  min-height: 210px;
  padding-top: 12px;
  resize: vertical;
  line-height: 1.65;
}

.planner-submit {
  min-height: 42px;
}

.planner-result {
  min-width: 0;
}

.planner-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 18px;
  display: grid;
  gap: 16px;
}

.planner-card-head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.planner-card-head span,
.planner-reference span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.planner-card-head strong {
  display: block;
  margin-top: 5px;
  font-size: 22px;
}

.planner-card-head p,
.planner-section-grid p,
.planner-reference p {
  color: var(--muted);
  line-height: 1.65;
}

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

.planner-section-grid section,
.planner-next,
.planner-reference {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 86%, var(--surface-2));
  padding: 14px;
}

.planner-section-grid h3,
.planner-next h3 {
  margin-bottom: 8px;
  font-size: 16px;
}

.planner-next ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.command-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.command-main h3 {
  font-family: Consolas, "Courier New", monospace;
  font-size: 20px;
  margin-bottom: 8px;
}

.command-main p {
  color: var(--muted);
  line-height: 1.58;
}

.command-syntax {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: 8px;
}

.command-syntax span {
  color: var(--muted);
  font-size: 13px;
}

.command-syntax code {
  font-family: Consolas, "Courier New", monospace;
  color: var(--text);
}

.script-card pre,
.command-card pre {
  margin: 0;
  overflow: auto;
  background: color-mix(in srgb, var(--text) 7%, transparent);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.script-card code,
.command-card pre code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre;
}

.tag-cloud button.active-filter {
  background: color-mix(in srgb, var(--primary) 15%, var(--surface));
  border-color: color-mix(in srgb, var(--primary) 45%, var(--line));
  color: var(--text);
}

.website-builder-page {
  display: grid;
  gap: 18px;
}

.website-builder-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.website-builder-card {
  min-height: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 20px;
  display: grid;
  align-content: start;
  gap: 12px;
}

.website-builder-card svg {
  width: 26px;
  height: 26px;
  color: var(--primary);
}

.website-builder-card strong {
  font-size: 18px;
}

.website-builder-card p {
  color: var(--muted);
  line-height: 1.65;
}

.materials-page {
  display: grid;
  gap: 18px;
}

.materials-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.materials-card {
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  padding: 20px;
  display: grid;
  align-content: start;
  gap: 12px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.materials-card:hover {
  border-color: color-mix(in srgb, var(--primary) 28%, var(--line));
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.materials-card svg {
  width: 28px;
  height: 28px;
  color: var(--primary);
}

.materials-card strong {
  font-size: 18px;
}

.materials-card p {
  color: var(--muted);
  line-height: 1.65;
}

.tutorial-page {
  display: grid;
  gap: 18px;
}

.tutorial-head {
  align-items: center;
  position: relative;
  z-index: 1;
}

/* 教程页：祥云水墨背景 + 顶部光晕，传奇主题不喧宾夺主 */
.tutorial-page {
  position: relative;
  isolation: isolate;
}

.tutorial-page::before {
  content: "";
  position: absolute;
  inset: -20px -20px 0 -20px;
  height: 280px;
  background:
    radial-gradient(ellipse 80% 50% at 20% 0%, color-mix(in srgb, var(--primary) 14%, transparent), transparent 70%),
    radial-gradient(ellipse 60% 40% at 90% 10%, color-mix(in srgb, var(--gold) 12%, transparent), transparent 70%);
  pointer-events: none;
  z-index: 0;
  filter: blur(2px);
}

.tutorial-page::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'><g fill='none' stroke='%23236f5a' stroke-width='1.4' opacity='0.5'><path d='M18 50 C 18 38, 32 32, 44 38 C 50 26, 70 26, 76 38 C 88 32, 102 38, 102 52 C 110 54, 110 66, 98 66 L 30 66 C 18 66, 12 56, 18 50 Z'/><path d='M88 110 C 88 100, 100 96, 110 100 C 116 90, 132 94, 132 106 C 140 108, 140 118, 128 118 L 96 118 C 88 118, 86 114, 88 110 Z'/></g></svg>");
  background-size: 220px 220px;
  background-position: 0 -10px;
  opacity: 0.08;
  pointer-events: none;
  z-index: 0;
}

.tutorial-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  position: relative;
  z-index: 1;
}

.tutorial-card {
  position: relative;
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(135deg, var(--surface), color-mix(in srgb, var(--primary) 2%, var(--surface)) 60%, color-mix(in srgb, var(--gold) 3%, var(--surface)));
  box-shadow: var(--shadow-card);
  padding: 12px 46px 12px 14px;
  display: grid;
  align-content: start;
  gap: 6px;
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

/* 卡片右上角古风角饰（细线半圆纹） */
.tutorial-card::before {
  content: "";
  position: absolute;
  top: -1px;
  right: -1px;
  width: 38px;
  height: 38px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'><g fill='none' stroke='%23236f5a' stroke-width='1' opacity='0.55'><path d='M40 0 L40 14 Q40 22 32 22 L18 22 Q10 22 10 30 L10 40'/><circle cx='32' cy='8' r='1.5' fill='%23b88324' stroke='none' opacity='0.7'/></g></svg>");
  background-repeat: no-repeat;
  background-size: 38px 38px;
  pointer-events: none;
  opacity: 0.7;
}

.tutorial-card:hover {
  border-color: color-mix(in srgb, var(--primary) 36%, var(--line));
  box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--primary) 38%, transparent), var(--shadow-soft);
  transform: translateY(-2px);
}

.tutorial-card-top {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tutorial-card-top span {
  min-width: 50px;
  height: 22px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--primary) 14%, var(--surface));
  color: var(--primary-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 11.5px;
  padding: 0 8px;
  letter-spacing: 0.5px;
}

.tutorial-card-top em {
  height: 22px;
  border: 1px solid color-mix(in srgb, var(--gold) 42%, var(--line));
  border-radius: 6px;
  background: color-mix(in srgb, var(--gold) 12%, var(--surface));
  color: color-mix(in srgb, var(--gold) 72%, var(--text));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  font-style: normal;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
}

.tutorial-card strong {
  font-size: 15px;
  line-height: 1.25;
  letter-spacing: 0.2px;
}

.tutorial-card p {
  color: var(--muted);
  line-height: 1.55;
  font-size: 12.5px;
}

.tutorial-play {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 30px;
  height: 30px;
  border: 1px solid color-mix(in srgb, var(--primary) 36%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
  color: var(--primary-strong);
  display: grid;
  place-items: center;
  box-shadow: 0 1px 3px color-mix(in srgb, var(--primary) 18%, transparent);
  transition: background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.tutorial-play:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  transform: translateY(-1px) scale(1.05);
  box-shadow: 0 4px 12px -2px color-mix(in srgb, var(--primary) 50%, transparent);
}

.tutorial-play svg {
  width: 12px;
  height: 12px;
  margin-left: 1px;
  fill: currentColor;
}

.manual-card h3,
.plan-card h3 {
  margin-bottom: 8px;
  font-size: 17px;
}

.manual-card p,
.plan-card p {
  line-height: 1.55;
}

.manual-card .chip-row,
.plan-card .chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.chip {
  border-radius: 999px;
  background: var(--surface-2);
  padding: 4px 8px;
  font-size: 12px;
  color: var(--muted);
}

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

.circle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.circle-card,
.circle-feed {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.circle-card span {
  color: var(--muted);
  font-size: 13px;
}

.circle-card strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
}

.circle-card p {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.65;
}

.plan-card.featured {
  border-color: color-mix(in srgb, var(--primary) 60%, var(--line));
}

.membership-plan-card {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: start;
  gap: 12px;
}

.membership-plan-card::after {
  content: "";
  width: 120px;
  height: 120px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  position: absolute;
  top: -68px;
  right: -48px;
  pointer-events: none;
}

.membership-plan-card.tier-pro::after {
  background: color-mix(in srgb, var(--gold) 18%, transparent);
}

.membership-plan-card.tier-max::after {
  background: color-mix(in srgb, #111827 18%, transparent);
}

.plan-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.plan-badge,
.plan-identity,
.year-price,
.credit-bonus {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
}

.plan-engine {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--primary) 5%, var(--surface));
  padding: 10px;
  display: grid;
  gap: 4px;
}

.plan-engine span {
  color: var(--muted);
  font-size: 12px;
}

.plan-engine strong {
  font-size: 14px;
}

.year-price {
  width: max-content;
  color: var(--primary-strong);
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}

.year-price.muted {
  color: var(--muted);
  background: var(--surface-2);
}

.plan-identity {
  width: max-content;
}

.plan-actions {
  display: grid;
  gap: 8px;
  margin-top: auto;
}

.price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 16px 0;
}

.price strong {
  font-size: 32px;
}

.feature-list {
  padding-left: 18px;
  margin: 14px 0 18px;
  color: var(--muted);
  line-height: 1.8;
}

.payment-box {
  padding: 18px;
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.membership-page {
  display: grid;
  gap: 18px;
}

.membership-hero {
  min-height: 210px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 88% 18%, rgba(184, 131, 36, 0.24), transparent 28%),
    linear-gradient(135deg, #10231d 0%, #1b332b 58%, #f7faf8 100%);
  color: #fff;
  box-shadow: var(--shadow);
  padding: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 22px;
  align-items: end;
}

.membership-hero span,
.checkout-title span,
.membership-perks span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.membership-hero > div:first-child span {
  color: rgba(255, 255, 255, 0.72);
}

.membership-hero h1 {
  max-width: 760px;
  margin-top: 8px;
  font-size: 30px;
  line-height: 1.18;
}

.membership-hero p {
  max-width: 760px;
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.65;
}

.membership-account {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  padding: 18px;
}

.membership-account strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.membership-redeem-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #0a0a0a;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.6);
  transition: background 0.18s ease, transform 0.06s ease;
}

.membership-redeem-link:hover {
  background: #ffffff;
}

.membership-redeem-link:active {
  transform: scale(0.98);
}

.membership-redeem-link i {
  width: 14px;
  height: 14px;
}

.membership-redeem-link span {
  font-size: 11px;
  opacity: 0.6;
}

.membership-metrics,
.membership-perks {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.membership-metrics article,
.membership-perks article,
.membership-plans,
.membership-order {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.membership-metrics article {
  padding: 16px;
  display: grid;
  gap: 8px;
}

.membership-metrics svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
}

.membership-metrics strong,
.membership-perks strong,
.checkout-title strong {
  display: block;
  color: var(--text);
  font-size: 17px;
}

.membership-metrics span,
.membership-perks p,
.membership-order p {
  color: var(--muted);
  line-height: 1.58;
}

.membership-checkout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.membership-plans {
  padding: 18px;
}

.checkout-title {
  margin-bottom: 14px;
}

.membership-order {
  margin-top: 0;
  padding: 18px;
  display: grid;
  gap: 14px;
  position: sticky;
  top: 18px;
}

.credits-section,
.consumption-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  padding: 18px;
}

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

.credit-pack-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 86% 10%, color-mix(in srgb, var(--gold) 16%, transparent), transparent 34%),
    var(--surface);
  padding: 16px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.credit-pack-card.featured {
  border-color: color-mix(in srgb, var(--gold) 52%, var(--line));
  box-shadow: 0 16px 36px rgba(184, 131, 36, 0.13);
}

.credit-pack-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.credit-pack-head span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.credit-pack-head strong {
  font-size: 18px;
}

.credit-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.credit-price strong {
  font-size: 34px;
}

.credit-pack-card p,
.credit-pack-card small {
  color: var(--muted);
  line-height: 1.58;
}

.credit-points {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 10px;
  display: grid;
  gap: 2px;
}

.credit-points strong {
  font-size: 22px;
}

.credit-points span {
  color: var(--muted);
  font-size: 12px;
}

.credit-bonus {
  width: max-content;
  color: var(--primary-strong);
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}

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

.consumption-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.consumption-table th,
.consumption-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
}

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

.consumption-table td {
  font-weight: 800;
}

.order-summary {
  margin: 0;
  display: grid;
  gap: 10px;
}

.order-summary div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.order-summary dt {
  color: var(--muted);
}

.order-summary dd {
  margin: 0;
  font-weight: 800;
}

.payment-methods {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.payment-methods button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
}

.payment-methods button.active,
.payment-methods button:hover {
  border-color: color-mix(in srgb, var(--primary) 42%, var(--line));
  color: var(--primary-strong);
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}

.payment-methods svg {
  width: 14px;
  height: 14px;
}

.wechat-pay-qr {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.wechat-pay-qr[hidden] {
  display: none;
}

.wechat-pay-qr img {
  width: min(220px, 100%);
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}

.wechat-pay-qr span {
  max-width: 100%;
  word-break: break-all;
  font-size: 12px;
  color: var(--muted);
}

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

.membership-perks article {
  padding: 18px;
}

.membership-perks strong {
  margin: 8px 0;
}

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

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

.admin-metric,
.admin-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.admin-metric {
  min-height: 132px;
  padding: 16px;
  display: grid;
  align-content: start;
  gap: 8px;
}

.admin-metric svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
}

.admin-metric span,
.admin-card-title span,
.admin-toolbar span,
.admin-table small,
.admin-log-item span,
.admin-log-item p,
.admin-log-item small,
.admin-mini-list p,
.admin-detail-grid dt {
  color: var(--muted);
}

.admin-metric strong {
  font-size: 24px;
  line-height: 1.1;
}

.admin-metric small {
  color: var(--muted);
  font-size: 12px;
}

.admin-card {
  padding: 16px;
  min-width: 0;
}

.admin-toolbar,
.admin-card-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.admin-toolbar strong,
.admin-card-title strong {
  display: block;
  font-size: 16px;
  margin-bottom: 4px;
}

.admin-search {
  width: min(360px, 100%);
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
}

.admin-search svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.admin-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
  background: var(--surface);
}

.admin-table th,
.admin-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
  white-space: nowrap;
}

.admin-table td {
  font-size: 13px;
}

.admin-table tr:last-child td {
  border-bottom: 0;
}

.admin-account-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.admin-account-cell > span {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 12%, var(--surface-2));
  color: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 800;
  flex: 0 0 auto;
}

.admin-account-cell strong,
.admin-table td > strong {
  display: block;
  line-height: 1.25;
}

.admin-account-cell small,
.admin-table td > small {
  display: block;
  margin-top: 4px;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-badge {
  min-width: 52px;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.admin-badge.tier-vip,
.admin-badge.tier-svip {
  border-color: color-mix(in srgb, var(--gold) 42%, var(--line));
  background: color-mix(in srgb, var(--gold) 12%, var(--surface));
  color: #7a520f;
}

.admin-badge.status-active {
  border-color: color-mix(in srgb, var(--primary) 34%, var(--line));
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
  color: var(--primary-strong);
}

.admin-badge.status-paused {
  border-color: color-mix(in srgb, var(--gold) 34%, var(--line));
  background: color-mix(in srgb, var(--gold) 10%, var(--surface));
  color: #76530f;
}

.admin-badge.status-blocked {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--accent);
}

.admin-row-button {
  min-height: 34px;
  padding: 0 10px;
  white-space: nowrap;
}

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

.admin-log-list {
  max-height: 420px;
  overflow: auto;
  display: grid;
  gap: 8px;
  padding-right: 4px;
}

.admin-log-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 10px 12px;
  display: grid;
  gap: 6px;
}

.admin-log-item > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.admin-log-item strong,
.admin-log-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-log-item p,
.admin-log-item small {
  margin: 0;
  line-height: 1.45;
  word-break: break-all;
}

.admin-edit-box {
  width: min(980px, calc(100vw - 32px));
}

.admin-edit-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.admin-edit-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

.admin-edit-form input,
.admin-edit-form select {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 0 10px;
}

.admin-edit-form .wide {
  grid-column: 1 / -1;
}

.admin-user-detail {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-user-detail section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 12px;
  min-width: 0;
}

.admin-user-detail h3 {
  margin-bottom: 10px;
  font-size: 14px;
}

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

.admin-detail-grid div {
  min-width: 0;
}

.admin-detail-grid dt {
  font-size: 12px;
  margin-bottom: 3px;
}

.admin-detail-grid dd {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-mini-list {
  display: grid;
  gap: 6px;
  max-height: 190px;
  overflow: auto;
}

.admin-mini-list p {
  margin: 0;
  line-height: 1.55;
  word-break: break-all;
}

.auth-modal {
  border: 0;
  padding: 0;
  background: transparent;
}

.auth-modal::backdrop {
  background: rgba(0, 0, 0, 0.62);
}

.login-shell {
  width: min(920px, calc(100vw - 36px));
  height: min(580px, calc(100vh - 36px));
  background: #090b0b;
  color: #f4f7f5;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  overflow: hidden;
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.login-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  background: #f7faf8;
  border: 1px solid rgba(255, 255, 255, 0.82);
  color: var(--primary-strong);
  opacity: 1;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.login-close:hover {
  background: #fff;
  color: var(--primary-strong);
  border-color: color-mix(in srgb, var(--primary) 28%, #fff);
}

.login-close svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.5;
}

.login-visual {
  position: relative;
  padding: 42px;
  display: flex;
  align-items: flex-end;
  gap: 14px;
  overflow: hidden;
  background:
    radial-gradient(circle at 36% 32%, rgba(101, 189, 157, 0.48), transparent 24%),
    radial-gradient(circle at 62% 72%, rgba(180, 63, 46, 0.34), transparent 26%),
    linear-gradient(135deg, #11231d, #151716 48%, #050606);
}

.login-visual-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.login-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(3, 5, 5, 0.08), rgba(3, 5, 5, 0.34)),
    linear-gradient(115deg, rgba(255, 255, 255, 0.08), transparent 34%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 80px);
  z-index: 1;
  pointer-events: none;
}

.login-visual-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
  padding: 0;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.42));
  z-index: 2;
}

.login-visual div:last-child {
  z-index: 2;
}

.login-visual strong,
.login-visual span {
  display: block;
}

.login-visual strong {
  font-size: 20px;
  line-height: 1.2;
}

.login-visual span {
  color: rgba(255, 255, 255, 0.72);
  margin-top: 4px;
  font-size: 12px;
}

.login-panel {
  align-self: center;
  width: min(380px, calc(100% - 56px));
  justify-self: center;
  display: grid;
  gap: 14px;
}

.login-panel h2 {
  font-size: 22px;
  line-height: 1.2;
  margin: 0 0 4px;
}

.login-tabs {
  display: flex;
  gap: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
  padding-bottom: 2px;
}

.login-tab {
  min-height: 30px;
  padding: 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
  font-size: 12.5px;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: color 0.15s var(--ease-out), border-color 0.15s var(--ease-out);
}

.login-tab:hover {
  color: rgba(255, 255, 255, 0.85);
}

.login-tab.active {
  border-color: #ffffff;
  color: #ffffff;
}

.login-mode {
  display: none;
  gap: 10px;
}

.login-mode.active {
  display: grid;
}

.phone-field,
.code-field,
.auth-field {
  height: 36px;
  display: flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
  transition: border-color 0.15s var(--ease-out), background 0.15s var(--ease-out);
}

.phone-field:focus-within,
.code-field:focus-within,
.auth-field:focus-within {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.07);
}

.phone-field span,
.auth-field span {
  padding: 0 12px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.78);
  min-width: 64px;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
}

.phone-field input,
.code-field input,
.auth-field input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: #ffffff;
  padding: 0 12px;
  font-family: inherit;
  font-size: 12.5px;
}

.phone-field input::placeholder,
.code-field input::placeholder,
.auth-field input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.auth-code-field button {
  align-self: stretch;
  flex: 0 0 auto;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  padding: 0 12px;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s var(--ease-out);
}

.auth-code-field button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
}

.auth-code-field button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.forgot-link {
  width: fit-content;
  justify-self: end;
  border: 0;
  background: transparent;
  color: #5ee082;
  font-weight: 700;
  padding: 0;
}

.forgot-link:hover {
  color: #fff;
}

.code-field button {
  align-self: stretch;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.78);
  padding: 0 16px;
}

.qr-box {
  min-height: 206px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: #0d0f0f;
  text-align: center;
}

.qr-grid {
  width: 132px;
  height: 132px;
  border: 10px solid #fff;
  background:
    linear-gradient(90deg, #111 12px, transparent 12px) 0 0 / 24px 24px,
    linear-gradient(#111 12px, transparent 12px) 0 0 / 24px 24px,
    #fff;
}

.qr-box span {
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
}

.agreement-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 11.5px;
  line-height: 1.6;
}

.agreement-row input {
  margin-top: 5px;
}

.text-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: #5ee082;
  font-weight: 700;
}

.login-submit {
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.62);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.login-submit:hover {
  background: var(--primary);
  color: #fff;
}

.agreement-modal {
  border: 0;
  padding: 0;
  background: transparent;
}

.agreement-modal::backdrop {
  background: rgba(0, 0, 0, 0.58);
}

.agreement-box {
  width: min(720px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 32px));
  overflow: auto;
  position: relative;
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 24px;
  box-shadow: var(--shadow);
}

.agreement-box .close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.agreement-content {
  display: grid;
  gap: 12px;
  color: var(--muted);
  line-height: 1.75;
}

.agreement-content p {
  margin: 0;
}

.settings-modal {
  border: 0;
  padding: 0;
  background: transparent;
}

.settings-modal::backdrop {
  background: rgba(0, 0, 0, 0.48);
}

.settings-box {
  width: min(820px, calc(100vw - 36px));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(26, 42, 36, 0.22);
  padding: 28px;
  position: relative;
}

.settings-box .close {
  position: absolute;
  top: 18px;
  right: 18px;
}

.settings-head {
  max-width: 560px;
  margin-bottom: 20px;
}

.settings-head span {
  color: var(--primary);
  font-weight: 700;
}

.settings-head h2 {
  margin: 6px 0 8px;
  font-size: 28px;
}

.settings-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

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

.settings-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  padding: 16px;
}

.settings-card-wide {
  grid-column: 1 / -1;
}

.settings-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.settings-card-title svg {
  width: 18px;
  height: 18px;
  color: var(--primary);
}

.settings-card dl {
  margin: 0;
  display: grid;
  gap: 8px;
}

.settings-card dl div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-card dt {
  color: var(--muted);
}

.settings-card dd {
  margin: 0;
  text-align: right;
  font-weight: 700;
}

.settings-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: color-mix(in srgb, var(--primary) 18%, var(--surface));
  color: var(--primary-strong);
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--line));
}

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

.settings-toggle {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.settings-toggle input {
  accent-color: var(--primary);
}

.notice-list {
  display: grid;
  gap: 12px;
}

.notice-list section {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  padding: 11px 12px;
}

.notice-list .notice-action {
  cursor: pointer;
  background: color-mix(in srgb, var(--primary) 7%, var(--surface));
  border-color: color-mix(in srgb, var(--primary) 26%, var(--line));
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.notice-list .notice-action:hover {
  border-color: color-mix(in srgb, var(--primary) 46%, var(--line));
  transform: translateY(-1px);
}

.notice-list strong {
  display: block;
  margin-bottom: 5px;
  font-size: 0.92rem;
}

.notice-list p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.mini-modal {
  width: min(560px, calc(100vw - 36px));
}

.sidebar-popover {
  position: fixed;
  left: 96px;
  bottom: 12px;
  z-index: 80;
  width: min(360px, calc(100vw - 116px));
}

.sidebar-popover article {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 14px 42px rgba(26, 42, 36, 0.16);
  padding: 12px;
  max-height: calc(100vh - 28px);
  overflow: auto;
}

.sidebar-popover .close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
}

.sidebar-popover .settings-head {
  margin-bottom: 10px;
  padding-right: 36px;
}

.sidebar-popover .settings-head span {
  font-size: 0.82rem;
}

.sidebar-popover .settings-head h2 {
  margin: 4px 0 6px;
  font-size: 19px;
}

.sidebar-popover .settings-head p {
  font-size: 0.84rem;
  line-height: 1.45;
}

.sidebar-popover .settings-grid {
  grid-template-columns: 1fr;
}

.sidebar-popover .settings-card {
  padding: 10px;
}

.sidebar-popover .settings-card-title {
  gap: 7px;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.sidebar-popover .settings-card-title svg {
  width: 16px;
  height: 16px;
}

.sidebar-popover .settings-card dl div {
  min-height: 38px;
  padding: 7px 9px;
}

.sidebar-popover .settings-card dt,
.sidebar-popover .settings-card dd {
  font-size: 0.86rem;
}

.sidebar-popover .settings-toggle,
.sidebar-popover .settings-actions .outline-button {
  min-height: 36px;
  font-size: 0.88rem;
}

.sidebar-popover .settings-actions {
  grid-template-columns: 1fr;
  gap: 8px;
}

.profile-popover {
  width: min(380px, calc(100vw - 116px));
}

.gm-letter-modal {
  width: min(620px, calc(100vw - 40px));
  max-height: min(86vh, 900px);
  border: 0;
  padding: 0;
  background: transparent;
  overflow: visible;
}

.gm-letter-modal::backdrop {
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 244, 222, 0.24), transparent 32%),
    rgba(18, 22, 20, 0.58);
  backdrop-filter: blur(3px);
}

.gm-letter-shell {
  position: relative;
  width: 100%;
  max-height: min(86vh, 900px);
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: #fffaf1;
  box-shadow: 0 26px 90px rgba(37, 28, 15, 0.24);
  overflow: hidden;
}

.gm-letter-image {
  display: block;
  width: 100%;
  max-height: min(86vh, 900px);
  object-fit: contain;
}

.gm-letter-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(178, 129, 58, 0.26);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: #7b5522;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 26px rgba(67, 48, 20, 0.16);
}

.gm-letter-close:hover {
  background: #fff;
  color: var(--text);
}

.gm-letter-close svg {
  width: 18px;
  height: 18px;
}

.auth-box {
  width: min(460px, calc(100vw - 28px));
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
  position: relative;
  display: grid;
  gap: 14px;
}

.auth-box .close {
  position: absolute;
  top: 12px;
  right: 12px;
}

.auth-box label {
  display: grid;
  gap: 7px;
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: var(--text);
  color: var(--surface);
  border-radius: 8px;
  padding: 12px 14px;
  transform: translateY(24px);
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

body,
button,
input,
textarea,
select {
  font-size: 0.95rem;
}

.quota-box strong,
.member-card-head strong {
  font-size: 18px;
}

.version-card h3,
.script-card h3,
.circle-card strong {
  font-size: 17px;
}

.price strong {
  font-size: 28px;
}

.login-panel h2 {
  font-size: 30px;
}

.login-visual strong {
  font-size: 24px;
}

/* Internal UI refresh: one shared visual language for app pages. */
.workspace {
  padding: clamp(14px, 1.35vw, 24px);
}

.sidebar {
  gap: 18px;
  padding: 18px 8px;
}

.sidebar-toggle {
  top: 86px;
  right: -13px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #f7faf8;
  color: #6c8178;
  box-shadow: var(--shadow-soft);
}

.sidebar-toggle svg {
  width: 15px;
  height: 15px;
}

body.sidebar-collapsed .sidebar-toggle {
  right: -42px;
}

.brand-logo,
.top-brand-logo {
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 0 1px rgba(26, 42, 36, 0.05);
}

.top-brand strong {
  letter-spacing: -0.02em;
}

.nav-list {
  gap: 9px;
}

.nav-item,
.ghost-button,
.primary-button,
.outline-button,
.icon-button,
.mode-tab,
.tag-cloud button,
.quick-prompt,
.manual-tab,
.manual-category,
.settings-entry,
.landing-enter {
  border-radius: var(--radius-sm);
  min-height: var(--control-height);
  font-size: 0.94rem;
  font-weight: 700;
}

.nav-item {
  min-height: 66px;
  padding: 7px 3px;
  border-color: transparent;
  color: #aeb8b4;
  font-size: 0.82rem;
  gap: 6px;
}

.nav-item.active {
  background: rgba(104, 255, 84, 0.1);
  color: #68ff54;
  box-shadow: inset 3px 0 0 #68ff54;
}

.nav-item:hover {
  background: rgba(104, 255, 84, 0.08);
  color: #68ff54;
  transform: translateX(0);
}

.nav-item.active svg {
  color: #68ff54;
}

.primary-button,
.ghost-button,
.outline-button,
.icon-button {
  letter-spacing: -0.01em;
}

.primary-button {
  border-color: color-mix(in srgb, var(--primary) 88%, #000);
  box-shadow: 0 10px 22px color-mix(in srgb, var(--primary) 18%, transparent);
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px color-mix(in srgb, var(--primary) 22%, transparent);
}

.ghost-button,
.outline-button,
.icon-button {
  background: color-mix(in srgb, var(--surface) 88%, var(--surface-2));
}

.outline-button {
  border-color: color-mix(in srgb, var(--line) 82%, var(--primary));
}

.outline-button:hover,
.ghost-button:hover,
.icon-button:hover {
  border-color: color-mix(in srgb, var(--primary) 32%, var(--line));
  color: var(--primary-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
}

.primary-button svg,
.ghost-button svg,
.outline-button svg,
.icon-button svg,
.mode-tab svg,
.tag-cloud button svg,
.quick-prompt svg,
.manual-tab svg,
.manual-category svg,
.settings-entry svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  stroke-width: 2.2;
}

.topbar {
  gap: 16px;
  margin-bottom: 16px;
}

.search-wrap {
  height: 48px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 94%, var(--surface-2));
  box-shadow: var(--shadow-card);
}

.search-wrap:focus-within {
  border-color: color-mix(in srgb, var(--primary) 44%, var(--line));
  box-shadow: var(--focus-ring), var(--shadow-card);
}

.chat-column,
.designer-workbench,
.version-workbench,
.tool-panel,
.payment-box,
.section-head.compact,
.manual-menu,
.manual-entry,
.manual-card,
.plan-card,
.version-card,
.script-card,
.command-card,
.circle-card,
.circle-feed {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.section-head {
  padding: clamp(16px, 1.6vw, 22px);
}

.section-head.compact {
  padding: clamp(18px, 1.6vw, 24px);
}

h1 {
  font-size: clamp(21px, 1.55vw, 28px);
  letter-spacing: -0.035em;
}

h2 {
  letter-spacing: -0.025em;
}

h3 {
  letter-spacing: -0.02em;
}

.section-head p,
.payment-box p,
.auth-box p,
.version-report-card > p,
.analysis-section p {
  font-size: 0.95rem;
  line-height: 1.68;
}

.quota-box {
  border-radius: var(--radius-sm);
  min-width: 122px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--primary) 7%, var(--surface)), var(--surface));
}

.quota-box strong {
  font-size: clamp(18px, 1.3vw, 22px);
  letter-spacing: -0.03em;
}

.mode-tabs,
.designer-toolbar {
  gap: 9px;
  padding: 12px clamp(16px, 1.4vw, 22px);
  scrollbar-width: thin;
}

.mode-tab {
  min-width: auto;
  padding: 0 14px;
  background: color-mix(in srgb, var(--surface-2) 72%, var(--surface));
  color: color-mix(in srgb, var(--muted) 84%, var(--text));
  border-color: color-mix(in srgb, var(--line) 72%, transparent);
}

.mode-tab:hover {
  border-color: color-mix(in srgb, var(--primary) 34%, var(--line));
  color: var(--text);
  transform: translateY(-1px);
}

.mode-tab.active {
  position: relative;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--primary) 16%, var(--surface)), color-mix(in srgb, var(--primary) 8%, var(--surface)));
  border-color: color-mix(in srgb, var(--primary) 48%, var(--line));
  color: var(--primary-strong);
  box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--primary) 72%, transparent);
}

.mode-tab.active svg {
  color: var(--primary);
}

.composer-topline {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.engine-context {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 90%, var(--surface-2));
  padding: 0 12px;
  color: var(--muted);
  font-size: 12px;
}

.engine-context span,
.engine-context strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.engine-context strong {
  color: var(--text);
  font-size: 12px;
}

.engine-context.empty strong {
  color: var(--muted);
}

.prompt-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: min(888px, 100%);
  margin: 8px auto 0;
}

.prompt-presets button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.prompt-presets button:hover {
  border-color: color-mix(in srgb, var(--primary) 36%, var(--line));
  color: var(--primary-strong);
  background: color-mix(in srgb, var(--primary) 7%, var(--surface));
}

.prompt-presets svg {
  width: 13px;
  height: 13px;
}

.image-script-panel,
.version-dropzone {
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 94% 18%, color-mix(in srgb, var(--gold) 13%, transparent), transparent 24%),
    color-mix(in srgb, var(--primary) 5%, var(--surface));
}

.image-script-preview,
.version-file-summary,
.analysis-section,
.design-result,
.manual-summary div,
.version-stats div,
.account-detail {
  border-radius: var(--radius-sm);
}

.chat-log {
  padding: 10px clamp(14px, 1.6vw, 22px);
  gap: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.message {
  width: min(920px, 100%);
  justify-self: center;
  display: grid;
  align-content: start;
  gap: 6px;
  border: 0;
  border-radius: 0;
  padding: 0;
  line-height: 1.34;
  box-shadow: none;
  background: transparent;
}

.message + .message {
  margin-top: 0;
}

.message-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 0;
  margin-top: 0;
  padding-left: 0;
  gap: 4px;
}

.message.user .message-actions {
  justify-content: flex-end;
  padding-right: 4px;
  min-height: 18px;
  margin-top: 2px;
  gap: 4px;
}

.message-body {
  padding: 0;
  line-height: 1.28;
  color: var(--text);
  white-space: pre-wrap;
  margin-bottom: 0;
}

.message-body > :first-child {
  margin-top: 0;
}

.message-body br + br + br {
  display: none;
}

.message-copy,
.message-edit,
.code-copy {
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, var(--surface-2));
  color: var(--muted);
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.message-copy,
.message-edit,
.code-copy {
  width: 26px;
  height: 26px;
  min-height: 26px;
  padding: 0;
}

.message-copy:hover,
.message-edit:hover,
.code-copy:hover {
  border-color: color-mix(in srgb, var(--primary) 34%, var(--line));
  color: var(--primary-strong);
  background: var(--surface);
}

.message-copy.copied,
.code-copy.copied {
  border-color: #c6ccd2;
  color: #6f7780;
  background: #e5e7eb;
  box-shadow: inset 0 0 0 1px rgba(111, 119, 128, 0.18);
}

.message-copy svg,
.message-edit svg,
.code-copy svg {
  width: 12px;
  height: 12px;
}

.message.assistant {
  background: transparent;
}

.message.user {
  width: fit-content;
  max-width: min(760px, 86%);
  justify-self: end;
  display: grid;
  align-items: flex-end;
  gap: 6px;
}

.message.user .message-body {
  border-radius: 18px;
  background: #f4f4f5;
  border: 1px solid #ececef;
  padding: 8px 13px;
  color: #1f2328;
  line-height: 1.36;
  white-space: pre-wrap;
}

.message.user .message-copy,
.message.user .message-edit {
  width: 22px;
  height: 22px;
  min-height: 22px;
  background: transparent;
  border-color: transparent;
  color: #8a8f98;
}

.script-file-downloads,
.script-attachments {
  width: min(920px, 100%);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}

.script-attachments {
  width: auto;
  max-width: min(920px, 100%);
  justify-self: start;
  gap: 6px;
  margin-top: 2px;
}

.script-package-button,
.script-file-button {
  min-height: 30px;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 92%, var(--surface-2));
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.script-package-button {
  background: #1f2328;
  border-color: #1f2328;
  color: #fff;
}

.script-package-button svg,
.script-file-button svg {
  width: 14px;
  height: 14px;
}

.script-package-button:hover,
.script-file-button:hover {
  transform: translateY(-1px);
}

.script-attachment-card {
  width: 62px;
  height: 62px;
  min-height: 62px;
  border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
  border-radius: 8px;
  background: #fff;
  color: #1f2328;
  display: grid;
  grid-template-rows: 28px 14px;
  place-items: center;
  align-content: center;
  gap: 3px;
  padding: 5px;
  text-align: center;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.script-attachment-card:hover {
  border-color: color-mix(in srgb, var(--primary) 38%, #dedee3);
  background: color-mix(in srgb, var(--primary) 4%, #fff);
  transform: translateY(-1px);
}

.script-attachment-card > svg {
  display: none;
}

.script-attachment-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--primary) 9%, #f4f6f8);
  color: var(--primary-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.script-attachment-icon svg {
  width: 15px;
  height: 15px;
}

.script-attachment-copy {
  min-width: 0;
  width: 100%;
  display: block;
}

.script-attachment-copy strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
}

.script-attachment-copy small {
  display: none;
}

.memory-fold {
  width: min(920px, 100%);
  justify-self: center;
  margin-bottom: 8px;
  border: 1px dashed color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface) 88%, var(--surface-2));
  color: var(--muted);
  padding: 8px 12px;
}

.memory-fold summary {
  cursor: pointer;
  font-weight: 800;
}

.memory-fold p {
  margin-top: 8px;
  line-height: 1.58;
}

.message code,
.design-result code,
.manual-body,
.script-card pre,
.command-card pre {
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  line-height: 1.32;
}

.code-block {
  position: relative;
  margin: 2px 0 6px;
  white-space: normal;
}

.code-copy {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.message .code-block code {
  padding: 28px 10px 10px;
  white-space: pre;
}

.typing-indicator {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

.typing-indicator span {
  margin-right: 2px;
}

.typing-indicator i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--primary);
  animation: typingPulse 1s ease-in-out infinite;
}

.typing-indicator i:nth-child(3) {
  animation-delay: 0.15s;
}

.typing-indicator i:nth-child(4) {
  animation-delay: 0.3s;
}

@keyframes typingPulse {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.composer {
  padding: 10px clamp(14px, 1.4vw, 20px) 14px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 86%, transparent), var(--surface));
  display: grid;
  justify-items: center;
  gap: 8px;
  align-content: start;
}

.composer textarea,
.designer-form textarea,
.version-input-card textarea,
.auth-box textarea,
.auth-box input {
  border-radius: var(--radius-md);
  padding: 13px 14px;
  font-size: 0.98rem;
  line-height: 1.7;
  background: color-mix(in srgb, var(--surface) 94%, var(--surface-2));
}

.composer textarea {
  height: 104px;
  min-height: 104px;
  max-height: 104px;
  resize: none;
}

.designer-form textarea,
.version-input-card textarea {
  min-height: 190px;
}

.composer textarea:focus,
.designer-form textarea:focus,
.version-input-card textarea:focus,
.auth-box textarea:focus,
.auth-box input:focus {
  border-color: color-mix(in srgb, var(--primary) 54%, var(--line));
  box-shadow: var(--focus-ring);
}

.composer-tools {
  gap: 12px;
  margin-top: 12px;
}

.composer-topline,
.composer-input-shell {
  width: min(888px, 100%);
}

.composer-input-shell {
  position: relative;
}

.composer-input-shell textarea {
  padding-right: 104px;
}

.send-icon-button {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 12px 24px color-mix(in srgb, var(--primary) 24%, transparent);
}

.send-icon-button:hover {
  background: var(--primary-strong);
  transform: translateY(-1px);
}

.send-icon-button svg {
  width: 18px;
  height: 18px;
}

.memory-toggle {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 92%, var(--surface-2));
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: var(--shadow-card);
}

.memory-toggle input {
  accent-color: var(--primary);
  width: 14px;
  height: 14px;
}

.memory-toggle.active {
  color: var(--primary-strong);
  border-color: color-mix(in srgb, var(--primary) 38%, var(--line));
  background: color-mix(in srgb, var(--primary) 9%, var(--surface));
}

.composer-control-row {
  position: absolute;
  right: 54px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.assistant-model-menu {
  position: relative;
}

.assistant-model-button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 94%, var(--surface-2));
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  box-shadow: var(--shadow-card);
}

.assistant-model-button span {
  font-size: 12px;
  font-weight: 900;
}

.assistant-model-button small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.assistant-model-button svg {
  width: 14px;
  height: 14px;
}

.assistant-model-button:hover,
.assistant-model-button[aria-expanded="true"] {
  color: var(--primary-strong);
  border-color: color-mix(in srgb, var(--primary) 38%, var(--line));
  background: color-mix(in srgb, var(--primary) 7%, var(--surface));
}

.assistant-model-panel {
  position: absolute;
  right: 0;
  bottom: 40px;
  width: 330px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 18px 46px rgba(26, 42, 36, 0.16);
  padding: 8px;
  z-index: 20;
}

.assistant-model-panel-title {
  color: var(--muted);
  padding: 8px 10px 6px;
  font-size: 12px;
  font-weight: 900;
}

.assistant-model-option {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  text-align: left;
}

.assistant-model-option:hover,
.assistant-model-option.active {
  background: color-mix(in srgb, var(--primary) 8%, var(--surface-2));
}

.assistant-model-option.disabled {
  cursor: not-allowed;
  opacity: 0.48;
  filter: grayscale(0.25);
}

.assistant-model-option span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.assistant-model-option strong {
  font-size: 13px;
  line-height: 1.2;
}

.assistant-model-option small {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.assistant-model-option em,
.assistant-model-option b {
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 82%, var(--surface));
  color: var(--muted);
  padding: 4px 7px;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.assistant-model-option b {
  color: #9a6a13;
  background: #fff4d6;
}

.assistant-model-option svg {
  width: 15px;
  height: 15px;
  color: var(--primary-strong);
}

.composer-topline .select-wrap {
  min-width: 124px;
  min-height: 30px;
  padding: 0 7px;
  font-size: 12px;
}

.composer-topline .select-wrap svg {
  width: 15px;
  height: 15px;
}

.select-wrap,
.designer-form select,
.designer-form input {
  min-height: 44px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface) 94%, var(--surface-2));
}

.select-wrap {
  min-width: min(280px, 100%);
}

.designer-form,
.version-upload-area,
.version-input-card,
.version-result,
.tool-panel {
  padding: clamp(16px, 1.55vw, 22px);
}

.designer-form label,
.version-input-card label {
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.design-output {
  padding: clamp(16px, 1.55vw, 22px);
}

.designer-form .design-chat-composer {
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
}

.designer-form .design-chat-composer textarea {
  min-height: 142px;
  padding: 12px 13px;
  font-size: 0.94rem;
  line-height: 1.62;
  border: 0;
  background: color-mix(in srgb, var(--surface) 88%, var(--surface-2));
}

.designer-form .design-chat-controls label {
  gap: 5px;
  font-size: 12px;
  letter-spacing: 0;
}

.designer-form .design-chat-controls select,
.designer-form .custom-size-fields input {
  min-height: 36px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
}

.designer-form .design-chat-controls .design-upload-button,
.designer-form .design-chat-controls .design-submit-button {
  width: 36px;
  height: 36px;
  min-height: 36px;
}

.designer-form .design-option-area {
  grid-template-columns: minmax(112px, 0.75fr) minmax(132px, 0.9fr) minmax(120px, 0.9fr) minmax(130px, 1fr) 36px 36px;
  align-items: end;
  gap: 7px;
}

.designer-form .design-option-area label {
  gap: 5px;
  font-size: 12px;
  letter-spacing: 0;
}

.designer-form .design-option-area select {
  min-height: 36px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
}

.designer-form .design-option-area .design-upload-button,
.designer-form .design-option-area .design-submit-button {
  width: 36px;
  height: 36px;
  min-height: 36px;
}

.tool-title {
  font-size: 0.98rem;
  letter-spacing: -0.015em;
}

.snippet {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.91rem;
  line-height: 1.58;
}

.designer-form .design-mode-option {
  border-color: var(--line);
  background: color-mix(in srgb, var(--surface) 96%, var(--surface-2));
  box-shadow: none;
}

.designer-form .design-mode-option.active {
  border-color: color-mix(in srgb, var(--primary) 68%, var(--line));
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--primary) 88%, transparent);
}

.designer-form .design-mode-option.active::after {
  content: "当前";
  justify-self: end;
  align-self: start;
  grid-column: 2;
  grid-row: 1;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 900;
}

.manual-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  color: var(--muted);
}

.manual-tab.active,
.manual-tab:hover {
  color: var(--primary-strong);
}

.manual-category {
  min-height: 40px;
}

.manual-category::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 45%, transparent);
}

.manual-category.active::before {
  background: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 14%, transparent);
}

.tag-cloud {
  gap: 9px;
}

.tag-cloud button {
  min-height: 36px;
  padding: 0 11px;
  background: color-mix(in srgb, var(--surface) 88%, var(--surface-2));
}

.tag-cloud button:hover {
  color: var(--primary-strong);
  border-color: color-mix(in srgb, var(--primary) 34%, var(--line));
}

.tag-cloud button.active-filter {
  color: var(--primary-strong);
  background: color-mix(in srgb, var(--primary) 13%, var(--surface));
  box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--primary) 60%, transparent);
}

.quick-prompt {
  gap: 10px;
  padding: 11px 12px;
}

.quick-prompt span {
  min-width: 0;
}

.manual-entry h3,
.version-card h3,
.script-card h3,
.plan-card h3 {
  font-size: clamp(17px, 1.05vw, 20px);
}

.script-card,
.command-card,
.manual-entry,
.plan-card,
.circle-card {
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.script-card:hover,
.command-card:hover,
.manual-entry:hover,
.plan-card:hover,
.circle-card:hover {
  border-color: color-mix(in srgb, var(--primary) 24%, var(--line));
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.resource-topline {
  gap: 7px;
  font-size: 0.88rem;
}

.chip {
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  background: color-mix(in srgb, var(--surface-2) 76%, var(--surface));
  color: color-mix(in srgb, var(--muted) 84%, var(--text));
  font-weight: 700;
}

.command-syntax {
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
}

.command-main h3 {
  font-size: clamp(18px, 1.15vw, 21px);
}

.analysis-table th,
.analysis-table td {
  padding: 13px 14px;
}

.analysis-table th {
  font-size: 0.9rem;
}

.analysis-table td {
  font-size: 0.92rem;
}

.pricing-grid {
  gap: 16px;
}

.plan-card {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: start;
}

.plan-card.featured {
  background:
    radial-gradient(circle at 92% 8%, color-mix(in srgb, var(--gold) 17%, transparent), transparent 28%),
    var(--surface);
}

.plan-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  border-radius: var(--radius-sm);
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
}

.plan-icon svg {
  width: 21px;
  height: 21px;
}

.price strong {
  font-size: clamp(28px, 2vw, 38px);
  letter-spacing: -0.05em;
}

.feature-list {
  line-height: 1.82;
}

.circle-grid {
  gap: 16px;
}

.circle-card strong {
  font-size: clamp(18px, 1.35vw, 24px);
  letter-spacing: -0.035em;
}

.settings-box,
.agreement-box,
.login-shell {
  border-radius: var(--radius-lg);
}

.toast {
  border-radius: var(--radius-sm);
  box-shadow: 0 18px 40px rgba(26, 42, 36, 0.16);
}

@media (max-width: 1080px) {
  :root {
    --assistant-promo-width: 100%;
    --assistant-content-width: min(920px, 100%);
    --assistant-stage-width: 100%;
    --assistant-gap: 18px;
  }

  .app-shell {
    grid-template-columns: 92px 1fr;
  }

  body.sidebar-collapsed .app-shell {
    grid-template-columns: 0 1fr;
  }

  .brand div:last-child {
    display: none;
  }

  .nav-item {
    justify-content: center;
    font-size: 12px;
  }

  .sidebar {
    padding: 18px 12px;
  }

  .status-pill span:last-child {
    display: none;
  }

  .settings-entry {
    justify-content: center;
    padding: 0;
  }

  .settings-entry svg {
    margin: 0;
  }

  .assistant-layout,
  .designer-layout,
  .version-analysis-layout,
  .task-market-layout,
  .script-layout,
  .planner-layout {
    grid-template-columns: 1fr;
  }

  .assistant-layout {
    width: 100%;
    gap: 18px;
  }

  .assistant-promo-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
  }

  .topbar {
    grid-template-columns: minmax(190px, auto) minmax(280px, 1fr);
    align-items: stretch;
  }

  .top-brand {
    min-width: 0;
  }

  .search-wrap {
    min-width: 0;
  }

  .top-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .top-actions .ghost-button,
  .top-actions .primary-button {
    flex: 1 1 0;
    justify-content: center;
  }

  .login-shell {
    grid-template-columns: 0 1fr;
  }

  .login-visual {
    display: none;
  }

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

  .mode-tabs,
  .designer-toolbar,
  .manual-switcher {
    flex-wrap: nowrap;
  }

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

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

  .admin-log-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  :root {
    --assistant-chat-height: min(58vh, 520px);
    --assistant-composer-height: auto;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    height: auto;
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-toggle {
    top: 76px;
    right: 12px;
    width: 34px;
    height: 34px;
    border-radius: 999px;
  }

  body.sidebar-collapsed .sidebar {
    height: 0;
    overflow: visible;
    transform: none;
    padding-top: 0;
    padding-bottom: 0;
    border-bottom: 0;
  }

  body.sidebar-collapsed .sidebar > :not(.sidebar-toggle) {
    display: none;
  }

  body.sidebar-collapsed .sidebar-toggle {
    right: 12px;
    top: 12px;
  }

  .brand div:last-child {
    display: none;
  }

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

  .nav-item {
    justify-content: center;
    padding: 8px;
    flex-direction: column;
    font-size: 12px;
  }

  .workspace {
    padding: 12px;
  }

  .payment-box,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

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

  .top-actions .ghost-button,
  .top-actions .primary-button {
    padding: 0 8px;
    min-width: 0;
    font-size: 12px;
    min-height: 36px;
  }

  .login-shell {
    width: calc(100vw - 20px);
    height: auto;
    min-height: calc(100vh - 20px);
  }

  .settings-box {
    width: calc(100vw - 20px);
    padding: 22px 16px;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .gm-letter-modal {
    width: min(440px, calc(100vw - 24px));
    max-height: 82vh;
  }

  .gm-letter-shell,
  .gm-letter-image {
    max-height: 82vh;
  }

  .login-panel {
    width: calc(100% - 32px);
    padding: 58px 0 28px;
  }

  .login-panel h2 {
    font-size: 28px;
  }

  .login-tabs {
    gap: 18px;
  }

  .landing-nav {
    padding: 14px 5vw;
    gap: 12px;
  }

  .landing-nav-links {
    display: none;
  }

  .landing-logo img {
    width: 24px;
    height: 24px;
  }

  .landing-slide-primary {
    padding: 80px 5vw 96px;
  }

  .landing-slide-primary .landing-copy h1 {
    font-size: clamp(34px, 9vw, 56px);
  }

  .landing-features,
  .landing-engines,
  .landing-slide-secondary {
    padding-left: 5vw;
    padding-right: 5vw;
  }

  .landing-features-grid {
    grid-template-columns: 1fr;
  }

  .landing-feature {
    padding: 32px 24px;
  }

  .landing-engines-list {
    gap: 22px;
    font-size: clamp(20px, 6vw, 30px);
  }

  .landing-footer-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .manual-browser,
  .task-market-stats,
  .resource-grid,
  .manual-summary,
  .analysis-stats,
  .pricing-grid,
  .circle-grid,
  .context-column,
  .materials-grid,
  .tutorial-grid,
  .membership-hero,
  .membership-checkout,
  .membership-metrics,
  .membership-perks,
  .credit-pack-grid {
    grid-template-columns: 1fr;
  }

  .membership-hero {
    min-height: auto;
    padding: 20px;
  }

  .membership-hero h1 {
    font-size: 24px;
  }

  .membership-order {
    position: static;
  }

  .task-market-toolbar,
  .task-card-head,
  .task-tech-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .task-card-head > strong {
    white-space: normal;
  }

  .task-card-actions .primary-button,
  .task-card-actions .outline-button,
  .task-market-actions .primary-button,
  .task-market-actions .outline-button {
    width: 100%;
    justify-content: center;
  }

  .manual-menu {
    position: static;
  }

  .chat-column {
    min-height: auto;
  }

  .section-head,
  .section-head.compact {
    gap: 14px;
    padding: 16px;
  }

  #assistantPanel .chat-column {
    gap: 10px;
  }

  .assistant-promo-column {
    grid-template-columns: 1fr;
  }

  #assistantPanel .section-head,
  #assistantPanel .mode-tabs,
  #assistantPanel .image-script-panel,
  #assistantPanel .chat-log-shell,
  #assistantPanel .composer {
    width: 100%;
  }

  .composer-topline {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 22px;
  }

  .quota-box {
    width: 100%;
    text-align: left;
  }

  .mode-tabs,
  .designer-toolbar {
    padding: 12px;
    gap: 8px;
  }

  .mode-tab {
    min-height: 38px;
    padding: 0 11px;
    font-size: 13px;
  }

  .mode-tab svg {
    width: 15px;
    height: 15px;
  }

  .message {
    max-width: 100%;
  }

  .chat-log {
    padding: 10px;
  }

  .message {
    width: min(100%, 920px);
    padding: 0;
  }

  .message.user {
    width: fit-content;
    max-width: 92%;
  }

  .message-body {
    padding: 0;
  }

  .composer {
    padding: 12px 12px 18px;
  }

  .composer textarea {
    height: 126px;
    min-height: 126px;
    max-height: 126px;
  }

  .composer-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .image-script-panel {
    margin: 12px 14px 0;
    grid-template-columns: 1fr;
  }

  .designer-fields {
    grid-template-columns: 1fr;
  }

  .design-chat-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr)) 36px 36px;
    align-items: end;
  }

  .design-option-area {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px 36px;
    align-items: end;
  }

  .designer-form .design-option-area {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px 36px;
  }

  .design-option-area > label {
    min-width: 0;
  }

  .design-option-area [data-design-mode-field] {
    grid-column: 1 / 3;
  }

  .design-upload-button,
  .design-submit-button {
    width: 36px;
  }

  .design-reference-list {
    display: flex;
  }

  .custom-size-fields {
    grid-template-columns: 1fr;
  }

  .website-builder-grid {
    grid-template-columns: 1fr;
  }

  .select-wrap,
  .version-upload-actions .outline-button,
  .composer-tools .primary-button {
    width: 100%;
  }

  .script-card-head {
    flex-direction: column;
  }

  .script-card-head .outline-button,
  .command-main .outline-button {
    width: 100%;
  }

  .command-main,
  .command-syntax {
    align-items: stretch;
    flex-direction: column;
  }

  .tag-cloud button {
    min-height: 34px;
    font-size: 12px;
  }

  .manual-tab {
    min-height: 38px;
    font-size: 13px;
  }

  .version-dropzone {
    padding: 18px;
  }

  .analysis-table {
    min-width: 760px;
  }

  .payment-box .primary-button,
  .section-head .primary-button,
  .section-head .outline-button {
    width: 100%;
  }

  .planner-section-grid {
    grid-template-columns: 1fr;
  }

  .planner-status {
    width: max-content;
  }

  .sidebar-popover,
  .profile-popover {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
  }
}

@media (max-width: 560px) {
  :root {
    --assistant-chat-height: min(54vh, 460px);
  }

  .design-chat-composer {
    padding: 9px;
  }

  .design-chat-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 1px;
  }

  .design-chat-tabs .mode-tab {
    flex: 0 0 auto;
  }

  .design-chat-controls {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px 36px;
  }

  .design-chat-controls label {
    min-width: 0;
  }

  .design-chat-controls label:nth-child(3) {
    grid-column: 1 / 3;
  }

  .design-mode-switch {
    grid-template-columns: 1fr;
  }

  .design-mode-option {
    min-height: 52px;
  }

  .design-option-area {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px 36px;
  }

  .designer-form .design-option-area {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px 36px;
  }

  .design-option-area > label:nth-child(1),
  .design-option-area > label:nth-child(2),
  .design-option-area [data-design-mode-field] {
    grid-column: 1 / 3;
  }

  .design-fullset-fields {
    grid-column: 1 / 3;
    grid-template-columns: 1fr;
  }

  .topbar {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 12px;
  }

  .top-brand {
    align-items: flex-start;
  }

  .top-brand-logo {
    width: 32px;
    height: 32px;
  }

  .top-brand span {
    display: none;
  }

  .search-wrap {
    height: 40px;
    padding: 0 10px;
  }

  .top-actions,
  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .assistant-layout,
  #assistantPanel .chat-column {
    gap: 8px;
  }

  .assistant-promo-column {
    gap: 8px;
  }

  #assistantPanel .chat-log-shell {
    border-radius: var(--radius-sm);
  }

  #assistantPanel .chat-log-shell.expanded {
    height: min(70vh, 620px);
    min-height: min(70vh, 620px);
    max-height: min(70vh, 620px);
  }

  .chat-log {
    padding: 8px 10px 46px;
    gap: 6px;
  }

  .message.user {
    max-width: 92%;
  }

  .message.user .message-body {
    padding: 7px 11px;
  }

  .composer {
    padding: 9px 10px 12px;
  }

  .composer-topline,
  .composer-input-shell {
    width: 100%;
  }

  .composer textarea {
    height: 96px;
    min-height: 96px;
    max-height: 96px;
    padding-right: 88px;
  }

  .composer-tools {
    gap: 8px;
  }

  .composer-control-row {
    position: static;
    margin-top: 7px;
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .assistant-model-panel {
    left: 0;
    right: auto;
    width: min(330px, calc(100vw - 42px));
  }
}

/* Assistant workspace viewport fix: keep the composer visible and poster sizing stable. */
body.in-platform[data-section="assistant"] {
  overflow: hidden;
}

body.in-platform[data-section="assistant"] .app-shell,
body.in-platform[data-section="assistant"] .workspace {
  height: 100vh;
  overflow: hidden;
}

body.in-platform[data-section="assistant"] .workspace {
  display: flex;
  flex-direction: column;
}

body.in-platform[data-section="assistant"] .topbar {
  flex: 0 0 auto;
}

body.in-platform[data-section="assistant"] #assistantPanel.active {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}

body.in-platform[data-section="assistant"] .assistant-layout {
  width: min(1740px, 100%);
  height: 100%;
  min-height: 0;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: clamp(22px, 2vw, 42px);
  align-items: stretch;
}

body.in-platform[data-section="assistant"] .assistant-promo-column {
  width: 360px;
  max-width: 360px;
  align-self: start;
  gap: 16px;
}

body.in-platform[data-section="assistant"] .assistant-promo-column img {
  width: 360px;
  height: 120px;
  aspect-ratio: 3 / 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

body.in-platform[data-section="assistant"] #assistantPanel .chat-column {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 6px;
  overflow: hidden;
}

body.in-platform[data-section="assistant"] #assistantPanel .chat-log-shell,
body.in-platform[data-section="assistant"] #assistantPanel .composer {
  width: 100%;
  max-width: none;
}

body.in-platform[data-section="assistant"] #assistantPanel .chat-log-shell,
body.in-platform[data-section="assistant"] #assistantPanel .chat-log-shell.expanded {
  height: auto;
  min-height: 0;
  max-height: none;
}

body.in-platform[data-section="assistant"] #assistantPanel .chat-log {
  min-height: 0;
  height: 100%;
  padding-bottom: 48px;
}

body.in-platform[data-section="assistant"] #assistantPanel .composer {
  height: auto;
  min-height: 0;
  max-height: none;
  overflow: visible;
  padding: 8px clamp(12px, 1vw, 16px) 10px;
}

body.in-platform[data-section="assistant"] .composer-topline,
body.in-platform[data-section="assistant"] .composer-input-shell {
  width: 100%;
}

body.in-platform[data-section="assistant"] .engine-context,
body.in-platform[data-section="assistant"] .prompt-presets {
  display: none !important;
}

body.in-platform[data-section="assistant"] .composer-topline {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 6px;
}

body.in-platform[data-section="assistant"] .composer-topline .select-wrap {
  width: 124px;
  min-width: 124px;
  min-height: 30px;
  height: 30px;
  padding: 0 6px;
  font-size: 12px;
  border-radius: 8px;
  gap: 5px;
}

body.in-platform[data-section="assistant"] .composer-topline .select-wrap svg {
  width: 14px;
  height: 14px;
}

body.in-platform[data-section="assistant"] .composer textarea {
  height: 86px;
  min-height: 86px;
  max-height: 86px;
}

@media (max-width: 1360px) {
  body.in-platform[data-section="assistant"] .assistant-layout {
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 18px;
  }

  body.in-platform[data-section="assistant"] .assistant-promo-column {
    width: 300px;
    max-width: 300px;
    gap: 12px;
  }

  body.in-platform[data-section="assistant"] .assistant-promo-column img {
    width: 300px;
    height: 100px;
  }
}

@media (max-width: 1080px) {
  body.in-platform[data-section="assistant"] {
    overflow: auto;
  }

  body.in-platform[data-section="assistant"] .app-shell,
  body.in-platform[data-section="assistant"] .workspace {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  body.in-platform[data-section="assistant"] #assistantPanel.active {
    display: block;
  }

  body.in-platform[data-section="assistant"] .assistant-layout {
    height: auto;
    grid-template-columns: 1fr;
  }

  body.in-platform[data-section="assistant"] .assistant-promo-column {
    width: 100%;
    max-width: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.in-platform[data-section="assistant"] .assistant-promo-column img {
    width: 100%;
    height: auto;
  }

  body.in-platform[data-section="assistant"] #assistantPanel .chat-column {
    height: auto;
    min-height: 0;
    display: flex;
  }

  body.in-platform[data-section="assistant"] #assistantPanel .chat-log-shell {
    height: min(58vh, 560px);
    min-height: 360px;
    max-height: 560px;
  }
}

@media (max-width: 760px) {
  body.in-platform[data-section="assistant"] .assistant-promo-column {
    grid-template-columns: 1fr;
  }

  body.in-platform[data-section="assistant"] #assistantPanel .chat-log-shell {
    height: min(54vh, 480px);
    min-height: 300px;
  }

  body.in-platform[data-section="assistant"] .composer textarea {
    height: 96px;
    min-height: 96px;
    max-height: 96px;
  }
}

body.in-platform[data-section="assistant"] #engineContext,
body.in-platform[data-section="assistant"] #promptPresets {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

body.in-platform[data-section="assistant"] .composer-topline {
  width: 100% !important;
  display: flex !important;
  justify-content: flex-start !important;
  margin-bottom: 6px !important;
}

body.in-platform[data-section="assistant"] .composer-topline .select-wrap {
  width: 124px !important;
  min-width: 124px !important;
  max-width: 124px !important;
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 6px !important;
  font-size: 12px !important;
  gap: 5px !important;
}

body.in-platform[data-section="assistant"] #engineSelect {
  width: 90px;
}

body.in-platform[data-section="assistant"] .composer-input-shell {
  width: 100% !important;
}

body.in-platform[data-section="assistant"] .composer textarea {
  height: 116px !important;
  min-height: 116px !important;
  max-height: 116px !important;
  padding-right: 284px !important;
}

@media (max-width: 900px) {
  body.in-platform[data-section="assistant"] .composer textarea {
    padding-right: 88px !important;
  }

  body.in-platform[data-section="assistant"] .composer-control-row {
    position: static;
    margin-top: 7px;
    width: 100%;
  }
}

.version-health-report {
  gap: 18px;
}

.version-score-hero {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 10%, var(--surface)), var(--surface));
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px;
  align-items: center;
  gap: 18px;
  padding: 18px;
}

.version-score-hero > div:first-child > span {
  color: var(--primary-strong);
  font-weight: 800;
  font-size: 13px;
}

.version-score-hero h2 {
  margin-top: 6px;
}

.version-score-ring {
  border: 8px solid color-mix(in srgb, var(--primary) 26%, var(--line));
  border-radius: 999px;
  width: 118px;
  height: 118px;
  place-items: center;
  display: grid;
  background: var(--surface);
}

.version-score-ring strong {
  font-size: 34px;
  line-height: 1;
}

.version-score-ring span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.version-hero-tags,
.version-cos-files {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  display: flex;
}

.version-hero-tags span,
.version-cos-files a {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.version-cos-files {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 10px;
}

.version-cos-files strong {
  align-self: center;
}

.version-score-cards {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.version-score-cards div {
  min-height: 96px;
}

.version-score-cards em {
  color: var(--muted);
  margin-top: 6px;
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
  display: block;
}

.version-score-cards .good strong {
  color: #176f4d;
}

.version-score-cards .warn strong {
  color: #9a6a13;
}

.version-score-cards .bad strong {
  color: #b33a2f;
}

.version-report-tabs {
  border-bottom: 1px solid var(--line);
  gap: 8px;
  display: flex;
  overflow-x: auto;
}

.version-report-tabs button {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  min-height: 38px;
  white-space: nowrap;
  padding: 0 10px;
  font-weight: 800;
}

.version-report-tabs button.active,
.version-report-tabs button:hover {
  border-bottom-color: var(--primary);
  color: var(--primary-strong);
}

.version-tab-panel,
.version-tab-content {
  display: grid;
  gap: 12px;
}

.version-overview-grid,
.version-two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  display: grid;
}

.version-info-list {
  margin: 0;
  display: grid;
  gap: 8px;
}

.version-info-list div {
  border-bottom: 1px solid var(--line);
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
  padding-bottom: 8px;
  display: grid;
}

.version-info-list dt {
  color: var(--muted);
}

.version-info-list dd {
  margin: 0;
  font-weight: 800;
}

.version-ced-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
  display: grid;
  gap: 7px;
}

.version-ced-block p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.version-table-title {
  padding: 10px 12px 0;
  font-size: 15px;
}

.version-history-list {
  gap: 8px;
  max-height: 360px;
  display: grid;
  overflow-y: auto;
}

.version-history-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-align: left;
  gap: 5px;
  padding: 10px;
  display: grid;
}

.version-history-item:hover {
  border-color: color-mix(in srgb, var(--primary) 34%, var(--line));
  background: color-mix(in srgb, var(--primary) 5%, var(--surface));
}

.version-history-item strong {
  color: var(--text);
}

.version-history-item span,
.version-history-item small {
  color: var(--muted);
  font-size: 12px;
}

.compact-empty {
  min-height: auto;
  padding: 12px;
  font-size: 12px;
}

@media (max-width: 1280px) {
  .pricing-grid,
  .credit-pack-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .version-score-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .version-score-hero,
  .version-overview-grid,
  .version-two-col {
    grid-template-columns: 1fr;
  }

  .version-score-ring {
    width: 104px;
    height: 104px;
  }

  .version-score-cards {
    grid-template-columns: 1fr;
  }

  .version-info-list div {
    grid-template-columns: 1fr;
  }
}

/* ============ Redemption Codes Admin ============ */
.rc-section {
  margin-top: 24px;
}

.rc-generate {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.rc-generate > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  user-select: none;
}

.rc-generate > summary::-webkit-details-marker { display: none; }

.rc-generate > summary i {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.rc-generate > summary strong {
  font-size: 14px;
  color: var(--text);
}

.rc-generate > summary span {
  font-size: 12px;
  color: var(--muted);
}

.rc-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
  border-top: 1px solid var(--line);
}

.rc-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.rc-form label.rc-form-full {
  grid-column: 1 / -1;
}

.rc-form input,
.rc-form select {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}

.rc-form input:focus,
.rc-form select:focus {
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
}

.rc-form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.rc-filter {
  display: flex;
  gap: 12px;
  padding: 14px 18px;
  flex-wrap: wrap;
  align-items: center;
}

.rc-filter .admin-search {
  flex: 1;
  min-width: 240px;
}

.rc-filter select {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  outline: none;
}

.rc-table th,
.rc-table td {
  font-size: 13px;
  vertical-align: middle;
}

.rc-table code {
  font-family: "JetBrains Mono", "SF Mono", ui-monospace, monospace;
  font-size: 12px;
  background: var(--surface-2);
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--text);
}

.rc-badge {
  display: inline-block;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  background: var(--surface-2);
  color: var(--muted);
}

.rc-badge.active {
  background: rgba(35, 111, 90, 0.12);
  color: var(--primary-strong);
}

.rc-badge.disabled {
  background: rgba(180, 63, 46, 0.10);
  color: var(--accent);
}

.rc-badge.used-up {
  background: rgba(184, 131, 36, 0.12);
  color: var(--gold);
}

.rc-action-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.rc-action-row button {
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 12px;
  cursor: pointer;
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.rc-action-row button:hover {
  border-color: var(--text);
}

.rc-action-row button.danger {
  color: var(--accent);
}

.rc-pagination {
  display: flex;
  gap: 8px;
  padding: 12px 18px;
  justify-content: flex-end;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.rc-pagination button {
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 12px;
  cursor: pointer;
}

.rc-pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.rc-empty {
  text-align: center;
  color: var(--muted);
  padding: 36px 0;
  font-size: 13px;
}

/* Dialog */
.rc-dialog {
  padding: 0;
  border: none;
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  width: min(640px, 92vw);
  box-shadow: var(--shadow);
}

.rc-dialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
}

.rc-dialog-inner {
  display: flex;
  flex-direction: column;
  padding: 20px 24px;
  gap: 16px;
}

.rc-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.rc-dialog-head strong {
  font-size: 16px;
  display: block;
  margin-bottom: 2px;
}

.rc-dialog-head span {
  font-size: 12px;
  color: var(--muted);
}

.rc-result-text {
  width: 100%;
  min-height: 220px;
  max-height: 360px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  font-family: "JetBrains Mono", "SF Mono", ui-monospace, monospace;
  font-size: 12.5px;
  line-height: 1.7;
  resize: vertical;
  outline: none;
}

.rc-dialog-foot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.primary-button.ghost {
  background: var(--surface-2);
  color: var(--text);
}

.primary-button.ghost:hover {
  background: var(--surface);
  border: 1px solid var(--line);
}

@media (max-width: 720px) {
  .rc-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .rc-filter {
    flex-direction: column;
    align-items: stretch;
  }
  .rc-filter .admin-search { min-width: auto; }
}

/* ============ Task Market ============ */
.tm-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 20px 0 16px;
  flex-wrap: wrap;
}

.tm-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 4px;
}

.tm-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s var(--ease-out), color 0.15s var(--ease-out);
}

.tm-tab:hover { color: var(--text); }
.tm-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-card);
}

.tm-filters {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.tm-filters select {
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
  outline: none;
}

.tm-search { width: 240px; }

.tm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.tm-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: border-color 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out), transform 0.05s ease;
}

.tm-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-hover);
}

.tm-card:active { transform: translateY(1px); }

.tm-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.tm-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  letter-spacing: -0.005em;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tm-card-reward {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.tm-card-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tm-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--muted-2);
}

.tm-card-foot-left { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.tm-chip {
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  letter-spacing: 0.02em;
}

.tm-status-badge {
  font-size: 11.5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 500;
}
.tm-status-badge.open { background: rgba(31, 122, 85, 0.10); color: var(--success); }
.tm-status-badge.in_progress { background: rgba(43, 95, 181, 0.10); color: var(--info); }
.tm-status-badge.delivered { background: rgba(184, 131, 36, 0.12); color: var(--gold); }
.tm-status-badge.reviewed { background: rgba(184, 131, 36, 0.12); color: var(--gold); }
.tm-status-badge.completed { background: var(--surface-2); color: var(--muted); }
.tm-status-badge.cancelled { background: rgba(180, 63, 46, 0.10); color: var(--danger); }

.tm-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
  font-size: 12px;
  color: var(--muted);
}

.tm-pagination button {
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 12px;
  cursor: pointer;
  color: var(--text);
}

.tm-pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

.tm-tier-badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-right: 6px;
}
.tm-tier-badge.intern { background: var(--surface-2); color: var(--muted); }
.tm-tier-badge.junior { background: rgba(43, 95, 181, 0.10); color: var(--info); }
.tm-tier-badge.senior { background: var(--grad-signature); color: #fafaf7; }

.tm-tier-rules {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.9;
}

.tm-tech-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 10px 0 18px;
}

.tm-tech-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tm-tech-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
}

.tm-tech-stats {
  display: flex;
  gap: 10px;
  font-size: 11.5px;
  color: var(--muted);
}

.tm-tech-intro {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
}

/* Dialog */
.tm-dialog {
  padding: 0;
  border: none;
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  width: min(560px, 94vw);
  box-shadow: var(--shadow-hover);
}

.tm-dialog-wide { width: min(820px, 94vw); }

.tm-dialog::backdrop {
  background: rgba(10, 10, 10, 0.42);
}

.tm-dialog-inner {
  display: flex;
  flex-direction: column;
  padding: 22px 24px;
  gap: 18px;
}

.tm-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.tm-dialog-head strong {
  font-size: 17px;
  display: block;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.tm-dialog-head span {
  font-size: 12.5px;
  color: var(--muted);
}

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

.tm-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.tm-form-grid label.tm-form-full {
  grid-column: 1 / -1;
}

.tm-form-grid input,
.tm-form-grid select,
.tm-form-grid textarea {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.tm-form-grid textarea {
  height: auto;
  padding: 12px;
  line-height: 1.55;
  resize: vertical;
  min-height: 120px;
}

.tm-form-grid input:focus,
.tm-form-grid select:focus,
.tm-form-grid textarea:focus {
  border-color: var(--text);
  background: var(--surface);
}

.tm-dialog-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
  flex-wrap: wrap;
}

.tm-dialog-foot > div {
  display: flex;
  gap: 10px;
}

.tm-form-tip {
  font-size: 12.5px;
  color: var(--muted);
}

.tm-form-tip strong { color: var(--text); }

/* Detail dialog body */
.tm-detail-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.tm-detail-meta-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tm-detail-desc {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  max-height: 280px;
  overflow-y: auto;
}

.tm-detail-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tm-detail-section h4 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  margin: 0;
  color: var(--text);
}

.tm-app-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tm-app-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tm-app-row.accepted {
  border-color: rgba(35, 111, 90, 0.4);
  background: var(--primary-soft);
}

.tm-app-row-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  font-size: 13px;
}

.tm-app-row-meta {
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tm-app-msg {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.55;
}

.tm-action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.tm-action-row button {
  height: 36px;
}

/* Wallet */
.tm-wallet-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.tm-wallet-card {
  background: var(--surface-2);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tm-wallet-card:first-child {
  background: var(--grad-signature);
  color: #fafaf7;
}

.tm-wallet-card span {
  font-size: 12px;
  opacity: 0.72;
}

.tm-wallet-card strong {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.tm-wallet-card small {
  font-size: 11px;
  opacity: 0.62;
}

.tm-wallet-tier {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.7;
}

.tm-wallet-section strong {
  font-size: 13px;
  display: block;
  margin-bottom: 8px;
}

#tmWalletPending {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

#tmWalletPending .tm-pending-row {
  display: flex;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  background: var(--surface);
}

@media (max-width: 720px) {
  .tm-form-grid,
  .tm-wallet-grid {
    grid-template-columns: 1fr;
  }
  .tm-search { width: 100%; }
}

/* ============ Task image upload ============ */
.tm-upload-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tm-upload-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  color: var(--muted);
}

.tm-upload-count {
  font-variant-numeric: tabular-nums;
}

.tm-upload-count strong { color: var(--text); }

.tm-upload-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.tm-upload-pick,
.tm-upload-item {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  overflow: hidden;
}

.tm-upload-pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  transition: background 0.15s var(--ease-out), border-color 0.15s var(--ease-out);
  text-align: center;
}

.tm-upload-pick:hover {
  background: var(--surface);
  border-color: var(--text);
  color: var(--text);
}

.tm-upload-pick i {
  width: 22px;
  height: 22px;
}

.tm-upload-pick small {
  font-size: 10px;
  opacity: 0.7;
  line-height: 1.3;
  padding: 0 4px;
}

.tm-upload-item {
  border: 1px solid var(--line);
  background: #000;
}

.tm-upload-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tm-upload-item.uploading::after {
  content: "上传中…";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 11px;
}

.tm-upload-item .tm-upload-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: rgba(10, 10, 10, 0.75);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}

.tm-upload-item .tm-upload-del:hover {
  background: var(--danger);
}

.tm-upload-item.failed { border-color: var(--danger); }
.tm-upload-item.failed::after {
  content: "失败";
  position: absolute;
  inset: auto 0 0 0;
  text-align: center;
  font-size: 11px;
  background: rgba(180, 63, 46, 0.85);
  color: #fff;
  padding: 2px;
}

/* Detail gallery */
.tm-detail-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}

.tm-detail-gallery a {
  display: block;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
}

.tm-detail-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s var(--ease-out);
}

.tm-detail-gallery a:hover img {
  transform: scale(1.04);
}

@media (max-width: 720px) {
  .tm-upload-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============ Lightbox + drag/drop ============ */
.tm-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 10, 0.92);
  padding: 24px;
  animation: tmLightboxIn 0.18s var(--ease-out);
}

.tm-lightbox[hidden] { display: none !important; }

@keyframes tmLightboxIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.tm-lightbox-stage {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0;
}

.tm-lightbox-stage img {
  max-width: min(94vw, 1400px);
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  background: #000;
}

.tm-lightbox-meta {
  display: flex;
  gap: 18px;
  color: rgba(250, 250, 247, 0.85);
  font-size: 13px;
}

#tmLightboxName {
  max-width: 60vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tm-lightbox-close,
.tm-lightbox-nav {
  position: absolute;
  border: 0;
  background: rgba(250, 250, 247, 0.1);
  color: rgba(250, 250, 247, 0.92);
  border-radius: 999px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s var(--ease-out), color 0.15s var(--ease-out);
}

.tm-lightbox-close:hover,
.tm-lightbox-nav:hover {
  background: rgba(250, 250, 247, 0.2);
}

.tm-lightbox-close {
  top: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
}

.tm-lightbox-nav {
  top: 50%;
  width: 48px;
  height: 48px;
  transform: translateY(-50%);
}

.tm-lightbox-prev { left: 24px; }
.tm-lightbox-next { right: 24px; }

.tm-lightbox-nav i { width: 24px; height: 24px; }
.tm-lightbox-close i { width: 20px; height: 20px; }

.tm-lightbox-nav[disabled] { opacity: 0.3; cursor: not-allowed; }

.tm-gallery-item {
  display: block;
  border: 0;
  padding: 0;
  background: #000;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  cursor: zoom-in;
}

.tm-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s var(--ease-out);
}

.tm-gallery-item:hover img {
  transform: scale(1.05);
}

/* Drag & drop */
.tm-upload-grid.dragging {
  background: var(--primary-soft);
  outline: 2px dashed var(--primary);
  outline-offset: -4px;
  border-radius: 12px;
}

.tm-upload-pick:focus-within {
  border-color: var(--text);
  background: var(--surface);
  color: var(--text);
}

@media (max-width: 720px) {
  .tm-lightbox { padding: 12px; }
  .tm-lightbox-close { top: 12px; right: 12px; }
  .tm-lightbox-nav { width: 40px; height: 40px; }
  .tm-lightbox-prev { left: 8px; }
  .tm-lightbox-next { right: 8px; }
  #tmLightboxName { max-width: 50vw; }
}

/* ============ Auth method toggle (phone/email) ============ */
.auth-method-toggle {
  display: flex;
  gap: 3px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 10px;
}

.auth-method-tab {
  flex: 1;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s var(--ease-out), color 0.15s var(--ease-out);
}

.auth-method-tab:hover { color: rgba(255, 255, 255, 0.9); }
.auth-method-tab.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* 微信扫码占位 */
.wechat-qr {
  min-height: 200px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}
.wechat-qr-placeholder {
  display: flex; flex-direction: column;
  align-items: center; gap: 8px;
  padding: 22px; text-align: center;
}
.wechat-qr-placeholder svg { width: 42px; height: 42px; color: rgba(255, 255, 255, 0.5); }
.wechat-qr-placeholder p { margin: 0; font-size: 14px; color: rgba(255, 255, 255, 0.85); font-weight: 600; }
.wechat-qr-placeholder span { font-size: 11.5px; color: rgba(255, 255, 255, 0.5); }

.auth-code-field button:disabled {
  background: var(--surface-2);
  color: var(--muted-2);
  cursor: not-allowed;
}

/* ============ Design Workshop ============ */
.workshop-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.workshop-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
  min-height: 600px;
}

.workshop-list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: fit-content;
  position: sticky;
  top: 16px;
}

.workshop-list-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  color: var(--muted);
  padding: 0 2px 6px;
  border-bottom: 1px solid var(--line);
}

.workshop-list-head strong {
  font-size: 14px;
  color: var(--text);
}

.workshop-list-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 70vh;
  overflow-y: auto;
}

.workshop-list-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 2px 2px;
  border-top: 1px solid var(--line);
  margin-top: 4px;
}
.workshop-list-pager .ws-pager-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.workshop-list-pager .ws-pager-btn:hover:not(:disabled) {
  background: var(--surface-2, #f5f5f7);
  border-color: var(--text);
}
.workshop-list-pager .ws-pager-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.workshop-list-pager .ws-pager-info {
  font-size: 12px;
  color: var(--muted);
  flex: 1;
  text-align: center;
}

.workshop-list-item {
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  background: var(--surface-2);
  transition: background 0.15s, border-color 0.15s;
}

.workshop-list-item:hover {
  border-color: var(--line);
}

.workshop-list-item.active {
  background: var(--text);
  color: var(--surface);
}

.workshop-list-item .ws-item-title {
  font-size: 13px;
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}

.workshop-list-item .ws-item-meta {
  font-size: 11.5px;
  opacity: 0.7;
  display: flex;
  gap: 8px;
}

.workshop-editor {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.workshop-editor-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.workshop-title-input {
  flex: 1;
  border: 0;
  background: transparent;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  outline: none;
  padding: 4px 0;
}

.workshop-title-input:focus {
  border-bottom: 2px solid var(--text);
}

.workshop-status {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 12px;
  color: var(--muted);
}

.workshop-meta-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.ws-meta-cycle { position: relative; }
.ws-cycle-custom { margin-top: 8px; }

.workshop-tag-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 12px;
}
.ws-tag-group { display: flex; flex-direction: column; gap: 6px; }
.ws-tag-label { font-size: 12px; color: var(--muted); }
.ws-tag-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.ws-tag-pills button {
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.ws-tag-pills button:hover {
  border-color: color-mix(in srgb, var(--primary) 40%, var(--line));
}
.ws-tag-pills button.active {
  background: color-mix(in srgb, var(--primary) 14%, var(--surface));
  border-color: var(--primary);
  color: var(--primary-strong);
  font-weight: 600;
}

.workshop-advanced {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--text) 2%, var(--surface));
}
.workshop-advanced[open] { background: var(--surface); }
.workshop-advanced > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 600;
  color: var(--text);
}
.workshop-advanced > summary::-webkit-details-marker { display: none; }
.workshop-advanced > summary svg { width: 16px; height: 16px; color: var(--muted); }
.workshop-advanced > summary span { flex: 1; }
.workshop-advanced > summary .ws-adv-chev { transition: transform 0.18s ease; }
.workshop-advanced[open] > summary .ws-adv-chev { transform: rotate(180deg); }
.workshop-adv-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 6px 14px 14px;
}
.workshop-adv-grid label {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 11.5px; color: var(--muted);
}
.workshop-adv-grid select {
  height: 34px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); font-size: 12.5px;
}
@media (max-width: 980px) {
  .workshop-meta-row { grid-template-columns: 1fr 1fr; }
  .workshop-tag-row { grid-template-columns: 1fr; }
  .workshop-adv-grid { grid-template-columns: 1fr 1fr; }
}

.workshop-meta-row label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.workshop-meta-row input,
.workshop-meta-row select {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
  outline: none;
}

.workshop-brief-block label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.workshop-brief-block textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.6;
  font-family: inherit;
  background: var(--surface);
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
}

.workshop-brief-block textarea:focus {
  border-color: var(--text);
}

.workshop-upload-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.workshop-actions-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.workshop-actions-row .ghost-button.danger {
  color: var(--danger);
}

.workshop-output {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.workshop-module {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.workshop-module-head {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  background: var(--surface);
  border-bottom: 1px solid transparent;
}

.workshop-module.open .workshop-module-head {
  border-bottom-color: var(--line);
}

.workshop-module-head strong {
  font-size: 14px;
  font-weight: 600;
}

.workshop-module-head .ws-mod-key {
  font-family: "JetBrains Mono", "IBM Plex Mono", "SF Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--muted-2);
  margin-right: 6px;
}

.workshop-module-head .ws-mod-actions {
  display: flex;
  gap: 6px;
}

.workshop-module-head button {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11.5px;
  cursor: pointer;
  color: var(--muted);
}

/* ✨ AI 调优 高亮按钮 */
.workshop-module-head .ws-mod-refine {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 18%, var(--surface)), color-mix(in srgb, var(--gold) 12%, var(--surface)));
  border-color: color-mix(in srgb, var(--primary) 36%, var(--line));
  color: var(--primary-strong);
  font-weight: 600;
  padding: 4px 10px 4px 8px;
  position: relative;
}
.workshop-module-head .ws-mod-refine svg {
  width: 13px; height: 13px;
  color: color-mix(in srgb, var(--gold) 70%, var(--primary-strong));
}
.workshop-module-head .ws-mod-refine:hover {
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 30%, var(--surface)), color-mix(in srgb, var(--gold) 22%, var(--surface)));
  border-color: var(--primary);
  box-shadow: 0 2px 8px -2px color-mix(in srgb, var(--primary) 36%, transparent);
}

.workshop-module-head button:hover {
  color: var(--text);
  border-color: var(--text);
}

.workshop-module-body {
  padding: 16px 18px;
  display: none;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text);
}

.workshop-module.open .workshop-module-body {
  display: block;
}

.workshop-module-body p {
  margin: 0 0 12px;
}

.workshop-module-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 14px;
  font-size: 12.5px;
}

.workshop-module-body th,
.workshop-module-body td {
  border: 1px solid var(--line);
  padding: 6px 10px;
  text-align: left;
  vertical-align: top;
}

.workshop-module-body th {
  background: var(--surface);
  font-weight: 500;
  color: var(--muted);
}

.workshop-module-body ul {
  margin: 0 0 12px;
  padding-left: 20px;
}

.workshop-module-body .ws-mod-notes {
  background: var(--surface);
  border-left: 3px solid var(--text);
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 10px;
  border-radius: 4px;
}

.workshop-loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.workshop-loading-spin {
  width: 40px;
  height: 40px;
  margin: 0 auto 16px;
  border: 3px solid var(--line);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: wsSpin 0.8s linear infinite;
}

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

.workshop-empty {
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 40px;
}

.workshop-empty > div {
  max-width: 480px;
}

.workshop-empty i {
  width: 40px;
  height: 40px;
  color: var(--muted-2);
  margin-bottom: 14px;
}

.workshop-empty h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.workshop-empty p {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.7;
  margin: 0;
}

@media (max-width: 980px) {
  .workshop-layout {
    grid-template-columns: 1fr;
  }
  .workshop-list {
    position: static;
  }
  .workshop-meta-row {
    grid-template-columns: 1fr 1fr;
  }
}

/* ============ Workshop list item · 命名 + 状态升级 ============ */
.workshop-list-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
}

.workshop-list-item .ws-item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.workshop-list-item .ws-item-title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  color: inherit;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.workshop-list-item .ws-item-meta {
  display: flex;
  gap: 10px;
  font-size: 11.5px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--muted-2);
  opacity: 0.78;
}

.workshop-list-item.active .ws-item-meta {
  color: rgba(255, 255, 255, 0.6);
}

.workshop-list-item .ws-item-status {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.workshop-list-item .ws-item-status i {
  width: 11px;
  height: 11px;
}

.workshop-list-item .ws-item-status.status-ready { color: var(--success, #1f7a55); }
.workshop-list-item .ws-item-status.status-generating { color: var(--info, #2b5fb5); }
.workshop-list-item .ws-item-status.status-generating i { animation: wsSpin 1s linear infinite; }
.workshop-list-item .ws-item-status.status-draft { color: var(--muted-2); opacity: 0.85; }

.workshop-list-item.active .ws-item-status.status-ready { color: #7be8b6; }
.workshop-list-item.active .ws-item-status.status-generating { color: #9ec3ff; }
.workshop-list-item.active .ws-item-status.status-draft { color: rgba(255,255,255,0.6); }

.workshop-list-item .ws-item-rename {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border: 0;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
  color: inherit;
  display: grid;
  place-items: center;
  margin-top: 2px;
}

.workshop-list-item .ws-item-rename i {
  width: 14px;
  height: 14px;
}

.workshop-list-item:hover .ws-item-rename {
  opacity: 0.55;
}

.workshop-list-item:hover .ws-item-rename:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.06);
}

.workshop-list-item.active:hover .ws-item-rename:hover {
  background: rgba(255, 255, 255, 0.15);
}

.ws-item-title-input {
  display: block;
  width: 100%;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  padding: 2px 6px;
  margin: -3px -7px;
  border: 1px solid var(--text);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  outline: none;
}

.workshop-list-item.active .ws-item-title-input {
  background: rgba(255,255,255,0.95);
  color: var(--text);
  border-color: rgba(255,255,255,0.95);
}

/* 新建项目轻量输入框 */
.ws-name-popover {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  box-shadow: var(--shadow-hover, 0 16px 42px rgba(0,0,0,0.18));
  display: flex;
  gap: 8px;
  z-index: 80;
  animation: wsPopIn 0.16s var(--ease-out, ease-out);
}

@keyframes wsPopIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ws-name-popover input {
  width: 260px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 13px;
  font-family: inherit;
  background: var(--surface);
  outline: none;
}

.ws-name-popover input:focus {
  border-color: var(--text);
}

.ws-name-popover button {
  height: 36px;
  padding: 0 16px;
  font-size: 13px;
}

/* ============ Workshop · 内嵌追问 + 润色 + 版本引用 ============ */

/* Brief 标题行带润色按钮 */
.ws-brief-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
}

.workshop-brief-block textarea {
  width: 100%;
  margin-top: 0;
}

/* 润色按钮（通用） */
.ws-refine-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.ws-refine-btn:hover {
  background: var(--surface-2);
  border-color: var(--text);
}

.ws-refine-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ws-refine-btn i {
  width: 13px;
  height: 13px;
}

/* 润色完成的闪烁高亮 */
.ws-refine-flash {
  animation: wsRefineFlash 0.6s var(--ease-out, ease-out);
}

@keyframes wsRefineFlash {
  0% { background: rgba(184, 131, 36, 0.18); }
  100% { background: transparent; }
}

/* 模块内嵌追问表单 */
.workshop-module-iterate {
  padding: 14px 18px 16px;
  border-top: 1px dashed var(--line);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.workshop-module-iterate[hidden] { display: none !important; }

.workshop-module-iterate .ws-iter-head {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.workshop-module-iterate .ws-iter-text {
  width: 100%;
  min-height: 80px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.55;
  font-family: inherit;
  background: var(--surface);
  resize: vertical;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.workshop-module-iterate .ws-iter-text:focus {
  border-color: var(--text);
}

.workshop-module-iterate .ws-iter-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.workshop-module-iterate .ws-iter-right {
  display: flex;
  gap: 8px;
}

.workshop-module-iterate .primary-button,
.workshop-module-iterate .ghost-button {
  font-size: 12.5px;
  padding: 6px 14px;
}

/* 版本引用 */
.workshop-refversion-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ws-ref-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px dashed var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.ws-ref-add-btn:hover {
  background: var(--surface-2);
  border-color: var(--text);
  color: var(--text);
}

.ws-ref-add-btn i {
  width: 12px;
  height: 12px;
}

.ws-ref-version-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 36px;
  align-items: center;
}

.ws-ref-empty {
  font-size: 12px;
  color: var(--muted-2);
  font-style: italic;
}

.ws-ref-version-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px 5px 12px;
  font-size: 12px;
  color: var(--text);
}

.ws-ref-version-tag i {
  width: 12px;
  height: 12px;
  opacity: 0.7;
}

.ws-ref-version-tag button {
  width: 18px;
  height: 18px;
  border: 0;
  background: transparent;
  color: var(--muted-2);
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}

.ws-ref-version-tag button:hover {
  background: var(--danger, #b43f2e);
  color: #fff;
}

/* 版本选择 popover */
.ws-ref-version-picker {
  position: absolute;
  width: 420px;
  max-width: 92vw;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-hover, 0 16px 42px rgba(0,0,0,0.18));
  z-index: 80;
  animation: wsPopIn 0.16s var(--ease-out, ease-out);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ws-ref-picker-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ws-ref-picker-head strong { font-size: 13px; }

.ws-ref-search {
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12.5px;
  outline: none;
  font-family: inherit;
}

.ws-ref-picker-body {
  max-height: 320px;
  overflow-y: auto;
  padding: 6px 0;
}

.ws-ref-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: background 0.12s, border-color 0.12s;
}

.ws-ref-row:hover {
  background: var(--surface-2);
}

.ws-ref-row.selected {
  border-left-color: var(--text);
  background: var(--surface-2);
}

.ws-ref-row input[type="checkbox"] {
  flex-shrink: 0;
}

.ws-ref-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ws-ref-row-main strong {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-ref-row-main span {
  font-size: 11px;
  color: var(--muted-2);
}

.ws-ref-picker-foot {
  border-top: 1px solid var(--line);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

.ws-ref-picker-foot .ws-ref-count {
  font-weight: 600;
  color: var(--text);
}

.ws-ref-picker-foot > div { display: flex; gap: 8px; }

.ws-ref-picker-foot button { font-size: 12px; padding: 5px 14px; }

/* ============ 顶部头像按钮 ============ */
.avatar-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
  padding: 0;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.avatar-button:hover { border-color: color-mix(in srgb, var(--primary) 50%, var(--line)); box-shadow: 0 2px 8px -2px color-mix(in srgb, var(--primary) 30%, transparent); }
.avatar-circle {
  position: relative;
  width: 30px; height: 30px;
  border-radius: 999px;
  overflow: hidden;
  background: linear-gradient(135deg, #7b6cf0, #f06585);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.avatar-circle img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ============ 个人资料抽屉 ============ */
.profile-drawer { position: fixed; inset: 0; z-index: 2000; }
.profile-drawer[hidden] { display: none; }
.profile-drawer-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.32);
  animation: fadeIn 0.18s ease;
}
.profile-drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 360px; max-width: 90vw;
  background: var(--surface);
  box-shadow: -8px 0 32px -8px rgba(0,0,0,0.2);
  display: flex; flex-direction: column;
  animation: slideInRight 0.22s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }

.profile-drawer-close {
  position: absolute; top: 14px; left: 14px;
  width: 32px; height: 32px;
  background: transparent; border: none;
  border-radius: 8px; cursor: pointer;
  display: grid; place-items: center;
  color: var(--muted);
}
.profile-drawer-close:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
.profile-drawer-close svg { width: 18px; height: 18px; }

.profile-drawer-head {
  padding: 60px 24px 18px;
  display: flex; flex-direction: column;
  align-items: center;
  border-bottom: 1px dashed var(--line);
}
.profile-avatar-wrap { position: relative; }
.profile-avatar {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 88px; height: 88px;
  border-radius: 999px;
  overflow: hidden;
  background: linear-gradient(135deg, #7b6cf0, #f06585);
  color: #fff; font-weight: 800; font-size: 32px;
  box-shadow: 0 6px 18px -6px rgba(123,108,240,0.4);
  margin-bottom: 14px;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-avatar-edit {
  position: absolute; right: -2px; bottom: 14px;
  width: 30px; height: 30px; border-radius: 999px;
  background: var(--primary); color: #fff; border: 2px solid var(--surface);
  display: grid; place-items: center; cursor: pointer;
}
.profile-avatar-edit:hover { background: var(--primary-strong); }
.profile-avatar-edit svg { width: 14px; height: 14px; }

.profile-name-row { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.profile-name-row strong { font-size: 18px; }
.profile-name-edit {
  width: 22px; height: 22px;
  background: transparent; border: 1px solid var(--line);
  border-radius: 999px; cursor: pointer;
  display: grid; place-items: center; color: var(--muted);
  transition: all 0.15s ease;
}
.profile-name-edit:hover { color: var(--primary-strong); border-color: var(--primary); }
.profile-name-edit svg { width: 11px; height: 11px; }
.profile-name-edit[hidden] { display: none; }
.profile-gm-id {
  font-size: 11px; color: var(--muted);
  letter-spacing: 0.5px;
  background: color-mix(in srgb, var(--text) 4%, var(--surface));
  padding: 2px 8px; border-radius: 4px;
  margin: 2px 0 4px !important;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.profile-email-line { font-size: 13px; color: var(--muted); margin: 0; }
.profile-phone { margin-top: 4px !important; font-size: 13px; color: var(--muted); }

/* 会员有效期 */
.profile-membership-expire {
  font-size: 11.5px;
  color: var(--muted);
  margin: 6px 0 0 !important;
  letter-spacing: 0.2px;
}
.profile-membership-expire.expiring { color: color-mix(in srgb, var(--gold) 80%, var(--text)); font-weight: 600; }
.profile-membership-expire.expired { color: var(--accent); font-weight: 600; }

/* ============ 会员徽章 ============ */
.member-badge {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 12px;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  position: relative;
  transition: all 0.2s ease;
}
.member-badge svg { width: 12px; height: 12px; }

.member-badge[data-tier="normal"] {
  background: color-mix(in srgb, var(--text) 4%, var(--surface));
  color: var(--muted);
  border-color: var(--line);
}

/* PLUS：清新蓝 */
.member-badge[data-tier="plus"] {
  background: linear-gradient(135deg, #e0f2fe, #bfdbfe);
  color: #1e3a8a;
  border-color: #93c5fd;
  box-shadow: 0 2px 6px -2px rgba(59, 130, 246, 0.25);
}

/* PRO：金尊 */
.member-badge[data-tier="pro"] {
  background: linear-gradient(135deg, #fef3c7, #fcd34d);
  color: #7c2d12;
  border-color: #f59e0b;
  box-shadow: 0 2px 8px -2px rgba(245, 158, 11, 0.4);
}
.member-badge[data-tier="pro"] svg { color: #b45309; }

/* MAX：紫钻 + 微动效 */
.member-badge[data-tier="max"] {
  background: linear-gradient(135deg, #f5d0fe, #c084fc 50%, #7e22ce);
  color: #fff;
  border-color: #a855f7;
  box-shadow: 0 4px 12px -3px rgba(168, 85, 247, 0.5);
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.member-badge[data-tier="max"] svg { color: #fef3c7; }
.member-badge[data-tier="max"]::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,0.35) 50%, transparent 70%);
  background-size: 220% 100%;
  animation: badge-shine 2.8s infinite;
  pointer-events: none;
}
@keyframes badge-shine {
  0% { background-position: 200% 0; }
  100% { background-position: -100% 0; }
}

/* SVIP：黑金顶配 */
.member-badge[data-tier="svip"] {
  background: linear-gradient(135deg, #1f2937, #b91c1c 50%, #fbbf24);
  color: #fff;
  border-color: #fbbf24;
  box-shadow: 0 4px 14px -3px rgba(251, 191, 36, 0.5);
}
.member-badge[data-tier="svip"] svg { color: #fbbf24; }

/* ============ 发布任务表单 - 私单/暗号/紧急 toggle ============ */
.tm-form-toggle { padding: 0 !important; }
.tm-toggle-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--text) 3%, var(--surface));
  cursor: pointer;
  font-weight: normal !important;
  color: var(--text) !important;
}
.tm-toggle-row input[type="checkbox"] {
  width: 16px; height: 16px; margin-top: 2px; cursor: pointer; accent-color: var(--primary);
}
.tm-toggle-row strong { font-size: 13px; display: block; margin-bottom: 2px; }
.tm-toggle-row small { font-size: 11px; color: var(--muted); display: block; }
.tm-toggle-row:hover { border-color: color-mix(in srgb, var(--primary) 36%, var(--line)); }

/* ============ 任务大厅卡片网格（淘宝/抖音风 6×4） ============ */
#manualGrid {
  display: grid !important;
  grid-template-columns: repeat(6, 1fr) !important;
  gap: 12px !important;
}
@media (max-width: 1400px) { #manualGrid { grid-template-columns: repeat(4, 1fr) !important; } }
@media (max-width: 900px) { #manualGrid { grid-template-columns: repeat(3, 1fr) !important; } }
@media (max-width: 600px) { #manualGrid { grid-template-columns: repeat(2, 1fr) !important; } }

.tm-grid-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  display: flex; flex-direction: column;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.tm-grid-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px -10px rgba(0,0,0,0.18);
  border-color: color-mix(in srgb, var(--primary) 36%, var(--line));
}

.tm-grid-cover {
  aspect-ratio: 4 / 3;
  background: color-mix(in srgb, var(--text) 5%, var(--surface));
  position: relative; overflow: hidden;
}
.tm-grid-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tm-grid-cover-placeholder {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  color: color-mix(in srgb, var(--muted) 50%, transparent);
}
.tm-grid-cover-placeholder svg { width: 32px; height: 32px; }
.tm-grid-tags {
  position: absolute; top: 6px; left: 6px;
  display: flex; gap: 4px; flex-wrap: wrap;
}
.tm-grid-tag {
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}
.tm-grid-tag.urgent { background: linear-gradient(135deg, #fef3c7, #fcd34d); color: #7c2d12; }
.tm-grid-tag.private { background: rgba(124, 58, 237, 0.85); color: #fff; }
.tm-grid-tag.code { background: rgba(245, 158, 11, 0.9); color: #fff; }

.tm-grid-body {
  padding: 10px 12px 12px;
  display: flex; flex-direction: column; gap: 4px;
  flex: 1;
}
.tm-grid-no {
  font-size: 10px;
  color: var(--muted);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: 0.5px;
}
.tm-grid-title {
  font-size: 13px;
  margin: 0;
  line-height: 1.4;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 36px;
}
.tm-grid-meta { display: flex; gap: 4px; flex-wrap: wrap; margin: 0; }
.tm-grid-chip {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
  color: var(--primary-strong);
}
.tm-grid-chip.alt {
  background: color-mix(in srgb, var(--gold) 12%, var(--surface));
  color: color-mix(in srgb, var(--gold) 70%, var(--text));
}
.tm-grid-foot {
  margin-top: auto;
  padding-top: 6px;
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 10.5px;
  color: var(--muted);
}
.tm-grid-price { color: var(--accent); font-weight: 600; }
.tm-grid-price strong { font-size: 16px; font-weight: 800; }
.tm-grid-time { font-size: 10px; }

/* ============ 任务快查弹窗 ============ */
.tm-quick-dialog { border: none; padding: 0; background: transparent; }
.tm-quick-dialog::backdrop { background: rgba(0,0,0,0.5); }
.tm-quick-shell {
  width: min(520px, calc(100vw - 32px));
  max-height: 80vh;
  background: var(--surface);
  border-radius: 16px; overflow: hidden;
  display: flex; flex-direction: column;
}
.tm-quick-shell header {
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: flex-start;
}
.tm-quick-shell header h2 { font-size: 16px; margin: 4px 0 6px; line-height: 1.4; }
.tm-quick-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.tm-quick-body { padding: 16px 20px; overflow-y: auto; flex: 1; }
.tm-quick-cover { width: 100%; max-height: 200px; object-fit: cover; border-radius: 8px; margin-bottom: 12px; }
.tm-quick-desc { font-size: 13px; line-height: 1.7; color: var(--text); margin: 0 0 14px; }
.tm-quick-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  padding: 12px; background: color-mix(in srgb, var(--text) 3%, var(--surface));
  border-radius: 8px;
}
.tm-quick-stats > div { display: flex; flex-direction: column; gap: 2px; }
.tm-quick-stats span { font-size: 11px; color: var(--muted); }
.tm-quick-stats strong { font-size: 13.5px; font-weight: 600; }
.tm-quick-shell footer {
  padding: 12px 20px 16px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap;
}
.tm-quick-shell footer button { padding: 8px 16px; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.tm-quick-shell footer button svg { width: 14px; height: 14px; }

/* ============ DSR 三维评分弹窗 ============ */
.dsr-dialog { border: none; padding: 0; background: transparent; }
.dsr-dialog::backdrop { background: rgba(0,0,0,0.5); }
.dsr-shell {
  width: min(440px, calc(100vw - 32px));
  background: var(--surface);
  border-radius: 14px; overflow: hidden;
}
.dsr-shell header {
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}
.dsr-shell h2 { font-size: 17px; margin: 0; }
.dsr-body { padding: 16px 20px; }
.dsr-task { font-size: 12px; color: var(--muted); margin: 0 0 14px; padding: 8px 12px; background: color-mix(in srgb, var(--text) 3%, var(--surface)); border-radius: 6px; }
.dsr-row { display: grid; grid-template-columns: 80px 1fr 36px; gap: 8px; align-items: center; padding: 8px 0; }
.dsr-label { font-size: 12.5px; color: var(--text); }
.dsr-stars { display: flex; gap: 2px; }
.dsr-stars button {
  width: 28px; height: 28px;
  border: none; background: transparent;
  color: var(--line); font-size: 22px; cursor: pointer;
  padding: 0; line-height: 1;
}
.dsr-stars button:hover, .dsr-stars button.active { color: #fbbf24; }
.dsr-score { font-size: 12.5px; color: var(--muted); text-align: right; font-weight: 600; }
.dsr-comment { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.dsr-comment textarea {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-family: inherit; font-size: 13px; outline: none; resize: vertical;
}
.dsr-comment textarea:focus { border-color: var(--primary); }
.dsr-summary { margin: 12px 0 0; font-size: 12px; color: var(--muted); text-align: center; }
.dsr-summary strong { font-size: 18px; color: var(--accent); }
.dsr-shell footer { padding: 12px 20px 16px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); }
.dsr-shell footer button { padding: 8px 16px; font-size: 13px; cursor: pointer; }

/* ============ 暗号接单弹窗 ============ */
.accept-code-dialog { border: none; padding: 0; background: transparent; }
.accept-code-dialog::backdrop { background: rgba(0,0,0,0.5); }
.accept-code-shell {
  width: min(380px, calc(100vw - 32px));
  background: var(--surface);
  border-radius: 14px; overflow: hidden;
}
.accept-code-shell header { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.accept-code-shell h2 { font-size: 16px; margin: 0; display: inline-flex; align-items: center; gap: 6px; }
.accept-code-shell h2 svg { width: 16px; height: 16px; color: var(--gold); }
.accept-code-body { padding: 18px 20px; }
.accept-code-body p { font-size: 12.5px; color: var(--muted); margin: 0 0 10px; }
.accept-code-body input {
  width: 100%;
  padding: 10px 14px; font-size: 16px;
  border: 1px solid var(--line); border-radius: 8px;
  outline: none; letter-spacing: 2px; text-align: center; font-weight: 600;
}
.accept-code-body input:focus { border-color: var(--primary); }
.accept-code-tip { color: var(--accent); font-size: 12px; margin: 8px 0 0 !important; }
.accept-code-shell footer { padding: 12px 20px 16px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); }
.accept-code-shell footer button { padding: 8px 16px; font-size: 13px; cursor: pointer; }

/* ============ 实习单一任务限制提示 ============ */
.intern-limit-toast {
  position: fixed; inset: 0; z-index: 3000;
  display: grid; place-items: center;
  background: rgba(0,0,0,0.45);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.intern-limit-toast.show { opacity: 1; }
.intern-limit-card {
  background: var(--surface);
  width: min(360px, calc(100vw - 32px));
  border-radius: 14px;
  padding: 28px 22px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  box-shadow: 0 14px 40px -10px rgba(0,0,0,0.3);
}
.intern-limit-card svg { width: 40px; height: 40px; color: var(--accent); }
.intern-limit-card strong { font-size: 16px; }
.intern-limit-card p { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.6; }
.intern-limit-card button { margin-top: 6px; padding: 8px 28px; font-size: 13px; }

/* ============ 服务商目录 ============ */
.tech-directory { padding-bottom: 40px; }
.tech-dir-toolbar { display: flex; gap: 14px; justify-content: space-between; flex-wrap: wrap; margin: 8px 0 18px; align-items: center; }
.tech-dir-sort { display: flex; gap: 4px; padding: 4px; background: color-mix(in srgb, var(--text) 4%, var(--surface)); border-radius: 8px; }
.tech-dir-sort button {
  padding: 6px 14px; border: none; background: transparent;
  font-size: 12.5px; cursor: pointer; border-radius: 6px;
  color: var(--muted);
}
.tech-dir-sort button.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-card); }
.tech-dir-search {
  position: relative; flex: 1; max-width: 280px;
  display: flex; align-items: center;
}
.tech-dir-search svg { position: absolute; left: 12px; width: 14px; height: 14px; color: var(--muted); }
.tech-dir-search input {
  flex: 1; padding: 8px 12px 8px 34px;
  border: 1px solid var(--line); border-radius: 8px;
  font-size: 13px; outline: none;
}
.tech-dir-search input:focus { border-color: var(--primary); }

.tech-card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 12px;
}
@media (max-width: 1100px) { .tech-card-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 820px)  { .tech-card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px)  { .tech-card-grid { grid-template-columns: 1fr; } }
.tech-card-loading { grid-column: 1 / -1; padding: 60px 0; text-align: center; color: var(--muted); }

.tech-dir-pagination {
  max-width: 1200px;
  margin: 24px auto 0;
  padding: 16px 12px 0;
  display: flex; justify-content: center; align-items: center; gap: 16px;
  font-size: 13px; color: var(--muted);
}
.tech-dir-pagination button {
  padding: 7px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tech-dir-pagination button:not(:disabled):hover {
  border-color: var(--primary);
  color: var(--primary-strong);
}
.tech-dir-pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

.tech-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  display: flex; flex-direction: column; gap: 10px;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.tech-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px -8px rgba(0,0,0,0.16); border-color: color-mix(in srgb, var(--primary) 30%, var(--line)); }

/* ============ 服务商卡片 - 9:16 竖图版 ============ */
.tech-card.portrait-card {
  padding: 0;
  overflow: hidden;
  display: flex; flex-direction: column;
  gap: 0;
  aspect-ratio: 9 / 16;
}
.tech-card-photo {
  position: relative;
  flex: 1.6;
  background: linear-gradient(135deg, #7b6cf0, #f06585);
  overflow: hidden;
}
.tech-card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tech-card-photo-placeholder {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  color: rgba(255,255,255,0.9);
}
.tech-card-photo-placeholder svg { width: 64px; height: 64px; }
.tech-card-tier-overlay {
  position: absolute; top: 10px; left: 10px;
  font-size: 11px; padding: 3px 9px;
  border-radius: 999px;
  font-weight: 700;
  background: rgba(255,255,255,0.92);
  color: var(--text);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.tech-card-tier-overlay.tier-gold { background: linear-gradient(135deg, #fef3c7, #fcd34d); color: #7c2d12; }
.tech-card-tier-overlay.tier-expert { background: linear-gradient(135deg, #ddd6fe, #a78bfa); color: #fff; }
.tech-card-tier-overlay.tier-senior { background: linear-gradient(135deg, #d1fae5, #6ee7b7); color: #064e3b; }
.tech-card-tier-overlay.tier-junior { background: linear-gradient(135deg, #dbeafe, #93c5fd); color: #1e3a8a; }

.tech-cert-badge {
  position: absolute; bottom: 10px; left: 10px;
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; padding: 4px 8px;
  border-radius: 4px;
  font-weight: 600;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.tech-cert-badge svg { width: 11px; height: 11px; }
.tech-cert-badge.individual { background: rgba(34, 197, 94, 0.92); color: #fff; }
.tech-cert-badge.company { background: rgba(245, 158, 11, 0.92); color: #fff; }

.tech-card-info {
  padding: 12px 14px 14px;
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface);
}
.tech-card-name-row strong { font-size: 15px; font-weight: 700; }
.tech-card-id {
  font-size: 10.5px;
  color: var(--muted);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: 0.5px;
  margin: 0;
}
.tech-card-metrics {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px dashed var(--line);
}
.tech-card-metrics > div {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
}
.tech-card-metrics strong { font-size: 13.5px; font-weight: 700; color: var(--text); }
.tech-card-metrics span { font-size: 10px; color: var(--muted); }
.tech-card-metrics > div:first-child strong { color: #f59e0b; }
.tech-card-top { display: flex; gap: 12px; align-items: center; }
.tech-card-portrait {
  width: 48px; height: 48px;
  border-radius: 999px;
  background: linear-gradient(135deg, #7b6cf0, #f06585);
  display: grid; place-items: center;
  overflow: hidden;
  color: #fff;
}
.tech-card-portrait img { width: 100%; height: 100%; object-fit: cover; }
.tech-card-portrait svg { width: 24px; height: 24px; }
.tech-card-top strong { display: block; font-size: 14.5px; }
.tech-card-tier {
  display: inline-block; font-size: 10.5px; padding: 2px 6px;
  border-radius: 4px; margin-top: 4px;
  background: color-mix(in srgb, var(--gold) 12%, var(--surface));
  color: color-mix(in srgb, var(--gold) 70%, var(--text));
  font-weight: 600;
}
.tech-card-tier.tier-gold { background: linear-gradient(135deg, #fef3c7, #fcd34d); color: #7c2d12; }
.tech-card-tier.tier-expert { background: linear-gradient(135deg, #ddd6fe, #a78bfa); color: #4c1d95; }
.tech-card-tier.tier-senior { background: linear-gradient(135deg, #d1fae5, #6ee7b7); color: #064e3b; }
.tech-card-stats {
  display: flex; gap: 12px;
  font-size: 11.5px; color: var(--muted);
}
.tech-card-stats span:first-child { color: #f59e0b; font-weight: 700; }
.tech-card-intro { font-size: 11.5px; color: var(--muted); margin: 0; line-height: 1.6; min-height: 36px; }

/* ============ 服务商个人主页 ============ */
.tech-profile-wrap { padding-bottom: 40px; }
.tech-profile-head {
  display: flex; gap: 24px; align-items: center;
  padding: 22px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 6%, var(--surface)), color-mix(in srgb, var(--gold) 4%, var(--surface)));
  border-radius: 14px;
  margin-bottom: 18px;
}
.tech-profile-portrait {
  width: 96px; height: 96px;
  border-radius: 999px;
  background: linear-gradient(135deg, #7b6cf0, #f06585);
  display: grid; place-items: center;
  overflow: hidden;
  flex-shrink: 0;
  color: #fff;
}
.tech-profile-portrait img { width: 100%; height: 100%; object-fit: cover; }
.tech-profile-portrait svg { width: 40px; height: 40px; }
.tech-profile-stats { display: flex; gap: 32px; flex-wrap: wrap; }
.tech-profile-stats > div { display: flex; flex-direction: column; gap: 2px; }
.tech-profile-stats strong { font-size: 22px; font-weight: 800; }
.tech-profile-stats span { font-size: 11px; color: var(--muted); }

.tech-profile-tabs { display: flex; gap: 6px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.tech-profile-tabs button {
  padding: 8px 18px; border: none; background: transparent;
  font-size: 13px; cursor: pointer; color: var(--muted);
  border-bottom: 2px solid transparent;
}
.tech-profile-tabs button.active { color: var(--text); font-weight: 600; border-bottom-color: var(--primary); }

.tech-reviews-list { display: flex; flex-direction: column; gap: 10px; }
.tech-review-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--surface);
}
.tech-review-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.tech-review-stars { color: #fbbf24; font-size: 14px; }
.tech-review-stars em { color: var(--text); font-style: normal; font-size: 12px; font-weight: 700; margin-left: 6px; }
.tech-review-meta { font-size: 11px; color: var(--muted); }
.tech-review-dsr { display: flex; gap: 12px; font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.tech-review-title { font-size: 13px; margin: 0 0 4px; }
.tech-review-tag {
  display: inline-block;
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
  color: var(--primary-strong);
  margin: 0 4px;
}
.tech-review-no { font-size: 10.5px; color: var(--muted); font-family: ui-monospace, monospace; }
.tech-review-comment { margin: 6px 0 0; font-size: 12.5px; color: var(--text); line-height: 1.6; padding: 8px 10px; background: color-mix(in srgb, var(--text) 3%, var(--surface)); border-radius: 6px; }
.tech-profile-intro { font-size: 13px; line-height: 1.8; color: var(--text); padding: 12px; background: color-mix(in srgb, var(--text) 3%, var(--surface)); border-radius: 8px; }

/* ============ 形象照片设置区 ============ */
.settings-portrait-row { display: flex; align-items: center; gap: 16px; }
.portrait-preview {
  width: 80px; height: 80px;
  border-radius: 999px;
  background: linear-gradient(135deg, #7b6cf0, #f06585);
  display: grid; place-items: center;
  overflow: hidden;
  flex-shrink: 0;
  color: #fff;
  box-shadow: 0 4px 12px -4px rgba(0,0,0,0.16);
}
.portrait-preview img { width: 100%; height: 100%; object-fit: cover; }
.portrait-preview svg { width: 30px; height: 30px; }

/* 任务市场入驻服务统计卡片可点击样式 */
.tm-stat-clickable { cursor: pointer; transition: all 0.15s ease; }
.tm-stat-clickable:hover {
  border-color: color-mix(in srgb, var(--primary) 36%, var(--line));
  transform: translateY(-1px);
}

/* ============ 报名课程按钮 ============ */
.tutorial-enroll-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
}
.tutorial-enroll-btn svg { width: 14px; height: 14px; }

/* ============ 课程报名弹窗 ============ */
.course-enroll-dialog { border: none; padding: 0; background: transparent; }
.course-enroll-dialog::backdrop { background: rgba(0,0,0,0.5); }
.course-enroll-shell {
  width: min(620px, calc(100vw - 32px));
  max-height: 90vh;
  background: var(--surface);
  border-radius: 16px;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.course-enroll-shell header {
  padding: 20px 24px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--line);
}
.course-enroll-shell h2 { font-size: 18px; margin: 0 0 4px; }
.course-enroll-shell header p { font-size: 12.5px; color: var(--muted); margin: 0; }
.course-enroll-shell > footer,
.course-enroll-shell > .course-enroll-info,
.course-enroll-shell > .course-enroll-section,
.course-enroll-shell > form { padding: 14px 24px; }
.course-enroll-shell { overflow-y: auto; }
.course-enroll-shell::-webkit-scrollbar { width: 8px; }

.course-enroll-info {
  background: color-mix(in srgb, var(--primary) 5%, var(--surface));
  border-bottom: 1px dashed var(--line);
}
.course-info-list {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px;
  font-size: 12px; color: var(--text);
  line-height: 1.7;
}

.course-enroll-section-title {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted); font-weight: 600;
  margin-bottom: 8px;
}
.course-enroll-section-title svg { width: 13px; height: 13px; }

.course-cohort-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.course-cohort {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.course-cohort:hover { border-color: color-mix(in srgb, var(--primary) 36%, var(--line)); }
.course-cohort.active {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
}
.course-cohort-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.course-cohort-head strong { font-size: 13.5px; }
.course-cohort-date { font-size: 11px; color: var(--muted); }
.course-cohort-meta {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11.5px;
}
.course-cohort-count {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--muted);
}
.course-cohort-count em { font-style: normal; color: var(--primary-strong); font-weight: 700; }
.course-cohort-count svg { width: 11px; height: 11px; }
.course-cohort-tag {
  padding: 1px 8px; border-radius: 4px;
  background: color-mix(in srgb, var(--gold) 14%, var(--surface));
  color: color-mix(in srgb, var(--gold) 70%, var(--text));
  font-weight: 600; font-size: 10.5px;
}

.course-timeslot-row { display: flex; gap: 8px; flex-wrap: wrap; }
.course-timeslot-btn {
  flex: 1; min-width: 120px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.course-timeslot-btn:hover { border-color: color-mix(in srgb, var(--primary) 36%, var(--line)); }
.course-timeslot-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

.course-enroll-form {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.course-enroll-form label { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--muted); }
.course-enroll-form label span em { color: var(--accent); font-style: normal; }
.course-enroll-form input, .course-enroll-form textarea {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.course-enroll-form input:focus, .course-enroll-form textarea:focus { border-color: var(--primary); }
.course-enroll-fullwidth { grid-column: 1 / -1; }

.course-enroll-foot {
  position: sticky; bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 12px 24px 16px !important;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.course-enroll-summary { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); }
.course-enroll-summary strong { color: var(--text); }
.course-enroll-price { font-size: 18px; font-weight: 800; color: var(--accent); }
.course-enroll-price strong { font-size: 22px; }
.course-enroll-actions { display: flex; gap: 8px; }
.course-enroll-actions button { padding: 8px 16px; font-size: 13px; }

@media (max-width: 600px) {
  .course-info-list { grid-template-columns: 1fr; }
  .course-cohort-list { grid-template-columns: 1fr; }
  .course-enroll-form { grid-template-columns: 1fr; }
}

/* ============ 首页主 Hero 海报 ============ */
.home-hero-poster {
  display: block;
  width: 100%;
  aspect-ratio: 21 / 9;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 14px;
  box-shadow: 0 4px 16px -6px rgba(0,0,0,0.18);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.home-hero-poster:hover { transform: translateY(-2px); box-shadow: 0 8px 24px -6px rgba(0,0,0,0.22); }
.home-hero-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 720px) {
  .home-hero-poster { aspect-ratio: 16 / 9; }
}

/* ============ 首页 5 张功能入口海报 ============ */
.home-posters {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.home-poster {
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: color-mix(in srgb, var(--text) 6%, var(--surface));
  position: relative;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.home-poster:hover { transform: translateY(-2px); box-shadow: 0 6px 18px -6px rgba(0,0,0,0.18); }
.home-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 1280px) { .home-posters { grid-template-columns: repeat(3, 1fr); } .home-poster:nth-child(n+4) { display: none; } }
@media (max-width: 720px) {
  .home-posters {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 85%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .home-poster { scroll-snap-align: start; }
  .home-poster:nth-child(n+4) { display: block; }
}

/* 任务市场顶部搜索条 */
.tm-stat-search { padding: 0 !important; }
.tm-stat-search input {
  width: 100%;
  height: 100%;
  min-height: 78px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  font-size: 14px;
  outline: none;
}
.tm-stat-search input:focus { border-color: var(--primary); }

/* ============ 作图工坊（fabric.js） ============ */
.canvas-studio { display: flex; flex-direction: column; gap: 14px; padding-bottom: 40px; }
.canvas-head-actions { display: flex; gap: 8px; }
.canvas-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 14px;
  align-items: start;
}
.canvas-toolbar {
  display: flex; flex-direction: column; gap: 14px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  position: sticky;
  top: 14px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
.canvas-tool-group { display: flex; flex-direction: column; gap: 8px; padding-bottom: 12px; border-bottom: 1px dashed var(--line); }
.canvas-tool-group:last-child { border-bottom: none; padding-bottom: 0; }
.canvas-tool-title { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.canvas-tool-row { display: flex; gap: 6px; }
.canvas-tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.canvas-tool-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}
.canvas-tool-btn:hover { border-color: color-mix(in srgb, var(--primary) 36%, var(--line)); }
.canvas-tool-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.canvas-tool-btn svg { width: 14px; height: 14px; }
.canvas-tool-btn.canvas-danger:hover { border-color: var(--accent); color: var(--accent); }
.canvas-tool-grid .canvas-tool-btn { justify-content: flex-start; padding: 7px 8px; font-size: 11.5px; }
.canvas-num {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--muted);
}
.canvas-num input {
  flex: 1;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12.5px;
  outline: none;
  width: 60px;
}
.canvas-num input[type="color"] { padding: 1px; height: 28px; cursor: pointer; }
.canvas-bgcolor input { width: 36px; }
.canvas-preset-row { display: flex; gap: 4px; flex-wrap: wrap; }
.canvas-preset-row button {
  font-size: 10.5px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
}
.canvas-preset-row button:hover {
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--primary) 36%, var(--line));
  color: var(--primary-strong);
}

.canvas-stage-wrap {
  background: color-mix(in srgb, var(--text) 3%, var(--surface));
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  display: flex; flex-direction: column; align-items: center;
  gap: 10px;
}
.canvas-stage {
  background: #fff;
  box-shadow: 0 2px 18px -6px rgba(0,0,0,0.18);
  border-radius: 6px;
  overflow: hidden;
  max-width: 100%;
}
.canvas-stage canvas { display: block; max-width: 100%; }
.canvas-hint { font-size: 11.5px; color: var(--muted); margin: 0; }

@media (max-width: 980px) {
  .canvas-layout { grid-template-columns: 1fr; }
  .canvas-toolbar { position: static; max-height: none; }
  .canvas-tool-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ============ 脚本大师 · 历史对话工具栏 ============ */
.chat-history-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 10px 10px 0 0;
  background: color-mix(in srgb, var(--text) 3%, var(--surface));
  border-bottom: 0;
  flex-wrap: wrap;
  font-size: 12px;
}
.chat-history-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600; color: var(--text);
}
.chat-history-label svg { width: 14px; height: 14px; color: var(--muted); }
.chat-history-tabs { display: flex; gap: 4px; }
.chat-history-tab {
  padding: 5px 11px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.16s ease;
}
.chat-history-tab small { font-size: 10px; opacity: 0.65; margin-left: 2px; }
.chat-history-tab:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--primary) 36%, var(--line));
  color: var(--primary-strong);
}
.chat-history-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.chat-history-tab.active small { opacity: 0.8; color: #fff; }
.chat-history-tab.locked,
.chat-history-tab:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  background: color-mix(in srgb, var(--text) 6%, var(--surface));
  color: var(--muted);
  border-color: var(--line);
}
.chat-history-meta {
  font-size: 11.5px; color: var(--muted);
  margin-left: auto;
}
.chat-history-clear {
  display: inline-flex; align-items: center; gap: 4px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11.5px;
  color: var(--muted);
  cursor: pointer;
}
.chat-history-clear svg { width: 12px; height: 12px; }
.chat-history-clear:hover { color: var(--accent); border-color: var(--accent); }

/* 只读历史渲染 */
.chat-history-readonly {
  padding: 14px;
  background: color-mix(in srgb, var(--gold) 5%, var(--surface));
  border-left: 3px solid color-mix(in srgb, var(--gold) 40%, var(--line));
  margin-bottom: 8px;
  max-height: 560px;
  overflow-y: auto;
}
.chat-history-readonly[hidden] { display: none; }
.chat-history-banner {
  font-size: 11.5px;
  color: color-mix(in srgb, var(--gold) 70%, var(--text));
  padding: 6px 10px;
  background: color-mix(in srgb, var(--gold) 10%, var(--surface));
  border-radius: 6px;
  margin-bottom: 12px;
  text-align: center;
  font-weight: 600;
}
.chat-history-empty {
  text-align: center; padding: 30px 0;
  color: var(--muted); font-size: 13px;
}
.chat-history-pair {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: var(--surface);
}
.chat-history-time {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--muted);
  margin-bottom: 8px;
}
.chat-history-time svg { width: 11px; height: 11px; }
.chat-history-engine {
  margin-left: auto;
  padding: 1px 8px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
  color: var(--primary-strong);
  font-size: 10.5px;
  font-weight: 600;
}
.chat-history-msg { margin-bottom: 8px; font-size: 12.5px; line-height: 1.6; }
.chat-history-msg:last-child { margin-bottom: 0; }
.chat-history-msg strong {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 2px;
  font-weight: 700;
}
.chat-history-msg.user p { margin: 0; color: var(--text); }
.chat-history-msg.ai .chat-history-reply {
  color: var(--text);
  max-height: 240px;
  overflow-y: auto;
  padding: 8px 10px;
  background: color-mix(in srgb, var(--text) 3%, var(--surface));
  border-radius: 6px;
}

@media (max-width: 720px) {
  .chat-history-bar { gap: 8px; padding: 8px 10px; }
  .chat-history-tab small { display: none; }
  .chat-history-meta { width: 100%; order: 99; margin-left: 0; }
}

/* ============ 工坊 AI 调优右侧面板 ============ */
.ws-refine-panel { position: fixed; inset: 0; z-index: 1800; }
.ws-refine-panel[hidden] { display: none; }
.ws-refine-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.28);
  animation: fadeIn 0.18s ease;
}
.ws-refine-shell {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 420px; max-width: 92vw;
  background: var(--surface);
  display: flex; flex-direction: column;
  box-shadow: -10px 0 30px -10px rgba(0,0,0,0.22);
  animation: slideInRight 0.22s ease;
}
.ws-refine-head {
  padding: 18px 22px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--line);
}
.ws-refine-head strong { font-size: 17px; }
.ws-refine-tag {
  display: inline-block;
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 22%, var(--surface)), color-mix(in srgb, var(--gold) 16%, var(--surface)));
  color: var(--primary-strong);
  font-size: 11px; font-weight: 800;
  padding: 3px 8px; border-radius: 4px;
  margin-right: 8px;
  letter-spacing: 1px;
}

.ws-refine-body {
  flex: 1; overflow-y: auto;
  padding: 18px 22px;
  display: flex; flex-direction: column; gap: 18px;
}
.ws-refine-section { display: flex; flex-direction: column; gap: 8px; }
.ws-refine-section-title {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.ws-refine-section-title svg { width: 13px; height: 13px; }
.ws-refine-preview {
  background: color-mix(in srgb, var(--text) 3%, var(--surface));
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  max-height: 220px;
  overflow-y: auto;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text);
}
.ws-refine-preview p { margin: 0 0 6px; }
.ws-refine-preview ul { margin: 4px 0; padding-left: 18px; }
.ws-refine-preview table { font-size: 11px; }
.ws-refine-preview .rc-empty { text-align: center; color: var(--muted); }

#wsRefineText {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--surface);
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s ease;
}
#wsRefineText:focus { border-color: var(--primary); }
#wsRefineText.ws-refine-flash {
  animation: flashGold 0.6s ease;
}
@keyframes flashGold {
  0%, 100% { background: var(--surface); }
  50% { background: color-mix(in srgb, var(--gold) 14%, var(--surface)); }
}

.ws-refine-tips {
  display: flex; flex-wrap: wrap; gap: 5px;
  margin-top: 4px;
}
.ws-refine-tips button {
  font-size: 11.5px;
  padding: 4px 10px;
  background: color-mix(in srgb, var(--text) 4%, var(--surface));
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}
.ws-refine-tips button:hover {
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--primary) 30%, var(--line));
  color: var(--primary-strong);
}

.ws-refine-foot {
  padding: 14px 22px 18px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 8px;
}
.ws-refine-foot .ghost-button, .ws-refine-foot .primary-button {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  font-size: 13px; font-weight: 600;
  cursor: pointer; border-radius: 8px;
}
.ws-refine-foot .ghost-button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}
.ws-refine-foot .ghost-button:hover { background: color-mix(in srgb, var(--text) 4%, var(--surface)); }
.ws-refine-foot .primary-button {
  background: var(--primary);
  border: none;
  color: #fff;
}
.ws-refine-foot .primary-button:hover { background: var(--primary-strong); }
.ws-refine-foot button:disabled { opacity: 0.55; cursor: wait; }
.ws-refine-foot button svg { width: 14px; height: 14px; }

@media (max-width: 720px) {
  .ws-refine-shell { width: 100vw; }
}

/* ============ 修改昵称弹窗 ============ */
.nickname-dialog { border: 0; padding: 0; background: transparent; }
.nickname-dialog::backdrop { background: rgba(0,0,0,0.5); }
.nickname-shell {
  width: min(420px, calc(100vw - 32px));
  background: var(--surface);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 60px -16px rgba(0,0,0,0.3);
}
.nickname-shell header {
  padding: 20px 22px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--line);
}
.nickname-shell h2 { font-size: 17px; margin: 0 0 4px; }
.nickname-shell header p { font-size: 12.5px; color: var(--muted); margin: 0; }
.nickname-body { padding: 18px 22px; }
.nickname-input { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.nickname-input span { font-size: 12px; color: var(--muted); }
.nickname-input input {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  outline: 0;
  transition: border-color 0.15s ease;
}
.nickname-input input:focus { border-color: var(--primary); }
.nickname-rules {
  margin: 0; padding-left: 20px;
  font-size: 12px; color: var(--muted);
  line-height: 1.8;
}
.nickname-rules strong { color: var(--accent); }
.nickname-error {
  margin: 10px 0 0;
  padding: 8px 12px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--accent);
  border-radius: 6px;
  font-size: 12.5px;
}
.nickname-shell footer {
  padding: 14px 22px 18px;
  display: flex; justify-content: flex-end; gap: 8px;
}

.profile-drawer-menu { display: flex; flex-direction: column; padding: 12px 14px; flex: 1; overflow-y: auto; }
.profile-drawer-menu button {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 12px;
  background: transparent; border: none; cursor: pointer;
  border-radius: 8px;
  font-size: 14.5px; color: var(--text);
  text-align: left;
}
.profile-drawer-menu button:hover { background: color-mix(in srgb, var(--primary) 8%, transparent); }
.profile-drawer-menu button svg { width: 20px; height: 20px; color: var(--muted); }

.profile-drawer-foot { padding: 14px 18px 22px; border-top: 1px dashed var(--line); }
.profile-logout {
  width: 100%; padding: 12px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: 10px; cursor: pointer;
  font-weight: 700; font-size: 14px;
}
.profile-logout:hover { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }

/* ============ 金币充值弹窗 ============ */
.coins-dialog { width: min(460px, calc(100vw - 32px)); }
.coins-amount-row { margin-top: 18px; }
.coins-amount-input { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; background: var(--surface); }
.coins-amount-input span { font-size: 12.5px; color: var(--muted); padding-right: 10px; border-right: 1px solid var(--line); }
.coins-amount-input input { flex: 1; border: 0; outline: 0; background: transparent; padding: 14px; font-size: 22px; font-weight: 700; color: var(--text); }
.coins-amount-input em { font-size: 12.5px; color: var(--muted); font-style: normal; }
.coins-quick { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.coins-quick button {
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}
.coins-quick button:hover {
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
  border-color: var(--primary);
  color: var(--primary-strong);
}
.coins-summary { margin: 16px 0 14px; text-align: center; color: var(--muted); font-size: 13.5px; }
.coins-summary strong { color: var(--text); font-size: 16px; }
.coins-pay-btn { width: 100%; }
.coins-qr-wrap { padding: 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.coins-qr-wrap img { width: 220px; height: 220px; border-radius: 8px; border: 1px solid var(--line); }
.coins-qr-tip { font-size: 13.5px; color: var(--text); margin: 4px 0 0; }
.coins-qr-amount { font-size: 18px; font-weight: 700; color: var(--text); margin: 4px 0; }
.coins-qr-status { font-size: 13px; color: var(--muted); margin: 4px 0 12px; }
.coins-qr-status:not(:empty) { padding: 6px 12px; background: color-mix(in srgb, var(--primary) 8%, var(--surface)); border-radius: 6px; }

/* ============ 我的钱包（v2：余额/会员/积分/金币） ============ */
.wallet-dialog { width: min(820px, calc(100vw - 32px)); }

/* 我的账单 */
.bills-dialog { width: min(880px, calc(100vw - 32px)); }
.bills-tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--line); margin-bottom: 14px; padding: 0 2px; }
.bills-tab {
  background: transparent; border: 0; padding: 10px 16px; cursor: pointer;
  font-size: 14px; color: var(--muted); position: relative;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.bills-tab:hover { color: var(--text); }
.bills-tab.active { color: var(--text); font-weight: 600; border-bottom-color: var(--primary, #1f7a55); }
.bills-filter {
  display: flex; gap: 10px; align-items: end; flex-wrap: wrap;
  padding: 8px 4px 14px; border-bottom: 1px dashed var(--line); margin-bottom: 12px;
}
.bills-filter label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.bills-filter input[type=date] {
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 13px; color: var(--text); background: var(--surface);
}
.bills-summary {
  display: flex; gap: 16px; padding: 12px 14px; background: color-mix(in srgb, var(--primary) 5%, transparent);
  border-radius: 10px; margin-bottom: 12px; font-size: 13px; flex-wrap: wrap;
}
.bills-summary .bs-item { display: flex; flex-direction: column; gap: 2px; }
.bills-summary .bs-label { font-size: 12px; color: var(--muted); }
.bills-summary .bs-value { font-size: 15px; font-weight: 600; color: var(--text); }
.bills-summary .bs-value.pos { color: #1f7a55; }
.bills-summary .bs-value.neg { color: #b43f2e; }
.bills-list-wrap { max-height: 50vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.bills-list { display: flex; flex-direction: column; }
.bills-row {
  display: grid; grid-template-columns: 110px 1fr 110px 100px;
  gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 13px;
  align-items: center;
}
.bills-row:last-child { border-bottom: 0; }
.bills-row:hover { background: color-mix(in srgb, var(--primary) 4%, transparent); }
.bills-row .br-date { color: var(--muted); font-size: 12px; }
.bills-row .br-desc { color: var(--text); }
.bills-row .br-desc small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.bills-row .br-amount { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.bills-row .br-amount.pos { color: #1f7a55; }
.bills-row .br-amount.neg { color: #b43f2e; }
.bills-row .br-balance { text-align: right; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.bills-pager { display: flex; gap: 6px; align-items: center; }
.bills-page-info { font-size: 12px; color: var(--muted); min-width: 56px; text-align: center; }
@media (max-width: 640px) {
  .bills-row { grid-template-columns: 1fr 1fr; row-gap: 6px; }
  .bills-row .br-date { grid-column: 1 / 2; }
  .bills-row .br-amount { grid-column: 2 / 3; }
  .bills-row .br-desc { grid-column: 1 / -1; order: 3; }
  .bills-row .br-balance { grid-column: 1 / -1; order: 4; text-align: left; }
}
.wallet-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.wallet-card {
  position: relative;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  display: flex; flex-direction: column;
  gap: 8px;
  min-height: 148px;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.wallet-card:hover { transform: translateY(-2px); box-shadow: 0 8px 18px -8px rgba(0,0,0,0.12); }
.wallet-card.primary {
  background: linear-gradient(135deg, var(--primary-strong), color-mix(in srgb, var(--primary) 80%, #000));
  color: #fff; border: none;
}
.wallet-card.primary .wallet-card-head span,
.wallet-card.primary .wallet-card-head small { color: rgba(255,255,255,0.78); }
.wallet-card.gold {
  background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 12%, var(--surface)), color-mix(in srgb, var(--gold) 6%, var(--surface)));
  border-color: color-mix(in srgb, var(--gold) 30%, var(--line));
}
.wallet-card-head { display: flex; justify-content: space-between; align-items: center; }
.wallet-card-head span { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.wallet-card-head span svg { width: 14px; height: 14px; }
.wallet-card-head small { font-size: 10.5px; color: var(--muted); }
.wallet-card > strong { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.1; }
.wallet-card.primary > strong { color: #fff; }
.wallet-card.primary > strong > span { font-size: 28px; }
.wallet-card-action {
  margin-top: auto;
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 10px;
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
  color: var(--primary-strong);
  border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--line));
  border-radius: 6px;
  font-size: 11.5px; font-weight: 600; cursor: pointer;
}
.wallet-card-action svg { width: 11px; height: 11px; }
.wallet-card-action.small { padding: 4px 8px; font-size: 11px; }
.wallet-card-action.ghost { background: transparent; }
.wallet-card-action:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.wallet-card.primary .wallet-card-action {
  background: rgba(255,255,255,0.16);
  color: #fff; border: 1px solid rgba(255,255,255,0.22);
}
.wallet-card.primary .wallet-card-action:hover { background: rgba(255,255,255,0.24); }
.wallet-card-actions { display: flex; gap: 6px; margin-top: auto; }

.wallet-tech-section { margin-top: 8px; padding-top: 16px; border-top: 1px dashed var(--line); }
.wallet-section-title { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.wallet-section-title strong { font-size: 14px; }
.wallet-section-title span { font-size: 11.5px; color: var(--muted); }
.wallet-tech-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.wallet-tech-grid > div {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px;
  display: flex; flex-direction: column; gap: 4px;
}
.wallet-tech-grid span { font-size: 12px; color: var(--muted); }
.wallet-tech-grid strong { font-size: 22px; font-weight: 800; }
.wallet-tech-grid small { font-size: 10.5px; color: var(--muted); }
.wallet-pending strong { display: block; font-size: 13px; margin-bottom: 8px; }

@media (max-width: 720px) {
  .wallet-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .wallet-cards { grid-template-columns: 1fr; }
}

/* ============ 设置-服务商入驻 ============ */
.enroll-status-card {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--primary) 4%, var(--surface));
}
.enroll-status-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.enroll-status-head strong { font-size: 16px; }
.enroll-status-badge {
  font-size: 11px; padding: 3px 8px;
  background: var(--line); color: var(--muted);
  border-radius: 999px; font-weight: 600;
}
.enroll-status-badge.ok { background: color-mix(in srgb, var(--primary) 18%, var(--surface)); color: var(--primary-strong); }
.enroll-status-badge.pending { background: color-mix(in srgb, var(--gold) 18%, var(--surface)); color: color-mix(in srgb, var(--gold) 70%, var(--text)); }
.enroll-status-badge.fail { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--accent); }
.enroll-status-card p { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 0 0 12px; }
.enroll-status-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.enroll-status-meta > div { display: flex; flex-direction: column; gap: 2px; }
.enroll-status-meta dt { font-size: 11px; color: var(--muted); margin: 0; }
.enroll-status-meta dd { font-size: 15px; font-weight: 700; margin: 0; }
.enroll-actions { margin-top: 18px; display: flex; flex-direction: column; gap: 6px; }

/* ============ 我的资产页 ============ */
.assets-page { padding-bottom: 60px; }
.assets-tabs {
  display: flex; gap: 4px;
  margin: 6px 0 24px;
  border-bottom: 1px solid var(--line);
}
.assets-tab {
  background: transparent; border: none; cursor: pointer;
  padding: 10px 16px;
  font-size: 14.5px; color: var(--muted);
  position: relative;
  border-radius: 8px 8px 0 0;
}
.assets-tab:hover { color: var(--text); }
.assets-tab.active { color: var(--text); font-weight: 600; }
.assets-tab.active::after {
  content: "";
  position: absolute; left: 16px; right: 16px; bottom: -1px;
  height: 2px; background: var(--primary);
  border-radius: 2px;
}

.assets-group { margin-bottom: 32px; }
.assets-group-date {
  font-size: 22px; font-weight: 800;
  margin: 0 0 14px;
  letter-spacing: -0.3px;
}
.assets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.asset-card {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 12px;
  overflow: hidden;
  background: color-mix(in srgb, var(--text) 4%, var(--surface));
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.asset-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px -8px rgba(0,0,0,0.16); }
.asset-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.asset-card-placeholder {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px;
  color: var(--muted);
  padding: 14px; text-align: center;
}
.asset-card-placeholder svg { width: 32px; height: 32px; opacity: 0.4; }
.asset-card-placeholder strong { font-size: 13px; color: var(--text); line-height: 1.35; }
.asset-card-tag {
  position: absolute; left: 8px; bottom: 8px;
  font-size: 11px; padding: 3px 8px;
  border-radius: 4px;
  background: rgba(0,0,0,0.62);
  color: #fff;
  letter-spacing: 0.3px;
}
.assets-empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 80px 0;
  color: var(--muted);
  gap: 12px;
}
.assets-empty svg { width: 56px; height: 56px; opacity: 0.4; }
.asset-card-text .asset-card-placeholder { padding: 16px; align-items: flex-start; text-align: left; }
.asset-card-text .asset-card-placeholder svg { width: 22px; height: 22px; align-self: flex-start; }
.asset-card-preview { font-size: 11px; color: var(--muted); line-height: 1.45; margin: 4px 0 0; }
.asset-card-play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 36px; height: 36px;
  background: rgba(0,0,0,0.55); color: #fff;
  border-radius: 999px; padding: 8px;
}

/* ============ 设置 Dialog ============ */
.settings-dialog {
  border: none; padding: 0;
  border-radius: 16px;
  max-width: 880px; width: 92vw; height: 600px;
  background: transparent;
  box-shadow: 0 20px 60px -16px rgba(0,0,0,0.32);
}
.settings-dialog::backdrop { background: rgba(0,0,0,0.4); }
.settings-shell {
  width: 100%; height: 100%;
  background: var(--surface);
  border-radius: 16px;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.settings-shell-head {
  padding: 22px 28px;
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}
.settings-shell-head h2 { font-size: 18px; margin: 0 0 4px; }
.settings-shell-head p { font-size: 13px; color: var(--muted); margin: 0; }

.settings-shell-body { display: grid; grid-template-columns: 200px 1fr; flex: 1; overflow: hidden; }
.settings-tabs-aside {
  border-right: 1px solid var(--line);
  padding: 16px 12px;
  display: flex; flex-direction: column; gap: 4px;
  background: color-mix(in srgb, var(--text) 2%, var(--surface));
}
.settings-aside-tab {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: transparent; border: none; cursor: pointer;
  border-radius: 8px;
  font-size: 14px; color: var(--text);
  text-align: left;
}
.settings-aside-tab:hover { background: color-mix(in srgb, var(--primary) 6%, transparent); }
.settings-aside-tab.active { background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary-strong); font-weight: 600; }
.settings-aside-tab svg { width: 18px; height: 18px; color: var(--muted); }
.settings-aside-tab.active svg { color: var(--primary-strong); }

.settings-tabs-body { padding: 24px 28px; overflow-y: auto; }
.settings-pane { display: none; }
.settings-pane.active { display: block; }

.settings-row {
  display: grid; grid-template-columns: 120px 1fr;
  padding: 14px 0; gap: 18px;
  border-bottom: 1px dashed var(--line);
  align-items: start;
}
.settings-row:last-child { border-bottom: none; }
.settings-row-label { font-size: 13px; color: var(--muted); padding-top: 4px; }
.settings-row-control { font-size: 14px; }
.settings-row-control strong { font-size: 14px; }
.settings-row-control .settings-hint { font-size: 11.5px; color: var(--muted); margin: 4px 0 0; }
.settings-avatar-row { display: flex; align-items: center; gap: 18px; }
.settings-big-avatar { width: 72px; height: 72px; font-size: 26px; margin: 0; box-shadow: 0 4px 12px -4px rgba(0,0,0,0.18); }
.settings-membership-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.settings-stat { display: inline-flex; flex-direction: column; margin-right: 18px; font-size: 12px; color: var(--muted); }
.settings-stat strong { font-size: 18px; color: var(--text); }

.settings-switch { display: inline-flex; cursor: pointer; }
.settings-switch input { display: none; }
.settings-switch span {
  position: relative;
  width: 38px; height: 22px;
  background: var(--line);
  border-radius: 999px;
  transition: background 0.16s ease;
}
.settings-switch span::after {
  content: ""; position: absolute;
  top: 2px; left: 2px; width: 18px; height: 18px;
  background: #fff; border-radius: 999px;
  transition: transform 0.16s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
}
.settings-switch input:checked + span { background: var(--primary); }
.settings-switch input:checked + span::after { transform: translateX(16px); }

.icon-button { background: transparent; border: none; cursor: pointer; padding: 6px; border-radius: 6px; color: var(--muted); }
.icon-button:hover { background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--text); }
.icon-button svg { width: 18px; height: 18px; }

@media (max-width: 720px) {
  .settings-dialog { height: 88vh; }
  .settings-shell-body { grid-template-columns: 1fr; }
  .settings-tabs-aside { flex-direction: row; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--line); }
  .settings-aside-tab { flex-shrink: 0; }
  .settings-row { grid-template-columns: 1fr; gap: 6px; }
}

/* 反扒：admin 风控面板 */
.risk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 12px; }
@media (max-width: 1100px) { .risk-grid { grid-template-columns: 1fr; } }
.admin-card-inner { background: #fafafa; border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-top: 12px; }
.admin-card-inner .admin-card-title { display: flex; justify-content: space-between; margin-bottom: 10px; }
.admin-card-inner .admin-card-title strong { font-size: 14px; }
.admin-card-inner .admin-card-title span { font-size: 12px; color: var(--muted); }
.risk-ban-form { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.risk-ban-form input { flex: 1; min-width: 100px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; }
.risk-ban-form button { padding: 6px 16px; }

/* 反扒：公开关键内容禁选（不影响输入框/可编辑区） */
.tm-card-desc,
.tm-detail-desc,
.workshop-module-body,
.manual-card-body,
.manual-search-snippet {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
input, textarea, [contenteditable="true"] { -webkit-user-select: text !important; user-select: text !important; }
