/* ============================================================
 * framework-bbs.css - BBS中间区域独立样式（由 framework.css 拆分）
 * 页面: bbs 板块/标签卡片/标签详情
 * 加载顺序: 本文件应在 framework.css 之前加载
 * ============================================================ */

/* ===== 盒子功能 · xiuno 风格标签卡片网格 ===== */
.fy-bbs-tabs {
    display: flex;
    align-items: center;
    gap: 24px;
    border-bottom: 1px solid var(--fy-border);
    margin-bottom: 18px;
    padding-bottom: 0;
}

.fy-bbs-tab {
    position: relative;
    padding: 10px 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--fy-text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.fy-bbs-tab:hover {
    color: var(--fy-text-primary);
}

.fy-bbs-tab.fy-active {
    color: var(--fy-text-primary);
}

.fy-bbs-tab.fy-active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: var(--fy-active);
    border-radius: 2px;
    animation: fy-bbs-tab-slide .32s cubic-bezier(.22,.61,.36,1) both;
}

.fy-post.fy-post-no-detail {
    cursor: default;
}

.fy-post.fy-post-no-detail:hover {
    transform: none;
    border-color: var(--fy-border);
    box-shadow: none;
}

@keyframes fy-bbs-tab-slide {
    from { transform: scaleX(0); opacity: .35; transform-origin: left center; }
    to { transform: scaleX(1); opacity: 1; transform-origin: left center; }
}

.fy-bbs-tabs-actions {
    margin-left: auto;
    padding-bottom: 8px;
}

/* 插件板块不显示论坛 Tab，发布按钮仍固定在内容区右上角。 */
.fy-bbs-tabs-plugin { justify-content: flex-end; border-bottom: 0; margin-bottom: 10px; }
.fy-bbs-tabs-plugin .fy-bbs-tabs-actions { padding-bottom: 0; }

/* 标签卡片网格 */
.fy-bbs-tag-grid {
    display: grid;
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

@media (max-width: 1200px) {
    .fy-bbs-tag-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .fy-bbs-tag-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .fy-bbs-tag-grid { grid-template-columns: 1fr; }
}


/* ===== Witcher 风格标签卡片（Uiverse.io by santhosh_2608） ===== */
.fy-bbs-tag-card {
    --wc-bg-dark: var(--fy-bg-card);
    --wc-bg-light: var(--fy-bg-primary);
    --wc-silver: var(--fy-text-primary);
    --wc-silver-dark: var(--fy-border);
    --wc-gold: var(--fy-active);
    --wc-magic-aura: rgba(255, 255, 255, 0.08);
    position: relative;
    background-color: var(--fy-bg-card);
    border: 2px solid var(--fy-border);
    color: var(--fy-text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 18px 14px 14px;
    box-sizing: border-box;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s;
    background-image:
        radial-gradient(circle at 50% 25%, var(--fy-bg-primary), var(--fy-bg-card) 70%),
        repeating-linear-gradient(45deg, rgba(0,0,0,0.03) 0, rgba(0,0,0,0.03) 2px, transparent 2px, transparent 4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 12px;
    min-height: 200px;
    z-index: 1;
}

/* 魔法光环（hover 时显示） */
.fy-bbs-tag-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle at 50% 40%, var(--wc-magic-aura) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 0;
    pointer-events: none;
}

/* 四角装饰 */
.fy-bbs-tag-corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid var(--fy-active);
    transition: all 0.4s ease;
    opacity: 0.5;
    z-index: 1;
}
.fy-bbs-tag-corner.top-left { top: 6px; left: 6px; border-right: none; border-bottom: none; }
.fy-bbs-tag-corner.top-right { top: 6px; right: 6px; border-left: none; border-bottom: none; }
.fy-bbs-tag-corner.bottom-left { bottom: 6px; left: 6px; border-right: none; border-top: none; }
.fy-bbs-tag-corner.bottom-right { bottom: 6px; right: 6px; border-left: none; border-top: none; }

/* 内容区 */
.fy-bbs-tag-content {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}

/* 标题 */
.fy-bbs-tag-title {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 14px;
    font-weight: 700;
    color: var(--fy-text-primary);
    border-bottom: 1px solid var(--fy-border);
    padding-bottom: 8px;
    width: 100%;
    text-align: center;
}

.fy-bbs-tag-hash {
    font-size: 16px;
    font-weight: 800;
}

/* 中间大数字（主题数） */
.fy-bbs-tag-icon {
    width: 70px;
    height: 70px;
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.6));
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fy-bbs-tag-count-num {
    font-size: 30px;
    font-weight: 800;
    color: var(--fy-text-primary);
    line-height: 1;
    transition: color 0.3s ease;
}

