/* ============================================================
   旅宿無障礙資訊填報：深藍＋白色、手機優先、大字、好按
   ============================================================ */
:root {
  /* 暖陽旅誌：米白底、陶土橘、深棕字；文字對比皆達 WCAG AA */
  --cream: #fbf6ee;
  --sand-50: #f8efe3;
  --sand-100: #f3e3cf;
  --sand-200: #ecdcc6;
  --heading: #2e2016;
  --ink: #3a2a1e;
  --muted: #6b5040;
  --brand: #a8442c;
  --brand-dark: #8a3622;
  --brand-tint: #f6e4d6;
  --line: #e3d5c2;
  --field: #9c8670;
  --white: #ffffff;
  --green: #2f6b4f;
  --green-bg: #e3efe6;
  --red: #b42318;
  --red-bg: #fdecea;
  --focus: #1d6f8c;
  --amber-bg: #fff3d6;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 1px 2px rgba(58, 42, 30, .06), 0 8px 24px rgba(58, 42, 30, .07);
  --tap: 52px;
  --font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --font-serif: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 18px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  line-height: 1.7;
  color: var(--ink);
  background: var(--cream);
}
img { max-width: 100%; display: block; }
a { color: var(--brand); text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.35; color: var(--heading); margin: 0 0 .5em; font-family: var(--font-serif); font-weight: 700; letter-spacing: .01em; }
p { margin: 0 0 1em; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 16px; top: -100px;
  background: var(--focus); color: var(--white);
  padding: 12px 16px; border-radius: 8px; z-index: 100; font-weight: 700;
}
.skip-link:focus { top: 12px; }

.demo-bar {
  background: var(--amber-bg);
  color: #5c4400;
  border-bottom: 1px solid #ecd27a;
  padding: 8px 16px;
  font-size: .85rem;
  text-align: center;
}

/* ---------- 版面 ---------- */
.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 720px; }

.site-header { background: var(--cream); color: var(--ink); border-bottom: 1px solid var(--line); }
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 64px; gap: 12px;
}
.brand {
  color: var(--heading); text-decoration: none; font-weight: 700; font-size: 1.1rem;
  font-family: var(--font-serif);
  display: flex; align-items: center; gap: 10px;
}
.brand-mark {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--brand); color: var(--white);
  display: grid; place-items: center; flex-shrink: 0;
}
.brand-mark svg { width: 22px; height: 22px; }
.header-actions { display: flex; align-items: center; gap: 12px; font-size: .9rem; }
.header-actions a { color: var(--ink); font-weight: 600; text-decoration: none; padding: 8px 4px; }
.header-actions a:hover { color: var(--brand); text-decoration: underline; }

.site-footer {
  margin-top: 64px; padding: 32px 0;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: .85rem;
}

/* ---------- 按鈕 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 10px 24px;
  border-radius: 999px; border: 2px solid transparent;
  font: inherit; font-weight: 700; font-size: 1rem;
  text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn-primary { background: var(--brand); color: var(--white); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-outline { background: var(--white); color: var(--brand); border-color: var(--brand); }
.btn-outline:hover { background: var(--sand-50); }
.btn-light { background: var(--brand); color: var(--white); }
.btn-light:hover { background: var(--brand-dark); }
.btn-ghost-light { background: transparent; color: var(--ink); border-color: var(--line); min-height: 44px; padding: 6px 16px; font-size: .9rem; }
.btn-link {
  background: none; border: 0; padding: 8px 4px; min-height: 44px;
  color: var(--brand); text-decoration: underline; text-underline-offset: 3px;
  font: inherit; font-weight: 600; cursor: pointer;
}
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-lg { min-height: 60px; font-size: 1.1rem; padding: 12px 32px; }

/* ---------- 說明頁 ---------- */
.hero { background: var(--sand-100); color: var(--ink); padding: 40px 0 0; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; align-items: end; }
.hero-text { padding-bottom: 8px; }
.hero-eyebrow { color: var(--brand); font-weight: 700; font-size: .9rem; letter-spacing: .08em; margin-bottom: 8px; }
.hero h1 { font-size: 1.75rem; }
.hero .lead { font-size: 1.1rem; color: var(--ink); max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; align-items: center; }
.hero-meta { color: var(--muted); font-size: .9rem; }
/* 業者說明頁用實景照片：手機滿版，大螢幕圓角卡片 */
.hero-photo { margin: 16px -16px 0; }
.hero-photo img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; object-position: 50% 80%; }
.hero-art { margin: 0 -16px; }
/* 手機只露出插畫下半部（小路與旅宿），避免把內容推太遠 */
.hero-art img { width: 100%; height: auto; aspect-ratio: 600 / 230; object-fit: cover; object-position: 50% 100%; margin-bottom: -2px; }

