/* ============================================================
   趣兽聚 - 主样式表
   浅蓝色系 · 玻璃拟态 · Furry风格
   ============================================================ */

:root {
    --color-primary: #5BB5D5;
    --color-primary-light: #7EC8E3;
    --color-primary-dark: #3A9BC0;
    --color-accent: #FFB6C1;
    --color-accent-warm: #FFD4A8;
    --color-bg: #E8F4FA;
    --color-bg-gradient: linear-gradient(135deg, #E8F4FA 0%, #D4ECF7 50%, #C5E3F0 100%);
    --color-surface: rgba(255, 255, 255, 0.72);
    --color-surface-solid: #FFFFFF;
    --color-text: #2C4A5E;
    --color-text-light: #6B8FA3;
    --color-text-muted: #9BB5C5;
    --color-border: rgba(91, 181, 213, 0.2);
    --color-shadow: rgba(91, 181, 213, 0.15);
    --color-success: #5CB85C;
    --color-warning: #F0AD4E;
    --color-danger: #E87C7C;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --shadow-sm: 0 2px 8px var(--color-shadow);
    --shadow-md: 0 4px 20px var(--color-shadow);
    --shadow-lg: 0 8px 32px rgba(91, 181, 213, 0.2);
    --glass-blur: blur(16px);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
    --nav-height: 64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    color: var(--color-text);
    background: var(--color-bg-gradient);
    min-height: 100vh;
    min-height: 100dvh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: auto;
    -webkit-overflow-scrolling: touch;
}

body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    left: 0;
    right: 0;
    touch-action: none;
}

a { color: var(--color-primary-dark); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-primary); }

img { max-width: 100%; display: block; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ---- Glass Effect ---- */
.glass {
    background: var(--color-surface);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--color-border);
}

/* ---- Icons ---- */
.icon { width: 20px; height: 20px; flex-shrink: 0; }
.icon-lg { width: 28px; height: 28px; }
.icon-xl { width: 36px; height: 36px; }

/* ---- Navbar ---- */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    height: calc(var(--nav-height) + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
    box-shadow: var(--shadow-sm);
}
.navbar-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: var(--nav-height);
}
.navbar-brand {
    display: flex; align-items: center; gap: 8px;
    font-size: 1.25rem; font-weight: 700; color: var(--color-primary-dark);
    min-width: 0;
}
.navbar-brand-text {
    display: flex; align-items: baseline; gap: 6px; min-width: 0; flex-wrap: wrap;
}
.navbar-brand-name { white-space: nowrap; }
.navbar-brand-tagline {
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em;
    color: var(--color-primary); white-space: nowrap;
}
.navbar-logo { width: 36px; height: 36px; object-fit: contain; border-radius: 10px; flex-shrink: 0; }
.navbar-menu { display: flex; align-items: center; gap: 8px; flex: 1; justify-content: flex-end; }
.nav-link {
    padding: 8px 16px; border-radius: var(--radius-sm);
    color: var(--color-text); font-size: 0.9rem; transition: all var(--transition);
}
.nav-link:hover, .nav-link.active { background: rgba(91,181,213,0.12); color: var(--color-primary-dark); }
.nav-user { display: flex; align-items: center; gap: 8px; }
.nav-staff-btn { white-space: nowrap; }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; color: var(--color-text); padding: 8px; }
.navbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.nav-login-btn,
.nav-register-btn,
.nav-points-btn,
.nav-profile-btn { white-space: nowrap; }

.main-content { padding-top: calc(var(--nav-height) + env(safe-area-inset-top, 0px) + 24px); padding-bottom: calc(48px + env(safe-area-inset-bottom, 0px)); min-height: calc(100dvh - 200px); }

/* ---- Buttons ---- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 24px; border-radius: var(--radius-md); font-size: 0.9rem;
    font-weight: 500; border: none; cursor: pointer; transition: all var(--transition);
    text-decoration: none; white-space: nowrap;
}
.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: #fff; box-shadow: 0 4px 12px rgba(91,181,213,0.35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(91,181,213,0.45); color: #fff; }
.btn-outline { background: transparent; border: 1.5px solid var(--color-primary); color: var(--color-primary-dark); }
.btn-outline:hover { background: rgba(91,181,213,0.1); }
.btn-ghost { background: rgba(91,181,213,0.08); color: var(--color-primary-dark); }
.btn-ghost:hover { background: rgba(91,181,213,0.15); }
.btn-secondary { background: #E8F4FA; color: var(--color-primary-dark); border: 1px solid var(--color-border); }
.btn-secondary:hover { background: #D4ECF7; }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-sm { padding: 6px 16px; font-size: 0.85rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
a.btn.is-disabled, a.btn[aria-disabled="true"],
button.btn.is-disabled, button.btn[aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    transform: none;
}

/* ---- Join page ---- */
.join-page { max-width: 480px; margin-top: 24px; padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px)); }
.join-page-card { padding: 28px; }
.join-page-card:hover { transform: none; }
.join-page-header { margin-bottom: 24px; }
.join-page-back { font-size: 0.88rem; color: var(--color-text-muted); text-decoration: none; }
.join-page-back:hover { color: var(--color-primary-dark); }
.join-page-header h2 { margin: 12px 0 4px; font-size: 1.35rem; }
.join-page-subtitle { color: var(--color-text-light); font-size: 0.92rem; margin: 0; }
.join-guest-tip {
    padding: 12px 14px; margin-bottom: 20px; border-radius: var(--radius-md);
    background: rgba(91, 181, 213, 0.12); border: 1px solid rgba(91, 181, 213, 0.28);
    font-size: 0.88rem; color: var(--color-primary-dark); line-height: 1.55;
}
.join-guest-tip a { color: var(--color-primary-dark); font-weight: 600; }
.join-meal-block {
    padding: 14px 16px; margin-bottom: 16px; border-radius: var(--radius-md);
    background: rgba(255, 182, 120, 0.12); border: 1px solid rgba(255, 160, 80, 0.28);
}
.join-meal-info {
    font-size: 0.9rem; color: var(--color-primary-dark); font-weight: 600;
    margin-bottom: 12px; line-height: 1.55;
}
.join-page-note { font-size: 0.82rem; color: var(--color-text-muted); margin-bottom: 16px; }
.join-qq-preview {
    display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 12px;
    background: rgba(91,181,213,0.08); border-radius: 10px;
}
.join-qq-preview img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.join-page .recaptcha-wrap { overflow: visible; }

