/*
Theme Name: 木瓜主题
Theme URI: https://example.com/xxs
Author: XXS
Author URI: https://example.com
Description: 一款简洁的论坛社区风格WordPress主题，支持每日签到、帖子列表、用户中心等功能
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: xxs
Tags: forum, community, social, responsive
*/

:root {
    --primary: #4f8cff;
    --primary-light: #e8f0ff;
    --primary-dark: #3a6fd8;
    --text-dark: #333;
    --text-gray: #666;
    --text-light: #999;
    --border: #e5e9ef;
    --bg-gray: #f5f7fa;
    --bg-white: #fff;
    --success: #52c41a;
    --warning: #faad14;
    --danger: #ff4d4f;
    --radius: 12px;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--bg-gray);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-dark);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ========== Header ========== */
.site-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    height: 60px;
    gap: 30px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
}

.site-logo img {
    height: 32px;
}

.main-nav {
    display: flex;
    gap: 25px;
}

.main-nav a {
    color: var(--text-gray);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--primary);
}

.header-search {
    margin-left: auto;
    width: 280px;
    position: relative;
}

.header-search input {
    width: 100%;
    height: 36px;
    padding: 0 40px 0 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-gray);
    outline: none;
    transition: all 0.2s;
}

.header-search input:focus {
    border-color: var(--primary);
    background: var(--bg-white);
}

.header-search button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    color: var(--text-light);
    cursor: pointer;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-login-btn {
    color: var(--text-dark);
    font-size: 14px;
}

.header-login-btn:hover {
    color: var(--primary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 20px;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 140, 255, 0.4);
}

.btn-outline {
    background: var(--bg-white);
    border: 1px solid var(--border);
    color: var(--text-gray);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
}

/* User Dropdown */
.user-dropdown {
    position: relative;
}

.user-avatar-wrap {
    cursor: pointer;
}

.user-avatar-wrap .user-avatar {
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.user-dropdown:hover .user-avatar-wrap .user-avatar {
    border-color: var(--primary);
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    width: 280px;
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s;
    z-index: 1000;
    overflow: hidden;
}

.user-dropdown:hover .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 25px 20px;
    text-align: center;
    background: linear-gradient(135deg, #f8f9ff 0%, #fff 100%);
    border-bottom: 1px solid var(--border);
}

.dropdown-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 3px solid var(--bg-white);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.dropdown-name {
    margin-top: 12px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.goto-profile {
    color: var(--text-light);
    font-size: 18px;
}

.goto-profile:hover {
    color: var(--primary);
}

.dropdown-level {
    margin-top: 8px;
}

.dropdown-level .level-tag {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 12px;
    color: #fff;
}

.dropdown-stats {
    display: flex;
    padding: 15px 10px;
    border-bottom: 1px solid var(--border);
}

.dropdown-stats .stat-item {
    flex: 1;
    text-align: center;
}

.dropdown-stats .stat-num {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
}

.dropdown-stats .stat-label {
    font-size: 12px;
    color: var(--text-light);
}

.dropdown-menu-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 15px 10px;
}

.dropdown-menu-grid a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 5px;
    color: var(--text-gray);
    border-radius: 8px;
    transition: all 0.2s;
}

.dropdown-menu-grid a:hover {
    background: var(--bg-gray);
    color: var(--primary);
}

.dropdown-menu-grid a i {
    font-size: 22px;
    color: var(--primary);
}

.dropdown-menu-grid a span {
    font-size: 12px;
}

.dropdown-menu-grid a.logout i {
    color: var(--danger);
}

.dropdown-menu-grid a.logout:hover {
    color: var(--danger);
}

/* ========== Auth Modal ========== */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.auth-modal.active {
    display: flex;
}

.auth-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.auth-modal-content {
    position: relative;
    width: 400px;
    max-width: 90%;
    background: var(--bg-white);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.auth-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-gray);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    transition: all 0.2s;
    z-index: 10;
}

.auth-modal-close:hover {
    background: var(--danger);
    color: #fff;
}

.auth-form {
    padding: 40px 35px;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h2 {
    font-size: 24px;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-light);
    font-size: 14px;
}

.auth-form .form-group {
    position: relative;
    margin-bottom: 18px;
}

.auth-form .form-group label {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 18px;
    pointer-events: none;
}

.auth-form .form-group input {
    width: 100%;
    height: 50px;
    padding: 0 45px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.2s;
    background: var(--bg-gray);
}

.auth-form .form-group input:focus {
    border-color: var(--primary);
    background: var(--bg-white);
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.1);
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 5px;
}

.toggle-password:hover {
    color: var(--primary);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 13px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-gray);
    cursor: pointer;
}

.remember-me input {
    accent-color: var(--primary);
}

.forgot-password {
    color: var(--primary);
}

.btn-block {
    width: 100%;
    height: 48px;
    font-size: 15px;
    font-weight: 500;
}

.btn-loading {
    display: none;
}

.btn.loading .btn-text {
    display: none;
}

.btn.loading .btn-loading {
    display: inline-block;
}