.section { padding: 48px 0 0; }
.section-title { font-size: 1.45rem; }
.section-lead { color: var(--muted); max-width: 40em; }

.cards { display: grid; gap: 16px; grid-template-columns: 1fr; margin-top: 24px; }
.card {
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 24px; background: var(--white); box-shadow: var(--shadow);
}
.card h3 { font-size: 1.1rem; margin-bottom: .35em; }
.card p { margin: 0; color: var(--muted); }
.card-icon {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--brand-tint); color: var(--brand);
  display: grid; place-items: center; font-size: 1.3rem; margin-bottom: 12px;
}

.compare { display: grid; gap: 16px; grid-template-columns: 1fr; margin-top: 24px; }
.compare-col { border-radius: var(--radius-lg); padding: 24px; }
.compare-bad { background: var(--sand-50); border: 1px dashed var(--line); }
.compare-good { background: var(--white); border: 2px solid var(--brand); box-shadow: var(--shadow); }
.compare-label { font-size: .85rem; font-weight: 700; color: var(--muted); margin-bottom: 8px; }

/* 呈現範例：資訊揭露卡 */
.facts { list-style: none; padding: 0; margin: 0; }
.facts li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--sand-200);
}
.facts li:last-child { border-bottom: 0; }
.facts .k { color: var(--muted); flex: 1 1 auto; }
.facts .v { font-weight: 700; color: var(--heading); text-align: right; flex: 0 0 auto; max-width: 55%; }
.facts .v-unknown { color: var(--muted); font-weight: 400; font-style: italic; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 12px; border-radius: 999px;
  font-size: .8rem; font-weight: 700; white-space: nowrap;
  background: var(--sand-100); color: var(--ink);
}
.badge-self { background: var(--sand-100); color: #5a4433; }
.badge-reviewed { background: #e2eef2; color: #1b5568; }
.badge-inspected { background: var(--green-bg); color: var(--green); }
.badge-tested { background: var(--brand-tint); color: var(--brand-dark); }

.levels { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 12px; }
.levels li { display: flex; gap: 16px; align-items: baseline; flex-wrap: wrap; }
.levels .badge { min-width: 7.5em; justify-content: center; }

.checklist { padding-left: 1.2em; }
.checklist li { margin-bottom: .4em; }

.cta-band {
  margin-top: 56px; background: var(--sand-100); border-radius: var(--radius-lg);
  padding: 32px 20px; text-align: center;
}

/* ---------- 表單 ---------- */
.form-head { padding: 24px 0 8px; }
.form-head h1 { font-size: 1.5rem; margin-bottom: .25em; }
.progress { margin: 16px 0 8px; }
.progress-track { height: 10px; background: var(--sand-200); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--brand); border-radius: 999px; transition: width .25s; }
.progress-text { font-weight: 700; color: var(--brand); margin-top: 8px; }

.notice {
  border-radius: var(--radius); padding: 16px; margin: 16px 0;
  background: var(--sand-50); border: 1px solid var(--line);
}
.notice p { margin: 0 0 8px; }

.error-summary {
  border: 3px solid var(--red); border-radius: var(--radius);
  padding: 16px 20px; margin: 16px 0; background: var(--white);
}
.error-summary-title { color: var(--red); font-size: 1.1rem; }
.error-summary ul { margin: 0; padding-left: 1.2em; }
.error-summary a { color: var(--red); font-weight: 600; }

.step { padding-top: 16px; }
.step-title { font-size: 1.4rem; }
.step-intro { color: var(--muted); }

.field {
  border: 0; margin: 0 0 28px; padding: 0; min-width: 0;
}
.label {
  display: block; font-weight: 700; font-size: 1.05rem;
  color: var(--heading); margin-bottom: 6px; padding: 0;
}
.req, .opt {
  display: inline-block; font-size: .72rem; font-weight: 700;
  padding: 1px 8px; border-radius: 999px; margin-left: 6px; vertical-align: middle;
}
.req { background: var(--brand); color: var(--white); }
.opt { background: var(--sand-200); color: var(--brand); }
.hint { color: var(--muted); font-size: .9rem; margin: 0 0 8px; }

.input {
  width: 100%; min-height: var(--tap);
  padding: 10px 14px;
  font: inherit; font-size: 1.05rem; color: var(--ink);
  background: var(--white);
  border: 2px solid var(--field); border-radius: 12px;
}
.input:focus { border-color: var(--brand); outline: 3px solid var(--focus); outline-offset: 1px; }
.input:disabled { background: #eef1f5; color: var(--muted); }
textarea.input { min-height: 120px; resize: vertical; }
select.input { appearance: auto; }

.options { display: grid; gap: 10px; }
.option {
  display: flex; align-items: center; gap: 12px;
  min-height: var(--tap); padding: 10px 16px;
  border: 2px solid var(--line); border-radius: 10px;
  background: var(--white); cursor: pointer;
}
.option:hover { border-color: var(--brand); }
.option:has(input:checked) { border-color: var(--brand); background: var(--sand-50); }
.option:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.option input { width: 24px; height: 24px; margin: 0; flex-shrink: 0; accent-color: var(--brand); }
.option-compact { min-height: var(--tap); white-space: nowrap; }
.option-consent { align-items: flex-start; padding: 16px; }
.option-consent input { margin-top: 4px; }

.measure-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.input-unit { position: relative; flex: 1 1 180px; max-width: 260px; }
.input-unit .input { padding-right: 64px; }
.unit {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-weight: 700; pointer-events: none;
}

.has-error .input, .has-error .option { border-color: var(--red); }
.error {
  color: var(--red); font-weight: 700; font-size: .95rem;
  margin: 8px 0 0; display: flex; gap: 6px;
}
.error::before { content: "⚠"; }

.photo-grid {
  list-style: none; padding: 0; margin: 0 0 12px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.photo-grid:empty { display: none; }
.photo-item { position: relative; }
.photo-item img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--line);
}
.photo-remove {
  position: absolute; right: 6px; top: 6px;
  min-height: 36px; padding: 4px 10px;
  background: rgba(11,37,69,.88); color: var(--white);
  border: 0; border-radius: 8px; font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer;
}
.upload-btn { cursor: pointer; }
.upload-btn:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }

