/* Reuse the existing UI token/style system where possible */
@import "./ui-styles.css";

/* ===== Enhanced Color System ===== */
:root {
  /* 優化後的灰階色系 - 確保對比度符合 WCAG AA */
  --text-primary: #1A1A1A;        /* 主文字 - 對比度 16.1:1 */
  --text-secondary: #4A4A4A;      /* 次要文字 - 對比度 9.7:1 */
  --text-tertiary: #6B6B6B;       /* 輔助文字 - 對比度 6.5:1 */
  --text-disabled: #9E9E9E;       /* 禁用狀態 - 對比度 4.5:1 */

  /* 背景色系 */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F8F8F8;
  --bg-tertiary: #F0F0F0;

  /* 品牌色 */
  --brand-red: #E42313;
  --brand-red-hover: #C41E0F;
  --brand-red-light: #FFF5F5;

  /* 語意色 */
  --success: #22C55E;
  --warning: #F59E0B;
  --error: #EF4444;

  /* 邊框 */
  --border-light: #E8E8E8;
  --border-medium: #D4D4D4;

  /* 陰影 */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

.trex-site {
  background: var(--bg-primary);
}

.trex-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (max-width: 768px) {
  .trex-container {
    padding: 0 16px;
  }
}

/* ===== Button Overrides ===== */
.btn {
  font-family: var(--font-heading);
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.2s ease;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background-color: var(--brand-red);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(228, 35, 19, 0.25);
}

.btn-primary:hover {
  background-color: var(--brand-red-hover);
  box-shadow: 0 4px 12px rgba(228, 35, 19, 0.35);
  transform: translateY(-1px);
  opacity: 1;
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
  opacity: 1;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 16px;
  font-weight: 700;
  width: auto;
}

.btn-sm {
  padding: 10px 20px;
  font-size: 14px;
}

/* ===== Navigation ===== */
.trex-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(26, 26, 26, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.trex-nav__inner {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.trex-nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.trex-nav__brand:hover {
  opacity: 0.9;
}

.trex-nav__name {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #FFFFFF;
  font-size: 18px;
}

.trex-nav__links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.trex-nav__link {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 16px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.trex-nav__link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
}

.trex-nav__cta.btn {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  margin-left: 8px;
}

/* ===== Hero Section ===== */
.trex-hero {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #1A1A1A;
}

.trex-hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.trex-hero__overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(1000px 600px at 25% 40%, rgba(228, 35, 19, 0.18) 0%, rgba(26, 26, 26, 0.85) 60%),
    rgba(0, 0, 0, 0.65);
  z-index: 1;
}

.trex-hero__content {
  position: relative;
  z-index: 2;
  padding: 80px 0;
  max-width: 800px;
}

.trex-hero__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 100px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #FFFFFF;
  background: rgba(228, 35, 19, 0.15);
  border: 1px solid rgba(228, 35, 19, 0.3);
  backdrop-filter: blur(8px);
}

.trex-hero__title {
  margin-top: 24px;
  font-family: var(--font-heading);
  font-weight: 800;
  letter-spacing: -0.04em;
  font-size: 56px;
  line-height: 1.1;
  color: #FFFFFF;
  max-width: 20ch;
}

.trex-hero__subtitle {
  margin-top: 20px;
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.9);
  max-width: 60ch;
}

.trex-hero__actions {
  margin-top: 32px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.trex-hero__primary.btn-lg,
.trex-hero__secondary.btn-lg {
  width: auto;
  padding: 16px 32px;
  font-size: 16px;
}

.terms-consent--on-dark {
  margin-top: 24px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  line-height: 1.6;
}

.terms-consent--on-dark a {
  color: rgba(255, 255, 255, 0.95);
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.3);
  transition: text-decoration-color 0.2s ease;
}

.terms-consent--on-dark a:hover {
  text-decoration-color: rgba(255, 255, 255, 0.7);
}

/* ===== Section Styles ===== */
.trex-section {
  padding: 96px 0;
  background: var(--bg-primary);
}

.trex-section--alt {
  background: var(--bg-secondary);
}

.trex-section--cta {
  background: linear-gradient(135deg, #1A1A1A 0%, #2D2D2D 100%);
}

.trex-section__header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 800px;
}

