/* ============================================
   AI LOBSTER GRID ?Cyberpunk Theme
   Cyan #00d4ff + Purple #7c5cff
   ============================================ */

/* === Reset & Base === */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

:root {
  --bg-0: #050510;
  --bg-1: #0a0a1a;
  --bg-2: #0f0f23;
  --bg-3: rgba(15,15,35,0.85);
  --bg-4: rgba(25,25,50,0.6);
  --border: rgba(0,212,255,0.08);
  --border-hover: rgba(0,212,255,0.2);
  --text-0: #ffffff;
  --text-1: #a0a0c0;
  --text-2: #505070;
  --text-3: #3a3a5a;
  --accent: #00d4ff;
  --accent-hover: #00b8e6;
  --accent-dim: rgba(0,212,255,0.1);
  --ice: #00d4ff;
  --purple: #7c5cff;
  --green: #10B981;
  --yellow: #FBBF24;
  --red: #F87171;
  --gradient-main: linear-gradient(135deg, #00d4ff 0%, #7c5cff 100%);
  --gradient-accent: linear-gradient(135deg, #7c5cff 0%, #00d4ff 100%);
  --gradient-hero: linear-gradient(135deg, rgba(0,212,255,0.06) 0%, rgba(124,92,255,0.04) 50%, transparent 100%);
  --shadow-glow: 0 0 20px rgba(0,212,255,0.15);
  --shadow-card: 0 4px 24px rgba(0,0,0,0.4);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --nav-height: 64px;
  --font-body: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Orbitron', 'Noto Sans TC', 'SF Mono', monospace;
  --font-num: 'Noto Sans TC', 'Orbitron', 'SF Mono', monospace;
  --font-display: 'Orbitron', 'Noto Sans TC', sans-serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg-0);
  color: var(--text-0);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === Page System === */
#app {
  position: relative;
  min-height: 100vh;
  z-index: 1;
}

.page {
  display: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.page.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.page-top {
  padding: 48px 24px 24px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

.page-top h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-0);
  letter-spacing: -0.02em;
}

.page-top p {
  color: var(--text-2);
  margin-top: 4px;
  font-size: 0.875rem;
}

.placeholder-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  text-align: center;
}

.placeholder-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius);
  background: var(--bg-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.placeholder-icon svg {
  width: 28px;
  height: 28px;
  stroke: var(--text-2);
}

.placeholder-page p {
  color: var(--text-2);
  font-size: 0.875rem;
}

.page-footer-space {
  height: calc(var(--nav-height) + 24px);
}

/* === Top Bar === */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 56px;
  background: rgba(5,5,16,0.9);
  backdrop-filter: blur(12px) saturate(180%);
  border-bottom: 1px solid rgba(0,212,255,0.1);
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-img {
  width: 28px;
  height: 28px;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-name {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-0);
  letter-spacing: 0.04em;
}

/* === Bottom Nav === */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--nav-height);
  display: flex;
  align-items: stretch;
  background: rgba(5,5,16,0.95);
  backdrop-filter: blur(16px) saturate(180%);
  border-top: 1px solid rgba(0,212,255,0.1);
  box-shadow: 0 -4px 30px rgba(0,0,0,0.4);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 500;
  transition: color var(--transition);
  position: relative;
}

.nav-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--transition);
}

.nav-item.active {
  color: var(--accent);
}

.nav-item.active::before {
  width: 32px;
}

.nav-item:hover {
  color: var(--text-1);
}

.nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.5;
}

.nav-center {
  position: relative;
}

.nav-center .nav-icon {
  width: 36px;
  height: 36px;
  background: var(--bg-2);
  border: 1px solid rgba(0,212,255,0.15);
  border-radius: 50%;
  margin-top: -12px;
  box-shadow: 0 0 12px rgba(0,212,255,0.1);
  transition: all var(--transition);
}

.nav-center .nav-icon:hover {
  background: var(--bg-3);
  border-color: rgba(0,212,255,0.25);
  box-shadow: 0 0 18px rgba(0,212,255,0.15);
}

.nav-center .nav-icon svg {
  stroke: var(--text-2);
  width: 18px;
  height: 18px;
}

.nav-center.active .nav-icon {
  background: rgba(0,212,255,0.08);
  border-color: rgba(0,212,255,0.3);
  box-shadow: 0 0 20px rgba(0,212,255,0.2);
}

.nav-center.active .nav-icon svg {
  stroke: var(--accent);
}

/* === Hero === */
.hero {
  position: relative;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 24px 80px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  /* 龍蝦圖：偏上顯示，裁掉底部文字區，暗化透出 */
  background: url('assets/hero-bg.jpg') center 20% / cover no-repeat;
  pointer-events: none;
  opacity: 0.35;
}

/* Full dark gradient overlay for text readability */
.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(5,5,16,0.6) 0%,
    rgba(5,5,16,0.5) 30%,
    rgba(5,5,16,0.8) 70%,
    rgba(5,5,16,1) 100%);
  pointer-events: none;
}

/* Subtle cyan glow on top */
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 60% 30%, rgba(0,212,255,0.08), transparent),
    radial-gradient(ellipse 40% 30% at 30% 50%, rgba(124,92,255,0.05), transparent);
  pointer-events: none;
}



.hero-content {
  position: relative;
  z-index: 2;
  max-width: 540px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 100px;
  background: var(--accent-dim);
  border: 1px solid rgba(0,212,255,0.2);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse-dot 2s ease infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 4px var(--accent); }
  50% { opacity: 0.3; box-shadow: none; }
}

.hero-title {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.title-line {
  display: block;
  color: var(--text-0);
}

.title-line.accent {
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  display: inline-block;
}

.title-line.accent::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--gradient-main);
  border-radius: 2px;
  opacity: 0.7;
}

.hero-sub {
  font-size: 0.9rem;
  color: var(--text-1);
  line-height: 1.7;
  margin-bottom: 28px;
  max-width: 400px;
}

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

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius);
  background: var(--gradient-main);
  color: #fff;
  border: none;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-primary:hover {
  box-shadow: 0 0 20px rgba(0,212,255,0.3), 0 0 40px rgba(124,92,255,0.15);
  transform: translateY(-1px);
}

