:root {
  --navy: #0b1f3a;
  --navy-light: #14315c;
  --gold: #c9a34e;
  --bg: #f7f8fa;
  --text: #1c2430;
  --muted: #5a6472;
  --white: #ffffff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Times New Roman", Times, "DFKai-SB", "BiauKai", "KaiTi", "標楷體", serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.9;
}

p, li {
  text-align: justify;
  text-justify: inter-character;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  color: var(--white);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

.brand span {
  color: var(--gold);
  font-weight: 400;
}

.nav-links {
  display: flex;
  gap: 28px;
}

.nav-links a {
  color: var(--white);
  text-decoration: none;
  font-size: 0.95rem;
  opacity: 0.9;
  transition: opacity 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  opacity: 1;
  color: var(--gold);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: var(--white);
  text-align: center;
  padding: 110px 24px;
}

.hero h1 {
  font-size: 2.2rem;
  margin-bottom: 16px;
  letter-spacing: 0.01em;
}

.hero .tagline {
  font-size: 1.1rem;
  color: #d7dce4;
  margin-bottom: 32px;
}

.btn {
  display: inline-block;
  background: var(--gold);
  color: var(--navy);
  font-weight: 700;
  padding: 12px 32px;
  border-radius: 4px;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.6);
  color: var(--white);
}

.btn-outline:hover {
  background: rgba(255,255,255,0.1);
  box-shadow: none;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Page hero (sub-pages) */
.page-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: var(--white);
  padding: 64px 24px;
  text-align: center;
}

.page-hero h1 {
  font-size: 1.9rem;
  margin-bottom: 10px;
}

.page-hero .tagline {
  color: #d7dce4;
  font-size: 1rem;
}

/* Sections */
.section {
  padding: 72px 0;
}

.section.alt {
  background: var(--white);
}

.section h2 {
  font-size: 1.6rem;
  color: var(--navy);
  margin-bottom: 24px;
  position: relative;
  display: inline-block;
}

.section h2::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  background: var(--gold);
  margin-top: 10px;
}

.section p {
  color: var(--muted);
  max-width: 780px;
}

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 32px;
}

.card {
  background: var(--white);
  border-top: 3px solid var(--gold);
  border-radius: 6px;
  padding: 28px;
  box-shadow: 0 4px 16px rgba(11,31,58,0.06);
}

.card h3 {
  color: var(--navy);
  margin-bottom: 12px;
  font-size: 1.1rem;
}

.card p {
  color: var(--muted);
  font-size: 0.95rem;
}

.more-link {
  margin-top: 32px;
}

.more-link a {
  color: var(--navy);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid var(--gold);
}

.section-note {
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
}

