/* ============================================
   Pass.HK — Design System & Styles
   ============================================ */

/* === CSS Custom Properties (Design Tokens) === */
:root {
  /* 品牌色 */
  --primary-color: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: rgba(99, 102, 241, 0.1);
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

  /* 文字色 */
  --text-primary: #1f2937;
  --text-secondary: #4b5563;
  --text-muted: #5b6370;

  /* 背景色 */
  --bg-primary: #f9fafb;
  --bg-secondary: #f3f4f6;
  --card-bg: #ffffff;
  --card-bg-hover: #f9fafb;
  --input-bg: #ffffff;
  --nav-bg: rgba(255, 255, 255, 0.85);
  --footer-bg: #f3f4f6;
  --hover-bg: #f3f4f6;

  /* 邊框 */
  --border-color: #e5e7eb;
  --input-border: #d1d5db;

  /* 狀態色 */
  --success-color: #22c55e;
  --success-bg: rgba(34, 197, 94, 0.1);
  --error-color: #ef4444;
  --error-bg: rgba(239, 68, 68, 0.1);
  --warning-color: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --info-color: #3b82f6;
  --info-bg: rgba(59, 130, 246, 0.1);

  /* 圓角系統 */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* 陰影系統 */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.12);
  --box-shadow: var(--shadow-md);
  --box-shadow-hover: var(--shadow-lg);

  /* 過渡動畫 */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 400ms ease;

  /* 字體 */
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;

  /* 容器 */
  --container-max: 1200px;

  /* === 設計系統擴展變量 === */
  --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.3);

  /* 功能卡片品牌色 */
  --feature-fast-color: #f59e0b;
  --feature-hd-color: #3b82f6;
  --feature-multi-color: #22c55e;
  --feature-noad-color: #ef4444;
}

/* === 暗色主題 === */
[data-theme="dark"] {
  --text-primary: #f3f4f6;
  --text-secondary: #d1d5db;
  --text-muted: #9ca3af;

  --bg-primary: #111827;
  --bg-secondary: #1f2937;
  --card-bg: #1f2937;
  --card-bg-hover: #374151;
  --input-bg: #374151;
  --nav-bg: rgba(30, 41, 59, 1);
  --footer-bg: #111827;
  --hover-bg: #374151;

  --border-color: #374151;
  --input-border: #4b5563;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.5);

  /* 暗色模式擴展變量 */
  --shadow-glow: 0 0 20px rgba(96, 165, 250, 0.4);
}

/* === 全局重置 === */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  transition: background-color var(--transition-normal), color var(--transition-normal);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: 64px;
}

/* === Skip Navigation (Accessibility) === */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary-color);
  color: white;
  padding: 8px 16px;
  z-index: 1000;
  font-size: 14px;
  text-decoration: none;
  border-radius: 0 0 var(--radius-sm) 0;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0;
}

/* === 通用工具類 === */
.hidden { display: none !important; }

/* === 焦點狀態 (Accessibility) === */
*:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* === 通用容器 === */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

/* 固定导航栏锚点偏移 */
:target {
  scroll-margin-top: 80px;
}

/* 会员页 Tab 锚点偏移 */
[id^="tab-"] {
  scroll-margin-top: 80px;
}

/* === 連結 === */
a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-hover);
}

/* === 圖片 === */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ============================================
   導航欄
   ============================================ */
header {
  width: 100%;
  display: block;
}

nav {
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 14px 20px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: background-color var(--transition-normal);
}

/* Nav content aligned with page content */
nav > .nav-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Nav content aligned with page content */
nav > .nav-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Mobile: nav-inner takes full width */
@media (max-width: 768px) {
  nav > .nav-inner {
    max-width: 100%;
  }
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}

.nav-logo-img {
  height: 50px;
  width: auto;
}

/* Logo 主題切換：top_logo_white.png(白底黑字)用于亮色，top_logo_black.png(黑底白字)用于暗色 */
.logo-light { display: block; }  /* 亮色 logo 默认显示 */
.logo-dark { display: none; }   /* 暗色 logo 默认隐藏 */

[data-theme="dark"] .logo-light { display: none; }   /* 暗色模式隐藏亮色 logo */
[data-theme="dark"] .logo-dark { display: block; }    /* 暗色模式显示暗色 logo */

/* 首页 Hero Logo — 满版展示 */
.hero-logo {
  text-align: center;
  margin-bottom: 20px;
}
.hero-logo-img {
  max-height: 50px;
  width: auto;
  margin: 0 auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 12px;
  right: 12px;
  height: 2px;
  background: var(--primary-color);
  border-radius: 1px;
  transform: scaleX(0);
  transition: transform var(--transition-fast);
}

.nav-links a:hover {
  color: var(--primary-color);
  background: var(--primary-light);
}

.nav-links a:hover::after {
  transform: scaleX(1);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 圖標按鈕 */
.icon-btn {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.icon-btn:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
  border-color: var(--primary-color);
}

/* 暗色主題下圖標切換 */
.icon-sun { display: none; }
.icon-moon { display: block; }

[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

/* 語言切換 */
#langText {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* 漢堡菜單 */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text-secondary);
}

/* 用戶區域 */
.user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 默認隱藏用戶 section，由 JS 控制顯示 */
.user-section {
  display: none;
}

/* JS 添加 visible class 後顯示 */
.user-section.visible {
  display: flex !important;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  font-weight: 600;
}

/* ============================================
   Hero 區域
   ============================================ */
.hero,
.hero-section {
  text-align: center;
  padding: 60px 20px 40px;
}

.hero-section {
  position: relative;
  overflow: hidden;
}

.hero h1,
.hero-title,
.hero-section h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin: 0 0 12px;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.3;
}

.hero p.subtitle,
.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin: 0 0 32px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* 搜索框 */
.parse-form {
  display: flex;
  gap: 12px;
  max-width: 640px;
  margin: 0 auto 16px;
  position: relative;
  z-index: 1;
}

.input-wrapper {
  flex: 1;
  position: relative;
}

.input-wrapper input {
  width: 100%;
  padding: 14px 44px 14px 44px;
  border: 2px solid var(--input-border);
  border-radius: var(--radius-lg);
  font-size: 1rem;
  background: var(--input-bg);
  color: var(--text-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

/* 搜索圖標 */
.input-wrapper::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2218%22%20height%3D%2218%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%239ca3af%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2211%22%20cy%3D%2211%22%20r%3D%228%22/%3E%3Cline%20x1%3D%2221%22%20y1%3D%2221%22%20x2%3D%2216.65%22%20y2%3D%2216.65%22/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 1;
}

[data-theme="dark"] .input-wrapper::before {
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2218%22%20height%3D%2218%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%236b7280%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2211%22%20cy%3D%2211%22%20r%3D%228%22/%3E%3Cline%20x1%3D%2221%22%20y1%3D%2221%22%20x2%3D%2216.65%22%20y2%3D%2216.65%22/%3E%3C/svg%3E");
}

.input-wrapper input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.input-wrapper input::placeholder {
  color: var(--text-muted);
}

[data-theme="dark"] .input-wrapper input::placeholder {
  color: var(--text-muted);
}

.clear-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  display: none;
  border-radius: 50%;
  transition: color var(--transition-fast);
}

.clear-btn:hover {
  color: var(--text-primary);
}