/* Hero stats bar ?now between hero and metrics section */
.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 0 20px;
  padding: 16px 20px;
  background: rgba(10,10,26,0.85);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0,212,255,0.1);
  border-radius: var(--radius);
}

.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0 24px;
}

.stat-num {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-unit {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  margin-left: 2px;
  opacity: 0.7;
}

.stat-label {
  font-size: 0.65rem;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hero-stat-divider {
  width: 1px;
  height: 28px;
  background: rgba(0,212,255,0.15);
}

/* === Sections === */
.section {
  padding: 40px 20px;
}

.section-dark {
  background: var(--bg-1);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-header {
  margin-bottom: 24px;
}

.section-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.section-tag.light {
  background: rgba(255,255,255,0.06);
  color: var(--text-1);
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-0);
  letter-spacing: -0.01em;
}

.section-title.light {
  color: var(--text-0);
}

/* === Metrics Grid (KPI Cards) === */
.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.metric-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition);
  backdrop-filter: blur(10px);
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-main);
  opacity: 0.6;
}

.metric-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 0 15px rgba(0,212,255,0.08);
}

.metric-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.metric-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-2);
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-0);
  letter-spacing: -0.02em;
}

.metric-plus {
  font-size: 0.8rem;
  color: var(--accent);
  margin-left: 1px;
}

.metric-label {
  font-size: 0.7rem;
  color: var(--text-2);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-bar {
  height: 3px;
  background: var(--bg-3);
  border-radius: 2px;
  margin-top: 10px;
  overflow: hidden;
}

.metric-fill {
  height: 100%;
  background: var(--gradient-main);
  border-radius: 2px;
  transition: width 1s ease;
}

/* === Capability Cards === */
.capability-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cap-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color var(--transition);
  backdrop-filter: blur(10px);
}

.cap-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 0 15px rgba(0,212,255,0.08);
}

.cap-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.cap-icon-wrap.blue { background: var(--accent-dim); }
.cap-icon-wrap.purple { background: rgba(124,92,255,0.12); }
.cap-icon-wrap.cyan { background: rgba(0,212,255,0.12); }

.cap-icon-wrap svg {
  width: 20px;
  height: 20px;
}

.cap-icon-wrap.blue svg { stroke: var(--accent); }
.cap-icon-wrap.purple svg { stroke: var(--purple); }
.cap-icon-wrap.cyan svg { stroke: var(--ice); }

.cap-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-0);
  margin-bottom: 6px;
}

.cap-desc {
  font-size: 0.8rem;
  color: var(--text-1);
  line-height: 1.6;
}

.cap-tags {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.cap-tags span {
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--bg-3);
  font-size: 0.65rem;
  color: var(--text-2);
  font-weight: 500;
}

/* === Demo Tabs === */
.demo-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.demo-tab {
  padding: 10px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}

.demo-tab:hover {
  color: var(--text-1);
}

.demo-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.demo-panel {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.demo-content {
  display: none;
  padding: 20px;
}

.demo-content.active {
  display: block;
}

.demo-visual {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 14px;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.demo-content h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-0);
  margin-bottom: 4px;
}

.demo-content p {
  font-size: 0.78rem;
  color: var(--text-2);
  line-height: 1.5;
}

/* Chart placeholder */
.chart-placeholder {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 120px;
  width: 100%;
}

.mini-bar {
  flex: 1;
  background: var(--accent-dim);
  border-radius: 3px 3px 0 0;
  min-height: 20px;
  transition: height 0.5s ease;
}

/* Chat demo */
.chat-demo {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.chat-bubble {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.8rem;
  line-height: 1.5;
  max-width: 85%;
}

.chat-bubble.user {
  background: var(--gradient-main);
  color: #fff;
  align-self: flex-end;
}

.chat-bubble.ai {
  background: var(--bg-3);
  color: var(--text-1);
}

/* Shield demo */
.shield-demo {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.shield-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: rgba(16,185,129,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.shield-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--green);
}

.threat-log {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.threat-item {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  padding: 3px 0;
}

.threat-item.safe { color: var(--green); }
.threat-item.warning { color: var(--yellow); }

/* Image recognition demo */
.image-recog {
  position: relative;
  width: 100%;
  height: 140px;
  background: var(--bg-3);
  border-radius: var(--radius-sm);
}

.recog-box {
  position: absolute;
  border: 1.5px solid var(--accent);
  border-radius: 4px;
}

.recog-box span {
  position: absolute;
  top: -18px;
  left: 0;
  background: var(--gradient-main);
  color: #fff;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.6rem;
  font-weight: 600;
  font-family: var(--font-mono);
  white-space: nowrap;
}

/* Canvas */
#neuralCanvas {
  width: 100%;
  height: 160px;
}

/* === App Grid (OpenAI applications) === */
.app-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.app-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color var(--transition);
  backdrop-filter: blur(10px);
}

.app-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 0 15px rgba(0,212,255,0.08);
}

.app-icon {
  margin-bottom: 8px;
  opacity: 0.5;
}

.app-icon svg {
  stroke: var(--text-1);
}

.app-card h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-0);
  margin-bottom: 4px;
}

.app-card p {
  font-size: 0.72rem;
  color: var(--text-2);
  line-height: 1.5;
  margin-bottom: 8px;
}

.app-stat {
  font-size: 0.68rem;
  color: var(--text-1);
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.app-stat strong {
  color: var(--accent);
  font-weight: 700;
}

/* === Spec Table === */
.spec-table {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.spec-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  padding: 11px 16px;
  font-size: 0.78rem;
  border-bottom: 1px solid var(--border);
}

.spec-row:last-child {
  border-bottom: none;
}

.spec-header {
  background: var(--bg-1);
  font-weight: 600;
  color: var(--text-2);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.spec-row span {
  color: var(--text-1);
}

.model-name {
  color: var(--text-0) !important;
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.spec-highlight {
  background: var(--accent-dim);
}

.spec-highlight span {
  color: var(--text-0);
}

/* === Performance Grid === */
.perf-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.perf-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.perf-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-main);
  opacity: 0.4;
}

.perf-value {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-0);
}

.perf-unit {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
}