/* Chart */
.chart-caption {
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.chart-box {
  background: var(--white);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(11,31,58,0.06);
  padding: 24px;
  max-width: 780px;
}

.predict-chart {
  width: 100%;
  height: auto;
  display: block;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 18px;
  font-size: 0.85rem;
  color: var(--muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 2px;
  flex-shrink: 0;
}

.swatch-candle-up {
  background: var(--navy);
}

.swatch-candle-down {
  background: var(--white);
  border: 1.5px solid var(--navy);
  box-sizing: border-box;
}

.swatch-line {
  width: 18px;
  height: 0;
  border-top: 2px dashed var(--gold);
  border-radius: 0;
  background: none;
}

.swatch-band {
  background: var(--gold);
  opacity: 0.3;
}

/* Product grid (representative works) */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 28px;
}

.product-item {
  background: var(--white);
  border-left: 3px solid var(--navy);
  border-radius: 4px;
  padding: 18px 22px;
  box-shadow: 0 2px 10px rgba(11,31,58,0.05);
}

.product-item h4 {
  color: var(--navy);
  font-size: 1rem;
  margin-bottom: 6px;
}

.product-item p {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Cooperation flow */
.flow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 32px 0;
}

.flow-step {
  background: var(--navy);
  color: var(--white);
  border-radius: 4px;
  padding: 12px 18px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.flow-step span {
  background: var(--gold);
  color: var(--navy);
  font-weight: 700;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.flow-arrow {
  color: var(--muted);
  font-weight: 700;
}

/* Formula cards */
.formula-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 28px;
}

.formula-card {
  background: var(--bg);
  border: 1px solid #e3e7ee;
  border-radius: 6px;
  padding: 22px;
}

.formula-card h4 {
  color: var(--navy);
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.formula {
  color: var(--navy);
  background: var(--white);
  border-radius: 4px;
  padding: 16px;
  overflow-x: auto;
  text-align: center;
}

.formula .katex {
  font-size: 1.1rem;
}

.formula-desc {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Research report list (sub-index) */
.report-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 860px;
}

.report-item {
  display: block;
  background: var(--white);
  border-left: 3px solid var(--gold);
  border-radius: 6px;
  padding: 26px 30px;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(11,31,58,0.06);
  transition: transform 0.2s, box-shadow 0.2s;
}

.report-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(11,31,58,0.1);
}

.report-date {
  display: inline-block;
  font-size: 0.82rem;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.report-item h3 {
  color: var(--navy);
  font-size: 1.15rem;
  margin-bottom: 10px;
  line-height: 1.5;
}

.report-item p {
  color: var(--muted);
  font-size: 0.95rem;
}

.report-more {
  display: inline-block;
  margin-top: 14px;
  color: var(--navy);
  font-weight: 700;
  font-size: 0.9rem;
}

/* Research report body (article) */
.report-body {
  max-width: 780px;
}

.report-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.report-body h2 {
  font-size: 1.35rem;
  color: var(--navy);
  margin-top: 44px;
  margin-bottom: 18px;
}

.report-body h2:first-of-type {
  margin-top: 0;
}

.report-body h3 {
  font-size: 1.08rem;
  color: var(--navy-light);
  margin-top: 28px;
  margin-bottom: 12px;
}

.report-body p {
  color: var(--text);
  max-width: none;
  margin-bottom: 16px;
}

.report-body p.lead {
  color: var(--muted);
  font-style: italic;
}

.report-body ul {
  margin: 0 0 16px 22px;
  color: var(--text);
}

.report-body li {
  margin-bottom: 8px;
}

.report-body .formula-box {
  background: var(--bg);
  border: 1px solid #e3e7ee;
  border-radius: 6px;
  padding: 16px 20px;
  margin: 0 0 18px;
  color: var(--navy);
  overflow-x: auto;
}

.report-body .formula-box.formula {
  text-align: center;
}

.report-body .formula-box.formula .katex {
  font-size: 1.05rem;
}

.report-body .formula-flow {
  font-family: "Cambria Math", "Times New Roman", serif;
  text-align: center;
  font-size: 0.95rem;
}

.report-body .katex-inline {
  padding: 0 1px;
}

.report-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 24px;
  font-size: 0.9rem;
}

.report-body th,
.report-body td {
  border: 1px solid #e3e7ee;
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.report-body th {
  background: var(--navy);
  color: var(--white);
  font-weight: 700;
}

.report-body tr:nth-child(even) td {
  background: var(--white);
}

.report-disclaimer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #e3e7ee;
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
}

.back-link {
  display: inline-block;
  margin-bottom: 28px;
  color: var(--navy);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.9rem;
}

.back-link:hover {
  color: var(--gold);
}

@media (max-width: 768px) {
  .report-item {
    padding: 20px 22px;
  }
}

/* Contact panel */
.contact-panel {
  max-width: 640px;
}

/* Contact */
.contact-email {
  margin-top: 16px;
}

.contact-email a {
  color: var(--navy);
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
  border-bottom: 2px solid var(--gold);
}

.contact-email a:hover {
  color: var(--gold);
}

/* Footer */
.site-footer {
  background: var(--navy);
  color: #b9c2cf;
  text-align: center;
  padding: 24px 0;
  font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 768px) {
  .nav-links {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--navy);
    flex-direction: column;
    align-items: center;
    padding: 16px 0;
    gap: 16px;
    display: none;
  }

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

  .nav-toggle {
    display: block;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .product-grid,
  .formula-grid {
    grid-template-columns: 1fr;
  }

  .flow {
    flex-direction: column;
    align-items: stretch;
  }

  .flow-arrow {
    text-align: center;
    transform: rotate(90deg);
  }

  .hero {
    padding: 80px 20px;
  }

  .hero h1 {
    font-size: 1.6rem;
  }
}
