/*
 * 檔案名稱：assets/css/app.css
 * 修改日期：2026/10/04 09:20（UTC+8）
 * 檔案用途：前台、安裝頁與共用視覺樣式。
 * 修改說明：建立手機／平板／電腦響應式介面。
 */

:root {
    --bg: #fff8ef;
    --surface: #ffffff;
    --surface-2: #fffaf4;
    --line: #eadac8;
    --text: #31251f;
    --muted: #7d6b60;
    --primary: #b85f2d;
    --primary-2: #d68446;
    --primary-soft: #fff0e1;
    --success: #2f8a5b;
    --danger: #c25145;
    --shadow: 0 12px 30px rgba(86, 49, 24, 0.08);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Noto Sans TC", "Segoe UI", Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 10% 5%, rgba(231, 179, 112, 0.18), transparent 22rem),
        var(--bg);
}

a {
    color: inherit;
}

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

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

.muted {
    color: var(--muted);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    color: #fff;
    background: linear-gradient(135deg, #8f431f, #c86d35);
    box-shadow: 0 6px 18px rgba(101, 48, 19, 0.18);
}

.brand {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand strong {
    font-size: 1.08rem;
    letter-spacing: 0.03em;
}

.brand small {
    opacity: 0.82;
}

.top-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.hero {
    position: relative;
    overflow: hidden;
    max-width: 1180px;
    margin: 20px auto 0;
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background:
        linear-gradient(135deg, rgba(255,255,255,0.96), rgba(255,246,235,0.94)),
        var(--surface);
    box-shadow: var(--shadow);
}

.hero::after {
    content: "祈福";
    position: absolute;
    right: 28px;
    bottom: -34px;
    font-size: 8rem;
    font-weight: 900;
    color: rgba(186, 102, 47, 0.06);
    pointer-events: none;
}

.hero h1 {
    margin: 0 0 10px;
    font-size: clamp(1.8rem, 4vw, 3.3rem);
    color: #6f351d;
}

.hero p {
    max-width: 760px;
    margin: 0;
    line-height: 1.8;
    color: var(--muted);
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 20px auto 60px;
}

.section-card {
    margin-bottom: 18px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.section-title h2,
.section-title h3 {
    margin: 0;
    color: #6b3d24;
}

.category-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    padding-bottom: 4px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.category-tab {
    flex: 0 0 auto;
    padding: 10px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: #70503d;
    background: #fff;
    cursor: pointer;
}

.category-tab.active {
    color: #fff;
    border-color: var(--primary);
    background: var(--primary);
}

.item-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.item-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 190px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface-2);
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.item-card:hover {
    transform: translateY(-2px);
    border-color: #d5ac8d;
    box-shadow: 0 9px 24px rgba(90, 48, 23, 0.1);
}

.item-card.selected {
    border: 2px solid var(--primary-2);
    background: #fff4e8;
}

.item-card.preselected::before {
    content: "廟方網站預選";
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    color: #fff;
    background: #7b5db1;
}

.item-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    margin-bottom: 12px;
    border-radius: 50%;
    font-size: 1.45rem;
    background: var(--primary-soft);
}

.item-name {
    padding-right: 84px;
    font-size: 1.08rem;
    font-weight: 800;
    color: #5a321e;
}

.item-desc {
    flex: 1;
    margin-top: 7px;
    line-height: 1.65;
    color: var(--muted);
    font-size: 0.92rem;
}

.item-price {
    margin-top: 12px;
    font-weight: 800;
    color: var(--primary);
}

.item-check {
    position: absolute;
    right: 14px;
    bottom: 14px;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: #aaa;
    background: #fff;
}

.item-card.selected .item-check {
    color: #fff;
    border-color: var(--success);
    background: var(--success);
}

.bridge-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid #d8cbea;
    border-radius: var(--radius-md);
    background: #f8f3ff;
    color: #5f4a79;
}

