/* ===== 秒创设计 AFDN — Anthropic/GPT Aesthetic ===== */
/* 奶油暖色调 · 大留白 · 柔阴影 · 丝滑动效 · 零外部依赖 */

:root {
  --cream: #FAF9F6;
  --white: #FFFFFF;
  --hover-bg: #F5F3F0;
  --text: #1A1A18;
  --text2: #6B6B65;
  --text3: #A0A09A;
  --border: #E8E6E1;
  --blue: #3B6CF6;
  --blue-hover: #2B5AE0;
  --blue-soft: #EEF1FE;
  --green: #16A34A;
  --green-soft: #DCFCE7;
  --red: #DC2626;
  --red-soft: #FEE2E2;
  --amber: #CA8A04;
  --amber-soft: #FEF9C3;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.03), 0 2px 8px rgba(0,0,0,.04);
  --shadow-md: 0 1px 3px rgba(0,0,0,.04), 0 6px 20px rgba(0,0,0,.07);
  --shadow-lg: 0 0 0 1px rgba(0,0,0,.04), 0 16px 48px rgba(0,0,0,.12);
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --ease: cubic-bezier(.16,1,.3,1);
}

* { box-sizing:border-box; margin:0; padding:0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--cream); color: var(--text);
  -webkit-font-smoothing: antialiased; line-height: 1.6;
}
::-webkit-scrollbar { width: 0; }

/* ===== NAV ===== */
.topnav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  height: 56px; display: flex; align-items: center; justify-content: center;
}
.topnav-inner {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; max-width: 1100px; padding: 0 20px;
}
.topnav-left { display: flex; align-items: center; gap: 12px; }

/* PillNav */
.pill-nav-bar {
  display: flex; align-items: center; gap: 3px;
  background: var(--text); border-radius: 40px; padding: 3px;
}
.pill-item {
  position: relative; overflow: hidden;
  padding: 7px 18px; border-radius: 40px; font-size: 13px; font-weight: 600;
  cursor: pointer; border: 0; background: var(--white); color: var(--text);
  font-family: inherit; transition: color .3s var(--ease);
  z-index: 1; line-height: 1;
}
.pill-item::before {
  content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%) scale(0);
  width: 200%; height: 200%; border-radius: 50%;
  background: var(--text); z-index: -1;
  transition: transform .4s var(--ease); transform-origin: center bottom;
}
.pill-item:hover { color: var(--white); }
.pill-item:hover::before { transform: translateX(-50%) scale(1); }
.pill-item.active { background: var(--text); color: var(--white); }
.pill-item.active::after {
  content: ''; position: absolute; bottom: -7px; left: 50%; transform: translateX(-50%);
  width: 10px; height: 10px; border-radius: 50%; background: var(--text);
}
.topnav-user { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text2); }
.topnav-user a { color: var(--text2); cursor: pointer; text-decoration: none; transition: color .2s; }
.topnav-user a:hover { color: var(--text); }

/* ===== PAGE ===== */
.page { display: none; animation: pageIn .4s var(--ease); padding-top: 144px; }
.page.show { display: block; }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* BlurText — blur fade-in per word */
.blur-text { display: flex; flex-wrap: wrap; justify-content: center; }
.blur-word {
  display: inline-block;
  filter: blur(10px); opacity: 0; transform: translateY(-20px);
  transition: filter .35s cubic-bezier(.4,0,.2,1), opacity .35s cubic-bezier(.4,0,.2,1), transform .35s cubic-bezier(.4,0,.2,1);
  will-change: filter, opacity, transform;
}
.blur-word.show { filter: blur(0); opacity: 1; transform: translateY(0); }

