/* ============================================================
   穩尚社群 mockup — 共用樣式
   Design tokens 取自 wingo-learning-main/src/assets/global.css
   卡片/陰影規則取自 QnASection.vue、course-card（TheHeader.vue）
   ============================================================ */

:root {
    --primary: #2C8CBC;
    --secondary: #38B2AC;
    --accent: #4FD1C5;
    --background: #F7FAFC;
    --text: #2D3748;
    --light-text: #718096;
    --light-gray: #E2E8F0;
    --white: #FFFFFF;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --danger: #E53E3E;
    --success: #38A169;
    --warning: #DD6B20;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

body {
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

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

/* ---------- Header（照抄 TheHeader.vue 現有站台頭） ---------- */
header.site-header {
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}
.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.logo i { color: var(--secondary); }
.brand-logo { height: 40px; display: block; }
.nav-links {
    display: flex;
    list-style: none;
    gap: 0.75rem;
    align-items: center;
}
.nav-links .btn-outline {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    color: var(--text);
    font-weight: 500;
}
.nav-links .btn-outline:hover { color: var(--primary); }
.nav-links .active {
    color: var(--primary);
    font-weight: bold;
    position: relative;
}
.navbar-row { display: flex; align-items: center; gap: 1.5rem; }
.auth-buttons { display: flex; align-items: center; gap: 0.75rem; }
.user-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
    font-weight: 500;
    cursor: pointer;
}

/* 通知鈴鐺 + 未讀紅點 */
.notif-bell {
    position: relative;
    font-size: 1.2rem;
    color: var(--text);
    cursor: pointer;
    padding: 0.25rem;
}
.notif-bell:hover { color: var(--primary); }
.notif-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--danger);
    border: 2px solid var(--white);
}

/* ---------- Buttons ---------- */
.btn {
    padding: 0.65rem 1.4rem;
    border-radius: 4px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    text-align: center;
    display: inline-block;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
}
.btn-primary { background-color: var(--primary); color: var(--white); }
.btn-primary:hover { background-color: #2680aa; }
.btn-secondary { background-color: var(--white); color: var(--primary); border: 1px solid var(--primary); }
.btn-secondary:hover { background-color: rgba(44,140,188,0.08); }
.btn-ghost { background: transparent; color: var(--light-text); }
.btn-ghost:hover { color: var(--text); }
.btn-danger-outline { background: var(--white); color: var(--danger); border: 1px solid var(--danger); }
.btn-danger-outline:hover { background: rgba(229,62,62,0.06); }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.85rem; }

/* ---------- Layout shell ---------- */
.page-shell {
    display: grid;
    grid-template-columns: 220px minmax(0,1fr) 260px;
    gap: 1.5rem;
    padding: 1.5rem 0 3rem;
}
@media (max-width: 1024px) {
    .page-shell { grid-template-columns: 1fr; }
    .side-nav, .side-panel { display: none; }
}

.side-nav {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    padding: 1rem;
    height: fit-content;
    position: sticky;
    top: 90px;
}
.side-nav a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    color: var(--text);
    font-size: 0.95rem;
    margin-bottom: 0.15rem;
}
.side-nav a i { width: 18px; text-align: center; color: var(--light-text); }
.side-nav a:hover { background: var(--background); }
.side-nav a.active { background: rgba(44,140,188,0.1); color: var(--primary); font-weight: 600; }
.side-nav a.active i { color: var(--primary); }

.side-panel {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    padding: 1.25rem;
    height: fit-content;
    position: sticky;
    top: 90px;
}
.side-panel h4 { font-size: 0.95rem; margin-bottom: 0.75rem; color: var(--text); }
.side-panel .note {
    font-size: 0.8rem;
    color: var(--light-text);
    line-height: 1.7;
}

.feed-col { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }

/* ---------- Card ---------- */
.card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    padding: 1.5rem;
}

/* ---------- Composer ---------- */
.composer textarea {
    width: 100%;
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 70px;
    color: var(--text);
}
.composer textarea:focus { outline: none; border-color: var(--primary); }
.composer-head { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.composer-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
}
.composer-tools { display: flex; gap: 0.5rem; }
.composer-tools button {
    background: var(--background);
    border: none;
    border-radius: 6px;
    padding: 0.45rem 0.7rem;
    color: var(--light-text);
    cursor: pointer;
    font-size: 0.9rem;
}
.composer-tools button:hover { color: var(--primary); }
.img-preview-row { display: flex; gap: 0.5rem; margin-top: 0.75rem; flex-wrap: wrap; }
.img-preview-row .thumb {
    width: 84px; height: 84px;
    border-radius: 8px;
    background: var(--light-gray);
    position: relative;
    overflow: hidden;
}
.img-preview-row .thumb .rm {
    position: absolute; top: 2px; right: 2px;
    background: rgba(0,0,0,0.55); color: var(--white);
    width: 18px; height: 18px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; cursor: pointer;
}

