/* ============================================================
   YouYang Image Studio — 设计令牌
   逆向自 DCAI 生成页的 CSS 变量与计算样式
   ============================================================ */
:root {
  /* 品牌 */
  --brand-50: #f0f8f6;
  --brand-100: #ddefea;
  --brand-600: #0e7c66;
  --brand-700: #096653;
  --brand-800: #074c3f;

  /* 文字 */
  --ink-950: #101217;
  --ink-800: #292d35;
  --ink-600: #5e6572;
  --ink-500: #7a8290;
  --ink-400: #9aa1ad;

  /* 线条 */
  --line-300: #cdd2db;
  --line-200: #e2e5ea;
  --line-100: #eceef2;

  /* 底色 */
  --canvas-100: #f4f6f8;
  --canvas-50: #fafbfc;
  --white: #ffffff;
  --media-950: #0d0f13;

  /* 语义 */
  --background: #fafbfc;
  --foreground: #101217;
  --muted: #f4f6f8;
  --muted-foreground: #5e6572;
  --border: #e2e5ea;
  --primary: #0e7c66;
  --primary-foreground: #fff;

  /* 阴影 */
  --shadow-control: 0 1px 2px #1218280d;
  --shadow-card: 0 6px 18px #121e1c0f;
  --shadow-float: 0 16px 40px #121e1c1f, 0 3px 10px #121e1c0f;

  /* 布局 */
  --container-content: 1280px;
  --container-workbench: 1440px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* hidden 属性必须压过 display:flex/grid，否则带 display 的元素藏不住 */
[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--canvas-100);
  color: var(--ink-950);
  font-family: "Geist Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "HarmonyOS Sans SC", "Noto Sans SC", "Microsoft YaHei",
    sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

button {
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

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

/* ============================================================
   容器
   ============================================================ */
.container-page {
  width: 100%;
  max-width: var(--container-content);
  margin: 0 auto;
  padding: 0 1rem;
}

.container-workbench {
  width: 100%;
  max-width: var(--container-workbench);
  margin: 0 auto;
  padding-inline: 1rem;
}

@media (min-width: 1024px) {
  .container-page {
    padding: 0 2rem;
  }
  .container-workbench {
    padding-inline: 2rem;
  }
}

/* ============================================================
   顶部导航
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line-100);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  height: 4rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-shrink: 0;
}

.brand__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: var(--brand-600);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand__name {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav__link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-600);
  transition: background 0.16s, color 0.16s;
}

.nav__link:hover {
  background: var(--canvas-100);
  color: var(--ink-950);
}

.nav__link--strong {
  font-weight: 600;
  color: var(--ink-600);
}

.nav__link--strong:hover {
  background: var(--canvas-100);
  color: var(--ink-950);
}

.nav__hint {
  padding: 0.0625rem 0.375rem;
  border-radius: 999px;
  background: var(--brand-50);
  color: var(--brand-700);
  font-size: 0.6875rem;
  font-weight: 600;
}

.nav__chevron {
  width: 0.75rem;
  height: 0.75rem;
  opacity: 0.6;
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.link-quiet {
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-600);
  transition: background 0.16s, color 0.16s;
}

.link-quiet:hover {
  background: var(--canvas-100);
  color: var(--ink-950);
}

/* ============================================================
   主区
   ============================================================ */
.workbench-page {
  min-height: calc(100dvh - 65px);
  padding: 1rem 0;
}

@media (min-width: 1024px) {
  .workbench-page {
    padding: 1.5rem 0;
  }
}

.workbench {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  min-height: 780px;
}

@media (min-width: 1024px) {
  .workbench {
    grid-template-columns: 420px minmax(0, 1fr);
  }
}

/* ============================================================
   卡片
   ============================================================ */
.card {
  background: var(--white);
  border: 1px solid var(--line-200);
  border-radius: 0.75rem;
  overflow: hidden;
}

.card--panel {
  display: flex;
  flex-direction: column;
}

.card--preview {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 620px;
}

/* ============================================================
   左栏：模式切换
   ============================================================ */
.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--line-200);
  background: var(--canvas-50);
  padding: 0.375rem;
}

