:root {
  --green: #1f9d63;
  --green-dark: #157a4c;
  --green-bg: #e6f6ee;
  --pink: #e0577a;
  --pink-bg: #fdeaef;
  --purple: #7c5cd6;
  --purple-bg: #f0ecfb;
  --amber: #b8860b;
  --amber-bg: #fdf3d8;
  --blue: #2f6fed;
  --blue-bg: #eaf1ff;
  --ink: #1c2430;
  --ink-soft: #5b6472;
  --line: #e6e9ee;
  --bg: #fbfbfa;
  --card: #ffffff;
  --radius: 14px;
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui,
    -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Nav ---------- */
.nav {
  border-bottom: 1px solid var(--line);
  background: var(--card);
  position: sticky;
  top: 0;
  z-index: 20;
}
.nav .container {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 19px;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--green), var(--blue));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
}
.brand small {
  display: block;
  font-weight: 400;
  font-size: 12px;
  color: var(--ink-soft);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 14px;
  color: var(--ink-soft);
}
.nav-links a:hover { color: var(--ink); }
.btn-login {
  background: var(--green);
  color: #fff;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
}
.btn-login:hover { background: var(--green-dark); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  margin: 24px 0;
  background: linear-gradient(180deg, #cfe8f6 0%, #eaf3d9 55%, #f4ead0 100%);
  padding: 56px 40px 0;
  min-height: 300px;
}
.hero-copy { max-width: 620px; position: relative; z-index: 2; }
.hero-eyebrow {
  display: inline-block;
  background: rgba(255,255,255,.7);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--green-dark);
  margin-bottom: 14px;
}
.hero h1 {
  font-size: 34px;
  margin: 0 0 12px;
  letter-spacing: .5px;
}
.hero p {
  color: #33403a;
  font-size: 15px;
  margin: 0;
}
.hero-scene {
  position: relative;
  height: 190px;
  margin-top: 24px;
}
.hero-scene svg { position: absolute; bottom: 0; left: 0; width: 100%; height: 100%; }

/* ---------- Stat row ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 24px 0;
}
.stat {
  background: var(--card);
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.stat .icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--green-bg);
  color: var(--green-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.stat .label { font-size: 12px; color: var(--ink-soft); }
.stat .value { font-size: 24px; font-weight: 700; }

/* ---------- Section headings ---------- */
.section {
  margin: 40px 0;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-head h2 {
  font-size: 18px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-head a { font-size: 13px; color: var(--green-dark); font-weight: 600; }

/* ---------- Story / task cards ---------- */
.story-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}
.story-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.story-photo {
  height: 130px;
  background-size: cover;
  background-position: center;
}
.story-body { padding: 14px 16px 18px; }
.story-body h3 { font-size: 15px; margin: 0 0 6px; }
.story-body p { font-size: 13px; color: var(--ink-soft); margin: 0 0 10px; }

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}
.badge.cat-技術解決型 { background: var(--green-bg); color: var(--green-dark); }
.badge.cat-創意策劃型 { background: var(--purple-bg); color: var(--purple); }
.badge.cat-社會實踐型 { background: var(--pink-bg); color: var(--pink); }
.badge.diff { background: var(--amber-bg); color: var(--amber); }
.badge.status-招募中 { background: var(--green-bg); color: var(--green-dark); }
.badge.status-媒合中 { background: var(--blue-bg); color: var(--blue); }
.badge.status-已結案 { background: #eee; color: #777; }

/* ---------- CTA cards ---------- */
.cta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.cta-card {
  border-radius: var(--radius);
  padding: 22px 24px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.cta-card.give { background: var(--green-bg); }
.cta-card.solve { background: var(--blue-bg); }
.cta-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  background: #fff;
}
.cta-card h3 { margin: 0 0 4px; font-size: 16px; }
.cta-card p { margin: 0 0 14px; font-size: 13px; color: var(--ink-soft); }
.cta-btn {
  display: inline-block;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}
.cta-card.give .cta-btn { background: var(--green); }
.cta-card.solve .cta-btn { background: var(--blue); }

footer.site-footer {
  text-align: center;
  padding: 30px 0 40px;
  font-size: 12px;
  color: var(--ink-soft);
}

/* ---------- Task board ---------- */
.board-head h1 { font-size: 26px; margin: 28px 0 18px; }

.search-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.search-row input {
  flex: 1;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
}
.search-row input:focus { outline: 2px solid var(--green); border-color: transparent; }
.search-row button {
  background: var(--green);
  color: #fff;
  padding: 0 20px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
}
.search-row button:hover { background: var(--green-dark); }

.filter-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 22px;
}
.filter-panel-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 12px;
}
.filter-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  align-items: end;
}
.filter-field label {
  display: block;
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.filter-field select,
.filter-field input {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
}
.filter-clear {
  background: #fff;
  border: 1px solid var(--line) !important;
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 13px;
  color: var(--ink-soft);
}

.result-count { font-size: 13px; color: var(--ink-soft); margin-bottom: 14px; }
.result-count b { color: var(--ink); }

.task-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}
.task-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: box-shadow .15s, transform .15s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.task-card:hover {
  box-shadow: 0 8px 24px rgba(20, 40, 30, .08);
  transform: translateY(-2px);
  border-color: var(--green);
}
.task-badges { display: flex; gap: 6px; }
.task-card h3 { font-size: 16px; margin: 0; }
.task-loc { font-size: 12px; color: var(--ink-soft); }
.task-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag-chip {
  font-size: 11px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  padding: 3px 9px;
  border-radius: 999px;
}
.task-foot {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}
.task-foot .heart { color: var(--pink); }