.trex-section__header--center {
  text-align: center;
  margin: 0 auto 64px;
}

.trex-section__title {
  font-family: var(--font-heading);
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text-primary);
}

.trex-section__desc {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.trex-section__desc strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ===== Value Proposition ===== */
.trex-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  margin-top: 64px;
}

.trex-stat {
  text-align: center;
}

.trex-stat__number {
  font-family: var(--font-heading);
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--brand-red);
  line-height: 1;
}

.trex-stat__label {
  margin-top: 12px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text-secondary);
}

/* ===== Features Grid ===== */
.trex-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.trex-feature {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 32px;
  transition: all 0.3s ease;
}

.trex-feature:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.trex-feature__icon {
  font-size: 48px;
  line-height: 1;
  margin-bottom: 20px;
}

.trex-feature__title {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.trex-feature__desc {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.trex-feature__badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--brand-red);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 600;
  vertical-align: middle;
}

/* ===== Workflow ===== */
.trex-workflow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

.trex-workflow__step {
  text-align: center;
}

.trex-workflow__number {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--brand-red);
  color: #FFFFFF;
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
}

.trex-workflow__title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.trex-workflow__desc {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* ===== Pricing ===== */
.trex-pricing {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  max-width: 900px;
  margin: 0 auto;
}

.trex-pricing__card {
  background: var(--bg-primary);
  border: 2px solid var(--border-light);
  border-radius: 20px;
  padding: 40px;
  position: relative;
  transition: all 0.3s ease;
}

.trex-pricing__card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-xl);
}

.trex-pricing__card--featured {
  border-color: var(--brand-red);
  box-shadow: var(--shadow-lg);
}

.trex-pricing__badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 16px;
  border-radius: 100px;
  background: var(--brand-red);
  color: #FFFFFF;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.trex-pricing__name {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.trex-pricing__price {
  margin-bottom: 32px;
}

