/* =========================
   Root & Global
========================= */
:root {
  --accent-color: #009d9d;
  --background-color: #f1f9f9;

  /* 補強顏色 */
  --default-color: #175a66; /* 內文深灰 */
  --heading-color: #024f55; /* 標題近黑 */
  --surface-color: #fcfcfc; /* 區塊淺灰 */
  --contrast-color: #00a6c4; /* 高對比反白 */
  scroll-behavior: smooth;
}

body {
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Arial,
    sans-serif;
  color: var(--default-color);
  background-color: var(--background-color);
}

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: 0.3s;
}

a:hover {
  color: color-mix(in srgb, var(--accent-color), transparent 25%);
}

h1,
h2,
h3,
h4 {
  color: var(--heading-color);
  font-weight: 700;
}

/* =========================
   Section
========================= */
section {
  padding: 60px 0;
  scroll-margin-top: 90px;
}

.section-title {
  text-align: center;
  padding-bottom: 60px;
}

.section-title h2 {
  font-size: 2.2rem;
  position: relative;
  padding-bottom: 20px;
}

.section-title h2::after {
  content: "";
  width: 50px;
  height: 3px;
  background: var(--accent-color);
  display: block;
  margin: 20px auto 0;
}

/* =========================
   Hero
========================= */
.hero {
  padding: 120px 0 80px;
  position: relative;
  background: linear-gradient(
    295deg,
    var(--background-color),
    color-mix(in srgb, var(--accent-color), transparent 25%)
  );
  overflow: hidden;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.hero::before {
  bottom: -30%;
  left: -10%;
  width: 50%;
  height: 100%;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--accent-color), transparent 92%),
    transparent 70%
  );
}

.hero::after {
  top: 10%;
  right: -5%;
  width: 40%;
  height: 80%;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--accent-color), transparent 94%),
    transparent 60%
  );
}

.hero .hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 15px;
  background: #fff;
  padding: 5px 15px;
  border-radius: 50px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.tag-dot {
  width: 10px;
  height: 10px;
  background: var(--contrast-color);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.tag-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--contrast-color);
}

.hero .hero-content .hero-text {
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1.7;
  color: var(--default-color);
  margin-bottom: 40px;
}

.hero-headline {
  font-size: 3.5rem;
  line-height: 1.3;
}

@keyframes pulse {
  50% {
    opacity: 0.6;
    transform: scale(1.2);
  }
}

/* =========================
   chartTopic
========================= */
.chartTopic .topic-card {
  background: var(--surface-color);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
  transition: transform 0.4s;
}

.chartTopic .topic-card:hover {
  transform: translateY(-6px);
}

.chartTopic .image-wrapper {
  position: relative;
  height: 220px;
  overflow: hidden;
}

.chartTopic .image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

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

.chartTopic .topic-card:hover img {
  transform: scale(1.08);
}

.chartTopic .hover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    0deg,
    color-mix(in srgb, var(--accent-color) 20%, transparent),
    transparent
  );
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 24px;
  opacity: 0;
  transition: 0.3s;
}

.chartTopic .topic-card:hover .hover-overlay {
  opacity: 1;
}

.action-btn {
  width: 48px;
  height: 48px;
  font-size: 1.5rem;
  background: #fff;
  color: var(--accent-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chartTopic .topic-card .hover-overlay .action-btn:hover {
  background: var(--accent-color);
  color: var(--background-color);
  transform: scale(1.1);
}

.topic-info {
  padding: 24px;
}

.topic-info h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.topic-info h4 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  padding-left: 2.7rem;
}

.topic-info p {
  font-size: 1rem;
  color: #617575;
}

/* =========================
   chartDisplay
========================= */
.chartDisplay {
  position: relative;
  overflow: hidden; /* 防止圓形跑出 section */
}

.chartDisplay::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 30%;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--accent-color), transparent 50%) 20%,
    color-mix(in srgb, var(--accent-color), transparent 95%) 60%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 0;
}

/* 確保所有實際內容都在圓形上方 */
.chartDisplay > .container {
  position: relative;
  z-index: 1;
}

.chartDisplay .form-card {
  background: var(--surface-color);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 2px 2px 15px color-mix(in srgb, #3d4949 60%, transparent);
  height: 100%;
}

.chartDisplay .notes-grid {
  margin-bottom: 25px;
}

.chartDisplay .notes-grid .note-box {
  background: var(--surface-color);
  padding: 28px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--default-color), transparent 92%);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.chartDisplay .notes-grid .note-box.highlight {
  background: rgba(var(--accent-color), 0.9);
  background: color-mix(in srgb, var(--accent-color), transparent 90%);
  border-color: color-mix(in srgb, var(--accent-color), transparent 70%);
}

/* =========================
   Footer
========================= */
.footer {
  background: #fff;
  padding: 30px 0;
  border-top: 1px solid #e2e8f0;
}

.footer .copyright {
  font-size: 0.98rem;
  color: #94b6b8;
}

.footer .footer-bottom {
  padding-top: 25px;
}

/* =========================
   Scroll Top
========================= */
.scroll-top {
  position: fixed;
  right: 15px;
  bottom: 15px;
  width: 40px;
  height: 40px;
  background: var(--accent-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: 0.3s;
}

.scroll-top.active {
  opacity: 1;
  visibility: visible;
}

/* =========================
   AOS Mobile Fix
========================= */
@media (max-width: 768px) {
  [data-aos-delay] {
    transition-delay: 0 !important;
  }
}
