
:root {
  --bg: #f7f4ee;
  --paper: #fffdf9;
  --ink: #24302d;
  --muted: #6d7772;
  --line: rgba(36, 48, 45, .12);
  --forest: #315b4e;
  --forest-dark: #24463c;
  --sand: #e7dbc8;
  --sun: #e3a646;
  --danger: #b44b4b;
  --shadow: 0 20px 55px rgba(41, 53, 49, .10);
  --radius-xl: 32px;
  --radius-lg: 22px;
  --radius-md: 15px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  background:
    radial-gradient(circle at 8% 0%, rgba(227, 166, 70, .18), transparent 29%),
    radial-gradient(circle at 92% 10%, rgba(49, 91, 78, .16), transparent 27%),
    var(--bg);
}

a { color: inherit; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }

.shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 900;
  letter-spacing: .03em;
}

.brand-mark {
  width: 43px;
  height: 43px;
  border-radius: 50% 50% 45% 55%;
  display: grid;
  place-items: center;
  color: white;
  background: var(--forest);
  box-shadow: 0 12px 24px rgba(49, 91, 78, .22);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.small-link {
  text-decoration: none;
  color: var(--muted);
  font-weight: 750;
  font-size: .92rem;
  padding: 10px 13px;
  border-radius: 999px;
}

.small-link:hover { background: rgba(255, 255, 255, .62); color: var(--ink); }

.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, .6fr);
  gap: 36px;
  align-items: center;
  min-height: 460px;
  padding: 62px;
  border: 1px solid rgba(255,255,255,.78);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(255,253,249,.98), rgba(244,239,229,.92));
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 46% 54% 59% 41% / 43% 39% 61% 57%;
  right: -90px;
  bottom: -100px;
  background: rgba(49,91,78,.09);
}

.eyebrow {
  color: var(--forest);
  font-size: .8rem;
  font-weight: 900;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 780px;
  margin: 14px 0 18px;
  font-size: clamp(2.65rem, 7vw, 5.7rem);
  line-height: .98;
  letter-spacing: -.06em;
}

.hero-copy {
  max-width: 690px;
  margin: 0;
  color: var(--muted);
  line-height: 1.95;
  font-size: 1.05rem;
  white-space: pre-line;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
  margin-top: 28px;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 850;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform .18s ease, background .18s ease;
}

.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--forest); color: white; }
.btn-primary:hover { background: var(--forest-dark); }
.btn-secondary { background: white; color: var(--ink); border: 1px solid var(--line); }

.hero-art {
  position: relative;
  z-index: 1;
  min-height: 285px;
  display: grid;
  place-items: center;
}

.hero-art {
  display: none;
}
.hero {
  grid-template-columns: 1fr;
}
/* 隱藏首頁右側圓形圖案 */
.hero-art {
  display: none;
}

/* 圖片移除後，讓文字佔滿整個區域 */
.hero {
  grid-template-columns: 1fr;
}

.orbit {
  position: relative;
  width: 270px;
  height: 270px;
  border-radius: 50%;
  border: 1px solid rgba(49,91,78,.18);
}

.orbit::before,
.orbit::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  inset: 34px;
  border: 1px dashed rgba(49,91,78,.22);
}

.orbit::after { inset: 78px; background: var(--forest); border: 0; }

.orbit-dot {
  position: absolute;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: white;
  box-shadow: 0 12px 28px rgba(36,48,45,.15);
  font-size: 1.25rem;
}

.orbit-dot:nth-child(1) { top: 10px; left: 112px; }
.orbit-dot:nth-child(2) { right: 8px; top: 105px; }
.orbit-dot:nth-child(3) { left: 104px; bottom: 7px; }
.orbit-dot:nth-child(4) { left: 7px; top: 105px; }

.section {
  padding: 78px 0 12px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  letter-spacing: -.04em;
}

.section-heading p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.filter-row {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 23px;
}

.filter-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 13px;
  background: rgba(255,255,255,.7);
  color: var(--muted);
  font-weight: 800;
}

.filter-chip.active {
  background: var(--forest);
  color: white;
  border-color: var(--forest);
}

.cards {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
}

.project-card {
  --card-accent: #315b4e;
  grid-column: span 6;
  min-height: 285px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  padding: 27px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(36,48,45,.11);
  background: var(--paper);
  box-shadow: 0 14px 38px rgba(41,53,49,.07);
  transition: transform .2s ease, box-shadow .2s ease;
}

.project-card.featured { grid-column: span 8; }
.project-card.featured + .project-card:not(.featured) { grid-column: span 4; }

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 24px 55px rgba(41,53,49,.13);
}

.project-card::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -70px;
  top: -70px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--card-accent) 13%, white);
}

.project-card-top,
.project-card-content,
.project-card-footer { position: relative; z-index: 1; }

.project-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.project-icon {
  width: 54px;
  height: 54px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--card-accent);
  font-size: 1.45rem;
  box-shadow: 0 12px 28px color-mix(in srgb, var(--card-accent) 26%, transparent);
}

.project-category {
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--card-accent);
  background: color-mix(in srgb, var(--card-accent) 10%, white);
  font-size: .78rem;
  font-weight: 900;
}

.project-card-content { margin: 24px 0; }
.project-card h3 {
  margin: 0 0 10px;
  font-size: clamp(1.35rem, 3vw, 2rem);
  letter-spacing: -.035em;
}