/* ---- Profile staff ---- */
.profile-staff-card:hover { transform: none; }
.profile-staff-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.profile-staff-role {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-primary-dark);
    background: rgba(91, 181, 213, 0.15);
    padding: 4px 10px;
    border-radius: 999px;
}
.profile-staff-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}
.profile-staff-stat {
    display: block;
    text-align: center;
    padding: 12px 8px;
    border-radius: var(--radius-md);
    background: rgba(91, 181, 213, 0.08);
    border: 1px solid rgba(91, 181, 213, 0.18);
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.profile-staff-stat.has-badge {
    border-color: rgba(58, 155, 192, 0.35);
    background: rgba(91, 181, 213, 0.12);
}
.profile-staff-stat-value {
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-primary-dark);
    line-height: 1.2;
}
.profile-staff-stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 4px;
}
.profile-staff-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
.profile-staff-nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 10px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--color-border);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--color-text);
    text-decoration: none;
    text-align: center;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.profile-staff-nav-item:hover {
    border-color: rgba(91, 181, 213, 0.45);
    background: rgba(91, 181, 213, 0.08);
    color: var(--color-primary-dark);
}
.profile-staff-subtitle {
    margin: 0 0 10px;
    font-size: 0.92rem;
    color: var(--color-text-light);
}
.profile-staff-activity-card {
    padding: 14px;
    margin-bottom: 10px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(91, 181, 213, 0.2);
}
.profile-staff-activity-card:hover { transform: none; }
.profile-staff-activity-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}
.profile-staff-activity-title {
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--color-text);
}
.profile-staff-activity-meta {
    margin: 8px 0 0;
    font-size: 0.78rem;
    color: var(--color-text-muted);
}
.profile-staff-activity-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}
@media (max-width: 480px) {
    .profile-staff-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.join-steps {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 24px;
    padding: 0 4px;
}
.join-step-item {
    flex: 1;
    text-align: center;
    font-size: 0.72rem;
    color: var(--color-text-muted);
    position: relative;
    padding-top: 28px;
}
.join-step-item::before {
    content: attr(data-step);
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 22px;
    height: 22px;
    line-height: 22px;
    border-radius: 50%;
    background: rgba(91, 181, 213, 0.15);
    color: var(--color-text-muted);
    font-size: 0.75rem;
    font-weight: 600;
}
.join-step-item.is-active {
    color: var(--color-primary-dark);
    font-weight: 600;
}
.join-step-item.is-active::before,
.join-step-item.is-done::before {
    background: var(--color-primary);
    color: #fff;
}
.join-step-item + .join-step-item::after {
    content: '';
    position: absolute;
    top: 11px;
    right: 50%;
    width: 100%;
    height: 2px;
    background: rgba(91, 181, 213, 0.2);
    z-index: -1;
    margin-right: 11px;
}
.join-step-item.is-done + .join-step-item::after,
.join-step-item.is-active + .join-step-item::after {
    background: rgba(91, 181, 213, 0.45);
}

.join-step-panel {
    transition: opacity 0.28s ease;
}
.join-step-panel[hidden] {
    display: none !important;
}
.join-step-panel.is-visible {
    animation: fadeIn 0.32s ease forwards;
}

.join-extra-fields {
    margin-bottom: 16px;
    border: 1px solid rgba(91, 181, 213, 0.2);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.6);
}
.join-extra-fields summary {
    padding: 12px 14px;
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--color-text-light);
    list-style: none;
    user-select: none;
}
.join-extra-fields summary::-webkit-details-marker { display: none; }
.join-extra-fields summary::after {
    content: '＋';
    float: right;
    color: var(--color-primary);
}
.join-extra-fields[open] summary::after { content: '－'; }
.join-extra-fields .join-extra-body {
    padding: 0 14px 14px;
    border-top: 1px dashed rgba(91, 181, 213, 0.2);
}

.join-submit-hint {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    text-align: center;
    margin: 0 0 10px;
    min-height: 1.2em;
}

.join-modal-summary {
    padding: 12px 14px;
    margin-bottom: 16px;
    border-radius: var(--radius-md);
    background: rgba(91, 181, 213, 0.1);
    border: 1px solid rgba(91, 181, 213, 0.22);
    font-size: 0.88rem;
    color: var(--color-primary-dark);
    line-height: 1.5;
}
.join-modal-summary strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 4px;
    color: var(--color-text);
}

.join-guest-quick {
    display: none;
    margin-bottom: 12px;
}
.join-guest-quick.is-visible {
    display: block;
}

/* ---- Create activity tutorial video ---- */
.create-tutorial-iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: min(52vh, 420px);
    margin-bottom: 24px;
    border: 0;
    display: block;
    background: #000;
}

.create-tutorial-modal {
    max-width: 400px;
}

.join-participants-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.join-participant-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 6px;
    background: rgba(91,181,213,0.08);
    border-radius: 999px;
    font-size: 0.88rem;
}
.join-participant-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.join-participant-name { font-weight: 500; }
.join-participant-rank {
    font-size: 0.75rem;
    color: var(--color-primary-dark);
    margin-left: 2px;
}
.join-participant-checked {
    font-size: 0.72rem;
    color: #2e7d32;
    background: rgba(46, 125, 50, 0.12);
    padding: 2px 8px;
    border-radius: 999px;
    margin-left: 2px;
}