.perf-label {
  font-size: 0.68rem;
  color: var(--text-2);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* === Pie / Donut Chart === */
.pie-chart-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.donut-chart {
  position: relative;
  width: 180px;
  height: 180px;
}

.donut-chart svg {
  width: 100%;
  height: 100%;
}

.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.donut-total {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-0);
}

.donut-sub {
  font-size: 0.65rem;
  color: var(--text-2);
}

.pie-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  width: 100%;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text-1);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* === Research Table === */
.research-table {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.res-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  padding: 11px 16px;
  font-size: 0.78rem;
  border-bottom: 1px solid var(--border);
}

.res-row:last-child { border-bottom: none; }

.res-header {
  background: var(--bg-1);
  font-weight: 600;
  color: var(--text-2);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.res-row span {
  color: var(--text-1);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

/* === Invest Cards === */
.invest-cards {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.invest-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  backdrop-filter: blur(10px);
}

.invest-flag {
  font-size: 1.5rem;
  margin-bottom: 6px;
}

.invest-amount {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-0);
}

.invest-amount span {
  font-size: 0.7rem;
  color: var(--text-2);
  font-weight: 400;
}

.invest-label {
  font-size: 0.65rem;
  color: var(--text-2);
  margin-top: 2px;
}

.growth-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  background: var(--accent-dim);
  border: 1px solid rgba(0,212,255,0.15);
  border-radius: var(--radius);
  font-size: 0.82rem;
  color: var(--text-1);
}



.growth-num {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent);
  font-size: 1rem;
}

/* === Modal === */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 480px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  backdrop-filter: blur(10px);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-2);
  font-size: 1.2rem;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.modal-close:hover {
  background: var(--bg-3);
  color: var(--text-0);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-0);
}

.modal-body {
  font-size: 0.85rem;
  color: var(--text-1);
  line-height: 1.7;
  white-space: pre-wrap;
}


/* ============================================
   TRAINING PAGE
   ============================================ */
.train-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 16px 20px;
}

.train-stat-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.train-stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}

.train-stat-card.points::before { background: var(--gradient-main); }
.train-stat-card.tasks::before { background: linear-gradient(135deg, var(--green), var(--accent)); }

.tsc-icon { display: none; }

.tsc-value {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-0);
}

.tsc-label {
  font-size: 0.68rem;
  color: var(--text-2);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Daily bar */
.train-daily-bar {
  margin: 0 20px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  backdrop-filter: blur(10px);
}

.tdb-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.tdb-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-1);
}

.tdb-count {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-2);
}

.tdb-count strong {
  color: var(--text-0);
}

.tdb-track {
  height: 4px;
  background: var(--bg-3);
  border-radius: 2px;
  overflow: hidden;
}

.tdb-fill {
  height: 100%;
  background: var(--gradient-main);
  border-radius: 2px;
  transition: width 0.5s ease;
}

.tdb-hint {
  font-size: 0.65rem;
  color: var(--text-3);
  margin-top: 6px;
}

/* Section label */
.train-section-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0 20px;
  margin-bottom: 10px;
}

/* Task cards */
#train-task-list {
  padding: 0 20px;
}

.train-task-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  display: flex;
  align-items: center;
  backdrop-filter: blur(10px);
}

.train-task-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 0 15px rgba(0,212,255,0.08);
}

.train-task-card.disabled {
  opacity: 0.5;
  cursor: default;
}

.train-task-cover {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  background: var(--bg-3) !important;
}

.cover-icon {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-1);
  font-family: var(--font-mono);
  z-index: 2;
}


.cover-tag {
  position: absolute;
  bottom: 2px;
  right: 2px;
  font-size: 0.5rem;
  font-weight: 700;
  color: var(--text-3);
  font-family: var(--font-mono);
  z-index: 2;
}
.cover-done {
  position: absolute;
  inset: 0;
  background: rgba(16,185,129,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--green);
  font-weight: 700;
  z-index: 3;
}

.train-task-body {
  flex: 1;
  padding: 12px 14px;
  min-width: 0;
}

.train-task-body h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-0);
  margin-bottom: 3px;
}

.train-task-meta {
  display: flex;
  gap: 12px;
  font-size: 0.68rem;
  color: var(--text-2);
}

.train-task-meta .pts {
  color: var(--accent);
  font-weight: 600;
}

/* Task button (inside card) */
.task-btn {
  border-radius: var(--radius-sm) !important;
}

/* Training records */
#train-record-list {
  padding: 0 20px;
}

.train-record-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  backdrop-filter: blur(10px);
}

.tri-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-2);
  font-family: var(--font-mono);
  flex-shrink: 0;
}

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

.tri-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tri-desc {
  font-size: 0.68rem;
  color: var(--text-2);
  margin-top: 1px;
}

.tri-score {
  text-align: right;
  flex-shrink: 0;
}

.tri-pts {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
}

.tri-date {
  font-size: 0.62rem;
  color: var(--text-3);
  margin-top: 1px;
}

.train-record-details {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}
.trd-chip {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  white-space: nowrap;
}
.trd-chip.ok {
  background: rgba(34,197,94,0.1);
  color: #22c55e;
  border: 1px solid rgba(34,197,94,0.2);
}
.trd-chip.no {
  background: rgba(239,68,68,0.1);
  color: #ef4444;
  border: 1px solid rgba(239,68,68,0.2);
}

.train-empty-records {
  text-align: center;
  padding: 32px 0;
  color: var(--text-3);
  font-size: 0.82rem;
}

/* === Task View (Quiz) === */
.train-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-0);
  position: sticky;
  top: 0;
  z-index: 50;
}

.train-back-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text-1);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.train-back-btn:hover {
  background: var(--bg-3);
  color: var(--text-0);
}

.train-topbar h2 {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-0);
}

.train-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--accent-dim);
  color: var(--accent);
}

/* Progress bar */
.train-progress-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 20px;
  flex-wrap: wrap;
}

.train-progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--bg-3);
  transition: all var(--transition);
}

.train-progress-dot.done { background: var(--green); }
.train-progress-dot.wrong-dot { background: var(--red); }
.train-progress-dot.current { background: var(--accent); box-shadow: 0 0 6px rgba(0,212,255,0.4); }

.train-progress-label {
  font-size: 0.65rem;
  color: var(--text-3);
  margin-left: 8px;
  font-family: var(--font-mono);
}

