/* ============================================
   BUPT 数学文化节 头像框生成器 · 全局样式
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;600;700&family=Noto+Sans+SC:wght@300;400;500&family=Playfair+Display:ital,wght@0,700;1,400&display=swap');

/* ── 变量 ── */
:root {
  --blue-900: #0a1340;
  --blue-800: #0d1b5a;
  --blue-700: #112380;
  --blue-600: #1a3aaa;
  --blue-500: #1a56db;
  --blue-400: #3b82f6;
  --blue-300: #60a5fa;
  --blue-200: #93c5fd;
  --blue-100: #dbeafe;
  --blue-50:  #eff6ff;

  --gold:     #f0b429;
  --white:    #ffffff;
  --gray-50:  #f8faff;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-500: #64748b;
  --gray-700: #334155;
  --gray-900: #0f172a;

  --shadow-xs: 0 1px 3px rgba(13,27,90,0.08);
  --shadow-sm: 0 2px 8px rgba(13,27,90,0.10);
  --shadow-md: 0 6px 24px rgba(13,27,90,0.14);
  --shadow-lg: 0 12px 48px rgba(13,27,90,0.20);
  --shadow-xl: 0 24px 80px rgba(13,27,90,0.28);

  --radius-sm: 8px;
  --radius:    14px;
  --radius-lg: 22px;
  --radius-xl: 32px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Noto Sans SC', sans-serif;
  color: var(--gray-900);
  background: var(--white);
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
img { display: block; max-width: 100%; }

/* ── 滚动条 ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--blue-200); border-radius: 99px; }

/* ============================================
   NAV 导航栏
   ============================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  height: 68px;
  transition: all 0.4s var(--ease);
}

.nav.scrolled {
  background: rgba(10, 19, 64, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Noto Serif SC', serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--white);
  letter-spacing: 0.02em;
}

.nav-logo-icon {
  width: 48px;
  height: 48px;
  background: transparent;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
}

.nav-links a {
  font-size: 13px;
  font-weight: 400;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.04em;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--white); }

.nav-btn {
  padding: 8px 22px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 99px;
  font-size: 13px;
  color: var(--white);
  font-family: 'Noto Sans SC', sans-serif;
  transition: all 0.2s var(--ease);
}
.nav-btn:hover {
  background: rgba(255,255,255,0.22);
  transform: translateY(-1px);
}

/* ── 编辑器页导航 ── */
.nav-editor {
  background: rgba(248,250,255,0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow-xs);
}

.nav-back {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--blue-500);
  font-weight: 500;
  transition: all 0.2s var(--ease);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
}
.nav-back:hover {
  background: var(--blue-50);
  transform: translateX(-2px);
}
.nav-back svg { flex-shrink: 0; }

.nav-editor .nav-logo { color: var(--gray-900); }

.nav-editor .nav-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-700);
  letter-spacing: 0.04em;
}

/* ============================================
   首页 - HERO
   ============================================ */
.hero {
  position: relative;
  min-height: 100vh;
  background: linear-gradient(160deg, #070d2e 0%, #0d1b5a 45%, #1a2870 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#particles-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 60px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 60px;
  flex: 1;
  padding-top: 68px;
}

.hero-left {
  flex: 1;
  max-width: 520px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(59,130,246,0.15);
  border: 1px solid rgba(96,165,250,0.3);
  border-radius: 99px;
  margin-bottom: 28px;
}

.hero-badge-dot {
  width: 6px;
  height: 6px;
  background: var(--blue-300);
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.7); }
}

.hero-badge span {
  font-size: 12px;
  color: var(--blue-200);
  letter-spacing: 0.08em;
  font-weight: 400;
}

.hero-title {
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(38px, 5vw, 58px);
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.hero-title-sub {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: clamp(20px, 2.5vw, 30px);
  color: var(--blue-200);
  margin-bottom: 24px;
  font-weight: 400;
  display: block;
}

.hero-desc {
  font-size: 15px;
  color: rgba(255,255,255,0.6);
  line-height: 1.9;
  margin-bottom: 44px;
  font-weight: 300;
  max-width: 420px;
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 36px;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-400));
  color: var(--white);
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 15px;
  font-weight: 500;
  border-radius: 99px;
  letter-spacing: 0.04em;
  box-shadow: 0 8px 32px rgba(26,86,219,0.5), 0 2px 8px rgba(26,86,219,0.3);
  transition: all 0.3s var(--ease-spring);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 48px rgba(26,86,219,0.6), 0 4px 14px rgba(26,86,219,0.4);
}
.btn-primary:hover::before { opacity: 1; }
.btn-primary:active { transform: translateY(0) scale(0.99); }

