﻿/* common.css */
/* 鈥斺€?閲嶇疆 鈥斺€?*/
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Noto Sans TC', sans-serif;
}

/* 鈥斺€?鍏叡 Header 鈥斺€?*/
header {
  background: linear-gradient(to right, #0b5394, #1c6ea4);
  color: white;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  min-height: 70px; /* 固定最小高度 */
  display: flex;
  align-items: center;
}
header .container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}
.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.logo i {
  font-size: 32px;
  margin-right: 15px;
}
.logo h1 {
  font-size: 1.2rem;
  font-weight: 600;
}
nav ul {
  display: flex;
  list-style: none;
}
nav li {
  margin-left: 12px;
}
nav a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 0.85rem;
  white-space: nowrap;
  font-family: 'Noto Sans TC', sans-serif;
}
nav a:hover,
nav a.active {
  background: rgba(255, 255, 255, 0.2);
}

/* 鏂板鐧诲綍鍥炬爣鏍峰紡 */
.login-icon a {
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  transition: all 0.3s;
}
.login-icon a:hover {
  background: rgba(255, 255, 255, 0.25);
}
.login-icon i {
  margin-right: 8px;
  font-size: 1.2em;
}

/* 鐧诲綍寮圭獥鏍峰紡 */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
}

.modal-content {
  background-color: #fff;
  margin: 10% auto;
  padding: 30px;
  border-radius: 8px;
  width: 100%;
  max-width: 500px;
  position: relative;
  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
}

.close {
  position: absolute;
  top: 15px;
  right: 20px;
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}
.close:hover {
  color: #333;
}

.auth-tabs {
  display: flex;
  margin-bottom: 20px;
  border-bottom: 1px solid #eee;
}

.tab-btn {
  padding: 10px 20px;
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  position: relative;
  color: #777;
  font-weight: 500;
  transition: all 0.3s;
}
.tab-btn.active {
  color: #0b5394;
  font-weight: 600;
}
.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 3px;
  background: #0b5394;
}

.auth-form {
  display: none;
}
.auth-form.active {
  display: block;
}

.auth-form .form-group {
  margin-bottom: 15px;
}

.auth-form label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: #444;
}

.auth-form .required::after {
  content: '*';
  color: #e74c3c;
  margin-left: 4px;
}

.auth-form input,
.auth-form select {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 1rem;
}

.auth-form input:focus,
.auth-form select:focus {
  border-color: #0b5394;
  outline: none;
}

.auth-form .form-checkbox {
  display: flex;
  align-items: center;
  margin: 20px 0;
}

.auth-form .form-checkbox input {
  width: auto;
  margin-right: 10px;
}

.auth-form .form-checkbox label {
  margin: 0;
  font-weight: normal;
}

