/* 基礎全域設定 */
body {
  margin: 0;
  padding: 0;
  font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  background-color: #f4f7f6;
  color: #333;
}

header {
  background-color: #2196f3;
  color: white;
  padding: 1rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

header h1 {
  margin: 0;
  font-size: 1.5rem;
}

/* 導覽列 */
.main-nav a {
  color: white;
  text-decoration: none;
  margin-left: 15px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.main-nav a:hover {
  background-color: rgba(255,255,255,0.2);
}

.main-nav a.current-page {
  background-color: rgba(255,255,255,0.3);
  font-weight: bold;
}

.main-nav span {
  margin-left: 15px;
  font-size: 0.9em;
}

.main-nav button {
  background-color: #e91e63;
  color: white;
  border: none;
  padding: 5px 10px;
  margin-left: 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
}

.main-nav button:hover {
  background-color: #c2185b;
}

/* 漢堡選單 (手機版) */
.hamburger {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

/* 主內容區塊 */
main {
  max-width: 1200px;
  margin: 20px auto;
  padding: 0 20px;
  min-height: calc(100vh - 140px);
}

/* 按鈕樣式 */
.btn-primary {
  background-color: #2196f3;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  text-decoration: none;
  display: inline-block;
  transition: background-color 0.2s;
}

.btn-primary:hover {
  background-color: #1976d2;
}

.btn-secondary {
  background-color: white;
  color: #2196f3;
  border: 1px solid #2196f3;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background-color: #e3f2fd;
}

.btn-danger {
  background-color: #f44336;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
}

.btn-danger:hover {
  background-color: #d32f2f;
}

/* 卡片與容器 */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  overflow: hidden;
  transition: transform 0.2s;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.card-body {
  padding: 15px;
}

.card-title {
  margin: 0 0 10px 0;
  color: #333;
  font-size: 1.2rem;
}

.card-text {
  color: #666;
  font-size: 0.95rem;
  margin-bottom: 15px;
  line-height: 1.5;
}

.card-footer {
  padding: 15px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* 表單樣式 */
.form-container {
  background: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  max-width: 500px;
  margin: 40px auto;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #333;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  box-sizing: border-box;
}

.form-input:focus {
  border-color: #2196f3;
  outline: none;
}

/* 首頁 Hero Section (原始版) */
.hero-section {
  text-align: center;
  padding: 60px 20px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  margin-bottom: 30px;
}

.hero-title {
  font-size: 2.5rem;
  color: #333;
  margin-bottom: 20px;
}

.hero-description {
  font-size: 1.2rem;
  color: #666;
  margin-bottom: 30px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.hero-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
}

/* 功能特色區域 */
.features-section {
  margin-top: 40px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}

.feature-card {
  text-align: center;
  padding: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.feature-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-icon img {
  max-width: 100%;
  max-height: 100%;
}

.feature-title {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: #333;
}

.feature-description {
  color: #666;
}

/* Footer */
footer {
  text-align: center;
  padding: 20px;
  color: #666;
  border-top: 1px solid #eee;
  margin-top: 40px;
  background-color: white;
}

/* 任務篩選器 */
.task-filter {
  background: white;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
}

/* Modal 樣式 */
.task-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}

.task-modal.show {
  display: flex;
}

.task-modal-content {
  background: white;
  padding: 20px;
  border-radius: 8px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
}

/* 響應式調整 */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .hamburger {
    display: block;
    position: absolute;
    right: 20px;
    top: 15px;
  }

  .main-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    margin-top: 15px;
  }

  .header-content.open .main-nav {
    display: flex;
  }

  .main-nav a, .main-nav span, .main-nav button {
    margin: 5px 0;
    display: block;
    width: 100%;
  }

  .hero-buttons {
    flex-direction: column;
  }
}

/* Loading */
.loading-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 2s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}