/* ===== CUSTOM PROPERTIES ===== */
:root {
  /* Colors */
  --raw-seinna: hsl(24, 74%, 58%);
  --sizzling-sunrise: hsl(51, 95%, 54%);
  --scarlet: hsl(13, 96%, 47%);
  --black: hsl(0, 0%, 0%);
  --white: hsl(0, 0%, 100%);
  --taiwan-red: hsl(0, 85%, 50%);
  --taiwan-blue: hsl(213, 100%, 40%);
  --temple-gold: hsl(45, 100%, 50%);
  --cultural-orange: hsl(25, 95%, 55%);

  /* Typography */
  --ff-saira-stencil-one: "Saira Stencil One", sans-serif;
  --ff-poppins: 'Poppins', sans-serif;
  --ff-roboto: 'Roboto', sans-serif;
  --ff-noto-sans: 'Noto Sans TC', sans-serif;

  /* Font Sizes */
  --fs-1: 2.5rem;
  --fs-2: calc(1.813rem + 1vw);
  --fs-3: calc(1.313rem + 1vw);
  --fs-4: 1.4rem;
  --fs-5: 1rem;
  --fs-6: 0.813rem;
  --fs-7: 0.75rem;

  /* Font Weights */
  --fw-400: 400;
  --fw-700: 700;

  /* Transitions */
  --transition-1: 0.25s ease-in-out;
  --transition-2: 0.5s ease-in-out;

  /* Spacing */
  --section-padding: 80px;

  /* Border Radius */
  --radius-4: 4px;
  --radius-8: 8px;
  --radius-12: 12px;
  --radius-16: 16px;
}

/* ===== DARK THEME ===== */
body.dark_theme {
  --bg-primary: hsl(220, 20%, 10%);
  --bg-secondary: hsl(220, 18%, 15%);
  --bg-tertiary: hsl(220, 15%, 20%);
  --color-primary: hsl(0, 0%, 100%);
  --color-secondary: hsl(0, 0%, 70%);
  --card-shadow: hsla(0, 0%, 0%, 0.5);
  --input-bg: hsl(220, 15%, 18%);
  --shadow-1: 0 10px 40px var(--card-shadow);
  --shadow-2: 0 5px 20px var(--card-shadow);
}

/* ===== LIGHT THEME ===== */
body.light_theme {
  --bg-primary: hsl(0, 0%, 95%);
  --bg-secondary: hsl(0, 0%, 100%);
  --bg-tertiary: hsl(0, 0%, 98%);
  --color-primary: hsl(0, 0%, 12%);
  --color-secondary: hsl(0, 0%, 40%);
  --card-shadow: hsla(0, 0%, 0%, 0.12);
  --input-bg: hsl(0, 0%, 93%);
  --shadow-1: 0 10px 40px var(--card-shadow);
  --shadow-2: 0 5px 20px var(--card-shadow);
}

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

li {
  list-style: none;
}

a {
  text-decoration: none;
}

a,
img,
time,
span,
input,
label,
select,
button,
textarea,
ion-icon {
  display: block;
}

input,
button,
select,
textarea {
  background: none;
  border: none;
  font: inherit;
}

button,
select {
  cursor: pointer;
}

input,
textarea {
  width: 100%;
}

ion-icon {
  pointer-events: none;
}

:is(a, button, select) {
  outline-color: var(--cultural-orange);
  outline-offset: 3px;
}

::selection {
  background: var(--taiwan-red);
  color: var(--white);
}

/* ===== BASE STYLES ===== */
html {
  font-family: var(--ff-noto-sans);
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  background: var(--bg-primary);
  color: var(--color-primary);
  transition: var(--transition-1);
  overflow-x: hidden;
}

body.active {
  overflow: hidden;
}

.container {
  padding-inline: 15px;
  max-width: 1200px;
  margin-inline: auto;
}

/* ===== TYPOGRAPHY ===== */
.h1 {
  font-size: var(--fs-1);
  line-height: 1.2;
  font-weight: var(--fw-700);
  font-family: var(--ff-noto-sans);
}

.h2,
.h3,
.h4 {
  color: var(--color-primary);
  font-family: var(--ff-noto-sans);
  line-height: 1.3;
  font-weight: var(--fw-700);
}

.h2 {
  font-size: var(--fs-2);
}

.h3 {
  font-size: var(--fs-3);
}

.h4 {
  font-size: var(--fs-5);
}

.w-100 {
  width: 100%;
}

/* ===== BUTTONS ===== */
.btn {
  max-width: max-content;
  color: var(--color-primary);
  font-weight: var(--fw-700);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 12px 30px;
  border: 2px solid transparent;
  border-radius: var(--radius-8);
  transition: var(--transition-1);
  font-size: var(--fs-6);
  display: inline-block;
}