/* ---- Cards ---- */
.card {
    background: var(--color-surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-body { padding: 20px; }
.card-cover { width: 100%; height: 180px; object-fit: cover; background: linear-gradient(135deg, #D4ECF7, #B8DFF0); }
.card-title { font-size: 1.05rem; font-weight: 600; margin-bottom: 8px; color: var(--color-text); }
.card-meta { font-size: 0.82rem; color: var(--color-text-light); display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.card-tag {
    display: inline-block; padding: 2px 10px; border-radius: 20px;
    font-size: 0.75rem; background: rgba(91,181,213,0.12); color: var(--color-primary-dark);
}

/* ---- Activity Grid ---- */
.activity-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.shop-product-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
}
.shop-product-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 10px;
}
.shop-product-card h3 { font-size: 1rem; margin: 0; }
.shop-product-meta {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin: 0;
}
.shop-product-points {
    font-weight: 600;
    color: var(--color-primary-dark);
    margin: 0;
}
.shop-product-link {
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.shop-product-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.shop-product-link .btn {
    align-self: flex-start;
    pointer-events: none;
}

/* ---- Shop Detail ---- */
.shop-detail-page { padding-bottom: 32px; }
.shop-detail-back {
    display: inline-block;
    margin-bottom: 16px;
    font-size: 0.88rem;
    color: var(--color-text-muted);
    text-decoration: none;
}
.shop-detail-back:hover { color: var(--color-primary-dark); }
.shop-detail-card { overflow: hidden; padding: 0; }
.shop-detail-img {
    width: 100%;
    max-height: 360px;
    object-fit: cover;
    display: block;
}
.shop-detail-body { padding: 20px; }
.shop-detail-title {
    margin: 0 0 8px;
    font-size: 1.35rem;
    line-height: 1.35;
}
.shop-detail-meta {
    margin: 0 0 8px;
    font-size: 0.88rem;
    color: var(--color-text-muted);
}
.shop-detail-points {
    margin: 0 0 16px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary-dark);
}
.shop-detail-points-extra {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-muted);
}
.shop-detail-desc {
    margin-bottom: 20px;
    font-size: 0.92rem;
    line-height: 1.65;
    color: var(--color-text);
    white-space: pre-wrap;
}
.shop-spec-section-title {
    margin: 0 0 12px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
}
.shop-modal-specs {
    margin-bottom: 16px;
}
.shop-order-step { display: none; }
.shop-order-step.is-active { display: block; }
.shop-order-step--hidden { display: none !important; }
.shop-order-steps-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    font-size: 0.82rem;
    color: var(--color-text-muted);
}
.shop-order-steps-bar span {
    flex: 1;
    text-align: center;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.04);
}
.shop-order-steps-bar span.is-current {
    color: var(--color-primary-dark);
    background: rgba(91, 181, 213, 0.18);
    font-weight: 600;
}
.shop-spec-total-preview {
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(91, 181, 213, 0.08);
    font-size: 0.92rem;
}
.shop-spec-total-preview strong {
    font-size: 1.1rem;
    color: var(--color-primary-dark);
}
.shop-order-step-hint {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin: 0 0 14px;
}
.shop-detail-spec-hint {
    margin: 0 0 16px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(91, 181, 213, 0.1);
    font-size: 0.88rem;
    color: var(--color-text-muted);
}
.shop-modal-specs .shop-spec-label {
    font-size: 0.9rem;
}
.shop-spec-req {
    font-size: 0.72rem;
    font-weight: 500;
    color: #c62828;
    margin-left: 4px;
}
.shop-spec-group { margin-bottom: 16px; }
.shop-spec-label {
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--color-text);
}
.shop-spec-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.shop-spec-option {
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    font-size: 0.85rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.shop-spec-option.is-selected {
    border-color: var(--color-primary);
    background: rgba(91, 181, 213, 0.14);
    color: var(--color-primary-dark);
    font-weight: 600;
}
.shop-spec-extra {
    margin-left: 4px;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}
.region-picker {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
@media (min-width: 520px) {
    .region-picker {
        grid-template-columns: repeat(3, 1fr);
    }
}
.shop-detail-balance {
    margin: 16px 0;
    font-size: 0.88rem;
    color: var(--color-text-muted);
}
.section { margin-bottom: 40px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-title { font-size: 1.3rem; font-weight: 700; display: flex; align-items: center; gap: 8px; color: var(--color-text); }

/* ---- Hero ---- */
.hero-logo {
    width: 88px;
    height: 88px;
    margin: 0 auto 16px;
    display: block;
    border-radius: 20px;
    object-fit: contain;
}
.hero-tag {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--color-primary);
    margin: -8px 0 20px;
}
.hero {
    text-align: center; padding: 48px 20px 32px;
    background: linear-gradient(180deg, rgba(126,200,227,0.15) 0%, transparent 100%);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    margin-bottom: 32px;
}
.hero h1 { font-size: 2rem; font-weight: 800; margin-bottom: 12px; background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { color: var(--color-text-light); font-size: 1.05rem; margin-bottom: 24px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---- Search & Filter ---- */
.search-bar {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: nowrap;
}
.search-input {
    width: 100%;
    min-width: 0;
    padding: 10px 12px 10px 38px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface-solid);
    font-size: 0.85rem;
    color: var(--color-text);
    transition: border-color var(--transition);
}
.search-input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(91,181,213,0.15); }
.search-wrapper {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}
.search-wrapper .icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--color-text-muted);
}
.filter-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-tab {
    padding: 6px 16px; border-radius: 20px; font-size: 0.85rem;
    border: 1.5px solid var(--color-border); background: var(--color-surface);
    cursor: pointer; transition: all var(--transition); color: var(--color-text-light);
}
.filter-tab:hover, .filter-tab.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* ---- Forms ---- */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 0.88rem; font-weight: 500; margin-bottom: 6px; color: var(--color-text); }
.form-label .required { color: var(--color-danger); }
.form-input, .form-textarea, .form-select {
    width: 100%; padding: 12px 16px; border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md); background: var(--color-surface-solid);
    font-size: 0.9rem; color: var(--color-text); transition: border-color var(--transition);
    font-family: inherit;
}
.form-textarea { min-height: 120px; resize: vertical; }
.form-input:focus, .form-textarea:focus, .form-select:focus {
    outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(91,181,213,0.15);
}
.form-hint { font-size: 0.78rem; color: var(--color-text-muted); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-section { margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid var(--color-border); }
.form-section-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.form-radio-group { display: flex; gap: 16px; flex-wrap: wrap; }
.form-radio { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.form-checkbox { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.form-checkbox input { margin-top: 4px; }

/* ---- Auth Pages ---- */
.auth-container { max-width: 460px; margin: 40px auto; padding: 0 20px; }
.auth-card { padding: 40px 32px; }
.auth-card h2 { text-align: center; margin-bottom: 8px; font-size: 1.5rem; }
.auth-card .subtitle { text-align: center; color: var(--color-text-light); margin-bottom: 28px; font-size: 0.9rem; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 0.88rem; color: var(--color-text-light); }
.auth-tabs {
    display: grid; gap: 6px; margin-bottom: 20px;
}
.auth-tabs-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.auth-tabs-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.auth-tab {
    min-width: 0; padding: 8px 4px; border: 1px solid rgba(91,181,213,0.35);
    border-radius: 10px; background: transparent; color: var(--color-text-light);
    font-size: 0.72rem; line-height: 1.2; cursor: pointer; transition: all var(--transition);
}
.auth-tab-with-icon {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.auth-tab-icon,
.auth-tab-kfl-icon {
    width: 18px; height: 18px; flex-shrink: 0; object-fit: contain;
}
.auth-tab-label {
    white-space: nowrap; font-size: 0.72rem; line-height: 1.15; max-width: 100%;
}
.auth-tab.active { background: rgba(91,181,213,0.15); color: var(--color-primary-dark); border-color: var(--color-primary); font-weight: 600; }
.auth-tab-kfl.active {
    background: rgba(255, 120, 40, 0.12); color: #c44a00;
    border-color: rgba(255, 120, 40, 0.55); font-weight: 600;
}
.auth-panel { display: none; }
.auth-panel.active { display: block; }
.auth-panel-kfl {
    padding-top: 4px;
    border-top: 1px solid rgba(255, 120, 40, 0.15);
    margin-top: 4px;
    padding-top: 16px;
}
.auth-hint { font-size: 0.82rem; color: var(--color-text-muted); margin-top: 6px; line-height: 1.45; }
.auth-code-row { display: flex; gap: 8px; }
.auth-code-row .form-input { flex: 1; }
.auth-code-row .btn { flex-shrink: 0; white-space: nowrap; }

.auth-kfl-divider { display: none; }
.auth-kfl-card {
    padding: 28px 32px 32px;
    border: 1px solid rgba(255, 120, 40, 0.22);
    background: linear-gradient(180deg, rgba(255, 120, 40, 0.06) 0%, rgba(255, 255, 255, 0) 48%);
}
.auth-kfl-head { text-align: center; margin-bottom: 20px; }
.auth-panel-kfl .auth-kfl-logo {
    display: block; width: min(200px, 68%); height: auto; margin: 0 auto 12px;
}
.auth-kfl-logo {
    display: block; width: min(220px, 72%); height: auto; margin: 0 auto 12px;
}
.auth-kfl-title {
    margin: 0 0 6px; font-size: 1.05rem; font-weight: 600; color: #c44a00;
}
.auth-kfl-subtitle {
    margin: 0; font-size: 0.85rem; color: var(--color-text-light); line-height: 1.5;
}
.auth-kfl-card .btn-kfl {
    background: linear-gradient(135deg, #ff8c2a 0%, #e85d04 100%);
    border: none; color: #fff; font-weight: 600;
}
.auth-kfl-card .btn-kfl:hover { filter: brightness(1.05); }
.auth-kfl-preview {
    margin-top: 16px; padding: 14px; border-radius: 12px;
    background: rgba(255, 120, 40, 0.08); text-align: center;
}
.auth-kfl-preview-avatar {
    width: 64px; height: 64px; border-radius: 50%; object-fit: cover;
    margin: 0 auto 8px; display: block; border: 2px solid rgba(255, 120, 40, 0.25);
}

/* ---- Avatar ---- */
.avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 2px solid var(--color-border); }
.avatar-sm { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.avatar-lg { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 3px solid var(--color-primary-light); }

/* ---- Activity Detail ---- */
.detail-hero { position: relative; height: 320px; overflow: hidden; border-radius: 0 0 var(--radius-xl) var(--radius-xl); }
.detail-hero img { width: 100%; height: 100%; object-fit: cover; }
.detail-hero-overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 32px 20px; background: linear-gradient(transparent, rgba(44,74,94,0.7));
    color: #fff;
}
.detail-hero-overlay h1 { font-size: 1.6rem; margin-bottom: 8px; }
.detail-content { max-width: 800px; margin: -40px auto 0; padding: 0 20px; position: relative; z-index: 1; }
.detail-card { padding: 28px; margin-bottom: 20px; }
.detail-section { margin-bottom: 24px; }
.detail-section h3 { font-size: 1rem; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; color: var(--color-primary-dark); }
.activity-content-body {
    line-height: 1.75;
    word-break: break-word;
    color: var(--color-text);
    font-size: 0.95rem;
}
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.join-action-wrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.join-capacity-badge {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--color-text-muted);
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(91, 181, 213, 0.1);
}
.status-badge {
    display: inline-block; padding: 4px 12px; border-radius: 20px;
    font-size: 0.78rem; font-weight: 500;
}
.status-published { background: rgba(92,184,92,0.15); color: var(--color-success); }
.verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #1565c0;
    white-space: nowrap;
    vertical-align: middle;
}
.verified-badge-icon {
    flex-shrink: 0;
    filter: drop-shadow(0 1px 1px rgba(21, 101, 192, 0.35));
}
.verified-badge--block {
    margin-left: 0;
    margin-top: 6px;
    display: inline-flex;
}
.ticket-organizer-meta {
    margin-top: 16px;
    text-align: center;
}
.card-views {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: var(--color-text-muted);
    font-size: 0.78rem;
}
.co-organizer-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.co-organizer-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(91,181,213,0.12);
    font-size: 0.85rem;
}
.co-organizer-invite-card {
    border: 1px solid rgba(91,181,213,0.25);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}
.status-upcoming { background: rgba(91,181,213,0.15); color: var(--color-primary-dark); }
.status-ongoing { background: rgba(92,184,92,0.15); color: var(--color-success); }
.map-preview { height: 200px; min-height: 200px; border-radius: 12px; overflow: hidden; margin-top: 0; background: linear-gradient(135deg, #D4ECF7, #B8DFF0); display: none; }
.map-preview.is-ready { display: block; }
.map-preview .map-picker-loading { display: flex; align-items: center; justify-content: center; height: 100%; min-height: 200px; color: var(--color-text-muted); font-size: 0.9rem; }
.location-block { margin-top: 4px; }
.location-address { margin: 0 0 12px; line-height: 1.5; }
.location-map-wrap { margin-bottom: 12px; }
.location-map-img { display: block; width: 100%; height: 200px; object-fit: cover; }
.location-nav-btn { margin-top: 4px; }
.location-block { display: flex; flex-direction: column; gap: 12px; }
.location-address { margin: 0; font-size: 0.95rem; line-height: 1.55; color: var(--color-text); word-break: break-word; }
.location-nav-btn { align-self: flex-start; margin-top: 0; }
.location-open-nav {
    display: flex; flex-direction: column; gap: 12px; width: 100%; padding: 0; margin: 0;
    border: none; background: none; text-align: left; cursor: pointer; color: inherit; font: inherit;
}
.location-open-nav .location-address { margin: 0; }
.location-nav-hint { font-size: 0.78rem; color: var(--color-primary); }
.location-transport-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.location-ai-btn { display: inline-flex; align-items: center; gap: 6px; }
.location-ai-icon { width: 16px; height: 16px; object-fit: contain; flex-shrink: 0; }
.location-transport-panel {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(91, 181, 213, 0.08);
    border: 1px solid rgba(91, 181, 213, 0.2);
}
.location-transport-loading { font-size: 0.85rem; color: var(--color-text-muted); }
.location-transport-md {
    font-size: 0.84rem;
    line-height: 1.55;
    color: var(--color-text);
}
.location-transport-md .location-transport-title {
    font-size: 0.88rem;
    font-weight: 600;
    margin: 0 0 6px;
    color: var(--color-text);
}
.location-transport-md ul {
    margin: 0;
    padding-left: 1.15em;
    list-style: disc;
}
.location-transport-md li { margin: 3px 0; }
.location-transport-md p { margin: 3px 0; }
.location-transport-text {
    font-size: 0.88rem;
    line-height: 1.65;
    color: var(--color-text);
    white-space: pre-wrap;
}
.segment-row { padding: 16px; margin-bottom: 12px; }
.segment-row-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.segment-drag-handle { cursor: grab; color: var(--color-text-muted); user-select: none; padding: 4px 8px; touch-action: none; }
.segment-drag-handle:active { cursor: grabbing; }
.segment-row.is-dragging { opacity: 0.55; }
.segment-row .map-picker-wrap,
.segment-row .map-container,
.segment-row .segment-map { -webkit-user-drag: none; user-select: none; }
.join-segment-pick-list { display: flex; flex-direction: column; gap: 8px; }
.join-segment-item {
    display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px;
    background: rgba(91,181,213,0.08); border-radius: 10px;
}
.join-segment-item.is-dragging { opacity: 0.55; }
.segment-extra-info { margin: 8px 0 0; font-size: 0.92rem; }
.segment-extra-note { margin: 6px 0 0; font-size: 0.88rem; color: var(--color-text-light); white-space: pre-line; }
.carpool-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.carpool-delete-btn { color: var(--color-danger); padding: 4px 10px; min-height: 32px; font-size: 0.82rem; }
.recaptcha-wrap { overflow: hidden; }
.recaptcha-wrap > div { transform-origin: left top; }
.carpool-card-steps { display: grid; gap: 8px; margin-top: 8px; }
.carpool-step { display: flex; gap: 10px; align-items: flex-start; }
.carpool-step-num { width: 22px; height: 22px; border-radius: 50%; background: var(--color-primary); color: #fff; font-size: 0.75rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.carpool-form-steps .step-panel { display: none; }
.carpool-form-steps .step-panel.active { display: block; }
.carpool-step-dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 16px; }
.carpool-step-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--color-border); }
.carpool-step-dots span.active { background: var(--color-primary); }
.status-pending { background: rgba(240,173,78,0.15); color: var(--color-warning); }
.status-ended { background: rgba(155,181,197,0.15); color: var(--color-text-muted); }
.status-cancelled { background: rgba(232,124,124,0.15); color: var(--color-danger); }

/* ---- Map ---- */
.map-container { width: 100%; height: 300px; border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--color-border); }

