:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang HK", "Noto Sans TC", sans-serif;
  color: #26352b;
  background: #f7f0e2;
  line-height: 1.8;
  font-size: 18px;
  --forest: #234d3c;
  --forest-dark: #18392c;
  --leaf: #5f7d4c;
  --sage: #e8f0e2;
  --paper: #fffdf8;
  --wood: #a87345;
  --wood-light: #e7cba9;
  --ink-soft: #536156;
  --border: #c9d2c3;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background-color: #f7f0e2;
  background-image:
    repeating-linear-gradient(0deg, rgba(143, 91, 48, .035) 0, rgba(143, 91, 48, .035) 1px, transparent 1px, transparent 9px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .25) 0, rgba(255, 255, 255, .25) 2px, transparent 2px, transparent 42px);
}

a { color: #1e654e; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: #163f31; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 4px solid #e4a44e;
  outline-offset: 3px;
}

.site-header {
  background: var(--forest);
  color: #fffdf8;
  border-bottom: 7px solid var(--wood);
  box-shadow: 0 3px 0 rgba(24, 57, 44, .12);
}
.header-inner, main, .site-footer-inner { width: min(1120px, calc(100% - 36px)); margin: 0 auto; }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 22px; padding: 18px 0; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 900; font-size: 1.65rem; color: #fffdf8; white-space: nowrap; letter-spacing: .06em; }
.brand-mark { width: 58px; height: 58px; object-fit: contain; flex: 0 0 58px; }
.brand:hover { color: #f5d9b4; text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; gap: 7px 16px; font-size: 1rem; }
.nav a { color: #f7f0e2; padding: 4px 0; }
.nav a[aria-current="page"] { font-weight: 900; color: #f1c17d; text-decoration: underline; }
.header-cta { margin-left: auto; background: #d58a45; color: #fff; padding: 10px 16px; border-radius: 7px; font-weight: 900; white-space: nowrap; box-shadow: inset 0 -2px 0 rgba(0,0,0,.12); }
.header-cta:hover { background: #e0a15d; color: #fff; text-decoration: none; }

main { padding: 44px 0 76px; }
.hero, .section {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 34px;
  margin-bottom: 26px;
  box-shadow: 0 5px 0 rgba(168, 115, 69, .09);
}
.hero {
  border-left: 9px solid var(--leaf);
  background-image: linear-gradient(135deg, rgba(232,240,226,.94), rgba(255,253,248,.98) 60%), repeating-linear-gradient(0deg, rgba(168,115,69,.035) 0, rgba(168,115,69,.035) 2px, transparent 2px, transparent 12px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 340px);
  align-items: center;
  gap: 24px;
  overflow: hidden;
}
.hero-copy { min-width: 0; }
.hero-mascot { align-self: stretch; display: flex; align-items: end; justify-content: center; min-height: 300px; }
.hero-mascot img { display: block; width: min(100%, 340px); max-height: 430px; object-fit: contain; object-position: bottom center; }
h1, h2, h3 { color: var(--forest-dark); line-height: 1.35; margin-top: 0; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); margin-bottom: 14px; letter-spacing: .015em; }
h2 { font-size: 1.7rem; border-bottom: 3px solid var(--wood-light); padding-bottom: 10px; margin-bottom: 20px; }
h3 { font-size: 1.25rem; }
.lead { font-size: 1.2rem; max-width: 800px; }
.eyebrow { color: #6b4a2d; font-weight: 900; letter-spacing: .06em; }
.actions { display: flex; flex-wrap: wrap; gap: 13px; margin-top: 24px; }
.button { display: inline-block; padding: 13px 19px; border-radius: 7px; background: var(--forest); color: #fff; font-weight: 900; min-height: 50px; }
.button:hover { background: var(--forest-dark); color: #fff; text-decoration: none; }
.button.secondary { background: var(--sage); color: var(--forest-dark); border: 2px solid #9cb18e; }
.button.secondary:hover { background: #d6e5cc; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 17px; }
.card { border: 1px solid var(--border); border-top: 5px solid var(--wood); border-radius: 9px; padding: 21px; background: #fffefa; }
.card h3 { margin-bottom: 8px; }
.steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: 14px; }
.steps li { counter-increment: step; border-left: 6px solid var(--leaf); padding: 13px 17px; background: #f1f6ed; border-radius: 0 7px 7px 0; }
.steps li::before { content: counter(step) ". "; font-weight: 900; color: #6b4a2d; }
.meta { color: var(--ink-soft); font-size: 1rem; }
.tag { display: inline-block; color: var(--forest-dark); background: #e4eedf; border: 1px solid #b6c9a9; padding: 4px 10px; border-radius: 999px; font-size: .9rem; font-weight: 800; margin: 2px 5px 4px 0; }
.notice { background: #fff6e8; border: 2px solid #d5a264; border-radius: 8px; padding: 17px 19px; }
form { display: grid; gap: 17px; max-width: 760px; }
label { font-weight: 900; display: grid; gap: 7px; }
input, select, textarea { width: 100%; padding: 13px; border: 2px solid #aebbaa; border-radius: 6px; font: inherit; background: #fffefa; color: var(--forest-dark); }
textarea { min-height: 140px; }
button { font: inherit; border: 0; cursor: pointer; }
.site-footer { border-top: 7px solid var(--wood); background: var(--forest-dark); color: #f7f0e2; }
.site-footer-inner { padding: 30px 0; display: grid; gap: 10px; }
.site-footer a { color: #f4c889; }
.small { font-size: .95rem; color: #d8e2d5; }

@media (max-width: 760px) {
  .header-cta { margin-left: 0; }
  .header-inner { align-items: flex-start; gap: 13px 17px; }
  .brand-mark { width: 50px; height: 50px; flex-basis: 50px; }
  .nav { width: 100%; gap: 5px 14px; }
  main { padding-top: 25px; }
  .hero, .section { padding: 23px 21px; }
  .hero { grid-template-columns: 1fr; gap: 12px; }
  .hero-mascot { order: 2; min-height: 250px; }
  .hero-mascot img { width: min(100%, 290px); max-height: 340px; }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.45rem; }
  .lead { font-size: 1.1rem; }
  .button { width: 100%; text-align: center; }
}

/* Admin MVP */
.admin-main { padding-top: 34px; }
.admin-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 360px); gap: 22px; align-items: center; background: var(--paper); border: 1px solid var(--border); border-left: 9px solid var(--leaf); border-radius: 12px; padding: 30px 34px; margin-bottom: 22px; box-shadow: 0 5px 0 rgba(168,115,69,.09); }
.admin-intro h1 { margin-bottom: 8px; }
.admin-notice { background: #fff6e8; border: 2px solid #d5a264; border-radius: 8px; padding: 16px 18px; color: #5b4029; }
.admin-header-title { font-weight: 900; font-size: 1.25rem; color: #fffdf8; margin-right: auto; }
.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.admin-stat { background: var(--forest); color: #fffdf8; border-radius: 9px; padding: 17px 19px; border-bottom: 5px solid var(--wood); }
.admin-stat span { display: block; color: #d8e6d3; font-size: .95rem; }
.admin-stat strong { display: block; font-size: 2rem; line-height: 1.2; margin-top: 4px; }
.admin-workspace { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(330px, .88fr); gap: 22px; align-items: start; }
.admin-list-panel, .admin-detail-panel { background: var(--paper); border: 1px solid var(--border); border-radius: 12px; padding: 25px; box-shadow: 0 5px 0 rgba(168,115,69,.09); }
.admin-toolbar { display: flex; justify-content: space-between; gap: 18px; align-items: end; border-bottom: 3px solid var(--wood-light); padding-bottom: 13px; margin-bottom: 14px; }
.admin-toolbar h2 { border: 0; padding: 0; margin: 0; }
.admin-filter { min-width: 190px; font-size: .9rem; }
.admin-filter select, .detail-status select { margin-top: 4px; padding: 10px; }
.lead-list { display: grid; gap: 9px; }
.lead-row { width: 100%; text-align: left; background: #fffefa; border: 2px solid var(--border); border-left: 6px solid var(--wood-light); border-radius: 8px; padding: 14px 15px; color: var(--forest-dark); }
.lead-row:hover, .lead-row.is-selected { background: #eef5e9; border-color: #9cb18e; }
.lead-row-top, .lead-row-bottom { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.lead-row-main { display: block; margin: 6px 0 2px; font-weight: 800; }
.lead-row-bottom { color: var(--ink-soft); font-size: .88rem; }
.status-pill { display: inline-block; flex: 0 0 auto; border-radius: 999px; padding: 3px 9px; background: #e4eedf; border: 1px solid #b6c9a9; color: var(--forest-dark); font-size: .8rem; font-weight: 900; }
.status-0 { background: #fff0d9; border-color: #e3b36e; color: #6b4a2d; }
.status-3 { background: #e8f0e2; border-color: #9cb18e; }
.status-4 { background: #dceee6; border-color: #80ad99; }
.status-5 { background: #e7e1f2; border-color: #aca0c9; }
.status-6 { background: #dff1df; border-color: #8fbd91; }
.status-7 { background: #f8dfdf; border-color: #d29c9c; color: #713f3f; }
.detail-heading { display: flex; justify-content: space-between; gap: 12px; align-items: start; border-bottom: 3px solid var(--wood-light); padding-bottom: 13px; margin-bottom: 17px; }
.detail-heading h2 { border: 0; padding: 0; margin: 2px 0 0; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 19px; }
.detail-grid div { background: #f1f6ed; border-radius: 7px; padding: 9px 12px; }
.detail-grid dt { color: var(--ink-soft); font-size: .84rem; }
.detail-grid dd { margin: 2px 0 0; font-weight: 900; }
.detail-block { border-top: 1px solid var(--border); padding-top: 13px; margin-top: 13px; }
.detail-block p { margin: 5px 0 0; }
.detail-status { margin-top: 20px; }
.detail-status select { display: block; }
.admin-footer-actions { display: flex; align-items: center; gap: 15px; margin: 20px 0 40px; }
.empty-state { color: var(--ink-soft); background: #f1f6ed; border-radius: 8px; padding: 20px; text-align: center; }
@media (max-width: 820px) { .admin-intro, .admin-workspace { grid-template-columns: 1fr; } .admin-stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .admin-toolbar, .lead-row-top, .lead-row-bottom, .admin-footer-actions { align-items: stretch; flex-direction: column; } .admin-filter { min-width: 0; } .admin-stats { gap: 9px; } .admin-stat { padding: 13px; } .admin-stat strong { font-size: 1.7rem; } .admin-intro, .admin-list-panel, .admin-detail-panel { padding: 20px; } }


/* Data Place + OAuth states */
.admin-login { max-width: 760px; margin: 0 auto 26px; background: var(--paper); border: 1px solid var(--border); border-left: 9px solid var(--leaf); border-radius: 12px; padding: 34px; box-shadow: 0 5px 0 rgba(168,115,69,.09); }
.admin-login .button { margin-top: 8px; text-decoration: none; }
.form-error { color: #8a3434; font-weight: 800; min-height: 1.8em; }
.form-status-error { border-color: #c98b8b; background: #fff0f0; color: #713f3f; }
button:disabled, .button[aria-disabled="true"] { opacity: .6; cursor: wait; }
#logout-button { margin-left: auto; }
@media (max-width: 560px) { .admin-login { padding: 23px 21px; } #logout-button { margin-left: 0; } }


/* Extended request questions */
.checkbox-fieldset { border: 2px solid #aebbaa; border-radius: 8px; padding: 16px; background: #fffefa; }
.checkbox-fieldset legend { padding: 0 8px; font-weight: 900; color: var(--forest-dark); }
.checkbox-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 14px; }
.checkbox-option { display: flex; grid-template-columns: none; align-items: flex-start; gap: 9px; font-weight: 700; }
.checkbox-option input { width: 22px; height: 22px; flex: 0 0 22px; margin: 3px 0 0; accent-color: var(--forest); }
@media (max-width: 560px) { .checkbox-grid { grid-template-columns: 1fr; } }