.btn-loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.auth-error {
    margin-top: 15px;
    padding: 10px 15px;
    background: #fff2f0;
    border: 1px solid #ffccc7;
    border-radius: 8px;
    color: var(--danger);
    font-size: 13px;
    display: none;
}

.auth-error.show {
    display: block;
}

.auth-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-light);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 500;
}

/* ========== Main Layout ========== */
.site-main {
    padding: 20px 0;
}

.main-layout {
    display: grid;
    grid-template-columns: 200px 1fr 300px;
    gap: 20px;
}

/* ========== Sidebar Left ========== */
.sidebar-left {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 15px;
    height: fit-content;
    position: sticky;
    top: 80px;
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 5px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    border-radius: 8px;
    color: var(--text-gray);
    transition: all 0.2s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: var(--primary-light);
    color: var(--primary);
}

.sidebar-nav .icon {
    width: 20px;
    height: 20px;
}

/* ========== Content Area ========== */
.content-area {
    min-width: 0;
}

.card {
    background: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* ========== Sign In Card ========== */
.signin-card .card-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.signin-info h3 {
    font-size: 20px;
    margin-bottom: 5px;
}

.signin-info p {
    color: var(--text-light);
    font-size: 13px;
}

.btn-signin {
    background: linear-gradient(135deg, #52c41a, #389e0d);
    padding: 10px 25px;
}

/* ========== Banner ========== */
.banner-card img {
    width: 100%;
    height: auto;
    display: block;
}

/* ========== Notice ========== */
.notice-bar {
    background: var(--primary-light);
    padding: 12px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
}

.notice-bar .icon {
    flex-shrink: 0;
}

/* ========== Tabs ========== */
.tabs {
    display: flex;
    gap: 20px;
    padding: 0 20px;
    border-bottom: 1px solid var(--border);
}

.tab-item {
    padding: 15px 5px;
    color: var(--text-gray);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s;
}

.tab-item:hover,
.tab-item.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ========== Post List ========== */
.post-list {
    list-style: none;
}

.post-item {
    display: flex;
    gap: 15px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
    min-height: 70px;
    box-sizing: border-box;
}

.post-item:hover {
    background: var(--bg-gray);
}

.post-item:last-child {
    border-bottom: none;
}

.post-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    flex-shrink: 0;
}

.post-content {
    flex: 1;
    min-width: 0;
}

.post-title {
    font-size: 15px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.post-title a {
    color: #343a40;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-title a:hover {
    color: var(--primary);
}

.post-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    flex-shrink: 0;
}

.post-tag.official {
    background: var(--primary);
    color: #fff;
}

/* 置顶标签 */
.sticky-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    background: #ff4d4f;
    color: #fff;
    font-size: 11px;
    border-radius: 4px;
    flex-shrink: 0;
}

.sticky-tag i {
    font-size: 10px;
}



/* 文章元信息 */
.post-meta {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: var(--text-light);
    gap: 8px;
}

.post-category {
    padding: 2px 8px;
    background-color: #f8f9fa;
    color: #868e96cc;
    border-radius: 4px;
    font-size: 12px;
}

.post-meta-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 16px;
    color: #868e96cc;
}

.post-meta-right > span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

/* 文章列表分页 */
.widget-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid var(--border);
}

.widget-pagination .page-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.widget-pagination .page-btn:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.widget-pagination .page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.widget-pagination a.page-btn {
    color: var(--text-dark);
    text-decoration: none;
}

.widget-pagination a.page-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.widget-pagination a.page-num {
    color: var(--text-dark);
    text-decoration: none;
}

.widget-pagination .page-numbers {
    display: flex;
    align-items: center;
    gap: 5px;
}

.widget-pagination .page-num {
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.widget-pagination .page-num:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.widget-pagination .page-num.active {
    background: var(--primary);
    color: #fff;
}

.widget-pagination .page-dots {
    padding: 0 5px;
    color: var(--text-light);
}

.widget-pagination .page-jump {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: 10px;
}

.widget-pagination .page-jump input {
    width: 50px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 6px;
    text-align: center;
    font-size: 13px;
}

.widget-pagination .page-jump input:focus {
    outline: none;
    border-color: var(--primary);
}

.widget-pagination .jump-btn {
    height: 32px;
    padding: 0 12px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.widget-pagination .jump-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.post-tag.hot {
    background: var(--danger);
    color: #fff;
}

.post-tag.new {
    background: var(--success);
    color: #fff;
}

/* ========== Sidebar Right ========== */
.sidebar-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ========== Forum Info Card ========== */
.forum-info-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 20px;
}

.forum-header {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.forum-logo {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: var(--primary);
}

.forum-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
}

.forum-name .badge {
    display: inline-block;
    padding: 2px 6px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    border-radius: 4px;
    margin-left: 5px;
}

.forum-desc {
    font-size: 12px;
    color: var(--text-light);
    line-height: 1.8;
}

.forum-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 15px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin: 15px 0;
    text-align: center;
}

.stat-item .num {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
}

.stat-item .label {
    font-size: 12px;
    color: var(--text-light);
}

