:root {
  --bg: #f8fafc;
  --bg-soft: #eef2ff;
  --card: #ffffff;
  --text: #0f172a;
  --text-dim: #475569;
  --primary: #3b82f6;
  --primary-ink: #ffffff;
  --accent: #1d4ed8;
  --border: #e2e8f0;
}
/* Loading Screen */
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--primary);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  transition: opacity 0.6s ease-out, visibility 0.6s;
}

.loader-content {
  text-align: center;
  transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55), opacity 0.3s;
}
.step-title img{width:100px;height:100px;}
.spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

.loading-text {
  color: #fff;
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: 2px;
  opacity: 0.9;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Animation States */
#loading-screen.scatter .loader-content {
  transform: scale(3);
  opacity: 0;
}

#loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Global Resets & Typography */
* {
  box-sizing: border-box;
}
html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(1200px 600px at 10% 0%, #ffffff 0%, var(--bg) 55%, var(--bg-soft) 100%);
  color: var(--text);
  font-family: "Noto Sans TC", system-ui, -apple-system, "Microsoft JhengHei", "PingFang HK", "PingFang TC", "Source Han Sans", "Heiti TC", sans-serif;
  line-height: 1.6;
}
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 12px 18px;
  text-decoration: none;
  font-weight: 700;
  transition: transform .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease;
}
.btn.primary {
  background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
  color: var(--primary-ink);
  box-shadow: 0 10px 20px rgba(59, 130, 246, .25);
}
.btn.primary:hover {
  transform: translateY(-2px);
}
.btn.ghost {
  background: transparent;
  border: 1px solid #cbd5e1;
  color: var(--text);
}
.btn.xl {
  padding: 16px 22px;
  font-size: 18px;
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(150%) blur(6px);
  background: rgba(255, 255, 255, .75);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
}
.brand-mark {
  font-weight: 900;
  letter-spacing: .02em;
  font-size: 18px;
}
.site-nav a {
  color: var(--text);
  text-decoration: none;
  margin-left: 18px;
  padding: 8px 10px;
  border-radius: 8px;
}
.site-nav a:hover {
  background: rgba(29, 78, 216, .08);
}
.hero {
  padding: 60px 0 40px;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.25fr .95fr;
  gap: 28px;
  align-items: stretch;
}
.hero-kicker {
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 8px;
}
.hero-text h1 {
  margin: 0 0 8px;
  font-size: 34px;
  line-height: 1.2;
}
.hero-text p {
  margin: 0 0 20px;
  color: var(--text-dim);
}
.hero-text {
  position: relative;
}
.hero-text::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 600px;
  height: 300px;
  background-image: url('../img/ad.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  border-radius: 24px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .12);
  opacity: .95;
  pointer-events: none;
  z-index: 0;
}
.hero-text > * {
  position: relative;
  z-index: 1;
}
.hero-actions {
  display: flex;
  gap: 12px;
}
.hero-card {
  background: linear-gradient(180deg, rgba(255,255,255,.95) 0%, rgba(255,255,255,.85) 100%);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}
.card-head {
  font-weight: 700;
  margin-bottom: 10px;
}
.card-head.small {
  font-weight: 500;
  color: var(--text-dim);
}
.card-body .input-group {
  margin-bottom: 14px;
}
.input-value {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.input-value input[type="number"] {
  appearance: textfield;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text);
  font-size: 18px;
  width: 100%;
}
input[type="range"] {
  width: 100%;
}
select {
  width: 100%;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
}
.result {
  margin-top: 8px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.result-value {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: .02em;
}
.result-note {
  color: var(--text-dim);
  font-size: 12px;
}
.products {
  padding: 30px 0 10px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.product-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .05);
}
.product-title {
  font-weight: 700;
  margin-bottom: 6px;
}
.product-desc {
  color: var(--text-dim);
}
.apply-steps {
  padding: 30px 0;
}
.apply-steps h2,
.faq h2 {
  margin: 0 0 16px;
  font-size: 24px;
}
.steps-grid{
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 20px;
  align-items: center;
  justify-content: center;
}
.faq-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.step,
.faq-item {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .05);
  position: relative;
}
.step {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  transition: transform .2s ease, box-shadow .2s ease;
}
.step-title,
.faq-q {
  font-weight: 600;
  cursor: pointer;
}
.step {
  text-align: center;
}
.step-count {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
}
.step-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.step-icon {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border);
  margin: 0 auto 8px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .08);
}
.step-text {
  font-weight: 600;
  font-size: 12px;
  line-height: 1.4;
  padding: 0 10px;
}
.step:hover {
  transform: scale(1.06);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .15);
}
.step::after {
  content: "→";
  position: absolute;
  right: -10px;
  top: 50%;
  transform: translateY(-50%) translateX(0);
  color: var(--primary);
  font-size: 26px;
  opacity: .7;
  animation: arrow-flow 1.2s ease-in-out infinite alternate;
}
.step:last-child::after {
  display: none;
}