/* 主按鈕 */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  text-decoration: none;
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(255,255,255,0.3) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--transition-fast);
  pointer-events: none;
}

.btn-primary:hover::after {
  opacity: 1;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  background: var(--text-muted);
  box-shadow: none;
}

.btn-primary:disabled::after {
  display: none;
}

/* 已签到按钮状态 */
.btn-signed {
  background: var(--bg-secondary) !important;
  color: var(--text-muted) !important;
  border-color: transparent !important;
  cursor: default !important;
  transform: none !important;
  box-shadow: none !important;
  pointer-events: none;
}

.btn-signed::after {
  display: none !important;
}

/* 按鈕載入狀態 */
.btn-primary.loading {
  pointer-events: none;
  opacity: 0.8;
}

.btn-primary.loading .btn-text {
  opacity: 0;
}

.btn-primary.loading::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.btn-icon {
  width: 18px;
  height: 18px;
}

/* 標籤 */
.parse-tags {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
}

.tag {
  padding: 4px 12px;
  background: var(--primary-light);
  color: var(--primary-color);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
}

/* ============================================
   廣告區域
   ============================================ */
.ad-section {
  max-width: var(--container-max);
  margin: 24px auto;
  padding: 0 20px;
}

.ad-block {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--box-shadow);
  text-align: center;
  border: 1px solid var(--border-color);
}

.ad-block a {
  color: var(--text-primary);
  text-decoration: none;
}

.ad-block h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--text-secondary);
}

/* ============================================
   結果卡片
   ============================================ */
.result-card {
  max-width: 800px;
  margin: 24px auto;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--box-shadow);
  overflow: hidden;
  border: 1px solid var(--border-color);
  animation: slideDown 0.3s ease;
}

.result-card > :last-child {
  margin-bottom: 0;
}

/* 视频页面标题和元信息 */
#result-title {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

#result-meta {
  margin: 0 0 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.result-body {
  padding: 20px 24px;
}

.result-body h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-body p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.result-card .thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--bg-secondary);
}

#player-section {
  padding: 0;
}

#player-section video {
  width: 100%;
  max-width: 100%;
  display: block;
  background: var(--bg-primary);
}

#result-desc {
  padding: 16px 24px;
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* 下載鏈接 */
.download-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 24px 24px;
}

.download-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-fast);
  border: 1px solid var(--border-color);
}

.download-link::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M21%2015v4a2%202%200%200%201-2%202H5a2%202%200%200%201-2-2v-4%22/%3E%3Cpolyline%20points%3D%227%2010%2012%2015%2017%2010%22/%3E%3Cline%20x1%3D%2212%22%20y1%3D%2215%22%20x2%3D%2212%22%20y2%3D%223%22/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  flex-shrink: 0;
}

.download-link:hover {
  background: var(--primary-light);
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.download-link.primary {
  background: var(--primary-gradient);
  color: white;
  border-color: transparent;
}

.download-link.primary:hover {
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* ============================================
   封面图缩略图（视频页面）
   ============================================ */
.cover-thumb {
  position: relative;
  width: 100%;
  overflow: hidden;
  cursor: pointer;
  border-radius: var(--radius-md);
  margin: 16px 0 0;
}

.cover-thumb img {
  width: 100%;
  display: block;
  border-radius: var(--radius-md);
  transition: transform var(--transition-normal);
}

.cover-thumb:hover img {
  transform: scale(1.02);
}

.cover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  opacity: 0;
  transition: opacity var(--transition-fast);
  pointer-events: none;
}

.cover-thumb:hover .cover-overlay {
  opacity: 1;
}

/* ============================================
   Lightbox 放大图片
   ============================================ */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-btns {
  display: flex;
  gap: 12px;
  padding: 16px 24px;
  width: 100%;
  justify-content: center;
  flex-shrink: 0;
}

.lightbox-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--card-bg);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.lightbox-btn:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.lightbox-overlay img {
  max-width: 90vw;
  max-height: 75vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* ============================================
   平台卡片
   ============================================ */
.platform-cards {
  max-width: var(--container-max);
  margin: 48px auto;
  padding: 0 20px;
}

.section-title {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 32px;
  color: var(--text-primary);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  text-align: center;
  box-shadow: var(--box-shadow);
  border: 1px solid var(--border-color);
  transition: all var(--transition-normal);
  cursor: default;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--box-shadow-hover);
  border-color: var(--primary-color);
}

.card-icon {
  margin: 0 auto 16px;
  display: flex;
  justify-content: center;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.legal-page {
  max-width: 800px;
  margin: 40px auto;
  padding: 32px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  line-height: 1.8;
}

.legal-page h1,
.legal-page h2 {
  margin-bottom: 24px;
  color: var(--text-primary);
}

.legal-page h3 {
  margin: 24px 0 12px;
  color: var(--text-primary);
}

.legal-page p {
  margin-bottom: 16px;
  color: var(--text-secondary);
}

/* ============================================
   最近視頻
   ============================================ */
.recent-videos {
  margin: 48px auto;
  max-width: var(--container-max);
  padding: 0 20px;
}

.video-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 340px));
  justify-content: center;
  gap: 20px;
}

.video-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  text-decoration: none;
  transition: all var(--transition-normal);
}

.video-item:hover {
  border-color: var(--primary-color);
  box-shadow: var(--box-shadow-hover);
  transform: translateY(-2px);
}

.video-thumb {
  width: 120px;
  height: 68px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  background: var(--bg-secondary);
}

.video-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.video-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  max-width: 100%;
}

.video-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================
   解析進度條
   ============================================ */
.parse-progress {
  max-width: 100%;
  margin: 12px 0 0;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--box-shadow);
  border: 1px solid var(--border-color);
}

.parse-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.parse-progress-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.parse-progress-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.parse-progress-cancel {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.parse-progress-cancel:hover {
  color: var(--error-color);
  background: var(--error-bg);
}

.parse-progress-bar {
  height: 4px;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.parse-progress-fill {
  height: 100%;
  background: var(--primary-gradient);
  border-radius: var(--radius-full);
  transition: width var(--transition-normal);
}

.parse-progress-message {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ============================================
   錯誤消息
   ============================================ */
.error-message {
  max-width: 640px;
  margin: 24px auto;
  padding: 16px 20px;
  background: var(--error-bg);
  border-radius: var(--radius-md);
  color: var(--error-color);
  font-size: 0.9rem;
  text-align: center;
  border-left: 4px solid var(--error-color);
}

[data-theme="dark"] .error-message {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-left-color: #f87171;
}

/* ============================================
   頁腳
   ============================================ */
footer {
  background: var(--footer-bg);
  padding: 48px 20px 32px;
  text-align: center;
  margin-top: auto;
  transition: background-color var(--transition-normal);
  border-top: 2px solid var(--border-color);
}

.footer-inner {
  max-width: var(--container-max);
  margin: 0 auto;
}

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-color);
}

.footer-brand img {
  height: 24px;
  width: auto;
}

.footer-tagline {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

.footer-links {
  display: flex;
  gap: 32px;
  justify-content: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color var(--transition-fast);
  position: relative;
}

.footer-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--primary-color);
  transition: width var(--transition-normal);
}

.footer-links a:hover {
  color: var(--primary-color);
}

.footer-links a:hover::after {
  width: 100%;
}

footer p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 12px;
}

