/* 森築美居 行銷神隊友 ─ 全站樣式（白色主題版）
   主色：森林綠 #25a968 ／ 底色：白色 ／ 綠色點綴用
*/
:root {
  --brand:      #25a968;
  --brand-2:    #2ec77c;
  --brand-deep: #1b8a53;
  --bg:         #ffffff;
  --bg-2:       #f7fbf8;
  --bg-3:       #edf6f1;
  --text:       #1a2e22;
  --text-muted: #5a7a6a;
  --text-on-green: #ffffff;
  --accent:     #25a968;
  --silver:     #9eb3a8;
  --border:     #d8ebe2;
  --shadow:     0 2px 12px rgba(37,169,104,.08);
  --radius:     12px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Noto Sans TC', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ── Header ── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: #fff;
  border-bottom: 2px solid var(--brand);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(37,169,104,.08);
}
.logo {
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--brand);
  letter-spacing: .5px;
}
.site-header nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: .9rem;
  transition: color .2s;
}
.site-header nav a:hover { color: var(--brand); }

/* ── Hero（首頁） ── */
.hero {
  text-align: center;
  padding: 72px 24px 56px;
  background: linear-gradient(160deg, #f0fbf5 0%, #e8f7ef 100%);
  border-bottom: 1px solid var(--border);
}
.hero-tag {
  display: inline-block;
  background: #fff;
  border: 1px solid var(--brand);
  color: var(--brand);
  font-size: .78rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 999px;
  letter-spacing: 1px;
  margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 14px;
}
.hero h1 span { color: var(--brand); }
.hero p {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 36px;
}

.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 28px;
}
.hero-cta .btn { font-size: 1rem; padding: 12px 32px; }
.hero-cta .btn.demo { border-color: var(--border); color: var(--text-muted); }
.hero-cta .btn.demo:hover { border-color: var(--brand); color: var(--brand); }

/* ── Tool Grid（首頁） ── */
.section-title {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.tools-section { padding: 52px 28px; max-width: 1060px; margin: 0 auto; }
.tools-section + .tools-section { padding-top: 0; }
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}
.tool-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 22px 20px;
  text-decoration: none;
  color: inherit;
  transition: border-color .2s, transform .15s, box-shadow .2s;
  display: block;
  box-shadow: var(--shadow);
}
.tool-card:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(37,169,104,.14);
}
.tool-icon { font-size: 1.8rem; margin-bottom: 10px; }
.tool-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.tool-card p { font-size: .85rem; color: var(--text-muted); line-height: 1.5; }
.tool-badge {
  display: inline-block;
  font-size: .68rem;
  font-weight: 700;
  background: var(--bg-3);
  color: var(--brand-deep);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 8px;
  margin-top: 10px;
}

/* ── Tool Page ── */
.tool-page {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}
.breadcrumb {
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.tool-page h1 {
  font-size: 1.75rem;
  font-weight: 900;
  margin-bottom: 6px;
  color: var(--text);
}
.subtitle {
  color: var(--text-muted);
  font-size: .95rem;
  margin-bottom: 28px;
  line-height: 1.6;
}

/* ── Panel / Form ── */
.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.panel h3 { font-size: 1rem; font-weight: 700; margin-bottom: 16px; color: var(--text); }
label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  margin-top: 14px;
}
label:first-of-type { margin-top: 0; }
input[type=text], textarea, select {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: .9rem;
  font-family: inherit;
  padding: 10px 14px;
  outline: none;
  transition: border-color .2s;
}
input[type=text]:focus, textarea:focus, select:focus { border-color: var(--brand); }
textarea { min-height: 90px; resize: vertical; }
select { cursor: pointer; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media(max-width:560px){ .row { grid-template-columns: 1fr; } }

/* ── Tone Picker (chip) ── */
.tone-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.tone-chip {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: .82rem;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s;
}
.tone-chip:hover { border-color: var(--brand); color: var(--brand); }
.tone-chip.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

/* ── Buttons ── */
.btn-row { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.btn {
  background: var(--brand);
  color: var(--text-on-green);
  border: none;
  border-radius: 8px;
  padding: 11px 28px;
  font-size: .95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background .2s;
}
.btn:hover { background: var(--brand-2); }
.btn.demo {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.btn.demo:hover { border-color: var(--brand); color: var(--brand); }

/* ── Result ── */
.result-wrap { display: flex; flex-direction: column; gap: 16px; }
.result-card { position: relative; }
.copy-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 4px 12px;
  font-size: .78rem;
  cursor: pointer;
  transition: all .15s;
}
.copy-btn:hover { border-color: var(--brand); color: var(--brand); }
.result-box {
  min-height: 120px;
  font-size: .92rem;
  line-height: 1.8;
  white-space: pre-wrap;
  color: var(--text);
  padding-top: 8px;
}
.result-box.empty { color: var(--text-muted); font-style: italic; }

/* ── Refine Box ── */
.refine-box {
  background: #fff;
  border: 2px solid var(--brand);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.refine-box h4 { font-size: .95rem; font-weight: 700; color: var(--brand); margin-bottom: 4px; }
.hint { font-size: .8rem; color: var(--text-muted); margin-bottom: 12px; }

/* ── Streaming cursor ── */
.streaming::after {
  content: '▌';
  animation: blink .8s step-end infinite;
  color: var(--brand);
}
@keyframes blink { 50% { opacity: 0; } }

/* ── Footer ── */
footer {
  text-align: center;
  padding: 28px;
  color: var(--text-muted);
  font-size: .8rem;
  border-top: 1px solid var(--border);
  background: var(--bg-2);
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ══════════════════════════════════════
   參考資料庫 (ref-uploader) 樣式
   ══════════════════════════════════════ */
.ref-uploader {
  margin-top: 16px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-2);
}

.ref-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: .88rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: left;
  transition: color .15s, background .15s;
}
.ref-toggle:hover { color: var(--brand); background: #fff; }
.ref-toggle-icon { font-size: 1rem; }
.ref-toggle-label { flex: 1; }
.ref-toggle-arrow { font-size: .7rem; color: var(--silver); }
.ref-badge {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 700;
  padding: 1px 7px;
  margin-left: 4px;
}

.ref-body {
  padding: 16px;
  border-top: 1px solid var(--border);
  background: #fff;
}
.ref-hint {
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.5;
}

.ref-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.ref-name-input {
  flex: 1;
  min-width: 0;
}
.ref-file-btn {
  flex-shrink: 0;
  font-size: .82rem;
  padding: 8px 14px;
  cursor: pointer;
  white-space: nowrap;
}

.ref-content-area {
  min-height: 80px;
  width: 100%;
}

.ref-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ref-item {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
}
.ref-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.ref-item-name {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
}
.ref-del-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: .75rem;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}
.ref-del-btn:hover { border-color: #e55; color: #e55; }
.ref-item-preview {
  font-size: .8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 2px;
}
.ref-item-date {
  font-size: .72rem;
  color: var(--silver);
}
.ref-empty {
  font-size: .82rem;
  color: var(--silver);
  text-align: center;
  padding: 12px 0;
  font-style: italic;
}
