:root {
    --wine: #74151f;
    --wine-dark: #4b0d14;
    --gold: #d2a042;
    --paper: #fff9ec;
    --ink: #43251f;
    --muted: #7b655e;
    --line: #e4d2a8;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: "Microsoft JhengHei", "Noto Sans TC", sans-serif;
    background: #f5efe2;
}

button,
input,
textarea,
select {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.company-header {
    color: #ffffff;
    background:
        radial-gradient(circle at 15% 25%, #a34a3928 0 7%, transparent 7.5%),
        linear-gradient(90deg, #4d0d15, #7b1721 45%, #4d0d15);
    border-bottom: 4px solid #c89532;
}

.company-header__inner {
    width: min(1180px, calc(100% - 32px));
    min-height: 82px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-seal {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: #72141e;
    font-size: 25px;
    font-weight: 800;
    border: 3px double #e3bd6d;
    border-radius: 50%;
    background: #fff0c6;
}

.brand-name {
    color: #ffe9ae;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: .06em;
}

.brand-sub {
    margin-top: 3px;
    color: #f5dca9;
    font-size: 13px;
}

.company-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 14px;
}

.company-nav a,
.public-back-link {
    color: #ffffff;
    text-decoration: none;
}

.public-shell main {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.hero {
    min-height: 420px;
    display: grid;
    grid-template-columns: 1.4fr .8fr;
    align-items: center;
    gap: 42px;
    padding: 60px 0;
}

.hero h1 {
    margin: 0 0 18px;
    color: var(--wine);
    font-size: clamp(34px, 5vw, 60px);
    line-height: 1.15;
}

.hero p,
.feature p,
.rich-content {
    line-height: 1.9;
}

.hero-card {
    padding: 32px;
    text-align: center;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--paper);
}

.hero-lantern {
    margin-bottom: 16px;
    font-size: 70px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding-bottom: 50px;
}

.feature {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #ffffff;
}

.feature h2 {
    color: var(--wine);
}

.footer {
    padding: 28px;
    color: #7a665b;
    text-align: center;
    border-top: 1px solid #e0d3bc;
}

/* 尋燈前台 */
.lookup-body {
    --lookup-primary: #74151f;
    --lookup-primary-dark: #4b0d14;
    --lookup-gold: #d2a042;
    --lookup-paper: #fff9ec;
    --lookup-ink: #43251f;
    --keypad-desktop-width: 420px;

    min-height: 100vh;
    color: var(--lookup-ink);
    background:
        radial-gradient(circle at 10% 35%, #dec78940 0 1px, transparent 2px) 0 0 / 32px 32px,
        linear-gradient(#f8f0df, #efe2c8);
}

.lookup-top {
    position: relative;
    color: #fff;
    border-bottom: 5px solid var(--lookup-gold);
    background:
        linear-gradient(180deg, #3b0a0f 0 10px, transparent 10px),
        linear-gradient(90deg, var(--lookup-primary-dark), var(--lookup-primary), var(--lookup-primary-dark));
}

.lookup-top::after {
    content: "";
    position: absolute;
    inset: auto 0 -12px;
    height: 12px;
    opacity: .5;
    background: repeating-linear-gradient(90deg, #d5a743 0 20px, #8c4c24 20px 40px);
}

.lookup-top__inner {
    width: min(1160px, calc(100% - 28px));
    min-height: 145px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
}

.temple-mini {
    color: #f8e4b3;
    line-height: 1.6;
    font-size: 14px;
}

.lookup-title {
    min-width: 230px;
    padding: 12px 30px;
    text-align: center;
    border-inline: 2px solid #d9ad52;
}

.lookup-title .small {
    color: #f7dd9c;
    letter-spacing: .18em;
}

.lookup-title h1 {
    margin: 4px 0 0;
    color: #ffe4a0;
    font-size: 52px;
    font-family: DFKai-SB, "標楷體", serif;
    letter-spacing: .2em;
    text-indent: .2em;
    text-shadow: 0 3px 0 #5b1017;
}

.lookup-top__right {
    justify-self: end;
    color: #f8e4b3;
    font-size: 14px;
}

.lookup-main {
    width: min(1120px, calc(100% - 28px));
    margin: 38px auto 28px;
}

.lookup-panel {
    position: relative;
    overflow: hidden;
    padding: 34px;
    border: 2px solid #c69a3e;
    border-radius: 22px;
    background:
        radial-gradient(circle at 18% 18%, #d7c28d32 0 2px, transparent 3px) 0 0 / 48px 48px,
        var(--lookup-paper);
    box-shadow: 0 15px 40px #5f371f1c;
}

.lookup-panel::before,
.lookup-panel::after {
    content: "雲";
    position: absolute;
    color: #b5935426;
    font-size: 86px;
    font-family: DFKai-SB, "標楷體", serif;
    pointer-events: none;
}

.lookup-panel::before {
    left: 18px;
    top: 8px;
}

.lookup-panel::after {
    right: 18px;
    bottom: 0;
}

.lookup-heading {
    position: relative;
    z-index: 1;
    margin: 0 0 8px;
    text-align: center;
    color: var(--lookup-primary);
    font-size: 28px;
}

.lookup-help {
    position: relative;
    z-index: 1;
    margin: 0 0 18px;
    color: #776158;
    text-align: center;
}

.phone-display {
    position: relative;
    z-index: 1;
    width: min(560px, 100%);
    min-height: 64px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    color: var(--lookup-primary-dark);
    font-size: clamp(20px, 3vw, 30px);
    font-weight: 800;
    letter-spacing: .08em;
    border: 2px solid var(--lookup-gold);
    border-radius: 12px;
    background: #fffdf5;
}

.keypad-layout {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: var(--keypad-desktop-width) 250px;
    justify-content: center;
    align-items: center;
    gap: 36px;
}

.keypad {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 13px;
}

.key-btn {
    min-height: 70px;
    color: var(--lookup-primary-dark);
    font-size: 27px;
    font-weight: 800;
    border: 2px solid #cf9b36;
    background:
        radial-gradient(circle at 50% 42%, #fffdf4 0 52%, #ecd6a6 54% 62%, #8e3b24 64% 68%, #f1d185 70% 73%, #fff7e0 75%);
    cursor: pointer;
    transition: transform .12s ease, filter .12s ease;
}

.keypad-medallion .key-btn,
.keypad-round .key-btn {
    border-radius: 999px;
}

.keypad-square .key-btn {
    border-radius: 16px;
}

.key-btn:hover,
.key-btn:focus-visible {
    filter: brightness(1.04);
    transform: translateY(-1px);
}

.key-btn--text {
    font-size: 20px;
}

.lookup-submit,
.requery {
    width: 100%;
    min-height: 64px;
    padding: 13px 22px;
    color: #ffe7a5;
    font-size: 22px;
    font-weight: 800;
    border: 2px solid #d0a04a;
    border-radius: 14px;
    background: linear-gradient(#821c27, #5d0f18);
    box-shadow: inset 0 0 0 2px #3c0910;
    cursor: pointer;
}

.lookup-submit:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.queue-note {
    margin-top: 16px;
    padding: 15px;
    line-height: 1.6;
    border: 1px solid #d9bd78;
    border-radius: 12px;
    background: #fff6d9;
}

.lookup-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.lookup-links a {
    padding: 9px 14px;
    color: var(--lookup-primary);
    text-decoration: none;
    border: 1px solid #d7b269;
    border-radius: 999px;
    background: #fff9e9;
}

.result-wrap {
    max-width: 980px;
    margin: 0 auto;
}

.result-summary h2 {
    margin: 0 0 18px;
    color: var(--lookup-primary);
    text-align: center;
    font-size: 30px;
}

.result-table {
    position: relative;
    z-index: 1;
    width: 100%;
    border-collapse: collapse;
    background: #fffdf7;
}

.result-table th,
.result-table td {
    padding: 16px 18px;
    text-align: center;
    border: 1px solid #d8bd7e;
}

.result-table th {
    color: #fff2c3;
    background: var(--lookup-primary);
}

.result-table td.person {
    color: #4b1815;
    font-size: 21px;
    font-weight: 800;
}

.result-table td.lamp {
    color: #8c1d24;
    font-weight: 700;
}

.result-table td.loc {
    color: #6b4b2b;
}

.requery-row {
    position: relative;
    z-index: 1;
    width: min(360px, 100%);
    margin: 24px auto 0;
}

.no-result {
    position: relative;
    z-index: 1;
    padding: 40px 10px;
    text-align: center;
}

.no-result .icon {
    font-size: 58px;
}

.info-page {
    width: min(900px, calc(100% - 32px));
    margin: 32px auto;
}

.info-page > h1 {
    color: var(--wine);
}

.info-page--paper {
    padding: 28px;
    line-height: 1.8;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #ffffff;
}

.faq-item {
    margin-bottom: 12px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #ffffff;
}

.faq-item summary {
    color: var(--wine);
    font-weight: 800;
    cursor: pointer;
}

.faq-answer {
    padding-top: 12px;
    line-height: 1.8;
}

.rich-content img {
    max-width: 100%;
    height: auto;
}

.rich-content table {
    max-width: 100%;
    border-collapse: collapse;
}

@media (max-width: 820px) {
    .company-header__inner,
    .lookup-top__inner {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .company-header__inner {
        padding: 15px 0;
    }

    .company-nav {
        justify-content: center;
    }

    .hero {
        grid-template-columns: 1fr;
        padding: 40px 0;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .lookup-top__inner {
        min-height: 0;
        padding: 18px 0 24px;
    }

    .temple-mini {
        order: 2;
    }

    .lookup-title {
        order: 1;
        min-width: 0;
        border-inline: 0;
    }

    .lookup-title h1 {
        font-size: 45px;
    }

    .lookup-top__right {
        order: 3;
        justify-self: center;
    }

    .lookup-main {
        margin-top: 30px;
    }

    .lookup-panel {
        padding: 24px 16px;
    }

    .keypad-layout {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .keypad {
        width: min(430px, 100%);
        margin: 0 auto;
        gap: 11px;
    }

    .key-btn {
        min-height: 67px;
        font-size: 25px;
    }

    .lookup-submit {
        width: min(430px, 100%);
        margin: 0 auto;
        display: block;
    }

    .queue-note {
        width: min(430px, 100%);
        margin-inline: auto;
    }

    .result-table th,
    .result-table td {
        padding: 13px 8px;
        font-size: 15px;
    }

    .result-table td.person {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .brand-name {
        font-size: 18px;
    }

    .lookup-heading {
        font-size: 23px;
    }

    .lookup-help {
        font-size: 14px;
    }

    .key-btn {
        min-height: 62px;
    }
}

/* ======================================================================
   尋燈 v1.0 桌機橫向／手機直向工作區
   2026/08/14 18:57 UTC+8
   ====================================================================== */
.lookup-workspace {
    width: min(1500px, calc(100% - 24px));
    margin: 24px auto 30px;
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 16px;
}

.lookup-side {
    position: relative;
    overflow: hidden;
    min-height: 730px;
    border: 2px solid var(--lookup-gold);
    border-radius: 18px;
    background:
        radial-gradient(circle at 30px 540px, #c18c4217 0 45px, transparent 46px),
        linear-gradient(180deg, #4a0c13, var(--lookup-primary), #470b12);
    box-shadow: 0 16px 34px #3d15131c;
}

.lookup-side::after {
    content: "廟";
    position: absolute;
    left: 50%;
    bottom: 34px;
    transform: translateX(-50%);
    color: #efc76b18;
    font: 160px/1 DFKai-SB, "標楷體", serif;
    pointer-events: none;
}

.lookup-side__nav {
    position: relative;
    z-index: 1;
    padding-top: 42px;
}

.lookup-side__nav a {
    min-height: 74px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 22px;
    color: #f6d992;
    text-decoration: none;
    font-size: 20px;
    font-weight: 800;
    border-bottom: 1px solid #d8a74e2b;
}

.lookup-side__nav a span {
    width: 28px;
    text-align: center;
    font-size: 24px;
}

.lookup-side__nav a.active,
.lookup-side__nav a:hover,
.lookup-side__nav a:focus-visible {
    color: #74151f;
    background: linear-gradient(90deg, #fff0bf, #f4d58d);
}

.lookup-side__blessing {
    position: relative;
    z-index: 1;
    margin-top: 76px;
    display: grid;
    gap: 8px;
    color: #efca75;
    text-align: center;
    font: 22px/1.5 DFKai-SB, "標楷體", serif;
}

.lookup-side__blessing span {
    display: block;
}

.lookup-workspace .lookup-main {
    width: 100%;
    margin: 0;
}

.lookup-workspace .lookup-panel {
    min-height: 730px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.lookup-action-column {
    width: 250px;
}

.lookup-mini-note {
    margin-top: 16px;
    padding: 14px 15px;
    color: #735344;
    line-height: 1.7;
    border: 1px solid #ddc58d;
    border-radius: 12px;
    background: #fffaf0;
}

.lookup-workspace .lookup-links {
    display: none;
}

.lookup-workspace .result-wrap {
    justify-content: flex-start;
    min-height: 730px;
    padding-top: 42px;
}

.lookup-workspace .result-table {
    table-layout: fixed;
}

.lookup-workspace .result-table th:nth-child(1),
.lookup-workspace .result-table td:nth-child(1) {
    width: 28%;
}

.lookup-workspace .result-table th:nth-child(2),
.lookup-workspace .result-table td:nth-child(2) {
    width: 28%;
}

.lookup-workspace .result-table th:nth-child(3),
.lookup-workspace .result-table td:nth-child(3) {
    width: 44%;
}

.lookup-workspace .result-table td {
    min-height: 64px;
    font-size: 19px;
}

.lookup-workspace .result-table td.person {
    font-size: 23px;
}

@media (max-width: 900px) {
    .lookup-workspace {
        width: min(100% - 18px, 660px);
        grid-template-columns: 1fr;
        margin-top: 24px;
    }

    .lookup-side {
        display: none;
    }

    .lookup-workspace .lookup-panel {
        min-height: 0;
    }

    .lookup-workspace .lookup-links {
        display: flex;
    }

    .lookup-action-column {
        width: 100%;
    }

    .lookup-mini-note {
        width: min(430px, 100%);
        margin-inline: auto;
    }

    .lookup-workspace .result-wrap {
        min-height: 0;
        padding-top: 28px;
    }
}

@media (max-width: 560px) {
    .lookup-workspace {
        width: calc(100% - 12px);
    }

    .lookup-workspace .lookup-panel {
        padding: 22px 12px;
        border-radius: 18px;
    }

    .phone-display {
        min-height: 58px;
        margin-bottom: 18px;
        font-size: 20px;
    }

    .keypad {
        width: min(356px, 100%);
    }

    .key-btn {
        min-height: 70px;
        font-size: 28px;
    }

    .key-btn--text {
        font-size: 18px;
    }

    .result-table th,
    .result-table td {
        padding: 12px 6px;
    }

    .lookup-workspace .result-table td {
        font-size: 16px;
    }

    .lookup-workspace .result-table td.person {
        font-size: 19px;
    }
}
