:root {
  --ink: #173f35;
  --ink-2: #245949;
  --gold: #c79a43;
  --paper: #fbf5e9;
  --paper-deep: #f3ead9;
  --line: #dfd2bf;
  --text: #1f2927;
  --muted: #68736f;
  --danger: #a33b32;
  --shadow: 0 10px 28px rgba(48, 38, 20, .12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  background:
    linear-gradient(180deg, rgba(255, 248, 236, .96), rgba(245, 234, 216, .88)),
    url("/app-download/assets/mist_mountain_banner.png") center top / cover fixed;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 88% 20%, rgba(201, 154, 67, .2), transparent 24%),
    radial-gradient(circle at 6% 72%, rgba(24, 89, 73, .1), transparent 30%),
    repeating-linear-gradient(90deg, rgba(199, 154, 67, .035) 0 1px, transparent 1px 5px);
  mix-blend-mode: multiply;
  opacity: 1;
  z-index: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 26px;
  border-bottom: 1px solid rgba(44, 55, 43, .12);
  background: rgba(255, 250, 241, .88);
  box-shadow: 0 8px 22px rgba(60, 43, 16, .08);
  backdrop-filter: blur(16px);
  /* 強制清除任何潛在的圓角與外邊距，確保通欄貼頂 */
  border-radius: 0 !important;
  margin: 0 !important;
  width: 100% !important;
  left: 0;
}

.topbar.menu-open {
  box-shadow: 0 12px 28px rgba(60, 43, 16, .12);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  text-decoration: none;
}

.brand img {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  box-shadow: 0 9px 20px rgba(10, 55, 43, .18);
}

.brand span {
  color: var(--ink);
  font-size: 23px;
  font-weight: 900;
  letter-spacing: .08em;
  white-space: nowrap;
}

.menu {
  width: 36px;
  height: 36px;
  display: grid;
  gap: 6px;
  align-content: center;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--ink);
  cursor: pointer;
}

.menu span {
  display: block;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
  transition: transform .18s ease, opacity .18s ease;
}

.menu[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(10px) rotate(45deg);
}

.menu[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.menu[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-10px) rotate(-45deg);
}

.menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 18px;
  width: min(250px, calc(100vw - 36px));
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(20, 85, 67, .14);
  border-radius: 18px;
  background: rgba(255, 250, 241, .98);
  box-shadow: 0 18px 40px rgba(47, 36, 16, .16);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity .18s ease, transform .18s ease;
}

.menu-panel[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.menu-panel a,
.menu-panel button {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-radius: 12px;
  padding: 0 14px;
  color: var(--ink);
  background: rgba(20, 85, 67, .06);
  font: inherit;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .06em;
  cursor: pointer;
  text-decoration: none;
}

.menu-panel a:active,
.menu-panel button:active {
  background: rgba(201, 154, 54, .16);
}

.menu-panel .accent {
  color: #8b6420;
  background: rgba(201, 154, 54, .14);
}

.page-shell {
  width: min(100vw, 540px);
  margin: 0 auto;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 250, 241, .92), rgba(247, 238, 224, .82)),
    url("/app-download/assets/mist_mountain_banner.png") center 120px / auto 58% no-repeat;
  box-shadow: 0 0 50px rgba(50, 38, 16, .12);
  position: relative;
}

.decorations {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.decorations::before,
.decorations::after {
  content: "";
  position: absolute;
  pointer-events: none;
  opacity: .45;
  z-index: 0;
}

.decorations::before {
  top: 155px;
  right: -88px;
  width: 210px;
  height: 210px;
  border: 2px solid rgba(199, 154, 67, .32);
  border-radius: 50%;
  background:
    repeating-conic-gradient(from -8deg, transparent 0 10deg, rgba(199, 154, 67, .13) 10deg 11deg),
    radial-gradient(circle, transparent 0 53%, rgba(199, 154, 67, .18) 54% 55%, transparent 56%);
}

.decorations::after {
  left: -42px;
  top: 212px;
  width: 116px;
  height: 58px;
  border-top: 2px solid rgba(199, 154, 67, .42);
  border-bottom: 2px solid rgba(199, 154, 67, .42);
  border-radius: 999px;
  transform: skewX(-20deg);
}

main {
  position: relative;
  z-index: 1;
  padding: 42px 22px 56px;
}

.hero {
  text-align: center;
  margin-bottom: 34px;
}

.hero h1,
.section-heading h2,
.result-panel h2 {
  margin: 0;
  color: var(--ink);
  font-family: "DFKai-SB", "KaiTi", "標楷體", serif;
  font-size: clamp(34px, 7vw, 54px);
  line-height: 1.18;
  letter-spacing: 0.03em;
  font-weight: 900;
}

.hero p {
  width: min(640px, 100%);
  margin: 18px auto 0;
  font-size: clamp(17px, 3.2vw, 22px);
  line-height: 1.8;
}

.steps {
  display: grid;
  gap: 14px;
  margin-bottom: 22px;
}

.step-card,
.panel,
.faq details,
.result-panel {
  background: rgba(255, 253, 248, .88);
  border: 1px solid rgba(223, 210, 191, .9);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.step-card {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 18px;
  align-items: center;
  padding: 22px 28px;
}

.step-icon,
.check-icon,
.success-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  color: #f4ead5;
  background: linear-gradient(145deg, var(--ink-2), #10372e);
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.12);
  font-size: 28px;
  font-weight: 800;
}

.step-card h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(22px, 4vw, 30px);
  letter-spacing: 0;
}