.btn-primary {
  border-color: var(--taiwan-red);
  color: var(--taiwan-red);
}

.btn-primary:is(:hover, :focus) {
  background: var(--taiwan-red);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 5px 20px hsla(0, 85%, 50%, 0.3);
}

.btn-secondary {
  background: var(--cultural-orange);
  border-color: var(--cultural-orange);
  color: var(--white);
}

.btn-secondary:is(:hover, :focus) {
  background: hsl(25, 95%, 60%);
  transform: translateY(-2px);
  box-shadow: 0 5px 20px hsla(25, 95%, 55%, 0.3);
}

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

/* ===== SECTIONS ===== */
.section-header {
  text-align: center;
  margin-bottom: 50px;
}

.section-subtitle {
  position: relative;
  color: var(--cultural-orange);
  text-transform: uppercase;
  font-weight: var(--fw-700);
  letter-spacing: 2px;
  padding-bottom: 8px;
  margin-bottom: 15px;
  font-size: var(--fs-6);
  display: inline-block;
}

.section-subtitle::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--cultural-orange);
  border-radius: 10px;
}

.section-title {
  max-width: 600px;
  margin-inline: auto;
  margin-bottom: 20px;
  text-align: center;
}

.section-text {
  color: var(--color-secondary);
  line-height: 1.8;
  margin-bottom: 20px;
  text-align: center;
  max-width: 800px;
  margin-inline: auto;
}

/* ===== TOOLTIP ===== */
.tooltip {
  position: absolute;
  top: -40px;
  background: var(--cultural-orange);
  min-width: max-content;
  color: var(--white);
  font-size: 13px;
  font-weight: var(--fw-700);
  padding: 6px 12px;
  border-radius: var(--radius-4);
  box-shadow: var(--shadow-2);
  transform: translateY(-10px);
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-1);
  z-index: 10;
}

/* ===== HEADER ===== */
.header {
  padding-block: 20px;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  transition: var(--transition-1);
  z-index: 100;
}

.header.active {
  padding-block: 15px;
  background: var(--bg-secondary);
  box-shadow: var(--shadow-1);
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.logo {
  position: relative;
  min-width: max-content;
  z-index: 2;
}

.logo a {
  color: var(--color-primary);
  font-family: var(--ff-noto-sans);
  font-weight: var(--fw-700);
  font-size: 1.5rem;
}

.logo span {
  display: inline-block;
  color: var(--taiwan-red);
  margin-left: 2px;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-left: auto;
}

.navbar-actions select {
  color: var(--color-primary);
  width: 60px;
  padding: 5px;
  border-radius: var(--radius-4);
  background: var(--bg-tertiary);
}

.navbar-actions option {
  background: var(--bg-primary);
  color: var(--color-primary);
}

.theme-btn {
  padding: 4px;
  width: 48px;
  background: var(--bg-tertiary);
  border-radius: 100px;
  transition: var(--transition-1);
}

.header.active .theme-btn {
  background: var(--bg-primary);
}

.theme-btn .icon {
  position: relative;
  left: 0;
  width: 20px;
  height: 20px;
  border-radius: 50px;
  box-shadow: inset 9px -6px var(--color-primary);
  transition: var(--transition-1);
}

.theme-btn.active .icon {
  left: 20px;
  box-shadow: inset 20px -20px var(--sizzling-sunrise);
}

.nav-toggle-btn {
  position: relative;
  transform: rotate(-55deg);
  transition: var(--transition-1);
  z-index: 101;
}

.nav-toggle-btn.active {
  transform: rotate(-45deg);
}

.nav-toggle-btn span {
  width: 20px;
  height: 2px;
  background: var(--color-primary);
  margin: 5px;
  transition: var(--transition-1);
}

.nav-toggle-btn :is(.one, .three) {
  width: 10px;
}

.nav-toggle-btn .one {
  margin-left: auto;
  transform-origin: left;
}

.nav-toggle-btn .three {
  transform-origin: right;
}

.nav-toggle-btn.active .one {
  transform: rotate(90deg) translateX(-3px);
}

.nav-toggle-btn.active .three {
  transform: rotate(90deg) translateX(3px);
}

.navbar {
  position: fixed;
  background: var(--bg-secondary);
  top: 100%;
  left: 0;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  visibility: hidden;
  transition: 0.75s cubic-bezier(0.71, 0.01, 0.24, 0.99);
  transition-delay: 0.5s;
  z-index: 99;
}

.navbar.active {
  top: 0;
  visibility: visible;
  transition-delay: 0s;
}

.navbar-list>li {
  margin-block: 20px;
  padding-inline: 50px;
  overflow: hidden;
}

.navbar-link {
  position: relative;
  width: max-content;
  margin-inline: auto;
  color: var(--color-primary);
  font-family: var(--ff-noto-sans);
  font-size: var(--fs-3);
  font-weight: var(--fw-700);
  padding: 10px;
  transform: translateY(50px);
  transition: 0.75s cubic-bezier(0.68, -0.55, 0.27, 2);
}

.navbar.active .navbar-link {
  transform: translateY(0);
  transition-delay: 0.5s;
}

.navbar-link::before {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 0;
  height: 4px;
  width: 0;
  background: var(--taiwan-red);
  border-radius: 10px;
  transition: var(--transition-1);
}

.navbar-link:is(:hover, :focus)::before {
  width: 100%;
}

/* ===== HERO SECTION ===== */
main {
  overflow-x: hidden;
}

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding-top: 100px;
  padding-bottom: 50px;
  position: relative;
  text-align: center;
}