.fy-bbs-tag-count-label {
    font-size: 10px;
    color: var(--fy-text-secondary);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-top: 4px;
}

/* 底部详情区 */
.fy-bbs-tag-details {
    margin-top: auto;
    width: 100%;
    font-size: 12px;
    color: var(--fy-text-secondary);
    text-align: center;
    line-height: 1.6;
}

.fy-bbs-tag-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--fy-border);
    padding: 6px 0;
    gap: 8px;
}

.fy-bbs-tag-stat span:first-child {
    color: var(--fy-text-secondary);
    flex-shrink: 0;
}

.fy-bbs-tag-stat span:last-child,
.fy-bbs-tag-latest-title {
    color: var(--fy-text-primary);
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60%;
    text-decoration: none;
    font-size: 12px;
}

.fy-bbs-tag-latest-title:hover {
    color: var(--fy-active);
}

/* 按钮区 */
.fy-bbs-tag-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

/* 关注按钮 */
.fy-bbs-follow-btn {
    cursor: pointer;
    border: 1px solid var(--fy-active);
    background: transparent;
    color: var(--fy-active);
    transition: all 0.2s;
}

.fy-bbs-follow-btn:hover {
    background: var(--fy-active);
    color: #fff;
}

.fy-bbs-follow-btn.fy-followed {
    background: var(--fy-active);
    color: #fff;
    border-color: var(--fy-active);
}

.fy-bbs-follow-btn.fy-followed:hover {
    background: transparent;
    color: var(--fy-active);
}

.fy-bbs-follow-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 关注列表空状态 */
.fy-bbs-empty-follow {
    text-align: center;
    padding: 40px 20px;
    background: var(--fy-bg-card);
    border: 1px solid var(--fy-border);
    border-radius: 12px;
    color: var(--fy-text-secondary);
    margin-bottom: 24px;
}

.fy-bbs-empty-follow .fy-icon {
    color: var(--fy-active);
}

.fy-bbs-tag-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
    letter-spacing: 0.05em;
}

.fy-bbs-tag-btn-outline {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--wc-silver-dark);
    color: var(--wc-silver);
}

.fy-bbs-tag-btn-outline:hover {
    border-color: var(--wc-gold);
    color: var(--wc-gold);
}

.fy-bbs-tag-btn-solid {
    background: transparent;
    border: 1px solid;
}

.fy-bbs-tag-btn-solid:hover {
    opacity: 0.8;
    background: rgba(255,255,255,0.05);
}

/* hover 效果 */
.fy-bbs-tag-card:hover {
    transform: translateY(-6px);
    border-color: var(--fy-active);
    box-shadow: 0 12px 28px rgba(0,0,0,0.2), 0 0 16px var(--fy-active-glow, rgba(108,92,231,0.15));
}

.fy-bbs-tag-card:hover::before {
    opacity: 1;
}

.fy-bbs-tag-card:hover .fy-bbs-tag-corner {
    width: 88%;
    height: 88%;
    opacity: 1;
    border-color: var(--fy-active);
}

.fy-bbs-tag-card:hover .fy-bbs-tag-icon {
    transform: scale(1.08);
    animation: tagHum 0.1s infinite alternate;
}