/* Question area */
.train-q-header {
  padding: 16px 20px 0;
}

.train-q-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 600;
  font-family: var(--font-mono);
  margin-bottom: 8px;
}

.train-q-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-0);
  line-height: 1.4;
  margin-bottom: 4px;
}

.train-q-hint {
  font-size: 0.78rem;
  color: var(--text-2);
}

.train-q-image-wrap {
  margin: 14px 20px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-2);
}

.train-q-image-wrap img {
  width: 100%;
  display: block;
}

.train-q-image-label {
  padding: 6px 12px;
  font-size: 0.68rem;
  color: var(--text-2);
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
}

.train-ai-tag {
  margin: 0 20px 14px;
  padding: 8px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--text-1);
}

.train-ai-tag strong {
  color: var(--accent);
}

/* Options */
.train-options {
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.train-option-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-0);
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition);
}

.train-option-btn:hover:not(.disabled) {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.train-option-btn .opt-letter {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-2);
  flex-shrink: 0;
  font-family: var(--font-mono);
}

.train-option-btn.selected { border-color: var(--accent); }
.train-option-btn.correct { border-color: var(--green); background: rgba(16,185,129,0.08); }
.train-option-btn.correct .opt-letter { background: var(--green); color: #fff; }
.train-option-btn.wrong { border-color: var(--red); background: rgba(248,113,113,0.08); }
.train-option-btn.wrong .opt-letter { background: var(--red); color: #fff; }
.train-option-btn.disabled { cursor: default; opacity: 0.7; }
.train-option-btn.disabled:hover { border-color: var(--border); background: var(--bg-2); }

/* Feedback */
.train-feedback {
  margin: 14px 20px;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 0.82rem;
  line-height: 1.5;
  display: none;
}

.train-feedback.show { display: block; }

.train-feedback.correct {
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.2);
  color: var(--green);
}

.train-feedback.wrong {
  background: rgba(248,113,113,0.08);
  border: 1px solid rgba(248,113,113,0.2);
  color: var(--red);
}

.fb-pts {
  font-family: var(--font-mono);
  font-weight: 700;
}

/* Action bar */
.train-action-bar {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  justify-content: center;
}

.btn-prev, .btn-submit {
  padding: 10px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text-1);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-prev:hover, .btn-submit:hover {
  background: var(--bg-3);
  color: var(--text-0);
}

/* === Result View === */
.train-result-hero {
  text-align: center;
  padding: 32px 20px 0;
}

.train-result-icon {
  font-size: 2.4rem;
  margin-bottom: 10px;
}

.train-result-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-0);
}

.train-result-subtitle {
  font-size: 0.82rem;
  color: var(--text-2);
  margin-top: 4px;
}

/* Score ring */
.train-score-ring {
  display: flex;
  justify-content: center;
  padding: 24px 0;
  position: relative;
}

.train-score-ring svg {
  width: 120px;
  height: 120px;
}

.ring-bg {
  fill: none;
  stroke: var(--bg-3);
  stroke-width: 8;
}

.ring-fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}

.ring-fill.good { stroke: var(--green); }
.ring-fill.mid { stroke: var(--yellow); }
.ring-fill.bad { stroke: var(--red); }

.train-score-text {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.train-score-num {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-0);
}

.train-score-label {
  font-size: 0.65rem;
  color: var(--text-2);
}

/* Result stats */
.train-result-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 0 20px 20px;
}

.trstat {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
  backdrop-filter: blur(10px);
}

.trv {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
}

.trv.green { color: var(--green); }
.trv.red { color: var(--red); }
.trv.yellow { color: var(--yellow); }
.trv.accent { color: var(--accent); }

.trl {
  font-size: 0.62rem;
  color: var(--text-2);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Result detail */
.train-result-detail {
  padding: 0 20px 20px;
}

.train-result-detail h3 {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.train-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 6px;
}

.tri2-num {
  min-width: 26px;
  height: 26px;
  padding: 0 5px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 700;
  flex-shrink: 0;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.tri2-num.ok { background: rgba(16,185,129,0.12); color: var(--green); }
.tri2-num.no { background: rgba(248,113,113,0.12); color: var(--red); }

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

.tri2-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tri2-desc {
  font-size: 0.68rem;
  color: var(--text-2);
  margin-top: 1px;
}

.tri2-pts {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

.train-result-actions {
  padding: 0 20px 20px;
  display: flex;
  justify-content: center;
}

.train-result-actions button {
  padding: 11px 32px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

/* ============================================
   PROFILE / SYSTEM CENTER ?Cyberpunk Style
   ============================================ */

/* Scan line for profile page */
#page-profile::after {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient-main);
  opacity: 0.4;
  animation: pf-scan 4s linear infinite;
  z-index: 999;
  pointer-events: none;
}
@keyframes pf-scan {
  0% { top: 0; }
  100% { top: 100vh; }
}

.pf-view {
  display: none;
}

.pf-view.active {
  display: block;
}

/* === Hero Card === */
.pf-hero {
  margin: 20px 20px 0;
  padding: 28px 24px 24px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(0,212,255,0.06) 0%, rgba(124,92,255,0.04) 50%, var(--bg-2) 100%);
  border: 1px solid rgba(0,212,255,0.1);
  position: relative;
  overflow: hidden;
}

/* 掃描光效 */
.pf-hero::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 200%;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(0,212,255,0.03) 45%, rgba(0,212,255,0.06) 50%, rgba(0,212,255,0.03) 55%, transparent 100%);
  animation: pf-card-scan 6s ease-in-out infinite;
}
@keyframes pf-card-scan {
  0%, 100% { transform: translateX(-50%); }
  50% { transform: translateX(50%); }
}

.pf-hero-top {
  display: flex;
  align-items: center;
  gap: 18px;
  position: relative;
  z-index: 1;
}

/* 頭像 */
.pf-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}

.pf-avatar-ring {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--gradient-main);
  animation: pf-ring-pulse 3s ease-in-out infinite;
}
@keyframes pf-ring-pulse {
  0%, 100% { opacity: 0.8; box-shadow: 0 0 12px rgba(0,212,255,0.3); }
  50% { opacity: 1; box-shadow: 0 0 24px rgba(0,212,255,0.5), 0 0 40px rgba(124,92,255,0.2); }
}