.steps-grid .step:nth-child(1)::after {
  animation-delay: 0s;
}
.steps-grid .step:nth-child(2)::after {
  animation-delay: 0.25s;
}
.steps-grid .step:nth-child(3)::after {
  animation-delay: 0.5s;
}
.steps-grid .step:nth-child(4)::after {
  animation-delay: 0.75s;
}

@keyframes arrow-flow {
  from {
    transform: translateY(-50%) translateX(0);
    opacity: .4;
  }
  to {
    transform: translateY(-50%) translateX(8px);
    opacity: 1;
  }
}
.step-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.step-badge {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step-media img {
  display: block;
  max-width: 120px;
  width: 100%;
  height: auto;
  margin-top: 4px;
}
.faq-q::after {
  content: "▾";
  color: var(--text-dim);
  transition: transform .2s ease;
}
.faq-item.open .faq-q::after {
  transform: rotate(180deg);
}
.faq-a {
  color: var(--text-dim);
  margin-top: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height .25s ease, opacity .2s ease, margin-top .2s ease;
}
.faq-item.open .faq-a {
  opacity: 1;
  margin-top: 6px;
}
.contact {
  padding: 30px 0 50px;
}
.about-section {
  padding: 40px 0;
  background-color: var(--bg-soft);
}
.about-section h2 {
  margin: 0 0 20px;
  font-size: 24px;
}
.about-content {
  background: #ffffff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .05);
  border: 1px solid var(--border);
}
.about-content3 img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 500px;
  margin: 0 auto;
}
.about-content p {
  margin-bottom: 1em;
  line-height: 1.8;
  color: var(--text-dim);
}
.about-content p:last-child {
  margin-bottom: 0;
}
.contact-inner {
  display: grid;
  grid-template-columns: 1.4fr .6fr;
  gap: 16px;
  align-items: start;
}
.contact-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, .06);
}
.contact-title {
  font-weight: 700;
  margin-bottom: 10px;
}

.contact-list {
  display: grid;
  gap: 10px;
}
.contact-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 50px;
}
.contact-label {
  color: var(--text-dim);
}
.contact-label2 {
  color: var(--text-dim);
  white-space: nowrap;
}
.contact-cta {
  display: flex;
  align-items: left;
  justify-content: left;
}
.contact-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.map-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .06);
}
.map-card iframe {
  border: 0;
  width: 100%;
  height: 260px;
}
.map-footer {
  display: flex;
  justify-content: flex-end;
  padding: 10px 12px;
}
.map-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.map-link:hover {
  text-decoration: underline;
}
.site-footer {
  border-top: 1px solid var(--border);
  background: #ffffff;
  padding: 60px 0 30px;
  color: var(--text-dim);
  font-size: 0.9rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  margin-bottom: 40px;
}
.footer-col h3 {
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
}
.footer-col p {
  line-height: 1.6;
}
.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-links li {
  margin-bottom: 0.8rem;
}
.footer-links a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-links a:hover {
  color: var(--primary);
}
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}
.footer-brand {
  font-weight: 700;
  color: var(--text);
  font-size: 0.75rem;
}
.footer-copy {
  font-size: 0.5rem;
}

.warning-text {
  color: var(--text-dim);
  font-size: 0.5rem;
  margin-top: 4px;
  padding: 6px 12px;
  background: #f1f5f9;
  border-radius: 4px;
}

.fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .14);
  border: 1px solid var(--border);
  color: var(--primary-ink);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, opacity .2s ease, visibility .2s ease;
}
.fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, .18);
}
.fab.whatsapp {
  background: #25D366;
  color: #ffffff;
}
.fab.totop {
  background: #3b82f6;
  color: #ffffff;
  bottom: 92px;
  opacity: 0;
  visibility: hidden;
}
.fab.totop.show {
  opacity: 1;
  visibility: visible;
}
.fab svg {
  width: 24px;
  height: 24px;
}

