/* =========================================================
   QRPASS 通用錯誤頁 — 色彩、字型、按鈕比照 www.qrpass.cc
   ========================================================= */
:root {
    color-scheme: dark;
    --green-900: #0a4237;
    --green-800: #0e5245;
    --green-700: #155f51;
    --line: #269f89;
    --teal: #36bca4;
    --teal-text: #6fd6c1;   /* 小字用，深底上對比 ≥ 4.5 */
    --check: #3ecba0;
    --sun: #ffd27a;
    --orange: #ffa208;
    --orange-dark: #db8610;
    --ink-on-orange: #0a3a31;
    --white: #ffffff;
    --white-80: rgba(255, 255, 255, .82);
    --ease-out: cubic-bezier(.22, 1, .36, 1);
    --font-cjk: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", sans-serif;
    --font-latin: "Manrope", "Segoe UI", sans-serif;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    overflow-x: hidden;
    background: var(--green-800);
    color: var(--white);
    font-family: var(--font-latin), var(--font-cjk);
    -webkit-font-smoothing: antialiased;
}
::selection { background: var(--orange); color: var(--ink-on-orange); }

a { color: inherit; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }

/* ---------- 背景：官網 Hero 漸層＋細格線 ---------- */
.backdrop {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    background: linear-gradient(160deg, var(--green-900) 0%, var(--green-800) 55%, #11604f 100%);
}
.backdrop::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(38, 159, 137, .16) 1px, transparent 1px),
        linear-gradient(90deg, rgba(38, 159, 137, .16) 1px, transparent 1px);
    background-size: 64px 64px;
    background-position: -1px -1px;
    -webkit-mask-image: radial-gradient(ellipse 75% 70% at 60% 45%, #000 20%, transparent 80%);
    mask-image: radial-gradient(ellipse 75% 70% at 60% 45%, #000 20%, transparent 80%);
}
.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
}
.glow-teal {
    width: 46vw; height: 46vw;
    top: -18vw; left: -12vw;
    background: rgba(62, 203, 160, .2);
}
.glow-orange {
    width: 38vw; height: 38vw;
    right: -10vw; bottom: -16vw;
    background: rgba(255, 162, 8, .16);
}

/* ---------- 外框 ---------- */
.shell {
    min-height: 100vh;
    min-height: 100dvh;
    padding-inline: max(20px, env(safe-area-inset-left)) max(20px, env(safe-area-inset-right));
}

.site-header {
    padding: 28px 0 0;
    animation: fade-in .8s var(--ease-out) both;
}
.brand {
    display: inline-flex;
    border-radius: 8px;
    transition: transform .3s var(--ease-out);
}
.brand:hover { transform: translateY(-2px); }
/* 官網白色透明底 Logo，直接放在深綠底上 */
.brand img { display: block; width: auto; height: 52px; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .2)); }

.header-tag {
    padding: 8px 14px;
    border: 1px solid rgba(38, 159, 137, .7);
    border-radius: 999px;
    color: var(--teal-text);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
}
.live-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--orange);
    box-shadow: 0 0 0 0 rgba(255, 162, 8, .6);
    animation: ping 2s infinite;
}

.main { padding: clamp(32px, 6vh, 72px) 0; }

/* ---------- 文字區 ---------- */
.eyebrow {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 22px;
    color: var(--teal-text);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .26em;
    text-transform: uppercase;
}
.eyebrow::before {
    content: "";
    width: 36px;
    height: 2px;
    background: var(--orange);
}

h1 {
    margin: 0 0 22px;
    font-family: var(--font-cjk);
    font-size: clamp(40px, 6vw, 80px);
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: .02em;
}
h1 .accent {
    color: var(--orange);
    white-space: nowrap;
}

.lead-text {
    margin: 0 0 26px;
    color: var(--sun);
    font-family: var(--font-cjk);
    font-size: clamp(16px, 1.5vw, 19px);
    font-weight: 700;
    line-height: 1.6;
}
.phrase { display: inline-block; }

.tips {
    margin: 0 0 34px;
    font-family: var(--font-cjk);
    font-size: 15px;
    line-height: 2;
    color: var(--white-80);
}
.tips li::before {
    content: "✓";
    margin-right: 10px;
    color: var(--check);
    font-weight: 700;
}

.actions { gap: 14px 16px; }

.btn-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 26px;
    border-radius: 999px;
    font-family: var(--font-cjk);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: transform .25s var(--ease-out), background-color .25s, box-shadow .25s, color .25s, border-color .25s;
}
.btn-pill .bi { font-size: 1.1em; }

