/* ===== 顶栏注册 / 登录 ===== */
.nav-auth {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.75rem;
    flex-shrink: 0;
}
.nav-auth .auth-btn {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 0.85rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: all .2s ease;
}
.nav-auth .auth-btn-ghost {
    color: var(--text-light);
    border: 1px solid var(--border-color);
    background: var(--bg-color);
}
.nav-auth .auth-btn-ghost:hover {
    color: var(--primary-dark);
    border-color: var(--primary-color);
}
.nav-auth .auth-btn-primary {
    color: #fff;
    background: var(--primary-light);
    border: 1px solid var(--primary-light);
}
.nav-auth .auth-btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}
.nav-auth .auth-user {
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8125rem;
    color: var(--text-color);
    text-decoration: none;
}
.nav-auth .auth-user:hover { color: var(--primary-dark); }

@media (max-width: 900px) {
    .nav-auth { margin-left: 0.25rem; }
    .nav-auth .auth-user { display: none; }
    .nav-auth .auth-btn { padding: 0 0.6rem; font-size: 0.75rem; }
}

/* ===== 论坛模式分类列表 ===== */
.forum-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
    padding: 0.9rem 1.1rem;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}
.forum-toolbar .forum-tip {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-light);
    line-height: 1.6;
}
.forum-toolbar .forum-tip strong { color: var(--text-color); }
.forum-new-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    height: 34px;
    padding: 0 1rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    color: #fff;
    background: var(--primary-light);
    text-decoration: none;
    white-space: nowrap;
    transition: background .2s ease;
}
.forum-new-btn:hover { background: var(--primary-dark); color: #fff; }

/* 表格外层卡片框（与顶部提示条同款） */
.forum-table-wrap {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-color);
}
.forum-table-wrap .forum-table {
    border: none;
    border-radius: 0;
    margin: 0; /* 去掉主题表格默认的 1rem 外边距，避免竖线不到底 */
}

.forum-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-color);
}
.forum-table thead th {
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-lighter);
    text-transform: uppercase;
    padding: 0.7rem 1rem;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}
.forum-table tbody td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    font-size: 0.875rem;
    color: var(--text-light);
}
.forum-table tbody tr:last-child td { border-bottom: none; }
.forum-table tbody tr:hover { background: rgba(62, 175, 124, 0.05); }

.forum-row-main { display: block; line-height: 1.65; }
.forum-tag,
.forum-badge { vertical-align: middle; margin-right: 0.4rem; }
.forum-row-title {
    display: inline;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-color);
    text-decoration: none;
    line-height: 1.65;
}
.forum-row-title:hover { color: var(--primary-dark); }
.forum-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    font-size: 0.6875rem;
    line-height: 1.6;
    color: #fff;
    background: #e5484d;
    border-radius: 4px;
}
/* 帖子标签：BUG 红 / 交易 蓝 */
.forum-tag {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    font-size: 0.6875rem;
    line-height: 1.6;
    border-radius: 4px;
    border: 1px solid transparent;
    white-space: nowrap;
}
.forum-tag.is-bug {
    color: #d63b3b;
    background: rgba(214, 59, 59, 0.1);
    border-color: rgba(214, 59, 59, 0.28);
}
.forum-tag.is-trade {
    color: #2b6cb0;
    background: rgba(43, 108, 176, 0.1);
    border-color: rgba(43, 108, 176, 0.28);
}
.forum-row-author { white-space: nowrap; }
.forum-row-num { text-align: center; white-space: nowrap; width: 72px; }
.forum-row-time { white-space: nowrap; width: 110px; color: var(--text-lighter); font-size: 0.8125rem; }

@media (max-width: 768px) {
    .forum-table thead th:nth-child(2),
    .forum-table tbody td:nth-child(2),
    .forum-table thead th:nth-child(3),
    .forum-table tbody td:nth-child(3) { display: none; }
}

/* ===== 嵌套评论：一律左对齐，一层层往下排（不缩进、不溢出、深度再深也不变窄） ===== */
#comments .comment-item { flex-wrap: wrap; }
#comments .comment-content { flex: 1 1 0; min-width: 0; }
#comments .comment-list {
    margin-left: 0;
    padding-left: 0;
}
/* 子评论用负边距抵掉父级内边距，做到和父评论左边完全对齐、宽度一致 */
#comments .comment-children {
    flex: 0 0 auto;
    box-sizing: border-box;
    margin: 1.25rem 0 0 -1.5rem;
    width: calc(100% + 3rem);
    padding: 0;
}
#comments .comment-children .comment-children {
    margin-left: -0.9rem;
    width: calc(100% + 1.8rem);
}
#comments .comment-children .comment-item { padding: 0.9rem 1rem; margin-bottom: 0; }
#comments .comment-children .comment-children { margin-top: 0.7rem; }
/* 有下级的评论卡片底部不留大块空白，避免层层叠出空白条 */
#comments .comment-item:has(> .comment-children) { padding-bottom: 0.35rem; }