.hero-banner {
  max-width: 600px;
  width: 100%;
  margin-bottom: 40px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-20px);
  }
}

.hero-content {
  max-width: 700px;
  z-index: 1;
}

.hero-title {
  margin-bottom: 20px;
  font-size: clamp(1.8rem, 5vw, 3rem);
  background: linear-gradient(135deg, var(--taiwan-red), var(--cultural-orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  color: var(--color-secondary);
  font-size: var(--fs-4);
  margin-bottom: 30px;
  letter-spacing: 1px;
}

.hero .btn {
  margin: 10px;
}

.hero-social-list {
  display: none;
}

.scroll-down {
  display: none;
}

/* ===== STATS SECTION ===== */
.stats {
  padding-block: var(--section-padding);
  background: var(--bg-primary);
}

.stats .container {
  background: var(--bg-secondary);
  padding: 50px 40px;
  border-radius: var(--radius-16);
  box-shadow: var(--shadow-1);
}

.stats-list {
  display: grid;
  gap: 30px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.stats-card {
  background: var(--bg-primary);
  padding: 30px;
  border-radius: var(--radius-16);
  box-shadow: var(--shadow-2);
  transition: var(--transition-2);
  text-align: center;
}

.stats-card:is(:hover, :focus) {
  transform: translateY(-10px);
  box-shadow: var(--shadow-1);
}

.stats-card .card-icon {
  background: linear-gradient(135deg, var(--taiwan-red), var(--cultural-orange));
  width: 80px;
  height: 80px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  margin-inline: auto;
  margin-bottom: 20px;
}

.stats-card .card-icon img {
  width: 50%;
  filter: brightness(0) invert(1);
}

.stats-card .card-title {
  color: var(--taiwan-red);
  margin-bottom: 10px;
  font-size: var(--fs-2);
}

.stats-card .card-title strong {
  display: block;
  color: var(--color-primary);
  font-size: var(--fs-5);
  margin-top: 8px;
  font-weight: var(--fw-400);
}

.stats-card .card-text {
  color: var(--color-secondary);
  line-height: 1.6;
  font-size: var(--fs-6);
}

/* ===== ABOUT SECTION ===== */
.about {
  padding-block: var(--section-padding);
}

.about-banner {
  max-width: 500px;
  width: 100%;
  /* 🔥 確保有寬度 */
  margin-inline: auto;
  margin-bottom: 50px;
  border-radius: var(--radius-16);
  overflow: hidden;
  box-shadow: var(--shadow-1);
}

.about-banner img {
  transition: var(--transition-2);
}

.about-banner:hover img {
  transform: scale(1.05);
}

.about-content {
  max-width: 800px;
  margin-inline: auto;
}

.project-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.info-item {
  background: var(--bg-secondary);
  padding: 20px;
  border-radius: var(--radius-12);
  text-align: center;
  box-shadow: var(--shadow-2);
}

.info-item h4 {
  color: var(--cultural-orange);
  margin-bottom: 10px;
  font-size: var(--fs-6);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.info-item p {
  color: var(--color-secondary);
  font-size: var(--fs-5);
}

/* ===== FEATURES SECTION ===== */
.features {
  padding-block: var(--section-padding);
  background: var(--bg-primary);
}

.features .container {
  background: var(--bg-secondary);
  padding: 50px 40px;
  border-radius: var(--radius-16);
  box-shadow: var(--shadow-1);
}

.features-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 50px;
}

.feature-card {
  background: var(--bg-primary);
  padding: 35px 25px;
  border-radius: var(--radius-16);
  box-shadow: var(--shadow-2);
  transition: var(--transition-2);
  text-align: center;
}

.feature-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-1);
}

.feature-card .card-icon {
  font-size: 3rem;
  color: var(--taiwan-red);
  margin-bottom: 20px;
}

.feature-card .card-title {
  margin-bottom: 15px;
  font-size: var(--fs-4);
}

.feature-card .card-text {
  color: var(--color-secondary);
  line-height: 1.7;
  font-size: var(--fs-6);
}

/* ===== TECH SECTION ===== */
.tech {
  padding-block: var(--section-padding);
  background: var(--bg-primary);
}

.tech .container {
  background: var(--bg-secondary);
  padding: 50px 40px;
  border-radius: var(--radius-16);
  box-shadow: var(--shadow-1);
}

.tech-content {
  max-width: 1000px;
  margin-inline: auto;
}

.tech-description {
  margin-bottom: 50px;
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-bottom: 50px;
}

.tech-category {
  background: var(--bg-primary);
  padding: 25px;
  border-radius: var(--radius-12);
  box-shadow: var(--shadow-2);
}

.tech-category h3 {
  color: var(--cultural-orange);
  margin-bottom: 20px;
  font-size: var(--fs-5);
  text-align: center;
}

.tech-items {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
}

.tech-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 15px;
  background: var(--bg-secondary);
  border-radius: var(--radius-8);
  transition: var(--transition-1);
}