.mode-tab {
  min-height: 2.25rem;
  border-radius: 0.4375rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-600);
  transition: background 0.16s, color 0.16s, box-shadow 0.16s;
}

.mode-tab:hover {
  color: var(--ink-950);
}

.mode-tab[data-active="true"] {
  background: var(--white);
  color: var(--brand-800);
  box-shadow: var(--shadow-control), inset 0 0 0 1px var(--brand-100);
}

/* ============================================================
   左栏：参数区
   ============================================================ */
.panel-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
@media (min-width: 1024px) {
  .panel-body {
    max-height: calc(100dvh - 110px);
    overflow-y: auto;
  }
}

.panel-body::-webkit-scrollbar {
  width: 8px;
}

.panel-body::-webkit-scrollbar-thumb {
  background: var(--line-300);
  border-radius: 999px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.field--divided {
  border-top: 1px solid var(--line-100);
  padding-top: 1rem;
}

.field__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-800);
  letter-spacing: 0;
}

.field__label--lg {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-950);
}

.field__count {
  font-size: 0.75rem;
  font-weight: 400;
  color: #a1a1a1;
  font-variant-numeric: tabular-nums;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .field-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.field-grid--divided {
  border-top: 1px solid var(--line-100);
  padding-top: 1rem;
}

/* ============================================================
   分段控件
   ============================================================ */
.segmented-control {
  display: grid;
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid var(--line-200);
  border-radius: 0.625rem;
  background: var(--canvas-100);
}

.segmented-control--2 {
  grid-template-columns: 1fr 1fr;
}

.segmented-control--3 {
  grid-template-columns: repeat(3, 1fr);
}

.segmented-control--6 {
  grid-template-columns: repeat(6, 1fr);
}

.segmented-option {
  min-height: 2.5rem;
  border-radius: 0.4375rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-600);
  transition: background 0.16s, color 0.16s, box-shadow 0.16s;
}

.segmented-option:hover {
  color: var(--ink-950);
}

.segmented-option[data-active="true"] {
  background: var(--white);
  color: var(--brand-800);
  box-shadow: var(--shadow-control), inset 0 0 0 1px var(--brand-100);
}

.segmented-option--stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.125rem;
  min-height: 3.375rem;
  padding: 0.5rem 0.75rem;
  text-align: left;
  line-height: 1.35;
}

.segmented-option__title {
  font-size: 0.875rem;
  font-weight: 600;
}

.segmented-option__hint {
  font-size: 0.6875rem;
  font-weight: 400;
  color: #a1a1a1;
}

.segmented-option[data-active="true"] .segmented-option__hint {
  color: var(--brand-700);
}

.segmented-option--compact {
  min-height: 2.5rem;
  font-size: 0.8125rem;
  padding: 0.5rem 0.25rem;
}

/* ============================================================
   说明块
   ============================================================ */
.info-block {
  position: relative;
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: var(--canvas-50);
}

.info-block__title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-950);
}

.info-block__desc {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  line-height: 1.65;
  color: #737373;
}

.info-block__meta {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  margin: 0;
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--ink-500);
}

/* ============================================================
   下拉框
   ============================================================ */
.select-wrap {
  position: relative;
}

.select {
  width: 100%;
  height: 2.75rem;
  padding: 0 2.25rem 0 0.875rem;
  border: 1px solid var(--line-200);
  border-radius: 0.5rem;
  background: var(--white);
  color: var(--ink-950);
  font-size: 0.875rem;
  font-weight: 400;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.16s, box-shadow 0.16s;
  text-overflow: ellipsis;
}

.select--sm {
  height: 2.5rem;
  font-size: 0.875rem;
}

.select:hover {
  border-color: var(--line-300);
}

.select:focus {
  outline: none;
  border-color: var(--brand-600);
  box-shadow: 0 0 0 3px rgba(14, 124, 102, 0.12);
}

.select-wrap__chevron {
  position: absolute;
  top: 50%;
  right: 0.625rem;
  width: 0.875rem;
  height: 0.875rem;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--ink-400);
}

