/* ==========================================================================
   造一只 V2 · 设计与交互优化层
   只叠加视觉与交互，不改动生成、登录、下单、3D 模型相关的脚本与接口。
   删除本文件与 v2-polish.js 的引用即可完整回退到 V1 外观。
   ========================================================================== */

:root {
  --v2-ink: #071b25;
  --v2-muted: #687a7c;
  --v2-paper: #fffaf0;
  --v2-card: #fffef8;
  --v2-line: #e4e6dc;
  --v2-coral: #ff614b;
  --v2-coral-deep: #e94e3a;
  --v2-lime: #f7f66e;
  --v2-mint: #baf0e7;
  --v2-ease: cubic-bezier(.22, .8, .24, 1);
  --v2-nav-h: 84px;
  --v2-nav-h-compact: 66px;
}

html { scroll-padding-top: calc(var(--v2-nav-h-compact) + 16px); }
body.mint-theme { -webkit-tap-highlight-color: transparent; }
body.mint-theme :is(h1, h2, h3) { text-wrap: balance; }
body.mint-theme :is(p, li, summary) { text-wrap: pretty; }

/* ---------- 1. 顶部导航：固定 + 滚动后磨砂收缩 + 当前区块高亮 ---------- */
body.mint-theme .nav {
  position: fixed;
  inset: 0 0 auto;
  width: 100%;
  max-width: none;
  margin: 0;
  padding-inline: max(50px, calc((100vw - 1440px) / 2));
  z-index: 60;
  height: var(--v2-nav-h);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: height .35s var(--v2-ease), background-color .35s ease, border-color .35s ease, box-shadow .35s ease;
}
body.mint-theme .nav.scrolled {
  height: var(--v2-nav-h-compact);
  background: rgba(255, 250, 240, .84);
  border-color: rgba(7, 27, 37, .07);
  box-shadow: 0 10px 30px rgba(7, 27, 37, .05);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
}
body.mint-theme .nav .brand-lockup-image { transition: width .35s var(--v2-ease); }
body.mint-theme .nav.scrolled .brand-lockup-image { width: 148px; }