.tech-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-2);
}

.tech-item img {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

.tech-item span {
  font-size: var(--fs-7);
  color: var(--color-secondary);
}

.tech-features-list {
  background: var(--bg-primary);
  padding: 30px;
  border-radius: var(--radius-12);
  box-shadow: var(--shadow-2);
}

.tech-features-list h3 {
  color: var(--taiwan-red);
  margin-bottom: 20px;
}

.tech-features-list ul {
  display: grid;
  gap: 15px;
}

.tech-features-list li {
  display: flex;
  align-items: center;
  gap: 15px;
  color: var(--color-secondary);
  line-height: 1.6;
}

.tech-features-list ion-icon {
  color: var(--cultural-orange);
  font-size: 24px;
  flex-shrink: 0;
}


/* ===== GAMEPLAY TIMELINE ===== */
.gameplay {
  padding-block: var(--section-padding);
}

.gameplay-timeline {
  max-width: 900px;
  margin-inline: auto;
  margin-top: 50px;
}

.timeline-item {
  display: flex;
  gap: 30px;
  margin-bottom: 60px;
  position: relative;
}

.timeline-item:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 30px;
  top: 70px;
  width: 2px;
  height: calc(100% + 20px);
  background: var(--cultural-orange);
  opacity: 0.3;
}

.timeline-number {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--taiwan-red), var(--cultural-orange));
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--white);
  font-size: var(--fs-4);
  font-weight: var(--fw-700);
  box-shadow: var(--shadow-2);
  z-index: 1;
}

.timeline-content {
  flex: 1;
  background: var(--bg-secondary);
  padding: 25px;
  border-radius: var(--radius-12);
  box-shadow: var(--shadow-2);
}

.timeline-content h3 {
  color: var(--taiwan-red);
  margin-bottom: 15px;
}

.timeline-content p {
  color: var(--color-secondary);
  line-height: 1.7;
  margin-bottom: 20px;
}

.timeline-image {
  border-radius: var(--radius-8);
  overflow: hidden;
  margin-top: 15px;
  aspect-ratio: 16/9;
  background: #000;
}

.timeline-image img,
.timeline-image video {
  width: 100%;
  transition: var(--transition-2);
}

.timeline-image:hover img,
.timeline-image:hover video {
  transform: scale(1.05);
}

/* ===== TECH SECTION ===== */
.tech {
  padding-block: var(--section-padding);
  background: var(--bg-secondary);
}

.tech-content {
  max-width: 1000px;
  margin-inline: auto;
}

.tech-description {
  margin-bottom: 50px;
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-bottom: 50px;
}

.tech-category {
  background: var(--bg-primary);
  padding: 25px;
  border-radius: var(--radius-12);
  box-shadow: var(--shadow-2);
}

.tech-category h3 {
  color: var(--cultural-orange);
  margin-bottom: 20px;
  font-size: var(--fs-5);
  text-align: center;
}

.tech-items {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
}

.tech-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 15px;
  background: var(--bg-secondary);
  border-radius: var(--radius-8);
  transition: var(--transition-1);
}

.tech-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-2);
}

