/* ===== 全局設定 ===== */
body, html {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background-color: #0b0c10;
  color: #ffffff;
  scroll-behavior: smooth;
  -webkit-user-select: none; /* Safari */
  -ms-user-select: none;     /* IE 10+ */
  user-select: none;         /* 標準語法 */
}

/* ===== hero 區塊 ===== */
.hero {
  height: 100vh;
  background: #0b0c10;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}
.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.hero img {
  width: 180px;
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 20px red);
  -webkit-user-drag: none; /* Safari/Chrome */
}
.hero h1 {
  font-size: 96px;
  margin: 1rem 0;
  line-height: 1.1;
}
.hero p {
  font-size: 24px;
  opacity: 0.85;
}

/* ===== 漸顯元素 ===== */
.fade-element {
  opacity: 0;
  transform: translateY(60px);
  transition: all 1s ease-out;
}
.fade-element.visible {
  opacity: 1;
  transform: translateY(0);
}
@media (max-width: 768px) and (orientation: portrait) {
  .arrow.fade-element.visible {
    transform: rotate(90deg) translateY(0);
  }
}

/* ===== 滾動區塊 ===== */
.scroll-section {
  height: 100vh;
  padding: 2rem;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  scroll-snap-align: start;
  background-color: #111317;
}

/* ===== #flow 區塊 ===== */
#flow {
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 3rem;
  padding: 0 2rem;
  user-select: none;
}
.resize-control {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-right: 2rem;
  color: #fff;
  font-size: 18pt;
  user-select: none;
  min-width: 140px;
}
.resize-control input[type=range] {
  width: 140px;
  margin-top: 0.5rem;
  cursor: pointer;
}
.flow-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 160px;
}
.flow-item img {
  width: 140px;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 0 10px #ff0000);
  -webkit-user-drag: none; /* Safari/Chrome */
}
.flow-item p {
  font-size: 28pt;
  font-weight: 700;
  white-space: nowrap;
  margin: 0;
  color: #fff;
}
.arrow {
  font-size: 48pt;
  color: #ff0000;
  user-select: none;
  line-height: 1;
  transform: none;
  margin: 0;
}

/* ===== #alert 區塊 ===== */
#alert .phone-sim {
  text-align: center;
  font-size: 30pt;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
#alert button {
  font-size: 25pt;
  padding: 0.5rem 1.5rem;
  cursor: pointer;
  border-radius: 12px;
  border: none;
  background-color: #ff0000;
  color: white;
  box-shadow: 0 0 10px #ff0000;
  transition: background-color 0.3s ease;
}
#alert button:hover {
  background-color: #cc0000;
}

/* ===== #value 區塊 ===== */
#value {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem 0;
}
#value .card {
  font-size: 30pt;
  text-align: center;
  width: 80%;
  max-width: 600px;
  margin: 0;
  background-color: #1c1f24;
  color: #ffffff;
  padding: 2rem;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}
#value .card.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== footer 區塊 ===== */
.footer {
  text-align: center;
  padding: 2rem;
  font-size: 22pt;
  font-weight: 700;
  color: #ff1a1a;
  background-color: #0b0c10;
  box-shadow: 0 0 15px 5px rgba(255, 0, 0, 0.6);
  border-radius: 12px;
  letter-spacing: 0.12em;
  text-shadow:
    0 0 8px #ff4d4d,
    0 0 15px #ff1a1a,
    0 0 20px #ff0000;
  opacity: 0;
  transform: translateY(20px);
  transition: all 1s ease-out;
  user-select: none;
  cursor: default;
}
.footer.visible {
  opacity: 1;
  transform: translateY(0);
  animation: pulseRedSafe 2.5s ease-in-out infinite alternate;
}
@keyframes pulseRedSafe {
  0% {
    text-shadow:
      0 0 10px #ff6666,
      0 0 20px #ff3333,
      0 0 30px #ff0000;
  }
  100% {
    text-shadow:
      0 0 20px #ff9999,
      0 0 30px #ff4d4d,
      0 0 40px #ff0000;
  }
}