.forum-links {
    font-size: 12px;
    color: var(--text-light);
    line-height: 2;
}

/* ========== Daily Signin Widget ========== */
.signin-widget {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 20px;
}

.signin-widget .widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.signin-widget .widget-title {
    font-size: 16px;
    font-weight: 600;
}

.signin-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.signin-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--bg-gray);
    font-size: 12px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
}

.signin-day.signed {
    background: var(--primary-light);
    color: var(--primary);
}

.signin-day.today {
    background: var(--primary);
    color: #fff;
}

.signin-day .day-num {
    font-size: 14px;
    font-weight: 600;
}

/* ========== Ranking Widget ========== */
.ranking-widget {
    background: var(--bg-white);
    border-radius: var(--radius);
}

.ranking-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
}

.ranking-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    font-size: 14px;
    color: var(--text-gray);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.ranking-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.ranking-list {
    list-style: none;
    padding: 15px;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 13px;
}

.ranking-item .rank {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.ranking-item .rank.top1 { background: #ffd700; color: #fff; }
.ranking-item .rank.top2 { background: #c0c0c0; color: #fff; }
.ranking-item .rank.top3 { background: #cd7f32; color: #fff; }

.ranking-item .title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-dark);
}

/* ========== Sidebar User Card ========== */
.sidebar-user-card-img {
    display: block;
    position: relative;
    margin: 28px 0 0;
    text-decoration: none;
}

.sidebar-user-card-img .user-card-box {
    background: #e8f4fa;
    border-radius: 10px;
    padding: 38px 15px 15px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.sidebar-user-card-img .avatar {
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #fff;
    padding: 3px;
    box-shadow: 0 0 0 3px #52c41a;
}

.sidebar-user-card-img .name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.sidebar-user-card-img .meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 12px;
}

.sidebar-user-card-img .uid {
    color: var(--primary);
}

.sidebar-user-card-img .level {
    display: inline-block;
    padding: 1px 8px;
    font-size: 11px;
    border-radius: 3px;
    color: #fff;
}

/* 未登录样式 */
.sidebar-user-card-img.sidebar-guest .user-card-box {
    padding: 38px 15px 15px;
}

.sidebar-user-card-img.sidebar-guest .guest-avatar {
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #d5e5ee;
    box-shadow: 0 0 0 3px #52c41a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-user-card-img.sidebar-guest .guest-avatar i {
    font-size: 26px;
    color: #8fafc4;
}

.sidebar-user-card-img.sidebar-guest .name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
}

.sidebar-user-card-img.sidebar-guest .meta {
    color: var(--text-gray);
}

.sidebar-user-card-img.sidebar-guest .meta {
    color: var(--text-gray);
    text-shadow: none;
}

/* ========== Footer ========== */
.site-footer {
    padding: 40px 0 30px;
    margin-top: 40px;
}

.site-footer a {
    text-decoration: none;
    transition: opacity 0.2s;
}

/* 底部文字 */
.footer-description {
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 14px;
    line-height: 1.8;
    opacity: 0.8;
}

/* 多栏风格 */
.footer-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 20px;
}

.footer-col h4 {
    font-size: 16px;
    margin-bottom: 15px;
    color: inherit;
    opacity: 0.9;
}

.footer-col p {
    font-size: 13px;
    line-height: 1.6;
    opacity: 0.7;
}

.footer-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-menu li {
    margin-bottom: 8px;
}

.footer-menu a {
    font-size: 13px;
    opacity: 0.7;
}

.footer-menu a:hover {
    opacity: 1;
}

.footer-col .footer-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-col .footer-links a {
    font-size: 13px;
    opacity: 0.7;
}

.footer-social {
    display: flex;
    gap: 12px;
}

.footer-social a {
    font-size: 20px;
    opacity: 0.7;
}

.footer-social a:hover {
    opacity: 1;
}

/* 居中风格 */
.footer-centered {
    text-align: center;
    padding-bottom: 20px;
}

.footer-social-center {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.footer-social-center a {
    font-size: 24px;
    opacity: 0.7;
}

.footer-links-center {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-links-center a {
    font-size: 13px;
    opacity: 0.7;
}

/* 统计 */
.footer-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 15px 0;
    font-size: 13px;
    opacity: 0.7;
}

.footer-stats i {
    margin-right: 5px;
}

/* 自定义区域 */
.footer-custom {
    padding: 15px 0;
    text-align: center;
}

/* 底部信息 */
.footer-bottom {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 30px;
    padding-top: 15px;
}

.footer-bottom .footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.footer-bottom .footer-links a {
    font-size: 13px;
    opacity: 0.7;
}

.copyright {
    font-size: 13px;
    opacity: 0.7;
}

.copyright a {
    margin-left: 15px;
    opacity: 0.7;
}

@media (max-width: 768px) {
    .footer-columns {
        grid-template-columns: 1fr 1fr;
    }
    
    .footer-stats {
        flex-wrap: wrap;
        gap: 15px;
    }
}

/* ========== Responsive ========== */

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-gray);
    border-radius: 8px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-gray);
    transition: all 0.2s;
}