.pf-avatar-inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bg-1);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  overflow: hidden;
}

.pf-avatar-inner svg {
  width: 28px;
  height: 28px;
  stroke: var(--accent);
  stroke-width: 1.5;
  fill: none;
}

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

.pf-user-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pf-user-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-0);
}

.pf-user-id {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-2);
  letter-spacing: 0.05em;
}

.pf-account-line {
  font-size: 0.75rem;
  color: var(--text-1);
  margin-top: 2px;
}

.pf-plan {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 0.62rem;
  font-weight: 600;
  background: var(--accent-dim);
  color: var(--accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* KYC 認證徽章 */
.pf-kyc-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.pf-kyc-badge.verified {
  background: rgba(16,185,129,0.12);
  border: 1px solid rgba(16,185,129,0.3);
  color: var(--green);
}
.pf-kyc-badge.pending {
  background: rgba(251,191,36,0.12);
  border: 1px solid rgba(251,191,36,0.3);
  color: var(--yellow);
}
.pf-kyc-badge.unverified {
  background: rgba(248,113,113,0.1);
  border: 1px solid rgba(248,113,113,0.25);
  color: var(--red);
}
.pf-kyc-badge.rejected {
  background: rgba(248,113,113,0.1);
  border: 1px solid rgba(248,113,113,0.25);
  color: var(--red);
}
.pf-kyc-badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

/* === Wallet === */
.pf-wallet {
  margin: 16px 20px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

/* 頂部漸層指示?*/
.pf-wallet::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient-main);
  opacity: 0.5;
}

.pf-wallet-title {
  font-family: var(--font-display);
  font-size: 0.55rem;
  color: var(--text-2);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 16px 16px 12px;
}

.pf-wallet-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 0 16px 16px;
}

.pf-wallet-item {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.03);
}

.pf-wi-label {
  font-size: 0.7rem;
  color: var(--text-2);
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}

.pf-wi-value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.pf-wi-value.cyan {
  color: var(--accent);
  text-shadow: 0 0 20px rgba(0,212,255,0.3);
}
.pf-wi-value.gold {
  color: var(--yellow);
  text-shadow: 0 0 20px rgba(251,191,36,0.3);
}

.pf-wi-unit {
  font-size: 0.65rem;
  font-weight: 400;
  opacity: 0.6;
  margin-left: 4px;
}

.pf-wi-sub {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-2);
  margin-top: 4px;
}

/* 操作按鈕 ?網格 */
.pf-wallet-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--border);
}

.pf-wa-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 4px;
  border-radius: var(--radius-sm);
  background: rgba(0,212,255,0.04);
  border: 1px solid rgba(0,212,255,0.08);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-1);
  cursor: pointer;
  transition: all var(--transition);
}

.pf-wa-btn:hover {
  background: rgba(0,212,255,0.08);
  border-color: rgba(0,212,255,0.2);
  box-shadow: 0 0 12px rgba(0,212,255,0.1);
  color: var(--accent);
}

.pf-wa-icon {
  width: 20px;
  height: 20px;
  stroke: var(--accent);
  stroke-width: 1.5;
  fill: none;
}

/* === Menu === */
.pf-menu {
  margin: 20px 20px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-radius: var(--radius);
  background: var(--bg-2);
  border: 1px solid var(--border);
  overflow: hidden;
}

.pf-menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

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

.pf-menu-item:hover {
  background: rgba(0,212,255,0.03);
}

/* hover 時左側青色指示條 */
.pf-menu-item:hover::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 2px;
  background: var(--accent);
  border-radius: 1px;
  box-shadow: 0 0 8px rgba(0,212,255,0.4);
}

/* 圖標帶背景色方塊 */
.pf-mi-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pf-mi-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.5;
  fill: none;
}

.pf-mi-icon.c1 { background: rgba(0,212,255,0.08); }
.pf-mi-icon.c1 svg { stroke: var(--accent); }
.pf-mi-icon.c2 { background: rgba(124,92,255,0.08); }
.pf-mi-icon.c2 svg { stroke: var(--purple); }
.pf-mi-icon.c3 { background: rgba(251,191,36,0.08); }
.pf-mi-icon.c3 svg { stroke: var(--yellow); }
.pf-mi-icon.c4 { background: rgba(16,185,129,0.08); }
.pf-mi-icon.c4 svg { stroke: var(--green); }
.pf-mi-icon.c5 { background: rgba(248,113,113,0.08); }
.pf-mi-icon.c5 svg { stroke: var(--red); }

.pf-mi-text {
  flex: 1;
  min-width: 0;
}

.pf-mi-t {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-0);
}

.pf-mi-s {
  font-size: 0.68rem;
  color: var(--text-2);
  margin-top: 2px;
}

/* 右側狀態標?*/
.pf-mi-status {
  font-size: 0.6rem;
  padding: 2px 8px;
  border-radius: 100px;
  font-weight: 600;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}
.pf-mi-status.green { background: rgba(16,185,129,0.1); color: var(--green); border: 1px solid rgba(16,185,129,0.2); }
.pf-mi-status.yellow { background: rgba(251,191,36,0.1); color: var(--yellow); border: 1px solid rgba(251,191,36,0.2); }
.pf-mi-status.red { background: rgba(248,113,113,0.08); color: var(--red); border: 1px solid rgba(248,113,113,0.2); }

.pf-mi-arrow {
  color: var(--text-2);
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* === Logout === */
.pf-logout-btn {
  display: block;
  width: calc(100% - 40px);
  margin: 24px auto;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: rgba(248,113,113,0.06);
  border: 1px solid rgba(248,113,113,0.15);
  color: var(--red);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.pf-logout-btn:hover {
  background: rgba(248,113,113,0.12);
  border-color: rgba(248,113,113,0.3);
}

/* Sub-page topbar */
.pf-sub-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-0);
  position: sticky;
  top: 0;
  z-index: 50;
}

.pf-back-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text-1);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.pf-back-btn:hover {
  background: var(--bg-3);
  color: var(--text-0);
}

.pf-sub-topbar h2 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-0);
}