.tech-item img {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

.tech-item span {
  font-size: var(--fs-7);
  color: var(--color-secondary);
}

.tech-features-list {
  background: var(--bg-primary);
  padding: 30px;
  border-radius: var(--radius-12);
  box-shadow: var(--shadow-2);
}

.tech-features-list h3 {
  color: var(--taiwan-red);
  margin-bottom: 20px;
}

.tech-features-list ul {
  display: grid;
  gap: 15px;
}

.tech-features-list li {
  display: flex;
  align-items: center;
  gap: 15px;
  color: var(--color-secondary);
  line-height: 1.6;
}

.tech-features-list ion-icon {
  color: var(--cultural-orange);
  font-size: 24px;
  flex-shrink: 0;
}

/* ===== TEAM SECTION ===== */
.team {
  padding-block: var(--section-padding);
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-bottom: 60px;
}

.team-member {
  background: var(--bg-secondary);
  padding: 25px;
  border-radius: var(--radius-16);
  box-shadow: var(--shadow-2);
  text-align: center;
  transition: var(--transition-2);
}

.team-member:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-1);
}

.member-image {
  width: 150px;
  height: 150px;
  margin-inline: auto;
  margin-bottom: 20px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--taiwan-red);
}

.member-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.member-name {
  margin-bottom: 5px;
  color: var(--color-primary);
}

.member-id {
  color: var(--color-secondary);
  font-size: var(--fs-7);
  margin-bottom: 10px;
}

.member-role {
  color: var(--cultural-orange);
  font-weight: var(--fw-700);
  margin-bottom: 15px;
  font-size: var(--fs-6);
}

.member-tasks {
  text-align: left;
  margin-top: 15px;
}

.member-tasks li {
  color: var(--color-secondary);
  font-size: var(--fs-7);
  padding: 5px 0;
  padding-left: 20px;
  position: relative;
}

.member-tasks li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--taiwan-red);
}

.advisor-section {
  margin-top: 60px;
}

.advisor-section h3 {
  text-align: center;
  color: var(--cultural-orange);
  margin-bottom: 30px;
  font-size: var(--fs-3);
}

.advisor-card {
  background: var(--bg-secondary);
  padding: 30px;
  border-radius: var(--radius-16);
  box-shadow: var(--shadow-2);
  display: flex;
  align-items: center;
  gap: 30px;
  max-width: 600px;
  margin-inline: auto;
  transition: transform 0.6s cubic-bezier(.4, 0, .2, 1), box-shadow 0.4s cubic-bezier(.4, 0, .2, 1);
}

.advisor-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-1);
}

.advisor-image {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--cultural-orange);
  flex-shrink: 0;
}

.advisor-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.advisor-info h4 {
  color: var(--color-primary);
  margin-bottom: 5px;
}

.advisor-info p {
  color: var(--color-secondary);
  font-size: var(--fs-6);
  line-height: 1.6;
}

.advisor-description {
  margin-top: 10px;
}

.gallery {
  padding-block: var(--section-padding);
  background: var(--bg-primary);
}

.gallery .container {
  background: var(--bg-secondary);
  padding: 50px 40px;
  border-radius: var(--radius-16);
  box-shadow: var(--shadow-1);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
  margin-bottom: 60px;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-12);
  overflow: hidden;
  box-shadow: var(--shadow-2);
  cursor: pointer;
  aspect-ratio: 4/3;
}

.gallery-item img,
.gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-2);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, hsla(0, 0%, 0%, 0.8), transparent);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  opacity: 0;
  transition: var(--transition-1);
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-item:hover img,
.gallery-item:hover video {
  transform: scale(1.1);
}

.gallery-overlay h4 {
  color: var(--white);
  margin-bottom: 5px;
}

.gallery-overlay p {
  color: hsla(0, 0%, 100%, 0.8);
  font-size: var(--fs-7);
}


.video-section {
  margin-top: 60px;
}

.video-section h3 {
  text-align: center;
  color: var(--taiwan-red);
  margin-bottom: 30px;
  font-size: var(--fs-3);
}

.video-container {
  max-width: 900px;
  margin-inline: auto;
  border-radius: var(--radius-12);
  overflow: hidden;
  box-shadow: var(--shadow-1);
  aspect-ratio: 16/9;
}

.video-container iframe {
  width: 100%;
  height: 100%;
}

/* ===== DOWNLOAD SECTION ===== */
.download {
  padding-block: var(--section-padding);
}

.download-content {
  max-width: 1000px;
  margin-inline: auto;
}

.download-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-block: 50px;
}

.download-card {
  background: var(--bg-secondary);
  padding: 35px 25px;
  border-radius: var(--radius-16);
  box-shadow: var(--shadow-2);
  text-align: center;
  transition: var(--transition-2);
}

.download-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-1);
}

.platform-icon {
  font-size: 4rem;
  color: var(--taiwan-red);
  margin-bottom: 20px;
}

.download-card h3 {
  margin-bottom: 10px;
}

.download-card p {
  color: var(--color-secondary);
  font-size: var(--fs-6);
  margin-bottom: 5px;
}

.version {
  color: var(--cultural-orange);
  font-weight: var(--fw-700);
  margin-bottom: 20px !important;
}

.download-card .btn {
  width: 100%;
  max-width: 100%;
}