.btn-primary svg { flex-shrink: 0; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  border-radius: 99px;
  transition: all 0.2s var(--ease);
  border: 1px solid rgba(255,255,255,0.12);
}
.btn-ghost:hover {
  color: var(--white);
  border-color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.05);
}

.hero-stats {
  display: flex;
  gap: 36px;
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.stat-item {}
.stat-num {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--white);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Hero Right: Frame Showcase ── */
.hero-right {
  flex: 1;
  max-width: 480px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.frame-showcase {
  position: relative;
  width: 360px;
  height: 400px;
}

.showcase-card {
  position: absolute;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  transition: all 0.6s var(--ease);
}

.showcase-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.showcase-card:nth-child(1) {
  width: 220px; height: 220px;
  top: 0; left: 0;
  z-index: 4;
  animation: float-card1 6s ease-in-out infinite;
}
.showcase-card:nth-child(2) {
  width: 180px; height: 180px;
  top: 20px; right: 10px;
  z-index: 3;
  animation: float-card2 7s ease-in-out infinite;
}
.showcase-card:nth-child(3) {
  width: 160px; height: 160px;
  bottom: 40px; left: 30px;
  z-index: 2;
  animation: float-card3 8s ease-in-out infinite;
}
.showcase-card:nth-child(4) {
  width: 200px; height: 200px;
  bottom: 0; right: 0;
  z-index: 3;
  animation: float-card4 5.5s ease-in-out infinite;
}

@keyframes float-card1 {
  0%, 100% { transform: translateY(0px) rotate(-3deg); }
  50% { transform: translateY(-14px) rotate(-1deg); }
}
@keyframes float-card2 {
  0%, 100% { transform: translateY(0px) rotate(4deg); }
  50% { transform: translateY(-10px) rotate(6deg); }
}
@keyframes float-card3 {
  0%, 100% { transform: translateY(0px) rotate(2deg); }
  50% { transform: translateY(-12px) rotate(0deg); }
}
@keyframes float-card4 {
  0%, 100% { transform: translateY(0px) rotate(-2deg); }
  50% { transform: translateY(-16px) rotate(-4deg); }
}

/* ── Hero Bottom Scroll Hint ── */
.scroll-hint {
  position: relative;
  z-index: 2;
  text-align: center;
  padding-bottom: 36px;
  animation: bounce-hint 2s infinite;
}
.scroll-hint span {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 8px;
}
.scroll-hint svg { margin: 0 auto; color: rgba(255,255,255,0.25); }

@keyframes bounce-hint {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50% { transform: translateY(6px); opacity: 1; }
}

/* ============================================
   首页 - FRAMES SECTION
   ============================================ */
.frames-section {
  padding: 100px 0 80px;
  background: var(--gray-50);
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
  padding: 0 20px;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 16px;
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  border-radius: 99px;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--blue-500);
  letter-spacing: 0.08em;
  font-weight: 500;
}

.section-title {
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.3;
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}

.section-desc {
  font-size: 15px;
  color: var(--gray-500);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.8;
}

.frames-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 40px;
}

.frame-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  transition: all 0.4s var(--ease-spring);
  cursor: pointer;
}

.frame-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-lg);
}

.frame-card-img {
  aspect-ratio: 1;
  overflow: hidden;
  position: relative;
}

.frame-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}
.frame-card:hover .frame-card-img img { transform: scale(1.06); }

.frame-card-info {
  padding: 14px 16px 16px;
}

.frame-card-name {
  font-family: 'Noto Serif SC', serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.frame-card-desc {
  font-size: 12px;
  color: var(--gray-500);
  line-height: 1.5;
}

/* ============================================
   首页 - HOW IT WORKS
   ============================================ */
.steps-section {
  padding: 80px 0 100px;
  background: var(--white);
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 40px;
  position: relative;
}

.steps-grid::before {
  content: '';
  position: absolute;
  top: 44px;
  left: calc(16% + 44px);
  right: calc(16% + 44px);
  height: 1px;
  background: linear-gradient(90deg, var(--blue-200), var(--blue-100), var(--blue-200));
}

.step-item {
  text-align: center;
  padding: 0 20px;
  position: relative;
}

.step-icon {
  width: 88px;
  height: 88px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, var(--blue-50), var(--blue-100));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.3s var(--ease-spring);
}

.step-item:hover .step-icon {
  background: linear-gradient(135deg, var(--blue-500), var(--blue-400));
  transform: scale(1.08);
  box-shadow: 0 8px 24px rgba(26,86,219,0.3);
}

