/* ============================================
   旅行規劃 v2 - 樣式（墨綠簡約風）
   ============================================ */

:root {
  --primary: #2f5d50;
  --primary-dark: #244a40;
  --primary-light: #e8f1ed;
  --accent: #b5651d;
  --bg: #fafaf7;
  --surface: #ffffff;
  --text: #1f1f1f;
  --text-soft: #6b6b6b;
  --border: #e3e3e0;
  --danger: #c1453b;
  --success: #2e7d4f;
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", "PingFang HK", "Microsoft JhengHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

#app {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}

/* ===== 頂欄 ===== */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  border-top: 4px solid var(--primary);
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 16px;
  color: var(--primary-dark);
}
.brand .logo { font-size: 20px; }
.brand .badge {
  font-size: 11px;
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-soft);
}

/* ===== 卡片 ===== */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.card-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-weight: 600;
  font-size: 15px;
  color: var(--primary-dark);
}
.card-title .icon { margin-right: 6px; }

/* ===== 按鈕 ===== */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--primary);
  background: var(--surface);
  color: var(--primary);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}
.btn:hover { background: var(--primary-light); }
.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text-soft);
}
.btn-ghost:hover { background: #f5f5f3; }
.btn-danger {
  border-color: var(--danger);
  color: var(--danger);
}
.btn-danger:hover { background: #fcebe9; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { display: block; width: 100%; }

/* ===== 表單 ===== */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 4px;
}
.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
}
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.form-textarea { resize: vertical; min-height: 60px; }
.form-row { display: flex; gap: 8px; }
.form-row .form-group { flex: 1; }

/* ===== 列表 ===== */
.list { list-style: none; padding: 0; margin: 0; }
.list-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 6px;
  background: var(--surface);
}
.list-item:hover { background: var(--primary-light); }
.list-item-body { flex: 1; min-width: 0; }
.list-item-title { font-weight: 500; }
.list-item-meta {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 2px;
}
.list-item-actions {
  display: flex;
  gap: 4px;
}
.empty-state {
  text-align: center;
  color: var(--text-soft);
  padding: 24px;
  font-size: 13px;
}

/* ===== 標籤 ===== */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}
.tag-place { background: #e3f2fd; color: #1565c0; }
.tag-food { background: #fff3e0; color: #b5651d; }
.tag-activity { background: #f3e5f5; color: #6a1b9a; }
.tag-attraction { background: #e3f2fd; color: #1565c0; }
.tag-transport { background: #fce4ec; color: #ad1457; }
.tag-meal { background: #fff3e0; color: #b5651d; }
.tag-souvenir { background: #f3e5f5; color: #6a1b9a; }

/* ===== Modal ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--primary-dark);
}
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* ===== Toast ===== */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--surface);
  border-left: 4px solid var(--primary);
  padding: 10px 16px;
  border-radius: 6px;
  box-shadow: var(--shadow-md);
  min-width: 200px;
  font-size: 13px;
}
.toast-error { border-color: var(--danger); color: var(--danger); }
.toast-success { border-color: var(--success); color: var(--success); }

/* ===== 認證頁面 ===== */
.auth-page {
  max-width: 400px;
  margin: 60px auto;
}
.auth-page h1 {
  text-align: center;
  color: var(--primary-dark);
  margin-bottom: 24px;
  font-size: 22px;
}
.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--border);
}
.auth-tab {
  flex: 1;
  text-align: center;
  padding: 8px;
  cursor: pointer;
  color: var(--text-soft);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}
.auth-tab.active {
  color: var(--primary);
  border-color: var(--primary);
  font-weight: 500;
}

/* ===== 行程事件卡 ===== */
.event-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.event-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 6px;
  padding: 12px 14px;
  position: relative;
}
.event-card.type-attraction { border-left-color: #1565c0; }
.event-card.type-transport { border-left-color: #ad1457; }
.event-card.type-meal { border-left-color: #b5651d; }
.event-card.type-souvenir { border-left-color: #6a1b9a; }
.event-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.event-title { font-weight: 600; font-size: 14px; }
.event-meta { font-size: 12px; color: var(--text-soft); margin-top: 4px; }
.event-note { font-size: 13px; color: var(--text); margin-top: 6px; }
.event-link a {
  color: var(--primary);
  text-decoration: none;
  font-size: 12px;
}
.event-link a:hover { text-decoration: underline; }

/* ===== 行程單日分組 ===== */
.day-group {
  margin-bottom: 16px;
}
.day-header {
  font-weight: 600;
  font-size: 14px;
  color: var(--primary-dark);
  padding: 8px 0;
  border-bottom: 2px solid var(--primary-light);
  margin-bottom: 8px;
}

/* ===== 工具類 ===== */
.row { display: flex; gap: 8px; align-items: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.muted { color: var(--text-soft); }
.small { font-size: 12px; }
.divider { height: 1px; background: var(--border); margin: 12px 0; }

/* ===== 計劃卡片 ===== */
.trip-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.trip-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}
.trip-card-title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
}
.trip-card-meta {
  font-size: 12px;
  color: var(--text-soft);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.share-pwd {
  font-family: monospace;
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}