/* ===== ANIMATIONS ===== */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.anim-up { animation: fadeUp .5s var(--ease) both; }
.stagger > *:nth-child(1) { animation-delay: 0s; }
.stagger > *:nth-child(2) { animation-delay: .06s; }
.stagger > *:nth-child(3) { animation-delay: .12s; }
.stagger > *:nth-child(4) { animation-delay: .18s; }
.stagger > *:nth-child(5) { animation-delay: .24s; }
.stagger > *:nth-child(6) { animation-delay: .30s; }
@keyframes popIn { from { transform: scale(0); } to { transform: scale(1); } }
.anim-pop { animation: popIn .25s cubic-bezier(.34,1.56,.64,1); }
@keyframes pulse-dot { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
.pulse-dot { animation: pulse-dot 2s ease-in-out infinite; }
@keyframes modalIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.modal-anim { animation: modalIn .25s var(--ease); }

/* ===== HERO ===== */
.hero { max-width: 720px; margin: 0 auto; padding: 56px 20px 60px; text-align: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 18px; border-radius: 40px; background: var(--white);
  box-shadow: var(--shadow-sm); font-size: 12px; font-weight: 600; color: var(--text2);
}
.hero-title {
  margin-top: 24px; font-size: 54px; font-weight: 700; letter-spacing: -0.03em;
  line-height: 1.15; color: var(--text);
}
.hero-title span { color: var(--blue); }
.hero-sub { margin-top: 16px; font-size: 16px; line-height: 1.6; color: var(--text2); }

/* ===== CAT TABS ===== */
.cat-wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px 40px; }
.cat-tabs { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.cat-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: 40px; font-size: 13px; font-weight: 500;
  cursor: pointer; border: 0; background: var(--white); color: var(--text2);
  box-shadow: var(--shadow-sm); font-family: inherit;
  transition: all .2s var(--ease);
}
.cat-tab:hover { color: var(--text); box-shadow: var(--shadow-md); }
.cat-tab.active { background: var(--text); color: var(--white); box-shadow: none; }
.cat-tab svg { width: 16px; height: 16px; }
.cat-tab-count { font-size: 11px; opacity: .6; }

/* ===== TEMPLATE GRID ===== */
.template-wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px 60px; }