.system-requirements {
  background: var(--bg-secondary);
  padding: 40px;
  border-radius: var(--radius-16);
  box-shadow: var(--shadow-2);
  margin-bottom: 50px;
}

.system-requirements h3 {
  text-align: center;
  color: var(--taiwan-red);
  margin-bottom: 30px;
  font-size: var(--fs-3);
}

.requirements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.requirements-column h4 {
  color: var(--cultural-orange);
  margin-bottom: 20px;
  text-align: center;
}

.requirements-column ul {
  display: grid;
  gap: 12px;
}

.requirements-column li {
  color: var(--color-secondary);
  line-height: 1.6;
  font-size: var(--fs-6);
}

.requirements-column strong {
  color: var(--color-primary);
}

.newsletter-section {
  background: var(--bg-secondary);
  padding: 40px;
  border-radius: var(--radius-16);
  box-shadow: var(--shadow-2);
  text-align: center;
}

.newsletter-section h3 {
  color: var(--taiwan-red);
  margin-bottom: 15px;
}

.newsletter-section p {
  color: var(--color-secondary);
  margin-bottom: 25px;
}

.newsletter-form {
  display: flex;
  gap: 15px;
  max-width: 500px;
  margin-inline: auto;
  flex-wrap: wrap;
}

.newsletter-form input {
  flex: 1;
  min-width: 250px;
  padding: 12px 20px;
  background: var(--input-bg);
  color: var(--color-primary);
  border-radius: var(--radius-8);
  font-size: var(--fs-6);
}

.newsletter-form .btn {
  flex-shrink: 0;
}

/* ===== CONTACT SECTION ===== */
.contact {
  padding-block: var(--section-padding);
  background: var(--bg-primary);
}

.contact .container {
  background: var(--bg-secondary);
  padding: 50px 40px;
  border-radius: var(--radius-16);
  box-shadow: var(--shadow-1);
}

.contact-content {
  margin-bottom: 50px;
}

.contact-list {
  display: grid;
  gap: 25px;
  margin-bottom: 30px;
}

.contact-list-item {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  background: var(--bg-primary);
  padding: 20px;
  border-radius: var(--radius-12);
  box-shadow: var(--shadow-2);
}

.contact-item-icon {
  font-size: 28px;
  color: var(--taiwan-red);
  flex-shrink: 0;
}

.contact-item-icon ion-icon {
  --ionicon-stroke-width: 40px;
}

.contact-item-title {
  margin-bottom: 10px;
  color: var(--cultural-orange);
}

.contact-list-item .contact-info {
  color: var(--color-secondary);
  font-style: normal;
  line-height: 1.7;
  transition: var(--transition-1);
}

.contact-info:not(address):is(:hover, :focus) {
  color: var(--taiwan-red);
}

.contac-social-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-top: 20px;
}

.contact-social-link {
  position: relative;
  background: var(--taiwan-red);
  color: var(--white);
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 20px;
  transition: var(--transition-1);
}

.contact-social-link:is(:hover, :focus) {
  background: var(--cultural-orange);
  transform: translateY(-5px);
  box-shadow: 0 5px 20px hsla(25, 95%, 55%, 0.3);
}

.contact-social-link:is(:hover, :focus) .tooltip {
  transform: translateY(0);
  opacity: 1;
}

.contact-form {
  background: var(--bg-primary);
  padding: 40px;
  border-radius: var(--radius-16);
  box-shadow: var(--shadow-2);
}

.form-wrapper {
  margin-bottom: 25px;
}

.form-label {
  color: var(--color-primary);
  font-size: var(--fs-6);
  font-weight: var(--fw-700);
  margin-bottom: 10px;
  display: block;
}

.input-wrapper {
  position: relative;
}

.input-field {
  background: var(--input-bg);
  color: var(--color-primary);
  padding: 12px 15px;
  padding-left: 45px;
  border-radius: var(--radius-8);
  transition: var(--transition-1);
  border: 2px solid transparent;
  font-size: var(--fs-6);
}

.input-wrapper ion-icon {
  position: absolute;
  top: 12px;
  left: 12px;
  color: var(--color-secondary);
  font-size: 22px;
  transition: var(--transition-1);
}

textarea.input-field {
  min-height: 120px;
  max-height: 300px;
  resize: vertical;
  padding-top: 12px;
}

.input-field:focus {
  outline: none;
  border-color: var(--taiwan-red);
}

.input-field:focus+ion-icon {
  color: var(--taiwan-red);
}

.contact .btn-primary {
  width: 100%;
  background: var(--taiwan-red);
  color: var(--white);
  border-color: var(--taiwan-red);
}