.fy-bbs-tag-card:hover .fy-bbs-tag-count-num {
    color: var(--fy-active);
    text-shadow: 0 0 8px var(--fy-active-glow, rgba(108,92,231,0.3));
}

.fy-bbs-tag-card:hover .fy-bbs-tag-title {
    color: var(--fy-active);
    text-shadow: 0 0 8px var(--fy-active-glow, rgba(108,92,231,0.3));
}

.fy-bbs-tag-card.fy-active {
    border-color: var(--fy-active);
    box-shadow: 0 0 0 1px var(--fy-active), 0 0 12px var(--fy-active-glow, rgba(108,92,231,0.15));
}

@keyframes tagHum {
    0% { transform: scale(1.1) translate(0, 0); }
    100% { transform: scale(1.1) translate(1px, 1px); }
}


/* ===== 标签详情页 ===== */
.fy-bbs-page-topbar {
    display: flex;
    align-items: center;
    margin-bottom: 14px;
}
.fy-bbs-tag-avatar { position:absolute; top:0; right:0; width:42px; height:42px; border-radius:12px; object-fit:cover; display:grid; place-items:center; color:var(--fy-active); background:color-mix(in srgb,var(--fy-active) 14%,var(--fy-bg-primary)); font-size:20px; overflow:hidden; }
.fy-bbs-tag-avatar.fy-bbs-type-emoji { line-height:1; }
.fy-bbs-tag-placeholder { color:var(--fy-active); }

.fy-bbs-detail-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.fy-bbs-detail-topbar .fy-bbs-back-btn { margin-bottom: 0 !important; }

.fy-bbs-detail-label {
    color: var(--fy-text-secondary);
    font-size: 13px;
    font-weight: 600;
}

/* 系统默认帖子详情：标题、正文与回复区采用论坛阅读布局 */
.fy-bbs-detail {
    padding: 0;
    overflow: hidden;
}

.fy-bbs-detail-head {
    padding: 24px 26px 20px;
    border-bottom: 1px solid var(--fy-border);
    background: linear-gradient(145deg, var(--fy-bg-card), var(--fy-bg-soft, var(--fy-bg-card)));
}
.fy-bbs-detail-head-row { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; margin-bottom: 12px; }

.fy-bbs-detail-category {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
    width: 100%;
    margin-left: 0;
    margin-bottom: 0;
    color: var(--fy-active);
    font-size: 13px;
    font-weight: 700;
}
.fy-bbs-detail-head-row .fy-detail-admin-actions { margin-top: 0; justify-content: flex-end; }

.fy-bbs-detail-title {
    margin: 0;
    color: var(--fy-text-primary);
    font-size: clamp(22px, 3vw, 32px);
    line-height: 1.35;
    letter-spacing: -.02em;
    word-break: break-word;
}

.fy-bbs-detail-meta,
.fy-bbs-detail-stats {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    color: var(--fy-text-secondary);
    font-size: 13px;
}

.fy-bbs-detail-meta { margin-top: 13px; }
.fy-bbs-detail-meta > .fy-detail-admin-actions { margin-top: 0; margin-left: auto; justify-content: flex-end; }
.fy-bbs-detail-stats { margin-top: 16px; gap: 18px; }
.fy-bbs-detail-stats span { display: inline-flex; align-items: center; gap: 5px; }
.fy-bbs-detail-stats .fy-icon { color: var(--fy-active); }
.fy-bbs-detail > .fy-post-text { padding: 26px; }