.project-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.78;
  white-space: pre-line;
}

.project-card-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.project-link {
  color: var(--card-accent);
  text-decoration: none;
  font-weight: 900;
}

.project-link:hover { text-decoration: underline; }
.external-mark { color: var(--muted); font-size: .86rem; }

.support-band {
  display: grid;
  grid-template-columns: 1.35fr .65fr;
  gap: 20px;
  align-items: center;
  margin: 80px 0 25px;
  padding: 36px;
  border-radius: var(--radius-xl);
  color: white;
  background: var(--forest);
  box-shadow: var(--shadow);
}

.support-band h2 { margin: 0 0 9px; font-size: clamp(1.7rem,4vw,3rem); }
.support-band p { margin: 0; color: rgba(255,255,255,.74); line-height: 1.8; }
.support-band .btn { justify-self: end; background: white; color: var(--forest); }

.site-footer {
  padding: 30px 0 50px;
  color: var(--muted);
  text-align: center;
  line-height: 1.8;
}

.empty-state, .loading-state {
  grid-column: 1 / -1;
  padding: 45px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  color: var(--muted);
  background: rgba(255,255,255,.55);
}

/* Admin */
.admin-body { background: #f3f5f4; }
.admin-shell { width: min(1240px, calc(100% - 28px)); margin: 0 auto; padding-bottom: 70px; }

.admin-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  background: rgba(243,245,244,.88);
  backdrop-filter: blur(16px);
}

.admin-title h1 { margin: 0; font-size: 1.42rem; }
.admin-title p { margin: 4px 0 0; color: var(--muted); font-size: .87rem; }

.admin-grid {
  display: grid;
  grid-template-columns: minmax(280px, .8fr) minmax(0, 1.7fr);
  gap: 18px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  background: white;
  box-shadow: 0 12px 35px rgba(41,53,49,.06);
}

.panel h2 { margin: 0 0 6px; font-size: 1.2rem; }
.panel-note { margin: 0 0 18px; color: var(--muted); font-size: .9rem; line-height: 1.6; }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: .83rem; font-weight: 850; }
.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid #dce1de;
  border-radius: 12px;
  padding: 11px 12px;
  color: var(--ink);
  background: white;
  outline: none;
}
.field textarea { min-height: 105px; resize: vertical; line-height: 1.6; }
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(49,91,78,.11);
}

.switch-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.check-label { display: inline-flex; align-items: center; gap: 7px; font-weight: 750; font-size: .9rem; }

.panel-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 17px; }
.admin-btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 850;
}
.admin-btn.primary { color: white; background: var(--forest); }
.admin-btn.secondary { color: var(--ink); background: #eef1ef; }
.admin-btn.danger { color: var(--danger); background: #fff0f0; }
.admin-btn:disabled { opacity: .45; cursor: not-allowed; }

.project-list { display: grid; gap: 10px; }
.admin-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fcfdfc;
}

.admin-item-icon {
  width: 43px;
  height: 43px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: white;
  font-size: 1.1rem;
}

.admin-item h3 { margin: 0; font-size: .98rem; }
.admin-item p { margin: 4px 0 0; color: var(--muted); font-size: .8rem; }
.admin-item-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: end; }

.icon-btn {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 9px;
  background: white;
  font-weight: 800;
}

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(27,37,34,.68);
  backdrop-filter: blur(9px);
}

.login-card {
  width: min(430px, 100%);
  border-radius: 25px;
  padding: 28px;
  background: white;
  box-shadow: 0 25px 75px rgba(0,0,0,.24);
}

.login-card h2 { margin: 0 0 8px; }
.login-card p { margin: 0 0 17px; color: var(--muted); line-height: 1.6; }

.status {
  min-height: 24px;
  margin-top: 12px;
  color: var(--muted);
  font-size: .88rem;
}
.status.error { color: var(--danger); }
.status.success { color: #177353; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 25px;
  z-index: 150;
  transform: translate(-50%, 18px);
  opacity: 0;
  pointer-events: none;
  padding: 11px 15px;
  border-radius: 12px;
  background: #1f2926;
  color: white;
  box-shadow: 0 14px 38px rgba(0,0,0,.22);
  transition: .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.hidden { display: none !important; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding: 42px 30px; }
  .hero-art { min-height: 240px; }
  .project-card,
  .project-card.featured,
  .project-card.featured + .project-card:not(.featured) { grid-column: span 6; }
  .support-band { grid-template-columns: 1fr; }
  .support-band .btn { justify-self: start; }
  .admin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 650px) {
  .shell { width: min(100% - 22px, 1160px); }
  .site-header { padding: 14px 0; }
  .small-link.hide-mobile { display: none; }
  .hero { min-height: auto; padding: 34px 22px; border-radius: 25px; }
  .hero h1 { font-size: clamp(2.5rem, 15vw, 4.2rem); }
  .hero-art { display: none; }
  .section { padding-top: 58px; }
  .section-heading { align-items: start; flex-direction: column; }
  .project-card,
  .project-card.featured,
  .project-card.featured + .project-card:not(.featured) { grid-column: 1 / -1; min-height: 265px; }
  .support-band { margin-top: 58px; padding: 28px 23px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .admin-item { grid-template-columns: auto 1fr; }
  .admin-item-actions { grid-column: 1 / -1; justify-content: start; }
}