.mobile-menu-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* 移动端侧边栏遮罩 */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr 280px;
    }
    .mobile-menu-btn {
        display: flex;
    }
    .sidebar-left {
        position: fixed;
        top: 0;
        left: 0;
        width: 200px;
        height: 100vh;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        border-radius: 0;
    }
    .sidebar-left.mobile-open {
        transform: translateX(0);
    }
}

@media (max-width: 768px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
    .sidebar-right {
        display: none;
    }
    .main-nav {
        display: none;
    }
    .header-search {
        flex: 1;
    }
    
    /* 文章列表标题显示2行 */
    .post-title {
        flex-wrap: wrap;
    }
    .post-title a,
    .widget-posts .post-title a {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}


/* ========== Single Post Layout ========== */
.single-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    align-items: start;
}



/* ========== Post Main Content ========== */
.post-main-content {
    min-width: 0;
}

.post-article {
    margin-bottom: 20px;
}

.post-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.post-header .post-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.4;
    color: #4a5966;
}

.post-meta-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: var(--text-light);
}

.post-meta-info .author-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-dark);
}

.post-meta-info .mini-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.post-meta-info .meta-divider {
    color: var(--border);
}

.post-meta-info .post-meta-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.post-meta-info .edit-link {
    color: var(--primary);
}

.post-meta-info .edit-link:hover {
    text-decoration: underline;
}

.post-body {
    padding: 25px 20px;
    line-height: 1.8;
    font-size: 15px;
    color: var(--text-dark);
}

.post-body p {
    line-height: 1.7;
    font-size: 16px;
    color: #2f3e4c;
}

.post-body h1,
.post-body h2,
.post-body h3,
.post-body h4,
.post-body h5,
.post-body h6 {
    color: #4a5966;
}

.post-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    cursor: zoom-in;
    transition: opacity 0.2s;
}

.post-body img:hover {
    opacity: 0.9;
}

/* 图片放大弹窗 */
.image-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.image-lightbox.active {
    display: flex;
}

.image-lightbox img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.image-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.image-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.post-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
}

/* ========== Comments Section ========== */
.comments-section {
    margin-bottom: 20px;
}

.comments-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.comments-title {
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.comments-title i {
    color: var(--primary);
}

.comments-sort {
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 13px;
    outline: none;
}

.comments-list {
    padding: 0;
}

.comment-item {
    display: flex;
    gap: 15px;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.comment-content {
    flex: 1;
    min-width: 0;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 13px;
}

.comment-author {
    font-weight: 500;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.comment-time {
    color: var(--text-light);
}

.comment-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--text-light);
}

.comment-action {
    cursor: pointer;
    transition: color 0.2s;
}

.comment-action:hover {
    color: var(--primary);
}

.comment-floor {
    background: var(--bg-gray);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.comment-text {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-gray);
}

.comment-text p {
    margin: 0;
}

.no-comments {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-light);
}

.no-comments i {
    font-size: 48px;
    display: block;
    margin-bottom: 15px;
}

/* ========== Comment Form ========== */
.comment-form-wrapper {
    padding: 20px;
    border-top: 1px solid var(--border);
}

.comment-form-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.comment-form-header img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.comment-form textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.comment-form textarea:focus {
    border-color: var(--primary);
}

.comment-form-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
}

.login-to-comment {
    text-align: center;
    padding: 20px;
}

.comment-login-link {
    color: var(--primary);
    font-size: 14px;
}

.comment-login-link:hover {
    text-decoration: underline;
}

/* ========== Single Topbar (Breadcrumb + Back) ========== */
.single-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: var(--bg-white);
    border-radius: var(--radius);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-light);
    overflow: hidden;
}