/* Section Divider */
.section-divider {
  border: none;
  height: 1px;
  background: var(--border-color);
  margin: 20px 0;
}

/* Social Icons */
.social-icons {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 20px;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  transition: all var(--transition-fast);
  text-decoration: none;
}

.social-icon:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* GitHub brand color */
.social-icon[href*="github"]:hover {
  color: #333;
  border-color: #333;
  background: #fff;
}
[data-theme="dark"] .social-icon[href*="github"]:hover {
  color: #fff;
  border-color: #6e6e6e;
  background: #24292f;
}

/* Email brand color */
.social-icon[href*="mailto"]:hover {
  color: #ea4335;
  border-color: #ea4335;
  background: rgba(234, 67, 53, 0.08);
}
[data-theme="dark"] .social-icon[href*="mailto"]:hover {
  color: #f28b82;
  border-color: #f28b82;
  background: rgba(242, 139, 130, 0.12);
}

/* Telegram brand color */
.social-icon[href*="t.me"]:hover {
  color: #0088cc;
  border-color: #0088cc;
  background: rgba(0, 136, 204, 0.08);
}
[data-theme="dark"] .social-icon[href*="t.me"]:hover {
  color: #5cb8d6;
  border-color: #5cb8d6;
  background: rgba(92, 184, 214, 0.12);
}

/* Feature icon — HTML uses .icon, not .feature-icon */
.feature-card .icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 24px;
}

.feature-card:nth-child(1) .icon {
  background: rgba(245, 158, 11, 0.12);
  color: var(--feature-fast-color);
}

.feature-card:nth-child(2) .icon {
  background: rgba(59, 130, 246, 0.12);
  color: var(--feature-hd-color);
}

.feature-card:nth-child(3) .icon {
  background: rgba(34, 197, 94, 0.12);
  color: var(--feature-multi-color);
}

.feature-card:nth-child(4) .icon {
  background: rgba(239, 68, 68, 0.12);
  color: var(--feature-noad-color);
}

/* Nav active page indicator */
.nav-links a.active {
  color: var(--primary-color);
  background: var(--primary-light);
}

.nav-links a.active::after {
  transform: scaleX(1);
}

/* icon-btn active state for nav links */
.nav-links .icon-btn.active {
  color: var(--primary-color);
  background: var(--primary-light);
  border-color: var(--primary-color);
}

/* Platform icon cards — brand colors on hover */
.platform-icon-card[data-platform="youtube"]:hover {
  border-color: #FF0000;
  background: rgba(255, 0, 0, 0.06);
}
.platform-icon-card[data-platform="bilibili"]:hover {
  border-color: #00B3FF;
  background: rgba(0, 179, 255, 0.06);
}
.platform-icon-card[data-platform="tiktok"]:hover {
  border-color: #25F3EE;
  background: rgba(37, 243, 238, 0.06);
}
.platform-icon-card[data-platform="douyin"]:hover {
  border-color: #25F3EE;
  background: rgba(37, 243, 238, 0.06);
}
.platform-icon-card[data-platform="xhs"]:hover {
  border-color: #FF2442;
  background: rgba(255, 36, 66, 0.06);
}
.platform-icon-card[data-platform="weibo"]:hover {
  border-color: #E6164F;
  background: rgba(230, 22, 79, 0.06);
}

/* Result card — fix double padding */
.result-card {
  padding: 0;
}

.result-card > .result-body {
  padding: 20px 24px;
}

/* Video player border-radius */
#player-section video {
  border-radius: var(--radius-md);
}

/* Hero bottom gradient transition */
.hero-section::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to bottom, transparent, var(--bg-primary));
  pointer-events: none;
  z-index: 1;
}

/* Feature card stagger animation */
.feature-card:nth-child(1) { animation-delay: 0ms; }
.feature-card:nth-child(2) { animation-delay: 100ms; }
.feature-card:nth-child(3) { animation-delay: 200ms; }
.feature-card:nth-child(4) { animation-delay: 300ms; }

/* ============================================
   功能卡片（Features）
   ============================================ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  max-width: var(--container-max);
  margin: 48px auto;
  padding: 0 20px;
}

.feature-card {
  position: relative;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  border: 1px solid var(--border-color);
  box-shadow: var(--box-shadow);
  transition: all var(--transition-normal);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--box-shadow-hover);
  border-color: var(--primary-color);
}

.feature-card h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.feature-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ============================================
   平台網格（Platform Grid）
   ============================================ */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

.platform-item {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  text-align: center;
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
  cursor: default;
}

.platform-item:hover {
  border-color: var(--primary-color);
  background: var(--primary-light);
}

.platform-item svg {
  width: 32px;
  height: 32px;
  margin: 0 auto 8px;
  display: block;
}

.platform-item span {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ============================================
   分享區域
   ============================================ */
.share-section {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  margin-top: 16px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.share-btn:hover {
  background: var(--primary-light);
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.share-btn svg {
  width: 16px;
  height: 16px;
}

/* ============================================
   表單包裝器
   ============================================ */
.form-wrapper {
  max-width: 480px;
  margin: 48px auto;
  padding: 0 20px;
}

.form-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--box-shadow);
  border: 1px solid var(--border-color);
}

.form-card h2 {
  margin: 0 0 24px;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  color: var(--text-primary);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Checkbox label overrides .form-group label { display: block } */
.form-group .checkbox-label {
  display: flex;
  margin-bottom: 0;
}

.form-group input:not([type="checkbox"]),
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--input-border);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  background: var(--input-bg);
  color: var(--text-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* Checkbox — "Remember Me" */
.checkbox-group {
  display: flex;
  align-items: center;
  margin: 12px 0 4px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-secondary);
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-custom {
  position: relative;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  background: var(--card-bg);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 5px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-label:hover .checkbox-custom {
  border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:focus-visible + .checkbox-custom {
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-submit {
  width: 100%;
  padding: 14px;
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-top: 8px;
}

.form-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

/* ============================================
   模態框
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: scale(0.95);
  transition: transform var(--transition-normal);
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px;
  transition: color var(--transition-fast);
}

.modal-close:hover {
  color: var(--text-primary);
}

/* ============================================
   徽章（Badge）
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success {
  background: var(--success-bg);
  color: var(--success-color);
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning-color);
}

.badge-error {
  background: var(--error-bg);
  color: var(--error-color);
}

.badge-info {
  background: var(--info-bg);
  color: var(--info-color);
}

.badge-primary {
  background: var(--primary-light);
  color: var(--primary-color);
}

.badge-dark {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.badge-danger {
  background: var(--error-bg);
  color: var(--error-color);
}

/* BEM 風格 badge 變體（與上方 dash 風格互為別名） */
.badge--success {
  background: var(--success-bg);
  color: var(--success-color);
}

.badge--warning {
  background: var(--warning-bg);
  color: var(--warning-color);
}

.badge--error {
  background: var(--error-bg);
  color: var(--error-color);
}

.text-success {
  color: var(--success-color);
}

.text-danger {
  color: var(--error-color);
}

/* ============================================
   動畫
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ============================================
   動畫
   ============================================ */
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.5s ease-out;
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-out;
}

.animate-slide-in-right {
  animation: slideInRight 0.3s ease-out;
}

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* ============================================
   複製提示 Toast
   ============================================ */
.copy-toast {
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--card-bg);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 10001;
  pointer-events: none;
}

.copy-toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* ============================================
   返回鏈接
   ============================================ */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-decoration: none;
  padding: 8px 0;
  transition: color var(--transition-fast);
}

.back-link:hover {
  color: var(--primary-color);
}

/* ============================================
   平台圖標卡片（Platform Icon Cards）
   ============================================ */
.platform-icon-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 24px 16px;
  text-align: center;
  border: 1px solid var(--border-color);
  transition: all var(--transition-normal);
  cursor: default;
}

.platform-icon-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--box-shadow-hover);
  border-color: var(--primary-color);
}