.map-preview iframe {
  width: 100%; height: 260px; border: 1px solid var(--line); border-radius: 10px; margin-top: 8px;
}

.summary-list { list-style: none; padding: 0; margin: 0 0 24px; border: 1px solid var(--line); border-radius: var(--radius); }
.summary-list li {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px;
  padding: 8px 16px; border-bottom: 1px solid var(--sand-200);
}
.summary-list li:last-child { border-bottom: 0; }
.summary-name { font-weight: 700; flex: 1 1 auto; }
.summary-meta { color: var(--muted); font-size: .9rem; }

.step-nav {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; gap: 12px; flex-wrap: wrap;
  padding: 12px 0 16px; margin-top: 8px;
  background: linear-gradient(to bottom, rgba(255,255,255,.85), var(--white) 30%);
  border-top: 1px solid var(--line);
}
.step-nav .btn { flex: 1 1 auto; }
.step-nav #btn-prev { flex: 0 0 auto; }

.status {
  margin: 16px 0; padding: 16px; border-radius: var(--radius);
  background: var(--sand-50); font-weight: 700; color: var(--brand);
}
.status-error { background: var(--red-bg); color: var(--red); }

/* ---------- 感謝頁 ---------- */
.thanks { text-align: center; padding: 64px 0 0; }
.thanks-icon {
  width: 80px; height: 80px; margin: 0 auto 24px;
  border-radius: 50%; background: var(--green-bg); color: var(--green);
  display: grid; place-items: center; font-size: 2.4rem; font-weight: 700;
}
.ref-code {
  display: inline-block; font-size: 1.5rem; font-weight: 700; letter-spacing: .12em;
  background: var(--sand-50); border: 2px dashed var(--brand); color: var(--heading);
  padding: 8px 24px; border-radius: 10px; margin: 8px 0 24px;
}

/* ---------- 管理後台 ---------- */
.admin-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px; padding: 24px 0 8px;
}
.admin-head h1 { margin: 0; font-size: 1.5rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.toolbar .input { flex: 1 1 220px; max-width: 360px; }
.toolbar select.input { flex: 0 1 200px; }
.stats { color: var(--muted); font-size: .9rem; margin-bottom: 8px; }

.login-box {
  max-width: 440px; margin: 64px auto; text-align: center;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 32px 24px;
}

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.list { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.list th, table.list td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--sand-200); vertical-align: middle; }
table.list td { white-space: nowrap; }
table.list td.name { white-space: normal; min-width: 10em; }
table.list th { background: var(--sand-50); color: var(--heading); white-space: nowrap; font-size: .85rem; }
table.list tr:last-child td { border-bottom: 0; }
table.list tbody tr:hover { background: var(--sand-50); }
table.list td a { font-weight: 700; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }

.detail-grid { display: grid; gap: 24px; grid-template-columns: 1fr; }
.panel { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; background: var(--white); box-shadow: var(--shadow); }
.panel h2 { font-size: 1.2rem; padding-bottom: 10px; border-bottom: 1px solid var(--sand-200); }
.panel-sticky { align-self: start; }
.review-form .field { margin-bottom: 16px; }
.meta-line { color: var(--muted); font-size: .85rem; margin-top: 8px; }

