/* ============================================================
   GULICALC Phase 1 Homepage Prototype — additive layer
   Scoped under .proto-home so production pages (which only load
   style.css) are completely unaffected. Uses the SITE'S EXISTING
   teal/cyan brand tokens from style.css (--accent, --accent-green,
   --radius, --shadow...) — no new palette introduced, per instruction
   to stay on-brand rather than 1:1-copy the green reference mockup.
   ============================================================ */

.proto-home {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.proto-banner {
  max-width: 1200px;
  margin: 0.75rem auto 0;
  padding: 0.55rem 1rem;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 0.78rem;
  border-radius: 10px;
  text-align: center;
}

/* ---------- Hero copy: plain intro text, no longer a separate visual
   card — the calculator card directly below is the one and only
   interactive block (search → Quick Answer → shares → result). ---------- */
.proto-hero-copy {
  padding: 2rem 0 1.25rem;
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}
.proto-hero-copy h1 {
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0 0 0.6rem;
  text-wrap: balance;
}
.proto-hero-copy h1 span { color: var(--accent); }
.proto-hero-copy p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin: 0;
}

.proto-chip-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.9rem;
  font-size: 0.8rem;
}
.proto-chip-row .label { color: var(--text-muted); margin-right: 0.2rem; }
.proto-chip {
  border: 1px solid var(--border-color);
  background: var(--bg-white);
  color: var(--text-secondary);
  border-radius: 100px;
  padding: 0.3rem 0.85rem;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8rem;
  transition: 0.15s;
}
.proto-chip:hover, .proto-chip.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* ---------- Quick Answer bar (once a symbol is picked) ---------- */
.proto-quickanswer {
  max-width: 780px;
  margin: 1.6rem auto 0;
  display: none;
}
.proto-quickanswer.show { display: block; }
.proto-qa-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}
.proto-qa-head .name { font-weight: 800; font-size: 1.05rem; color: var(--text-primary); }
.proto-qa-head .meta { font-size: 0.74rem; color: var(--text-muted); }
.proto-qa-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
}
.proto-qa-cell {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.75rem 0.6rem;
  text-align: center;
}
.proto-qa-cell .k { font-size: 0.68rem; color: var(--text-muted); font-weight: 600; }
.proto-qa-cell .v { font-size: 1.05rem; font-weight: 800; color: var(--text-primary); margin-top: 0.2rem; font-variant-numeric: tabular-nums; }
.proto-qa-cell .v.accent { color: var(--accent); }
.proto-qa-cell .v.green { color: var(--accent-green); }
.proto-qa-source {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin: 0.6rem 0 0;
  line-height: 1.5;
}

/* ---------- Progressive Input: collapsed 進階設定 (price/dividend) ---------- */
.proto-advanced summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0;
  user-select: none;
}
.proto-advanced summary::-webkit-details-marker { display: none; }
.proto-advanced summary::before {
  content: "▸";
  font-size: 0.7rem;
  transition: transform 0.15s;
}
.proto-advanced[open] summary::before { transform: rotate(90deg); }
.proto-advanced summary:hover { color: var(--accent-hover); }

/* ---------- Next Intent (question-framed CTAs) ---------- */
.proto-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 2.5rem 0 1rem;
}
.proto-section-head h2 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}
.proto-section-head .sub { font-size: 0.78rem; color: var(--text-muted); }
.proto-section-head .more { font-size: 0.8rem; font-weight: 700; color: var(--accent); text-decoration: none; }

.proto-intent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.7rem;
}
.proto-intent-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  text-decoration: none;
  transition: 0.15s;
}
.proto-intent-card:hover { border-color: var(--accent); box-shadow: 0 8px 20px rgba(8,145,178,.1); transform: translateY(-1px); }
.proto-intent-card .icon {
  width: 34px; height: 34px; flex: 0 0 auto;
  border-radius: 9px;
  background: var(--accent-light);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.proto-intent-card .txt { font-size: 0.86rem; font-weight: 600; color: var(--text-primary); line-height: 1.4; }

/* ---------- Popular ETF grid ---------- */
.proto-etf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.75rem;
}
.proto-etf-card {
  display: block;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  text-decoration: none;
  transition: 0.15s;
}
.proto-etf-card:hover { border-color: var(--accent); box-shadow: 0 8px 20px rgba(8,145,178,.1); transform: translateY(-1px); }
.proto-etf-card .code { font-size: 0.68rem; font-weight: 800; color: var(--accent); }
.proto-etf-card .name { font-size: 0.86rem; font-weight: 700; color: var(--text-primary); margin: 0.1rem 0 0.5rem; }
.proto-etf-card .row { display: flex; justify-content: space-between; font-size: 0.78rem; }
.proto-etf-card .price { color: var(--text-secondary); }
.proto-etf-card .yield { font-weight: 800; color: var(--accent-green); }

/* ---------- Popular comparison list ---------- */
.proto-compare-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.6rem;
}
.proto-compare-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.65rem 0.9rem;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: 0.15s;
}
.proto-compare-item:hover { border-color: var(--accent); color: var(--accent); }
.proto-compare-item .arrow { color: var(--text-muted); font-weight: 400; }

/* ---------- AdSense placeholder (visual only, matches existing .ad-slot convention) ---------- */
.proto-ad-slot {
  max-width: 1200px;
  margin: 2rem auto;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border-color);
  border-radius: 12px;
  color: var(--text-muted);
  font-size: 0.78rem;
  background: var(--bg-input);
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .proto-home { padding: 0 1rem; }
  .proto-hero-copy { padding: 1.4rem 0 1rem; }
  .proto-hero-copy h1 { font-size: 1.45rem; line-height: 1.4; }
  .proto-qa-grid { grid-template-columns: repeat(2, 1fr); }
  .proto-section-head { margin: 1.8rem 0 0.8rem; }
}
/* v2.1 修訂 #6：極窄螢幕（<400px）H1 再收斂一點，避免斷行不平均 */
@media (max-width: 400px) {
  .proto-hero-copy h1 { font-size: 1.3rem; letter-spacing: -0.01em; }
}

/* ---------- Dark mode (reuse existing [data-theme=dark] convention) ---------- */
[data-theme="dark"] .proto-qa-cell,
[data-theme="dark"] .proto-intent-card,
[data-theme="dark"] .proto-etf-card,
[data-theme="dark"] .proto-compare-item {
  background: var(--bg-white);
  border-color: var(--border-color);
}
[data-theme="dark"] .proto-chip {
  background: var(--bg-white);
  border-color: var(--border-color);
  color: var(--text-secondary);
}