.platform-icon-card svg {
  width: 40px;
  height: 40px;
  margin: 0 auto 12px;
  display: block;
}

.platform-icon-card span {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ============================================
   原始 URL 顯示
   ============================================ */
.original-url {
  padding: 12px 24px;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  margin-top: 16px;
}

.original-url a {
  color: var(--primary-color);
  word-break: break-all;
}

/* ============================================
   下載區域標題
   ============================================ */
#video-links-section h4,
#audio-links-section h4 {
  margin: 24px 0 12px;
  padding: 0 24px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ============================================
   分享標籤
   ============================================ */
.share-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ============================================
   複製按鈕已複製狀態
   ============================================ */
.share-btn.copied {
  background: var(--success-bg);
  color: var(--success-color);
  border-color: var(--success-color);
}




/* ============================================
   選擇樣式
   ============================================ */
::selection {
  background: var(--primary-color);
  color: white;
}







/* ============================================
   會員卡片
   ============================================ */
.membership-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--box-shadow);
  border: 1px solid var(--border-color);
  text-align: center;
}

.membership-card h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  font-weight: 600;
}

.membership-price {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
  margin: 16px 0;
}

.membership-features {
  list-style: none;
  padding: 0;
  margin: 24px 0;
  text-align: left;
}

.membership-features li {
  padding: 8px 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.membership-features li::before {
  content: "✓ ";
  color: var(--success-color);
  font-weight: 700;
}

/* ============================================
   表格樣式
   ============================================ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.data-table th,
.data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table td {
  color: var(--text-primary);
  font-size: 0.9rem;
}

.data-table tbody tr {
  transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
  background: var(--hover-bg);
}

/* ============================================
   表格响应式容器 — 防止移动端横向溢出
   ============================================ */

.table-responsive {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  margin: 16px 0;
}

.table-responsive table {
  width: 100%;
  min-width: 520px;
  margin: 0;
}

/* ============================================
   工具提示
   ============================================ */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  pointer-events: none;
}

.tooltip:hover::after {
  opacity: 1;
  visibility: visible;
}

/* 屬性驅動 Tooltip（推薦用法） */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 6px 12px;
  background: var(--text-primary);
  color: var(--bg-primary);
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

[data-tooltip]:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================
    分割線
    ============================================ */
.divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 24px 0;
}

/* ============================================
   通知/Toast
   ============================================ */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 16px 24px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  z-index: 10000;
  animation: slideInRight 0.3s ease-out;
  max-width: 400px;
}

.toast-success {
  border-left: 4px solid var(--success-color);
}

.toast-error {
  border-left: 4px solid var(--error-color);
}

.toast-warning {
  border-left: 4px solid var(--warning-color);
}

.toast-info {
  border-left: 4px solid var(--info-color);
}

/* ============================================
   骨架屏（Skeleton Loading）
   ============================================ */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-secondary) 25%,
    var(--hover-bg) 50%,
    var(--bg-secondary) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================
   暗色主題切換過渡
   ============================================ */
body,
nav,
.card,
.result-card,
.feature-card,
.form-card,
.modal-content,
footer {
  transition: background-color var(--transition-normal), color var(--transition-normal), border-color var(--transition-normal);
}

/* ============================================
   響應式設計（Consolidated Responsive）
   ============================================ */
@media (max-width: 768px) {
  nav {
    padding: 14px 16px;
  }

  .hero h1,
  .hero-title {
    font-size: 1.8rem;
  }

  .hero p.subtitle,
  .hero-subtitle {
    font-size: 1rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
    padding: 2rem 1rem;
  }

  .platform-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .share-section {
    flex-wrap: wrap;
  }

  .parse-form {
    flex-direction: column;
  }

  .nav-links {
    display: none;
  }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    gap: 8px;
    animation: slideDown 0.25s ease;
    z-index: 101;
  }

  /* 確保手機端菜單項正確顯示 */
  .nav-links.open li {
    display: block !important;
  }

  .nav-links.open .auth-section {
    display: block !important;
  }

  .nav-links.open .auth-section.hidden {
    display: none !important;
  }

  /* Pre-paint: logged-in user on mobile — hide auth buttons before JS runs */
  html[data-user] .nav-links.open .auth-section {
    display: none !important;
  }

  .nav-links.open .user-section {
    display: block !important;
  }

  .nav-links.open .user-section.hidden {
    display: none !important;
  }

  .hamburger {
    display: block;
  }

  .footer-links {
    flex-direction: column;
    gap: 16px;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .video-list {
    grid-template-columns: 1fr;
  }

  .download-links {
    flex-direction: column;
  }

  .quick-amounts {
    justify-content: center;
  }

  .form-card {
    padding: 24px 20px;
  }
}

