/* 基礎樣式重置與變數定義 */
:root {
  --primary-color: #0066CC;
  --primary-hover: #0052A3;
  --secondary-color: #4CAF50;
  --secondary-hover: #3E8E41;
  --danger-color: #E74C3C;
  --danger-hover: #C0392B;
  --warning-color: #F39C12;
  --info-color: #3498DB;
  --light-color: #F8F9FA;
  --dark-color: #2C3E50;
  --gray-light: #ECF0F1;
  --gray-medium: #BDC3C7;
  --gray-dark: #7F8C8D;
  --border-color: #DFE6E9;
  --text-color: #2D3436;
  --text-light: #636E72;
  --text-white: #FFFFFF;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.16);
  --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.19);
  --shadow-inset: inset 0 1px 2px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 20px;
  --radius-full: 50%;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Noto Sans TC', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--light-color);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* 容器與佈局 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* 頁頭樣式 */
.site-header {
  background: linear-gradient(135deg, var(--primary-color), var(--dark-color));
  color: var(--text-white);
  padding: 3rem 0 4rem;
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.site-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
}

.site-header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  font-weight: 700;
  position: relative;
  display: inline-block;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.site-header h1::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 3px;
}

.tagline {
  font-size: 1.25rem;
  opacity: 0.9;
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.7;
  font-weight: 300;
}

.header-wave {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100px;
  overflow: hidden;
}

.header-wave svg {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* 主要內容區樣式 */
main {
  padding: 1.5rem 0;
  position: relative;
  z-index: 1;
}

section {
  margin-bottom: 3rem;
  padding: 2rem;
  background-color: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

section:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

h2 {
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
  padding-bottom: 0.5rem;
}

h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 2px;
  background: var(--primary-color);
}

h3 {
  margin-bottom: 1.25rem;
  font-size: 1.4rem;
  color: var(--dark-color);
}

h4 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--dark-color);
}

.section-description {
  margin-bottom: 1.5rem;
  color: var(--text-light);
  line-height: 1.7;
}

/* 介紹區塊樣式 */
.intro-section {
  text-align: center;
}

.banner-container {
  margin: 0 auto 1.5rem;
  max-width: 800px;
}

.banner-img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.banner-img:hover {
  transform: scale(1.02);
}

.intro-text {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  color: var(--text-color);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.stat-card {
  background: white;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.stat-number {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--dark-color);
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-light);
}

/* 詐騙類型列表增強 */
.scam-types {
  list-style: none;
  margin: 1.5rem 0;
}

.scam-types li {
  margin-bottom: 0.75rem;
  padding-left: 2rem;
  position: relative;
  line-height: 1.7;
  color: var(--text-color);
}

.scam-icon {
  position: absolute;
  left: 0;
  top: 0.25rem;
  color: var(--primary-color);
  font-size: 1.1rem;
}

/* 官方鏈接樣式增強 */
.official-link-container {
  margin-top: 2rem;
  text-align: center;
}

.official-link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--primary-color);
  transition: var(--transition);
  font-weight: 500;
  gap: 0.5rem;
}

