/* 视频号下载助手 · 现代 SaaS 风格 */
:root {
  --primary: #6c5ce7;
  --primary-dark: #5848c2;
  --primary-light: #a29bfe;
  --accent: #00d4ff;
  --success: #00c48c;
  --danger: #ff5e72;
  --warn: #ffa940;
  --text: #1a1a2e;
  --text-secondary: #5a5a7a;
  --text-muted: #9b9bb5;
  --bg-page: linear-gradient(135deg, #f5f3ff 0%, #e8f4ff 50%, #fff0f6 100%);
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.6);
  --shadow-sm: 0 2px 8px rgba(108, 92, 231, 0.08);
  --shadow-md: 0 8px 24px rgba(108, 92, 231, 0.12);
  --shadow-lg: 0 16px 48px rgba(108, 92, 231, 0.16);
  --shadow-btn: 0 6px 20px rgba(108, 92, 231, 0.35);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --gradient-primary: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 50%, #00d4ff 100%);
  --gradient-warm: linear-gradient(135deg, #ff6b9d 0%, #ffa940 100%);
  --gradient-success: linear-gradient(135deg, #00c48c 0%, #00d4ff 100%);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "SF Pro Display", sans-serif;
  background: var(--bg-page);
  background-attachment: fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum";
  min-height: 100vh;
}

.app { max-width: 480px; margin: 0 auto; padding: 0 16px 80px; min-height: 100vh; }

/* ========== 顶栏 ========== */
.topbar {
  padding: 28px 4px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar-title {
  font-size: 26px;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}
.topbar-title::before {
  content: "✨ ";
  -webkit-text-fill-color: initial;
}

/* ========== 警告条 ========== */
.notice-bar {
  background: linear-gradient(135deg, #fff3e0, #ffe0b2);
  color: #b97d10;
  font-size: 13px;
  text-align: center;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-weight: 500;
}

/* ========== 搜索卡 ========== */
.search-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  padding: 22px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255, 255, 255, 0.5);
  position: relative;
  overflow: hidden;
}
.search-card::before {
  content: "";
  position: absolute;
  top: -50%; right: -20%;
  width: 200px; height: 200px;
  background: var(--gradient-primary);
  opacity: 0.06;
  border-radius: 50%;
  pointer-events: none;
}
.search-row {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}
.search-row input {
  flex: 1;
  border: 1.5px solid rgba(108, 92, 231, 0.15);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 14px;
  outline: none;
  background: rgba(255, 255, 255, 0.7);
  min-width: 0;
  transition: all 0.2s ease;
  font-family: inherit;
}
.search-row input:focus {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.1);
}
.btn-primary-sm {
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 0 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--shadow-btn);
  transition: all 0.2s ease;
}
.btn-primary-sm:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(108, 92, 231, 0.45); }
.btn-primary-sm:active { transform: translateY(0); }
.btn-primary-sm:disabled { opacity: 0.6; cursor: not-allowed; }
.clipboard-hint {
  display: none;
  font-size: 12px;
  color: var(--success);
  margin-top: 8px;
  padding: 6px 12px;
  background: rgba(0, 196, 140, 0.08);
  border-radius: var(--radius-sm);
  text-align: center;
}
.clipboard-hint.show { display: block; animation: slideDown 0.3s ease; }
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========== 加载 ========== */
.loading {
  text-align: center;
  padding: 40px 0;
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(108, 92, 231, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 12px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#loadingText { font-size: 14px; color: var(--text-secondary); }

/* ========== 视频卡片 ========== */
.video-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255, 255, 255, 0.5);
}
.video-cover-wrap {
  position: relative;
  width: 100%;
  background: linear-gradient(135deg, #1a1a2e, #2d2d44);
  aspect-ratio: 16/9;
  overflow: hidden;
}
.video-cover {
  width: 100%;
  display: block;
  aspect-ratio: 16/9;
  object-fit: cover;
}
.video-duration {
  position: absolute;
  right: 10px; bottom: 10px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  color: white;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-weight: 500;
}
.video-play-badge {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 60px; height: 60px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  color: white;
  font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  padding-left: 4px;
  border: 2px solid rgba(255, 255, 255, 0.3);
}
.video-meta { padding: 16px 20px; }
.video-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 6px;
}
.video-author {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}
.video-author::before { content: "@"; opacity: 0.5; }
.video-stats {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ========== 操作区 ========== */
.action-area { margin-top: 4px; }

.icon-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.icon-btn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-md);
  padding: 14px 0;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}
.icon-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: rgba(108, 92, 231, 0.2); }
.icon-btn .icon { font-size: 24px; }
.icon-btn .icon-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; }