.btn-primary-pill {
    border: 0;
    background: var(--orange);
    color: var(--ink-on-orange);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .2);
}
.btn-primary-pill:hover { background: #ffb02f; transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0, 0, 0, .25); }
.btn-primary-pill:hover .bi { animation: spin .7s var(--ease-out); }
.btn-primary-pill:active { transform: translateY(0); background: var(--orange-dark); }

.btn-ghost-pill {
    border: 1.5px solid rgba(255, 255, 255, .55);
    background: transparent;
    color: var(--white);
}
.btn-ghost-pill:hover { border-color: var(--white); background: rgba(255, 255, 255, .08); color: var(--white); transform: translateY(-2px); }

.home-link {
    gap: 10px;
    margin-left: 6px;
    font-family: var(--font-cjk);
    font-size: 15px;
    font-weight: 700;
    color: var(--white);
    text-decoration: none;
}
.home-link:hover { color: var(--white); }
.arrow-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--orange);
    color: var(--ink-on-orange);
    transition: transform .3s var(--ease-out), background-color .3s;
}
.home-link:hover .arrow-dot { transform: translateX(4px); background: #ffb02f; }

/* 參考資訊：給客服對照用的小字 */
.ref-line {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 22px;
    margin-top: 30px;
    padding-top: 16px;
    border-top: 1px solid rgba(38, 159, 137, .45);
    color: var(--teal-text);
    font-family: var(--font-cjk);
    font-size: 12px;
    letter-spacing: .04em;
}
.ref-item { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.ref-item > span {
    margin-left: 6px;
    color: var(--white-80);
    font-family: var(--font-latin);
    font-weight: 700;
}

/* ---------- 視覺區：打字機打錯字「Oops.」 ---------- */
.visual {
    position: relative;
    width: min(100%, 540px);
    container-type: inline-size;      /* 字級跟著視覺區寬度縮放（cqi） */
}
.oops-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 62cqi;
}
.oops {
    display: flex;
    align-items: baseline;
    justify-content: center;
    min-height: 1.2em;
    color: var(--white);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 31cqi;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    user-select: none;
}
.oops .ch { display: inline-block; animation: key .14s ease-out; }
/* 打錯的字：橘色波浪底線 */
.oops .typo {
    color: #ffb15a;
    text-decoration: underline wavy var(--orange);
    text-decoration-thickness: .035em;
    text-underline-offset: .12em;
}
/* 句點用橘色圓球 */
.dot-ball {
    display: inline-block;
    width: .17em;
    height: .17em;
    margin-left: .05em;
    border-radius: 50%;
    background: var(--orange);
    box-shadow: 0 0 .12em rgba(255, 162, 8, .55);
}
.caret {
    display: inline-block;
    width: .055em;
    height: .8em;
    margin-left: .05em;
    border-radius: .03em;
    background: var(--orange);
    animation: blink 1s steps(1) infinite;
}
.caret.typing { animation: none; }

/* ---------- 頁尾 ---------- */
.site-footer {
    padding: 20px 0 max(24px, env(safe-area-inset-bottom));
    border-top: 1px solid rgba(38, 159, 137, .45);
    color: var(--teal-text);
    font-size: 12px;
    letter-spacing: .06em;
}
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--white); }

/* ---------- 動態 ---------- */
.reveal { animation: reveal .9s var(--ease-out) both; }
.copy .reveal:nth-child(1) { animation-delay: .1s; }
.copy .reveal:nth-child(2) { animation-delay: .18s; }
.copy .reveal:nth-child(3) { animation-delay: .26s; }
.copy .reveal:nth-child(4) { animation-delay: .34s; }
.copy .reveal:nth-child(5) { animation-delay: .42s; }
.copy .reveal:nth-child(6) { animation-delay: .5s; }
.visual.reveal { animation-delay: .2s; }

@keyframes reveal  { from { opacity: 0; transform: translateY(24px); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes ping {
    70%  { box-shadow: 0 0 0 9px rgba(255, 162, 8, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 162, 8, 0); }
}
@keyframes shimmer {
    60%, 100% { transform: translateX(100%); }
}
@keyframes blink { 50% { opacity: 0; } }
@keyframes key { from { transform: translateY(6%); opacity: .3; } }

/* ---------- 斷點 ---------- */
/* 桌機：動畫區往左延伸到兩欄之間的留白，讓 Oops 大一點 */
@media (min-width: 992px) {
    .visual { width: calc(100% + 120px); max-width: none; margin-left: -120px; }
}

@media (max-width: 991.98px) {
    .main { align-items: flex-start !important; padding-top: 28px; }
    .visual { width: min(90%, 420px); margin-bottom: 36px; }
    .copy { max-width: 600px; margin-inline: auto; }
}

@media (max-width: 575.98px) {
    .shell { padding-inline: 16px; }
    .site-header { padding-top: 18px; }
    .brand img { height: 40px; }
    .header-tag { padding: 6px 11px; font-size: 10px; letter-spacing: .14em; }
    .visual { width: 92%; margin: 0 auto 20px; }
    .eyebrow { font-size: 11px; letter-spacing: .2em; margin-bottom: 16px; }
    .eyebrow::before { width: 24px; }
    h1 { font-size: clamp(36px, 11vw, 46px); margin-bottom: 16px; }
    .lead-text { font-size: 16px; margin-bottom: 18px; }
    .tips { font-size: 14.5px; margin-bottom: 26px; }
    .actions { gap: 12px; }
    .btn-pill { flex: 1 1 calc(50% - 6px); justify-content: center; padding: 13px 16px; }
    .home-link { width: 100%; justify-content: center; margin: 6px 0 0; }
    .ref-line { margin-top: 24px; justify-content: center; text-align: center; }
    .site-footer { justify-content: center !important; text-align: center; font-size: 11px; }
}

/* 減少動態：CSS 動畫停住；打字動畫由 JS 直接顯示完整的「Oops.」 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-delay: 0s !important;
        animation-iteration-count: 1 !important;
        transition: none !important;
    }
}