/* ============================================================
   提示词输入
   ============================================================ */
.prompt-area {
  width: 100%;
  min-height: 12rem;
  padding: 0.75rem;
  border: 1px solid var(--line-200);
  border-radius: 0.5rem;
  background: var(--white);
  color: var(--ink-950);
  font-size: 0.875rem;
  line-height: 1.7;
  resize: vertical;
  transition: border-color 0.16s, box-shadow 0.16s;
}

.prompt-area::placeholder {
  color: var(--ink-400);
}

.prompt-area:focus {
  outline: none;
  border-color: var(--brand-600);
  box-shadow: 0 0 0 3px rgba(14, 124, 102, 0.12);
}

.example-btn {
  margin-top: 0.5rem;
  text-align: left;
  font-size: 0.75rem;
  line-height: 1.65;
  color: var(--ink-500);
  text-decoration: underline;
  text-decoration-color: var(--line-300);
  text-underline-offset: 4px;
  transition: color 0.16s;
}

.example-btn:hover {
  color: var(--ink-950);
}

.polish-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.polish-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--brand-700);
  transition: color 0.16s;
}

.polish-btn:hover {
  color: var(--brand-800);
}

.polish-btn svg {
  width: 0.875rem;
  height: 0.875rem;
}

/* ============================================================
   消耗提示 + 主按钮
   ============================================================ */
.cost-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  border: 1px solid #e5e5e5;
  border-radius: 0.5rem;
  background: #fafafa;
  font-size: 0.875rem;
  line-height: 1.45;
}

.cost-box__label {
  color: #737373;
}

.cost-box__value {
  font-weight: 600;
  color: var(--brand-700);
  font-variant-numeric: tabular-nums;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  background: var(--brand-600);
  color: var(--primary-foreground);
  font-size: 1rem;
  font-weight: 600;
  box-shadow: var(--shadow-control);
  transition: background 0.16s, box-shadow 0.16s, transform 0.16s;
}

.btn-primary:hover:not(:disabled) {
  background: var(--brand-700);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(14, 124, 102, 0.16);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(1px) scale(0.985);
}

.btn-primary:disabled {
  background: var(--line-300);
  color: #fff;
  cursor: not-allowed;
}

.btn-primary--block {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.625rem 1.25rem;
  font-size: 1rem;
}

.btn-primary--sm {
  min-height: 2.25rem;
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
  border-radius: 0.5rem;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-height: 2.125rem;
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--line-200);
  border-radius: 0.5rem;
  background: var(--white);
  color: var(--ink-600);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: background 0.16s, border-color 0.16s, color 0.16s;
}

.btn-secondary:hover {
  background: var(--canvas-50);
  border-color: var(--line-300);
  color: var(--ink-950);
}

.btn-secondary[data-active="true"] {
  background: var(--brand-50);
  border-color: var(--brand-100);
  color: var(--brand-700);
  font-weight: 600;
}

.micro-note {
  margin: 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--ink-400);
}

/* ============================================================
   右栏：预览
   ============================================================ */
.preview-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.5rem;
  padding: 0 1rem;
  border-bottom: 1px solid var(--line-200);
}

.preview-head__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: var(--brand-50);
  color: var(--brand-700);
  flex-shrink: 0;
}

.preview-head__icon svg {
  width: 1rem;
  height: 1rem;
}

.preview-head__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.preview-head__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.preview-canvas {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 1.25rem;
  background: var(--white);
}

@media (min-width: 640px) {
  .preview-canvas {
    padding: 2rem;
  }
}

.preview-canvas__grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 1;
  background-image: linear-gradient(#d8d9da 1px, transparent 1px),
    linear-gradient(90deg, #d8d9da 1px, transparent 1px);
  background-size: 24px 24px;
}

.preview-empty {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  max-width: 36rem;
  aspect-ratio: 1 / 1;
  padding: 0 1.5rem;
  border: 1px solid #e5e5e5;
  border-radius: 0.5rem;
  background: var(--white);
  text-align: center;
  font-size: 0.875rem;
  color: #a1a1a1;
}

.preview-empty svg {
  width: 1.75rem;
  height: 1.75rem;
  color: #a1a1a1;
}

.preview-strip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--media-950);
  color: #fff;
  font-size: 0.75rem;
  min-height: 2.625rem;
}

