/* 字體引入 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@300;400;500;700&family=Montserrat:wght@300;400;500;600;700&display=swap');

/* CSS 變數定義 */
:root {
  /* 基礎色彩 */
  --color-primary: #2D2D2D;
  --color-accent: #C5A059;
  --color-accent-red: #8B2635;
  --color-bg: #F9F9F9;
  --color-white: #FFFFFF;

  /* 主要漸層 */
  --gradient-brand: linear-gradient(135deg, #C5A059 0%, #E8D5A8 50%, #C5A059 100%);
  --gradient-primary: linear-gradient(135deg, #C5A059 0%, #8B2635 100%);
  --gradient-primary-hover: linear-gradient(135deg, #D4B068 0%, #9C3040 100%);

  /* 次要漸層 */
  --gradient-secondary: linear-gradient(135deg, #4A4A4A 0%, #2D2D2D 100%);
  --gradient-subtle: linear-gradient(180deg, #FFFFFF 0%, #F5F5F5 100%);

  /* 強調漸層 */
  --gradient-gold: linear-gradient(90deg, #D4AF37 0%, #FFD700 50%, #D4AF37 100%);
  --gradient-success: linear-gradient(135deg, #4CAF50 0%, #81C784 100%);

  /* 背景漸層 */
  --gradient-hero: linear-gradient(135deg, rgba(45, 45, 45, 0.02) 0%, rgba(197, 160, 89, 0.08) 50%, rgba(139, 38, 53, 0.04) 100%);
  --gradient-card-hover: linear-gradient(180deg, rgba(197, 160, 89, 0.05) 0%, rgba(139, 38, 53, 0.03) 100%);
  --gradient-page: linear-gradient(180deg, #FFFFFF 0%, #F5F0E8 100%);

  /* 陰影 */
  --shadow-soft: 0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-medium: 0 4px 20px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 4px 15px rgba(197, 160, 89, 0.3);
  --shadow-glow-hover: 0 6px 25px rgba(197, 160, 89, 0.4);

  /* 字體 */
  --font-chinese: 'Noto Sans TC', sans-serif;
  --font-latin: 'Montserrat', sans-serif;

  /* 動畫 */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 基礎重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-chinese);
  background: var(--gradient-page);
  min-height: 100vh;
  color: var(--color-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-bottom: 80px;
}

/* Loading 畫面 */
.loading {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-hero);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.3s ease-out;
}

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

.loading-logo {
  font-family: var(--font-latin);
  font-size: 3rem;
  font-weight: 700;
  color: var(--color-accent);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

@keyframes heroGlow {

  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }

  50% {
    transform: translate(20%, 10%) rotate(180deg);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

/* 導航列 */
.navbar {
  position: sticky;
  top: 0;
  background: var(--color-white);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-soft);
  z-index: 100;
}

.nav-back {
  display: flex;
  align-items: center;
  color: var(--color-primary);
  text-decoration: none;
  padding: 0.5rem;
  transition: var(--transition);
}

.nav-back:active {
  transform: scale(0.9);
}

.nav-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-primary);
}

/* Hero Section */
.hero {
  position: relative;
  min-height: 25vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2.5rem 1rem;
  background: var(--gradient-hero);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(197, 160, 89, 0.1) 0%, transparent 50%);
  animation: heroGlow 8s ease-in-out infinite;
  z-index: -1;
}

.hero h1 {
  font-family: var(--font-chinese);
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
  z-index: 1;
}

.hero-subtitle {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 500;
  opacity: 0.9;
}

.hero-description {
  font-size: clamp(1rem, 2.5vw, 1.125rem);
  color: var(--color-primary);
  opacity: 0.7;
  margin-top: 1rem;
  z-index: 1;
}

/* 品牌目錄區塊 */
.directory-section {
  padding: 2rem 1rem;
}

.directory-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .directory-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .directory-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 品牌卡片 */
.brand-card {
  background: var(--color-white);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease-out forwards;
  text-decoration: none;
  color: inherit;
  display: block;
}

.brand-card:hover,
.brand-card:active {
  transform: translateY(-3px);
  box-shadow: var(--shadow-medium);
  background: var(--gradient-card-hover);
  border-left: 3px solid var(--color-accent);
}

/* 卡片上方區塊：照片 | 資訊 | 產業 */
.card-top {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1rem;
}

.card-photo-section {
  flex-shrink: 0;
}

.card-info-section {
  flex: 1;
  min-width: 0;
}

.card-industry-section {
  flex-shrink: 0;
  text-align: center;
}

.industry-label {
  font-size: 0.75rem;
  color: var(--color-primary);
  opacity: 0.7;
  margin-bottom: 0.35rem;
}

.industry-tags {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* 卡片分隔線 */
.card-divider {
  height: 2px;
  background: var(--gradient-primary);
  border-radius: 2px;
  margin: 0.5rem 0;
}

/* 卡片下方區塊：可提供 | 需要 */
.card-bottom {
  display: flex;
  gap: 1rem;
  padding-top: 0.75rem;
}

.card-give-section,
.card-ask-section {
  flex: 1;
}

.card-give-section {
  text-align: left;
}

.card-ask-section {
  text-align: left;
}

/* 成員照片容器 */
.member-photo-container {
  position: relative;
  width: 80px;
  height: 80px;
}

.member-photo {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--color-white);
  box-shadow: var(--shadow-soft);
}

.member-status {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--color-white);
  box-shadow: var(--shadow-soft);
}

.member-info {
  text-align: left;
}

.member-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
  color: var(--color-primary);
}

.member-title {
  font-size: 0.8rem;
  color: var(--color-accent);
  font-weight: 500;
  margin-bottom: 0.2rem;
}

.company-name-card {
  font-size: 0.8rem;
  color: var(--color-primary);
  opacity: 0.7;
  margin-bottom: 0.3rem;
}

.member-tags {
  margin-bottom: 0;
}

.member-resources-tags {
  margin-bottom: 0.5rem;
  text-align: right;
}

.resource-label-small {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-accent);
  display: block;
  margin-bottom: 0.35rem;
}

.resource-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.card-give-section .resource-tags {
  justify-content: flex-start;
}

.card-ask-section .resource-tags {
  justify-content: flex-start;
}

.resource-tag {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.2;
}

.give-tag {
  background: rgba(197, 160, 89, 0.2);
  color: #B8860B;
  border: 1.5px solid rgba(197, 160, 89, 0.5);
  font-weight: 600;
}

.ask-tag {
  background: rgba(139, 38, 53, 0.2);
  color: #8B2635;
  border: 1.5px solid rgba(139, 38, 53, 0.5);
  font-weight: 600;
}

.industry-tag {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  background: rgba(197, 160, 89, 0.15);
  color: #8B7355;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid rgba(197, 160, 89, 0.3);
}

/* 浮動動作按鈕 (FAB) */
.fab {
  position: fixed;
  bottom: 5.5rem;
  right: 1.5rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: var(--color-white);
  border: none;
  box-shadow: var(--shadow-glow);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: var(--transition);
}

.fab:hover,
.fab:active {
  background: var(--gradient-primary-hover);
  transform: scale(1.05);
  box-shadow: var(--shadow-glow-hover);
}

/* 模態框 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.3s ease-out;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--color-white);
  border-radius: 16px;
  padding: 1.5rem;
  max-width: 420px;
  width: calc(100% - 2rem);
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp 0.3s ease-out;
}

.welcome-modal-content {
  max-width: 420px;
  text-align: center;
  padding: 1.5rem;
}

.welcome-modal-content h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.welcome-description {
  font-size: 1rem;
  color: var(--color-primary);
  opacity: 0.7;
  margin-bottom: 2rem;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--color-primary);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
  transition: var(--transition);
}

.modal-close:hover,
.modal-close:active {
  opacity: 1;
  transform: scale(1.1);
}

.modal-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--color-primary);
}

/* 表單樣式 */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--color-primary);
  font-size: 0.875rem;
}