/* 导航链接收进一个玻璃胶囊，避免压在首屏插画上看不清 */
body.mint-theme .nav nav {
  gap: 2px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 999px;
  background: rgba(255, 250, 240, .52);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  transition: background-color .3s ease, border-color .3s ease;
}
body.mint-theme .nav.scrolled nav { background: rgba(7, 27, 37, .04); border-color: transparent; }
body.mint-theme .nav nav a {
  position: relative;
  padding: 9px 17px;
  border-radius: 999px;
  color: #173a40;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s ease, background-color .2s ease;
}
body.mint-theme .nav nav a:hover { color: var(--v2-ink); background: rgba(255, 255, 255, .72); }
body.mint-theme .nav nav a.is-active { color: #fff; background: var(--v2-ink); }

/* 滚动后在登录按钮旁出现“开始创造”快捷按钮 */
body.mint-theme .nav-actions { gap: 10px; }
body.mint-theme .nav .nav-cta {
  display: inline-flex;
  min-height: 42px;
  padding: 9px 18px;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--v2-coral);
  font-size: 14px;
  font-weight: 800;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .3s ease, transform .3s var(--v2-ease), visibility .3s, background-color .2s ease;
}
body.mint-theme .nav .nav-cta img { width: 15px; height: 15px; filter: brightness(0) invert(1); }
body.mint-theme .nav.scrolled .nav-cta { opacity: 1; visibility: visible; transform: none; }
body.mint-theme .nav .nav-cta:hover { background: var(--v2-coral-deep); color: #fff; }
body.mint-theme .nav.scrolled .login-entry { background: #fff; box-shadow: inset 0 0 0 1px rgba(7, 27, 37, .08); }
body.mint-theme .login-entry { transition: background-color .2s ease, box-shadow .2s ease; }
body.mint-theme .login-entry:hover { background: #fff; box-shadow: inset 0 0 0 1px rgba(7, 27, 37, .14); }

/* 阅读进度条 */
.v2-progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 2px;
  background: var(--v2-coral);
  transform: scaleX(0);
  transform-origin: 0 50%;
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}
.nav.scrolled .v2-progress { opacity: 1; }

/* 手机菜单按钮（桌面隐藏） */
.v2-menu-toggle { display: none; }

/* ---------- 2. 通用按钮手感 ---------- */
body.mint-theme :is(.primary, .nav-cta, .login-entry, .generate-button, .image-generate-button, .cotton-primary, .size-select-button, .product-mode-tabs button, .creation-tabs button) {
  transition-property: transform, background-color, color, box-shadow, opacity;
  transition-duration: .18s;
  transition-timing-function: ease;
}
body.mint-theme :is(.primary, .nav-cta, .login-entry, .generate-button, .image-generate-button, .cotton-primary, .size-select-button):not(:disabled):active { transform: scale(.97); }
body.mint-theme .hero-actions .primary { box-shadow: 0 12px 28px rgba(255, 97, 75, .28); }
body.mint-theme .hero-actions .primary:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(255, 97, 75, .34); }
body.mint-theme .hero-actions .primary img { transition: transform .25s var(--v2-ease); }
body.mint-theme :is(.primary, .nav-cta):hover img { transform: translate(2px, -2px); }

/* ---------- 3. 制作流程：三张独立卡片 + 步骤连线 ---------- */
body.mint-theme .mint-workflow {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  justify-content: stretch;
  gap: 20px;
  padding: 40px 0 28px;
  counter-reset: v2step;
}
body.mint-theme .mint-workflow article,
body.mint-theme .mint-workflow article + article {
  position: relative;
  padding: 26px 28px 28px;
  border: 1px solid var(--v2-line);
  border-left: 1px solid var(--v2-line);
  border-radius: 20px;
  background: var(--v2-card);
  transition: transform .3s var(--v2-ease), box-shadow .3s ease, border-color .3s ease;
}
body.mint-theme .mint-workflow article:hover {
  transform: translateY(-4px);
  border-color: #d3e3dc;
  box-shadow: 0 18px 40px rgba(7, 27, 37, .07);
}
body.mint-theme .mint-workflow article > div { justify-content: space-between; gap: 16px; }
body.mint-theme .mint-workflow article > div img {
  box-sizing: content-box;
  width: 24px;
  height: 24px;
  padding: 11px;
  border-radius: 14px;
  background: #e7f5ef;
  filter: none;
}
body.mint-theme .mint-workflow article:nth-child(2) > div img { background: #fbf9c9; }
body.mint-theme .mint-workflow article:nth-child(3) > div img { background: #ffe3dd; }
@media (min-width: 721px) {
  body.mint-theme .mint-workflow article:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -15px;
    z-index: 1;
    width: 10px;
    height: 10px;
    border-top: 2px solid #b6cdc6;
    border-right: 2px solid #b6cdc6;
    transform: translateY(-50%) rotate(45deg);
  }
}

/* ---------- 4. 社区展示：标题区留白收紧 ---------- */
body.mint-theme .community-showcase .showcase-heading h2 { line-height: 1.3; }

/* ---------- 5. 创作工作台：面板层次 ---------- */
body.mint-theme .product-mode-tabs button:not(.active):hover { background: rgba(255, 255, 255, .65); }
body.mint-theme .creation-tabs button:not(.active):hover { background: rgba(255, 255, 255, .55); }
body.mint-theme .studio-grid,
body.mint-theme .cotton-studio-grid { box-shadow: 0 24px 60px rgba(39, 97, 88, .08); }
body.mint-theme :is(.prompt-field textarea, .cotton-note textarea, .cotton-refine textarea) {
  transition: border-color .2s ease, box-shadow .2s ease;
}
body.mint-theme :is(.prompt-field textarea, .cotton-note textarea, .cotton-refine textarea):focus {
  border-color: #7fb8ab;
  outline: none;
  box-shadow: 0 0 0 4px rgba(127, 184, 171, .22);
}

/* ---------- 6. 尺寸与价格：卡片化 + 选中态更明确 ---------- */
body.mint-theme .sizes .size-cards { gap: 22px; }
body.mint-theme .sizes .size-cards article,
body.mint-theme .sizes .size-cards article.popular,
body.mint-theme .sizes .size-cards article + article {
  position: relative;
  border: 1px solid var(--v2-line);
  border-radius: 22px;
  background: var(--v2-card);
  cursor: pointer;
  transition: transform .3s var(--v2-ease), box-shadow .3s ease, border-color .3s ease;
}
body.mint-theme .sizes .size-cards article:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 44px rgba(7, 27, 37, .08);
}
body.mint-theme .sizes .size-cards article.selected,
body.mint-theme .sizes .size-cards article.selected:hover,
body.mint-theme .sizes .size-cards article.selected:focus,
body.mint-theme .sizes .size-cards article.selected:focus-visible {
  border-color: #cfe6dc;
  background: #f5faef;
  box-shadow: 0 18px 40px rgba(39, 97, 88, .1);
}
body.mint-theme .sizes .size-cards article:focus-visible { outline: 3px solid #287d7b; outline-offset: 4px; }
body.mint-theme .sizes .size-cards .size-visual.size-photo img { transition: transform .6s var(--v2-ease); }
body.mint-theme .sizes .size-cards article:hover .size-visual.size-photo img { transform: scale(1.035) !important; }
/* 经典版“最受欢迎”角标 */
body.mint-theme .sizes .size-cards .popular-tag {
  display: block;
  top: 14px;
  right: auto;
  left: 14px;
  padding: 6px 11px;
  border-radius: 999px;
  color: var(--v2-ink);
  background: var(--v2-lime);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}
body.mint-theme .sizes .size-cards button { border-radius: 999px; min-height: 46px; }
.v2-size-dots { display: none; }

/* ---------- 7. 常见问题：展开动画 + 悬停反馈 ---------- */
body.mint-theme .faq-list { interpolate-size: allow-keywords; }
body.mint-theme .faq-list details { transition: background-color .2s ease; }
body.mint-theme .faq-list details:hover { background: rgba(186, 240, 231, .22); }
body.mint-theme .faq-list details[open] { background: rgba(186, 240, 231, .3); }
body.mint-theme .faq-list summary { padding-inline: 8px; }
body.mint-theme .faq-list details > p { padding-inline: 8px; }
body.mint-theme .faq-list details::details-content {
  block-size: 0;
  overflow: hidden;
  transition: block-size .32s var(--v2-ease), content-visibility .32s allow-discrete;
}
body.mint-theme .faq-list details[open]::details-content { block-size: auto; }

/* ---------- 8. 结尾引导 ---------- */
body.mint-theme .mint-closing {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: linear-gradient(105deg, #baf0e7 4%, #c2f2df 48%, #def5bb 100%);
}
body.mint-theme .mint-closing::before,
body.mint-theme .mint-closing::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
}
body.mint-theme .mint-closing::before {
  inset: -80% -25%;
  background:
    radial-gradient(ellipse 35% 50% at 29% 50%, rgba(255, 255, 255, .72), transparent 78%),
    radial-gradient(ellipse 40% 64% at 78% 48%, rgba(237, 250, 145, .75), transparent 78%),
    radial-gradient(ellipse 26% 52% at 57% 70%, rgba(109, 223, 210, .38), transparent 80%);
  filter: blur(22px);
  animation: v2-closing-glow 16s ease-in-out infinite alternate;
}
body.mint-theme .mint-closing::after {
  inset: -100% -35%;
  background: linear-gradient(110deg,
    transparent 34%, rgba(255, 255, 255, .03) 41%,
    rgba(255, 255, 255, .34) 49%, rgba(247, 253, 189, .23) 53%,
    transparent 61%);
  filter: blur(16px);
  transform: translate3d(-20%, 0, 0) rotate(-8deg);
  animation: v2-closing-sheen 12s ease-in-out infinite alternate;
}
body.mint-theme .mint-closing > * { position: relative; z-index: 1; }
@keyframes v2-closing-glow {
  from { transform: translate3d(-5%, -3%, 0) rotate(-7deg) scale(1); }
  to { transform: translate3d(6%, 4%, 0) rotate(8deg) scale(1.08); }
}
@keyframes v2-closing-sheen {
  from { transform: translate3d(-20%, 0, 0) rotate(-8deg); opacity: .45; }
  to { transform: translate3d(20%, 0, 0) rotate(-8deg); opacity: .8; }
}
@media (prefers-reduced-motion: reduce) {
  body.mint-theme .mint-closing::before,
  body.mint-theme .mint-closing::after { animation: none; }
}
body.mint-theme .mint-closing .primary { box-shadow: 0 12px 26px rgba(255, 97, 75, .26); }

/* ---------- 9. AI 客服入口 ---------- */
body.mint-theme .chat-launcher { transition: transform .25s var(--v2-ease), box-shadow .25s ease; }
body.mint-theme .chat-launcher:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(24, 51, 42, .18); }

/* ==========================================================================
   平板
   ========================================================================== */
@media (min-width: 721px) and (max-width: 1100px) {
  body.mint-theme .nav { padding-inline: 24px; }
  body.mint-theme .hero {
    height: auto;
    min-height: 0;
    max-height: none;
    aspect-ratio: auto;
    padding-bottom: clamp(420px, 62vw, 620px);
    background-size: auto clamp(440px, 64vw, 660px);
    background-position: 72% bottom;
  }
  body.mint-theme .hero { background-color: #aff5f1; }
  body.mint-theme .hero-copy { padding-top: 130px; text-align: center; }
  body.mint-theme .hero h1 { font-size: clamp(44px, 6.6vw, 64px); white-space: normal; }
  body.mint-theme .hero-actions { justify-content: center; }
}

@media (max-width: 1100px) {
  body.mint-theme .nav nav a { padding: 8px 12px; font-size: 13px; }
  body.mint-theme .nav .nav-cta { display: none; }
  body.mint-theme .mint-workflow article,
  body.mint-theme .mint-workflow article + article { padding: 22px; }
}

/* ==========================================================================
   手机
   ========================================================================== */
@media (max-width: 900px) {
  body.mint-theme .nav .nav-cta { display: none; }
  .v2-menu-toggle {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--v2-paper);
    color: var(--v2-ink);
    cursor: pointer;
  }
  .nav.scrolled .v2-menu-toggle { background: #fff; box-shadow: inset 0 0 0 1px rgba(7, 27, 37, .08); }
  .v2-menu-toggle span,
  .v2-menu-toggle span::before,
  .v2-menu-toggle span::after {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform .3s var(--v2-ease), opacity .2s ease;
  }
  .v2-menu-toggle span { position: relative; }
  .v2-menu-toggle span::before,
  .v2-menu-toggle span::after { content: ""; position: absolute; left: 0; }
  .v2-menu-toggle span::before { top: -6px; }
  .v2-menu-toggle span::after { top: 6px; }
  .nav.menu-open .v2-menu-toggle span { background: transparent; }
  .nav.menu-open .v2-menu-toggle span::before { transform: translateY(6px) rotate(45deg); }
  .nav.menu-open .v2-menu-toggle span::after { transform: translateY(-6px) rotate(-45deg); }

  /* 手机端把原有 nav 变成下拉菜单 */
  body.mint-theme .nav nav {
    position: absolute;
    top: calc(100% + 8px);
    right: 14px;
    left: 14px;
    display: grid;
    gap: 4px;
    padding: 10px;
    border: 1px solid rgba(7, 27, 37, .08);
    border-radius: 20px;
    background: rgba(255, 250, 240, .97);
    box-shadow: 0 24px 60px rgba(7, 27, 37, .16);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(.98);
    transform-origin: top center;
    transition: opacity .22s ease, transform .28s var(--v2-ease), visibility .28s;
  }
  body.mint-theme .nav nav,
  body.mint-theme .nav.scrolled nav {
    border-color: rgba(7, 27, 37, .08);
    background: #fffaf0;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  body.mint-theme .nav.menu-open nav { opacity: 1; visibility: visible; transform: none; }
  body.mint-theme .nav nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 50px;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 16px;
  }
  body.mint-theme .nav nav a::after { content: "→"; color: #9fb3b0; font-weight: 400; }
  body.mint-theme .nav nav a.is-active::after { color: var(--v2-lime); }
  body.mint-theme .nav.menu-open { background: rgba(255, 250, 240, .96); }

}

@media (max-width: 720px) {
  :root { --v2-nav-h: 72px; --v2-nav-h-compact: 60px; }
  body.mint-theme .nav { padding: 0 14px 0 18px; padding-inline: 18px 14px; }
  body.mint-theme .hero { background-color: #aff5f1; }
  body.mint-theme .nav.scrolled .brand-lockup-image { width: 124px; }
  body.mint-theme .nav-actions { gap: 8px; }

  /* 流程卡片：紧凑单列 */
  body.mint-theme .mint-workflow { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 24px 0 18px; }
  body.mint-theme .mint-workflow article,
  body.mint-theme .mint-workflow article + article {
    grid-template-columns: 58px 1fr;
    padding: 16px 16px 16px 14px;
    border: 1px solid var(--v2-line);
    border-radius: 16px;
  }
  body.mint-theme .mint-workflow article { display: grid; column-gap: 12px; }
  body.mint-theme .mint-workflow article > div { grid-row: span 2; flex-direction: column; align-items: center; justify-content: flex-start; gap: 6px; }
  body.mint-theme .mint-workflow article > div img { width: 18px; height: 18px; padding: 8px; border-radius: 11px; }
  body.mint-theme .mint-workflow b { font-size: 24px; }
  body.mint-theme .mint-workflow h3 { font-size: 17px; margin-top: 2px; }
  body.mint-theme .mint-workflow article:hover { transform: none; box-shadow: none; }

  /* 创作方式两个选项并排，节省首屏高度 */
  body.mint-theme .creation-tabs { grid-template-columns: 1fr 1fr; }
  body.mint-theme .creation-tabs button { padding: 10px; text-align: left; }

  /* 尺寸卡片：横向滑动 + 指示点 */
  body.mint-theme .sizes .size-cards {
    display: flex;
    gap: 12px;
    margin-inline: -18px;
    padding: 4px 18px 14px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 18px;
    scrollbar-width: none;
  }
  body.mint-theme .sizes .size-cards::-webkit-scrollbar { display: none; }
  body.mint-theme .sizes .size-cards article,
  body.mint-theme .sizes .size-cards article.popular,
  body.mint-theme .sizes .size-cards article + article {
    flex: 0 0 80%;
    border-top: 1px solid var(--v2-line);
    scroll-snap-align: start;
  }
  body.mint-theme .sizes .size-cards article.selected { border-color: #cfe6dc; box-shadow: 0 10px 26px rgba(39, 97, 88, .1); }
  body.mint-theme .sizes .size-cards article:hover { transform: none; }
  body.mint-theme .sizes .size-cards article:hover .size-visual.size-photo img { transform: none !important; }
  body.mint-theme .size-card-details { padding: 16px 18px 18px; }
  body.mint-theme .size-cards strong { margin: 10px 0 14px; }

  .v2-size-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
  }
  .v2-size-dots button {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: #cfd9d3;
    cursor: pointer;
    transition: width .3s var(--v2-ease), background-color .3s ease;
  }
  .v2-size-dots button[aria-current="true"] { width: 22px; background: var(--v2-ink); }
  .v2-size-hint { margin: 6px 0 0; color: var(--v2-muted); font-size: 12px; text-align: center; }

  body.mint-theme .faq-list summary { padding-inline: 6px; }

  body.mint-theme .mint-closing h2 { max-width: 12em; font-size: 23px; }
  body.mint-theme .chat-launcher { bottom: max(15px, env(safe-area-inset-bottom)); }
}

@media (min-width: 721px) {
  .v2-size-hint { display: none; }
}

/* ==========================================================================
   减少动态效果
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  body.mint-theme *,
  body.mint-theme *::before,
  body.mint-theme *::after,
  body.mint-theme .faq-list details::details-content {
    transition-duration: .01ms !important;
  }
}
