/* ── HERO ── */
.hero {
  position: relative;
  padding: 6rem 2rem 5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--ink);
  text-align: center;
}

.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 65% 40%, rgba(196,149,106,0.11) 0%, transparent 60%),
    radial-gradient(ellipse 50% 70% at 20% 80%, rgba(122,140,114,0.07) 0%, transparent 55%),
    linear-gradient(160deg, #1c1a17 0%, #252018 50%, #1e1b14 100%);
}

.hero-lines {
  position: absolute; inset: 0; pointer-events: none;
}
.hero-lines svg { width: 100%; height: 100%; }

.hero-inner {
  position: relative; z-index: 2;
  max-width: 600px;
}

.hero-label {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 0.88rem;
  color: var(--accent3);
  letter-spacing: 0.24em;
  margin-bottom: 1.6rem;
  opacity: 0;
  animation: fadeUp 0.9s 0.2s ease forwards;
}

.hero-title {
  font-family: 'Noto Serif TC', serif;
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 600;
  color: var(--paper);
  letter-spacing: 0.08em;
  line-height: 1.2;
  margin-bottom: 1rem;
  opacity: 0;
  animation: fadeUp 0.9s 0.4s ease forwards;
}

.hero-divider {
  width: 48px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent3), transparent);
  margin: 0 auto 1.4rem;
  opacity: 0;
  animation: fadeIn 0.9s 0.65s ease forwards;
}

.hero-desc {
  font-size: 0.83rem;
  color: rgba(250,247,242,0.45);
  letter-spacing: 0.06em;
  line-height: 2;
  opacity: 0;
  animation: fadeUp 0.9s 0.8s ease forwards;
}

/* ── MAIN CONTENT ── */
.main-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 5rem 2rem 4rem;
}

/* ── SECTION HEADER ── */
.section-label {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 0.8rem;
  letter-spacing: 0.28em;
  color: var(--accent2);
  margin-bottom: 0.4rem;
}
.section-title {
  font-family: 'Noto Serif TC', serif;
  font-size: clamp(1.3rem, 3vw, 1.65rem);
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}
.section-rule {
  width: 40px; height: 2px;
  background: var(--accent2);
  margin-bottom: 2.4rem;
}

/* ── FORM BLOCKS ── */
.form-block {
  margin-bottom: 3.5rem;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem 2rem;
}
.grid-design {
  grid-template-columns: 2fr 1fr;
}
.full { grid-column: 1 / -1; }

/* Field */
.field { display: flex; flex-direction: column; }

label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--text-soft);
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
label .req {
  color: var(--accent-rose);
  font-size: 0.62rem;
  letter-spacing: 0.05em;
}

input, select, textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--paper-mid);
  border-radius: 2px;
  background: var(--paper-warm);
  color: var(--text-main);
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 0.88rem;
  font-weight: 300;
  transition: border-color 0.2s, background 0.2s;
  appearance: none;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent2);
  background: #fff;
}
input::placeholder, textarea::placeholder {
  color: var(--text-soft);
  opacity: 0.5;
}
textarea { min-height: 90px; resize: vertical; }

select[multiple] {
  padding: 0;
  background: var(--paper-warm);
}
select[multiple] option {
  padding: 9px 13px;
  border-bottom: 1px solid var(--paper-mid);
}
select[multiple] option:checked {
  background: rgba(196,149,106,0.12);
  color: var(--accent1);
}

/* Font preview */
.font-preview-box {
  margin-top: 8px;
  padding: 10px 13px;
  border: 1px dashed var(--paper-mid);
  border-radius: 2px;
  font-size: 0.88rem;
  color: var(--text-soft);
  background: transparent;
  letter-spacing: 0.04em;
  min-height: 42px;
}

/* ── OR-GROUP 二擇一提示 ── */
.or-group-hint { display: none; } /* 改為 card 標題顯示，舊 hint 隱藏 */

.or-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent-rose);
  border: 1px solid var(--accent-rose);
  border-radius: 2px;
  padding: 1px 5px;
  margin-left: 4px;
  opacity: 0.75;
  line-height: 1.6;
}

/* ── OR-PAIR CARD ── */
.or-pair {
  grid-column: 1 / -1;
  border: 1.5px dashed rgba(184,124,110,0.35);
  border-radius: 4px;
  padding: 1.1rem 1.2rem 1.1rem;
  background: rgba(184,124,110,0.035);
  position: relative;
}
.or-pair-label {
  position: absolute;
  top: -0.62em;
  left: 1rem;
  background: var(--paper);
  padding: 0 0.5rem;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent-rose);
  opacity: 0.85;
  white-space: nowrap;
}
.or-pair-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
}
.or-pair-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: rgba(184,124,110,0.5);
  user-select: none;
  padding: 0 0.2rem;
}

@media (max-width: 620px) {
  .or-pair-inner { grid-template-columns: 1fr; }
  .or-pair-divider { display: none; }
}