.photo-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 8px 0 16px; }
.photo-gallery a { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.photo-gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.photo-group-title { font-size: .9rem; font-weight: 700; color: var(--muted); margin: 12px 0 4px; }

.map-embed iframe { width: 100%; height: 240px; border: 1px solid var(--line); border-radius: 10px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--heading); color: var(--white);
  padding: 12px 24px; border-radius: 999px; font-weight: 700; z-index: 50;
}

/* ---------- 旅客網站 ---------- */
.header-actions a[aria-current="page"] { font-weight: 700; text-decoration-thickness: 3px; }
.hero-compact { padding-top: 32px; }

.stays-layout { display: grid; gap: 24px; grid-template-columns: 1fr; margin-top: 24px; }
.filters { padding: 12px 20px; }
.filters details[open] { padding-bottom: 8px; }
.filters summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 44px; cursor: pointer; list-style: none;
}
.filters summary::-webkit-details-marker { display: none; }
.filters summary::after { content: "▾"; color: var(--brand); font-size: 1.2rem; }
.filters details[open] summary { margin-bottom: 16px; }
.filters details[open] summary::after { content: "▴"; }
.filters h2 { font-size: 1.15rem; margin: 0; padding: 0; border: 0; flex: 1; }
.summary-count { color: var(--brand); font-weight: 700; font-size: .9rem; }
.filters .field { margin-bottom: 20px; }
.filters .label { font-size: 1rem; }
.filters .option { min-height: 48px; padding: 8px 12px; font-size: .95rem; }
.filters .input-unit { max-width: none; }

.stay-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.stay-card {
  display: grid; grid-template-columns: minmax(0, 1fr);
  border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--white);
  box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s;
}
.stay-card:has(a:hover) { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(58,42,30,.08), 0 14px 32px rgba(58,42,30,.12); }
.stay-card:has(a:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.stay-cover {
  background: var(--sand-100); color: var(--muted);
  display: grid; place-items: center; overflow: hidden;
}
.stay-cover img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.stay-cover-empty { aspect-ratio: auto; min-height: 56px; font-size: .85rem; color: var(--muted); }
.stay-body { padding: 16px 20px 20px; }
.stay-body h3 { font-size: 1.25rem; margin-bottom: 4px; }
.stay-body h3 a { color: var(--heading); text-decoration: none; }
.stay-body h3 a:hover { color: var(--brand); text-decoration: underline; }
/* 整張卡片都可以點 */
.stay-body h3 a::after { content: ""; position: absolute; inset: 0; }
.stay-card { position: relative; }
.stay-meta { color: var(--muted); font-size: .9rem; margin-bottom: 12px; }

.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  background: var(--brand-tint); color: var(--brand-dark);
  padding: 2px 12px; border-radius: 999px; font-size: .85rem; font-weight: 700;
}
.tags li::before { content: "✓ "; }
.tags-lg { margin: 8px 0 24px; }
.tags-lg li { font-size: .95rem; padding: 4px 14px; }

.stay-hero { margin: 4px 0 16px; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); background: var(--sand-100); }
.stay-hero img { width: 100%; aspect-ratio: 16 / 9; max-height: 440px; object-fit: cover; }

.facts li.note { flex-direction: column; gap: 4px; }

/* ---------- 大螢幕 ---------- */
@media (min-width: 720px) {
  .hero { padding-top: 56px; }
  .hero-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; }
  .hero-text { padding-bottom: 56px; }
  .hero-art { margin: 0; }
  .hero-photo { margin: 0; align-self: center; padding-bottom: 56px; }
  .hero-photo img { aspect-ratio: 4 / 3; border-radius: var(--radius-lg); box-shadow: var(--shadow); }
  .hero-art img { aspect-ratio: auto; max-width: 560px; margin: 0 auto -2px; }
  .hero h1 { font-size: 2.6rem; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .compare { grid-template-columns: 1fr 1fr; }
  .options-2 { grid-template-columns: 1fr 1fr; }
  .photo-grid { grid-template-columns: repeat(3, 160px); }
  .step-nav { position: static; background: none; }
  .detail-grid { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
  .panel-sticky { position: sticky; top: 16px; }
  .stay-card { grid-template-columns: 240px minmax(0, 1fr); }
  .stay-cover { min-height: 180px; position: relative; }
  .stay-cover img { position: absolute; inset: 0; height: 100%; aspect-ratio: auto; }
}

@media (min-width: 960px) {
  .stays-layout { grid-template-columns: 300px minmax(0, 1fr); align-items: start; }
  .filters { position: sticky; top: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