.form-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-grid {
    display: grid;
    gap: 14px;
}

.form-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid .span-2 {
    grid-column: 1 / -1;
}

label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    font-weight: 700;
    color: #654b3d;
}

input,
select,
textarea {
    width: 100%;
    min-height: 46px;
    padding: 10px 13px;
    border: 1px solid #ddcfbf;
    border-radius: 12px;
    outline: none;
    color: var(--text);
    background: #fff;
}

textarea {
    min-height: 96px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary-2);
    box-shadow: 0 0 0 3px rgba(214, 132, 70, 0.14);
}

.password-wrap {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.password-wrap input {
    flex: 1;
}

.icon-button {
    flex: 0 0 46px;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 9px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: #65402b;
    text-decoration: none;
    background: #fff;
    cursor: pointer;
}

.btn.primary {
    color: #fff;
    border-color: var(--primary);
    background: var(--primary);
}

.btn.success {
    color: #fff;
    border-color: var(--success);
    background: var(--success);
}

.btn.danger {
    color: #fff;
    border-color: var(--danger);
    background: var(--danger);
}

.btn.large {
    min-height: 50px;
    font-weight: 800;
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.person-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.person-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fffdf9;
}

.person-avatar {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #f3e1d2;
}

.summary-bar {
    position: sticky;
    bottom: 12px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid #e5c8ad;
    border-radius: 18px;
    background: rgba(255, 250, 244, 0.96);
    backdrop-filter: blur(8px);
    box-shadow: 0 12px 35px rgba(89, 45, 19, 0.16);
}

.summary-amount strong {
    display: block;
    margin-top: 2px;
    font-size: 1.35rem;
    color: var(--primary);
}

.notice {
    margin: 14px 0;
    padding: 14px 16px;
    border-radius: 14px;
    line-height: 1.65;
}

.notice.success {
    border: 1px solid #bfe1cc;
    background: #edf9f1;
    color: #2d704b;
}

.notice.warning {
    border: 1px solid #efd39d;
    background: #fff8e9;
    color: #795925;
}

.notice.danger {
    border: 1px solid #ebc0bb;
    background: #fff1ef;
    color: #8b4038;
}

.credential-box {
    margin: 12px 0 16px;
    padding: 12px;
    overflow-wrap: anywhere;
    border: 1px dashed #9bc9ad;
    border-radius: 12px;
    background: #fff;
}

.installer-body {
    display: grid;
    place-items: start center;
    padding: 30px 16px 60px;
}

.installer-shell {
    width: min(860px, 100%);
}

.installer-card {
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.installer-card h1 {
    margin-bottom: 4px;
    color: #6f351d;
}

.check-list {
    display: grid;
    gap: 8px;
    margin: 10px 0 24px;
}

.check-row {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
}

.check-row.ok {
    background: #edf9f1;
    color: #2d704b;
}

.check-row.bad {
    background: #fff0ee;
    color: #92473e;
}

.empty-state {
    padding: 36px 16px;
    text-align: center;
    color: var(--muted);
}

@media (max-width: 900px) {
    .item-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .topbar {
        position: static;
        align-items: flex-start;
        padding: 12px 14px;
    }

    .top-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .hero {
        width: calc(100% - 24px);
        margin-top: 12px;
        padding: 22px 18px;
        border-radius: 22px;
    }

    .hero::after {
        font-size: 5.5rem;
    }

    .container {
        width: calc(100% - 24px);
        margin-top: 12px;
    }

    .section-card {
        padding: 16px;
        border-radius: 20px;
    }

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

    .item-card {
        min-height: 150px;
    }

    .form-grid.two {
        grid-template-columns: 1fr;
    }

    .form-grid .span-2 {
        grid-column: auto;
    }

    .summary-bar {
        bottom: 8px;
        flex-direction: column;
        align-items: stretch;
    }

    .summary-bar .btn {
        width: 100%;
    }
}