.task-card.add-more {
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  border-style: dashed;
  text-align: center;
  font-size: 13px;
  gap: 6px;
}
.task-card.add-more .plus { font-size: 26px; color: var(--green); }

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 50px 20px;
  color: var(--ink-soft);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 24, 30, .45);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  z-index: 50;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff;
  border-radius: 16px;
  max-width: 760px;
  width: 100%;
  padding: 28px 30px 30px;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: var(--bg);
  width: 32px;
  height: 32px;
  border-radius: 999px;
  font-size: 16px;
  color: var(--ink-soft);
}
.modal-close:hover { background: var(--line); }
.modal-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.modal-title h2 { font-size: 21px; margin: 0; }
.modal-meta { font-size: 13px; color: var(--ink-soft); margin-bottom: 18px; }
.modal-body { display: grid; grid-template-columns: 1fr 240px; gap: 26px; }
.modal-main h4 { font-size: 13px; color: var(--ink-soft); margin: 18px 0 6px; }
.modal-main h4:first-child { margin-top: 0; }
.modal-main p { font-size: 14px; margin: 0; }
.modal-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

.modal-side {
  background: var(--bg);
  border-radius: 12px;
  padding: 16px;
  height: fit-content;
}
.modal-side .side-label { font-size: 11px; color: var(--ink-soft); margin-bottom: 2px; }
.modal-side .side-org { font-weight: 700; font-size: 14px; margin-bottom: 12px; }
.modal-side .side-contact { font-size: 12px; color: var(--ink-soft); margin-bottom: 16px; }
.apply-btn {
  width: 100%;
  background: var(--green);
  color: #fff;
  padding: 11px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 12px;
}
.apply-btn:hover { background: var(--green-dark); }
.apply-btn:disabled { background: #b9c4bd; cursor: default; }
.interest-note { font-size: 12px; color: var(--ink-soft); }

.tabs {
  display: flex;
  gap: 22px;
  border-bottom: 1px solid var(--line);
  margin-top: 22px;
}
.tab-btn {
  background: none;
  padding: 10px 2px;
  font-size: 13px;
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
}
.tab-btn.active { color: var(--green-dark); border-color: var(--green-dark); font-weight: 700; }
.tab-panel { display: none; padding-top: 16px; }
.tab-panel.active { display: block; }

.qa-post { display: flex; gap: 10px; margin-bottom: 16px; }
.qa-avatar {
  width: 32px; height: 32px; border-radius: 999px;
  background: var(--purple-bg); color: var(--purple);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}
.qa-post.reply .qa-avatar { background: var(--green-bg); color: var(--green-dark); margin-left: 42px; }
.qa-post.reply { margin-left: 0; }
.qa-author { font-size: 13px; font-weight: 700; }
.qa-time { font-size: 11px; color: var(--ink-soft); font-weight: 400; margin-left: 6px; }
.qa-content { font-size: 13px; margin-top: 3px; }
.qa-form { display: flex; gap: 8px; margin-top: 14px; }
.qa-form input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
}
.qa-form button {
  background: var(--green);
  color: #fff;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 860px) {
  .story-grid, .filter-grid, .task-grid, .cta-row { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .modal-body { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}