/* Swap */
/* Swap Balance Bar */
.pf-swap-balance-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 12px 20px 0;
  padding: 14px 20px;
  background: linear-gradient(135deg, rgba(74,125,255,0.08), rgba(139,92,246,0.08));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
}
.pf-swap-bal-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.pf-swap-bal-icon { font-size: 1.1rem; }
.pf-swap-bal-label {
  font-size: 0.72rem;
  color: var(--text-2);
  letter-spacing: 0.03em;
}
.pf-swap-bal-val {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-0);
}
.pf-swap-bal-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
  margin: 0 8px;
}

.pf-swap-card {
  margin: 16px 20px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(10px);
  overflow: hidden;
}

.pf-swap-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.pf-swap-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-0);
}

.pf-swap-rate {
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--text-1);
}

.pf-swap-from, .pf-swap-to {
  margin-bottom: 8px;
}

.pf-swap-label {
  font-size: 0.7rem;
  color: var(--text-2);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pf-swap-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.pf-swap-amount {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-0);
  font-family: var(--font-num);
  font-size: 1.1rem;
  font-weight: 600;
  outline: none;
  transition: border-color var(--transition);
}

.pf-swap-amount:focus {
  border-color: var(--accent);
}

.pf-swap-coin, .pf-swap-coin-label {
  padding: 10px 14px;
  background: var(--bg-3);
  border-radius: var(--radius);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
  border: none;
  font-family: var(--font-body);
  flex-shrink: 0;
}

.pf-swap-coin {
  cursor: pointer;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.pf-swap-switch-wrapper {
  display: flex;
  justify-content: center;
  padding: 12px 0;
}

.pf-swap-switch-btn {
  background: linear-gradient(135deg, rgba(0,212,255,0.15), rgba(124,92,255,0.15));
  border: 2px solid rgba(0,212,255,0.3);
  border-radius: 50%;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,212,255,0.2);
}

.pf-swap-switch-btn:hover {
  transform: scale(1.1);
  border-color: rgba(0,212,255,0.6);
  box-shadow: 0 6px 20px rgba(0,212,255,0.4);
}

.pf-swap-switch-btn:active {
  transform: scale(0.95);
}

.pf-swap-switch-btn .switch-icon {
  font-size: 1.5rem;
  color: var(--accent);
  transition: transform 0.4s ease;
}

.pf-swap-switch-btn.rotating .switch-icon {
  transform: rotate(180deg);
}

.pf-swap-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-2);
  margin: 12px 0 16px;
  font-family: var(--font-num);
  flex-wrap: wrap;
  gap: 4px;
}

.pf-primary-btn {
  width: 100%;
  padding: 11px;
  background: var(--gradient-main);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.pf-primary-btn:hover {
  box-shadow: 0 0 20px rgba(0,212,255,0.3), 0 0 40px rgba(124,92,255,0.15);
}

/* Withdraw */
.pf-withdraw-card {
  margin: 16px 20px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(10px);
}

.pf-withdraw-balance {
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.pf-wb-label {
  font-size: 0.7rem;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pf-wb-amount {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-0);
  margin-top: 4px;
}

.pf-wb-unit {
  font-size: 0.7rem;
  color: var(--text-2);
  font-family: var(--font-mono);
}

.pf-withdraw-form {
  margin-bottom: 16px;
}

.pf-wf-row {
  margin-bottom: 14px;
}

.pf-wf-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-1);
  margin-bottom: 6px;
}

.pf-wf-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-0);
  font-family: var(--font-body);
  font-size: 0.88rem;
  outline: none;
  transition: border-color var(--transition);
}

.pf-wf-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.pf-quick-amounts {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.pf-qa-btn {
  padding: 5px 14px;
  background: var(--bg-3);
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-1);
  cursor: pointer;
  transition: all var(--transition);
}

.pf-qa-btn:hover {
  background: var(--bg-4);
  color: var(--accent);
}

.pf-note {
  margin: 12px 20px;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.75rem;
  color: var(--text-1);
  line-height: 1.6;
  backdrop-filter: blur(10px);
}

.pf-note strong {
  color: var(--text-0);
}

/* Tab row */
.pf-tab-row {
  display: flex;
  gap: 0;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
}

.pf-tab-item {
  padding: 10px 14px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
}

.pf-tab-item:hover {
  color: var(--text-1);
}

.pf-tab-item.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Transaction list */
#pf-tx-list {
  padding: 10px 20px;
}

.pf-tx-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  backdrop-filter: blur(10px);
}

.pf-tx-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.9rem;
}

.pf-tx-icon.earn { background: rgba(16,185,129,0.1); }
.pf-tx-icon.spend { background: rgba(248,113,113,0.1); }
.pf-tx-icon.swap { background: rgba(0,212,255,0.1); }
.pf-tx-icon.withdraw { background: rgba(251,191,36,0.1); }

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

.pf-tx-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-0);
}

.pf-tx-time {
  font-size: 0.65rem;
  color: var(--text-3);
  margin-top: 1px;
  font-family: var(--font-mono);
}

.pf-tx-amount {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.pf-tx-amount.plus { color: var(--green); }
.pf-tx-amount.minus { color: var(--red); }

/* Record list (profile) */
#pf-record-list {
  padding: 10px 20px;
}

.pf-rec-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
}

.pf-rec-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-2);
  font-family: var(--font-mono);
  flex-shrink: 0;
}

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

.pf-rec-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-0);
}

.pf-rec-time {
  font-size: 0.65rem;
  color: var(--text-3);
  margin-top: 1px;
  font-family: var(--font-mono);
}

.pf-rec-pts {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

/* Data form */
.pf-data-form {
  padding: 16px 20px;
}

.pf-data-section {
  margin-bottom: 20px;
}

.pf-data-section-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.pf-data-field {
  margin-bottom: 14px;
}

.pf-data-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-1);
  margin-bottom: 5px;
}

.pf-required {
  color: var(--red);
}

.pf-data-field input,
.pf-data-field select {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-0);
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
  transition: border-color var(--transition);
}

.pf-data-field input:focus,
.pf-data-field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.pf-data-field input:disabled,
.pf-data-field select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pf-data-field input::placeholder {
  color: var(--text-3);
}

.pf-data-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.pf-data-actions {
  display: flex;
  gap: 10px;
  padding-top: 8px;
}

