/* ============================================
   IEEE NEMS 2027 - V2 主樣式表
   設計靈感：IEEE ICRA 2025
   色系：紫色 + 青藍 + 深藍海軍
   ============================================ */

/* --- CSS 變數 --- */
:root {
  --color-primary: #6300E2;
  --color-primary-dark: #4A00AA;
  --color-secondary: #00B4D8;
  --color-accent: #FFB703;
  --color-navy: #0A1628;
  --color-navy-light: #132244;
  --color-pink: #E2498A;
  --color-text: #1a1a2e;
  --color-text-light: #555;
  --color-text-white: #FFFFFF;
  --color-bg-light: #F4F6FA;
  --color-bg-white: #FFFFFF;
  --color-border: #E1E2E2;
  --color-red: #cc0000;
  --content-width: 1140px;
  --font-heading: 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
  /* 漸層 */
  --gradient-primary: linear-gradient(96deg, var(--color-navy) 0%, var(--color-primary) 100%);
  --gradient-footer: linear-gradient(90deg, var(--color-primary) 50%, var(--color-secondary) 100%);
  --gradient-hero: linear-gradient(135deg, var(--color-navy) 0%, var(--color-primary-dark) 50%, var(--color-primary) 100%);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg-white);
  overflow-x: hidden;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.25s;
}

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

img { max-width: 100%; height: auto; }

/* --- 共用容器 --- */
.container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Header --- */
.site-header {
  background: var(--color-bg-white);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: box-shadow 0.3s;
}

.site-header.scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.header-title-bar {
  padding: 10px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  max-width: var(--content-width);
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.header-title-bar h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.header-title-bar h1 a {
  color: var(--color-navy);
  text-decoration: none;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- 語言切換按鈕 --- */
.lang-toggle {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: 50px;
  background: var(--color-bg-white);
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-text);
  transition: all 0.25s;
}

.lang-toggle:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(99, 0, 226, 0.08);
}

.lang-toggle .lang-icon { font-size: 0.9rem; }

/* --- 導覽列 --- */
.nav-bar {
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.nav-bar .container {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 0;
}

.nav-menu > li { position: relative; }

.nav-menu > li > a {
  display: block;
  padding: 12px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  transition: color 0.25s;
}

.nav-menu > li > a:hover,
.nav-menu > li.active > a {
  color: var(--color-primary);
}

/* 目前頁面指示三角形（ICRA 風格） */
.nav-menu > li.active > a::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid var(--color-primary);
}

/* 下拉選單 */
.nav-menu > li > .submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 230px;
  background: var(--color-primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 100;
  list-style: none;
  margin-top: 1px;
}

.nav-menu > li:hover > .submenu { display: block; }

.submenu li a {
  display: block;
  padding: 12px 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  transition: background 0.2s;
}

.submenu li:last-child a { border-bottom: none; }

.submenu li a:hover {
  background: var(--color-navy);
  color: #fff;
}

/* 漢堡選單 */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  margin: 5px 0;
  transition: all 0.3s;
}

.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* === HERO BANNER（全新設計） === */
.hero-banner {
  position: relative;
  min-height: 620px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--color-navy);
}

/* 粒子動畫背景容器 */
#particles-js {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* 背景圖片（如果有的話）*/
.hero-bg-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0.15;
  z-index: 0;
}

.hero-overlay {
  position: relative;
  z-index: 2;
  text-align: center;
  color: #fff;
  padding: 60px 24px;
  max-width: 850px;
}

.hero-overlay .conference-series {
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 3px;
  text-transform: uppercase;
  opacity: 0.8;
  margin-bottom: 16px;
}

.hero-overlay h2 {
  font-size: 4rem;
  font-weight: 800;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #fff 0%, var(--color-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-overlay .conference-full-name {
  font-size: 1.1rem;
  font-weight: 300;
  opacity: 0.9;
  margin-bottom: 24px;
  line-height: 1.5;
}

.hero-overlay .conference-info {
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.hero-overlay .conference-info i {
  margin-right: 4px;
  color: var(--color-secondary);
}

.hero-overlay .divider {
  margin: 0 14px;
  opacity: 0.4;
}

.hero-overlay .hero-venue {
  font-size: 0.95rem;
  opacity: 0.7;
  margin-top: 8px;
}

/* Hero CTA 按鈕 */
.hero-buttons {
  margin-top: 32px;
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* === 按鈕（ICRA 風格 pill 按鈕） === */
.btn {
  display: inline-block;
  padding: 12px 32px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-navy);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(99, 0, 226, 0.3);
}

.btn-secondary {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.6);
}

.btn-secondary:hover {
  background: #fff;
  color: var(--color-navy);
  border-color: #fff;
  transform: translateY(-2px);
}

.btn-accent {
  background: var(--color-accent);
  color: var(--color-navy);
}

.btn-accent:hover {
  background: #fff;
  color: var(--color-navy);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 183, 3, 0.3);
}

/* === 統計數字橫幅（ICRA 風格） === */
.stats-bar {
  background: var(--gradient-primary);
  padding: 40px 0;
  color: #fff;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  text-align: center;
}

