/* ==========================================
   SPA 專屬增補樣式
   ========================================== */
body {
    background: linear-gradient(135deg, #fdf3e7 0%, #f8e1c9 100%);
    min-height: 100vh;
}
.app-header { text-align: center; color: #7a5c43; margin-bottom: 30px; animation: weiyuFadeInDown 0.6s ease; }
.app-header h1 { font-size: 42px; font-weight: 800; margin-bottom: 8px; text-shadow: 0 2px 6px rgba(122,92,67,0.12); }

/* 登入橫幅 */
.login-banner { padding: 16px 20px; border-radius: 12px; margin-bottom: 20px; color: white; display: flex; flex-direction: column; gap: 12px; }
.login-banner.warning { background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%); }
.login-banner.success { background: linear-gradient(135deg, #c69c72 0%, #9f7653 100%); flex-direction: row; justify-content: space-between; align-items: center; }
.login-input-group { display: flex; gap: 8px; flex-wrap: wrap; }
.login-input-group input { flex: 1; min-width: 120px; padding: 10px 14px; border: none; border-radius: 8px; outline: none; }
.login-btn { background: white; color: #f59e0b; padding: 10px 20px; border-radius: 8px; border: none; font-weight: bold; cursor: pointer; transition: 0.2s; }
.logout-btn { background: rgba(255,255,255,0.2); color: white; padding: 8px 16px; border-radius: 8px; border: none; cursor: pointer; transition: 0.2s; }

/* SPA 專屬表單排版 */
.spa-form-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.spa-form-group { flex: 1; min-width: 140px; display: flex; flex-direction: column; gap: 6px; }
.spa-form-group label { font-size: 13px; font-weight: 600; color: #94a3b8; }
.spa-form-group select, .spa-form-group input[type="text"], .spa-form-group input[type="password"] { padding: 10px 14px; border: 2px solid #e2e8f0; border-radius: 10px; font-size: 14px; outline: none; transition: 0.3s; color: #334155; box-sizing: border-box; width: 100%; }
.spa-form-group select:focus, .spa-form-group input:focus { border-color: #71E2D1; box-shadow: 0 0 0 3px rgba(113, 226, 209, 0.15); }

/* 付費解鎖設定區（獨立成行、淡灰背景卡片，與普通表單區分；僅付費可見性時由 JS 顯示） */
.weiyu-paid-settings {
    margin: 4px 0 16px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    animation: weiyuFadeInDown 0.3s ease;
}
.weiyu-paid-settings-header {
    display: flex; align-items: center; gap: 8px;
    font-size: 14px; font-weight: 700; color: #334155;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}
.weiyu-paid-settings-header i { font-size: 16px; }
.weiyu-paid-settings-body {
    display: flex; gap: 12px; flex-wrap: wrap;
}
.weiyu-paid-settings-body .spa-form-group {
    flex: 1 1 200px;     /* 兩欄並列：價格 + 解鎖碼；窄屏自動換行 */
    min-width: 0;
}
.weiyu-paid-settings-body .spa-form-group:first-child {
    flex: 0 1 220px;     /* 價格欄窄一點，給解鎖碼留空間 */
}

/* SPA 卡片样式与 SSR 完全一致：使用 .item-header / .weiyu-card-footer 等基础类，由 style.css 控制布局；不需重复定义 */

/* ==========================================
   SPA 卡片 footer 专属样式：actions 紧贴 author 左侧
   （SSR card.php 保持 actions 靠右不变，SPA 这里主动左移让布局更紧凑）
   ========================================== */
.weiyu-card-footer {
    display: flex !important;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.weiyu-card-footer .weiyu-author-info {
    flex-shrink: 0;
}
.weiyu-card-footer .weiyu-actions-group {
    margin-left: 0 !important;       /* 取消 SSR 的 margin-left:auto，靠左对齐 */
    flex-shrink: 0;
}

/* 移动端 <480px：actions 仍然保持贴左 author（与桌面端一致），只调整 gap */
@media (max-width: 480px) {
    .weiyu-card-footer {
        gap: 8px;
    }
    .weiyu-card-footer .weiyu-actions-group {
        margin-left: 0 !important;
    }
}
/* ==========================================
   卡片心情標籤 (漸層色)
   ========================================== */
.mood-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    vertical-align: middle;
    margin-right: 6px;
    border: 1px solid transparent;
    /* 默认白色文字（心情背景深色时适用），具体颜色由后台配置动态注入 */
    color: white;
}

/* ==========================================
   可見性狀態標籤
   ========================================== */
.visibility-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    vertical-align: middle;
}
.visibility-public {
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}
.visibility-private {
    color: #ef4444;
    background: #fee2e2;
    border: 1px solid #fecaca;
}
.visibility-paid {
    color: #8b5cf6;              /* 紫色文字（與 SSR card.php 的 #8b5cf6 同步） */
    background: #ede9fe;         /* 紫色背景（與 SSR card.php 的 #ede9fe 同步） */
    border: 1px solid #ddd6fe;   /* 紫色邊框 */
}
.visibility-password {
    color: #f59e0b;
    background: #fef3c7;
    border: 1px solid #fde68a;
}

/* ==========================================
#話題標籤 與 @提及 用戶樣式
   ========================================== */
.weiyu-hashtag { 
    display: inline-block;
    color: white; 
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); 
    text-decoration: none; 
    font-weight: 500; 
    padding: 4px 12px; 
    border-radius: 16px; 
    font-size: 13px; 
    transition: all 0.3s; 
    margin: 0 2px;
}
.weiyu-hashtag:hover { 
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.weiyu-mention { 
    display: inline-block;
    color: white; 
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); 
    text-decoration: none; 
    font-weight: 500; 
    padding: 4px 12px; 
    border-radius: 16px; 
    font-size: 13px; 
    transition: all 0.3s; 
    margin: 0 2px;
}
.weiyu-mention:hover { 
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}
/* 評論模態框 */
.comment-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1000; justify-content: center; align-items: center; }
.comment-modal.active { display: flex; }
.comment-modal-content { background: white; border-radius: 20px; width: 90%; max-width: 500px; max-height: 80vh; overflow: hidden; display: flex; flex-direction: column; animation: weiyuFadeInUp 0.3s ease; }
.comment-modal-header { padding: 16px 20px; border-bottom: 1px solid #e2e8f0; display: flex; justify-content: space-between; align-items: center; }
.comment-modal-header h4 { font-size: 16px; color: #1e293b; margin: 0; }
.comment-modal-close { background: none; border: none; font-size: 20px; color: #94a3b8; cursor: pointer; padding: 4px 8px; }
.comment-modal-close:hover { background: #f1f5f9; border-radius: 6px; }
.comment-list { flex: 1; overflow-y: auto; padding: 16px 20px; }
.comment-item { display: flex; gap: 12px; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid #f1f5f9; }
.comment-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.comment-body { flex: 1; }
.comment-author { font-size: 14px; font-weight: 600; color: #1e293b; margin-bottom: 4px; }
.comment-time { font-size: 12px; color: #94a3b8; margin-left: 8px; font-weight: normal; }
.comment-text { font-size: 14px; color: #475569; line-height: 1.5; }
.comment-reply-btn { font-size: 12px; color: #0e3d36; background: none; border: none; cursor: pointer; margin-top: 6px; }
.comment-actions { display: flex; gap: 12px; margin-top: 6px; }
.comment-delete-btn { font-size: 12px; color: #ef4444; background: none; border: none; cursor: pointer; transition: color 0.2s; }
.comment-delete-btn:hover { color: #dc2626; }
.comment-item { transition: opacity 0.3s, transform 0.3s; }
.comment-input-area { padding: 16px 20px; border-top: 1px solid #e2e8f0; background: #f8fafc; }
.comment-input-wrapper { display: flex; gap: 10px; align-items: flex-end; }
.comment-input-wrapper textarea { flex: 1; min-height: 40px; padding: 10px 14px; border: 1px solid #e2e8f0; border-radius: 12px; font-size: 14px; resize: none; outline: none; }
.comment-submit-btn { background: linear-gradient(135deg, #71E2D1 0%, #5fcfc0 100%); color: #0e3d36; border: none; padding: 10px 18px; border-radius: 12px; cursor: pointer; transition: transform .15s, box-shadow .15s; box-shadow: 0 2px 6px rgba(113, 226, 209, 0.3); }
.comment-submit-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(113, 226, 209, 0.45); }
.comment-empty { text-align: center; padding: 40px 20px; color: #94a3b8; }
/* AI 評論標識 */
.comment-ai { background: linear-gradient(135deg, #f0f0ff 0%, #e8f4f8 100%); border-radius: 12px; padding: 10px; margin-left: -10px; margin-right: -10px; }
.comment-ai .comment-avatar { box-shadow: 0 0 0 2px #71E2D1; }
.weiyu-ai-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: #0e3d36; background: linear-gradient(135deg, #d4f5ec, #bce8e0); padding: 1px 7px; border-radius: 6px; margin-left: 6px; vertical-align: middle; }
/* ==========================================
   修復：卡片頭部編輯與刪除按鈕重疊問題
   ========================================== */
.weiyu-front-container .weiyu-admin-actions {
    position: static !important; /* 強制解除絕對定位 */
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
}
.weiyu-front-container .btn-del-front, 
.weiyu-front-container .btn-edit-front {
    padding: 6px 8px !important; /* 稍微縮小按鈕內距，讓排版更精緻 */
}

/* ==========================================
   標籤容器樣式
   ========================================== */
.weiyu-tags-container {
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.weiyu-tag-item {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
}

.weiyu-tag-item:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}
/* ==========================================
   篩選模式橫幅樣式
   ========================================== */
   .filter-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 12px;
    margin: 0 0 20px 0;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    animation: filterSlideDown 0.3s ease;
}

.filter-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
}

.filter-banner-content i {
    font-size: 16px;
}

.filter-banner-content strong {
    font-weight: 600;
}

.clear-filter-btn {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.clear-filter-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.clear-filter-btn i {
    font-size: 12px;
}

/* 全文搜尋欄 (SPA demo) */
.weiyu-spa-search {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 auto 20px;
    padding: 0 18px;
    height: 48px;
    max-width: 680px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 30px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
    transition: border-color 0.3s, box-shadow 0.3s;
}
.weiyu-spa-search:focus-within {
    border-color: #71E2D1;
    box-shadow: 0 4px 24px rgba(113, 226, 209, 0.25);
}
.weiyu-spa-search > i.fa-magnifying-glass {
    color: #94a3b8;
    font-size: 16px;
    flex: none;
}
#weiyu-spa-search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 15px;
    color: #334155;
    height: 100%;
}
#weiyu-spa-search-input::placeholder {
    color: #94a3b8;
}
/* 隱藏 WebKit 原生搜索清除按鈕，避免與自訂清除鈕重疊 */
#weiyu-spa-search-input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}
#weiyu-spa-search-clear {
    flex: none;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: background 0.2s, color 0.2s;
}
#weiyu-spa-search-clear:hover {
    background: #cbd5e1;
    color: #334155;
}

@keyframes filterSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   世界盡頭提示樣式
   ========================================== */
.end-of-world-banner {
    text-align: center;
    padding: 40px 20px;
    margin: 30px 0;
    animation: endFadeIn 0.5s ease;
}

.end-of-world-content {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
    padding: 16px 32px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(30, 41, 59, 0.3);
}

.end-of-world-content i {
    font-size: 20px;
}

.end-of-world-content i:first-child {
    color: #60a5fa;
}

.end-of-world-content i:last-child {
    color: #f472b6;
}

@keyframes endFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   心情自定義下拉選擇器
   ========================================== */
.weiyu-mood-select {
    position: relative;
    display: inline-block;
    width: 100%;
/* 心情动态配色：由 JS 依据后端 mood.color / mood.text 设置 */
    --mood-bg: #d4f5ec;
    --mood-fg: #71E2D1;
}

.weiyu-mood-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 2px solid var(--mood-fg);
    border-radius: 10px;
    font-size: 14px;
    color: var(--mood-fg);
    cursor: pointer;
    background: var(--mood-bg);
    transition: border-color 0.3s, box-shadow 0.3s, background 0.2s, color 0.2s;
    user-select: none;
}

.weiyu-mood-trigger:hover {
    border-color: var(--mood-fg);
    filter: brightness(0.97);
}

.weiyu-mood-trigger .weiyu-mood-arrow {
    margin-left: auto;
    font-size: 10px;
    color: var(--mood-fg);
    opacity: 0.7;
    transition: transform 0.2s;
}

.weiyu-mood-dropdown.active + .weiyu-mood-trigger .weiyu-mood-arrow,
.weiyu-mood-select:has(.weiyu-mood-dropdown.active) .weiyu-mood-arrow {
    transform: rotate(180deg);
}

.weiyu-mood-trigger i:first-child {
    font-size: 16px;
    color: var(--mood-fg);
}

.weiyu-mood-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 100;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.25s ease, opacity 0.25s ease;
    pointer-events: none;
}

.weiyu-mood-dropdown.active {
    max-height: 300px;
    opacity: 1;
    pointer-events: auto;
}

.weiyu-mood-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    font-size: 14px;
    color: #334155;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.weiyu-mood-item:hover {
    background: #f0f0ff;
    color: #334155;
}

.weiyu-mood-item.selected {
    background: var(--mood-bg);
    color: var(--mood-fg);
    font-weight: 600;
}

.weiyu-mood-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
    color: var(--item-fg, #94a3b8);
}

.weiyu-mood-item.selected i {
    color: var(--mood-fg);
}
/* 付費解鎖（基礎樣式自 spa.js 行內遷移；spa.css 後載入覆蓋 style.css 的 SSR 同名樣式） */
.weiyu-locked-box { background: #f8fafc; border-radius: 12px; padding: 30px; text-align: center; border: none; }
.weiyu-locked-box > i { font-size: 32px; color: #94a3b8; margin-bottom: 10px; }
.weiyu-locked-box--unavailable { padding: 25px; }
.weiyu-locked-box--unavailable > i { font-size: 28px; color: #cbd5e1; }
.weiyu-paid-lock { background: linear-gradient(135deg, #fffbeb, #fef3c7); border: 1px solid #fde68a; border-radius: 12px; padding: 26px; text-align: center; }
.weiyu-paid-lock > i { font-size: 28px; color: #d97706; margin-bottom: 10px; }
.weiyu-paid-lock .weiyu-paid-tip { color: #92400e; margin-bottom: 6px; font-size: 14px; }
.weiyu-paid-lock .weiyu-paid-price { font-size: 26px; font-weight: 700; color: #b45309; margin-bottom: 12px; }
.weiyu-paid-lock .weiyu-pay-tip { color: #f59e0b; margin: 8px 0 0; font-size: 13px; }
.weiyu-buy-btn { margin-top: 6px; background: linear-gradient(135deg, #f59e0b, #ef4444); color: #fff; border: none; padding: 11px 22px; border-radius: 10px; cursor: pointer; font-size: 15px; font-weight: 600; transition: transform .15s ease, box-shadow .15s ease; }
.weiyu-buy-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(217, 119, 6, .35); }
.weiyu-paid-code-toggle { margin-top: 14px; font-size: 13px; color: #64748b; cursor: pointer; text-decoration: underline; }
.weiyu-paid-code-toggle:hover { color: #475569; }
.weiyu-paid-code-group { display: none; margin-top: 10px; justify-content: center; gap: 8px; }
.weiyu-paid-code-group input[type="password"] { padding: 10px 14px; border: 1px solid #e2e8f0; border-radius: 8px; outline: none; max-width: 160px; }
.weiyu-unlock-btn { background: linear-gradient(135deg, #71E2D1 0%, #5fcfc0 100%); color: #0e3d36; border: none; padding: 10px 16px; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 6px rgba(113, 226, 209, 0.3); transition: transform .15s, box-shadow .15s; }
.weiyu-unlock-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(113, 226, 209, 0.45); }
.weiyu-pay-method { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 18px; border: none; border-radius: 12px; color: #0e3d36; font-size: 16px; font-weight: 600; cursor: pointer; background: linear-gradient(135deg, #71E2D1 0%, #5fcfc0 100%); transition: transform .12s ease, box-shadow .12s ease; box-shadow: 0 2px 6px rgba(113, 226, 209, 0.3); }
.weiyu-pay-method[data-method="wechat"] { background: #07c160; }
.weiyu-pay-method[data-method="alipay"] { background: #1677ff; }
.weiyu-pay-method:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(113, 226, 209, 0.45); }

/* ==========================================
   SPA 詳情頁 (Detail Overlay)
   ========================================== */
.weiyu-detail-overlay {
    position: fixed; inset: 0; z-index: 9000;
    background: linear-gradient(135deg, #fdf3e7 0%, #f8e1c9 100%);
    display: none; align-items: stretch; justify-content: center;
}
.weiyu-detail-overlay.active { display: flex; }
.weiyu-detail-panel {
    background: linear-gradient(135deg, #fdf3e7 0%, #f8e1c9 100%);
    width: 100%; max-width: 800px; height: 100%;
    display: flex; flex-direction: column;
    animation: weiyuDetailIn 0.25s ease;
}
@keyframes weiyuDetailIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.weiyu-detail-header {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 18px;
    border-bottom: none;
    position: sticky; top: 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    z-index: 2;
}
.weiyu-detail-close {
    background: #f1f5f9; border: none; width: 36px; height: 36px;
    border-radius: 50%; cursor: pointer; color: #475569; font-size: 16px;
    display: flex; align-items: center; justify-content: center; transition: background .15s;
}
.weiyu-detail-close:hover { background: #e2e8f0; }
.weiyu-detail-title { font-weight: 700; font-size: 16px; color: #1e293b; }
.weiyu-detail-scroll { flex: 1; overflow-y: auto; padding: 18px; -webkit-overflow-scrolling: touch; }
.weiyu-detail-post .item-card {
    box-shadow: none;
    border: 1px solid #eef2f7;
    margin-bottom: 8px;
    padding: 24px;          /* 详情页稍紧凑一些 */
    animation: none;          /* 避免在 overlay 内再次播放入场动画 */
    opacity: 1;              /* 父级 animation none + opacity:1 防止首屏空白 */
}
.weiyu-detail-post .item-card:hover {
    transform: none;        /* overlay 中禁止 hover 抬升 */
    box-shadow: none;
    border-color: #eef2f7;
}
.weiyu-detail-post .item-content {
    font-size: 15px;        /* 详情页正文略放大，与 Feed 卡片区分 */
    line-height: 1.7;
}
.weiyu-detail-post .item-image img { max-height: 540px; } /* 详情页允许更大的图 */
.weiyu-detail-comments { margin-top: 26px; }
.weiyu-detail-comments-title { font-weight: 700; color: #334155; margin-bottom: 14px; font-size: 15px; }
.weiyu-detail-comment-list { display: flex; flex-direction: column; gap: 14px; }
.weiyu-detail-comment-input {
    display: flex !important;
    flex-direction: row;
    gap: 10px;
    margin-top: 18px;
    align-items: flex-end;
    width: 100%;
    box-sizing: border-box;
}
.weiyu-detail-comment-input textarea {
    flex: 1 1 auto;
    min-width: 0;
    resize: none;
    min-height: 44px;
    max-height: 140px;
    padding: 11px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    line-height: 1.5;
    box-sizing: border-box;
}
.weiyu-detail-comment-input textarea:focus { border-color: #71E2D1; box-shadow: 0 0 0 3px rgba(113, 226, 209, 0.15); }
.weiyu-detail-comment-submit {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #71E2D1 0%, #5fcfc0 100%);
    color: #0e3d36;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .15s, box-shadow .15s;
    padding: 0;
    box-shadow: 0 2px 6px rgba(113, 226, 209, 0.3);
}
.weiyu-detail-comment-submit:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(113, 226, 209, 0.45); }
.weiyu-detail-comment-submit:active { transform: translateY(0); box-shadow: 0 1px 3px rgba(113, 226, 209, 0.3); }
.weiyu-detail-loading, .weiyu-detail-error { text-align: center; color: #94a3b8; padding: 48px 0; }
.weiyu-detail-error { color: #ef4444; }
.weiyu-detail-comment-empty { padding: 28px 16px; text-align: center; color: #94a3b8; font-size: 13px; }

/* 详情页背景支持暗色滚动条 */
.weiyu-detail-scroll { scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
.weiyu-detail-scroll::-webkit-scrollbar { width: 6px; }
.weiyu-detail-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

body.weiyu-detail-open { overflow: hidden; }
@media (max-width: 820px) {
    .weiyu-detail-panel { max-width: 100%; }
    .weiyu-detail-scroll { padding: 12px; }
    .weiyu-detail-post .item-card { padding: 18px; }
    .weiyu-detail-header { padding: 12px 14px; }
}

/* ==========================================
   頂部加載進度條（自 spa.js 行內遷移）
   ========================================== */
#weiyu-loading-bar {
    position: fixed; top: 0; left: 0; width: 100%; height: 3px;
    background: linear-gradient(90deg, #71E2D1 0%, #5fcfc0 50%, #71E2D1 100%);
    background-size: 200% 100%;
    z-index: 9999; transition: opacity 0.3s;
    opacity: 0; pointer-events: none;
    animation: loading-slide 1.5s ease-in-out infinite;
}
#weiyu-loading-bar.is-loading { opacity: 1; }
@keyframes loading-slide { 0% { background-position: 0% 0; } 50% { background-position: 100% 0; } 100% { background-position: 0% 0; } }

/* ==========================================
   支付方式選擇彈窗（自 spa.js 行內遷移）
   ========================================== */
#weiyu-pay-modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); display: flex; align-items: center; justify-content: center; z-index: 9999; }
.weiyu-pay-dialog { background: #fff; border-radius: 16px; padding: 28px; max-width: 340px; width: 90%; text-align: center; }
.weiyu-pay-dialog-title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.weiyu-pay-dialog-sub { color: #64748b; font-size: 13px; margin-bottom: 18px; }
.weiyu-pay-dialog-methods { display: flex; flex-direction: column; gap: 12px; }
.weiyu-pay-close { margin-top: 18px; background: none; border: none; color: #94a3b8; cursor: pointer; }

/* ==========================================
   卡片內聯編輯表單（自 spa.js 行內遷移）
   覆蓋 style.css 的 SSR 同名 .weiyu-edit-textarea 樣式
   ========================================== */
.weiyu-inline-edit-form { background: #f8fafc; border-radius: 12px; padding: 20px; margin-bottom: 16px; border: 2px solid #71E2D1; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.weiyu-inline-edit-form label { display: block; font-size: 13px; color: #64748b; margin-bottom: 5px; }
.weiyu-inline-edit-form .weiyu-edit-field { margin-bottom: 15px; }
.weiyu-inline-edit-form .weiyu-edit-textarea { width: 100%; min-height: 100px; padding: 12px; border: 1px solid #e2e8f0; border-radius: 8px; font-family: inherit; box-sizing: border-box; }
.weiyu-edit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px 14px; margin-bottom: 15px; }
.weiyu-edit-grid select { width: 100%; padding: 8px 12px; border-radius: 6px; border: 1px solid #e2e8f0; box-sizing: border-box; }
.weiyu-edit-paid-row { display: none; grid-template-columns: minmax(0, 1fr) minmax(140px, 220px); gap: 12px 14px; margin-bottom: 15px; }
.weiyu-edit-paid-row.is-visible { display: grid; }
.weiyu-inline-edit-form .weiyu-edit-password { width: 100%; padding: 8px 12px; border-radius: 6px; border: 1px solid #e2e8f0; box-sizing: border-box; }
.weiyu-edit-price-wrap { display: flex; align-items: center; gap: 6px; border: 2px solid #ddd6fe; border-radius: 10px; padding: 0 10px; background: #fff; }
.weiyu-edit-price-currency { font-size: 16px; font-weight: 600; color: #475569; }
.weiyu-edit-paid-price { flex: 1; min-width: 0; padding: 10px 0; border: none; outline: none; font-size: 15px; font-weight: 600; background: transparent; -moz-appearance: textfield; }
.weiyu-edit-price-unit { font-size: 13px; color: #94a3b8; }
.weiyu-inline-edit-form .weiyu-edit-tags { width: 100%; padding: 8px 12px; border-radius: 6px; border: 1px solid #e2e8f0; box-sizing: border-box; }
.weiyu-edit-cancel-btn { padding: 8px 20px; border: 1px solid #e2e8f0; border-radius: 6px; background: #fff; cursor: pointer; }
.weiyu-edit-save-btn { padding: 8px 20px; border: none; border-radius: 6px; background: linear-gradient(135deg, #71E2D1, #5fcfc0); color: #0e3d36; cursor: pointer; box-shadow: 0 2px 6px rgba(113, 226, 209, 0.3); transition: transform .15s, box-shadow .15s; }
.weiyu-edit-save-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(113, 226, 209, 0.45); }
/* .weiyu-edit-actions 直接復用 style.css 既有定義（值一致） */

/* ==========================================
   其他 JS 注入組件（自 spa.js 行內遷移）
   ========================================== */
.item-card .card-content { margin-bottom: 16px; font-size: 15.5px; line-height: 1.7; color: #334155; word-break: break-word; }
#weiyu-spa-search-clear { display: none; }
.empty-state > i { font-size: 48px; opacity: 0.5; margin-bottom: 10px; }
.comment-empty i { font-size: 24px; }
.weiyu-mention-item .weiyu-mention-user { display: flex; flex-direction: column; }
.weiyu-mention-item .weiyu-mention-name { font-weight: 500; color: #334155; }
.weiyu-mention-item .weiyu-mention-slug { font-size: 12px; color: #94a3b8; }
.weiyu-login-tip-title { font-weight: 600; }
.is-hidden { display: none !important; }