.breadcrumb a {
    color: var(--text-light);
    white-space: nowrap;
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb .sep {
    color: var(--border);
}

.breadcrumb .current {
    color: var(--text-dark);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 300px;
}

.btn-block {
    display: flex;
    width: 100%;
    justify-content: center;
}

/* ========== Post Sidebar ========== */
.post-sidebar {
    position: sticky;
    top: 80px;
}

/* ========== Author Card ========== */
.author-card {
    overflow: hidden;
}

.author-cover {
    height: 80px;
    background: linear-gradient(135deg, var(--primary), #667eea);
}

.author-info {
    padding: 0 20px 20px;
    text-align: center;
    margin-top: -35px;
}

.author-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 3px solid var(--bg-white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.author-name {
    font-size: 16px;
    margin: 10px 0 5px;
}

.author-name a {
    color: var(--text-dark);
}

.author-meta {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 15px;
}

.author-meta .author-uid {
    margin-right: 10px;
}

.author-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
}

.author-actions .btn {
    flex: 1;
}

.author-stats {
    display: flex;
    justify-content: space-around;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

.author-stats .stat {
    text-align: center;
}

.author-stats .stat-label {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 5px;
}

.author-stats .stat-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
}

/* ========== Hot Posts List ========== */
.hot-posts-list {
    list-style: none;
    padding: 15px;
}

.hot-post-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.hot-post-item:last-child {
    border-bottom: none;
}

.hot-rank {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
    background: var(--bg-gray);
    color: var(--text-light);
}

.hot-rank.rank-1 { background: #ff4d4f; color: #fff; }
.hot-rank.rank-2 { background: #ff7a45; color: #fff; }
.hot-rank.rank-3 { background: #ffa940; color: #fff; }

.hot-title {
    font-size: 13px;
    color: var(--text-gray);
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.hot-title:hover {
    color: var(--primary);
}

/* ========== Button Sizes ========== */
.btn-sm {
    padding: 6px 15px;
    font-size: 13px;
}

/* ========== Responsive for Single ========== */
@media (max-width: 1024px) {
    .single-layout {
        grid-template-columns: 1fr;
    }
    .post-sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .post-header-actions {
        display: none;
    }
}


/* ========== Ranking Page ========== */
.ranking-page {
    overflow: hidden;
}

.ranking-tabs-header {
    display: flex;
    gap: 30px;
    padding: 20px 30px;
    border-bottom: 1px solid var(--border);
}

.ranking-tab-item {
    font-size: 14px;
    color: var(--text-gray);
    padding-bottom: 10px;
    border-bottom: 2px solid transparent;
    margin-bottom: -21px;
    transition: all 0.2s;
}

.ranking-tab-item:hover {
    color: var(--primary);
}

.ranking-tab-item.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 500;
}

.ranking-table-wrapper {
    overflow-x: auto;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

.ranking-table th {
    padding: 15px 20px;
    text-align: left;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-light);
    background: var(--bg-gray);
    border-bottom: 1px solid var(--border);
}

.ranking-table td {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-gray);
}

.ranking-table tbody tr:hover {
    background: var(--bg-gray);
}

.ranking-table .col-rank {
    width: 80px;
    text-align: center;
}

.ranking-table .col-user {
    min-width: 200px;
}

.ranking-table .col-num {
    width: 100px;
    text-align: center;
}

.ranking-table .rank-num {
    display: inline-block;
    min-width: 24px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
}

.ranking-table .rank-num.rank-1 {
    color: #ff4d4f;
    font-weight: 600;
}

.ranking-table .rank-num.rank-2 {
    color: #ff7a45;
    font-weight: 600;
}

.ranking-table .rank-num.rank-3 {
    color: #faad14;
    font-weight: 600;
}

.ranking-table .user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-dark);
}

.ranking-table .user-cell:hover {
    color: var(--primary);
}

.ranking-table .user-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ranking-table .user-name {
    font-weight: 500;
}

.ranking-table .empty-row {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}
/*  */
.ranking-table .empty-row i {
    font-size: 48px;
    display: block;
    margin-bottom: 15px;
}

/* Responsive */
@media (max-width: 768px) {
    .ranking-tabs-header {
        gap: 15px;
        padding: 15px 20px;
        overflow-x: auto;
    }
    
    .ranking-tab-item {
        white-space: nowrap;
    }
    
    .ranking-table th,
    .ranking-table td {
        padding: 12px 15px;
    }
}


/* ========== Discover Page ========== */
.discover-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
}

.discover-main {
    min-width: 0;
}

/* Top Grid - 三栏 */
.discover-top-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.discover-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
}

.discover-card-header {
    padding: 15px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.discover-card-header .header-dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
}

.discover-list {
    list-style: none;
    padding: 10px 0;
}

.discover-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    font-size: 13px;
    transition: background 0.2s;
}

.discover-list-item:hover {
    background: var(--bg-gray);
}

.discover-list-item .list-icon {
    color: var(--primary);
    font-size: 14px;
    flex-shrink: 0;
}

.discover-list-item .comment-mini-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}

.discover-list-item .comment-author {
    color: var(--primary);
    font-weight: 500;
    flex-shrink: 0;
}

.discover-list-item .list-title {
    flex: 1;
    color: var(--text-gray);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.discover-list-item .list-title:hover {
    color: var(--primary);
}

.discover-list-item .list-time {
    color: var(--text-light);
    font-size: 12px;
    flex-shrink: 0;
}

/* Active Users Section */
.active-users-section {
    margin-bottom: 20px;
}

.active-users-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 15px;
    padding: 20px;
}

.active-user-item {
    text-align: center;
}

.active-user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-bottom: 8px;
    border: 2px solid var(--border);
    transition: border-color 0.2s;
}

.active-user-item:hover .active-user-avatar {
    border-color: var(--primary);
}

.active-user-name {
    font-size: 13px;
    color: var(--text-dark);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.active-user-time {
    font-size: 11px;
    color: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

/* Forums Section */
.forums-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
}

.forum-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
}

.forum-item:nth-child(2n) {
    border-right: none;
}

.forum-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-light), #e0e7ff);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.forum-icon i {
    font-size: 24px;
    color: var(--primary);
}

.forum-info {
    flex: 1;
    min-width: 0;
}

.forum-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.forum-name a {
    color: var(--text-dark);
}