.step-item:hover .step-icon svg { color: var(--white) !important; }

.step-num {
  position: absolute;
  top: -8px; right: -8px;
  width: 22px; height: 22px;
  background: var(--blue-500);
  border-radius: 50%;
  font-size: 11px;
  color: var(--white);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 8px;
}

.step-desc {
  font-size: 13px;
  color: var(--gray-500);
  line-height: 1.8;
}

/* ============================================
   首页 - FOOTER
   ============================================ */
.footer {
  background: var(--blue-900);
  padding: 40px 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-brand {
  font-family: 'Noto Serif SC', serif;
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  line-height: 1.8;
}

.footer-brand strong {
  color: rgba(255,255,255,0.8);
  font-weight: 600;
}

.footer-math {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 22px;
  color: var(--blue-300);
  opacity: 0.8;
  letter-spacing: 0.05em;
}

/* ============================================
   编辑器页
   ============================================ */
.editor-page {
  min-height: 100vh;
  background: var(--gray-50);
  padding-top: 68px;
}

.editor-main {
  display: grid;
  grid-template-columns: 260px 1fr 280px;
  gap: 0;
  min-height: calc(100vh - 68px);
  max-width: 1300px;
  margin: 0 auto;
}

/* ── 左侧框选择 ── */
.editor-sidebar-left {
  background: var(--white);
  border-right: 1px solid var(--gray-200);
  padding: 32px 20px;
  overflow-y: auto;
}

.sidebar-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--blue-500);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.sidebar-heading-num {
  width: 20px; height: 20px;
  background: var(--blue-500);
  border-radius: 50%;
  font-size: 11px;
  color: var(--white);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.frame-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.frame-option {
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.25s var(--ease);
  background: var(--white);
  box-shadow: var(--shadow-xs);
}

.frame-option:hover {
  border-color: var(--blue-200);
  box-shadow: var(--shadow-sm);
  transform: translateX(3px);
}

.frame-option.selected {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 4px rgba(26,86,219,0.12);
}

.frame-option-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
}

.frame-option-thumb {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.frame-option-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.frame-option-info {}
.frame-option-name {
  font-family: 'Noto Serif SC', serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 3px;
}
.frame-option-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 500;
}

.tag-blue  { background: #eff6ff; color: #2563eb; }
.tag-purple{ background: #f5f3ff; color: #7c3aed; }
.tag-gold  { background: #fffbeb; color: #d97706; }
.tag-pink  { background: #fff0f6; color: #db2777; }

.frame-option.selected .frame-option-name { color: var(--blue-500); }

.selected-check {
  width: 18px; height: 18px;
  background: var(--blue-500);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  flex-shrink: 0;
}
.frame-option.selected .selected-check { display: flex; }

/* ── 中间画布 ── */
.editor-canvas-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  gap: 20px;
  position: relative;
}

.canvas-container {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  cursor: move;
  transition: box-shadow 0.3s;
}
.canvas-container:hover { box-shadow: 0 20px 60px rgba(13,27,90,0.25); }
.canvas-container.dragging { cursor: grabbing; }

#main-canvas {
  display: block;
  width: 440px;
  height: 440px;
  background: #1a1a2e;
}

.canvas-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  pointer-events: none;
  transition: opacity 0.3s;
}

.canvas-placeholder.hidden { opacity: 0; }

.placeholder-icon {
  width: 72px; height: 72px;
  border-radius: var(--radius);
  background: rgba(59,130,246,0.12);
  border: 1.5px dashed rgba(96,165,250,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue-300);
}

.placeholder-text {
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  text-align: center;
  line-height: 1.7;
}

.canvas-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--gray-500);
}

.canvas-hint-dot {
  width: 4px; height: 4px;
  background: var(--gray-300);
  border-radius: 50%;
}

/* ── 右侧控制 ── */
.editor-sidebar-right {
  background: var(--white);
  border-left: 1px solid var(--gray-200);
  padding: 32px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.control-block {}

.control-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--blue-500);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.control-heading-num {
  width: 20px; height: 20px;
  background: var(--blue-500);
  border-radius: 50%;
  font-size: 11px;
  color: var(--white);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* 上传区 */
.upload-zone {
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  position: relative;
  overflow: hidden;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--blue-400);
  background: var(--blue-50);
}

.upload-zone-icon {
  width: 52px; height: 52px;
  margin: 0 auto 12px;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  transition: all 0.25s var(--ease);
}

.upload-zone:hover .upload-zone-icon {
  background: var(--blue-100);
  color: var(--blue-500);
}