.pf-edit-btn {
  flex: 1;
  padding: 11px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-1);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.pf-edit-btn:hover {
  background: var(--bg-3);
  color: var(--text-0);
}

/* FAQ */
.pf-faq-list {
  padding: 10px 20px;
}

.pf-faq-item {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 8px;
  backdrop-filter: blur(10px);
}

.pf-faq-q {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-0);
  margin-bottom: 6px;
}

.pf-faq-a {
  font-size: 0.78rem;
  color: var(--text-2);
  line-height: 1.6;
}

/* KYC upload */
.pf-kyc-upload-area {
  position: relative;
  width: 100%;
  min-height: 120px;
  border: 1.5px dashed rgba(0,212,255,0.2);
  border-radius: var(--radius);
  background: var(--bg-1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s;
  overflow: hidden;
}

.pf-kyc-upload-area:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.pf-kyc-upload-area img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  min-height: 120px;
  max-height: 200px;
}

.pf-kyc-upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px;
}

.pf-kyc-upload-placeholder span {
  font-size: 1.5rem;
  color: var(--text-3);
}

.pf-kyc-upload-placeholder p {
  font-size: 0.75rem;
  color: var(--text-2);
  text-align: center;
}

/* === Toast === */
#app-toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 20px;
  border-radius: var(--radius);
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-0);
  font-size: 0.82rem;
  font-weight: 500;
  z-index: 99999;
  transition: opacity 0.3s;
  box-shadow: var(--shadow-card);
}

/* === Responsive === */
@media (min-width: 480px) {
  .metrics-grid { grid-template-columns: repeat(4, 1fr); }
  .app-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 768px) {
  .hero { min-height: 480px; padding: 80px 40px 100px; }
  .hero-title { font-size: 3rem; }
  .section { padding: 60px 40px; }
  .page-top { padding: 60px 40px 30px; }
  .capability-cards { flex-direction: row; }
  .cap-card { flex: 1; }
  .invest-cards { gap: 16px; }
}

/* === Scrollbar === */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--bg-3);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--bg-4);
}

/* === Animations === */
@keyframes scan-line {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100vh); }
}

/* Subtle scan effect on hero - cyan/purple */
.hero::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,212,255,0.15), rgba(124,92,255,0.1), transparent);
  animation: scan-line 8s linear infinite;
  pointer-events: none;
  z-index: 1;
}

/* ============================================
   TRAIN DETAIL PAGE
   ============================================ */

/* Cover image area */
.td-cover-wrap {
  margin: 0 16px;
  position: relative;
}

.td-cover {
  width: 100%;
  height: 200px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--border);
}

.td-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.td-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--bg-1), var(--bg-2));
}

.td-cover-icon {
  font-size: 48px;
  opacity: 0.5;
}

.td-cover-label {
  font-size: 0.75rem;
  color: var(--text-3);
  letter-spacing: 0.04em;
}

.td-cover-tags {
  position: absolute;
  bottom: 10px;
  left: 10px;
  display: flex;
  gap: 6px;
}

.td-cover-tag {
  font-size: 0.62rem;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(0,212,212,0.15);
  color: var(--accent);
  border: 1px solid rgba(0,212,255,0.25);
  backdrop-filter: blur(8px);
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* Info section */
.td-info {
  padding: 16px 20px;
}

.td-task-name {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text-0);
  margin-bottom: 6px;
}

.td-desc {
  font-size: 0.82rem;
  color: var(--text-1);
  line-height: 1.6;
  margin-bottom: 16px;
}

/* Stats grid */
.td-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.td-stat-item {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  text-align: center;
}

.td-stat-num {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
}

.td-stat-num.gold { color: var(--yellow); }
.td-stat-num.cyan { color: var(--accent); }
.td-stat-num.blue { color: var(--purple); }

.td-stat-unit {
  font-size: 0.62rem;
  color: var(--text-3);
  display: block;
  margin-top: 2px;
  letter-spacing: 0.04em;
}

/* Progress section */
.td-progress {
  margin-bottom: 8px;
}

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

.td-progress-label {
  font-size: 0.75rem;
  color: var(--text-1);
}

.td-progress-pct {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
}

.td-progress-track {
  height: 6px;
  background: var(--bg-3);
  border-radius: 3px;
  overflow: hidden;
}

.td-progress-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--gradient-main);
  transition: width 0.5s ease;
}

.td-progress-detail {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--text-3);
  margin-top: 4px;
  font-family: var(--font-mono);
}

/* Action buttons */
.td-actions {
  padding: 12px 20px 24px;
  display: flex;
  gap: 10px;
}

.td-btn-start {
  flex: 1;
  padding: 14px 0;
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  border: none;
  font-family: var(--font-body);
  transition: all var(--transition);
}

.td-btn-start:hover:not(:disabled) {
  box-shadow: 0 6px 28px rgba(0,212,255,0.35);
  transform: translateY(-1px);
}

.td-btn-start:disabled {
  background: var(--bg-3) !important;
  color: var(--text-3) !important;
  box-shadow: none !important;
  cursor: not-allowed;
  opacity: 0.6;
}

.td-btn-browse {
  flex: 1;
  padding: 14px 0;
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-1);
  font-family: var(--font-body);
  transition: all var(--transition);
}

.td-btn-browse:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Detail page badge variations */
#train-detail .train-badge {
  font-size: 0.65rem;
  padding: 3px 10px;
}

/* ============================================
   CHARITY PAGE ?Love & Warmth
   ============================================ */

/* Hero */
.charity-hero {
  position: relative;
  padding: 48px 24px 32px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.charity-hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(248,113,113,0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 80%, rgba(124,92,255,0.08) 0%, transparent 60%),
    var(--bg-0);
  z-index: 0;
}
.charity-hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
}
.charity-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: var(--red);
  border: 1px solid rgba(248,113,113,0.25);
  background: rgba(248,113,113,0.06);
  margin-bottom: 16px;
}
.charity-hero-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.charity-hero-title .title-line {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--text-0);
  line-height: 1.2;
}
.charity-hero-title .title-line:first-child {
  font-size: 1.8rem;
}
.charity-hero-sub {
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--text-2);
  letter-spacing: 0.04em;
}