.forum-name a:hover {
    color: var(--primary);
}

.forum-badge {
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.forum-stats-row {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 5px;
    display: flex;
    gap: 15px;
}

.forum-desc {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.forum-moderator {
    font-size: 12px;
    color: var(--text-light);
}

.forum-moderator .moderator-name {
    color: var(--text-gray);
}

.forum-enter {
    padding: 6px 15px;
    background: var(--bg-gray);
    border-radius: 15px;
    font-size: 12px;
    color: var(--text-gray);
    align-self: center;
    transition: all 0.2s;
}

.forum-enter:hover {
    background: var(--primary);
    color: #fff;
}

.empty-forums {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px;
    color: var(--text-light);
}

.empty-forums i {
    font-size: 48px;
    display: block;
    margin-bottom: 15px;
}

/* Discover Sidebar */
.discover-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Stats Card */
.stats-card {
    padding: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    text-align: center;
}

.stats-grid .stat-item i {
    font-size: 20px;
    color: var(--primary);
    margin-bottom: 5px;
}

.stats-grid .stat-label {
    font-size: 11px;
    color: var(--text-light);
    margin-bottom: 3px;
}

.stats-grid .stat-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
}

/* Hot Forums List */
.hot-forums-list {
    padding: 10px 0;
}

.hot-forum-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    transition: background 0.2s;
}

.hot-forum-item:hover {
    background: var(--bg-gray);
}

.hot-forum-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-light), #e0e7ff);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hot-forum-icon i {
    font-size: 18px;
    color: var(--primary);
}

.hot-forum-info {
    flex: 1;
    min-width: 0;
}

.hot-forum-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.hot-forum-desc {
    font-size: 12px;
    color: var(--text-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hot-forum-count {
    color: var(--primary);
    font-size: 13px;
    font-weight: 500;
}

/* Mini Ranking */
.ranking-tabs-mini {
    display: flex;
    border-bottom: 1px solid var(--border);
}

.ranking-tab-mini {
    flex: 1;
    padding: 12px;
    text-align: center;
    font-size: 13px;
    color: var(--text-gray);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s;
}

.ranking-tab-mini:hover,
.ranking-tab-mini.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.mini-ranking-list {
    padding: 10px 0;
}

.mini-ranking-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
}

.mini-rank-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
}

.mini-rank-info {
    flex: 1;
    min-width: 0;
}

.mini-rank-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.mini-rank-points {
    font-size: 12px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 4px;
}

.mini-rank-badge {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}

.mini-rank-badge.rank-1 { background: #fff1f0; color: #ff4d4f; }
.mini-rank-badge.rank-2 { background: #fff7e6; color: #fa8c16; }
.mini-rank-badge.rank-3 { background: #fffbe6; color: #faad14; }
.mini-rank-badge.rank-4,
.mini-rank-badge.rank-5 { background: var(--bg-gray); color: var(--text-light); }

/* Responsive */
@media (max-width: 1200px) {
    .discover-top-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .discover-top-grid .discover-card:last-child {
        grid-column: 1 / -1;
    }
    .active-users-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1024px) {
    .discover-layout {
        grid-template-columns: 1fr;
    }
    .discover-sidebar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .discover-top-grid {
        grid-template-columns: 1fr;
    }
    .forums-grid {
        grid-template-columns: 1fr;
    }
    .forum-item {
        border-right: none;
    }
    .active-users-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .discover-sidebar {
        grid-template-columns: 1fr;
    }
}


/* ========== Home Layout ========== */
.home-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
}

/* 有左侧栏时，三栏布局 */
.home-layout:not(.no-left) {
    grid-template-columns: 200px 1fr 300px;
}

/* 无右侧栏时，单栏布局 */
.home-layout.no-right {
    grid-template-columns: 1fr;
}

/* 有左侧无右侧时 */
.home-layout:not(.no-left).no-right {
    grid-template-columns: 200px 1fr;
}

.home-left {
    position: sticky;
    top: 80px;
    height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    align-self: flex-start;
}

/* 只在移动端显示的左侧菜单 */
.home-left.mobile-only {
    display: none;
}

/* 桌面端根据后台设置隐藏 */
.home-left.desktop-hidden {
    display: none;
}

.home-left > .widget {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.home-center {
    min-width: 0;
}

.home-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ========== Quick Nav Widget ========== */
.widget-quick-nav {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.quick-nav-list {
    list-style: none;
    overflow-y: auto;
}

.widget-quick-nav .sidebar-user-card-img {
    flex-shrink: 0;
    margin-top: auto;
}

.quick-nav-list li {
    margin-bottom: 5px;
}

.quick-nav-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    border-radius: 8px;
    color: var(--text-gray);
    font-size: 14px;
    transition: all 0.2s;
}

.quick-nav-list a:hover,
.quick-nav-list a.active {
    background: var(--primary-light);
    color: var(--primary);
}

.quick-nav-list a i {
    font-size: 18px;
}

/* ========== Slider Widget ========== */
.widget-slider {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 20px;
    background: var(--bg-gray);
}

.slider-container {
    position: relative;
    width: 100%;
    height: 100%;
    touch-action: pan-y;
}

.slide-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.slide-item.active {
    opacity: 1;
    pointer-events: auto;
}

.slide-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.slide-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: var(--bg-gray);
    color: var(--text-light);
}

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    color: var(--text);
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.widget-slider:hover .slider-arrow {
    opacity: 1;
}

.slider-arrow:hover {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.slider-prev { left: 10px; }
.slider-next { right: 10px; }

.slider-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
}

.slider-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s;
}

.slider-dots .dot:hover,
.slider-dots .dot.active {
    background: #fff;
    transform: scale(1.2);
}

.slide-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px 15px 12px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}