.step-card h2 span {
  margin-right: 8px;
}

.step-card p,
.faq p,
.timeline p,
.notice p,
.message {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.panel,
.result-panel {
  padding: clamp(22px, 4vw, 34px);
  margin-top: 22px;
}

.section-heading {
  margin-bottom: 22px;
  text-align: center;
}

.section-heading p {
  margin: 0 0 8px;
  color: var(--gold);
  font-weight: 800;
}

.section-heading h2 {
  font-size: clamp(28px, 5vw, 40px);
}

.section-description {
  width: min(660px, 100%);
  margin: 14px auto 0;
  color: var(--muted);
  font: 500 16px/1.8 "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  text-align: left;
}

.field {
  display: grid;
  gap: 9px;
  margin-bottom: 22px;
  font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  font-weight: 700;
}

.field b {
  color: var(--danger);
}

input,
select,
textarea {
  width: 100%;
  min-height: 58px;
  padding: 0 18px;
  color: var(--text);
  background: rgba(255,255,255,.72);
  border: 1px solid #d4c9ba;
  border-radius: 8px;
  font: 500 17px/1.5 "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

textarea {
  min-height: 112px;
  padding-top: 15px;
  resize: vertical;
}

.field small {
  justify-self: end;
  color: var(--muted);
  font-weight: 500;
}

.consent {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 20px;
  font-size: 18px;
}

.consent input {
  width: 24px;
  min-height: 24px;
  accent-color: var(--ink);
}

.notice {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 14px;
  align-items: center;
  margin: 16px 0 22px;
  padding: 16px;
  border: 1px solid rgba(199, 154, 67, .45);
  border-radius: 10px;
  background: rgba(255, 248, 234, .76);
}

.notice span {
  color: var(--gold);
  font-size: 30px;
}

.primary-button,
.danger-button,
.secondary-button,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
  width: 100%;
  border-radius: 9px;
  border: 1px solid var(--ink);
  font: 800 20px/1 "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  letter-spacing: 0.05em;
  cursor: pointer;
  text-decoration: none;
}

.primary-button {
  color: #f9e9b6;
  background:
    linear-gradient(160deg, rgba(255,255,255,.1), transparent 32%),
    linear-gradient(145deg, #1d5747, #0d372f);
  border-bottom-color: var(--gold);
  box-shadow: 0 8px 16px rgba(20, 61, 50, .18);
}

.danger-button {
  color: #fff8ef;
  background:
    linear-gradient(160deg, rgba(255,255,255,.12), transparent 34%),
    linear-gradient(145deg, #b14a3f, #8f3028);
  border-color: #7f2b25;
  border-bottom-color: #d7a24a;
  box-shadow: 0 8px 16px rgba(122, 42, 34, .16);
}

.secondary-button,
.text-button {
  color: var(--ink);
  background: rgba(255,255,255,.62);
}

.provider-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.self-delete-panel {
  margin-top: 22px;
}

.manual-guidance {
  margin: 0 0 22px;
  padding: 16px 18px;
  color: var(--danger);
  background: rgba(163, 59, 50, .08);
  border: 1px solid rgba(163, 59, 50, .24);
  border-radius: 10px;
  font: 700 16px/1.7 "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

.signed-in {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 16px;
  align-items: center;
}

.signed-in p {
  margin: 0 0 4px;
  color: var(--muted);
}

.signed-in strong {
  color: var(--ink);
  word-break: break-word;
}

.text-button {
  width: auto;
  min-height: 46px;
  padding: 0 18px;
  font-size: 16px;
}

.result-panel {
  text-align: center;
}

.success-mark {
  width: 96px;
  height: 96px;
  margin: 0 auto 22px;
  color: #f9e9b6;
  font-size: 54px;
}

.timeline {
  margin: 26px 0;
  padding: 18px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.timeline-row {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  position: relative;
  padding-bottom: 20px;
}

.timeline-row:last-child {
  padding-bottom: 0;
}

.timeline-row > span {
  width: 18px;
  height: 18px;
  margin-top: 5px;
  border: 2px solid #b8c0bb;
  border-radius: 50%;
}

.timeline-row.active > span {
  background: var(--ink-2);
  border-color: var(--ink-2);
}

.timeline-row strong {
  color: var(--ink);
  font-size: 18px;
}

.faq {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.home-return {
  margin-top: 22px;
}

.faq details {
  padding: 18px 22px;
}

.faq summary {
  color: var(--ink);
  cursor: pointer;
  font-size: 20px;
  font-weight: 800;
}

.hidden {
  display: none !important;
}

.message.error {
  color: var(--danger);
}

.message.success {
  color: var(--ink);
}

button:disabled {
  cursor: not-allowed;
  opacity: .62;
}

@media (min-width: 760px) {
  .page-shell {
    width: min(100vw, 1120px);
  }
  .topbar {
    padding-left: 34px;
    padding-right: 34px;
  }
}

@media (max-width: 640px) {
  .step-card {
    grid-template-columns: 58px 1fr;
    padding: 18px;
  }

  .step-icon,
  .check-icon {
    width: 52px;
    height: 52px;
    font-size: 22px;
  }

  .provider-row,
  .signed-in {
    grid-template-columns: 1fr;
  }

  .text-button {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .topbar {
    padding-left: 18px;
    padding-right: 18px;
  }

  .brand img {
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }

  .brand span {
    font-size: 20px;
  }
}
