/* === 花甲小白 - 适老化设计系统 === */
:root {
  --primary: #F5A623;
  --primary-dark: #E8941C;
  --primary-light: #FFE4B5;
  --bg: #FFFBF5;
  --bg-card: #FFFFFF;
  --text: #2D2D2D;
  --text-secondary: #6B6B6B;
  --text-light: #999999;
  --border: #F0E6D6;
  --success: #52C41A;
  --error: #FF4D4F;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 4px 20px rgba(245, 166, 35, 0.15);
  --shadow-lg: 0 8px 32px rgba(245, 166, 35, 0.2);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html { font-size: 20px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Heiti SC", sans-serif;
  font-size: 20px;
  line-height: 1.8;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px;
}

/* 顶部导航 */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 251, 245, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
}
.nav-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-emoji { font-size: 32px; }
.nav-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 28px;
  border-radius: 50px;
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  min-height: 48px;
}
.nav-btn:active { transform: scale(0.95); }

/* 标题系统 */
h1 { font-size: 42px; line-height: 1.3; font-weight: 800; }
h2 { font-size: 36px; line-height: 1.3; font-weight: 700; }
h3 { font-size: 28px; line-height: 1.4; font-weight: 600; }
p { font-size: 20px; line-height: 1.8; }

.text-secondary { color: var(--text-secondary); }
.text-center { text-align: center; }

/* 按钮系统 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 40px;
  min-height: 64px;
  font-size: 22px;
  font-weight: 600;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  font-family: inherit;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow);
}
.btn-primary:hover { background: var(--primary-dark); box-shadow: var(--shadow-lg); }
.btn-outline {
  background: white;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Hero 区 */
.hero {
  padding: 60px 0 40px;
  text-align: center;
}
.hero h1 {
  background: linear-gradient(135deg, var(--primary), #FF6B35);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}
.hero-subtitle {
  font-size: 22px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}
.hero-emoji {
  font-size: 80px;
  margin-bottom: 20px;
}

/* 卡片 */
.theme-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #fff9f0, #fff3e0);
  border: 1.5px solid #F5DEB3;
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 16px;
}
.theme-info-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
#theme-info-emoji {
  font-size: 36px;
  line-height: 1;
}
.theme-info-name {
  font-size: 18px;
  font-weight: 700;
  color: #333;
  margin-bottom: 2px;
}
.theme-info-desc {
  font-size: 13px;
  color: #888;
}
.theme-info-right {
  text-align: right;
}
.theme-recommend {
  display: inline-block;
  background: #fff;
  color: #F5A623;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #F5DEB3;
}

.input-field {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  border: 1.5px solid #e5e5e5;
  border-radius: 12px;
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color 0.2s;
  outline: none;
}
.input-field:focus {
  border-color: var(--primary);
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

/* 功能列表 */
.features {
  display: grid;
  gap: 20px;
  margin: 40px 0;
}
.feature-item {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 24px;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.feature-icon {
  font-size: 48px;
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  border-radius: 50%;
}
.feature-text h3 { margin-bottom: 8px; }
.feature-text p {
  color: var(--text-secondary);
  font-size: 18px;
}

/* 步骤 */
.steps {
  display: flex;
  justify-content: space-between;
  margin: 40px 0;
  gap: 12px;
}
.step {
  flex: 1;
  text-align: center;
  background: white;
  border-radius: var(--radius);
  padding: 24px 16px;
  box-shadow: var(--shadow);
}
.step-num {
  width: 48px;
  height: 48px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  margin: 0 auto 12px;
}
.step h3 { font-size: 22px; margin-bottom: 4px; }
.step p {
  font-size: 16px;
  color: var(--text-secondary);
}

/* 模板选择 */
.templates {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 24px 0;
}
.template-card {
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.2s;
  background: white;
  box-shadow: var(--shadow);
}
.template-card.selected {
  border-color: var(--primary);
  transform: scale(1.02);
}
.template-preview {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
}
.template-name {
  padding: 16px;
  text-align: center;
  font-size: 20px;
  font-weight: 600;
}
.template-desc {
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
  padding-bottom: 12px;
}
.template-premium .template-name {
  padding-bottom: 2px;
}


/* 上传区 */
.upload-area {
  border: 3px dashed var(--primary);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  background: white;
  transition: all 0.2s;
  margin-bottom: 20px;
}
.upload-area:hover, .upload-area.dragover {
  background: var(--primary-light);
  border-color: var(--primary-dark);
}
.upload-icon { font-size: 64px; margin-bottom: 16px; }
.upload-text {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 8px;
}
.upload-hint {
  font-size: 18px;
  color: var(--text-secondary);
}
.upload-btn-row {
  margin-bottom: 20px;
}

/* 照片预览网格 */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 20px 0;
}
.photo-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #eee;
}
.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 32px;
  height: 32px;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 进度条 */
.progress-section {
  text-align: center;
  padding: 40px 0;
}
.spinner {
  width: 64px;
  height: 64px;
  border: 6px solid var(--primary-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 24px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress-bar {
  width: 100%;
  height: 16px;
  background: var(--primary-light);
  border-radius: 50px;
  overflow: hidden;
  margin: 16px 0;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  border-radius: 50px;
  transition: width 0.3s;
}

/* 结果页 */
.result-video {
  width: 100%;
  border-radius: var(--radius);
  margin-bottom: 20px;
  background: #000;
  aspect-ratio: 9/16;
  max-height: 70vh;
}
.result-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.result-tips {
  background: var(--primary-light);
  border: 2px solid var(--primary);
}

.result-tips h3 {
  text-align: center;
  color: var(--primary-dark);
}

.tip-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--primary);
}