/* ========== Notice Widget ========== */
.widget-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: var(--primary-light);
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.widget-notice .notice-icon {
    color: var(--primary);
    font-size: 18px;
}

.widget-notice .notice-content {
    flex: 1;
    font-size: 14px;
    color: var(--primary);
}

.widget-notice .notice-content a {
    color: var(--primary);
}

/* ========== User Widget ========== */
.widget-user {
    overflow: hidden;
}

.user-card-content {
    padding: 20px;
}

.user-card-content .user-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.user-card-content .user-avatar-lg {
    width: 60px;
    height: 60px;
    border-radius: 50%;
}

.user-card-content .user-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
}

.user-card-content .user-level {
    display: inline-block;
    padding: 3px 10px;
    font-size: 12px;
    border-radius: 10px;
}

.user-card-content .user-stats {
    display: flex;
    gap: 30px;
    padding: 15px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 15px;
}

.user-card-content .user-stats .stat {
    text-align: center;
}

.user-card-content .user-stats .num {
    display: block;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark);
}

.user-card-content .user-stats .label {
    font-size: 12px;
    color: var(--text-light);
}

.user-card-content .user-actions {
    display: flex;
    gap: 10px;
}

.user-card-content .user-actions .btn {
    flex: 1;
}

.login-prompt {
    padding: 30px 20px;
    text-align: center;
}

.login-prompt i {
    font-size: 48px;
    color: var(--text-light);
    margin-bottom: 10px;
}

.login-prompt p {
    color: var(--text-light);
    margin-bottom: 15px;
}

.login-prompt .login-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* ========== Signin Widget ========== */
.widget-signin .signin-done {
    color: var(--success);
    font-size: 13px;
}

.widget-signin .signin-body {
    padding: 15px;
}

.widget-signin .signin-tip {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 15px;
}

.widget-signin .signin-tip strong {
    color: var(--primary);
}

.widget-signin .signin-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.widget-signin .signin-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--bg-gray);
    font-size: 12px;
    color: var(--text-light);
}

.widget-signin .signin-day.signed {
    background: var(--primary-light);
    color: var(--primary);
}

.widget-signin .signin-day.today {
    background: var(--primary);
    color: #fff;
}

.widget-signin .signin-login-tip {
    text-align: center;
    padding: 20px;
}

.widget-signin .signin-login-tip i {
    font-size: 36px;
    color: var(--text-light);
    margin-bottom: 10px;
}

.widget-signin .signin-login-tip p {
    color: var(--text-light);
    margin-bottom: 15px;
}

/* ========== Responsive Home ========== */
@media (max-width: 1024px) {
    .home-layout,
    .home-layout:not(.no-left) {
        grid-template-columns: 1fr 280px;
    }
    .home-layout.no-right,
    .home-layout:not(.no-left).no-right {
        grid-template-columns: 1fr;
    }
    
    /* 左侧栏移动端样式 */
    .home-left,
    .home-left.desktop-hidden,
    .home-left.mobile-only {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        width: 220px;
        height: 100vh;
        z-index: 1000;
        background: var(--bg-white);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        border-radius: 0;
        padding-top: 60px;
        box-shadow: 2px 0 15px rgba(0,0,0,0.1);
    }
    
    .home-left.mobile-open {
        transform: translateX(0);
    }
    
    /* 防止滚动穿透 */
    body.sidebar-open {
        overflow: hidden;
    }
}

@media (max-width: 768px) {
    .home-layout,
    .home-layout:not(.no-left),
    .home-layout.no-right,
    .home-layout:not(.no-left).no-right {
        grid-template-columns: 1fr;
    }
    .home-right {
        display: none;
    }
}




.widget-posts .post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

.widget-posts .post-content {
    flex: 1;
    min-width: 0;
}