/* ===== Sign In / Sign Up 彈窗設計 ===== */
.sign-header {
  position: fixed;
  top: 0;
  width: 100%; 
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(28, 31, 36, 0.95);
  padding: 1rem 2rem;
  box-shadow: 0 2px 16px rgba(255,0,0,0.10);
}

.sign-mark {
  display: flex;
  align-items: center;
}
.sign-icon {
  width: 45px;
  height: 45px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.button-group {
  display: flex;
  gap: 1.2rem;
  align-items: center;
}

/* 主按鈕：Sign In / Sign Up */
.sign-btn {
  background: linear-gradient(90deg, #ff4d4d 0%, #ff1a1a 100%);
  color: #fff;
  border: none;
  border-radius: 22px;
  padding: 0.55rem 2.1rem;
  font-size: 1.12rem;
  font-weight: 700;
  min-height: 46px;
  box-shadow: 0 4px 16px rgba(255,0,0,0.14), 0 1.5px 4px rgba(0,0,0,0.08);
  outline: none;
  cursor: pointer;
  letter-spacing: 1px;
  transition: background 0.25s, transform 0.18s, box-shadow 0.18s;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 2rem;
}

/* 主按鈕 hover/active 效果 */
.sign-btn:hover, .sign-btn:focus {
  background: linear-gradient(90deg, #ff1a1a 0%, #ff4d4d 100%);
  transform: translateY(-2px) scale(1.045);
  box-shadow: 0 6px 18px rgba(255,0,0,0.22), 0 2px 8px rgba(0,0,0,0.13);
}

.about-btn {
  background: #fff;
  color: #ff1a1a;
  border: 2px solid #ffb3b3;
  border-radius: 22px;
  padding: 0.55rem 1.7rem;
  font-size: 1.12rem;
  font-weight: 700;
  min-height: 46px;
  box-shadow: 0 3px 12px rgba(255,0,0,0.07), 0 1.5px 4px rgba(0,0,0,0.06);
  outline: none;
  cursor: pointer;
  letter-spacing: 1px;
  transition: 
    background 0.25s, 
    color 0.22s, 
    border-color 0.22s, 
    transform 0.18s, 
    box-shadow 0.18s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.about-btn:hover, .about-btn:focus {
  background: linear-gradient(90deg, #ffb3b3 0%, #fff 100%);
  color: #fff;
  border-color: #ff4d4d;
  transform: translateY(-2px) scale(1.045);
  box-shadow: 0 6px 18px rgba(255,0,0,0.14), 0 2px 8px rgba(0,0,0,0.11);
}



/* ===== modal 彈窗 ===== */
.modal {
  display: none;
  position: fixed;
  z-index: 3000;
  left: 0; top: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.7);
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 0;
  animation: fadeIn 0.5s;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.modal-content {
  background: #22232a;
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(255,0,0,0.3);
  position: relative;
  animation: slideDown 0.6s;
  width: 100%;
  max-width: 360px;
  padding: 2rem 2.5rem;
  box-sizing: border-box;
  max-height: 92vh;
  overflow-y: auto;
  margin: 2vh 0;
}
@keyframes slideDown {
  from { transform: translateY(-60px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.close {
  position: absolute;
  right: 1.2rem; top: 1.2rem;
  font-size: 2rem;
  color: #ff4d4d;
  cursor: pointer;
  transition: color 0.2s;
}
.close:hover { color: #fff; }
.tab-group {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}
.tab {
  flex: 1;
  padding: 0.7rem 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.1rem;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.3s;
}
.tab.active {
  border-bottom: 2px solid #ff4d4d;
  color: #ff4d4d;
}
.form-container {
  position: relative;
}
.form {
  display: none;
  flex-direction: column;
  gap: 1rem;
  animation: fadeForm 0.5s;
}
@keyframes fadeForm {
  from { opacity: 0; transform: translateY(30px);}
  to   { opacity: 1; transform: translateY(0);}
}
.form.active { display: flex; }
input {
  padding: 0.7rem 1rem;
  border-radius: 8px;
  border: 1px solid #444;
  background: #292b33;
  color: #fff;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}
input:focus { border-color: #ff4d4d; }
button[type="submit"] {
  background: #ff4d4d;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.7rem;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
button[type="submit"]:hover {
  background: #ff1a1a;
  transform: scale(1.03);
}
.note {
  font-size: 0.95rem;
  color: #ffb3b3;
  margin-top: 0.3rem;
  text-align: left;
}

/* ===== 響應式設計 ===== */
@media (max-width: 768px) {
  .hero img { width: 120px; -webkit-user-drag: none;}
  .hero h1 { font-size: 48px; }
  .hero p { font-size: 18px; }
  #flow { flex-direction: column; gap: 1.5rem; }
  .arrow { transform: rotate(90deg); font-size: 36pt;margin: 0.2rem 0; }
  .flow-item img { width: 100px;-webkit-user-drag: none;}
  .flow-item p { font-size: 18pt; }
  #alert .phone-sim { font-size: 20pt; }
  #alert button { font-size: 18pt; padding: 0.4rem 1rem; }
  #value .card { width: 90%; padding: 1.5rem; font-size: 22pt; }
  .footer { font-size: 16pt; padding: 1.5rem; }
}
@media (max-width: 700px) {
  .modal-content {
    max-width: 90vw;
    padding: 1.2rem 0.7rem;
    font-size: 1rem;
  }
}
@media (max-width: 500px) {
  .modal-content { width: 92vw; padding: 1.2rem 0.5rem; }
  .sign-header { padding: 0.5rem 1rem; }
}
@media (max-width: 400px), (max-height: 400px) {
  .modal-content { max-width: 98vw; padding: 0.7rem 0.2rem; font-size: 0.95rem; }
}
@media (max-width: 400px) {
  body, html { overflow-x: hidden; }
  .hero-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    padding: 0.5rem 0.5rem;
    max-width: 98vw;
    box-sizing: border-box;
  }
  .hero-inner img { width: 60px !important; max-width: 100%; margin-bottom: 0.5rem;-webkit-user-drag: none;}
  .hero-inner h1,
  .hero-inner p {
    font-size: 1.3rem;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    margin: 0.2rem 0;
    padding: 0 0.5rem;
    text-align: center;
  }
  #flow { flex-direction: column; align-items: center; gap: 1rem; width: 100%; }
  #flow .flow-item img { width: 60px !important; max-width: 100%;-webkit-user-drag: none;}
  #flow .flow-item p { font-size: 1rem; margin: 0.2rem 0; }
  .arrow { transform: rotate(90deg); font-size: 1.5rem; margin: 0.2rem 0; }
  .scroll-section, .card, .phone-sim {
    width: 100%;
    box-sizing: border-box;
    padding: 0.6rem 0.2rem;
    font-size: 1rem;
  }
  .sign-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 0.5rem;
  }
  .sign-btn { font-size: 0.9rem; padding: 0.4rem 0.7rem; }
  .modal-content { width: 96vw; padding: 1rem 0.5rem; box-sizing: border-box; }
  input, button { font-size: 1rem !important; }
}

/* ===== 橫向手機適配 ===== */
@media screen and (orientation: landscape) and (min-aspect-ratio: 16/10) {
  .modal {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
  }
  .modal-content {
    max-width: 440px;
    width: 92vw;
    min-width: 280px;
    margin: 0 auto;
    padding: 1.2rem 1.5rem;
    border-radius: 16px;
    font-size: 1rem;
    box-sizing: border-box;
    box-shadow: 0 8px 32px rgba(255,0,0,0.3);
  }
}
@media screen and (orientation: landscape) and (min-aspect-ratio: 2/1) {
  .modal-content {
    max-width: 480px;
    width: 80vw;
    font-size: 1.05rem;
  }
}