/* ===== FOOTER ===== */
.footer {
  background: var(--bg-primary);
  padding-block: 30px;
  text-align: center;
  box-shadow: 0 -5px 20px var(--card-shadow);
}

.footer .logo {
  margin-bottom: 15px;
}

.copyright {
  color: var(--color-secondary);
  line-height: 1.7;
  margin-bottom: 10px;
  font-size: var(--fs-6);
}

.copyright a {
  display: inline;
  color: var(--taiwan-red);
  font-weight: var(--fw-700);
}

.footer-text {
  color: var(--color-secondary);
  font-size: var(--fs-7);
  line-height: 1.6;
}

/* ===== GO TO TOP ===== */
.go-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  font-size: 22px;
  color: var(--white);
  background: var(--taiwan-red);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: var(--transition-1);
  z-index: 50;
  box-shadow: var(--shadow-2);
}

.go-top.active {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.go-top:hover {
  background: var(--cultural-orange);
  box-shadow: 0 5px 20px hsla(25, 95%, 55%, 0.4);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.8s ease-out forwards;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Mobile Small (max 400px) */
@media (max-width: 400px) {
  .hero-title {
    font-size: 1.5rem;
  }

  .timeline-item {
    flex-direction: column;
  }

  .timeline-item::after {
    display: none;
  }

  .advisor-card {
    flex-direction: column;
    text-align: center;
  }
}

/* Tablet (min 550px) */
@media (min-width: 550px) {
  .container {
    max-width: 550px;
  }

  .section-title {
    max-width: 500px;
  }
}

/* Tablet Large (min 768px) */
@media (min-width: 768px) {
  .container {
    max-width: 750px;
  }

  .section-title {
    max-width: 600px;
  }

  .hero {
    padding-top: 120px;
  }

  .hero .btn-group {
    display: flex;
    gap: 15px;
  }

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

  .about-content,
  .tech-description {
    text-align: left;
  }

  .section-text {
    text-align: left;
  }

  .contact-form {
    max-width: 600px;
    margin-inline: auto;
  }

  .newsletter-form {
    flex-wrap: nowrap;
  }
}

/* Desktop (min 992px) */
@media (min-width: 992px) {
  :root {
    --fs-1: 3rem;
    --fs-2: 2.5rem;
    --section-padding: 120px;
  }

  .container {
    max-width: 980px;
  }

  .section-content {
    position: relative;
    padding-left: 40px;
  }

  .section-subtitle {
    position: absolute;
    top: 0;
    left: 0;
    transform: rotate(0.75turn) translateX(-100%);
    transform-origin: left top;
    margin-bottom: 0;
  }

  .section-subtitle::after {
    top: 8px;
    left: auto;
    right: calc(100% + 20px);
  }

  /* Header Desktop */
  .header {
    padding-block: 25px;
  }

  .header.active {
    padding-block: 15px;
  }

  .navbar-actions {
    order: 1;
    margin-left: 0;
  }

  .nav-toggle-btn {
    display: none;
  }

  .navbar {
    all: unset;
    display: block;
  }

  .navbar-link {
    transform: translateY(0);
    font-size: var(--fs-6);
    padding-inline: 15px;
    font-weight: var(--fw-700);
  }

  .navbar-list>li {
    margin: 0;
    padding: 0;
    overflow: visible;
  }

  .navbar-list {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
  }

  .navbar-link::before {
    height: 3px;
  }

  /* Hero Desktop */
  .hero {
    position: relative;
    padding-top: 0;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 50px;
  }

  .hero-banner {
    order: 2;
    max-width: 600px;
    margin-bottom: 0;
  }

  .hero-content {
    order: 1;
    text-align: left;
  }

  .hero-title {
    text-align: left;
  }

  .hero-subtitle {
    text-align: left;
  }

  .hero .btn {
    margin: 10px 10px 10px 0;
  }

  .hero-social-list {
    display: block;
    position: absolute;
    bottom: 100px;
    left: -50px;
  }

  .hero-social-list::after {
    content: "";
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 40px;
    background: var(--color-secondary);
  }

  .hero-social-link {
    position: relative;
    color: var(--color-secondary);
    margin-block: 10px;
    padding: 8px;
    font-size: 20px;
    transition: var(--transition-1);
  }

  .hero-social-link:is(:hover, :focus) {
    color: var(--taiwan-red);
  }

  .hero-social-link .tooltip {
    left: calc(100% + 15px);
    top: 50%;
    transform: translateY(-50%) translateX(10px);
  }

  .hero-social-link:is(:hover, :focus) .tooltip {
    transform: translateY(-50%) translateX(0);
    opacity: 1;
  }

  .scroll-down {
    display: block;
    position: absolute;
    bottom: 100px;
    right: -80px;
    color: var(--color-secondary);
    font-size: 1rem;
    text-transform: uppercase;
    transform: rotate(90deg);
    transform-origin: top right;
    letter-spacing: 2px;
    font-weight: var(--fw-700);
  }

  .scroll-down::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -60px;
    transform: translateY(-50%);
    width: 40px;
    height: 2px;
    background: var(--color-secondary);
  }

  /* About Desktop */
  .about {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 60px;
  }

  .about-banner {
    margin-bottom: 0;
  }

  /* Contact Desktop */
  .contact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
  }

  .contact-content {
    margin-bottom: 0;
  }

  .contact-form {
    margin: 0;
    max-width: 100%;
  }

  /* Footer Desktop */
  .footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
  }

  .footer .logo {
    margin-bottom: 0;
  }

  .copyright {
    margin-bottom: 0;
  }
}