.cta-row { display: grid; gap: 10px; margin-bottom: 14px; }
.cta-btn {
  border: none;
  border-radius: var(--radius-md);
  padding: 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  text-decoration: none;
  display: block;
  font-family: inherit;
}
.cta-primary {
  background: var(--gradient-warm);
  color: white;
  box-shadow: 0 6px 20px rgba(255, 107, 157, 0.3);
}
.cta-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(255, 107, 157, 0.4); }
.cta-outline {
  background: var(--bg-card);
  color: var(--text);
  border: 1.5px solid rgba(108, 92, 231, 0.2);
}
.cta-outline:hover { border-color: var(--primary); color: var(--primary); }
.cta-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ========== 下载进度 ========== */
.download-progress {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(255, 255, 255, 0.5);
}
.progress-bar { height: 6px; background: rgba(108, 92, 231, 0.1); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: var(--gradient-primary); transition: width 0.3s ease; border-radius: 3px; }
.progress-text { font-size: 12px; color: var(--text-secondary); margin-top: 8px; }

/* ========== 下载结果 ========== */
.download-result {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 14px;
  font-size: 13px;
  line-height: 1.7;
  word-break: break-all;
  border: 1px solid rgba(255, 255, 255, 0.5);
}
.download-result .ok { color: var(--success); font-weight: 600; }
.download-result .warn { color: var(--warn); }
.download-result .mono { font-size: 12px; color: var(--text-muted); font-family: monospace; }

/* ========== 次级按钮 ========== */
.sub-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.sub-btn {
  background: var(--gradient-primary);
  color: white;
  border: none; border-radius: var(--radius-md);
  padding: 14px 0;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  box-shadow: var(--shadow-btn);
  transition: all 0.2s ease;
  font-family: inherit;
}
.sub-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(108, 92, 231, 0.4); }
.sub-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ========== 一键发微信 ========== */
.send-wechat-btn {
  width: 100%;
  background: var(--gradient-success);
  color: white;
  border: none; border-radius: var(--radius-lg);
  padding: 16px;
  font-size: 15px; font-weight: 700;
  cursor: pointer;
  margin-bottom: 14px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 8px 24px rgba(0, 196, 140, 0.3);
  transition: all 0.2s ease;
  font-family: inherit;
}
.send-wechat-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(0, 196, 140, 0.4); }

