/* ===== 基礎 ===== */
* { box-sizing: border-box; }
html, body {
    overflow-x: hidden;
    max-width: 100%;
}
body {
    margin: 0;
    font-family: "Segoe UI", "Microsoft JhengHei", "PingFang TC", sans-serif;
    background: #f4f6f8;
    color: #2c3e50;
    line-height: 1.6;
}
a { color: #1e88e5; text-decoration: none; }
h1, h2, h3 { margin: 0 0 12px; }
input, select, textarea, button { font-family: inherit; font-size: 1rem; }

/* ===== 頂部導覽 ===== */
.topnav {
    background: #ffebee;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}
.nav-brand { font-weight: 700; font-size: 23px; color: #e53935; letter-spacing: 2px; }
.nav-brand .brand-heart { margin-right: 3px; }
.nav-links a {
    margin-left: 16px;
    padding: 6px 10px;
    border-radius: 6px;
    color: #555;
}
.nav-links a:hover { background: #f0f0f0; }
.nav-links a.active { color: #e53935; font-weight: 600; }

/* ===== 品牌字特效（全站套用）===== */
/* 光線掃過（支援 background-clip:text 的瀏覽器，只套在文字上） */
@supports (-webkit-background-clip: text) or (background-clip: text) {
    .nav-brand .brand-text {
        background-image: linear-gradient(100deg, #e53935 0%, #e53935 47%, #ffd1a1 49%, #fff3d6 50%, #ffd1a1 51%, #e53935 53%, #e53935 100%);
        background-size: 300% auto;
        background-position: 100% 50%;
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        color: transparent;
        animation: brand-light-sweep 4s linear infinite;
    }
}
/* 愛心跳動 */
.nav-brand .brand-heart {
    display: inline-block;
    transform-origin: 50% 60%;
    animation: heart-beat 1.2s ease-in-out infinite;
}
@keyframes brand-light-sweep {
    0% { background-position: 100% 50%; }
    20% { background-position: -200% 50%; }
    100% { background-position: -200% 50%; }
}
@keyframes heart-beat {
    0%, 100% { transform: scale(1); }
    15% { transform: scale(1.25); }
    30% { transform: scale(1); }
    45% { transform: scale(1.18); }
    60% { transform: scale(1); }
}
/* 減少動態效果時：停止移動 */
@media (prefers-reduced-motion: reduce) {
    .nav-brand .brand-heart {
        animation: none;
    }
}

/* ===== 容器 ===== */
.container {
    max-width: 900px;
    margin: 24px auto;
    padding: 0 16px;
}
.container-wide { max-width: 1600px; }

/* ===== 卡片 ===== */
.card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    margin-bottom: 2px;
}

/* ===== 表單 ===== */
label {
    display: block;
    margin-bottom: 14px;
    font-weight: 600;
    font-size: 0.92rem;
    color: #444;
}
label input, label select, label textarea {
    display: block;
    width: 100%;
    margin-top: 5px;
    padding: 9px 12px;
    border: 1px solid #ccd1d6;
    border-radius: 6px;
    font-weight: 400;
}
label textarea { resize: vertical; }
label input:focus, label select:focus, label textarea:focus {
    outline: none;
    border-color: #1e88e5;
    box-shadow: 0 0 0 2px rgba(30,136,229,0.15);
}

/* ===== 按鈕 ===== */
.btn {
    display: inline-block;
    padding: 9px 18px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}
.btn-primary { background: #e53935; color: #fff; }
.btn-primary:hover { background: #d32f2f; }
.btn-secondary { background: #eee; color: #333; }
.btn-secondary:hover { background: #e0e0e0; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-sm { padding: 5px 12px; font-size: 0.88rem; }

/* ===== 登陸頁 ===== */
.hero {
    text-align: center;
    padding: 40px 16px 8px;
}
.hero h1 {
    font-size: 2rem;
    color: #e53935;
    margin-bottom: 10px;
}
.hero p { color: #666; font-size: 1.05rem; margin: 0; }
.landing-map { margin-top: 20px; }
.landing-map-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.landing-status { color: #777; font-size: 0.9rem; }
#landing-map { width: 100%; height: 460px; border-radius: 8px; border: 0.5px solid #ddd; }
.landing-cta {
    margin-top: 16px;
    text-align: center;
    background: #fff5f5;
    border: 1px solid #ffd6d6;
    border-radius: 8px;
    padding: 14px;
}
.landing-cta p { margin: 0 0 10px; color: #555; }
.cta-buttons { display: flex; gap: 10px; justify-content: center; }
.popup-cta { display: inline-block; margin-top: 6px; font-size: 0.88rem; }

/* ===== Alert ===== */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.95rem;
}
.alert-error { background: #fdecea; color: #b71c1c; border: 1px solid #f5c6c6; }
.alert-success { background: #e8f5e9; color: #1b5e20; border: 1px solid #c8e6c9; }
.alert-warning { background: #fff8e1; color: #795548; border: 1px solid #ffe082; }

/* ===== 登入/註冊 ===== */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #e53935 0%, #ff7043 100%);
}
.auth-card {
    background: #fff;
    border-radius: 14px;
    padding: 36px 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
.brand { font-size: 1.8rem; text-align: center; color: #e53935; }
.tagline { text-align: center; color: #777; margin-bottom: 20px; }
.auth-switch { text-align: center; margin-top: 16px; font-size: 0.92rem; color: #555; }

/* ===== 個人檔案 ===== */
.profile-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.card-map { grid-column: 1 / -1; padding: 12px; }
#location-map, #discover-map, #admin-location-map {
    width: 100%;
    height: 420px;
    border-radius: 8px;
    border: 0.5px solid #ddd;
}
.gender-pin-wrap {
    background: none;
    border: none;
}
.loc-status { color: #555; font-size: 0.9rem; margin: 10px 0; }
.loc-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hint { color: #666; font-size: 0.92rem; }
.photo-preview { text-align: center; margin-bottom: 14px; }
.photo-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #eee;
}
.photo-empty {
    width: 200px;
    height: 200px;
    margin: 0 auto;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

/* ===== 探索 ===== */
.page-with-ads {
    display: grid;
    grid-template-columns: 170px 1fr 170px;
    gap: 20px;
    align-items: start;
    min-width: 0;
}
.ad-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 76px;
}
.ad-column.ad-right { top: 76px; }
.ad-block {
    border: 1px solid #eee;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}
.ad-block a, .ad-block .ad-block-inner { display: block; text-decoration: none; color: inherit; }
.ad-block img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}
.ad-title {
    display: block;
    padding: 6px 8px;
    font-size: 0.8rem;
    color: #555;
    text-align: center;
    background: #fafafa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ad-empty { color: #bbb; font-size: 0.8rem; text-align: center; border: 1px dashed #ddd; border-radius: 10px; padding: 40px 0; }
.popup-vp {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 0.85rem;
    color: #555;
}
.popup-vp label { margin-bottom: 0; font-weight: 600; font-size: 0.85rem; }
.popup-vp select {
    padding: 4px 6px;
    border: 1px solid #ccd1d6;
    border-radius: 6px;
    font-size: 0.85rem;
    background: #fff;
    color: #2c3e50;
}
.discover-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: start;
    min-width: 0;
}
.discover-map { position: sticky; top: 76px; min-width: 0; }
.discover-list { min-width: 0; }
.page-main { min-width: 0; }
.landing-map { margin-top: 20px; min-width: 0; }
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}
.card-head h2 { margin: 0; }
.discover-filter { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: #555; }
.discover-filter select {
    padding: 6px 8px;
    border: 1px solid #ccd1d6;
    border-radius: 6px;
    background: #fff;
}
.discover-count { font-size: 0.85rem; color: #888; font-weight: 400; }
.admin-drag-note { font-size: 0.8rem; color: #e65100; background: #fff3e0; border: 1px solid #ffe0b2; padding: 4px 10px; border-radius: 6px; }
.user-list { list-style: none; padding: 0; margin: 0; max-height: 480px; overflow-y: auto; }
.user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 6px;
    border-bottom: 1px solid #f0f0f0;
}
.user-item:last-child { border-bottom: none; }
.user-avatar img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
}
.avatar-placeholder {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #ffcdd2;
    color: #b71c1c;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-weight: 700; }
.name-link { color: inherit; text-decoration: none; }
.name-link:hover { text-decoration: underline; }
.user-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.user-actions-row { display: flex; align-items: center; gap: 8px; }
.btn-unlike {
    border: none;
    background: none;
    color: #999;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 2px 4px;
}
.btn-unlike:hover { color: #e53935; text-decoration: underline; }

/* ===== VIP ===== */
.vip-badge {
    display: inline-block;
    padding: 1px 7px;
    margin-left: 5px;
    border-radius: 999px;
    background: linear-gradient(135deg, #f5d56b, #d4a017);
    color: #5b3f00;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    vertical-align: 1px;
    box-shadow: 0 0 4px rgba(212, 160, 23, 0.5);
}
.vip-album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}
.vip-album-item { text-align: center; }
.vip-album-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #eee;
    cursor: pointer;
    display: block;
}
.vip-album-caption {
    font-size: 0.82rem;
    color: #555;
    margin: 4px 0;
    word-break: break-all;
}
.vip-album-empty { color: #999; font-size: 0.9rem; }
.vip-vis-badge {
    font-size: 0.75rem;
    color: #2e7d32;
    background: #e8f5e9;
    border-radius: 20px;
    padding: 2px 10px;
    display: inline-block;
    margin: 4px 0;
}
.vip-vis-badge.friends {
    color: #b26a00;
    background: #fff3e0;
}
/* 互讚好友限定：馬賽克（模糊）遮罩，若隱若現 */
.vip-album-item.locked .vip-album-img-wrap { position: relative; }
.vip-album-item.locked .vip-album-img {
    filter: blur(7px) brightness(1.15);
    transform: scale(1.08);
    opacity: 0.92;
}
.vip-album-lock {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #6d4c00;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 8px;
    pointer-events: none;
}
.vip-album-item.locked .vip-album-lock { display: flex; }
.vip-album-lock b { font-size: 0.9rem; }
.vip-album-lock span { font-size: 0.7rem; color: #8a6d2f; }
.self-vp { margin-bottom: 14px; }
.self-vp-hint { font-size: 0.82rem; color: #999; }
.vip-locked-panel {
    padding: 14px;
    background: #fafafa;
    border: 1px dashed #d0c77f;
    border-radius: 8px;
    margin-bottom: 16px;
    color: #555;
}
.vip-locked-title { font-size: 1rem; margin-bottom: 4px; }
.vip-locked-title b { color: #b8860b; }
.vip-upload-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    padding: 12px;
    background: #fafafa;
    border: 1px dashed #d0c77f;
    border-radius: 8px;
    margin-bottom: 16px;
}
.vip-upload-form label { margin-bottom: 0; }
.vip-upload-form input[type="text"] { min-width: 220px; }
.vip-inline-form {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 6px;
}
.vip-inline-form input[type="text"] { flex: 1; min-width: 0; }

/* lightbox */
.vip-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 20px;
}
.vip-lightbox.open { display: flex; }
.vip-lightbox img {
    max-width: 92vw;
    max-height: 78vh;
    border-radius: 6px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.6);
}
.vip-lightbox-caption { color: #eee; margin-top: 12px; max-width: 80vw; text-align: center; }
.vip-lightbox-close {
    position: absolute;
    top: 16px;
    right: 24px;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    background: none;
    border: none;
}
.vip-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 2.4rem;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    border-radius: 50%;
    width: 52px;
    height: 52px;
    line-height: 1;
}
.vip-lightbox-nav.prev { left: 20px; }
.vip-lightbox-nav.next { right: 20px; }
@media (max-width: 560px) {
    .vip-lightbox-nav { width: 42px; height: 42px; font-size: 1.8rem; }
    .vip-lightbox-nav.prev { left: 8px; }
    .vip-lightbox-nav.next { right: 8px; }
}
.gender-sym { font-weight: 700; margin-right: 4px; }
.gender-sym.female { color: #e75480; }
.gender-sym.male { color: #3b82f6; }
.user-dist { font-size: 0.85rem; color: #1e88e5; cursor: pointer; }
.user-dist:hover { text-decoration: underline; }
.user-bio { font-size: 0.85rem; color: #777; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-like.liked { background: #e0e0e0; color: #888; }
.popup-photo {
    width: 90px;
    height: 90px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
    margin-bottom: 6px;
}
.popup-photo.placeholder {
    background: #ffcdd2;
    color: #b71c1c;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
}
.popup-name { font-weight: 700; }
.popup-dist { font-size: 0.85rem; color: #1e88e5; }
.popup-bio {
    font-size: 0.85rem;
    color: #555;
    max-width: 180px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.popup-like { display: block; margin-top: 8px; }

/* ===== 聊天 ===== */
.chat-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    align-items: stretch;
    min-height: 70vh;
}
.chat-list h2 { margin-bottom: 14px; }
.match-list { list-style: none; padding: 0; margin: 0; }
.match-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 8px;
    border-radius: 8px;
    color: inherit;
}
.match-list a:hover { background: #f5f5f5; }
.match-list a.active { background: #ffe9e8; }
.match-avatar img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}
.match-avatar .avatar-placeholder { width: 44px; height: 44px; font-size: 1.1rem; }
.match-info { min-width: 0; }
.match-name { font-weight: 600; }
.match-last { font-size: 0.85rem; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-main { display: flex; flex-direction: column; }
.chat-header { border-bottom: 1px solid #f0f0f0; padding-bottom: 12px; }
.chat-box {
    flex: 1;
    overflow-y: auto;
    padding: 14px 4px;
    min-height: 400px;
    max-height: 520px;
}
.msg { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 12px; }
.msg-body {
    max-width: 70%;
    padding: 9px 13px;
    border-radius: 14px;
    word-break: break-word;
}
.msg-mine { flex-direction: row-reverse; }
.msg-mine .msg-body { background: #e53935; color: #fff; border-bottom-right-radius: 3px; }
.msg-peer .msg-body { background: #f1f1f1; border-bottom-left-radius: 3px; }
.msg-time { font-size: 0.72rem; color: #aaa; }
.chat-form { display: flex; gap: 10px; margin-top: 12px; }
.chat-form input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ccd1d6;
    border-radius: 20px;
}
.chat-form input:focus { outline: none; border-color: #1e88e5; }
.chat-empty { color: #999; text-align: center; padding: 60px 0; }
.empty { color: #999; }

/* ===== 聊天室 / 私訊 ===== */
.room-list { list-style: none; padding: 0; margin: 0 0 6px; }
.room-list a {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 8px;
    border-radius: 8px;
    color: inherit;
}
.room-list a:hover { background: #f5f5f5; }
.room-list a.active { background: #ffe9e8; }
.room-name { font-weight: 600; }
.room-online { font-size: 0.8rem; color: #999; }
.online-head { margin-top: 20px; }
.online-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 220px;
    overflow-y: auto;
}
.online-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 8px 4px;
}
.online-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: inherit;
}
.online-item a:hover { text-decoration: underline; }
.room-online-text { font-size: 0.85rem; color: #888; margin-left: 8px; }
.chat-loadmore {
    display: block;
    margin: 12px auto 0;
}
.msg-main {
    max-width: 72%;
    min-width: 0;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
}
.msg-head .match-name { font-size: 0.82rem; }
.msg-head .vip-badge { margin-left: 2px; }
.msg-main .msg-body {
    max-width: none;
    padding: 3px 11px;
    border-radius: 12px;
}
.msg-system {
    text-align: center;
    font-size: 0.8rem;
    color: #999;
    background: #fafafa;
    border-radius: 12px;
    padding: 5px 12px;
    margin: 10px auto;
    max-width: 80%;
}
.btn-report {
    border: 1px solid #e0e0e0;
    background: #fff;
    color: #aaa;
    font-size: 0.72rem;
    border-radius: 10px;
    padding: 1px 8px;
    cursor: pointer;
}
.btn-report:hover { color: #b71c1c; border-color: #f5c6cb; }
a.btn-dm { text-decoration: none; }
.btn-dm:hover { color: #1e88e5; border-color: #bbdefb; }
.msg .insert-name { cursor: pointer; }
.msg .insert-name:hover { text-decoration: underline; }
.dm-find { display: flex; gap: 6px; margin-bottom: 12px; }
.dm-find input { flex: 1; min-width: 0; }
.dm-find-results { border-bottom: 1px solid #f0f0f0; margin-bottom: 12px; }
.dm-unread {
    margin-left: auto;
    background: #e53935;
    color: #fff;
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* ===== 響應式 ===== */
@media (max-width: 860px) {
    .profile-layout { grid-template-columns: 1fr; }
    .page-with-ads { grid-template-columns: 1fr; }
    .page-main { order: 1; }
    .ad-column { position: static; order: 2; flex-direction: row; flex-wrap: wrap; }
    .ad-block { width: calc(50% - 8px); }
    .ad-block:nth-child(n+3) { display: none; }
    .discover-layout, .chat-layout { grid-template-columns: 1fr; }
    .discover-map { position: static; }
    .discover-map { order: 1; }
    .discover-list:nth-of-type(1) { order: 3; }
    .discover-list:nth-of-type(2) { order: 2; }
    .nav-inner { padding: 0 8px; }
    .nav-links a { margin-left: 8px; padding: 6px 6px; font-size: 0.95rem; }
    .nav-brand { font-size: 1.05rem; }
}
@media (max-width: 560px) {
    .nav-inner { padding: 0 6px; }
    .nav-links a { margin-left: 4px; padding: 6px 4px; font-size: 0.85rem; }
    .nav-brand { font-size: 0.95rem; }
}

/* ===== 管理後台行動版選單：換行排列整齊 ===== */
@media (max-width: 860px) {
    .admin-nav .nav-inner {
        flex-wrap: wrap;
        height: auto;
        padding: 8px;
        gap: 4px 0;
    }
    .admin-nav .nav-brand {
        width: 100%;
        margin-bottom: 4px;
        font-size: 1rem;
    }
    .admin-nav .nav-links {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        width: 100%;
        gap: 6px;
    }
    .admin-nav .nav-links a {
        margin: 0;
        padding: 5px 8px;
        font-size: 0.85rem;
        white-space: nowrap;
    }
}

.admin-filter {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 14px;
}

/* ===== 管理後台 ===== */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    border-top: 3px solid #1e88e5;
}
.stat-card .num { font-size: 1.6rem; font-weight: 700; color: #2c3e50; }
.stat-card .lbl { font-size: 0.85rem; color: #777; }
.stat-card.warn { border-top-color: #e53935; }
.stat-card.ok { border-top-color: #43a047; }

.admin-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.admin-toolbar form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.admin-toolbar input[type=text], .admin-toolbar select {
    padding: 8px 10px;
    border: 1px solid #ccd1d6;
    border-radius: 6px;
}
.admin-table { width: 100%; border-collapse: collapse; background: #fff; }
.admin-table th, .admin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    text-align: left;
    vertical-align: middle;
    font-size: 0.93rem;
}
.admin-table th { background: #fafafa; color: #555; font-size: 0.85rem; }
.admin-table tr:hover td { background: #fafafa; }
.thumb { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.thumb-placeholder {
    width: 44px; height: 44px; border-radius: 50%;
    background: #ffcdd2; color: #b71c1c;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700;
}
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}
.badge-active { background: #e8f5e9; color: #1b5e20; }
.badge-banned { background: #fdecea; color: #b71c1c; }
.badge-ban { background: #fff3e0; color: #e65100; }
.badge-admin { background: #fff3e0; color: #e65100; }
.badge-female { background: #fce4ec; color: #c2185b; }
.badge-male { background: #e3f2fd; color: #1565c0; }
.badge-other { background: #eeeeee; color: #616161; }
.row-actions { white-space: nowrap; }
.row-actions .btn { margin-right: 6px; }
.pagination { display: flex; gap: 6px; margin-top: 14px; align-items: center; flex-wrap: wrap; }
.pagination a, .pagination span {
    padding: 6px 12px;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #e0e0e0;
    color: #333;
}
.pagination a:hover { background: #f0f0f0; }
.pagination .cur { background: #e53935; color: #fff; border-color: #e53935; }
.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.meta-grid .kv { padding: 8px 0; border-bottom: 1px solid #f5f5f5; }
.meta-grid .kv b { display: block; color: #888; font-size: 0.82rem; font-weight: 600; }
.admin-sub { font-size: 0.9rem; color: #888; margin-bottom: 16px; }

/* ===== 照片審核 ===== */
.nav-badge {
    display: inline-block;
    margin-left: 5px;
    min-width: 18px;
    padding: 1px 6px;
    border-radius: 999px;
    background: #e53935;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    text-align: center;
}
.review-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}
.review-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.review-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.review-photo { text-align: center; }
.review-photo img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #eee;
}
.review-actions { display: flex; gap: 10px; }
.review-actions form { margin: 0; }

/* ===== 會員基本資料 ===== */
.back-link { margin: 14px 0 0; font-size: 0.9rem; }
.member-card { display: flex; gap: 24px; align-items: flex-start; }
.member-photo img {
    width: 160px;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #eee;
    display: block;
}
.member-photo-empty {
    width: 160px;
    height: 200px;
    border-radius: 10px;
    background: #f5f5f5;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    border: 1px dashed #ddd;
}
.member-info { flex: 1; min-width: 0; }
.member-info h2 { margin: 0 0 14px; }
.member-detail { list-style: none; padding: 0; margin: 0 0 18px; color: #444; }
.member-detail li { padding: 8px 0; border-bottom: 1px solid #f5f5f5; }
.member-detail li.member-bio { white-space: pre-wrap; }
.member-action .btn { min-width: 120px; }
@media (max-width: 560px) {
    .member-card { flex-direction: column; }
    .member-photo img, .member-photo-empty { width: 100%; height: auto; }
}

/* ===== 漂流瓶 ===== */
.bottle-layout {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 18px;
    align-items: start;
}
.bottle-sea { position: relative; overflow: hidden; }
.badge-bottle { background: #e0f2f1; color: #00695c; }
.sea-scene {
    position: relative;
    height: 340px;
    border-radius: 12px;
    background: linear-gradient(180deg, #b3e5fc 0%, #4fc3f7 45%, #0288d1 100%);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.sea-waves {
    position: absolute;
    left: -50%;
    right: -50%;
    bottom: 0;
    height: 90px;
    background: radial-gradient(ellipse at 20% 100%, rgba(255,255,255,0.45) 0 8%, transparent 9%);
    background-size: 90px 22px;
    animation: sea-drift 6s linear infinite;
}
@keyframes sea-drift {
    from { transform: translateX(0); }
    to { transform: translateX(45px); }
}
.sea-sprites {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}
.sea-sprite {
    position: absolute;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    pointer-events: auto;
    animation-duration: var(--sprite-dur, 12s);
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    will-change: left, top, transform;
}
.sea-sprite:active { transform: scale(0.94); }
.sea-sprite .bottle-svg { width: 100%; height: auto; filter: drop-shadow(0 10px 14px rgba(0,80,120,0.35)); }
@keyframes sprite-drift-right {
    0%   { left: -120px; top: var(--sprite-y, 50%); transform: rotate(-4deg); }
    25%  { left: 25%;    top: calc(var(--sprite-y, 50%) - 46px); transform: rotate(4deg); }
    50%  { left: 50%;    top: calc(var(--sprite-y, 50%) + 34px); transform: rotate(-3deg); }
    75%  { left: 75%;    top: calc(var(--sprite-y, 50%) - 30px); transform: rotate(5deg); }
    100% { left: var(--sprite-travel, 110%); top: var(--sprite-y, 50%); transform: rotate(-4deg); }
}
@keyframes sprite-drift-left {
    0%   { left: var(--sprite-travel, 110%); top: var(--sprite-y, 50%); transform: rotate(4deg); }
    25%  { left: 75%;    top: calc(var(--sprite-y, 50%) - 40px); transform: rotate(-4deg); }
    50%  { left: 50%;    top: calc(var(--sprite-y, 50%) + 30px); transform: rotate(3deg); }
    75%  { left: 25%;    top: calc(var(--sprite-y, 50%) - 34px); transform: rotate(-5deg); }
    100% { left: -120px; top: var(--sprite-y, 50%); transform: rotate(4deg); }
}
.sea-sprite.drift-right { animation-name: sprite-drift-right; }
.sea-sprite.drift-left { animation-name: sprite-drift-left; }
.bottle-svg { display: block; filter: drop-shadow(0 10px 14px rgba(0,80,120,0.35)); }
.bottle-bubble { animation: bubble-rise 3s ease-in-out infinite; }
.bottle-bubble.b2 { animation-delay: 1s; }
.bottle-bubble.b3 { animation-delay: 2s; }
@keyframes bubble-rise {
    0% { transform: translateY(0); opacity: 0; }
    20% { opacity: 0.8; }
    100% { transform: translateY(-34px); opacity: 0; }
}
.sea-status { position: absolute; left: 0; right: 0; bottom: 10px; color: #fff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,80,120,0.4); padding: 0 12px; text-align: center; z-index: 3; pointer-events: none; }

.bottle-color-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 6px 0 10px;
}
.bottle-color-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 2px solid #dfe6ef;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.bottle-color-option:hover { border-color: #6fb3d6; }
.bottle-color-option.selected { border-color: #0288d1; background: #e1f0f9; font-weight: 600; }
.bottle-color-option input { position: absolute; opacity: 0; pointer-events: none; }
.bottle-color-swatch {
    width: 18px;
    height: 26px;
    border-radius: 6px 6px 3px 3px;
    border: 1px solid rgba(0,0,0,0.15);
    display: inline-block;
}
.swatch-lightgreen { background: linear-gradient(180deg, #a7d8b8, #6fae85); }
.swatch-pink { background: linear-gradient(180deg, #f9c8d6, #f0a8bf); }
.swatch-transparent { background: linear-gradient(180deg, #ffffff, #e6f3fb); }
.bottle-color-dot {
    width: 12px;
    height: 16px;
    border-radius: 4px 4px 2px 2px;
    border: 1px solid rgba(0,0,0,0.15);
    display: inline-block;
    vertical-align: middle;
    margin-right: 4px;
}
.dot-lightgreen { background: #6fae85; }
.dot-pink { background: #f0a8bf; }
.dot-transparent { background: #e6f3fb; }

.bottle-card {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid #b2dfdb;
    border-radius: 12px;
    background: #f5fbfa;
    animation: bottle-card-in 0.4s ease;
}
@keyframes bottle-card-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.bottle-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.bottle-body { white-space: pre-wrap; word-break: break-word; margin: 8px 0 14px; }
.bottle-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.bottle-form-msg, #bottle-form-msg { color: #666; font-size: 0.9rem; }
#bottle-form { max-width: 420px; }
#bottle-input { width: 100%; box-sizing: border-box; }

.bottle-collected-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.bottle-collected-item {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 14px;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.bottle-collected-item .bottle-body { margin: 0; font-size: 0.95rem; }
.bottle-collected-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.85rem; flex-wrap: wrap; }
.bottle-sender { display: inline-flex; align-items: center; gap: 6px; }
.bottle-sender img, .bottle-sender .avatar-placeholder {
    width: 28px; height: 28px; border-radius: 50%; object-fit: cover; display: inline-flex;
    align-items: center; justify-content: center; font-size: 0.85rem; background: #e3f2fd;
}
@media (max-width: 760px) {
    .bottle-layout { grid-template-columns: 1fr; }
}

/* ===== VIP 升級方案 ===== */
.upgrade-plans {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}
.upgrade-plan { padding: 20px; text-align: center; }
.upgrade-plan h3 { margin: 0 0 8px; }
.upgrade-price { font-size: 2rem; font-weight: 700; color: #b8860b; margin: 8px 0; }
.vip-compare { margin-top: 20px; }
.vip-compare-table { width: 100%; border-collapse: collapse; }
.vip-compare-table th, .vip-compare-table td {
    border: 1px solid #eee;
    padding: 10px 12px;
    text-align: left;
    font-size: 0.9rem;
    vertical-align: middle;
}
.vip-compare-table thead th {
    background: #fff3e0;
    color: #b8860b;
    font-weight: 700;
}
.vip-compare-table .vip-col { background: #fff8e1; }
.vip-compare-no { color: #999; }
.vip-compare-yes { color: #b8860b; font-weight: 600; }
@media (max-width: 600px) {
    .upgrade-plans { grid-template-columns: 1fr; }
    .vip-compare-table { font-size: 0.82rem; }
    .vip-compare-table th, .vip-compare-table td { padding: 8px 6px; }
}
