/* Tailwind CSS CDN */
@import url('https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css');

/* ============================================================
   手绘头像工坊 · 全局样式
   ============================================================ */
:root {
  /* 主色 */
  --c-primary: #2F6B4F;
  --c-primary-soft: #3F8C63;
  --c-accent: #F2A65A;
  /* 背景 */
  --c-bg: #FAF6EC;
  --c-surface: #FFFFFF;
  --c-deep: #1E3A2F;
  /* 文字 */
  --c-text: #24382E;
  --c-muted: #5B6B60;
  --c-invert: #FFFFFF;
  /* 功能色 */
  --c-success: #4CAF50;
  --c-danger: #E5533D;
  --c-warn: #F2C14E;
  --c-sky: #7FB3D5;

  --grad-green: linear-gradient(135deg, #3F8C63 0%, #2F6B4F 100%);
  --grad-warm: linear-gradient(135deg, #F2A65A 0%, #E5533D 100%);
  --grad-page: linear-gradient(180deg, #FAF6EC 0%, #F6F1E2 45%, #FAF6EC 100%);

  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 26px;
  --r-pill: 999px;

  --sh-sm: 0 2px 8px rgba(30, 58, 47, .06);
  --sh-md: 0 10px 28px rgba(30, 58, 47, .10);
  --sh-lg: 0 22px 55px rgba(30, 58, 47, .16);

  --glass: rgba(255, 255, 255, .72);
  --glass-brd: rgba(255, 255, 255, .85);

  --font: "Noto Sans SC", "Noto Sans", -apple-system, "Segoe UI", "PingFang SC",
          "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;

  --maxw: 1180px;
  --ease: cubic-bezier(.22, .8, .3, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--c-text);
  background: var(--grad-page);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 西文（英/法/西）行高放宽 */
html[lang="en"] body,
html[lang="fr"] body,
html[lang="es"] body { line-height: 1.75; }

h1, h2, h3 { line-height: 1.25; margin: 0; }
h1 { font-size: clamp(28px, 4.4vw, 40px); font-weight: 700; letter-spacing: -.5px; }
h2 { font-size: clamp(22px, 3vw, 30px); font-weight: 700; }
h3 { font-size: 18px; font-weight: 600; }
p  { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
img { display: block; max-width: 100%; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--c-primary); color: #fff; padding: 10px 16px; border-radius: 0 0 12px 0;
}
.skip-link:focus { left: 0; }

/* 语言切换时柔和淡入 */
.lang-fade, [data-i18n] { transition: opacity .15s var(--ease); }
body.switching [data-i18n] { opacity: .25; }

/* ---------- 通用按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 11px 22px;
  border: none; border-radius: var(--r-pill);
  font-family: inherit; font-size: 15px; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
  white-space: nowrap;
}
.btn-primary { background: var(--grad-green); color: var(--c-invert); box-shadow: 0 8px 20px rgba(47, 107, 79, .28); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(47, 107, 79, .34); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: rgba(255, 255, 255, .75); color: var(--c-primary);
  border: 1.5px solid rgba(63, 140, 99, .45); backdrop-filter: blur(6px);
}
.btn-ghost:hover { transform: translateY(-2px); border-color: var(--c-primary-soft); box-shadow: var(--sh-md); }

.btn-warm { background: var(--grad-warm); color: #fff; box-shadow: 0 10px 26px rgba(229, 83, 61, .3); }
.btn-warm:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(229, 83, 61, .38); }

.btn-lg { min-height: 52px; padding: 14px 30px; font-size: 16px; }

:focus-visible { outline: 3px solid rgba(242, 166, 90, .75); outline-offset: 3px; }

/* ============================================================
   区块 1：顶部导航
   ============================================================ */
.site-nav {
  position: sticky; top: 0; z-index: 60;
  background: rgba(250, 246, 236, .82);
  backdrop-filter: blur(14px) saturate(150%);
  border-bottom: 1px solid rgba(47, 107, 79, .10);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: 10px 20px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; min-width: 0; }
.brand-mark { display: grid; place-items: center; filter: drop-shadow(0 4px 10px rgba(47, 107, 79, .25)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong { font-size: 17px; font-weight: 700; }
.brand-text small { font-size: 12px; color: var(--c-muted); }

.nav-links { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.nav-links a {
  padding: 8px 14px; border-radius: var(--r-pill);
  color: var(--c-text); text-decoration: none; font-size: 14px; font-weight: 500;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.nav-links a:hover { background: rgba(63, 140, 99, .12); color: var(--c-primary); }

.free-badge {
  padding: 5px 12px; margin-right: 4px;
  border-radius: var(--r-pill);
  background: rgba(76, 175, 80, .14); color: #2E7D32;
  font-size: 12px; font-weight: 700; letter-spacing: .3px;
  border: 1px solid rgba(76, 175, 80, .3);
}

/* 语言切换器 */
.lang-switch { display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .8); border: 1px solid rgba(47, 107, 79, .12); }
.lang-pill {
  border: none; background: transparent; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 600; color: var(--c-muted);
  padding: 6px 12px; border-radius: var(--r-pill); min-height: 34px;
  transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
}
.lang-pill:hover { color: var(--c-primary); background: rgba(63, 140, 99, .1); }
.lang-pill.is-active { background: var(--grad-green); color: #fff; box-shadow: 0 6px 14px rgba(47, 107, 79, .26); }
.lang-select {
  display: none;
  font-family: inherit; font-size: 14px; color: var(--c-text);
  border: none; background: transparent; min-height: 34px; padding: 0 4px; cursor: pointer;
}

/* ============================================================
   区块 2：Hero + 上传
   ============================================================ */
.hero {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(36px, 6vw, 68px) 20px 24px;
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 52px);
  align-items: center;
}
.hero-copy { min-width: 0; animation: riseIn .6s var(--ease) both; }
.hero-badge {
  display: inline-block; margin-bottom: 16px;
  padding: 7px 16px; border-radius: var(--r-pill);
  background: rgba(242, 166, 90, .16); color: #A2581F;
  border: 1px solid rgba(242, 166, 90, .45);
  font-size: 13px; font-weight: 600;
}
.hero h1 { margin-bottom: 14px; }
.hero h1::after {
  content: ""; display: block; width: 92px; height: 6px; margin-top: 16px;
  border-radius: 6px; background: var(--grad-warm);
}
.hero-sub { color: var(--c-muted); font-size: 17px; max-width: 46ch; }
.hero-points { margin-top: 22px; display: grid; gap: 10px; }
.hero-points li { position: relative; padding-left: 30px; font-size: 15px; color: var(--c-text); }
.hero-points li::before {
  content: ""; position: absolute; left: 0; top: 6px; width: 18px; height: 18px;
  border-radius: 50%; background: rgba(63, 140, 99, .18);
  border: 2px solid var(--c-primary-soft);
}

/* 上传卡片 */
.hero-panel { animation: riseIn .7s .08s var(--ease) both; }
.dropzone {
  position: relative; overflow: hidden;
  border-radius: var(--r-lg);
  border: 2.5px dashed rgba(63, 140, 99, .45);
  background: linear-gradient(160deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, .68));
  backdrop-filter: blur(10px);
  box-shadow: var(--sh-md);
  padding: clamp(24px, 4vw, 40px) 24px;
  text-align: center; cursor: pointer;
  transition: transform .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease);
}
.dropzone::before {
  content: ""; position: absolute; inset: -40%;
  background: radial-gradient(circle at 30% 20%, rgba(242, 166, 90, .16), transparent 60%),
              radial-gradient(circle at 70% 80%, rgba(127, 179, 213, .18), transparent 60%);
  pointer-events: none;
}
.dropzone:hover { border-color: var(--c-primary-soft); transform: translateY(-3px); box-shadow: var(--sh-lg); }
.dropzone.is-drag { border-color: var(--c-accent); background: rgba(242, 166, 90, .10); transform: scale(1.02); box-shadow: 0 0 0 6px rgba(242, 166, 90, .16), var(--sh-lg); }
.dropzone-inner { position: relative; z-index: 1; }
.dz-icon { display: inline-grid; place-items: center; animation: floaty 4.5s ease-in-out infinite; }
.dz-title { margin: 8px 0 6px; font-size: 21px; font-weight: 700; }
.dz-sub { color: var(--c-muted); font-size: 14px; margin-bottom: 16px; }
.dz-ways {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
  max-width: 380px; margin: 0 auto 18px;
}
.dz-ways li {
  font-size: 13px; color: var(--c-primary); background: rgba(63, 140, 99, .09);
  border-radius: var(--r-sm); padding: 7px 10px; min-width: 0;
}
.dz-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.dz-actions .btn { cursor: pointer; }
.dz-limit { margin-top: 14px; font-size: 12.5px; color: var(--c-muted); }

.dz-progress {
  position: absolute; inset: 0; z-index: 2;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  background: rgba(250, 246, 236, .88); backdrop-filter: blur(4px);
  font-size: 15px; font-weight: 600; color: var(--c-primary);
}
.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid rgba(63, 140, 99, .25); border-top-color: var(--c-primary-soft);
  animation: spin .8s linear infinite;
}

/* ============================================================
   区块 3/6：广告位
   ============================================================ */
.ad-slot { max-width: var(--maxw); margin: 28px auto; padding: 0 20px; }
.ad-note { font-size: 11.5px; color: #9AA79E; margin-bottom: 6px; letter-spacing: .2px; }
.ad-box {
  display: block; min-height: 90px; width: 100%;
  background: rgba(255, 255, 255, .55);
  border: 1px dashed rgba(47, 107, 79, .16);
  border-radius: var(--r-md);
}

/* ============================================================
   通用卡片 / 区块头
   ============================================================ */
.card {
  background: var(--glass); backdrop-filter: blur(12px) saturate(160%);
  border: 1px solid var(--glass-brd);
  border-radius: var(--r-lg); box-shadow: var(--sh-md);
  padding: clamp(20px, 3vw, 30px);
}
.card-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.section-head { max-width: var(--maxw); margin: 0 auto; padding: 0 20px 22px; text-align: center; }
.section-head h2 { margin-bottom: 8px; }
.section-head p { color: var(--c-muted); max-width: 62ch; margin: 0 auto; }

/* ============================================================
   区块 4：工作区
   ============================================================ */
.workspace { max-width: var(--maxw); margin: 46px auto 0; padding: 0 20px; }
.workspace-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }

.preview-card { display: grid; justify-items: center; }
.avatar-ring {
  width: clamp(160px, 22vw, 220px); aspect-ratio: 1 / 1; border-radius: 50%;
  padding: 8px; margin-bottom: 12px;
  background: conic-gradient(from 210deg, #3F8C63, #F2A65A, #7FB3D5, #3F8C63);
  box-shadow: 0 14px 34px rgba(30, 58, 47, .2);
  animation: breathe 6s ease-in-out infinite;
}
.avatar-img {
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
  background: #EDE6D3; border: 3px solid #fff;
}
.hint { font-size: 12.5px; color: var(--c-muted); margin-bottom: 16px; }

/* 对比滑杆 */
.compare { width: 100%; }
.compare-stage {
  position: relative; width: 100%; aspect-ratio: 1 / 1;
  border-radius: var(--r-md); overflow: hidden;
  background: #EDE6D3; box-shadow: inset 0 0 0 1px rgba(47, 107, 79, .12);
  touch-action: pan-y;
}
.compare-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare-overlay { clip-path: inset(0 0 0 50%); }
.compare-tag {
  position: absolute; bottom: 10px; z-index: 3;
  padding: 4px 10px; border-radius: var(--r-pill);
  background: rgba(30, 58, 47, .68); color: #fff; font-size: 11.5px; font-weight: 600;
  backdrop-filter: blur(6px);
}
.tag-left { left: 10px; }
.tag-right { right: 10px; }
.compare-range {
  position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%;
  margin: 0; opacity: 0; cursor: ew-resize;
}
.compare-range:focus-visible { outline: 3px solid var(--c-accent); outline-offset: -4px; opacity: .01; }

/* 预设 */
.panel-card { min-width: 0; }
.presets { display: grid; gap: 10px; margin-bottom: 22px; }
.preset {
  display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 12px 14px; min-height: 62px; cursor: pointer;
  border: 1.5px solid rgba(47, 107, 79, .14); border-radius: var(--r-md);
  background: rgba(255, 255, 255, .7); font-family: inherit; color: inherit;
  transition: transform .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.preset:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }
.preset.is-active { border-color: var(--c-primary-soft); box-shadow: 0 0 0 3px rgba(63, 140, 99, .16), var(--sh-md); }
.preset-swatch { width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }
.sw-meadow { background: linear-gradient(135deg, #8FD3A8, #3F8C63); }
.sw-town    { background: linear-gradient(135deg, #BFDAE6, #5B7F8C); }
.sw-sunset  { background: linear-gradient(135deg, #FFD79A, #E07A3F); }
.preset-text { display: flex; flex-direction: column; min-width: 0; }
.preset-text strong { font-size: 15px; }
.preset-text small { font-size: 12.5px; color: var(--c-muted); }

/* 滑块 */
.controls { display: grid; gap: 16px; margin-bottom: 22px; }
.control label {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 14px; font-weight: 600; margin-bottom: 8px; min-width: 0;
}
.control label b { color: var(--c-primary); font-size: 13px; font-variant-numeric: tabular-nums; }
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 34px; background: transparent; cursor: pointer; margin: 0;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 8px; border-radius: var(--r-pill);
  background: linear-gradient(90deg, rgba(63, 140, 99, .35), rgba(242, 166, 90, .45));
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 24px; height: 24px; margin-top: -8px; border-radius: 50%;
  background: #fff; border: 3px solid var(--c-primary-soft);
  box-shadow: 0 4px 12px rgba(30, 58, 47, .22);
  transition: transform .15s var(--ease);
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.12); }
input[type="range"]::-moz-range-track { height: 8px; border-radius: var(--r-pill); background: linear-gradient(90deg, rgba(63, 140, 99, .35), rgba(242, 166, 90, .45)); }
input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 3px solid var(--c-primary-soft); }

.panel-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============================================================
   区块 5：结果区
   ============================================================ */
.result { max-width: var(--maxw); margin: 46px auto 0; padding: 0 20px; }
.result-card { display: grid; justify-items: center; text-align: center; }
.result-frame {
  width: min(380px, 82%); aspect-ratio: 1 / 1; border-radius: var(--r-md);
  overflow: hidden; background: #EDE6D3; box-shadow: var(--sh-lg);
  border: 4px solid #fff; margin-bottom: 14px;
  animation: popIn .45s var(--ease) both;
}
.result-img { width: 100%; height: 100%; object-fit: cover; }
.result-file { font-size: 13px; color: var(--c-muted); font-family: ui-monospace, Menlo, Consolas, monospace; margin-bottom: 18px; word-break: break-all; }
.result-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* ============================================================
   区块 6：免费说明 + FAQ
   ============================================================ */
.free { max-width: var(--maxw); margin: 56px auto 0; padding: 0 20px; }
.perks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.perk {
  background: var(--glass); backdrop-filter: blur(10px);
  border: 1px solid var(--glass-brd); border-radius: var(--r-md);
  padding: 20px 18px; box-shadow: var(--sh-sm);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease);
}
.perk:hover { transform: translateY(-4px); box-shadow: var(--sh-md); }
.perk-icon { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: rgba(63, 140, 99, .12); margin-bottom: 12px; }
.perk h3 { font-size: 16px; margin-bottom: 6px; }
.perk p { font-size: 13.5px; color: var(--c-muted); }

.faq { margin-top: 30px; display: grid; gap: 10px; }
.faq details {
  background: var(--glass); backdrop-filter: blur(10px);
  border: 1px solid var(--glass-brd); border-radius: var(--r-md);
  box-shadow: var(--sh-sm); overflow: hidden;
}
.faq summary {
  list-style: none; cursor: pointer; padding: 16px 20px;
  font-size: 15.5px; font-weight: 600; position: relative; padding-right: 46px;
  transition: background .18s var(--ease);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { background: rgba(63, 140, 99, .07); }
.faq summary::after {
  content: ""; position: absolute; right: 20px; top: 22px;
  width: 9px; height: 9px; border-right: 2px solid var(--c-primary-soft); border-bottom: 2px solid var(--c-primary-soft);
  transform: rotate(45deg); transition: transform .25s var(--ease);
}
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq details p { padding: 0 20px 18px; font-size: 14.5px; color: var(--c-muted); animation: fadeDown .25s var(--ease) both; }

/* ============================================================
   隐私政策页
   ============================================================ */
.privacy-card { max-width: 820px; margin: 0 auto; }
.privacy-card h1 { margin-bottom: 6px; }
.privacy-updated { font-size: 13px; color: var(--c-muted); margin-bottom: 18px; }
.privacy-intro { margin-bottom: 26px; color: var(--c-text); font-weight: 500; }
.privacy-card h2 {
  font-size: 18px; font-weight: 600; margin: 26px 0 8px; padding-left: 12px;
  border-left: 4px solid var(--c-primary-soft);
}
.privacy-card p { max-width: 70ch; color: var(--c-muted); font-size: 15px; }
.privacy-contact { margin-top: 28px !important; }
.privacy-contact a {
  display: inline-block; padding: 10px 20px; border-radius: var(--r-pill);
  background: var(--grad-green); color: #fff; text-decoration: none; font-weight: 600;
  box-shadow: 0 8px 20px rgba(47, 107, 79, .26);
}

/* ============================================================
   区块 7：打赏
   ============================================================ */
.donate { max-width: var(--maxw); margin: 46px auto 0; padding: 0 20px; }
.donate-card {
  text-align: center; display: grid; justify-items: center;
  background:
    radial-gradient(circle at 15% 20%, rgba(242, 166, 90, .18), transparent 55%),
    radial-gradient(circle at 85% 80%, rgba(229, 83, 61, .12), transparent 55%),
    var(--glass);
}
.donate-heart {
  display: inline-grid; place-items: center; width: 60px; height: 60px; border-radius: 50%;
  background: rgba(229, 83, 61, .12); margin-bottom: 14px;
  animation: heartbeat 2.6s ease-in-out infinite;
}
.donate-card h2 { margin-bottom: 10px; }
.donate-card > p { color: var(--c-muted); max-width: 52ch; margin-bottom: 20px; }
.donate-note { font-size: 12.5px; color: var(--c-muted); margin-top: 14px; }

/* ============================================================
   区块 8：页脚
   ============================================================ */
.site-footer {
  margin-top: 66px; padding: 40px 20px 34px;
  background: linear-gradient(180deg, rgba(30, 58, 47, .96), var(--c-deep));
  color: rgba(255, 255, 255, .82);
}
.footer-inner { max-width: var(--maxw); margin: 0 auto; display: grid; gap: 20px; justify-items: center; text-align: center; }
.footer-brand strong { color: #fff; font-size: 17px; }
.footer-brand p { font-size: 12.5px; max-width: 68ch; margin-top: 8px; color: rgba(255, 255, 255, .62); }
.footer-links { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.footer-links a {
  padding: 8px 14px; border-radius: var(--r-pill); color: rgba(255, 255, 255, .85);
  text-decoration: none; font-size: 14px; transition: background .18s var(--ease);
}
.footer-links a:hover { background: rgba(255, 255, 255, .12); }
.lang-switch-footer { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .2); }
.lang-switch-footer .lang-pill { color: rgba(255, 255, 255, .72); }
.lang-switch-footer .lang-pill:hover { color: #fff; background: rgba(255, 255, 255, .14); }
.lang-switch-footer .lang-pill.is-active { background: rgba(255, 255, 255, .95); color: var(--c-primary); box-shadow: none; }
.footer-rights { font-size: 12.5px; color: rgba(255, 255, 255, .5); }

/* ============================================================
   Toast
   ============================================================ */
.toast-wrap {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 200; display: grid; gap: 10px; justify-items: center; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px; max-width: min(92vw, 460px);
  padding: 12px 18px; border-radius: var(--r-pill);
  background: rgba(30, 58, 47, .94); color: #fff; font-size: 14px; font-weight: 500;
  box-shadow: var(--sh-lg); backdrop-filter: blur(8px);
  animation: toastIn .28s var(--ease) both;
}
.toast.is-out { animation: toastOut .28s var(--ease) both; }
.toast.toast-error { background: rgba(229, 83, 61, .95); }
.toast.toast-success { background: rgba(47, 107, 79, .95); }

/* ============================================================
   动画
   ============================================================ */
@keyframes riseIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.02); } }
@keyframes heartbeat { 0%, 100% { transform: scale(1); } 12% { transform: scale(1.14); } 24% { transform: scale(1); } 36% { transform: scale(1.1); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px) scale(.98); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   响应式断点
   ============================================================ */
@media (max-width: 1024px) {
  .perks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: 1fr; }
  .hero-copy { text-align: center; }
  .hero-sub, .hero-points { margin-left: auto; margin-right: auto; }
  .hero h1::after { margin-left: auto; margin-right: auto; }
  .hero-points { justify-items: start; max-width: 380px; }
}

@media (max-width: 820px) {
  .workspace-grid { grid-template-columns: 1fr; }
  .nav-links { order: 3; width: 100%; justify-content: center; margin-left: 0; }
  .lang-switch { margin-left: auto; }
  .nav-inner { padding: 10px 16px; }
}

@media (max-width: 640px) {
  .lang-pill { display: none; }
  .lang-select { display: block; }
  .perks { grid-template-columns: 1fr; }
  .dz-ways { grid-template-columns: 1fr; }
  .result-frame { width: 88%; }
  .result-actions .btn, .panel-actions .btn { flex: 1 1 auto; }
  .toast-wrap { bottom: 16px; width: 100%; padding: 0 12px; }
  .ad-slot, .workspace, .result, .free, .donate { padding-left: 16px; padding-right: 16px; }
  .hero { padding-left: 16px; padding-right: 16px; }
}

@media (max-width: 380px) {
  .dz-actions .btn { width: 100%; }
  .compare-stage { aspect-ratio: 4 / 5; }
}