/* Tablet breakpoint */
@media (max-width: 1024px) and (min-width: 769px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .platform-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .hero h1,
  .hero-title {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 2.5rem 1rem 2rem;
  }

  .hero h1 {
    font-size: 1.5rem;
  }

  .platform-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================
    高對比度模式
    ============================================ */
@media (prefers-contrast: high) {
  :root {
    --border-color: #9ca3af;
    --input-border: #6b7280;
  }

  .btn-primary {
    border: 2px solid var(--primary-hover);
  }

  .card,
  .result-card {
    border-width: 2px;
  }
}

/* ============================================
   深色模式下的品牌漸變
   ============================================ */
[data-theme="dark"] .hero h1,
[data-theme="dark"] .hero-title {
  background: linear-gradient(135deg, #818cf8 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

/* ============================================
   表單錯誤狀態
   ============================================ */
.form-error input:user-invalid,
.form-error input:focus:user-invalid {
  border-color: var(--error-color);
  box-shadow: 0 0 0 3px var(--error-bg);
}

.form-error-message {
  color: var(--error-color);
  font-size: 0.8rem;
  margin-top: 4px;
}


/* ============================================
   暗色模式光暈效果
   ============================================ */
[data-theme="dark"] .btn-primary {
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

[data-theme="dark"] .card:hover,
[data-theme="dark"] .feature-card:hover {
  box-shadow: 0 0 24px rgba(99, 102, 241, 0.15);
}

/* ============================================
   自定義滾動條
   ============================================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

[data-theme="dark"] ::-webkit-scrollbar-track {
  background: #1f2937;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #4b5563;
}

/* ============================================
   列印樣式
   ============================================ */
@media print {
  nav, footer, .btn-primary, .parse-progress {
    display: none !important;
  }

  body {
    color: #000;
    background: #fff;
  }

  .card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* ============================================
   減少動畫 (Accessibility)
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ============================================
   載入狀態
   ============================================ */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading::after {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

/* ============================================
   Modal Backdrop
   ============================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* ============================================
   缺失的 CSS 類（Missing Classes）
   ============================================ */

.gradient-text {
  background: linear-gradient(135deg, var(--primary-color), #7c3aed, #ec489b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-search-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 2rem;
}

.hero-search-box {
  display: flex;
  gap: 0.5rem;
  width: 100%;
  max-width: 600px;
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 0.5rem;
  transition: border-color var(--transition-fast);
}

.hero-search-box:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

.features-section {
  padding: 3rem 1rem;
}

/* ============================================
    表單輔助類 & 社交登入
    ============================================ */

.form-message {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.875rem;
  min-height: 1.25rem;
}

.form-links {
  display: flex;
  justify-content: space-between;
  margin-top: 1.25rem;
  font-size: 0.875rem;
}

.link-accent {
  color: var(--primary-color);
  text-decoration: none;
}

.link-accent:hover {
  text-decoration: underline;
}

.link a {
  color: var(--primary-color);
  text-decoration: none;
}

.link a:hover {
  text-decoration: underline;
}

/* Social login */
.social-login-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.social-login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.social-login-btn:hover {
  background: var(--card-bg);
  border-color: var(--primary-color);
}

.social-login-btn .icon {
  display: flex;
  align-items: center;
}

.social-login-divider {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  margin: 1rem 0;
  position: relative;
}

.social-login-divider::before,
.social-login-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc(50% - 2rem);
  height: 1px;
  background: var(--border-color);
}

.social-login-divider::before {
  left: 0;
}

.social-login-divider::after {
  right: 0;
}

/* Password wrapper */
.password-wrapper {
  position: relative;
}

.password-wrapper input {
  padding-right: 2.75rem;
}

.password-toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
}

.password-toggle:hover {
  color: var(--text-primary);
}

/* Modal variants */
.modal-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  position: relative;
}

.modal-title {
  text-align: center;
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
  color: var(--text-primary);
}

.modal-desc {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}

.modal-input-group {
  margin-bottom: 1rem;
}

.modal-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.9375rem;
  background: var(--input-bg);
  color: var(--text-primary);
}

.modal-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

.btn-block {
  display: block;
  width: 100%;
}

/* ============================================
    個人資料（Profile）
    ============================================ */

/* Stats Grid (Member Dashboard) */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
}

.stat-card h3 {
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-color);
  margin: 0;
}

.quick-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.quick-actions .btn-primary,
.quick-actions .btn-secondary {
  flex: 1;
  min-width: 120px;
  justify-content: center;
}

.profile-container {
  max-width: 600px;
  margin: 2rem auto;
}

.profile-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.profile-card h2 {
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  color: var(--text-primary);
}

.profile-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

.info-item:last-child {
  border-bottom: none;
}

.info-item label {
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.info-item span {
  color: var(--text-primary);
  font-weight: 500;
}

/* ============================================
   歷史記錄（History）
   ============================================ */

.history-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.history-table th,
.history-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.history-table th {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.history-table td {
  color: var(--text-primary);
  font-size: 0.875rem;
}

.history-table tr:hover td {
  background: var(--card-bg);
}

.history-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
}

/* ============================================
    登入/註冊頁面佈局
    ============================================ */

.auth-layout {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
}

.auth-layout .form-card h1 {
  margin: 0 0 24px;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  color: var(--text-primary);
}

.auth-layout .btn-primary {
  width: 100%;
}

/* ============================================
   會員頁面（Member）
   ============================================ */

/* Page wrapper */
/* ============================================
   会员中心 (Member Center) — 设计系统
   ============================================ */

/* --- Page Container --- */
.member-page {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 55px 24px 0;
}

/* ============================================
   Topbar — 个人资料栏 + Tab 导航
   ============================================ */

.member-topbar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: 0 0 20px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 28px;
}

/* Left section: avatar + name + badge */
.member-topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.member-topbar-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.member-topbar-info h1 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
}

.member-email {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.3;
}

/* Avatar — 渐变圆环 */
.member-avatar-ring {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  padding: 2.5px;
  background: var(--primary-gradient);
  flex-shrink: 0;
  position: relative;
}

.member-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.member-avatar span {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color);
  user-select: none;
}

/* Badge — 身份标签 */
.member-badge {
  display: inline-block;
  padding: 3px 10px;
  background: var(--primary-light);
  color: var(--primary-color);
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  width: fit-content;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

.member-badge.free {
  background: var(--bg-secondary);
  color: var(--text-muted);
}

/* ============================================
   Tab 导航
   ============================================ */

.member-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.03);
  width: 100%;
  justify-content: center;
  position: relative;
  z-index: 1;
  align-self: center;
}

[data-theme="dark"] .member-tabs {
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.15);
}

.tab-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  transition: all var(--transition-fast);
  border: none;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
}

.tab-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.tab-item:hover {
  color: var(--text-primary);
  background: var(--card-bg);
}

.tab-item:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 1px;
  border-radius: var(--radius-sm);
}

.tab-item.active {
  background: var(--card-bg);
  color: var(--primary-color);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* ============================================
   Body / Tab Panels
   ============================================ */

.member-body {
  min-height: 400px;
}

.member-tab {
  display: none;
}

.member-tab.active {
  display: block;
  animation: tabFadeIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================
   Card 组件
   ============================================ */

.member-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--box-shadow);
  margin-bottom: 1.5rem;
  transition: box-shadow var(--transition-normal), transform var(--transition-normal);
}

.member-card:hover {
  box-shadow: var(--box-shadow-hover);
}

.member-card h2 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Card Header — 带图标 */
.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1.25rem;
}

.card-header-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-header-icon svg {
  width: 20px;
  height: 20px;
}

.card-header-icon--primary { background: var(--primary-light); color: var(--primary-color); }
.card-header-icon--success { background: var(--success-bg); color: var(--success-color); }
.card-header-icon--warning { background: var(--warning-bg); color: var(--warning-color); }
.card-header-icon--info { background: var(--info-bg); color: var(--info-color); }
.card-header-icon--error { background: var(--error-bg); color: var(--error-color); }

.card-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.card-subtitle {
  margin: 2px 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ============================================
   Welcome 卡片 — 渐变 Hero
   ============================================ */

.welcome-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: white;
  padding: 2rem 2.25rem;
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.welcome-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

.welcome-card h2 {
  color: white;
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 6px;
  position: relative;
  z-index: 1;
}

.welcome-card p {
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
  font-size: 0.9rem;
  position: relative;
  z-index: 1;
}

[data-theme="dark"] .welcome-card {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
} 

/* ============================================
   Stats 统计卡片
   ============================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all var(--transition-normal);
}

.stat-card:hover {
  box-shadow: var(--box-shadow-hover);
  transform: translateY(-2px);
}

.stat-card.highlight {
  border-color: var(--primary-color);
  background: linear-gradient(135deg, var(--primary-light), var(--card-bg));
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon svg {
  width: 22px;
  height: 22px;
}

.stat-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ============================================
   Dashboard Grid — 2 列布局
   ============================================ */

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.dashboard-card h2 {
  margin-bottom: 1rem;
}

/* Sign-in CTA */
.dash-signin {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dash-signin p {
  color: var(--text-secondary);
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

#dashSigninBtn {
  align-self: flex-start;
}

/* ============================================
   Recent Parses — 最近解析列表
   ============================================ */

.dash-recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

.dash-recent-item:first-child {
  padding-top: 0;
}

.dash-recent-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.dash-recent-thumb {
  width: 52px;
  height: 36px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-secondary);
}

.dash-recent-info {
  flex: 1;
  min-width: 0;
}

.dash-recent-info h4 {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-recent-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 2px 0 0;
}

.dash-recent-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: 8px;
}