.preview-strip__label {
  font-weight: 600;
}

.preview-strip__empty {
  color: rgba(255, 255, 255, 0.5);
}

.preview-strip__link {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: rgba(255, 255, 255, 0.75);
  transition: color 0.16s;
}

.preview-strip__link:hover {
  color: #fff;
}

/* ============================================================
   页脚
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--line-100);
  background: var(--canvas-50);
  color: var(--ink-500);
  font-size: 0.875rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding: 3rem 0;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.footer-brand {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ink-950);
}

.footer-desc {
  margin: 0.75rem 0 0;
  line-height: 1.7;
}

.footer-title {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-950);
}

.footer-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-list a {
  transition: color 0.16s;
}

.footer-list a:hover {
  color: var(--brand-700);
}

.footer-contact {
  margin: 1rem 0 0;
  font-size: 0.75rem;
}

.footer-bottom {
  border-top: 1px solid var(--line-100);
}

.footer-bottom__inner {
  padding: 1rem 0;
  text-align: center;
  font-size: 0.75rem;
}

/* ============================================================
   工具类
   ============================================================ */
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   站点外壳：下拉菜单 / 移动导航 / 弹窗 / 输入框
   ============================================================ */
.nav-drop {
  position: relative;
}

.nav-drop > .nav__link--strong {
  flex-wrap: nowrap;
  white-space: nowrap;
  height: 2.25rem;
}

.nav__chevron {
  display: inline-flex;
  flex-shrink: 0;
  transition: transform 0.18s;
}

.nav__chevron svg {
  width: 14px;
  height: 14px;
}

.nav-drop.is-open .nav__chevron {
  transform: rotate(180deg);
}

.navmenu {
  position: absolute;
  left: 50%;
  top: 100%;
  width: min(920px, calc(100vw - 48px));
  transform: translateX(-36%);
  padding-top: 0.75rem;
  display: none;
  z-index: 60;
}

.nav-drop.is-open .navmenu {
  display: block;
}

.navmenu__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
  padding: 1.5rem;
  border: 1px solid var(--line-200);
  border-radius: 0.75rem;
  background: var(--white);
  box-shadow: var(--shadow-float);
}

.navmenu__coltitle {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #737373;
}

.navmenu__item {
  display: block;
  padding: 0.625rem 0.5rem;
  border-radius: 0.5rem;
  transition: background 0.16s;
}

.navmenu__item:hover {
  background: var(--canvas-50);
}

.navmenu__itemtitle {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-800);
}

.navmenu__itemdesc {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: #737373;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-burger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-left: auto;
  border: 1px solid var(--line-200);
  border-radius: 0.5rem;
  color: var(--ink-800);
}

.header-burger svg {
  width: 20px;
  height: 20px;
}

.mobile-nav {
  border-top: 1px solid var(--line-100);
  background: var(--white);
  max-height: 70vh;
  overflow-y: auto;
}

.mobile-nav__inner {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.mobile-nav__title {
  margin: 0.75rem 0 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #a1a1a1;
}

.mobile-nav__link {
  padding: 0.625rem 0.25rem;
  font-size: 0.875rem;
  color: var(--ink-800);
  border-radius: 0.375rem;
}

.mobile-nav__link--main {
  font-weight: 600;
}

@media (max-width: 1023px) {
  .nav {
    display: none;
  }
  .header-actions {
    display: none;
  }
  .header-burger {
    display: flex;
  }
}

@media (max-width: 767px) {
  .navmenu__grid {
    grid-template-columns: 1fr;
  }
}

.key-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  height: 2.25rem;
  padding: 0 0.75rem;
  border: 1px solid var(--line-200);
  border-radius: 999px;
  background: var(--canvas-50);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-600);
  transition: border-color 0.16s, color 0.16s;
}