/* Desktop Large (min 1200px) */
@media (min-width: 1200px) {
  .container {
    max-width: 1200px;
  }

  .section-title {
    max-width: 700px;
  }

  .hero-social-list {
    left: -80px;
  }

  .scroll-down {
    right: -100px;
  }

  .about-banner {
    max-width: 550px;
  }

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

  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Desktop XL (min 1400px) */
@media (min-width: 1400px) {
  :root {
    --fs-1: 3.5rem;
    --fs-2: 3rem;
  }

  .container {
    max-width: 1350px;
  }
}


/* ===== 3D Model Container 樣式 ===== */
.model-3d-container {
  width: 100%;
  height: 100%;
  min-height: 400px;
  border-radius: var(--radius-16);
  overflow: hidden;
  position: relative;
}

.hero-banner .model-3d-container {
  min-height: 500px;
  height: 600px;
}

.about-banner .model-3d-container {
  min-height: 400px;
  height: 500px;
  width: 100% !important;
  /* 🔥 強制寬度 */
  box-shadow: var(--shadow-1);
}

.model-3d-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* 手機版調整 */
@media (max-width: 768px) {
  .hero-banner .model-3d-container {
    height: 400px;
    min-height: 350px;
  }

  .about-banner .model-3d-container {
    height: 350px;
    min-height: 300px;
  }
}

/* 桌面版調整 */
@media (min-width: 992px) {
  .hero-banner .model-3d-container {
    height: 100%;
    min-height: 600px;
  }
}

/* ===== PRELOADER / LOADING 畫面 ===== */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--bg-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.6s ease-out, visibility 0.6s ease-out;
}

.preloader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-inner {
  text-align: center;
  padding: 20px;
}

/* Loading 動畫（使用你提供的樣式 + 台灣紅色主題） */
.loader {
  width: fit-content;
  margin: 0 auto 30px;
  font-weight: bold;
  font-family: var(--ff-noto-sans);
  font-size: 40px;
  background: radial-gradient(circle closest-side, var(--taiwan-red) 94%, #0000) right/calc(200% - 1em) 100%;
  animation: loaderSlide 1s infinite alternate linear;
}

.loader::before {
  content: "Loading...";
  line-height: 1em;
  color: #0000;
  background: inherit;
  background-image: radial-gradient(circle closest-side, var(--cultural-orange) 94%, var(--taiwan-red));
  -webkit-background-clip: text;
  background-clip: text;
}

@keyframes loaderSlide {
  100% {
    background-position: left;
  }
}

/* 進度百分比 */
.loading-percent {
  color: var(--cultural-orange);
  font-size: var(--fs-3);
  font-weight: var(--fw-700);
  margin-bottom: 15px;
  font-family: var(--ff-noto-sans);
}

/* 提示文字 */
.loading-tip {
  color: var(--color-secondary);
  font-size: var(--fs-6);
  margin-top: 10px;
}

/* 深色主題樣式 */
body.dark_theme .loader {
  background: radial-gradient(circle closest-side, var(--taiwan-red) 94%, #0000) right/calc(200% - 1em) 100%;
}

body.dark_theme .loader::before {
  background-image: radial-gradient(circle closest-side, var(--cultural-orange) 94%, var(--taiwan-red));
}

/* 淺色主題樣式 */
body.light_theme .loader {
  background: radial-gradient(circle closest-side, var(--taiwan-red) 94%, #0000) right/calc(200% - 1em) 100%;
}

body.light_theme .loader::before {
  background-image: radial-gradient(circle closest-side, var(--cultural-orange) 94%, var(--taiwan-red));
}

/* 手機版響應式 */
@media (max-width: 768px) {
  .loader {
    font-size: 28px;
  }

  .loading-percent {
    font-size: var(--fs-4);
  }

  .loading-tip {
    font-size: var(--fs-7);
  }
}

@media (max-width: 480px) {
  .loader {
    font-size: 24px;
  }

  .loader::before {
    content: "Loading...";
  }
}