.dash-credit-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dash-credit-icon svg {
  width: 16px;
  height: 16px;
}
.dash-credit-icon.income { background: var(--success-bg); color: var(--success-color); }
.dash-credit-icon.expense { background: var(--error-bg); color: var(--error-color); }

.dash-credit-amount {
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: 8px;
}
.dash-credit-amount.positive { color: var(--success-color); }
.dash-credit-amount.negative { color: var(--error-color); }

/* ============================================
   Dashboard — Recent Parses (Table)
   ============================================ */

.recent-parses-card .card-subtitle,
#tab-recent .card-subtitle {
  font-size: 0.78rem;
  color: var(--warning-color);
  margin-top: 0;
}

.rp-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.rp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.rp-table thead th {
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

.rp-table tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition-fast);
}

.rp-table tbody tr:hover {
  background: var(--bg-secondary);
}

.rp-table tbody tr:last-child {
  border-bottom: none;
}

.rp-table td {
  padding: 8px 10px;
  vertical-align: middle;
}

.rp-thumb-cell {
  width: 80px;
}

.rp-thumb {
  width: 72px;
  height: 50px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  display: block;
  background: var(--bg-secondary);
}

.rp-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.rp-thumb-placeholder svg {
  width: 20px;
  height: 20px;
}

.rp-thumb-link {
  display: inline-block;
  line-height: 0;
  transition: opacity var(--transition-fast);
}

.rp-thumb-link:hover {
  opacity: 0.85;
}

.rp-title-cell {
  max-width: 280px;
}

.rp-title-link {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--transition-fast);
}

.rp-title-link:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

.rp-title-text {
  color: var(--text-primary);
  font-weight: 500;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rp-url-cell {
  max-width: 300px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.rp-url-link {
  color: var(--primary-color);
  text-decoration: none;
}
.rp-url-link:hover {
  text-decoration: underline;
}

.rp-platform-cell {
  width: 80px;
}

/* Mobile: recent parses table */
@media (max-width: 600px) {
  .rp-table thead th:nth-child(3),
  .rp-table tbody td:nth-child(3) {
    display: none;
  }
  .rp-thumb-cell {
    width: 56px;
  }
  .rp-thumb {
    width: 50px;
    height: 36px;
  }
  .rp-table {
    font-size: 0.78rem;
  }
  .rp-table td,
  .rp-table th {
    padding: 6px 6px;
  }
  .rp-title-cell {
    max-width: 160px;
  }
}

/* ============================================
   Profile 表单
   ============================================ */

.member-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-group input,
.form-group select {
  padding: 10px 14px;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-family: var(--font-family);
  color: var(--text-primary);
  background: var(--input-bg);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-info {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin: 0;
  padding: 2px 0;
}

.form-readonly {
  opacity: 0.6;
  cursor: not-allowed;
  background: var(--bg-secondary) !important;
}

.btn-save {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ============================================
   Credits Summary — 积分概览
   ============================================ */

.credits-summary-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 1.5rem;
}

.credit-stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.credit-stat-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 0 2px 2px 0;
}

.credit-stat-card.balance::before { background: var(--primary-color); }
.credit-stat-card.income::before { background: var(--success-color); }
.credit-stat-card.expense::before { background: var(--error-color); }

.credit-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--box-shadow);
}

.credit-stat-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.credit-stat-card.balance .credit-stat-icon { background: var(--primary-light); color: var(--primary-color); }
.credit-stat-card.income .credit-stat-icon { background: var(--success-bg); color: var(--success-color); }
.credit-stat-card.expense .credit-stat-icon { background: var(--error-bg); color: var(--error-color); }

.credit-stat-icon svg {
  width: 18px;
  height: 18px;
}

.credit-stat-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.credit-stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.credit-stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ============================================
   Credits List — 积分明细
   ============================================ */

.credits-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.credit-log-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.credit-log-item:hover {
  background: var(--hover-bg);
}

.credit-log-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.credit-log-icon svg {
  width: 16px;
  height: 16px;
}

.credit-log-icon.income { background: var(--success-bg); color: var(--success-color); }
.credit-log-icon.expense { background: var(--error-bg); color: var(--error-color); }

.credit-log-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.credit-log-body,
.credit-log-info {
  flex: 1;
  min-width: 0;
}

.credit-log-body h4,
.credit-log-info h4 {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.credit-log-body p,
.credit-log-info p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 2px 0 0;
}

.credit-log-url {
  margin: 2px 0 4px !important;
}
.credit-log-url a {
  font-size: 0.72rem;
  color: var(--primary-color);
  text-decoration: none;
  word-break: break-all;
  opacity: 0.85;
  transition: opacity var(--transition-fast);
}
.credit-log-url a:hover {
  opacity: 1;
  text-decoration: underline;
}

.credit-log-amount {
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.credit-log-amount.positive { color: var(--success-color); }
.credit-log-amount.negative { color: var(--error-color); }

/* ============================================
   Benefits — 会员权益
   ============================================ */

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.benefit-item {
  text-align: center;
  padding: 1.5rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.benefit-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--box-shadow);
  border-color: var(--border-color);
}

.benefit-icon {
  width: 50px;
  height: 50px;
  margin: 0 auto 14px;
  background: var(--primary-light);
  color: var(--primary-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.benefit-icon svg {
  width: 26px;
  height: 26px;
}

.benefit-item h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 6px;
}

.benefit-item p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

/* ============================================
   Plans — 订阅方案
   ============================================ */

.plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.plan-card {
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  text-align: center;
  transition: all var(--transition-normal);
  position: relative;
  display: flex;
  flex-direction: column;
}

.plan-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.plan-card.featured {
  border-color: var(--primary-color);
  background: linear-gradient(180deg, var(--primary-light), var(--card-bg));
  box-shadow: 0 4px 24px rgba(99, 102, 241, 0.12);
}

.plan-card.featured:hover {
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.25);
}

.plan-top h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 10px;
}

.plan-price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
}