.upload-zone-text {
  font-size: 13px;
  color: var(--gray-700);
  font-weight: 500;
  margin-bottom: 4px;
}

.upload-zone-hint {
  font-size: 11px;
  color: var(--gray-500);
}

#avatar-input { display: none; }

.upload-preview {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--blue-50);
  border-radius: var(--radius-sm);
  border: 1px solid var(--blue-100);
}

.upload-preview.visible { display: flex; }

.upload-preview-img {
  width: 40px; height: 40px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.upload-preview-info {
  flex: 1;
  min-width: 0;
}

.upload-preview-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-700);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-preview-change {
  font-size: 11px;
  color: var(--blue-500);
  cursor: pointer;
  flex-shrink: 0;
}
.upload-preview-change:hover { text-decoration: underline; }

/* 滑块 */
.slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.slider-label {
  font-size: 12px;
  color: var(--gray-500);
  width: 28px;
  flex-shrink: 0;
}

.slider-value {
  font-size: 12px;
  color: var(--gray-700);
  font-weight: 500;
  width: 38px;
  text-align: right;
  flex-shrink: 0;
}

input[type="range"] {
  -webkit-appearance: none;
  flex: 1;
  height: 4px;
  border-radius: 99px;
  background: var(--gray-200);
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  background: var(--blue-500);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(26,86,219,0.4);
  transition: transform 0.15s;
}

input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }

.reset-btn {
  font-size: 11px;
  color: var(--blue-400);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  margin-top: 2px;
  display: inline-block;
}
.reset-btn:hover {
  background: var(--blue-50);
  color: var(--blue-600);
}

/* 下载按钮 */
.btn-download {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-400));
  color: var(--white);
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 15px;
  font-weight: 500;
  border-radius: var(--radius);
  letter-spacing: 0.04em;
  box-shadow: 0 6px 20px rgba(26,86,219,0.35);
  transition: all 0.3s var(--ease-spring);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.btn-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(26,86,219,0.45);
}
.btn-download:active { transform: translateY(0); }

.btn-download:disabled {
  background: var(--gray-200);
  color: var(--gray-400);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.btn-download-hint {
  font-size: 11px;
  color: var(--gray-500);
  text-align: center;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.divider {
  height: 1px;
  background: var(--gray-100);
}

/* ============================================
   成功弹窗
   ============================================ */
.success-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 19, 64, 0.6);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}

.success-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.success-modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 48px 52px;
  text-align: center;
  max-width: 420px;
  width: calc(100vw - 48px);
  box-shadow: var(--shadow-xl);
  transform: scale(0.9) translateY(16px);
  transition: transform 0.4s var(--ease-spring);
}

.success-overlay.visible .success-modal {
  transform: scale(1) translateY(0);
}

.success-icon {
  width: 80px; height: 80px;
  margin: 0 auto 24px;
  background: linear-gradient(135deg, #10b981, #34d399);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(16,185,129,0.35);
}

.success-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 10px;
}

.success-desc {
  font-size: 14px;
  color: var(--gray-500);
  line-height: 1.8;
  margin-bottom: 28px;
}

.success-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-success-primary {
  padding: 12px;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-400));
  color: var(--white);
  border-radius: var(--radius-sm);
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s var(--ease);
  letter-spacing: 0.04em;
}
.btn-success-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-success-ghost {
  padding: 12px;
  color: var(--gray-500);
  border-radius: var(--radius-sm);
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 14px;
  transition: all 0.2s var(--ease);
  border: 1px solid var(--gray-200);
}
.btn-success-ghost:hover {
  background: var(--gray-50);
  color: var(--gray-700);
}