.stat-item .stat-number {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 6px;
  color: var(--color-secondary);
}

.stat-item .stat-label {
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.85;
}

/* === 區塊通用 === */
.section {
  padding: 60px 0;
}

.section-alt {
  background: var(--color-bg-light);
}

/* 對角裁切角落（ICRA 風格） */
.section-trim-purple {
  background-image: linear-gradient(133deg, var(--color-bg-white) 93%, var(--color-primary) 93%);
}

.section-trim-cyan {
  background-image: linear-gradient(133deg, var(--color-bg-white) 93%, var(--color-secondary) 93%);
}

.section-trim-navy {
  background-image: linear-gradient(133deg, var(--color-bg-light) 93%, var(--color-navy) 93%);
}

/* 漸層色帶分隔線 */
.gradient-divider {
  height: 4px;
  background: linear-gradient(to right, var(--color-navy), var(--color-primary), var(--color-primary), var(--color-secondary));
  border: none;
}

/* === 標題樣式 === */
.content-h1 {
  font-size: 2.8rem;
  font-weight: 300;
  color: var(--color-text);
  margin: 40px 0 24px;
  line-height: 1.2;
}

.content-h2 {
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-bottom: 10px;
  margin-top: 2rem;
  margin-bottom: 1rem;
  border-bottom: 3px solid var(--color-primary);
}

.content-h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-top: 1.2rem;
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: 2rem;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.section-title.white { color: #fff; }

.section-subtitle {
  font-size: 1rem;
  color: var(--color-text-light);
  margin-bottom: 32px;
}

.section-subtitle.white {
  color: rgba(255, 255, 255, 0.7);
}

/* === 公告框 === */
.announcement-box {
  border: 3px double var(--color-primary);
  border-radius: 8px;
  padding: 24px 28px;
  margin: 24px 0;
  text-align: center;
  font-size: 1rem;
  line-height: 1.7;
  background: rgba(99, 0, 226, 0.03);
}

/* === 雙欄佈局 === */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-top: 16px;
}

/* === What's New 列表 === */
.news-list {
  list-style: none;
}

.news-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.news-list li .icon {
  color: var(--color-primary);
  margin-top: 4px;
  flex-shrink: 0;
}

.news-list .date {
  font-weight: 700;
  display: block;
  font-size: 0.88rem;
  color: var(--color-primary);
}

/* === Important Dates 列表 === */
.dates-list {
  list-style: none;
}

.dates-list li {
  padding: 12px 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1px solid var(--color-border);
}

.dates-list li:last-child { border-bottom: none; }

.dates-list li .icon {
  color: var(--color-primary);
  margin-top: 4px;
  flex-shrink: 0;
  font-size: 1.1rem;
}

.dates-list .label { font-weight: 700; }

.text-red { color: var(--color-red); font-weight: 700; }
.text-link { color: var(--color-primary); text-decoration: underline; }
.text-link:hover { color: var(--color-pink); }

/* === 歷屆會議 === */
.history-list {
  columns: 2;
  column-gap: 40px;
  list-style: none;
  margin-top: 12px;
}

.history-list li {
  padding: 4px 0;
  font-size: 0.92rem;
}

.history-list li strong { color: var(--color-primary); }

/* === 研究主題卡片（SIGGRAPH 風格發光卡） === */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.topic-card {
  background: var(--color-navy);
  border-radius: 12px;
  padding: 20px 24px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.3s;
  border: 1px solid rgba(99, 0, 226, 0.3);
}

.topic-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(99, 0, 226, 0.25);
  border-color: var(--color-primary);
}

.topic-card .topic-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(99, 0, 226, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--color-secondary);
  font-size: 0.9rem;
}

.topic-card .topic-name {
  font-size: 0.9rem;
  font-weight: 500;
}

/* === 贊助商區塊 === */
.sponsors-section { padding: 40px 0; }

.sponsors-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 16px 0 28px;
}

.sponsor-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  min-height: 80px;
  transition: all 0.3s;
}

.sponsor-card:hover {
  box-shadow: 0 4px 20px rgba(99, 0, 226, 0.1);
  transform: translateY(-2px);
}

.sponsor-card img { max-height: 50px; object-fit: contain; }

/* === 漸層色區塊（講者/CTA 用） === */
.gradient-section {
  background: var(--gradient-primary);
  color: #fff;
  padding: 60px 0;
}

.gradient-section-footer {
  background: var(--gradient-footer);
  color: #fff;
  padding: 40px 0;
}

/* === 倒數計時器 === */
.countdown {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin: 24px 0;
}

.countdown-item {
  text-align: center;
}

.countdown-item .count-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--color-secondary);
  line-height: 1;
}

.countdown-item .count-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.7;
  margin-top: 4px;
}

/* === Footer === */
.site-footer { margin-top: 0; }

.footer-main {
  background: var(--gradient-footer);
  padding: 40px 0 20px;
  color: #fff;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-orgs {
  display: flex;
  align-items: center;
  gap: 20px;
}