@keyframes arrow-flow-down {
  from {
    transform: translateX(-50%) translateY(0);
    opacity: .4;
  }
  to {
    transform: translateX(-50%) translateY(8px);
    opacity: 1;
  }
}

/* Form Styles */
.apply-form-section {
  padding: 60px 0;
  background: var(--bg-soft);
}
.form-container {
  max-width: 800px;
  margin: 0 auto;
  background: #ffffff;
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .08);
  border: 1px solid var(--border);
}
.form-container h1 {
  margin: 0 0 10px;
  text-align: center;
  color: var(--text);
  font-size: 32px;
}
.form-intro {
  text-align: center;
  color: var(--text-dim);
  margin-bottom: 40px;
}
.form-section {
  margin-bottom: 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--border);
}
.form-section:last-of-type {
  border-bottom: none;
}
.form-section-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 20px;
  color: var(--primary);
  display: flex;
  align-items: center;
}
.form-section-title::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 18px;
  background: var(--primary);
  margin-right: 10px;
  border-radius: 2px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.form-group.full-width {
  grid-column: span 2;
}
.form-group label {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.required {
  color: #ef4444;
}
.form-group input,
.form-group select {
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 16px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  background: #ffffff;
  width: 100%;
}
.form-group input:focus,
.form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .1);
}
.form-actions {
  text-align: center;
  margin-top: 20px;
}
.form-actions button {
  width: 100%;
  max-width: 300px;
  cursor: pointer;
  border: none;
  font-size: 18px;
}

/* Nav CTA Button */
.site-nav .nav-cta-btn {
  background: var(--primary);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 99px;
  font-weight: 700;
  margin-left: 24px;
  transition: transform .2s ease, box-shadow .2s ease;
  box-shadow: 0 4px 12px rgba(59, 130, 246, .3);
}
.site-nav .nav-cta-btn:hover {
  background: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, .4);
}

@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-group.full-width {
    grid-column: span 1;
  }
  .form-container {
    padding: 24px;
  }
}

@media (max-width: 980px) {

  .hero-inner {
    grid-template-columns: 1fr;
  }
  .steps-grid {
    grid-template-columns: 1fr;
    justify-content: center;
    gap: 40px;
  }
  .step {
    width: 280px;
    height: 280px;
    margin: 0 auto;
  }
  .step::after {
    content: "↓";
    right: auto;
    left: 50%;
    top: auto;
    bottom: -35px;
    transform: translateX(-50%);
    animation: arrow-flow-down 1.2s ease-in-out infinite alternate;
  }
  .hero-text::after {
    width: 100%;
    height: 100%;
    border-radius: 20px;
    opacity: .9;
    right: auto;
    left: 0;
    top: 0;
  }
  .nav-toggle {
    display: inline-flex;
  }
  .site-nav {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    display: none;
    flex-direction: column;
    padding: 12px;
    gap: 8px;
    z-index: 60;
  }
  .site-nav.open {
    display: flex;
  }
  .site-nav a {
    margin-left: 0;
    padding: 12px 16px;
    border-radius: 12px;
  }
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .contact-inner {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 520px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .hero-text::after {
    opacity: .85;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .hero-text h1 {
    font-size: 28px;
  }
  .result-value {
    font-size: 20px;
  }
}

/* Auth Modal */
.modal {
  display: none; 
  position: fixed; 
  z-index: 1000; 
  left: 0;
  top: 0;
  width: 100%; 
  height: 100%; 
  overflow: auto; 
  background-color: rgba(0,0,0,0.5); 
  backdrop-filter: blur(5px);
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex;
}

.modal-content {
  background-color: #fff;
  padding: 30px;
  border-radius: 16px;
  width: 90%;
  max-width: 400px;
  position: relative;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.close-modal {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  position: absolute;
  right: 20px;
  top: 15px;
  line-height: 1;
}

.close-modal:hover,
.close-modal:focus {
  color: #000;
  text-decoration: none;
  cursor: pointer;
}

.auth-tabs {
  display: flex;
  margin-bottom: 24px;
  border-bottom: 2px solid #e2e8f0;
}

.auth-tab {
  flex: 1;
  padding: 12px;
  background: none;
  border: none;
  font-size: 16px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.3s;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.auth-tab.active {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.auth-form h3 {
  margin-top: 0;
  margin-bottom: 20px;
  text-align: center;
  color: var(--text);
  font-size: 1.25rem;
}

.full-width {
  width: 100%;
  margin-top: 16px;
}

.auth-form input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}

.auth-form input:focus {
  border-color: var(--primary);
}

.auth-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text);
}