/* ===== 回复引用：显示被回复的是谁、原话淡化成引用条 ===== */
#comments .comment-quote {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    margin: 0.15rem 0 0.6rem;
    padding: 0.45rem 0.7rem;
    background: rgba(0, 0, 0, 0.035);
    border-left: 3px solid rgba(0, 0, 0, 0.12);
    border-radius: 6px;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-light, #8a9199);
    max-width: 100%;
    overflow: hidden;
}
#comments .comment-quote-author {
    flex: 0 0 auto;
    min-width: 0;
    max-width: 45%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    color: var(--primary-color, #3eaf7c);
    text-decoration: none;
}
#comments .comment-quote-author::before { content: "回复 "; color: var(--text-light, #8a9199); font-weight: 400; }
#comments .comment-quote-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 移动端评论卡片改成纵向排布，宽度按 100% 撑满，避免被内容撑出横向滚动条 */
@media (max-width: 768px) {
    #comments .comment-content { width: 100%; }
    #comments .comment-children,
    #comments .comment-children .comment-children { width: 100%; margin-left: 0; }
    #comments .comment-quote-text { white-space: normal; overflow: visible; }
}
/* 去掉核心多出来的一层 <ol class="comment-list">，避免每层多出一个空盒子 */
#comments .comment-children .comment-list { display: contents; }

/* ===== 前台发帖表单 ===== */
.post-form-wrap {
    max-width: 100%;
    padding: 1.5rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}
.post-form-wrap h2 {
    margin: 0 0 0.35rem;
    font-size: 1.125rem;
    color: var(--text-color);
}
.post-form-wrap .post-form-hint {
    margin: 0 0 1.25rem;
    font-size: 0.8125rem;
    color: var(--text-lighter);
    line-height: 1.7;
}
.post-form-field { margin-bottom: 1rem; }
.post-form-field label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.8125rem;
    color: var(--text-light);
}
.post-form-field input[type="text"],
.post-form-field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0.7rem 0.85rem;
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--text-color);
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.post-form-field textarea { min-height: 240px; resize: vertical; line-height: 1.75; }

/* 标签单选 */
.post-form-required { color: #d63b3b; }
.post-form-tags { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.post-form-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.8rem;
    font-size: 0.8125rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease;
}
.post-form-tag input[type="radio"] { margin: 0; accent-color: currentColor; }
.post-form-tag.is-bug { color: #d63b3b; }
.post-form-tag.is-bug:has(input:checked) {
    background: rgba(214, 59, 59, 0.08);
    border-color: rgba(214, 59, 59, 0.45);
}
.post-form-tag.is-trade { color: #2b6cb0; }
.post-form-tag.is-trade:has(input:checked) {
    background: rgba(43, 108, 176, 0.08);
    border-color: rgba(43, 108, 176, 0.45);
}
.post-form-tag-hint {
    margin: 0.45rem 0 0;
    font-size: 0.75rem;
    color: var(--text-lighter);
}
.post-form-field input:focus,
.post-form-field textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(62, 175, 124, 0.12);
}
.post-form-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.post-form-actions button {
    height: 36px;
    padding: 0 1.25rem;
    font-size: 0.875rem;
    color: #fff;
    background: var(--primary-light);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background .2s ease;
}
.post-form-actions button:hover { background: var(--primary-dark); }
.post-form-msg {
    margin: 0 0 1rem;
    padding: 0.7rem 0.9rem;
    font-size: 0.8125rem;
    line-height: 1.6;
    border-radius: 6px;
}
.post-form-msg.is-error { color: #c0392b; background: #fdf0ee; border: 1px solid #f6d0c9; }
.post-form-msg.is-ok { color: var(--primary-dark); background: rgba(62, 175, 124, 0.1); border: 1px solid rgba(62, 175, 124, 0.28); }
.post-form-login {
    text-align: center;
    padding: 2rem 1rem;
}
.post-form-login p { color: var(--text-light); font-size: 0.9375rem; margin-bottom: 1rem; }
.post-form-login a {
    display: inline-block;
    margin: 0 0.35rem;
    height: 36px;
    line-height: 36px;
    padding: 0 1.25rem;
    border-radius: 6px;
    font-size: 0.875rem;
    text-decoration: none;
    color: #fff;
    background: var(--primary-light);
}
.post-form-login a.is-ghost {
    color: var(--text-light);
    background: var(--bg-color);
    border: 1px solid var(--border-color);
}

/* ===== 顶部导航下拉菜单（窄屏：平板与手机统一收起） ===== */
@media (max-width: 1100px) {
    .nav-toggle {
        display: flex;
        margin-left: 0.25rem;
    }

    .nav-menu {
        display: none;
        position: fixed;
        top: calc(var(--header-height) + 0.45rem);
        right: 0.75rem;
        left: auto;
        width: 7.5em;
        max-width: calc(100vw - 1.5rem);
        align-items: stretch;
        background: var(--bg-color);
        border: 1px solid var(--border-color);
        border-radius: 10px;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
        padding: 0.3rem 0;
        overflow: hidden;
        z-index: 1200;
    }

    .nav-menu.open {
        display: block;
    }

    .nav-menu .nav-links {
        display: block;
        width: 100%;
    }

    .nav-menu .nav-links li {
        margin: 0;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-menu .nav-links li:last-child {
        border-bottom: 0;
    }

    .nav-menu .nav-links a {
        display: block;
        padding: 0.65rem 0.5rem;
        font-size: 0.9rem;
        text-align: center;
        border-bottom: 0;
        white-space: nowrap;
    }

    .nav-menu .nav-links a.active {
        color: var(--primary-color);
        font-weight: 600;
    }
}