.price-currency {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.price-amount {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.02em;
}

.price-period {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.plan-saving {
  display: inline-block;
  margin-top: 10px;
  padding: 3px 12px;
  background: var(--success-bg);
  color: var(--success-color);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 18px 0;
  text-align: left;
  flex: 1;
}

.plan-features li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.feature-check {
  width: 16px;
  height: 16px;
  color: var(--success-color);
  flex-shrink: 0;
}

.plan-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 14px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

.plan-badge.recommend {
  background: var(--primary-color);
  color: white;
}

.plan-badge.coming-soon {
  background: var(--warning-bg);
  color: var(--warning-color);
  position: static;
  transform: none;
  display: inline-block;
  margin: 0 auto 12px;
  width: fit-content;
}

.btn-plan {
  width: 100%;
  padding: 11px;
  border: 2px solid var(--primary-color);
  background: transparent;
  color: var(--primary-color);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-top: auto;
}

.btn-plan:hover:not(:disabled) {
  background: var(--primary-color);
  color: white;
}

.btn-plan:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-plan.btn-featured {
  background: var(--primary-color);
  color: white;
}

.btn-plan.btn-featured:hover:not(:disabled) {
  background: var(--primary-hover);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}

/* ============================================
   Subscription Status — 订阅状态
   ============================================ */

.subscription-status-card {
  padding: 1.5rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  text-align: center;
}

.subscription-status-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.sub-status-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sub-status-icon svg {
  width: 28px;
  height: 28px;
}

.subscription-status-content.active .sub-status-icon {
  background: var(--success-bg);
  color: var(--success-color);
}

.subscription-status-content.inactive .sub-status-icon {
  background: var(--card-bg);
  color: var(--text-muted);
  border: 2px solid var(--border-color);
}

/* ============================================
   History List — 解析历史
   ============================================ */

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.history-item:hover {
  background: var(--hover-bg);
  transform: translateX(2px);
}

.history-thumb {
  width: 72px;
  height: 46px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-secondary);
}

.history-info {
  flex: 1;
  min-width: 0;
}

.history-info h4 {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-info p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 3px 0 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.history-platform {
  color: var(--text-muted);
}

.history-platform + .history-duration::before {
  content: '·';
  color: var(--border-color);
  margin-right: 6px;
}

.history-duration {
  color: var(--text-muted);
  background: transparent;
  padding: 0;
}

.history-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex-shrink: 0;
  margin-left: 8px;
}

.history-date {
  font-size: 0.76rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ============================================
   Pagination — 分页
   ============================================ */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
}

.pagination button {
  padding: 7px 16px;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pagination button:hover:not(:disabled) {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.pagination button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.pagination button.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.page-info {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 0 6px;
  font-weight: 500;
}

/* ============================================
   Loading / Empty / Status
   ============================================ */

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 2rem auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 2rem 0;
  text-align: center;
}

.empty-state svg {
  width: 40px;
  height: 40px;
  color: var(--text-muted);
  opacity: 0.35;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin: 0;
}

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
}

.status-badge.success { background: var(--success-bg); color: var(--success-color); }
.status-badge.warning { background: var(--warning-bg); color: var(--warning-color); }
.status-badge.error { background: var(--error-bg); color: var(--error-color); }

/* Quick actions (legacy, standalone dashboard) */
.quick-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 1rem;
}

/* ============================================
   Responsive — 1024px (Tablet)
   ============================================ */

@media (max-width: 1024px) {
  .member-page {
    padding: 55px 20px 0;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .benefits-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .plans-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .credits-summary-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .member-topbar {
    gap: 16px;
  }

  .member-tabs {
    flex: none;
    width: 100%;
  }
}

/* ============================================
   Responsive — 768px (Large Mobile)
   ============================================ */

@media (max-width: 768px) {
  .member-page {
    padding: 55px 14px 0;
  }

  .member-topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 0 0 14px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border-color);
  }

  .member-topbar-left {
    gap: 10px;
  }

  .member-avatar-ring {
    width: 40px;
    height: 40px;
    padding: 2px;
  }

  .member-avatar span {
    font-size: 1rem;
  }

  .member-topbar-info h1 {
    font-size: 1rem;
  }

  .member-topbar-info .member-email {
    display: none;
  }

  .member-badge {
    font-size: 0.65rem;
    padding: 2px 8px;
  }

  .member-tabs {
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    order: 3;
    background: var(--bg-secondary);
    align-self: center;
  }

  .tab-item {
    padding: 7px 12px;
    font-size: 0.78rem;
    gap: 5px;
  }

  .tab-item span {
    display: inline; /* keep text on tablet */
  }

  .tab-item svg {
    width: 14px;
    height: 14px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .stat-card {
    padding: 0.85rem;
    gap: 10px;
  }

  .stat-icon {
    width: 38px;
    height: 38px;
  }

  .stat-icon svg {
    width: 18px;
    height: 18px;
  }

  .stat-value {
    font-size: 1.2rem;
  }

  .stat-label {
    font-size: 0.72rem;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .member-card {
    padding: 1.15rem;
    margin-bottom: 1rem;
  }

  .credits-summary-cards {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .credit-stat-card {
    padding: 0.9rem;
  }

  .benefits-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .benefit-item {
    padding: 1.15rem 0.75rem;
  }

  .benefit-icon {
    width: 42px;
    height: 42px;
  }

  .benefit-icon svg {
    width: 22px;
    height: 22px;
  }

  .benefit-item h3 {
    font-size: 0.88rem;
  }

  .benefit-item p {
    font-size: 0.78rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .form-group input,
  .form-group select {
    font-size: 16px;
  }

  .plan-card {
    padding: 1.2rem;
  }

  .price-amount {
    font-size: 1.65rem;
  }

  .history-item {
    padding: 10px 12px;
  }

  .history-thumb {
    width: 56px;
    height: 38px;
  }

  .welcome-card {
    padding: 1.35rem;
  }

  .welcome-card h2 {
    font-size: 1.15rem;
  }
}

/* ============================================
   Responsive — 480px (Small Mobile)
   ============================================ */

@media (max-width: 480px) {
  .member-page {
    padding: 55px 10px 0;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .stat-card {
    padding: 0.7rem;
    gap: 8px;
  }

  .stat-icon {
    width: 34px;
    height: 34px;
  }

  .stat-icon svg {
    width: 16px;
    height: 16px;
  }

  .stat-value {
    font-size: 1.05rem;
  }

  .stat-label {
    font-size: 0.68rem;
  }

  .tab-item {
    padding: 6px 10px;
    font-size: 0.72rem;
    gap: 4px;
  }

  .tab-item span {
    display: none;
  }

  .tab-item svg {
    width: 16px;
    height: 16px;
    margin: 0;
  }

  .benefits-grid {
    grid-template-columns: 1fr;
  }

  .plans-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .member-card,
  .plan-card {
    padding: 0.9rem;
  }

  .member-topbar {
    gap: 8px 10px;
    padding: 0 0 10px;
  }

  .member-tabs {
    gap: 2px;
    padding: 3px;
    justify-content: center;
  }

  .welcome-card {
    padding: 1.1rem;
  }

  .welcome-card h2 {
    font-size: 1.05rem;
  }

  .history-item {
    padding: 8px 10px;
    gap: 10px;
  }

  .history-thumb {
    width: 48px;
    height: 34px;
  }

  .history-info h4 {
    font-size: 0.82rem;
  }

  .credit-log-item {
    padding: 10px 12px;
    gap: 8px;
  }

  .credit-log-left {
    gap: 8px;
  }

  .credit-log-info h4 {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
    max-height: 2.2em;
  }

  .credit-log-url {
    margin: 0 !important;
  }

  .credit-log-url a {
    font-size: 0.65rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
    display: inline-block;
    vertical-align: middle;
  }

  .credit-log-amount {
    font-size: 0.9rem;
  }

  .dash-recent-item {
    gap: 8px;
  }

  .dash-recent-info h4 {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .dash-credit-amount {
    font-size: 0.8rem;
  }

  .pagination button {
    padding: 6px 12px;
    font-size: 0.78rem;
  }

  .card-header {
    gap: 10px;
  }

  .card-header-icon {
    width: 34px;
    height: 34px;
  }

  .card-header-icon svg {
    width: 17px;
    height: 17px;
  }
}

/* ============================================
   管理後台（Admin）— Member-style 设计
   ============================================ */

/* --- Page Container --- */
.admin-page {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 55px 24px 0;
}

/* --- Topbar — 头像 + Tab 导航 --- */
.admin-topbar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: 0 0 20px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 28px;
}

.admin-topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.admin-topbar-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.admin-topbar-info h1 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
}

.admin-topbar-info .admin-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.3;
}

/* Avatar — 盾牌图标 + 渐变圆环 */
.admin-avatar-ring {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  padding: 2.5px;
  background: var(--primary-gradient);
  flex-shrink: 0;
  position: relative;
}

.admin-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.admin-avatar svg {
  width: 26px;
  height: 26px;
  color: var(--primary-color);
}

/* --- Tab 导航 --- */
.admin-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  justify-content: center;
  position: relative;
  z-index: 1;
  align-self: center;
}

[data-theme="dark"] .admin-tabs {
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.15);
}