/* ===== MASONRY ===== */
.masonry-section { max-width: 1100px; margin: 0 auto; padding: 0 20px 120px; }
.masonry-title { font-size: 18px; font-weight: 700; text-align: center; color: var(--text); margin-bottom: 8px; }
.masonry-sub { font-size: 13px; color: var(--text2); text-align: center; margin-bottom: 32px; }
.masonry-wrap { position: relative; }
.masonry-wrap.truncated { max-height: 600px; overflow: hidden; }
.masonry-wrap.truncated::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 200px;
  background: linear-gradient(transparent, var(--cream));
  pointer-events: none;
}
.masonry-grid { column-count: 4; column-gap: 12px; }
.masonry-item {
  break-inside: avoid; margin-bottom: 12px; border-radius: var(--radius);
  overflow: hidden; cursor: pointer; position: relative;
  box-shadow: var(--shadow-sm); transition: transform .3s var(--ease), box-shadow .3s var(--ease);
  opacity: 0; transform: translateY(60px); filter: blur(8px);
  will-change: transform, opacity, filter;
}
.masonry-item.show { opacity: 1; transform: translateY(0); filter: blur(0); }
.masonry-item:hover { transform: scale(.96); box-shadow: var(--shadow-md); }
.masonry-item img { width: 100%; display: block; }
.masonry-item-overlay {
  position: absolute; inset: 0; background: linear-gradient(transparent 50%, rgba(0,0,0,.5));
  opacity: 0; transition: opacity .3s var(--ease);
  display: flex; align-items: flex-end; padding: 16px;
}
.masonry-item:hover .masonry-item-overlay { opacity: 1; }
.masonry-item-label { color: #fff; font-size: 12px; font-weight: 600; }
.masonry-toggle {
  display: flex; justify-content: center; margin-top: 24px;
}
.masonry-toggle .btn { padding: 10px 28px; }
.magnet-wrap { display: inline-block; }
.magnet-inner { will-change: transform; }

@media (max-width: 900px) { .masonry-grid { column-count: 3; } }
@media (max-width: 640px) { .masonry-grid { column-count: 2; column-gap: 8px; } .masonry-item { margin-bottom: 8px; } .masonry-wrap.truncated { max-height: 500px; } }
.template-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.template-card {
  background: var(--white); border-radius: var(--radius); padding: 20px 16px;
  cursor: pointer; text-align: center; width: 220px;
  box-shadow: var(--shadow-sm); transition: all .3s var(--ease);
}
.template-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.template-card:active { transform: scale(.98); }
.template-card-icon { display: flex; justify-content: center; margin-bottom: 10px; color: var(--text2); }
.template-card-icon svg { width: 24px; height: 24px; }
.template-card-name { font-size: 13px; font-weight: 600; color: var(--text); }
.template-card-ratio { font-size: 11px; color: var(--text3); margin-top: 4px; }

/* ===== CREATE WIZARD ===== */
.create-wrap { max-width: 700px; margin: 0 auto; padding: 36px 20px 120px; }
.steps {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  margin-bottom: 32px;
}
.step {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 40px; font-size: 13px; font-weight: 500;
  color: var(--text3); transition: all .3s var(--ease);
}
.step-num {
  display: flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%; font-size: 11px; font-weight: 700;
  background: var(--hover-bg); transition: all .3s var(--ease);
}
.step.active { color: var(--text); background: var(--white); box-shadow: var(--shadow-sm); }
.step.active .step-num { background: var(--text); color: var(--white); }
.step.done { color: var(--green); }
.step.done .step-num { background: var(--green-soft); color: var(--green); }
.step-arrow { width: 16px; height: 16px; color: var(--border); }

/* ===== CARDS ===== */
.card {
  background: var(--white); border-radius: var(--radius); padding: 20px;
  margin-bottom: 16px; box-shadow: var(--shadow-sm);
}
.card-title { font-size: 15px; font-weight: 600; color: var(--text); }
.card-sub { font-size: 13px; color: var(--text2); margin-top: 4px; }

/* ===== FORM INPUTS ===== */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--text2); margin-bottom: 6px; }
.form-input, .form-textarea {
  width: 100%; padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--hover-bg); border: 0; font-size: 14px; outline: none;
  font-family: inherit; color: var(--text);
  transition: all .2s var(--ease);
}
.form-input:focus, .form-textarea:focus { background: var(--white); box-shadow: 0 0 0 2px rgba(59,108,246,.15); }
.form-textarea { min-height: 90px; resize: vertical; line-height: 1.6; }
.form-input::placeholder, .form-textarea::placeholder { color: var(--text3); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 22px; border-radius: 40px; font-size: 14px; font-weight: 600;
  cursor: pointer; border: 0; font-family: inherit;
  transition: all .2s var(--ease);
}
.btn:active { transform: scale(.98); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--text); color: #fff; }
.btn-primary:hover { background: #333; }
.btn-secondary {
  background: var(--white); color: var(--text2);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover { background: var(--hover-bg); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text2); }
.btn-ghost:hover { background: var(--hover-bg); color: var(--text); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }

/* ===== COPYWRITER OPTIONS ===== */
.copy-options { display: flex; flex-direction: column; gap: 12px; }
.copy-option {
  background: var(--white); border-radius: var(--radius); padding: 18px;
  cursor: pointer; box-shadow: var(--shadow-sm);
  transition: all .2s var(--ease); position: relative;
}
.copy-option:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.copy-option.selected { box-shadow: 0 0 0 2px var(--blue), 0 4px 16px rgba(59,108,246,.15); }
.copy-option-check {
  position: absolute; top: 14px; right: 14px;
  width: 20px; height: 20px; border-radius: 50%; background: var(--blue);
  display: flex; align-items: center; justify-content: center;
}
.copy-option-check svg { width: 11px; height: 11px; }
.copy-opt-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.copy-opt-sub { font-size: 13px; color: var(--text2); margin-bottom: 6px; }
.copy-opt-cta { font-size: 13px; font-weight: 600; color: var(--blue); margin-bottom: 6px; display: flex; align-items: center; gap: 4px; }
.copy-opt-body { font-size: 13px; color: var(--text2); line-height: 1.7; white-space: pre-wrap; margin-top: 8px; }
.copy-opt-cta svg { width: 16px; height: 16px; }

/* ===== POSTER RESULT ===== */
.poster-result { text-align: center; }
.poster-result img {
  max-width: 100%; max-height: 60vh; border-radius: var(--radius); box-shadow: var(--shadow-lg); margin: 0 auto;
}
.poster-actions { display: flex; gap: 12px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.poster-cost { font-size: 12px; color: var(--text3); margin-top: 12px; }

/* ===== HISTORY ===== */
.history-wrap { max-width: 720px; margin: 0 auto; padding: 36px 20px 120px; }
.history-title { font-size: 20px; font-weight: 700; margin-bottom: 24px; color: var(--text); }
.history-list { display: flex; flex-direction: column; gap: 12px; }
.history-item {
  display: flex; gap: 16px; padding: 16px; background: var(--white);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  align-items: center; transition: all .2s var(--ease);
}
.history-item:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.history-thumb {
  width: 80px; height: 107px; border-radius: var(--radius-sm); overflow: hidden;
  background: var(--hover-bg); flex-shrink: 0;
}
.history-thumb img { width: 100%; height: 100%; object-fit: cover; }
.history-info { flex: 1; min-width: 0; }
.history-name { font-size: 14px; font-weight: 600; color: var(--text); }
.history-date { font-size: 12px; color: var(--text3); margin-top: 2px; }
.history-badge {
  display: inline-block; margin-top: 4px; padding: 2px 10px; border-radius: 40px;
  font-size: 11px; font-weight: 600;
}
.badge-done { background: var(--green-soft); color: var(--green); }
.badge-failed { background: var(--red-soft); color: var(--red); }
.badge-pending { background: var(--amber-soft); color: var(--amber); }
.history-dl {
  height: 34px; padding: 0 16px; border-radius: 40px; background: var(--white);
  box-shadow: var(--shadow-sm); border: 0; font-size: 12px; font-weight: 500;
  color: var(--text2); cursor: pointer; font-family: inherit;
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
  transition: all .2s var(--ease);
}
.history-dl:hover { background: var(--hover-bg); color: var(--text); }
.history-dl svg { width: 14px; height: 14px; }

/* ===== PRICING ===== */
.pricing-wrap { max-width: 700px; margin: 0 auto; padding: 36px 20px 120px; }
.pricing-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; color: var(--text); }
.pricing-sub { font-size: 14px; color: var(--text2); margin-bottom: 24px; }
.pricing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pricing-card {
  background: var(--white); border-radius: var(--radius-lg); padding: 24px;
  box-shadow: var(--shadow-sm); text-align: center;
  transition: all .2s var(--ease); position: relative;
}
.pricing-card.featured { box-shadow: 0 0 0 2px var(--blue), 0 4px 16px rgba(59,108,246,.12); }
.pricing-badge {
  position: absolute; top: -10px; right: 16px;
  padding: 2px 12px; border-radius: 40px; background: var(--blue);
  color: #fff; font-size: 11px; font-weight: 700;
}
.pricing-name { font-size: 16px; font-weight: 700; color: var(--text); }
.pricing-price { margin: 12px 0 16px; font-size: 32px; font-weight: 800; color: var(--text); }
.pricing-unit { font-size: 13px; color: var(--text3); font-weight: 400; }
.pricing-features { list-style: none; text-align: left; margin-bottom: 20px; }
.pricing-features li {
  padding: 4px 0; font-size: 13px; color: var(--text2);
  display: flex; align-items: center; gap: 8px;
}
.pricing-features li svg { width: 14px; height: 14px; color: var(--green); flex-shrink: 0; }
.pricing-btn-current {
  display: flex; align-items: center; justify-content: center;
  height: 40px; border-radius: 40px; font-size: 13px; font-weight: 500;
  background: var(--hover-bg); color: var(--text2); width: 100%;
}

/* ===== SETTINGS ===== */
.settings-wrap { max-width: 700px; margin: 0 auto; padding: 36px 20px 120px; }
.settings-title { font-size: 20px; font-weight: 700; margin-bottom: 24px; color: var(--text); }
.settings-card { background: var(--white); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.settings-card h3 { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.key-status-ok { font-size: 13px; font-weight: 600; color: var(--green); }
.key-status-no { font-size: 13px; font-weight: 600; color: var(--red); }
.key-actions { display: flex; gap: 8px; margin-top: 12px; }
.usage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.usage-stat {
  background: var(--hover-bg); border-radius: var(--radius); padding: 16px; text-align: center;
}
.usage-num { font-size: 24px; font-weight: 800; color: var(--blue); }
.usage-label { font-size: 12px; color: var(--text2); margin-top: 2px; }
.howto-list { padding-left: 20px; }
.howto-list li { padding: 4px 0; font-size: 13px; color: var(--text2); }
.howto-list a { color: var(--blue); font-weight: 500; text-decoration: none; }
.howto-list a:hover { text-decoration: underline; }

/* ===== MODAL ===== */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,.2); backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal-box {
  background: var(--white); border-radius: var(--radius-lg); padding: 32px;
  width: 90%; max-width: 380px; box-shadow: var(--shadow-lg);
}
.modal-title { font-size: 18px; font-weight: 600; margin-bottom: 20px; color: var(--text); }
.modal-input { margin-bottom: 12px; }
.modal-input label { display: block; font-size: 13px; font-weight: 500; color: var(--text2); margin-bottom: 6px; }
.modal-input input {
  width: 100%; padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--hover-bg); border: 0; font-size: 14px; outline: none;
  font-family: inherit; color: var(--text);
  transition: all .2s var(--ease);
}
.modal-input input:focus { background: var(--white); box-shadow: 0 0 0 2px rgba(59,108,246,.15); }
.modal-footer { text-align: center; margin-top: 16px; font-size: 13px; color: var(--text2); }
.modal-footer span { color: var(--blue); font-weight: 600; cursor: pointer; }
.modal-footer span:hover { text-decoration: underline; }

/* ===== TOAST ===== */
#toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 300;
  padding: 10px 22px; border-radius: 40px; font-size: 13px; font-weight: 500;
  background: var(--text); color: #fff; box-shadow: var(--shadow-md);
  opacity: 0; pointer-events: none; transition: all .3s var(--ease);
}
#toast.show { opacity: 1; }
#toast.toast-success { background: var(--green); }
#toast.toast-error { background: var(--red); }