/* ---------- Avatar ---------- */
.avatar {
    width: 42px; height: 42px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--white); font-weight: 600; font-size: 0.95rem;
    flex-shrink: 0;
}
.avatar-sm { width: 32px; height: 32px; font-size: 0.8rem; }
.avatar-lg { width: 72px; height: 72px; font-size: 1.4rem; }

/* ---------- Post ---------- */
.post-card { display: flex; flex-direction: column; gap: 0.75rem; }
.post-top { display: flex; gap: 0.75rem; align-items: flex-start; }
.post-meta { flex: 1; min-width: 0; }
.post-author { font-weight: 600; color: var(--text); }
.post-author .tag-role {
    font-size: 0.7rem;
    background: rgba(44,140,188,0.1);
    color: var(--primary);
    padding: 0.1rem 0.45rem;
    border-radius: 10px;
    margin-left: 0.4rem;
    font-weight: 500;
}
.post-time { font-size: 0.8rem; color: var(--light-text); }
.post-more { color: var(--light-text); cursor: pointer; padding: 0.25rem; }

/* ⋯ 更多操作選單（封鎖等） */
.post-more-wrap { position: relative; }
button.post-more {
    background: none; border: none;
    font-size: 1rem;
    color: var(--light-text);
    cursor: pointer;
    padding: 0.25rem 0.4rem;
    border-radius: 6px;
}
button.post-more:hover { background: var(--background); color: var(--text); }
.post-more-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 115%;
    background: var(--white);
    box-shadow: var(--card-shadow);
    border-radius: 8px;
    min-width: 150px;
    padding: 6px;
    z-index: 60;
}
.post-more-menu.show { display: block; }
.post-more-menu button {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 0.55rem 0.6rem;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.post-more-menu button:hover { background: var(--background); color: var(--danger); }

/* 動態牆新貼文提示（往下滑之後出現，模擬 SSE 推播） */
.new-post-banner {
    position: fixed;
    top: 84px;
    left: 50%;
    transform: translateX(-50%) translateY(-16px);
    background: var(--primary);
    color: var(--white);
    padding: 0.6rem 1.3rem;
    border-radius: 999px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.18);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
    z-index: 150;
}
.new-post-banner.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.new-post-banner:hover { background: #2680aa; }
.post-body { color: var(--text); font-size: 0.95rem; line-height: 1.7; white-space: pre-wrap; }
.post-images {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    border-radius: 10px;
    overflow: hidden;
}
.post-images.single { grid-template-columns: 1fr; }
.post-images .img-ph {
    background: linear-gradient(135deg, var(--light-gray), #cbd5e0);
    aspect-ratio: 16/10;
    display: flex; align-items: center; justify-content: center;
    color: var(--light-text);
    font-size: 1.4rem;
}
.post-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.post-tag {
    font-size: 0.75rem;
    background: var(--background);
    color: var(--light-text);
    padding: 0.15rem 0.6rem;
    border-radius: 10px;
    cursor: pointer;
}
.post-tag:hover { background: rgba(44,140,188,0.12); color: var(--primary); }

/* ---------- 動態牆篩選提示 ---------- */
.filter-indicator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(44,140,188,0.08);
    border: 1px solid rgba(44,140,188,0.25);
    border-radius: 8px;
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
    color: var(--primary);
}
.filter-indicator .filter-label { font-weight: 600; }
/* ---------- 搜尋 ---------- */
.search-bar { display: flex; flex-direction: column; gap: 0.7rem; }
.search-input-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    padding: 0.55rem 0.8rem;
}
.search-input-row:focus-within { border-color: var(--primary); }
.search-input-row i.fa-search { color: var(--light-text); }
.search-input-row input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.92rem;
    color: var(--text);
    font-family: inherit;
    background: transparent;
}
.search-clear { background: none; border: none; color: var(--light-text); cursor: pointer; padding: 0.2rem; }
.search-clear:hover { color: var(--text); }
.search-scope { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.scope-btn {
    background: var(--background);
    border: none;
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    font-size: 0.82rem;
    color: var(--light-text);
    cursor: pointer;
}
.scope-btn.active { background: var(--primary); color: var(--white); }

/* ---------- 空狀態 ---------- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 3rem 1.5rem;
    gap: 0.5rem;
}
.empty-state-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--background);
    color: var(--light-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}
.empty-state-title { font-size: 0.95rem; font-weight: 600; color: var(--text); }
.empty-state-sub { font-size: 0.85rem; color: var(--light-text); max-width: 320px; margin-bottom: 0.5rem; }

.filter-indicator button {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.post-actions {
    display: flex;
    gap: 1.5rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--light-gray);
    margin-top: 0.25rem;
}
.post-action {
    display: flex; align-items: center; gap: 0.4rem;
    color: var(--light-text);
    cursor: pointer;
    font-size: 0.9rem;
    background: none; border: none;
}
.post-action:hover { color: var(--primary); }
.post-action.liked { color: var(--danger); }
.post-action.liked i { font-weight: 900; }

/* ---------- Comment ---------- */
.comment-list { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }
.comment { display: flex; gap: 0.6rem; }
.comment-bubble {
    background: var(--background);
    border-radius: 12px;
    padding: 0.6rem 0.9rem;
    flex: 1;
}
.comment-author { font-weight: 600; font-size: 0.88rem; color: var(--text); }
.comment-text { font-size: 0.9rem; color: var(--text); margin-top: 0.1rem; }
.comment-foot { display: flex; gap: 1rem; margin-top: 0.35rem; font-size: 0.78rem; color: var(--light-text); }
.comment-foot span { cursor: pointer; }
.comment-foot span:hover { color: var(--primary); }
.reply-row { margin-left: 2.6rem; margin-top: 0.5rem; }

/* ---------- Notification item ---------- */
.notif-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border-radius: 10px;
    align-items: flex-start;
}
.notif-item.unread { background: rgba(44,140,188,0.06); }
.notif-icon {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--white); font-size: 0.9rem; flex-shrink: 0;
}
.notif-text { font-size: 0.9rem; color: var(--text); }
.notif-text b { font-weight: 600; }
.notif-time { font-size: 0.78rem; color: var(--light-text); margin-top: 0.15rem; }