.footer-orgs .org-label {
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.footer-orgs img { height: 45px; object-fit: contain; }

.footer-social {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-social a {
  color: #fff;
  font-size: 1.2rem;
  transition: color 0.2s;
}

.footer-social a:hover { color: var(--color-accent); }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  margin-top: 20px;
  padding-top: 16px;
  text-align: center;
  font-size: 0.82rem;
  opacity: 0.8;
}

/* === 內頁通用 === */
/* 子頁面 Banner */
.page-banner {
  background: var(--gradient-primary);
  padding: 50px 0 40px;
  position: relative;
  overflow: hidden;
}

.page-banner::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(to right, var(--color-navy), var(--color-primary), var(--color-secondary));
}

.page-banner h1 {
  font-size: 2.5rem;
  font-weight: 300;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.page-content {
  padding: 20px 0 60px;
}

.page-content p {
  margin-bottom: 1rem;
  line-height: 1.8;
}

.page-content ul {
  margin: 0.5rem 0 1rem 1.5rem;
}

.page-content ul li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

/* === 表格 === */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.data-table th,
.data-table td {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.92rem;
}

.data-table th {
  background: var(--color-navy);
  color: #fff;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
}

.data-table td {
  border-bottom: 1px solid var(--color-border);
}

.data-table tbody tr:hover { background: rgba(99, 0, 226, 0.03); }

/* === 講者卡片 === */
.speaker-card {
  display: flex;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--color-border);
}

.speaker-card:last-child { border-bottom: none; }

.speaker-photo {
  width: 150px;
  height: 175px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: var(--color-bg-light);
}

.speaker-info h4 {
  color: var(--color-primary);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.speaker-info .speaker-name {
  font-weight: 700;
  font-size: 1.05rem;
}

.speaker-info .speaker-affiliation {
  color: var(--color-text-light);
  font-size: 0.9rem;
}

/* 手風琴 */
.accordion-toggle {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--color-primary);
  font-weight: 600;
  margin-top: 10px;
  padding: 4px 0;
  transition: color 0.2s;
}

.accordion-toggle:hover { color: var(--color-pink); }

.accordion-content {
  display: none;
  padding: 12px 0;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--color-text-light);
}

.accordion-content.open { display: block; }

/* === 研究主題 icon 列表 === */
.topic-list {
  list-style: none;
  margin: 12px 0;
}

.topic-list li {
  padding: 8px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
}

.topic-list li .icon {
  color: var(--color-primary);
  font-size: 0.7rem;
}

/* === AOS 動畫 === */
[data-aos] {
  opacity: 0;
  transition-property: opacity, transform;
}

[data-aos].aos-animate { opacity: 1; }

[data-aos="fade-up"] { transform: translateY(30px); }
[data-aos="fade-up"].aos-animate { transform: translateY(0); }

[data-aos="fade-in"] { opacity: 0; }
[data-aos="fade-in"].aos-animate { opacity: 1; }

[data-aos="fade-right"] { transform: translateX(-30px); }
[data-aos="fade-right"].aos-animate { transform: translateX(0); }

[data-aos="fade-left"] { transform: translateX(30px); }
[data-aos="fade-left"].aos-animate { transform: translateX(0); }

/* === 聯絡資訊卡片 === */
.contact-card {
  margin: 20px 0;
  padding: 28px;
  background: var(--color-bg-light);
  border-radius: 12px;
  border-left: 4px solid var(--color-primary);
}

.contact-card p {
  margin-bottom: 0.5rem;
}

.contact-card i {
  color: var(--color-primary);
  width: 22px;
}

/* === RWD 響應式 === */
@media (max-width: 1024px) {
  .nav-toggle { display: block; }

  .nav-menu {
    display: none;
    flex-direction: column;
    width: 100%;
    background: var(--color-bg-white);
    border-top: 1px solid var(--color-border);
  }

  .nav-menu.open { display: flex; }

  .nav-menu > li > a {
    padding: 12px 20px;
    border-bottom: 1px solid #f0f0f0;
  }

  .nav-menu > li > .submenu {
    position: static;
    box-shadow: none;
  }

  .nav-menu > li > .submenu { display: none; }
  .nav-menu > li.submenu-open > .submenu { display: block; }

  .submenu li a { padding-left: 40px; }

  .content-h1, .page-banner h1 { font-size: 2rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .two-col { grid-template-columns: 1fr; gap: 24px; }
  .topics-grid { grid-template-columns: 1fr; }
  .sponsors-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-overlay h2 { font-size: 2.5rem; }
  .hero-overlay .conference-full-name { font-size: 0.95rem; }
  .hero-banner { min-height: 500px; }
  .history-list { columns: 1; }
  .speaker-card { flex-direction: column; align-items: center; text-align: center; }
  .footer-content { flex-direction: column; text-align: center; }
  .countdown-item .count-number { font-size: 1.8rem; }
  .stat-item .stat-number { font-size: 2rem; }
}

@media (max-width: 480px) {
  .sponsors-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .hero-overlay { padding: 40px 16px; }
  .hero-overlay h2 { font-size: 2rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
  .countdown { gap: 14px; }
}