.admin-tabs .tab-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  transition: all var(--transition-fast);
  border: none;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
}

.admin-tabs .tab-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.admin-tabs .tab-item:hover {
  color: var(--text-primary);
  background: var(--card-bg);
}

.admin-tabs .tab-item:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 1px;
  border-radius: var(--radius-sm);
}

.admin-tabs .tab-item.active {
  background: var(--card-bg);
  color: var(--primary-color);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* --- Body --- */
.admin-body {
  min-height: 400px;
}

/* --- Admin Section (content area card) --- */
.admin-section {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--box-shadow);
  margin-bottom: 1.5rem;
  transition: box-shadow var(--transition-normal), transform var(--transition-normal);
}

.admin-section h2 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-section h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Admin actions toolbar */
.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.admin-toolbar input[type="text"],
.admin-toolbar select {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text-primary);
  font-size: 0.85rem;
}

.admin-toolbar input[type="text"]:focus,
.admin-toolbar select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

/* Admin actions row (buttons) */
.admin-actions {
  display: flex;
  gap: 12px;
  margin: 1rem 0;
}

/* Status grid (system status cards) */
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--input-bg);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.online {
  background: var(--success-color);
  box-shadow: 0 0 8px rgba(16,185,129,0.4);
}

.status-dot.offline {
  background: var(--error-color);
}

.status-dot.checking {
  background: var(--warning-color);
  animation: pulse 1s infinite;
}

/* Platform stats cards — 今日解析统计（按平台） */
.platform-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.platform-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  text-align: center;
  transition: all var(--transition-fast);
}

.platform-stat-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.platform-stat-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.platform-stat-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.platform-stat-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.platform-stat-count {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.platform-stat-label {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Platform-specific colors */
.platform-stat-card[data-platform="youtube"] .platform-stat-icon { background: rgba(255,0,0,0.1); color: #ff0000; }
.platform-stat-card[data-platform="douyin"] .platform-stat-icon { background: rgba(0,0,0,0.06); color: var(--text-primary); }
.platform-stat-card[data-platform="bilibili"] .platform-stat-icon { background: rgba(0,161,214,0.1); color: #00a1d6; }
.platform-stat-card[data-platform="tiktok"] .platform-stat-icon { background: rgba(0,0,0,0.06); color: var(--text-primary); }
.platform-stat-card[data-platform="instagram"] .platform-stat-icon { background: rgba(225,48,108,0.1); color: #e1306c; }

/* Parsers grid */
.parsers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.parser-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.parser-card .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.parser-card .name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.parser-card .status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.parser-card .info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  font-size: 0.8rem;
}

.parser-card .info .label {
  color: var(--text-muted);
}

.parser-card .info .value {
  color: var(--text-primary);
  font-weight: 500;
  text-align: right;
}

/* Refresh info bar */
.refresh-info {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 1rem;
}

/* Admin search bar */
.search-bar {
  margin-bottom: 1rem;
}

.search-bar input {
  width: 100%;
  max-width: 400px;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text-primary);
  font-size: 0.9rem;
}

.search-bar input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

/* Admin table */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.admin-table th,
.admin-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.admin-table th {
  background: var(--input-bg);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-table td {
  color: var(--text-primary);
  font-size: 0.875rem;
}

/* Responsive — Mobile */
@media (max-width: 768px) {
  .admin-page {
    padding: 20px 16px 0;
  }

  .admin-topbar {
    gap: 12px;
  }

  .admin-tabs {
    gap: 2px;
    padding: 3px;
    justify-content: flex-start;
  }

  .admin-tabs .tab-item {
    padding: 7px 12px;
    font-size: 0.78rem;
  }

  .admin-tabs .tab-item svg {
    width: 14px;
    height: 14px;
  }

  .admin-tabs .tab-item span {
    display: none;
  }

  .admin-tabs .tab-item.active span,
  .admin-tabs .tab-item:hover span {
    display: inline;
  }

  .parsers-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .admin-page {
    padding: 16px 12px 0;
  }

  .admin-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
  }

  .admin-tabs .tab-item {
    padding: 6px 10px;
    font-size: 0.75rem;
  }
}

/* ============================================
   FAQ 页面样式
   ============================================ */
.faq-card {
  max-width: 800px;
  margin: 40px auto;
  padding: 32px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--box-shadow);
  border: 1px solid var(--border-color);
}

.faq-title {
  margin: 0 0 24px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
}

.faq-list {
  line-height: 1.8;
  color: var(--text-secondary);
}

.faq-item {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
}

.faq-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.faq-question {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.faq-answer {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ============================================
    首頁額外組件（Index Page Extras）
    ============================================ */

.latest-parses {
  margin-top: 2rem;
}

/* 示例快捷链接 */
.example-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
}

.example-link-label {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 32px;
}

.example-link-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-family);
}

.example-link-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: var(--primary-light);
}

/* 积分信息横幅 */
.credit-info-banner {
  text-align: center;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

/* 社交证明统计数据 */
.social-proof {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.social-proof-item {
  text-align: center;
}

.social-proof .stat-number {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-color);
}

.social-proof .stat-label {
  font-size: 12px;
  color: var(--text-muted);
}

/* 功能卡片徽章 */
.feature-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--primary-color);
  color: white;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}

.ad-banner {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: var(--card-bg);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.btn-secondary:hover {
  background: var(--input-bg);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* ============================================
   User Dropdown Menu
   ============================================ */

.user-dropdown {
  position: relative;
  display: inline-block;
}

.user-dropdown-trigger {
  background: none;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  padding: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.user-dropdown-trigger:hover {
  border-color: var(--primary-color);
  transform: scale(1.05);
}

.user-dropdown-menu {
  display: none;
  position: fixed;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 240px;
  z-index: 10001;
  animation: dropdownSlideIn var(--transition-fast);
}

.user-dropdown-menu.show {
  display: block;
}

.user-dropdown-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  text-align: center;
}

.user-dropdown-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.user-dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.user-dropdown-item:hover {
  background: var(--hover-bg);
  color: var(--primary-color);
}

.user-dropdown-item svg {
  flex-shrink: 0;
}

.user-dropdown-logout {
  color: var(--error-color);
}

.user-dropdown-logout:hover {
  background: var(--error-bg);
}

@keyframes dropdownSlideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 移動端下拉菜單適配 */
@media (max-width: 768px) {
  .user-dropdown-menu {
    min-width: auto;
    left: 10px;
    right: 10px;
  }
}

/* ============================================
   Back to Top 按钮
   ============================================ */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

.back-to-top svg {
  width: 20px;
  height: 20px;
}