.tip-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.tip-item:first-child {
  padding-top: 0;
}

.tip-num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
}

.tip-text {
  font-size: 20px;
  color: var(--text);
  line-height: 1.5;
}

.copy-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 20px 40px;
  border-radius: 12px;
  font-size: 20px;
  z-index: 9999;
  text-align: center;
}

/* 视频包装器 */
.video-wrapper {
  position: relative;
  width: 100%;
  margin-bottom: 24px;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  aspect-ratio: 9/16;
  max-height: 70vh;
}

.video-wrapper .result-video {
  width: 100%;
  height: 100%;
  margin-bottom: 0;
  border-radius: 0;
  max-height: none;
  object-fit: cover;
}
/* 声音开关按钮 */
.sound-toggle {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: all 0.3s ease;
}

.sound-toggle:active {
  transform: scale(0.9);
  background: rgba(0, 0, 0, 0.7);
}

.sound-toggle.sound-on {
  background: rgba(255, 200, 80, 0.7);
}

/* 长按提示动画 */
.longpress-hint {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 10;
}

.longpress-hint.show {
  opacity: 1;
}

.longpress-finger {
  animation: fingerPress 2s ease-in-out infinite;
}

@keyframes fingerPress {
  0%, 100% { transform: scale(1) translateY(0); }
  50% { transform: scale(1.1) translateY(10px); }
}

.longpress-ring {
  width: 80px;
  height: 80px;
  border: 4px solid var(--primary);
  border-radius: 50%;
  margin-top: -20px;
  animation: ringExpand 2s ease-out infinite;
  opacity: 0;
}

@keyframes ringExpand {
  0% { transform: scale(0.5); opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}

.longpress-text {
  color: white;
  font-size: 22px;
  font-weight: 600;
  margin-top: 20px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
  animation: textBlink 2s ease-in-out infinite;
}

@keyframes textBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* 保存方式列表 */
.save-methods {
  margin-bottom: 24px;
}

.save-method-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: white;
  border-radius: var(--radius);
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.2s;
}

.save-method-card:active {
  transform: scale(0.98);
  background: var(--primary-light);
}

.save-icon {
  font-size: 36px;
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  border-radius: 50%;
}

.save-info {
  flex: 1;
  min-width: 0;
}

.save-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.save-desc {
  font-size: 16px;
  color: var(--text-secondary);
}

.save-arrow {
  font-size: 28px;
  color: var(--text-light);
  flex-shrink: 0;
}

/* 分享引导遮罩 */
.share-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 80px 24px 24px;
}

.share-arrow {
  color: white;
  text-align: right;
  margin-right: 20px;
  margin-bottom: 20px;
  animation: arrowBounce 1s ease-in-out infinite;
}

@keyframes arrowBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.share-guide {
  width: 100%;
  background: white;
  border-radius: var(--radius);
  padding: 28px;
  margin-top: auto;
}

.share-guide h3 {
  text-align: center;
  color: var(--primary-dark);
  margin-bottom: 8px;
}

.share-guide p {
  font-size: 19px;
  line-height: 2;
  color: var(--text);
}

/* FAQ */
.faq-item {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.faq-q {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--primary-dark);
}
.faq-a { color: var(--text-secondary); }

/* 底部 */
.footer {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
  font-size: 16px;
}

/* 工具类 */
.hidden { display: none !important; }

/* 移动端优化 */
@media (max-width: 480px) {
  html { font-size: 18px; }
  h1 { font-size: 36px; }
  h2 { font-size: 30px; }
  h3 { font-size: 24px; }
  .hero { padding: 40px 0 30px; }
  .templates { grid-template-columns: 1fr; }
  .steps { flex-direction: column; }
  .feature-item { flex-direction: column; text-align: center; }
  .feature-icon { margin: 0 auto; }
}

/* 模板选择 4 列网格 */
.template-grid-4 {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 16px !important;
  max-width: 100% !important;
  margin: 16px 0 !important;
}

@media (min-width: 600px) {
  .template-grid-4 {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}

.template-grid-4 .template-preview {
  height: 100px !important;
  font-size: 36px !important;
}

.template-grid-4 .template-name {
  font-size: 16px !important;
}

.template-grid-4 .template-desc {
  font-size: 13px !important;
}
.template-card {
  cursor: pointer;
  transition: all 0.2s ease;
}

.template-card:active {
  transform: scale(0.97);
}

/* 测试版徽标 */
.beta-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 10px;
  font-size: 14px;
  font-weight: 600;
  color: #B45309;
  background: #FFE4B5;
  border: 1px solid #F5A623;
  border-radius: 999px;
  vertical-align: middle;
}

/* 等待说明 + 微信通知 */
.wait-notice {
  margin-top: 20px;
  background: #FFF8EC;
}
.wait-notice-text {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}
.qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.qr-img {
  width: 160px;
  height: 160px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  object-fit: contain;
  background: white;
}
.qr-text {
  font-size: 15px;
  color: var(--text-secondary);
  text-align: center;
}

.notify-contact-box {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--border-color);
}

.notify-hint {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.notify-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.notify-input:focus {
  border-color: var(--primary-color);
}

/* 结果页换主题网格（2 列紧凑） */
.regen-grid {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 12px !important;
  margin: 16px 0 !important;
  max-width: 100% !important;
}
.regen-grid .template-preview {
  height: 90px !important;
  font-size: 34px !important;
}
.regen-grid .template-name {
  padding: 10px !important;
  font-size: 15px !important;
}