.widget-posts .post-title {
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 5px;
    line-height: 1.4;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.widget-posts .post-title a {
    color: var(--text-dark);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.widget-posts .post-title a:hover {
    color: var(--primary);
}

@media (max-width: 768px) {
    .widget-posts .post-title a {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}

.widget-posts .post-meta {
    font-size: 12px;
    color: var(--text-light);
    display: flex;
    gap: 10px;
}

/* Ranking Widget */
.widget-ranking .ranking-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget-ranking .ranking-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    border-bottom: 1px solid var(--border);
}

.widget-ranking .ranking-item:last-child {
    border-bottom: none;
}

.widget-ranking .rank {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    background: var(--bg-gray);
    color: var(--text-light);
    flex-shrink: 0;
}

.widget-ranking .rank.rank-1 { background: #ff4d4f; color: #fff; }
.widget-ranking .rank.rank-2 { background: #ff7a45; color: #fff; }
.widget-ranking .rank.rank-3 { background: #ffa940; color: #fff; }

.widget-ranking .title {
    flex: 1;
    font-size: 13px;
    color: var(--text-gray);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.widget-ranking .title:hover {
    color: var(--primary);
}


/* ========== Profile Edit Page ========== */
.profile-edit-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 20px;
    min-height: 500px;
}

.profile-edit-sidebar {
    height: fit-content;
    position: sticky;
    top: 80px;
}

.profile-sidebar-header {
    padding: 25px 20px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.profile-sidebar-header .profile-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-bottom: 10px;
}

.profile-sidebar-header .profile-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.profile-sidebar-header .profile-level {
    display: inline-block;
    padding: 3px 12px;
    font-size: 12px;
    border-radius: 15px;
}

.profile-nav {
    padding: 10px 0;
}

.profile-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-gray);
    font-size: 14px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.profile-nav-item:hover {
    background: var(--bg-gray);
    color: var(--primary);
}

.profile-nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 500;
}

.profile-nav-item i {
    font-size: 18px;
}

.profile-edit-content {
    min-width: 0;
}

.profile-form-body {
    padding: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.form-group .required {
    color: var(--danger);
}

.form-input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    font-family: inherit;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.1);
}

.form-input:disabled {
    background: var(--bg-gray);
    color: var(--text-light);
    cursor: not-allowed;
}

.form-input::placeholder {
    color: var(--text-light);
}

textarea.form-input {
    resize: vertical;
    min-height: 100px;
}

.form-hint {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 5px;
}

.form-actions {
    padding-top: 10px;
    border-top: 1px solid var(--border);
    margin-top: 25px;
}

.password-input-wrapper {
    position: relative;
}

.password-input-wrapper .form-input {
    padding-right: 45px;
}

.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 5px;
}

.toggle-password:hover {
    color: var(--primary);
}

/* Avatar Section */
.avatar-preview-section {
    display: flex;
    align-items: center;
    gap: 25px;
    padding: 20px;
    background: var(--bg-gray);
    border-radius: 12px;
    margin-bottom: 25px;
}

.current-avatar .avatar-preview-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--bg-white);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.avatar-info p {
    margin: 0 0 5px;
    font-size: 14px;
    color: var(--text-dark);
}

.avatar-options {
    display: grid;
    gap: 15px;
}

.avatar-option-card {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-white);
}

.avatar-option-card h4 {
    font-size: 14px;
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.avatar-option-card h4 i {
    color: var(--primary);
}

.avatar-option-card p {
    font-size: 13px;
    color: var(--text-gray);
    margin: 0;
}

.avatar-upload-area {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 15px;
}

.avatar-upload-area:hover,
.avatar-upload-area.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.avatar-upload-area i {
    font-size: 36px;
    color: var(--text-light);
    margin-bottom: 10px;
}

.avatar-upload-area p {
    font-size: 14px;
    color: var(--text-gray);
    margin: 0 0 5px;
}

.avatar-upload-area span {
    font-size: 12px;
    color: var(--text-light);
}

/* Alert Messages */
.alert {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.alert i {
    font-size: 18px;
}

.alert-success {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #52c41a;
}

.alert-error {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: #ff4d4f;
}

/* Responsive */
@media (max-width: 768px) {
    .profile-edit-layout {
        grid-template-columns: 1fr;
    }
    
    .profile-edit-sidebar {
        position: static;
    }
    
    .profile-sidebar-header {
        display: flex;
        align-items: center;
        gap: 15px;
        text-align: left;
        padding: 15px 20px;
    }
    
    .profile-sidebar-header .profile-avatar {
        margin-bottom: 0;
    }
    
    .profile-nav {
        display: flex;
        overflow-x: auto;
        padding: 0;
        border-top: 1px solid var(--border);
    }
    
    .profile-nav-item {
        flex-shrink: 0;
        border-left: none;
        border-bottom: 3px solid transparent;
        padding: 12px 15px;
    }
    
    .profile-nav-item.active {
        border-left-color: transparent;
        border-bottom-color: var(--primary);
    }
    
    .avatar-preview-section {
        flex-direction: column;
        text-align: center;
    }
}


/* Avatar Upload Fix */
.avatar-upload-area {
    position: relative;
}

.avatar-upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.avatar-upload-area.has-file {
    border-color: var(--success);
    background: #f6ffed;
}

.avatar-upload-area.has-file i {
    color: var(--success);
}


/* Loading Animation */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}


/* ========== Single Page Widgets ========== */
.single-widgets {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.single-widgets .widget {
    margin-bottom: 0;
}

/* 确保文章页小工具有正确的卡片样式 */
.post-sidebar .widget-slider,
.post-sidebar .widget-notice {
    background: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
}