.auth-form .btn-submit {
  background: #0b5394;
  color: white;
  border: none;
  padding: 14px 30px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s;
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 1.1rem;
  width: 100%;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.auth-form .btn-submit:hover {
  background: #083e70;
  transform: translateY(-2px);
}

.auth-form .form-note {
  margin-top: 20px;
  font-size: 0.9rem;
  color: #777;
  text-align: center;
}

.auth-form .form-note a {
  color: #0b5394;
  text-decoration: none;
}

.auth-form .form-note a:hover {
  text-decoration: underline;
}

/* 姹夊牎鑿滃崟鏍峰紡 */
.hamburger {
  display: none; /* 榛樿妗岄潰绔殣钘?*/
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 25px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 10;
}

/* 绉诲姩绔樉绀烘眽鍫℃寜閽?*/
@media (max-width: 768px) {
  .hamburger {
    display: flex;
    position: absolute;
    top: 20px;
    left: 10px; /* 涓巋eader.php淇濇寔涓€鑷达紝鏇撮潬杩戝乏杈?*/
  }
}


.hamburger-line {
  width: 30px;
  height: 3px;
  background: white;
  border-radius: 3px;
  transition: all 0.3s ease;
}

.hamburger.active .hamburger-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.hamburger.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger.active .hamburger-line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* 绉诲姩瀵艰埅鑿滃崟鏍峰紡 */
.mobile-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: linear-gradient(to bottom, #0b5394, #1c6ea4);
  z-index: 99;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.mobile-nav.active {
  display: block;
  max-height: 500px;
}

.mobile-nav ul {
  flex-direction: column;
  padding: 15px 0;
}

.mobile-nav li {
  margin: 10px 0;
}

.mobile-nav a {
  display: block;
  padding: 10px 20px;
  color: white;
  text-decoration: none;
}

.mobile-nav a:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* 闅愯棌妗岄潰瀵艰埅鍦ㄧЩ鍔ㄧ */
@media (max-width: 768px) {
  .desktop-nav {
    display: none;
  }

  /* 鏄剧ず绉诲姩瀵艰埅 */
  .mobile-nav {
    display: block;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: linear-gradient(to bottom, #0b5394, #1c6ea4);
    z-index: 99;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .mobile-nav.active {
    max-height: 500px;
  }
}

/* 鈥斺€?鍝嶅簲寮?鈥斺€?*/
@media (max-width: 768px) {
  .header-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    text-align: left;
  }
  
  nav ul {
    margin-top: 0;
    flex-wrap: nowrap;
  }
  
  nav li {
    margin: 0;
  }
  
  .login-icon {
    margin-top: 0;
  }
  
  /* 鐧诲綍寮圭獥鍝嶅簲寮?*/
  .modal-content {
    margin: 20% 5%;
    width: 90%;
  }
}
@media (max-width: 576px) {
  nav ul {
    flex-direction: column;
  }
  nav li {
    margin: 5px 0;
  }
  
  .login-icon {
    margin-top: 0;
  }
  
  /* 鐧诲綍寮圭獥鍝嶅簲寮?*/
  .modal-content {
    padding: 20px 15px;
  }
  
  .auth-tabs {
    justify-content: center;
  }
  
  /* 绉诲姩瀵艰埅鑿滃崟鍦ㄥ皬灞忓箷涓婂叏瀹?*/
  .mobile-nav {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: none;
  }
}

/* 娑堟伅鎻愮ず */
.message-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  padding: 10px;
}

.alert {
  padding: 15px;
  margin-bottom: 10px;
  border-radius: 4px;
  color: white;
  text-align: center;
  font-weight: 500;
}

.alert.success {
  background-color: #28a745;
}

.alert.error {
  background-color: #dc3545;
}

/* 涓嬫媺鑿滃崟 */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  color: white;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.15);
  transition: all 0.3s;
}

.dropdown-toggle:hover {
  background: rgba(255, 255, 255, 0.25);
}

.dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background-color: white;
  min-width: 160px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  z-index: 1;
  border-radius: 4px;
  overflow: hidden;
}

.dropdown-menu a {
  color: #333;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  text-align: left;
  transition: all 0.3s;
}

.dropdown-menu a:hover {
  background-color: #f1f1f1;
}

/* 淇敼瀵艰埅鏂囧瓧鍨傜洿灞呬腑 */
nav ul {
  align-items: center; /* 鏂板 */
}

nav li {
  display: flex; /* 鏂板 */
  align-items: center; /* 鏂板 */
  margin-left: 12px;
}

nav a {
  display: flex; /* 淇敼 */
  align-items: center; /* 鏂板 */
  height: 100%; /* 鏂板 */
}

/* 鎵嬫満楠岃瘉鐮佹牱寮?*/
.sms-code-group {
  display: flex;
  gap: 10px;
}

.btn-send-code {
  background: #f39c12;
  color: white;
  border: none;
  padding: 0 15px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: all 0.3s;
}

.btn-send-code:hover {
  background: #e67e22;
}

/* 寮圭獥鍐呭婊氬姩 */
.modal-content {
  max-height: 90vh;
  overflow-y: auto;
}



/* 鍒嗙粍鏍峰紡 */
.form-section {
  margin-bottom: 12px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 6px;
}

.form-section h3.section-title {
  padding-bottom: 8px;
  border-bottom: 1px dashed #ddd;
  margin-bottom: 12px;
}

.section-title {
  font-size: 1.1rem;
  color: #0b5394;
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #ddd;
}

/* 涓ゅ垪甯冨眬 */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
}

/* 鍙姌鍙犲尯鍩?*/
.collapsible .collapsible-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.collapsible.active .collapsible-content {
  max-height: 1000px;
}