/* Stats */
.charity-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-1);
}
.charity-stat {
  text-align: center;
}
.charity-stat-num {
  display: block;
  font-family: var(--font-num);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-0);
}
.charity-stat-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  color: var(--text-2);
  margin-top: 2px;
}
.charity-stat-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
}

/* Filter Tabs */
.charity-filter-row {
  display: flex;
  gap: 8px;
  padding: 16px 0 12px;
}
.charity-filter {
  padding: 6px 18px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--text-2);
  background: var(--bg-2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}
.charity-filter:hover {
  border-color: var(--border-hover);
  color: var(--text-1);
}
.charity-filter.active {
  background: var(--gradient-main);
  color: #fff;
  border-color: transparent;
}

/* Card */
.charity-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 14px;
  transition: var(--transition);
}
.charity-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 8px 32px rgba(0,212,255,0.08);
  transform: translateY(-2px);
}
.charity-card-cover {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-3);
}
.charity-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.charity-card:hover .charity-card-cover img {
  transform: scale(1.03);
}
.charity-card-badge {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.08em;
  color: #fff;
  backdrop-filter: blur(8px);
}
.charity-card-badge.ongoing {
  background: rgba(0,212,255,0.7);
}
.charity-card-badge.upcoming {
  background: rgba(251,191,36,0.7);
}
.charity-card-badge.ended {
  background: rgba(80,80,112,0.7);
}
.charity-card-type {
  position: absolute;
  right: 10px;
  top: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.06em;
  color: #fff;
  background: rgba(124,92,255,0.7);
  backdrop-filter: blur(8px);
}

/* Card Body */
.charity-card-body {
  padding: 14px 16px 16px;
}
.charity-card-title {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-0);
  margin-bottom: 6px;
}
.charity-card-desc {
  font-size: 0.75rem;
  color: var(--text-2);
  line-height: 1.5;
  margin-bottom: 14px;
}

/* Progress */
.charity-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--bg-4);
  overflow: hidden;
  margin-bottom: 8px;
}
.charity-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--gradient-main);
  transition: width 0.5s ease;
}
.charity-progress-fill.lottery {
  background: linear-gradient(135deg, #7c5cff, #a78bfa);
}
.charity-numbers {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-num);
  font-size: 0.7rem;
  color: var(--text-1);
  margin-bottom: 12px;
}
.charity-numbers .raised {
  color: var(--accent);
  font-weight: 700;
}

/* Tags */
.charity-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.charity-tag {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.6rem;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  border: 1px solid var(--border);
  color: var(--text-1);
  background: var(--bg-3);
}

/* Buttons */
.charity-card-actions {
  display: flex;
  gap: 8px;
}
.charity-btn-primary {
  flex: 1;
  height: 38px;
  border: 0;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  background: var(--gradient-main);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(0,212,255,0.2);
}
.charity-btn-primary:hover {
  box-shadow: 0 6px 24px rgba(0,212,255,0.35);
  transform: translateY(-1px);
}
.charity-btn-ghost {
  flex: 1;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-1);
  background: transparent;
  cursor: pointer;
  transition: var(--transition);
}
.charity-btn-ghost:hover {
  border-color: var(--border-hover);
  color: var(--accent);
  background: var(--accent-dim);
}

/* Responsive */
@media (max-width: 380px) {
  .charity-hero-title .title-line { font-size: 1.3rem; }
  .charity-stats { gap: 14px; padding: 16px; }
  .charity-stat-num { font-size: 1.1rem; }
}

/* ============================================
   CHARITY DETAIL MODAL (cd- prefix classes)
   ============================================ */

/* Hero */
.cd-hero {
  padding: 14px 14px 10px;
  background: linear-gradient(135deg, rgba(124,92,255,0.18), rgba(0,212,255,0.12));
  border-bottom: 1px solid rgba(255,255,255,0.06);
  text-align: center;
  flex-shrink: 0;
}
.cd-hero-title {
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--text-0);
  margin-bottom: 4px;
  line-height: 1.35;
}
.cd-hero-sub {
  font-size: 0.68rem;
  color: var(--text-2);
  line-height: 1.4;
}

/* Scroll area */
.cd-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  -webkit-overflow-scrolling: touch;
}
.cd-scroll::-webkit-scrollbar { width: 3px; }
.cd-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Cover */
.cd-cover-wrap {
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-3);
  border: 1px solid var(--border);
  margin-bottom: 8px;
}
.cd-cover-wrap img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}

/* Summary */
.cd-summary {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-0);
  margin-bottom: 8px;
  line-height: 1.5;
}

/* Meta badges */
.cd-meta-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.cd-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-1);
  white-space: nowrap;
}
.cd-badge:first-child { color: var(--accent); border-color: rgba(0,212,255,0.3); }

/* Progress */
.cd-progress-wrap {
  margin-bottom: 10px;
}
.cd-progress-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-4);
  overflow: hidden;
  border: 1px solid var(--border);
}
.cd-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--purple));
  transition: width 0.5s ease;
}
.cd-progress-labels {
  display: flex;
  justify-content: flex-end;
  font-size: 0.6rem;
  color: var(--text-2);
  margin-top: 3px;
}

/* Content card */
.cd-content-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.cd-content-subtitle {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--text-3);
  margin-bottom: 8px;
  letter-spacing: 0.04em;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.cd-content-body {
  font-size: 0.75rem;
  color: var(--text-1);
  line-height: 1.75;
  white-space: pre-line;
  word-break: break-word;
}

.cd-bottom-spacer { height: 12px; }

/* Bottom actions */
.cd-actions {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  background: var(--bg-1);
}
.cd-btn-primary {
  height: 42px;
  border-radius: 12px;
  border: 0;
  cursor: pointer;
  font-weight: 900;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--accent));
  box-shadow: 0 6px 20px rgba(124,92,255,0.3), inset 0 1px 0 rgba(255,255,255,0.15);
  transition: var(--transition);
}
.cd-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(124,92,255,0.4); }
.cd-btn-primary:active { transform: translateY(0); }

.cd-btn-ghost {
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  cursor: pointer;
  font-weight: 900;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  color: var(--text-1);
  background: rgba(255,255,255,0.06);
  transition: var(--transition);
}
.cd-btn-ghost:hover { background: rgba(255,255,255,0.1); }