/* 橫向表單欄位（標籤+輸入框） */
.form-group-inline {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.form-label-inline {
  flex: 0 0 100px;
  font-weight: 500;
  color: var(--color-primary);
  font-size: 0.9375rem;
  text-align: right;
}

.form-input-inline {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid rgba(45, 45, 45, 0.2);
  border-radius: 8px;
  font-family: var(--font-chinese);
  font-size: 1rem;
  transition: var(--transition);
  background: var(--color-white);
}

.form-input-inline:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.1);
}

/* 響應式調整 */
@media (max-width: 768px) {
  .form-group-inline {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .form-label-inline {
    flex: none;
    width: 100%;
    text-align: left;
    font-size: 0.875rem;
  }

  .form-input-inline {
    width: 100%;
  }

  .welcome-modal-content {
    padding: 1.5rem;
  }
}

.form-group input[type="text"],
.form-group input[type="tel"] {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid rgba(45, 45, 45, 0.2);
  border-radius: 8px;
  font-family: var(--font-chinese);
  font-size: 1rem;
  transition: var(--transition);
  background: var(--color-white);
}

.form-group input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.1);
}

.file-upload {
  position: relative;
  display: block;
  width: 100%;
}

.file-upload input[type="file"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 1;
}

.file-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  border: 2px dashed rgba(45, 45, 45, 0.3);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  background: var(--color-bg);
  color: var(--color-primary);
  gap: 0.5rem;
}

.file-upload-label:hover,
.file-upload-label:active {
  border-color: var(--color-accent);
  background: rgba(197, 160, 89, 0.05);
}

.file-hint {
  font-size: 0.75rem;
  opacity: 0.6;
}

.image-preview {
  margin-top: 1rem;
  display: none;
}

.image-preview.active {
  display: block;
}