.toggle-section {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.toggle-section i {
  transition: transform 0.3s;
}

.collapsible.active .toggle-section i {
  transform: rotate(180deg);
}

/* 鍝嶅簲寮忚皟鏁?*/
@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* 閽堝378px瀹藉害鐨勭壒瀹氫慨澶?*/
@media (max-width: 378px) {
  /* 椤堕儴瀵艰埅淇 */
  header .container {
    width: 100%;
    padding: 0 10px;
  }
  
  .header-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }
  
  .logo h1 {
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
  }
  
  .hamburger {
    left: 10px;
    width: 25px;
    height: 25px;
  }
  
  .mobile-login-container {
    right: 0px; /* 瀹屽叏鍙冲榻?*/
  }
  
  .mobile-login-link {
    font-size: 12px;
  }
  
  /* 浜ゆ槗涓績椤甸潰淇 */
  .listing-grid {
    grid-template-columns: 1fr !important;
    gap: 15px;
  }
  
  .listing-card {
    margin: 0 5px;
  }
  
  .listing-header {
    padding: 10px 15px;
  }
  
  .listing-header img {
    height: 30px;
    left: 10px;
  }
  
  .listing-header h3 {
    font-size: 1.1rem;
  }
  
  .listing-header .listing-id {
    font-size: 0.8rem;
  }
  
  .listing-body {
    padding: 15px;
  }
  
  .listing-features {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .feature-value {
    font-size: 1rem;
  }
  
  .listing-footer {
    padding: 0 15px 15px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .listing-price {
    font-size: 1.3rem;
  }
  
  .btn-enquiry {
    width: 100%;
    text-align: center;
  }
}

/* 璋冩暣娉ㄥ唽琛ㄥ崟楂樺害 */
#registerForm .form-section {
  padding: 8px 12px;
  margin-bottom: 8px;
}
#registerForm .form-row {
  gap: 8px;
  margin-bottom: 8px;
}
#registerForm .form-group {
  margin-bottom: 12px;
}

/* === FIX (2025-08-16): Ensure hamburger toggles mobile nav (#navMenu.mobile-nav) === */
@media (max-width: 768px) {
  #navMenu.mobile-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    color: #333333;
    z-index: 9999;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  }
  #navMenu.mobile-nav.active { display: block; }
  #navMenu.mobile-nav ul {
    display: flex; flex-direction: column;
    padding: 12px 10px; gap: 4px;
  }
  #navMenu.mobile-nav a {
    display: block; padding: 10px 12px;
    color: #333; text-decoration: none;
  }
  #navMenu.mobile-nav a:hover { background: #f5f5f5; }
}

/* 通用容器样式 */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* 通用页脚（供 footer.php 使用） */
.site-footer {
  background: #0a3d62;
  color: #fff;
  padding: 40px 0 20px;
  margin-top: auto;
}

.site-footer .footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}

.site-footer .footer-col h4 {
  font-size: 1.2rem;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 10px;
}

.site-footer .footer-col h4::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 50px;
  height: 2px;
  background: #3498db;
}

.site-footer .footer-col p {
  margin-bottom: 10px;
  color: #ddd;
  line-height: 1.6;
}

.site-footer .footer-col ul {
  list-style: none;
}

.site-footer .footer-col ul li {
  margin-bottom: 10px;
}

.site-footer .footer-col ul li a {
  color: #ddd;
  text-decoration: none;
  transition: color 0.3s;
}

.site-footer .footer-col ul li a:hover {
  color: #3498db;
}

.site-footer .copyright {
  text-align: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  color: #aaa;
}

/* Desktop: compact header nav to keep one line */
@media (min-width: 769px) {
  header .container {
    width: 96%;
    max-width: 1380px;
  }

  .header-content {
    flex-wrap: nowrap;
    gap: 10px;
  }

  .logo {
    flex-shrink: 0;
  }

  .logo h1 {
    font-size: 1.08rem;
    white-space: nowrap !important;
  }

  nav {
    min-width: 0;
  }

  nav ul {
    flex-wrap: nowrap !important;
    gap: 8px;
  }

  nav li {
    margin-left: 0;
    flex: 0 0 auto !important;
  }

  nav a {
    font-size: 0.8rem;
    padding: 5px 7px;
    white-space: nowrap !important;
    word-break: keep-all !important;
    flex-wrap: nowrap !important;
  }

  .login-icon i {
    margin-right: 6px;
    font-size: 1rem;
  }

  .login-icon a,
  .dropdown-toggle {
    max-width: 165px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap !important;
  }
}