/* ---------- Badges / tags ---------- */
.badge-count {
    background: var(--primary);
    color: var(--white);
    font-size: 0.7rem;
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
}
.section-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.section-title-row h2 { font-size: 1.1rem; color: var(--text); }
.tabs { display: flex; gap: 1.5rem; border-bottom: 1px solid var(--light-gray); margin-bottom: 1rem; }
.tabs button {
    background: none; border: none;
    padding: 0.75rem 0.1rem;
    font-size: 0.95rem;
    color: var(--light-text);
    cursor: pointer;
    border-bottom: 2px solid transparent;
}
.tabs button.active { color: var(--primary); font-weight: 600; border-color: var(--primary); }
.tab-panel { display: flex; flex-direction: column; gap: 1.25rem; }

/* ---------- 我的留言（個人頁） ---------- */
.my-comment-item { display: flex; flex-direction: column; gap: 0.4rem; }
.my-comment-ref {
    font-size: 0.82rem;
    color: var(--light-text);
    background: var(--background);
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
}
.my-comment-ref b { color: var(--text); font-weight: 600; }
.my-comment-body { font-size: 0.95rem; color: var(--text); line-height: 1.6; }
.my-comment-time { font-size: 0.78rem; color: var(--light-text); }

/* ---------- Modal (report/block) ---------- */
.modal-mask {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex; align-items: center; justify-content: center;
    z-index: 200;
}
.modal-box {
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    width: 380px;
    max-width: 90vw;
}
.modal-box h3 { font-size: 1.05rem; margin-bottom: 0.9rem; }
.modal-box.wide { width: 440px; }
.edit-avatar-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.1rem; }
.form-field { margin-bottom: 1rem; }
.form-field label { display: block; font-size: 0.82rem; color: var(--light-text); margin-bottom: 0.35rem; font-weight: 500; }
.form-field input[type="text"], .form-field textarea {
    width: 100%;
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    padding: 0.55rem 0.7rem;
    font-size: 0.9rem;
    color: var(--text);
    font-family: inherit;
}
.form-field textarea { min-height: 70px; resize: vertical; }
.form-field input:focus, .form-field textarea:focus { outline: none; border-color: var(--primary); }

/* ---------- 表單頁分節（編輯個人資料頁） ---------- */
.form-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin: 1.75rem 0 1.1rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--light-gray);
}
.form-section-title:first-of-type { border-top: none; padding-top: 0; margin-top: 0.25rem; }
.opt { font-size: 0.78rem; color: var(--light-text); font-weight: 400; margin-left: 0.4rem; }
.check-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    color: var(--text);
    padding: 0.5rem 0;
    cursor: pointer;
}
.check-row input { width: 16px; height: 16px; accent-color: var(--primary); }
.avatar-hint { font-size: 0.78rem; color: var(--light-text); margin-top: 0.4rem; }
.modal-box .reason {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 0; font-size: 0.9rem;
}
.modal-box textarea {
    width: 100%; border: 1px solid var(--light-gray); border-radius: 8px;
    padding: 0.6rem; margin-top: 0.5rem; min-height: 60px;
}
.modal-foot { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1.2rem; }

/* ---------- Mockup-only banner ---------- */
.mock-banner {
    background: #FFF3CD;
    color: #856404;
    text-align: center;
    font-size: 0.82rem;
    padding: 0.5rem;
}

footer.site-footer {
    background-color: var(--text);
    color: var(--white);
    padding: 2rem 0;
    text-align: center;
    font-size: 0.85rem;
    margin-top: 2rem;
}
footer.site-footer a { color: var(--light-gray); }