.trex-pricing__amount {
  font-family: var(--font-heading);
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.trex-pricing__period {
  font-family: var(--font-body);
  font-size: 18px;
  color: var(--text-secondary);
  margin-left: 4px;
}

.trex-pricing__features {
  list-style: none;
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.trex-pricing__features li {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
}

/* ===== FAQ ===== */
.trex-faq {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.trex-faq__item {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 24px;
  transition: all 0.2s ease;
}

.trex-faq__item:hover {
  border-color: var(--border-medium);
}

.trex-faq__item[open] {
  border-color: var(--brand-red);
}

.trex-faq__question {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.trex-faq__question::after {
  content: '+';
  font-size: 24px;
  color: var(--text-tertiary);
  transition: transform 0.2s ease;
}

.trex-faq__item[open] .trex-faq__question::after {
  content: '−';
  color: var(--brand-red);
}

.trex-faq__answer {
  margin-top: 16px;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* ===== CTA Section ===== */
.trex-cta {
  text-align: center;
  padding: 64px 0;
}

.trex-cta__title {
  font-family: var(--font-heading);
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #FFFFFF;
  margin-bottom: 16px;
}

.trex-cta__desc {
  font-family: var(--font-body);
  font-size: 18px;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 32px;
}

/* ===== Footer ===== */
.trex-footer {
  background: #1A1A1A;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 64px 0 32px;
}

.trex-footer__inner {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 64px;
  margin-bottom: 48px;
}

.trex-footer__left {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.trex-footer__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.trex-footer__name {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: #FFFFFF;
}

.trex-footer__tagline {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.7);
  max-width: 300px;
}

.trex-footer__right {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
}

.trex-footer__section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.trex-footer__heading {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #FFFFFF;
  margin-bottom: 4px;
}

.trex-footer__link {
  font-family: var(--font-body);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.2s ease;
}

.trex-footer__link:hover {
  color: #FFFFFF;
}

.trex-footer__bottom {
  padding-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.trex-footer__copyright {
  font-family: var(--font-body);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
}

/* ===== Responsive Design ===== */
@media (max-width: 1024px) {
  .trex-features,
  .trex-workflow {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .trex-stats {
    gap: 32px;
  }

  .trex-pricing {
    grid-template-columns: 1fr;
    max-width: 500px;
  }

  .trex-footer__inner {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .trex-footer__right {
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
  }
}

@media (max-width: 768px) {
  .trex-section {
    padding: 64px 0;
  }

  .trex-section__header--center {
    margin-bottom: 48px;
  }

  .trex-section__title {
    font-size: 32px;
  }

  .trex-section__desc {
    font-size: 16px;
  }

  .trex-nav__links .trex-nav__link {
    display: none;
  }

  .trex-nav__cta.btn {
    margin-left: 0;
  }

  .trex-hero {
    min-height: 80vh;
  }

  .trex-hero__content {
    padding: 60px 0;
  }

  .trex-hero__title {
    font-size: 40px;
  }

  .trex-hero__subtitle {
    font-size: 16px;
  }

  .trex-stats {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .trex-stat__number {
    font-size: 40px;
  }

  .trex-cta__title {
    font-size: 32px;
  }

  .trex-footer__right {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

@media (max-width: 480px) {
  .trex-section {
    padding: 48px 0;
  }

  .trex-section__title {
    font-size: 28px;
  }

  .trex-hero__title {
    font-size: 32px;
  }

  .trex-hero__actions {
    flex-direction: column;
    width: 100%;
  }

  .trex-hero__primary.btn-lg,
  .trex-hero__secondary.btn-lg {
    width: 100%;
  }

  .trex-feature {
    padding: 24px;
  }

  .trex-feature__icon {
    font-size: 40px;
  }

  .trex-feature__title {
    font-size: 20px;
  }

  .trex-pricing__card {
    padding: 32px 24px;
  }

  .trex-pricing__amount {
    font-size: 48px;
  }

  .trex-workflow__number {
    width: 56px;
    height: 56px;
    font-size: 24px;
  }

  .trex-cta {
    padding: 48px 0;
  }

  .trex-cta__title {
    font-size: 28px;
  }
}

.trex-web--hero {
  background-color: var(--black-primary);
  overflow-x: hidden;
}

.trex-web__video-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.trex-web__video-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
  z-index: 1;
}

.trex-web__center {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
}

.trex-web__card {
  width: min(560px, 100%);
  border-radius: 18px;
  padding: 26px 24px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.32);
  box-shadow: 0 16px 60px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.trex-web__brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-top: 4px;
}

.trex-web__brand .logo-text.large {
  color: var(--black-primary);
}

.trex-web__brand .logo-mark.large {
  box-shadow: 0 10px 28px rgba(228, 35, 19, 0.28);
}

.trex-web__title {
  text-align: center;
  font-family: var(--font-heading);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--black-primary);
  margin-top: 10px;
}

.trex-web__subtitle {
  text-align: center;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--gray-700);
  margin-top: -6px;
}

.trex-web__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.trex-web__hint {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 3;
  max-width: min(320px, 72vw);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}

.trex-web__hint-text {
  color: var(--white);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.01em;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(13, 13, 13, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.trex-web__hint-arrow {
  width: 170px;
  height: 90px;
  opacity: 0.92;
  filter: drop-shadow(0 10px 26px rgba(0, 0, 0, 0.55));
  transform: rotate(6deg);
}

.form-status {
  margin: 14px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-surface);
  color: var(--black-primary);
  font-size: 14px;
}

.site-credit {
  margin-top: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.6;
}

.site-credit a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  transition: all 0.2s ease;
}

.site-credit a:hover {
  color: #FFFFFF;
  border-bottom-color: rgba(255, 255, 255, 0.6);
}

.site-credit--on-dark {
  color: rgba(255, 255, 255, 0.6);
}

.site-credit--on-dark a {
  color: rgba(255, 255, 255, 0.9);
  border-bottom-color: rgba(255, 255, 255, 0.3);
}

.terms-consent {
  margin-top: 10px;
  text-align: center;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.6;
}

.terms-consent a {
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 1px solid var(--border-medium);
  transition: border-color 0.2s ease;
}

.terms-consent a:hover {
  border-bottom-color: var(--text-primary);
}

.trex-landing-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.trex-landing-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.trex-landing-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.trex-landing-card.card {
  padding: 14px 14px;
  gap: 6px;
}