.image-preview img {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.btn-submit {
  width: 100%;
  padding: 1rem;
  background: var(--gradient-primary);
  color: var(--color-white);
  border: none;
  border-radius: 10px;
  font-family: var(--font-chinese);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 1rem;
  box-shadow: var(--shadow-glow);
}

.btn-submit:hover {
  background: var(--gradient-primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-hover);
}

.btn-submit:active {
  transform: translateY(0);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

/* 成員詳情頁 */
.profile-container {
  max-width: 800px;
  margin: 0 auto;
  padding-bottom: 100px;
}

.profile-header {
  text-align: center;
  padding: 2rem 1rem;
  background: var(--color-white);
  margin-bottom: 1rem;
}

.profile-photo {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1rem;
  box-shadow: var(--shadow-soft);
  border: 4px solid var(--color-white);
}

.profile-name {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--color-primary);
}

.profile-title {
  font-size: 1rem;
  color: var(--color-primary);
  opacity: 0.7;
  margin-bottom: 1rem;
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

/* 公司資訊區塊 */
.company-section {
  background: var(--color-white);
  padding: 2rem 1rem;
  margin-bottom: 1rem;
  text-align: center;
}

.company-logo-container {
  margin-bottom: 1rem;
}

.company-logo {
  max-width: 200px;
  max-height: 120px;
  object-fit: contain;
  margin: 0 auto;
}

.company-name {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--color-primary);
}

.company-description {
  font-size: 0.9375rem;
  line-height: 1.8;
  color: var(--color-primary);
  opacity: 0.8;
  max-width: 600px;
  margin: 0 auto;
}

/* LCD 區塊 - 分頁標籤 */
.lcd-section {
  background: var(--color-white);
  margin: 1rem 0;
  padding: 0 1rem 2rem;
}

.section-header {
  text-align: center;
  margin-bottom: 1.5rem;
  padding-top: 1rem;
}

.section-header h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.section-description {
  font-size: 0.875rem;
  color: var(--color-primary);
  opacity: 0.7;
}

.tabs {
  display: flex;
  border-bottom: 1px solid rgba(45, 45, 45, 0.1);
  margin-bottom: 1.5rem;
  gap: 0.5rem;
}

.tab {
  flex: 1;
  padding: 1rem;
  background: none;
  border: none;
  font-family: var(--font-chinese);
  font-size: 1rem;
  color: var(--color-primary);
  opacity: 0.6;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 2px solid transparent;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.tab-icon {
  font-size: 1.25rem;
}

.tab.active {
  opacity: 1;
  border-bottom-color: var(--color-accent);
  font-weight: 600;
}

.tab-content {
  display: none;
  padding: 1rem 0;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

.tab-content-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(45, 45, 45, 0.1);
}

.tab-content-header h4 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.tab-description {
  font-size: 0.875rem;
  color: var(--color-primary);
  opacity: 0.7;
  line-height: 1.6;
}

.resource-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.resource-item {
  background: var(--color-bg);
  padding: 1rem;
  border-radius: 8px;
  border-left: 3px solid var(--color-accent);
  transition: var(--transition);
}

.resource-item:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-soft);
}

.resource-item-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--color-primary);
  font-size: 1rem;
}

.resource-item-description {
  font-size: 0.875rem;
  color: var(--color-primary);
  opacity: 0.8;
  line-height: 1.6;
}

/* 社群媒體區塊（內嵌在描述下方） */
.social-section-inline {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(45, 45, 45, 0.1);
  text-align: center;
}

.social-buttons-inline {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
}

.social-button-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  aspect-ratio: 1 / 1;
  padding: 0;
  background: var(--color-bg);
  border: 2px solid rgba(45, 45, 45, 0.1);
  border-radius: 12px;
  text-decoration: none;
  color: var(--color-primary);
  transition: var(--transition);
}

.social-button-inline:hover,
.social-button-inline:active {
  border-color: var(--social-color, var(--color-accent));
  background: var(--social-color, var(--color-accent));
  color: var(--color-white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.social-icon-inline {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.social-icon-inline svg {
  width: 100%;
  height: 100%;
}

/* 底端固定列 */
.sticky-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-white);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
  padding: 1rem;
  display: flex;
  justify-content: space-around;
  z-index: 999;
}

.action-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  color: var(--color-primary);
  font-family: var(--font-chinese);
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
  padding: 0.5rem 1rem;
  flex: 1;
}

.action-button:active {
  transform: scale(0.9);
}

.action-button svg {
  width: 24px;
  height: 24px;
}

/* 響應式調整 */
@media (max-width: 768px) {
  .fab {
    bottom: 5.5rem;
    right: 1.5rem;
    width: 56px;
    height: 56px;
  }

  .profile-photo {
    width: 120px;
    height: 120px;
  }

  .modal-content {
    padding: 1.5rem;
  }
}

/* 成功訊息 */
.success-message {
  position: fixed;
  top: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-white);
  padding: 1rem 2rem;
  border-radius: 8px;
  box-shadow: var(--shadow-medium);
  z-index: 3000;
  animation: slideDown 0.3s ease-out;
  display: none;
}

.success-message.active {
  display: block;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* 邀約121彈窗樣式 */
.invite-modal-content {
  max-width: 380px;
  text-align: center;
  padding: 2rem 1.5rem;
}

.invite-success-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.invite-modal-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 1rem;
}

.invite-description {
  font-size: 1rem;
  color: var(--color-primary);
  opacity: 0.8;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}