.fy-bbs-share {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 26px 24px;
    padding: 12px 14px;
    border: 1px dashed var(--fy-border-strong, var(--fy-border));
    border-radius: 10px;
    background: var(--fy-bg-soft, rgba(127,127,127,.06));
    color: var(--fy-text-secondary);
    font-size: 13px;
}
.fy-bbs-share-label { font-weight: 700; color: var(--fy-text-primary); }
.fy-bbs-share code { min-width: 0; overflow-wrap: anywhere; color: var(--fy-active); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.fy-comments-card {
    margin-top: 18px;
    padding: 22px 26px 26px;
}
.fy-comments-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 18px;
}
.fy-comments-head h2 { margin: 0; color: var(--fy-text-primary); font-size: 20px; }
.fy-comments-head span { margin-left: 8px; color: var(--fy-text-secondary); font-size: 13px; }
.fy-comment-notice {
    margin-bottom: 14px;
    padding: 10px 12px;
    border: 1px solid rgba(39,174,96,.25);
    border-radius: 8px;
    background: rgba(39,174,96,.08);
    color: var(--fy-success, #27ae60);
    font-size: 13px;
}
.fy-comment-notice-error { border-color: rgba(231,76,60,.25); background: rgba(231,76,60,.08); color: var(--fy-danger, #e74c3c); }
.fy-comment-form textarea {
    display: block;
    width: 100%;
    min-height: 104px;
    resize: vertical;
    box-sizing: border-box;
    padding: 13px 14px;
    border: 1px solid var(--fy-border);
    border-radius: 10px;
    outline: none;
    background: var(--fy-bg-soft, rgba(127,127,127,.06));
    color: var(--fy-text-primary);
    font: inherit;
    line-height: 1.65;
    transition: border-color .2s, box-shadow .2s;
}
.fy-comment-form textarea:focus { border-color: var(--fy-active); box-shadow: 0 0 0 3px var(--fy-active-glow, rgba(108,92,231,.15)); }
.fy-comment-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; color: var(--fy-text-secondary); font-size: 12px; }
.fy-comment-login,
.fy-comment-empty { padding: 16px; border-radius: 10px; background: var(--fy-bg-soft, rgba(127,127,127,.06)); color: var(--fy-text-secondary); font-size: 13px; text-align: center; }
.fy-comment-login a { color: var(--fy-active); font-weight: 700; text-decoration: none; }
.fy-comments-list { margin-top: 22px; border-top: 1px solid var(--fy-border); }
.fy-comment-item { display: flex; gap: 12px; padding: 18px 0; border-bottom: 1px solid var(--fy-border); }
.fy-comment-item:last-child { border-bottom: 0; padding-bottom: 0; }
.fy-comment-avatar { display: grid; flex: 0 0 36px; width: 36px; height: 36px; place-items: center; border-radius: 50%; background: var(--fy-active); color: #fff; font-size: 15px; font-weight: 700; }
.fy-comment-body { min-width: 0; flex: 1; }
.fy-comment-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--fy-text-secondary); font-size: 12px; }
.fy-comment-meta strong { color: var(--fy-text-primary); font-size: 13px; }
.fy-admin-comment .fy-comment-avatar { background:#d97706; }
.fy-admin-comment .fy-comment-meta strong { color:#b45309; }
.fy-comment-meta em { padding: 2px 6px; border-radius: 4px; background: var(--fy-active); color: #fff; font-size: 10px; font-style: normal; }
.fy-comment-meta time { margin-left: auto; }
.fy-comment-content { margin-top: 7px; color: var(--fy-text-primary); font-size: 14px; line-height: 1.75; overflow-wrap: anywhere; }

.fy-bbs-cat-detail {
    margin-bottom: 20px;
}

.fy-bbs-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    background: var(--fy-bg-card);
    border: 1px solid var(--fy-border);
    color: var(--fy-text-secondary);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    margin-bottom: 14px;
    transition: all 0.2s;
}

.fy-bbs-back-btn:hover {
    border-color: var(--fy-active);
    color: var(--fy-active);
}

.fy-bbs-cat-info {
    display:grid;
    grid-template-columns:auto minmax(0,1fr);
    align-items:center;
    gap:14px;
    padding: 20px 24px;
    border-radius: 12px;
    background: var(--fy-bg-card);
    border: 1px solid var(--fy-border);
}

.fy-bbs-cat-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--fy-text-primary);
    margin-bottom: 10px;
}

.fy-bbs-cat-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--fy-text-secondary);
}