/* ============================================
   Toast 通知
   ============================================ */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--gray-900);
  color: var(--white);
  padding: 12px 24px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 400;
  box-shadow: var(--shadow-lg);
  z-index: 300;
  transition: transform 0.4s var(--ease-spring), opacity 0.3s;
  opacity: 0;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.success { background: #065f46; }
.toast.warning { background: #92400e; }
.toast.error   { background: #991b1b; }

/* ============================================
   进场动画
   ============================================ */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  animation: fadeUp 0.7s var(--ease) forwards;
}

.fade-up-1 { animation-delay: 0.1s; }
.fade-up-2 { animation-delay: 0.25s; }
.fade-up-3 { animation-delay: 0.4s; }
.fade-up-4 { animation-delay: 0.55s; }
.fade-up-5 { animation-delay: 0.7s; }

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   响应式
   ============================================ */
/* ============================================
   响应式 - 平板
   ============================================ */
@media (max-width: 1100px) {
  .frames-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .editor-main {
    grid-template-columns: 220px 1fr 260px;
  }
}

/* ============================================
   响应式 - 手机端完整适配
   ============================================ */
@media (max-width: 900px) {

  /* ── 首页Hero ── */
  .hero-content {
    flex-direction: column;
    padding: 0 20px;
    text-align: center;
    padding-top: 80px;
  }
  .hero-desc { margin: 0 auto 36px; }
  .hero-cta  { justify-content: center; }
  .hero-stats{ justify-content: center; gap: 24px; }
  .hero-right{ display: none; }

  /* ── 首页导航 ── */
  .nav { padding: 0 16px; height: 56px; }
  .nav-links { display: none; }
  .nav-logo span { font-size: 13px; }
  .nav-btn {
    padding: 6px 14px;
    font-size: 12px;
  }

  /* ── 编辑器导航栏：手机端完全重排 ── */
  .nav.nav-editor {
    height: auto;
    padding: 10px 14px;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0;
  }

  /* 返回按钮：只显示箭头，不显示文字 */
  .nav-back {
    font-size: 0;
    padding: 6px 8px;
    flex-shrink: 0;
  }
  .nav-back svg {
    width: 20px;
    height: 20px;
  }

  /* 中间标题：缩小 */
  .nav-editor .nav-logo {
    flex: 1;
    justify-content: center;
    gap: 6px;
  }
  .nav-logo-icon {
    width: 28px;
    height: 28px;
  }
  .nav-logo-icon img {
    width: 24px !important;
    height: 24px !important;
  }
  .nav-editor .nav-title {
    font-size: 12px;
    white-space: nowrap;
  }

  /* 进度指示：只显示数字圆圈，隐藏文字 */
  #editor-progress {
    gap: 4px;
    flex-shrink: 0;
  }
  #editor-progress .progress-step span {
    width: 20px;
    height: 20px;
    font-size: 10px;
  }
  /* 隐藏进度文字，只保留数字 */
  #prog-1,#prog-2,#prog-3 {
    font-size: 0 !important;
  }
  #prog-1 span,#prog-2 span,#prog-3 span {
    font-size: 10px !important;
  }
  /* 隐藏进度间的横线 */
  #editor-progress svg {
    width: 8px;
  }

  /* ── 编辑器主体：手机改为纵向堆叠 ── */
  .editor-main {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }

  /* 左侧选框区：移到顶部，横向滚动 */
  .editor-sidebar-left {
    order: 1;
    padding: 14px;
    border-right: none;
    border-bottom: 1px solid var(--gray-200);
    overflow-x: auto;
    overflow-y: hidden;
  }

  .sidebar-heading {
    margin-bottom: 10px;
    font-size: 10px;
  }

  /* 框列表改为横向排列 */
  .frame-list {
    display: flex;
    flex-direction: row;
    gap: 10px;
    width: max-content;
  }

  .frame-option {
    width: 130px;
    flex-shrink: 0;
  }

  .frame-option-inner {
    flex-direction: column;
    align-items: center;
    padding: 8px;
    text-align: center;
    gap: 6px;
  }

  .frame-option-thumb {
    width: 70px;
    height: 70px;
  }

  .frame-option-name { font-size: 12px; }

  .selected-check {
    position: absolute;
    top: 6px;
    right: 6px;
  }
  .frame-option { position: relative; }

  /* 画布区：居中显示 */
  .editor-canvas-area {
    order: 2;
    padding: 16px;
  }

  #main-canvas {
    width: 300px !important;
    height: 300px !important;
  }

  .canvas-hint { font-size: 11px; }

  /* 右侧控制区：移到底部 */
  .editor-sidebar-right {
    order: 3;
    border-left: none;
    border-top: 1px solid var(--gray-200);
    padding: 16px;
    gap: 16px;
  }

  .upload-zone { padding: 18px 14px; }

  .btn-download {
    padding: 12px;
    font-size: 14px;
  }

  /* ── 首页其他区域 ── */
  .frames-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    padding: 0 16px;
  }

  .steps-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 0 24px;
  }
  .steps-grid::before { display: none; }

  .footer {
    flex-direction: column;
    padding: 28px 20px;
    text-align: center;
    gap: 12px;
  }

  .section-title { font-size: 26px; }
}

/* ============================================
   响应式 - 小屏手机（iPhone SE等）
   ============================================ */
@media (max-width: 390px) {
  #main-canvas {
    width: 260px !important;
    height: 260px !important;
  }

  .frame-option { width: 110px; }
  .frame-option-thumb { width: 55px; height: 55px; }

  .frames-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 0 12px;
  }

  .hero-title { font-size: 32px; }
}