.key-chip:hover {
  border-color: var(--brand-600);
  color: var(--brand-700);
}

.key-chip svg {
  width: 14px;
  height: 14px;
}

.is-current {
  color: var(--ink-950) !important;
  font-weight: 600;
}

/* ---------------- 弹窗 ---------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 18, 23, 0.42);
  backdrop-filter: blur(2px);
}

.modal__panel {
  position: relative;
  width: 100%;
  max-width: 30rem;
  padding: 1.5rem;
  border-radius: 0.75rem;
  background: var(--white);
  box-shadow: var(--shadow-float);
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.modal__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.375rem;
  color: var(--ink-500);
}

.modal__close:hover {
  background: var(--canvas-100);
}

.modal__close svg {
  width: 16px;
  height: 16px;
}

.modal__desc {
  margin: 0.75rem 0 1.25rem;
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--ink-500);
}

.modal__hint {
  margin: 0.625rem 0 0;
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--ink-500);
}

.modal__hint a {
  color: var(--brand-700);
  text-decoration: underline;
}

.modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.input {
  width: 100%;
  height: 2.75rem;
  padding: 0 0.875rem;
  margin-top: 0.5rem;
  border: 1px solid var(--line-200);
  border-radius: 0.5rem;
  background: var(--white);
  font-size: 0.875rem;
  transition: border-color 0.16s, box-shadow 0.16s;
}

.input:focus {
  outline: none;
  border-color: var(--brand-600);
  box-shadow: 0 0 0 3px rgba(14, 124, 102, 0.12);
}

/* ---------------- 通用页面块 ---------------- */
.page-main {
  background: var(--canvas-100);
  padding: 2rem 0 4rem;
}

.page-hero {
  padding: 3.5rem 0 2.5rem;
}

.page-hero__eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-700);
}

.page-hero__title {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

@media (min-width: 768px) {
  .page-hero__title {
    font-size: 2.5rem;
  }
}

.page-hero__desc {
  margin: 1rem 0 0;
  max-width: 42rem;
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--ink-500);
}

.section-title {
  margin: 0 0 1.25rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.tile {
  padding: 1.25rem;
  border: 1px solid var(--line-200);
  border-radius: 0.75rem;
  background: var(--white);
}

.tile__title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
}

.tile__desc {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--ink-500);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: var(--ink-400);
  padding-top: 1rem;
}

.breadcrumb a:hover {
  color: var(--brand-700);
}

/* ---------------- 生成记录 ---------------- */
.dash-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.dash-bar__count {
  font-size: 0.8125rem;
  color: var(--ink-500);
}

.dash-bar .btn-secondary {
  margin-left: auto;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .gallery {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.gallery__item {
  position: relative;
  border: 1px solid var(--line-200);
  border-radius: 0.625rem;
  overflow: hidden;
  background: var(--white);
  transition: border-color 0.16s, transform 0.16s;
}

.gallery__item:hover {
  border-color: var(--brand-600);
  transform: translateY(-2px);
}

.gallery__item img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--canvas-100);
}

.gallery__meta {
  padding: 0.5rem 0.625rem;
  font-size: 0.6875rem;
  color: var(--ink-500);
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.gallery__prompt {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery__actions {
  display: flex;
  gap: 0.375rem;
  padding: 0 0.625rem 0.625rem;
}

.gallery__actions a,
.gallery__actions button {
  flex: 1;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-200);
  border-radius: 0.375rem;
  background: var(--white);
  font-size: 0.6875rem;
  color: var(--ink-600);
  transition: border-color 0.16s, color 0.16s;
}

.gallery__actions a:hover,
.gallery__actions button:hover {
  border-color: var(--brand-600);
  color: var(--brand-700);
}

.dash-empty {
  padding: 4rem 1rem;
  text-align: center;
  border: 1px solid var(--line-200);
  border-radius: 0.75rem;
  background: var(--white);
  color: var(--ink-500);
  font-size: 0.875rem;
}

.dash-empty[hidden] {
  display: none;
}

.dash-empty p {
  margin: 0 0 1.25rem;
}