.map-picker-wrap { position: relative; margin-bottom: 4px; }
.map-search-bar {
    display: flex; gap: 8px; align-items: stretch; margin-bottom: 8px;
}
.map-search-bar .map-search-input { flex: 1; min-width: 0; margin-bottom: 0; }
.map-search-btn { flex-shrink: 0; padding-left: 18px; padding-right: 18px; white-space: nowrap; }
.map-suggest-list {
    position: absolute; left: 0; right: 0; top: 48px; z-index: 20;
    background: var(--color-surface-solid); border: 1px solid var(--color-border);
    border-radius: var(--radius-md); box-shadow: var(--shadow-md); max-height: 220px; overflow-y: auto;
}
.map-suggest-item {
    display: block; width: 100%; text-align: left; padding: 10px 14px; border: none; background: none;
    cursor: pointer; font-size: 0.88rem; color: var(--color-text); border-bottom: 1px solid var(--color-border);
}
.map-suggest-item:last-child { border-bottom: none; }
.map-suggest-item:hover { background: rgba(91, 181, 213, 0.1); }
.segment-place-fields .form-input[readonly] {
    background: rgba(91, 181, 213, 0.06);
    color: var(--color-text);
    cursor: default;
}
.map-suggest-item strong { font-weight: 600; color: var(--color-primary-dark); }
.map-suggest-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 12px; font-size: 0.78rem; color: var(--color-text-muted);
    border-top: 1px solid var(--color-border); background: rgba(240, 247, 251, 0.6);
}
.map-suggest-close {
    border: none; background: none; cursor: pointer; font-size: 1.1rem; line-height: 1;
    color: var(--color-text-muted); padding: 2px 6px;
}
.map-suggest-empty, .map-suggest-loading {
    padding: 14px 16px; font-size: 0.85rem; color: var(--color-text-muted); line-height: 1.5;
}
.map-picker-loading, .map-picker-error {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    height: 100%; min-height: 200px; padding: 20px; text-align: center;
    background: #E8F4FA; color: #6B8FA3; font-size: 0.9rem;
}
.map-picker-error-hint { font-size: 0.8rem; color: #9BB5C4; margin-top: 8px; line-height: 1.5; }

.join-status-banner {
    margin-bottom: 20px; padding: 16px 18px; border-radius: var(--radius-md);
    font-size: 0.92rem; line-height: 1.6;
}
.join-status-banner strong { display: block; font-size: 1rem; margin-bottom: 4px; }
.join-status-banner p { margin: 6px 0 0; font-size: 0.85rem; opacity: 0.92; }
.join-status-pending { background: rgba(240, 173, 78, 0.15); border: 1px solid rgba(240, 173, 78, 0.35); color: #8a5a00; }
.join-status-success { background: rgba(92, 184, 92, 0.15); border: 1px solid rgba(92, 184, 92, 0.35); color: #2d6a2d; }
.join-status-danger { background: rgba(232, 124, 124, 0.15); border: 1px solid rgba(232, 124, 124, 0.35); color: #a33; }
.join-status-info { background: rgba(91, 181, 213, 0.12); border: 1px solid rgba(91, 181, 213, 0.3); color: var(--color-primary-dark); }

.card-entry-banner {
    border-left: 4px solid var(--color-primary);
    box-shadow: 0 4px 16px rgba(91, 181, 213, 0.12);
}
.card-entry-banner strong { color: var(--color-primary-dark); }

.card-entry-cta-pulse {
    animation: cardEntryPulse 2.2s ease-in-out infinite;
}
@keyframes cardEntryPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(58, 155, 192, 0.45); }
    50% { box-shadow: 0 0 0 10px rgba(58, 155, 192, 0); }
}

.ticket-page .ticket-card-body {
    text-align: center;
}
.ticket-card-brand {
    font-size: 0.82rem;
    color: var(--color-text-light);
}
.ticket-card-title {
    margin: 16px 0;
    font-size: 1.3rem;
}
.ticket-card-meta {
    font-size: 0.88rem;
    color: var(--color-text-light);
    margin: 4px 0;
}
.ticket-card-organizer {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    margin: 0;
}
.ticket-card-blessing {
    font-style: italic;
    margin-top: 12px;
    color: var(--color-primary-dark);
}
.ticket-card-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px dashed rgba(91, 181, 213, 0.35);
}
.ticket-card-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.ticket-card-actions .icon {
    width: 18px;
    height: 18px;
}

.ticket-save-sheet {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 16px;
    visibility: hidden;
    pointer-events: none;
}
.ticket-save-sheet.is-open,
.ticket-save-sheet.is-closing {
    visibility: visible;
    pointer-events: auto;
}
.ticket-save-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 36, 48, 0.55);
    opacity: 0;
    transition: opacity 0.28s ease;
}
.ticket-save-sheet.is-open .ticket-save-sheet-backdrop {
    opacity: 1;
}
.ticket-save-sheet.is-closing .ticket-save-sheet-backdrop {
    opacity: 0;
}
.ticket-save-sheet-panel {
    position: relative;
    width: min(420px, 100%);
    max-height: min(90vh, 720px);
    overflow: auto;
    background: #fff;
    border-radius: var(--radius-xl);
    padding: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(18px) scale(0.98);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.ticket-save-sheet.is-open .ticket-save-sheet-panel {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.ticket-save-sheet.is-closing .ticket-save-sheet-panel {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
}
.ticket-card.is-ready {
    animation: fadeInUp 0.42s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.ticket-save-sheet-img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    -webkit-touch-callout: default;
    user-select: auto;
}
.ticket-save-sheet-hint {
    text-align: center;
    font-size: 0.88rem;
    color: var(--color-text-muted);
    margin: 12px 0;
}

.site-announcements {
    max-width: var(--container-max, 1080px);
    margin: 0 auto 16px;
    padding: 0 16px;
    position: relative;
    z-index: 1;
}
.site-announcement-item {
    display: flex; align-items: flex-start; gap: 12px;
    margin-bottom: 10px; padding: 12px 14px; border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(91,181,213,0.12), rgba(126,200,227,0.08));
    border: 1px solid rgba(91, 181, 213, 0.28);
    box-shadow: none;
}
.site-announcement-body { flex: 1; min-width: 0; }
.site-announcement-title { display: block; font-size: 0.92rem; margin-bottom: 4px; color: var(--color-primary-dark); }
.site-announcement-content {
    margin: 0; font-size: 0.85rem; line-height: 1.6; color: var(--color-text);
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.site-announcement-item.is-expanded .site-announcement-content {
    display: block; -webkit-line-clamp: unset; overflow: visible;
}
.site-announcement-link { display: inline-block; margin-top: 8px; font-size: 0.85rem; color: var(--color-primary); text-decoration: none; font-weight: 600; }
.site-announcement-link:hover { text-decoration: underline; }
.site-announcement-expand {
    display: inline-block; margin-top: 6px; padding: 0; border: none; background: none;
    font-size: 0.82rem; color: var(--color-primary); cursor: pointer; font-weight: 600;
}
.site-announcement-expand:hover { text-decoration: underline; }
.site-announcement-item.is-expanded .site-announcement-expand { display: none; }
.site-announcement-close {
    flex-shrink: 0; border: none; background: transparent; font-size: 1.25rem; line-height: 1;
    color: var(--color-text-muted); cursor: pointer; padding: 0 4px;
}
.site-announcement-close:hover { color: var(--color-text); }
.btn-urge-review { margin-top: 10px; }

/* ---- Comments ---- */
.comment-list { display: flex; flex-direction: column; gap: 16px; }
.comment-item { display: flex; gap: 12px; }
.comment-body { flex: 1; }
.comment-author { font-weight: 600; font-size: 0.88rem; }
.comment-time { font-size: 0.75rem; color: var(--color-text-muted); }
.comment-text { font-size: 0.9rem; margin-top: 4px; }

/* ---- Tabs ---- */
.tabs { display: flex; gap: 4px; margin-bottom: 24px; background: rgba(91,181,213,0.08); border-radius: var(--radius-md); padding: 4px; }
.tab {
    flex: 1; padding: 10px; text-align: center; border-radius: var(--radius-sm);
    cursor: pointer; font-size: 0.88rem; transition: all var(--transition); border: none; background: none; color: var(--color-text-light);
}
.tab.active { background: var(--color-surface-solid); color: var(--color-primary-dark); font-weight: 600; box-shadow: var(--shadow-sm); }

/* ---- Modal ---- */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(44,74,94,0.45);
    display: flex; align-items: center; justify-content: center; z-index: 2000;
    opacity: 0; visibility: hidden; transition: opacity var(--transition), visibility var(--transition);
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
.modal-overlay.show { opacity: 1; visibility: visible; }
.modal {
    background: var(--color-surface-solid); border-radius: var(--radius-lg);
    padding: 28px; max-width: 480px; width: 90%; max-height: min(85vh, 85dvh); overflow-y: auto;
    box-shadow: var(--shadow-lg); transform: translateY(20px); transition: transform var(--transition);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
.modal-overlay.show .modal { transform: translateY(0); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 12px; }
.modal-title { font-size: 1.15rem; font-weight: 600; flex: 1; min-width: 0; }
.modal-close {
    background: none; border: none; cursor: pointer; color: var(--color-text-muted);
    padding: 8px; margin: -8px -8px -8px 0; min-width: 44px; min-height: 44px;
    display: flex; align-items: center; justify-content: center; font-size: 1.5rem; line-height: 1;
}

/* ---- Toast ---- */
.toast {
    position: fixed; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--color-text); color: #fff; padding: 12px 24px;
    border-radius: var(--radius-md); font-size: 0.88rem; z-index: 3000;
    transition: transform var(--transition); pointer-events: none;
    max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ---- Footer ---- */
.footer { padding: 32px 0; text-align: center; border-top: 1px solid var(--color-border); margin-top: 48px; }
.footer-brand { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; color: var(--color-primary-dark); margin-bottom: 8px; }
.footer-text { font-size: 0.85rem; color: var(--color-text-light); margin-bottom: 12px; }

.site-footer-bottom { margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--color-border); }

.site-partners { margin-bottom: 20px; }
.site-partners-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--color-primary-dark);
    margin: 0 0 4px;
    text-align: center;
}
.site-partners-note {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin: 0 0 16px;
    text-align: center;
}
.site-partners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 12px;
    max-width: 760px;
    margin: 0 auto;
}
.site-partner-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding: 14px 10px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(91, 181, 213, 0.18);
    background: rgba(255, 255, 255, 0.55);
    min-height: 100%;
}
.site-partner-link {
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.site-partner-link:hover {
    background: rgba(91, 181, 213, 0.1);
    border-color: rgba(91, 181, 213, 0.35);
    transform: translateY(-2px);
}
.site-partner-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-primary-dark);
    line-height: 1.35;
}
.site-partner-logo {
    width: auto;
    max-width: 120px;
    max-height: 48px;
    height: auto;
    object-fit: contain;
    display: block;
}
.site-partner-tagline {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    line-height: 1.45;
    margin: 0;
}