.official-logo {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.official-link:hover .official-logo {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.official-link-text {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.95rem;
}

.link-icon {
  font-size: 0.8rem;
}

/* 功能狀態樣式增強 */
.feature-status {
  background-color: #F8FAFC;
  padding: 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  border-left: 4px solid var(--primary-color);
}

.feature-status h4 {
  margin-bottom: 0.75rem;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.feature-status ul {
  list-style-type: none;
  margin-top: 0.75rem;
}

.feature-status li {
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
  padding-left: 1.5rem;
}

.status-icon {
  font-size: 1rem;
  margin-right: 0.5rem;
}

.status-icon.success {
  color: var(--secondary-color);
}

.status-icon.warning {
  color: var(--warning-color);
  animation: spin 2s linear infinite;
}

.status-icon.building {
  color: var(--info-color);
}

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

/* 表單樣式增強 */
.form-container {
  display: none;
  margin-top: 1.5rem;
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.fraud-form {
  max-width: 800px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 1.75rem;
  position: relative;
}

label {
  display: block;
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: var(--dark-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-icon {
  font-size: 1rem;
  color: var(--primary-color);
}

input[type="text"],
textarea,
input[type="file"],
select {
  width: 100%;
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: var(--transition);
  background-color: #FDFDFD;
  font-family: inherit;
}

input[type="text"]:focus,
textarea:focus,
select:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 140, 186, 0.2);
  background-color: white;
}

textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.6;
}

/* 文件上傳樣式 */
.file-input-container {
  position: relative;
  overflow: hidden;
  display: inline-block;
  width: 100%;
  margin-top: 0.5rem;
}

.file-input {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.file-input-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background-color: #F8F9FA;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-sm);
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  gap: 0.5rem;
  position: relative;
}

.file-input-label:hover {
  background-color: #F1F3F5;
  border-color: var(--primary-color);
}

.file-input-label.has-file {
  border-color: var(--secondary-color);
  background-color: rgba(76, 175, 80, 0.05);
}

.file-icon {
  font-size: 2rem;
  color: var(--primary-color);
  transition: var(--transition);
}

.file-input-label:hover .file-icon {
  transform: translateY(-3px);
}

.file-input-text {
  font-weight: 500;
  color: var(--dark-color);
  transition: var(--transition);
}

.file-input-hint {
  font-size: 0.85rem;
  color: var(--text-light);
  transition: var(--transition);
}

.form-hint {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.form-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 2rem;
  gap: 1rem;
}

/* reCAPTCHA 樣式 */
.g-recaptcha {
  margin: 1rem 0;
  display: flex;
  justify-content: center;
}

/* 按鈕樣式全面增強 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition);
  border: none;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  gap: 0.5rem;
}

.btn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%);
  transform-origin: 50% 50%;
}

.btn:focus:not(:active)::after {
  animation: ripple 0.6s ease-out;
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 0.5;
  }
  100% {
    transform: scale(20, 20);
    opacity: 0;
  }
}

.btn-icon {
  font-size: 1rem;
  transition: var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  background: linear-gradient(135deg, var(--primary-hover), var(--primary-color));
}

.btn-primary:hover .btn-icon {
  transform: translateX(3px);
}

.btn-submit {
  background: linear-gradient(135deg, var(--secondary-color), var(--secondary-hover));
  color: white;
}

.btn-submit:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  background: linear-gradient(135deg, var(--secondary-hover), var(--secondary-color));
}

.btn-reset {
  background: linear-gradient(135deg, var(--danger-color), var(--danger-hover));
  color: white;
}

.btn-reset:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  background: linear-gradient(135deg, var(--danger-hover), var(--danger-color));
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-light);
  cursor: pointer;
  padding: 0 0.5rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
}

.btn-close:hover {
  color: var(--danger-color);
  background-color: rgba(0, 0, 0, 0.05);
  transform: rotate(90deg);
}

/* 聊天彈出窗口全面增強 */
.chat-popup-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
  padding: 1rem 1.75rem;
  border-radius: 50px;
  cursor: pointer;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: var(--transition);
  font-weight: 600;
  border: none;
}

.chat-popup-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
}

.chat-icon {
  font-size: 1.2rem;
}

.chat-text {
  white-space: nowrap;
}

.chat-notification {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: var(--danger-color);
  color: white;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: bold;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.popup-box {
  position: fixed;
  right: 2rem;
  bottom: calc(2rem + 70px);
  width: 380px;
  max-width: calc(100% - 4rem);
  background-color: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  display: none;
  overflow: hidden;
  animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(30px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.popup-title {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.popup-icon {
  font-size: 1.2rem;
}

.chat-iframe {
  width: 100%;
  height: 500px;
  border: none;
  background: #F5F7FA;
}

/* 頁腳樣式增強 */
.site-footer {
  background: linear-gradient(135deg, var(--dark-color), #1A252F);
  color: white;
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
  position: relative;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-logo img {
  max-width: 150px;
  height: auto;
  filter: brightness(0) invert(1);
  opacity: 0.8;
  transition: var(--transition);
}

.footer-logo img:hover {
  opacity: 1;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-link {
  color: white;
  text-decoration: none;
  opacity: 0.8;
  transition: var(--transition);
  position: relative;
  padding-left: 1rem;
}

.footer-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background: var(--primary-color);
  border-radius: 50%;
  transition: var(--transition);
}

.footer-link:hover {
  opacity: 1;
  padding-left: 1.2rem;
}

.footer-link:hover::before {
  background: white;
}

.footer-social {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.social-icon {
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.social-icon:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-3px);
}

.copyright {
  text-align: center;
  font-size: 0.95rem;
  opacity: 0.7;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.copyright a {
  color: white;
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  position: relative;
}

.copyright a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: white;
  transition: var(--transition);
}

.copyright a:hover {
  text-decoration: none;
}

.copyright a:hover::after {
  width: 100%;
}

/* 提示訊息樣式 */
.alert {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  background-color: var(--dark-color);
  color: white;
  box-shadow: var(--shadow-lg);
  z-index: 1100;
  opacity: 0;
  transition: opacity 0.3s ease;
  max-width: 90%;
  text-align: center;
}

.alert.show {
  opacity: 1;
}

.alert-error {
  background-color: var(--danger-color);
}

/* 動畫增強 */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.pulse {
  animation: pulse 2s infinite;
}

/* 圖片響應式處理 */
.responsive-img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  margin: 1rem 0;
}

/* 載入動畫 */
.loading-spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

/* 輔助類 */
.text-center {
  text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* 響應式設計全面增強 */
@media (max-width: 992px) {
  .site-header h1 {
    font-size: 2.2rem;
  }
  
  .tagline {
    font-size: 1.1rem;
  }
  
  section {
    padding: 1.75rem;
  }
  
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 1.25rem;
  }
  
  .site-header {
    padding: 2rem 0 3rem;
  }
  
  .site-header h1 {
    font-size: 1.9rem;
  }
  
  section {
    padding: 1.5rem;
  }
  
  .popup-box {
    width: 90%;
    right: 5%;
  }
  
  .form-actions {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .btn-reset {
    margin-left: 0;
    margin-top: 0;
  }
  
  .btn {
    width: 100%;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .footer-links {
    align-items: center;
  }
  
  .footer-social {
    justify-content: center;
  }
}

@media (max-width: 576px) {
  .site-header {
    padding: 1.75rem 0 2.5rem;
  }
  
  .site-header h1 {
    font-size: 1.7rem;
  }
  
  .tagline {
    font-size: 1rem;
    padding: 0 1rem;
  }
  
  section {
    padding: 1.25rem;
    margin-bottom: 2rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  .chat-popup-btn {
    bottom: 1.5rem;
    right: 1.5rem;
    padding: 0.9rem 1.5rem;
    font-size: 0.95rem;
  }
  
  .popup-box {
    bottom: calc(1.5rem + 60px);
    right: 1.5rem;
    max-width: calc(100% - 3rem);
  }
  
  .file-input-label {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem 1rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 400px) {
  .chat-popup-btn {
    bottom: 1rem;
    right: 1rem;
    padding: 0.8rem 1.25rem;
    font-size: 0.9rem;
  }
  
  .popup-box {
    bottom: calc(1rem + 55px);
    right: 1rem;
    max-width: calc(100% - 2rem);
  }
  
  .btn {
    padding: 0.8rem 1.5rem;
    font-size: 0.95rem;
  }
}

/* 觸控設備優化 */
@media (hover: none) {
  .btn:hover {
    transform: none !important;
  }
  
  section:hover {
    transform: none !important;
    box-shadow: var(--shadow-sm) !important;
  }
  
  .chat-popup-btn:hover {
    transform: none !important;
  }
  
  .footer-link:hover {
    padding-left: 1rem;
  }
  
  .footer-link:hover::before {
    background: var(--primary-color);
  }
}