.fy-bbs-cat-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* 帖子流头部 */
.fy-bbs-feed-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.fy-bbs-feed-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--fy-text-primary);
}

.fy-bbs-feed-tabs {
    display: flex;
    gap: 4px;
}

.fy-bbs-feed-tab {
    padding: 5px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--fy-text-secondary);
    text-decoration: none;
    transition: all 0.2s;
}

.fy-bbs-feed-tab:hover {
    background: var(--fy-hover);
    color: var(--fy-text-primary);
}

.fy-bbs-feed-tab.fy-active {
    background: var(--fy-active);
    color: #fff;
}

/* ===== 关注按钮固定到标签卡片左上角 ===== */
.fy-bbs-tag-card .fy-bbs-tag-follow-btn {
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    right: auto !important;
    bottom: auto !important;
    z-index: 6 !important;
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    padding: 0 !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    font-size: 18px !important;
    line-height: 1 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.25) !important;
}

/* ===== 图标放卡片左上角，关注按钮放右上角（对调分开，避免遮挡） ===== */
.fy-bbs-tag-card .fy-bbs-tag-avatar {
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    right: auto !important;
    z-index: 5 !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    border-radius: 10px !important;
    display: grid !important;
    place-items: center !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.22) !important;
}
.fy-bbs-tag-card .fy-bbs-tag-follow-btn {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    left: auto !important;
    bottom: auto !important;
    z-index: 6 !important;
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    padding: 0 !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    font-size: 18px !important;
    line-height: 1 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.25) !important;
}
/* ===== 关注/取消关注 轻提示（屏幕中下方约1/5处） ===== */
.fy-follow-toast {
    position: fixed;
    left: 50%;
    bottom: 15%;
    transform: translate(-50%, 14px);
    z-index: 99999;
    padding: 10px 24px;
    border-radius: 8px;
    color: #fff;
    background: rgba(15,18,26,.92);
    border: 1px solid var(--fy-active);
    box-shadow: 0 10px 28px rgba(0,0,0,.35);
    font-size: 14px;
    letter-spacing: .04em;
    opacity: 0;
    pointer-events: none;
    transition: opacity .28s ease, transform .28s ease;
}
.fy-follow-toast-show { opacity: 1; transform: translate(-50%, 0); }

body .fy-detail-admin-actions { display:inline-flex; gap:6px; margin-left:auto; }
body .fy-detail-actions { display:flex; gap:10px; flex-wrap:wrap; margin:18px 0 4px; }
body .fy-detail-action { display:inline-flex; align-items:center; gap:6px; padding:9px 16px; font-size:13px; color:#c7d3e0; background:rgba(6,10,18,.7); border:1px solid #2a3a4f; cursor:pointer; clip-path:polygon(7px 0,100% 0,100% calc(100% - 7px),calc(100% - 7px) 100%,0 100%,0 7px); transition:.18s; }
body .fy-detail-action:hover { border-color:#00f0ff; color:#00f0ff; }
body .fy-detail-action.is-on { color:#0a0c12; background:linear-gradient(135deg,#fce300,#ffb300); border-color:transparent; }
body .fy-comment-actions { display:inline-flex; align-items:center; gap:10px; margin-top:6px; }
body .fy-comment-delete-btn { background:transparent; border:0; padding:0; color:#7c8aa0; font-size:12px; cursor:pointer; }
body .fy-comment-delete-btn:hover { color:#ff2b6d; }
[data-theme="light"] body .fy-detail-action { color:#1c2537; background:#ffffff; border-color:#b6c2d4; }
[data-theme="light"] body .fy-detail-action:hover { border-color:#00a8c8; color:#0088cc; }
[data-theme="light"] body .fy-comment-delete-btn { color:#8a94a6; }
[data-theme="light"] body .fy-comment-delete-btn:hover { color:#d63384; }