/* ===== EMPTY / LOADING ===== */
.empty { text-align: center; padding: 60px 20px; }
.empty-icon { display: flex; justify-content: center; margin-bottom: 12px; color: var(--text3); }
.empty-icon svg { width: 48px; height: 48px; }
.empty-title { font-size: 14px; font-weight: 500; color: var(--text2); }
.empty-sub { font-size: 12px; color: var(--text3); margin-top: 4px; }
.loading { text-align: center; padding: 48px 0; }
.spinner {
  display: inline-block; width: 24px; height: 24px;
  border: 2px solid var(--border); border-top-color: var(--blue);
  border-radius: 50%; animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { margin-top: 12px; font-size: 13px; color: var(--text2); }

/* ===== RESPONSIVE ===== */
@media (max-width: 720px) {
  .hero-title { font-size: 40px; }
  .hero-sub { font-size: 14px; }
  .pill-nav-bar { display: none; }
  .topnav-inner { padding: 0 14px; }
  .pricing-grid { grid-template-columns: 1fr; }
  .template-card { width: 150px; }
  .steps { flex-direction: column; gap: 6px; }
  .step-arrow { display: none; }
  .poster-actions { flex-direction: column; }
  .history-item { flex-direction: column; align-items: flex-start; }
  .usage-grid { grid-template-columns: 1fr; }
}

/* ===== HERO LOGO + CIRCULAR TEXT ===== */
.hero-logo-wrap { display: flex; align-items: center; justify-content: center; gap: 28px; margin-bottom: 24px; }
.circular-text {
  width: 90px; height: 90px; border-radius: 50%; position: relative; flex-shrink: 0;
  animation: circ-spin 14s linear infinite; cursor: default;
}
.circular-text:hover { animation-duration: 3s; }
.circular-text span {
  position: absolute; left: 50%; top: 50%; font-size: 11px; font-weight: 700;
  color: var(--text2); letter-spacing: 0.05em;
}
.circular-text:hover span { color: var(--blue); }
@keyframes circ-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
