/* ============================================
   DADRC - 數位資產發展研究中心
   Light Theme with Web3 Tech Accents
   ============================================ */

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

:root {
  --primary: #5B4CDB;
  --primary-light: #7C6FEF;
  --primary-dark: #4338B8;
  --accent: #0891B2;
  --accent-bright: #06B6D4;
  --light-bg: #F8F9FC;
  --white: #FFFFFF;
  --light-surface: #F1F3F8;
  --light-card: #FFFFFF;
  --light-card-hover: #F8F5FF;
  --text-primary: #1A1D2E;
  --text-secondary: #5A5F7A;
  --text-tertiary: #8B90A8;
  --border-subtle: rgba(91, 76, 219, 0.12);
  --border-light: #E2E5EF;
  --shadow-sm: 0 1px 3px rgba(26, 29, 46, 0.06);
  --shadow-md: 0 4px 16px rgba(26, 29, 46, 0.08);
  --shadow-lg: 0 8px 32px rgba(91, 76, 219, 0.12);
  --shadow-glow: 0 4px 20px rgba(91, 76, 219, 0.15);
  --gradient-hero: linear-gradient(135deg, #1A1040 0%, #2D1B69 40%, #1A1040 100%);
  --gradient-card: linear-gradient(145deg, #FFFFFF, #FAFBFE);
  --gradient-accent: linear-gradient(135deg, #5B4CDB, #06B6D4);
  --gradient-accent-soft: linear-gradient(135deg, rgba(91, 76, 219, 0.08), rgba(6, 182, 212, 0.08));
  --font-main: 'Noto Sans TC', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Inter', 'Noto Sans TC', sans-serif;
  --transition-fast: 0.2s ease;
  --transition-med: 0.4s ease;
  --max-width: 1200px;
}

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

body {
  font-family: var(--font-main);
  background: var(--light-bg);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--accent); }

img { max-width: 100%; display: block; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* --- Animated Background Particles --- */
.bg-particles {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0; overflow: hidden;
}
.bg-particles::before, .bg-particles::after {
  content: ''; position: absolute; border-radius: 50%; opacity: 0.04;
  animation: float 20s ease-in-out infinite;
}
.bg-particles::before {
  width: 600px; height: 600px;
  background: radial-gradient(circle, var(--primary), transparent 70%);
  top: -10%; left: -5%;
}
.bg-particles::after {
  width: 500px; height: 500px;
  background: radial-gradient(circle, var(--accent-bright), transparent 70%);
  bottom: -10%; right: -5%;
  animation-delay: -10s; animation-duration: 25s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* --- Navigation --- */
.navbar {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition-med);
}
.navbar .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px; gap: 16px;
}
.nav-logo {
  display: flex; align-items: center; gap: 12px;
  font-weight: 700; font-size: 1.15rem; color: var(--text-primary);
}
.nav-logo .logo-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--gradient-accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 0.85rem; color: #fff;
}
.nav-logo .logo-img {
  height: 32px; width: auto; max-width: 180px; object-fit: contain;
  filter: brightness(0) saturate(100%);
}
.nav-logo span { display: none; }
.nav-links { display: flex; gap: 24px; list-style: none; white-space: nowrap; flex-shrink: 0; }
.nav-links a {
  color: var(--text-secondary); font-size: 0.95rem; font-weight: 500;
  position: relative; padding: 4px 0;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -2px; left: 0;
  width: 0; height: 2px;
  background: var(--gradient-accent);
  transition: width var(--transition-fast);
}
.nav-links a:hover, .nav-links a.active {
  color: var(--text-primary);
}
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.nav-cta {
  padding: 8px 20px; border-radius: 8px; font-size: 0.9rem; font-weight: 600;
  background: var(--gradient-accent); color: #fff;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.nav-cta:hover {
  transform: translateY(-1px); box-shadow: var(--shadow-glow);
  color: #fff;
}

/* Language Switcher */
.lang-switch {
  display: flex; align-items: center; gap: 2px;
  font-size: 0.85rem; font-weight: 600;
  margin-right: 4px;
}
.lang-switch a, .lang-switch span {
  padding: 4px 8px; border-radius: 6px;
  transition: all var(--transition-fast);
}
.lang-switch a {
  color: var(--text-tertiary);
}
.lang-switch a:hover {
  color: var(--primary); background: rgba(91, 76, 219, 0.06);
}
.lang-switch .lang-active {
  color: var(--primary); background: rgba(91, 76, 219, 0.1);
}
.lang-switch .lang-sep {
  color: var(--border-light); font-weight: 400;
}

/* Mobile hamburger */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span {
  display: block; width: 24px; height: 2px; background: var(--text-primary);
  margin: 5px 0; transition: var(--transition-fast);
}

/* --- Hero Section (keeps dark for contrast) --- */
.hero {
  position: relative; min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--gradient-hero); text-align: center;
  padding: 120px 24px 80px;
}
.hero-content { position: relative; z-index: 1; max-width: 800px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px; border-radius: 50px;
  background: rgba(91, 76, 219, 0.2);
  border: 1px solid rgba(91, 76, 219, 0.3);
  font-size: 0.85rem; color: #C4BAFE;
  margin-bottom: 24px;
}
.hero-badge .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-bright);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.5); }
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800; line-height: 1.2;
  margin-bottom: 12px;
  color: #F0F0F5;
}
.hero h1 .gradient-text {
  background: var(--gradient-accent);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero .subtitle {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: #A0A4B8; margin-bottom: 8px;
  font-weight: 500; letter-spacing: 3px;
}
.hero .desc {
  font-size: 1.05rem; color: #A0A4B8;
  max-width: 600px; margin: 16px auto 32px; line-height: 1.8;
}
.hero-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.hero .btn-outline { color: #F0F0F5; border-color: rgba(91, 76, 219, 0.3); }
.hero .btn-outline:hover { color: #F0F0F5; border-color: var(--primary-light); background: rgba(91, 76, 219, 0.15); }

/* Grid lines decoration */
.hero-grid {
  position: absolute; inset: 0; z-index: 0; overflow: hidden; opacity: 0.04;
  background-image:
    linear-gradient(#A29BFE 1px, transparent 1px),
    linear-gradient(90deg, #A29BFE 1px, transparent 1px);
  background-size: 60px 60px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; border-radius: 10px; font-size: 0.95rem;
  font-weight: 600; border: none; cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-primary {
  background: var(--gradient-accent); color: #fff;
}
.btn-primary:hover {
  transform: translateY(-2px); box-shadow: var(--shadow-glow);
  color: #fff;
}
.btn-outline {
  background: transparent; color: var(--text-primary);
  border: 1px solid var(--border-light);
}
.btn-outline:hover {
  border-color: var(--primary); background: rgba(91, 76, 219, 0.06);
  color: var(--primary);
}

/* --- Sections --- */
.section {
  position: relative; z-index: 1;
  padding: 100px 0;
}
.section-header {
  text-align: center; margin-bottom: 60px;
}
.section-header .tag {
  display: inline-block; font-size: 0.8rem; font-weight: 600;
  color: var(--primary); letter-spacing: 3px; text-transform: uppercase;
  margin-bottom: 12px;
}
.section-header h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 700; margin-bottom: 16px;
  color: var(--text-primary);
}
.section-header p {
  color: var(--text-secondary); max-width: 600px; margin: 0 auto;
  font-size: 1.05rem;
}
.section-divider {
  width: 60px; height: 3px; margin: 16px auto 0;
  background: var(--gradient-accent); border-radius: 2px;
}

/* --- Cards --- */
.card {
  background: var(--light-card);
  border: 1px solid var(--border-light);
  border-radius: 16px; padding: 32px;
  transition: all var(--transition-med);
  box-shadow: var(--shadow-sm);
}
.card:hover {
  border-color: rgba(91, 76, 219, 0.25);
  background: var(--light-card-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.card-icon {
  width: 56px; height: 56px; border-radius: 14px;
  background: var(--gradient-accent-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; margin-bottom: 20px;
}
.card h3 {
  font-size: 1.15rem; font-weight: 700; margin-bottom: 10px;
  color: var(--text-primary);
}
.card p {
  color: var(--text-secondary); font-size: 0.95rem; line-height: 1.7;
}

/* --- Grid Layouts --- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

/* --- Stats Bar --- */
.stats-bar {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
  padding: 48px 0;
}
.stat-item { text-align: center; }
.stat-number {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 800;
  background: var(--gradient-accent);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}
.stat-label { color: var(--text-secondary); font-size: 0.85rem; margin-top: 4px; line-height: 1.5; }

/* --- Partner Logos --- */
.partners-grid {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 32px; align-items: center;
}
.partner-item {
  padding: 20px 32px; border-radius: 12px;
  background: var(--white); border: 1px solid var(--border-light);
  font-size: 0.9rem; font-weight: 600; color: var(--text-secondary);
  transition: all var(--transition-fast);
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.partner-item:hover {
  border-color: rgba(91, 76, 219, 0.25); color: var(--primary);
  box-shadow: var(--shadow-md);
}

/* --- Timeline --- */
.timeline { position: relative; max-width: 700px; margin: 0 auto; }
.timeline::before {
  content: ''; position: absolute; left: 20px; top: 0; bottom: 0;
  width: 2px; background: var(--border-light);
}
.timeline-item {
  position: relative; padding-left: 56px; margin-bottom: 40px;
}
.timeline-dot {
  position: absolute; left: 12px; top: 6px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--light-bg); border: 2px solid var(--primary);
}
.timeline-dot.active { background: var(--primary); box-shadow: var(--shadow-glow); }
.timeline-date {
  font-size: 0.8rem; color: var(--primary); font-weight: 600;
  letter-spacing: 1px; margin-bottom: 6px;
}
.timeline-content h3 { font-size: 1.05rem; margin-bottom: 6px; }
.timeline-content p { color: var(--text-secondary); font-size: 0.9rem; }

/* --- Event Card --- */
.event-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 16px; overflow: hidden;
  transition: all var(--transition-med);
  box-shadow: var(--shadow-sm);
}
.event-card:hover {
  border-color: rgba(91, 76, 219, 0.25);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.event-card-header {
  padding: 24px 28px;
  background: var(--gradient-accent-soft);
  border-bottom: 1px solid var(--border-light);
}
.event-date {
  font-size: 0.8rem; color: var(--primary); font-weight: 600;
  letter-spacing: 1px; margin-bottom: 8px;
}
.event-card-header h3 { font-size: 1.15rem; color: var(--text-primary); }
.event-card-body { padding: 24px 28px; }
.event-card-body p { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 16px; }
.event-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.event-tag {
  padding: 4px 12px; border-radius: 6px; font-size: 0.8rem;
  background: rgba(91, 76, 219, 0.07); color: var(--primary);
  border: 1px solid rgba(91, 76, 219, 0.15);
}

/* --- Contact Form --- */
.contact-form {
  max-width: 600px; margin: 0 auto;
}
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block; font-size: 0.9rem; font-weight: 600;
  margin-bottom: 8px; color: var(--text-secondary);
}
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 12px 16px; border-radius: 10px;
  background: var(--white); border: 1px solid var(--border-light);
  color: var(--text-primary); font-size: 0.95rem;
  font-family: var(--font-main);
  transition: border-color var(--transition-fast);
}
.form-group input:focus, .form-group textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91, 76, 219, 0.1);
}
.form-group textarea { resize: vertical; min-height: 120px; }

/* --- Footer (dark for contrast) --- */
.footer {
  position: relative; z-index: 1;
  background: #1A1D2E;
  border-top: none;
  padding: 60px 0 32px;
  color: #D0D3E0;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 40px;
  margin-bottom: 40px;
}
.footer-brand .nav-logo .logo-img {
  height: 28px; max-width: 160px;
  filter: brightness(0) invert(1);
}
.footer-brand .nav-logo span { display: none; }
.footer-brand > p { color: #8B90A8; font-size: 0.9rem; margin-top: 12px; max-width: 280px; }
.footer-col h4 { font-size: 0.85rem; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: #8B90A8; margin-bottom: 16px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: #8B90A8; font-size: 0.9rem; }
.footer-col a:hover { color: var(--accent-bright); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 24px; text-align: center;
  color: #8B90A8; font-size: 0.85rem;
}

/* --- Page Header (sub-pages, keeps dark) --- */
.page-header {
  padding: 140px 0 60px;
  text-align: center;
  background: var(--gradient-hero);
  position: relative;
}
.page-header .hero-grid {
  position: absolute; inset: 0; z-index: 0; overflow: hidden; opacity: 0.04;
  background-image:
    linear-gradient(#A29BFE 1px, transparent 1px),
    linear-gradient(90deg, #A29BFE 1px, transparent 1px);
  background-size: 60px 60px;
}
.page-header-content { position: relative; z-index: 1; }
.page-header h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800; margin-bottom: 12px;
  color: #F0F0F5;
}
.page-header p {
  color: #A0A4B8; font-size: 1.05rem;
  max-width: 560px; margin: 0 auto;
}

/* --- Prose Content --- */
.prose { max-width: 760px; margin: 0 auto; }
.prose h2 { font-size: 1.5rem; font-weight: 700; margin: 48px 0 16px; color: var(--text-primary); }
.prose h3 { font-size: 1.2rem; font-weight: 600; margin: 32px 0 12px; color: var(--primary); }
.prose p { color: var(--text-secondary); margin-bottom: 16px; font-size: 1rem; line-height: 1.8; }
.prose ul { list-style: none; margin-bottom: 20px; }
.prose ul li {
  position: relative; padding-left: 20px;
  color: var(--text-secondary); margin-bottom: 8px;
}
.prose ul li::before {
  content: ''; position: absolute; left: 0; top: 10px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}

/* --- Research Cards --- */
.research-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 16px; padding: 36px;
  transition: all var(--transition-med);
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.research-card::before {
  content: ''; position: absolute; top: 0; left: 0;
  width: 100%; height: 3px;
  background: var(--gradient-accent);
  opacity: 0; transition: opacity var(--transition-fast);
}
.research-card:hover::before { opacity: 1; }
.research-card:hover {
  border-color: rgba(91, 76, 219, 0.25);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.research-number {
  font-family: var(--font-heading);
  font-size: 3rem; font-weight: 900;
  background: var(--gradient-accent);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; opacity: 0.25; line-height: 1;
  margin-bottom: 12px;
}
.research-card h3 { font-size: 1.15rem; margin-bottom: 12px; color: var(--text-primary); }
.research-card p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.7; }

/* --- Photo Gallery --- */
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 40px;
}
.photo-gallery.gallery-hero {
  grid-template-columns: 1fr;
}
.photo-gallery.gallery-hero .photo-item:first-child {
  grid-column: 1 / -1;
}
.photo-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  transition: all var(--transition-med);
  aspect-ratio: 16 / 9;
  box-shadow: var(--shadow-sm);
}
.photo-item:hover {
  border-color: rgba(91, 76, 219, 0.25);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.photo-item:hover img {
  transform: scale(1.03);
}
.photo-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  background: linear-gradient(transparent, rgba(26, 29, 46, 0.8));
  font-size: 0.85rem;
  color: #F0F0F5;
  font-weight: 500;
}
.photo-gallery-full {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 16px;
  margin-top: 40px;
}
.photo-gallery-full .photo-item:first-child {
  grid-column: 1 / -1;
  aspect-ratio: 21 / 9;
}
@media (max-width: 768px) {
  .photo-gallery,
  .photo-gallery-full {
    grid-template-columns: 1fr;
  }
  .photo-gallery-full .photo-item:first-child {
    aspect-ratio: 16 / 9;
  }
}

/* --- Section Alt Backgrounds --- */
.section[style*="background: rgba(108, 92, 231, 0.03)"],
.section[style*="background: rgba(108, 92, 231, 0.05)"] {
  background: var(--light-surface) !important;
}

/* --- Scroll Reveal Animation --- */
.reveal {
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* --- Responsive --- */
@media (max-width: 992px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .stats-bar { grid-template-columns: repeat(2, 1fr); gap: 32px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .nav-links, .nav-cta { display: none; }
  .nav-toggle { display: block; }
  .navbar.open .nav-links {
    display: flex; flex-direction: column;
    position: absolute; top: 72px; left: 0; width: 100%;
    background: rgba(255, 255, 255, 0.98); padding: 24px;
    border-bottom: 1px solid var(--border-light);
  }
  .navbar.open .nav-cta {
    display: inline-flex; position: absolute;
    top: 80px; right: 24px;
  }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
  .hero { padding: 100px 20px 60px; }
  .section { padding: 60px 0; }
}