/* ========== 历史记录 ========== */
.history-section {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow-sm);
}
.history-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
}
.history-arrow { color: var(--text-muted); font-size: 18px; transition: transform 0.2s ease; }
.history-list { border-top: 1px solid rgba(108, 92, 231, 0.08); }
.history-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(108, 92, 231, 0.05);
  cursor: pointer;
  transition: background 0.15s ease;
}
.history-item:hover { background: rgba(108, 92, 231, 0.03); }
.history-item:last-child { border-bottom: none; }
.history-thumb {
 width: 56px; height: 36px;
  border-radius: 6px;
  object-fit: cover;
  background: linear-gradient(135deg, #e8e8f0, #d0d0e0);
  flex-shrink: 0;
}
.history-info { flex: 1; min-width: 0; }
.history-title {
  font-size: 13px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.history-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.history-del {
  color: var(--text-muted); font-size: 12px;
  background: none; border: none; cursor: pointer;
  padding: 6px;
}

/* ========== 空状态 ========== */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-secondary);
}
.empty-icon {
  font-size: 56px;
  margin-bottom: 16px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 12px rgba(108, 92, 231, 0.2));
}
.empty-state p { font-size: 14px; font-weight: 500; }
.empty-sub { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

/* ========== 客服栏 ========== */
.footer { margin-top: 24px; padding: 0; }
.cs-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  padding: 14px 20px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow-sm);
}
.cs-avatar {
  width: 38px; height: 38px;
  background: var(--gradient-primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.cs-text { font-size: 14px; font-weight: 600; flex: 1; }
.cs-status {
  font-size: 11px;
  color: var(--success);
  display: flex; align-items: center; gap: 4px;
}
.cs-status::before {
  content: "";
  width: 6px; height: 6px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.cookie-link-btn {
  background: none; border: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  text-decoration: underline;
  font-family: inherit;
}
.footer-note {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  padding: 16px 0 8px;
  opacity: 0.7;
}

/* ========== Toast ========== */
.toast {
  position: fixed;
  top: 30%; left: 50%;
  transform: translateX(-50%);
  background: rgba(26, 26, 46, 0.92);
  backdrop-filter: blur(20px);
  color: white;
  font-size: 14px;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  z-index: 100;
  max-width: 80%;
  text-align: center;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ========== Modal ========== */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(26, 26, 46, 0.4);
  backdrop-filter: blur(8px);
  z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: white;
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 420px;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-wide { max-width: 500px; }
.modal-title {
  font-size: 18px; font-weight: 700;
  text-align: center;
  margin-bottom: 18px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.quality-list {
  max-height: 320px;
  overflow-y: auto;
}
.quality-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(108, 92, 231, 0.06);
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s ease;
}
.quality-item:active { background: rgba(108, 92, 231, 0.06); }
.quality-name { font-size: 14px; font-weight: 500; }
.quality-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.quality-arrow { color: var(--text-muted); }
.modal-close {
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  border: none;
  border-radius: var(--radius-md);
  background: rgba(108, 92, 231, 0.08);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease;
}
.modal-close:hover { background: rgba(108, 92, 231, 0.15); }
.asr-content { max-height: 340px; overflow-y: auto; background: rgba(108, 92, 231, 0.04); border-radius: var(--radius-md); padding: 14px; }
.asr-text { font-size: 14px; line-height: 1.8; white-space: pre-wrap; }
.asr-actions { display: flex; gap: 8px; }
.asr-actions .modal-close { margin-top: 16px; flex: 1; }

/* ========== iOS 引导卡 ========== */
.ios-guide {
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.08), rgba(0, 212, 255, 0.06));
  border: 1.5px solid rgba(108, 92, 231, 0.25);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin: 14px 0;
  font-size: 13px;
  line-height: 1.8;
}
.ios-guide b { color: var(--primary); }
.share-icon {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 22px; height: 22px;
  border: 1.5px solid var(--primary);
  border-radius: 5px;
  font-size: 13px; color: var(--primary);
  margin: 0 3px; vertical-align: middle;
}
.steps {
  background: rgba(108, 92, 231, 0.04);
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.9;
  margin-top: 14px;
}
.steps ol { padding-left: 22px; margin: 4px 0; }
.steps li { margin-bottom: 6px; }
.warn {
  background: linear-gradient(135deg, #fff3cd, #ffe8b0);
  color: #856404;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  margin: 14px 0;
  font-size: 13px;
  line-height: 1.7;
  border: 1px solid rgba(255, 169, 64, 0.2);
}
.ok { color: var(--success); }
.mut { color: var(--text-muted); }

.hidden { display: none !important; }
/* ========== 会员系统 ========== */
.member-bar {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, rgba(255,169,64,0.15), rgba(255,107,157,0.12));
  border: 1.5px solid rgba(255,169,64,0.35);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  margin-bottom: 14px;
}
.member-info { flex: 1; display: flex; align-items: center; gap: 8px; }
.member-icon { font-size: 20px; }
#memberText { font-size: 13px; font-weight: 600; color: var(--text); }
.member-btn {
  background: var(--gradient-warm);
  color: white; border: none; border-radius: var(--radius-md);
  padding: 8px 18px; font-size: 13px; font-weight: 700; cursor: pointer;
  box-shadow: 0 4px 12px rgba(255,107,157,0.3);
  font-family: inherit;
}
.free-quota {
  margin-top: 12px; font-size: 12px; color: var(--text-muted);
  background: rgba(108,92,231,0.06); padding: 6px 12px; border-radius: var(--radius-sm);
  display: inline-block;
}
.member-plans { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.member-plan {
  position: relative;
  border: 1.5px solid rgba(108,92,231,0.15);
  border-radius: var(--radius-lg);
  padding: 18px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.member-plan:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.member-plan.hot { border-color: var(--primary); background: linear-gradient(135deg, rgba(108,92,231,0.06), rgba(0,212,255,0.04)); }
.member-plan.selected { border-width: 2.5px; }
.plan-tag {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--gradient-warm); color: white; font-size: 11px; font-weight: 700;
  padding: 2px 10px; border-radius: 10px; white-space: nowrap;
}
.plan-name { font-size: 15px; font-weight: 600; }
.plan-price { font-size: 22px; font-weight: 800; margin: 6px 0 2px; background: var(--gradient-primary); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.plan-desc { font-size: 12px; color: var(--text-muted); }
.pay-step { margin-bottom: 12px; }
.pay-tip { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.pay-tip-sm { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.pay-qr-wrap { text-align: center; margin-bottom: 8px; }
.pay-qr { width: 180px; height: 180px; border-radius: var(--radius-md); border: 1px solid rgba(0,0,0,0.08); }
.pay-input {
  width: 100%; border: 1.5px solid rgba(108,92,231,0.2);
  border-radius: var(--radius-md); padding: 12px 14px; font-size: 13px;
  outline: none; font-family: inherit; box-sizing: border-box;
}
.pay-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(108,92,231,0.1); }
.member-status { font-size: 12px; color: var(--text-muted); text-align: center; margin-top: 10px; min-height: 16px; }