.site-copyright { margin-top: 0; padding-top: 16px; border-top: 1px solid var(--color-border); }
.site-copyright-line { font-size: 0.78rem; color: var(--color-text-muted); margin: 0 0 6px; line-height: 1.6; }
.site-copyright-line a { color: var(--color-text-muted); text-decoration: none; }
.site-copyright-line a:hover { color: var(--color-primary-dark); text-decoration: underline; }

.admin-body > .site-footer-bottom {
    padding: 24px 16px calc(28px + env(safe-area-inset-bottom, 0px));
    text-align: center;
    border-top: 1px solid rgba(91, 181, 213, 0.15);
    background: rgba(255, 255, 255, 0.45);
}

.admin-body > .site-footer-bottom .site-partners-grid {
    max-width: 680px;
}

.admin-login-page + .site-footer-bottom {
    margin-top: 0;
    background: transparent;
    border-top: none;
    padding-top: 12px;
}

.admin-login-page + .site-footer-bottom .site-copyright {
    border-top: none;
    padding-top: 8px;
}

/* ---- Empty State ---- */
.empty-state { text-align: center; padding: 48px 20px; color: var(--color-text-muted); }
.empty-state .icon-xl { margin: 0 auto 16px; opacity: 0.4; }

/* ---- Ticket ---- */
.ticket-card {
    max-width: 400px; margin: 40px auto; padding: 32px;
    background: linear-gradient(135deg, #fff, #E8F4FA);
    border: 2px dashed var(--color-primary-light); border-radius: var(--radius-xl);
    text-align: center;
}
.ticket-qr {
    width: 200px; height: 200px; margin: 20px auto;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.ticket-qr-img {
    display: block; width: 200px; height: 200px;
    object-fit: contain; margin: 0 auto;
}
@media (max-width: 480px) {
    .ticket-card {
        max-width: none; margin: 16px auto; padding: 20px 16px;
    }
    .ticket-card-title { font-size: 1.1rem; margin: 12px 0; }
    .ticket-qr {
        width: min(160px, 42vw); height: min(160px, 42vw); margin: 12px auto;
    }
    .ticket-qr-img {
        width: min(160px, 42vw); height: min(160px, 42vw);
    }
}

.page-back-bar {
    background: rgba(255,255,255,0.65);
    border-bottom: 1px solid rgba(91,181,213,0.15);
    padding: 10px 0;
    position: sticky;
    top: calc(var(--nav-height) + env(safe-area-inset-top, 0px));
    z-index: 90;
    backdrop-filter: blur(8px);
}
.page-back-inner { padding-left: 4px; padding-right: 4px; }
.page-back-link {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 0.9rem; color: var(--color-primary-dark); text-decoration: none;
    padding: 6px 8px; border-radius: 8px;
}
.page-back-link:hover { background: rgba(91,181,213,0.1); }
.page-back-icon { width: 18px; height: 18px; }

.support-page { max-width: 520px; margin: 24px auto 40px; padding: 0 16px; }
.support-card { padding: 28px 24px; }
.support-subtitle { color: var(--color-text-muted); font-size: 0.9rem; margin: 8px 0 20px; line-height: 1.6; }
.support-success { text-align: center; padding: 24px 0; }
.footer-links { margin: 8px 0 0; font-size: 0.88rem; }
.footer-links a { color: var(--color-primary-dark); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }

/* ---- Loading ---- */
.loading { display: flex; align-items: center; justify-content: center; padding: 40px; }
.spinner {
    width: 32px; height: 32px; border: 3px solid var(--color-border);
    border-top-color: var(--color-primary); border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Paw decoration ---- */
.paw-decoration {
    position: fixed; opacity: 0.04; pointer-events: none; z-index: 0;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
        position: relative;
        z-index: 1001;
        -webkit-tap-highlight-color: transparent;
    }
    .navbar-inner {
        gap: 6px;
    }
    .navbar-brand {
        flex: 1;
        min-width: 0;
    }
    .navbar-actions {
        gap: 6px;
        flex-shrink: 0;
    }
    .nav-login-btn,
    .nav-register-btn,
    .nav-points-btn,
    .nav-profile-btn {
        min-height: 36px;
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    .navbar-menu {
        position: fixed;
        top: calc(var(--nav-height) + env(safe-area-inset-top, 0px));
        left: 0;
        right: 0;
        background: var(--color-surface-solid);
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
        box-shadow: var(--shadow-md);
        z-index: 999;
        gap: 4px;
        max-height: calc(100dvh - var(--nav-height) - env(safe-area-inset-top, 0px));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        transform: translateY(-110%);
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
        transition: transform var(--transition), opacity 0.2s ease, visibility 0.2s;
    }
    .navbar-menu.open {
        transform: translateY(0);
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
    }
    .navbar-menu .nav-link,
    .navbar-menu .btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
    .navbar-menu .nav-staff-btn { margin: 4px 0; }
    .navbar-menu .nav-user { justify-content: center; }
    .hero h1 { font-size: 1.5rem; }
    .hero-actions { display: none; }
    .hero {
        padding: 32px 20px 20px;
        margin-bottom: 20px;
    }
    .hero p { margin-bottom: 0; }
    .search-bar {
        gap: 6px;
        margin-bottom: 12px;
    }
    .search-input {
        padding: 8px 10px 8px 32px;
        font-size: 0.8rem;
    }
    .search-wrapper .icon {
        left: 10px;
        width: 14px;
        height: 14px;
    }
    .form-row { grid-template-columns: 1fr; }
    .detail-hero { height: 220px; }
    .activity-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .activity-grid .empty-state {
        grid-column: 1 / -1;
    }
    .activity-grid .card-cover {
        height: clamp(88px, 28vw, 118px);
    }
    .activity-grid .card-body {
        padding: 10px;
    }
    .activity-grid .card-title {
        font-size: 0.86rem;
        margin-bottom: 6px;
        line-height: 1.35;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .activity-grid .card-meta {
        font-size: 0.72rem;
        gap: 4px;
    }
    .activity-grid .card-tag {
        padding: 1px 6px;
        font-size: 0.68rem;
    }
    .activity-grid .card-meta .avatar-sm {
        width: 20px;
        height: 20px;
    }
    .activity-grid .card-meta:nth-of-type(2) {
        margin-top: 4px;
        font-size: 0.7rem;
    }
    .activity-grid .shop-product-card {
        padding: 10px;
        gap: 8px;
    }
    .activity-grid .shop-product-card h3 {
        font-size: 0.86rem;
        line-height: 1.35;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .activity-grid .shop-product-card p {
        font-size: 0.72rem;
    }
    .activity-grid .shop-product-card .btn {
        width: 100%;
        min-height: 36px;
        padding: 6px 8px;
        font-size: 0.78rem;
    }
    .detail-actions { flex-direction: column; }
    .detail-actions .btn { width: 100%; }
    .detail-owner-actions > div {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    .detail-owner-actions .btn,
    .detail-owner-actions a.btn {
        width: 100%;
        min-height: 44px;
        justify-content: center;
    }
    .detail-owner-actions .owner-checkin-entry {
        font-weight: 600;
        box-shadow: 0 2px 8px rgba(46, 125, 50, 0.25);
    }
}

@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .auth-card { padding: 28px 20px; }
    .auth-kfl-card { padding: 24px 20px 28px; }
    .auth-tab { padding: 8px 2px; }
    .auth-tab-label { font-size: 0.65rem; }
    .fcfs-row { grid-template-columns: 1fr !important; }
    .navbar-brand-tagline { display: none; }
    .nav-login-btn,
    .nav-register-btn,
    .nav-points-btn,
    .nav-profile-btn {
        padding: 6px 10px;
        font-size: 0.78rem;
    }
    .nav-points-btn {
        font-weight: 600;
        padding: 6px 8px;
    }
}

/* ---- 先到先得物料 ---- */
.fcfs-gift-list { display: flex; flex-direction: column; gap: 10px; }
.fcfs-gift-card {
    padding: 14px 16px; border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(255,182,193,0.12), rgba(126,200,227,0.12));
    border: 1px solid var(--color-border);
}
.fcfs-gift-card.fcfs-full { opacity: 0.65; }
.fcfs-gift-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.fcfs-gift-rank {
    font-size: 0.82rem; font-weight: 600; color: var(--color-primary-dark);
    background: rgba(91,181,213,0.15); padding: 2px 10px; border-radius: 20px;
}
.fcfs-gift-status { font-size: 0.78rem; color: var(--color-text-light); }
.fcfs-gift-name { font-weight: 600; font-size: 1rem; }
.fcfs-gift-desc { font-size: 0.85rem; color: var(--color-text-light); margin-top: 4px; }
.fcfs-my-reward {
    margin-top: 14px; padding: 12px 16px; border-radius: var(--radius-md);
    background: rgba(92,184,92,0.12); border: 1px dashed var(--color-success);
    font-size: 0.9rem; display: flex; flex-direction: column; gap: 4px;
}