/* ── DIVIDER LINE ── */
.form-sep {
  border: none;
  border-top: 1px solid var(--paper-mid);
  margin: 2.8rem 0;
}

/* ── ACTION ROW ── */
.actions {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}

button {
  padding: 0.75rem 2rem;
  border: 1px solid var(--accent3);
  border-radius: 2px;
  background: transparent;
  color: var(--accent1);
  font-family: 'Noto Serif TC', serif;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
}
button:hover { background: var(--accent3); color: var(--ink); }
button.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
button.primary:hover { background: var(--ink-soft); }

/* ── QUICK TEMPLATES ── */
.snippet-group {
  margin-top: 1.2rem;
  padding-top: 1.2rem;
  border-top: 1px dashed var(--paper-mid);
}
.snippet-label {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  color: var(--text-soft);
  margin-bottom: 0.7rem;
  text-transform: uppercase;
}
.snippet-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
button.snippet {
  padding: 0.5rem 1.2rem;
  border: 1px dashed var(--paper-mid);
  border-radius: 2px;
  background: transparent;
  color: var(--text-soft);
  font-family: 'Noto Serif TC', serif;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: border-color 0.25s, color 0.25s, background 0.25s;
}
button.snippet:hover {
  border-color: var(--accent3);
  border-style: solid;
  color: var(--accent1);
  background: var(--paper-warm);
}

/* ── OUTPUT BLOCK ── */
.output-wrap {
  margin-top: 3rem;
}
.output-label {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 0.78rem;
  letter-spacing: 0.24em;
  color: var(--accent2);
  margin-bottom: 0.8rem;
}

pre {
  white-space: pre-wrap;
  background: var(--ink);
  color: rgba(250,247,242,0.8);
  padding: 2rem 1.8rem;
  border-radius: 2px;
  font-size: 0.82rem;
  line-height: 2;
  letter-spacing: 0.02em;
  font-family: 'Noto Sans TC', sans-serif;
  font-weight: 300;
}

/* ── TOAST ── */
#toast {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%) scale(0.85);
  background: var(--ink-soft);
  color: var(--paper);
  padding: 20px 40px;
  border-radius: 2px;
  font-family: 'Noto Serif TC', serif;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  box-shadow: 0 8px 40px rgba(0,0,0,0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 9999;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%,-50%) scale(1);
}

/* ── FOOTER ── */
footer {
  background: var(--ink);
  color: rgba(250,247,242,0.55);
  padding: 2.5rem 2rem;
  text-align: center;
  border-top: 1px solid rgba(250,247,242,0.06);
  font-size: 0.78rem;
  line-height: 2;
  letter-spacing: 0.04em;
}
footer .inner { max-width: 600px; margin: 0 auto; }
.footer-name {
  font-family: 'Noto Serif TC', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--paper);
  letter-spacing: 0.12em;
  margin-bottom: 0.4rem;
}
.footer-role {
  color: var(--accent3);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  margin-bottom: 1rem;
}
.footer-rule {
  width: 32px; height: 1px;
  background: rgba(250,247,242,0.2);
  margin: 0.8rem auto;
}
.footer-link {
  color: rgba(250,247,242,0.75);
  text-decoration: none;
  border-bottom: 1px solid rgba(250,247,242,0.25);
  padding-bottom: 1px;
  transition: color 0.2s, border-color 0.2s;
  font-family: 'Noto Serif TC', serif;
  letter-spacing: 0.08em;
}
.footer-link:hover { color: var(--accent3); border-color: var(--accent3); }
.footer-copy {
  margin-top: 1.2rem;
  font-size: 0.68rem;
  color: rgba(250,247,242,0.3);
  letter-spacing: 0.06em;
}

/* ── LANG SWITCHER ── */
.lang-switcher {
  position: fixed;
  top: 1rem;
  right: 1.2rem;
  z-index: 1000;
  display: flex;
  gap: 0;
  border: 1px solid rgba(250,247,242,0.25);
  border-radius: 2px;
  overflow: hidden;
  backdrop-filter: blur(6px);
}
.lang-btn {
  padding: 0.3rem 0.7rem;
  font-size: 0.68rem;
  font-family: 'EB Garamond', serif;
  letter-spacing: 0.1em;
  cursor: pointer;
  border: none;
  background: rgba(28,26,23,0.7);
  color: rgba(250,247,242,0.5);
  transition: background 0.2s, color 0.2s;
  width: auto;
  text-align: center;
}
.lang-btn:hover { background: rgba(28,26,23,0.9); color: var(--accent3); }
.lang-btn.active {
  background: var(--accent1);
  color: var(--paper);
}

/* ── ANIMATIONS ── */

/* ── RESPONSIVE ── */
@media (max-width: 620px) {
  .grid { grid-template-columns: 1fr; }
  .main-wrap { padding: 3rem 1.2rem 3rem; }
  .actions { flex-direction: column; align-items: flex-start; }
  button { width: 100%; text-align: center; }
}
