/* --- 基础变量定义 --- */
:root {
    /* 核心主色 - 声声绿 */
    --primary: #14b8a6;       /* Teal-500 */
    --primary-hover: #0d9488; /* Teal-600 */
    --primary-light: #ccfbf1; /* Teal-100 */
    --primary-fade: #f0fdfa;  /* Teal-50 */
    --primary-rgb: 13, 148, 136; /* RGB用于阴影 */

    /* 辅助色 */
    --text-main: #1f2937;     /* 深灰黑 */
    --text-sub: #6b7280;      /* 浅灰 */
    --bg-body: #f3f4f6;       /* 整体背景灰 */
    --white: #ffffff;

    /* 状态色 */
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
    --vip-gold: #f59e0b;

    /* 布局尺寸 */
    --sidebar-width: 240px;
    --content-padding: 32px;
    --header-height: 64px;
    --radius-md: 8px;
    --radius-sm: 4px;            /* 小圆角 */
    --radius-lg: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif; background-color: var(--bg-body); color: var(--text-main); font-size: 14px; }
a { text-decoration: none; color: inherit; }

/* --- 布局容器 --- */
.app-container { display: flex; min-height: 100vh; }

/* --- 左侧侧边栏 --- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--white);
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.logo-area {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    font-size: 18px;
    font-weight: bold;
    color: var(--primary);
    border-bottom: 1px solid #f3f4f6;
    white-space: nowrap;
    overflow: hidden;
}
.logo-area i { margin-right: 10px; font-size: 24px; }

.nav-menu { flex: 1; padding: 16px 12px; overflow-y: auto; }
.nav-divider { font-size: 12px; color: #9ca3af; padding: 16px 12px 8px; font-weight: 500; }

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-sub);
    margin-bottom: 4px;
    transition: all 0.2s;
}
.nav-item i { font-size: 18px; margin-right: 12px; }
.nav-item:hover { background-color: var(--bg-body); color: var(--text-main); }
.nav-item.active {
    background-color: var(--primary-fade);
    color: var(--primary);
    font-weight: 600;
}
.badge-hot {
    background: var(--danger); color: #fff; font-size: 10px;
    padding: 2px 6px; border-radius: 10px; margin-left: auto;
}

.sidebar-footer { padding: 16px; border-top: 1px solid #f3f4f6; }
.user-mini-profile { display: flex; align-items: center; gap: 10px; }
.user-mini-profile img { width: 36px; height: 36px; border-radius: 50%; }
.user-mini-profile .name { font-weight: bold; font-size: 13px; }
.user-mini-profile .status { font-size: 11px; color: var(--success); }

/* --- 主内容区 --- */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-x: hidden;
}

/* 顶部 Header */
/* --- 顶栏重构样式 --- */
.top-header {
    height: var(--header-height);
    background: #fff;
    padding: 0 var(--content-padding);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #f1f5f9;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px; /* 图标组间距 */
}

/* 每一个功能项的样式 */
.header-action-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-sub);
}

.header-action-item:hover {
    background-color: var(--primary-fade);
    color: var(--primary);
}

.header-action-item .action-label {
    font-size: 13px;
    font-weight: 500;
}

.header-action-item .icon-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    position: relative;
}

/* 红点样式 */
.badge-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background-color: var(--danger);
    border: 2px solid #fff;
    border-radius: 50%;
}

/* --- 消息下拉框样式 --- */
.msg-dropdown {
    display: none; /* 默认隐藏 */
    position: absolute;
    top: 50px;
    right: 0;
    width: 320px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
    z-index: 1000;
    overflow: hidden;
}

.dropdown-header {
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: bold;
    color: var(--text-main);
}
.dropdown-header a { color: var(--primary); font-weight: normal; }

.dropdown-body { max-height: 360px; overflow-y: auto; }

.msg-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid #f8fafc;
    transition: background 0.2s;
}
.msg-item:hover { background: #f9fafb; }
.msg-item.unread { background: #fffcf5; } /* 未读消息背景色微调 */

.msg-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.msg-icon.warning { background: #fff7ed; color: #f97316; }
.msg-icon.info { background: #f0f9ff; color: #0ea5e9; }

.msg-content { flex: 1; }
.msg-title { font-size: 13px; font-weight: bold; margin-bottom: 4px; color: var(--text-main); }
.msg-text { font-size: 12px; color: var(--text-sub); line-height: 1.4; margin-bottom: 6px; }
.msg-time { font-size: 11px; color: #94a3b8; }

.dropdown-footer {
    display: block;
    text-align: center;
    padding: 12px;
    font-size: 12px;
    color: var(--text-sub);
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
}
.dropdown-footer:hover { color: var(--primary); }
.greeting { font-size: 16px; font-weight: 600; }
.icon-btn {
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; cursor: pointer; color: var(--text-sub); position: relative;
}
.icon-btn:hover { background-color: var(--bg-body); }
.badge-dot {
    width: 8px; height: 8px; background: var(--danger); border-radius: 50%;
    position: absolute; top: 6px; right: 6px; border: 1px solid #fff;
}

/* 内容容器 */
.content-body { padding: 24px var(--content-padding); max-width: 100%; width: 100%; }

/* --- 通用组件 --- */
.btn {
    padding: 8px 16px; border-radius: 6px; font-size: 13px; cursor: pointer; border: none; font-weight: 500; transition: 0.2s;
    display: inline-flex; align-items: center; justify-content: center;
}
.btn-sm { padding: 4px 12px; font-size: 12px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline-primary { border: 1px solid var(--primary); color: var(--primary); background: transparent; }
.btn-outline-primary:hover { background: var(--primary-fade); }
.btn-outline-danger { border: 1px solid var(--danger); color: var(--danger); background: #fff; }
.btn-outline-danger:hover { background: #fef2f2; }
.btn-outline-warning { border: 1px solid var(--warning); color: var(--warning); background: #fff; }
.btn-text { background: transparent; color: var(--text-sub); }
.btn-text:hover { color: var(--primary); }
.btn-white { background: #fff; color: var(--text-main); font-weight: bold; }

.card { background: #fff; border-radius: var(--radius-lg); padding: 20px; box-shadow: 0 1px 2px rgba(0,0,0,0.05); margin-bottom: 24px; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.card-header .title { font-size: 16px; font-weight: bold; display: flex; align-items: center; gap: 8px; }

/* --- 通用提示区样式 (Alert Box) --- */
.prompt-area {
    background-color: #f0f7ff;
    border: 1px solid #cce3ff;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
}
.prompt-area i { color: #0066ff; font-size: 18px; margin-top: 2px; }
.prompt-content { font-size: 13px; color: #374151; line-height: 1.6; }
.prompt-content strong { color: #1e40af; display: block; margin-bottom: 4px; }
.prompt-content ul { margin: 0; padding-left: 20px; color: #6b7280; }
.prompt-content .text-danger { color: #ef4444; font-weight: bold; }

/* 审核状态提示条 */
.modal-notice {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.modal-notice.info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.modal-notice.warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* 只读输入框样式微调 */
input[readonly], textarea[readonly] {
    background-color: #f9fafb !important;
    color: #9ca3af !important;
    cursor: not-allowed;
    border-color: #e5e7eb !important;
}

/* --- 侧边栏底部个人中心 --- */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid #f3f4f6;
    position: relative; /* 为弹出层定位 */
}

.user-profile-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.2s;
}

.user-profile-trigger:hover {
    background: var(--primary-fade);
}

.user-profile-trigger img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--white);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.user-profile-trigger .user-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 2px;
    overflow: hidden;
}

.user-profile-trigger .name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.user-profile-trigger .user-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}
.user-meta .status {
    font-size: 11px;
    color: #64748b; /* 稍微深一点的灰色 */
}

.user-meta .uid {
    font-size: 11px;
    color: #64748b; /* 较浅的灰色，区分等级和ID */
    font-family: Arial, sans-serif; /* 使用无衬线字体让数字更清晰 */
    letter-spacing: 0.2px;
}

.user-profile-trigger i {
    color: #9ca3af;
}

/* 弹出菜单样式 */
.profile-popover {
    display: none; /* 默认隐藏 */
    position: absolute;
    bottom: 82px; /* 位于触发器上方 */
    left: 12px;
    right: 12px;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow:
            0 4px 6px -1px rgba(0, 0, 0, 0.05),
            0 20px 25px -5px rgba(0, 0, 0, 0.1),
            0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 200;
    padding: 6px;
}
.account-popover::after {
    content: "";
    position: absolute;
    bottom: -6px; /* 露出一半 */
    right: 25px;  /* 对应你下面三个点的位置 */
    width: 12px;
    height: 12px;
    background: #ffffff;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transform: rotate(45deg); /* 旋转成三角形 */
}
.popover-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 6px 10px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    font-size: 13px;
    color: var(--text-main);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.menu-item i {
    font-size: 16px;
    color: var(--text-sub);
}

.menu-item:hover {
    background: var(--primary-fade);
    color: var(--primary);
}

.menu-item:hover i {
    color: var(--primary);
}

.logout-item:hover {
    background: #fef2f2;
    color: var(--danger);
}
.logout-item:hover i { color: var(--danger); }

/* 特殊项样式 */
.group-entry-btn { color: var(--primary) !important; margin-top: 10px; }
.badge-new { background: #ff4d4f; color: #fff; font-size: 10px; padding: 1px 5px; border-radius: 10px; margin-left: auto; }

/* 弹窗样式 */
.qr-modal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 9999; align-items: center; justify-content: center;
}
.qr-modal-content { background: #fff; border-radius: 16px; width: 380px; padding: 24px; text-align: center; position: relative; }
.qr-modal-header { display: flex; justify-content: space-between; margin-bottom: 20px; }
.close-qr { cursor: pointer; font-size: 24px; color: #94a3b8; }
.qr-modal-body img { width: 240px; margin-bottom: 16px; border: 1px solid #eee; padding: 5px; }
.qr-modal-body p { font-size: 13px; color: #64748b; }

/* 分页 */
/* 分页容器 - 改为 Flex 布局并靠右对齐 */
.pagination {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    clear: both;
}

/* 所有的分页按钮（a标签） */
.pagination a {
    border: 1px solid #e5e7eb;
    background: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-sub);
    text-decoration: none;
    line-height: 1.2;
    transition: all 0.2s;
    display: inline-block;
}

/* 悬停状态 - 排除当前激活页 */
.pagination a:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #fff;
}

/* 当前选中页 (span.current) */
.pagination span.current {
    padding: 6px 12px;
    border-radius: 4px;
    background: var(--primary);
    color: #fff;
    border: 1px solid var(--primary);
    display: inline-block;
    line-height: 1.2;
}

/* 禁用状态 (如：没有上一页时) */
.pagination span.disabled {
    display: none;
}

/* 跳转区域 (.jump) 样式微调，使其符合整体视觉 */
.pagination .jump {
    margin-left: 8px;
    color: var(--text-sub);
    display: flex;
    align-items: center;
    gap: 5px;
}

.pagination .jump input {
    width: 40px;
    height: 28px;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
    text-align: center;
    outline: none;
}

.pagination .jump input:focus {
    border-color: var(--primary);
}

/* 清除浮动（如果旧代码中还有其他地方引用） */
.pagination::after {
    content: "";
    display: table;
    clear: both;
}

/* 底部 */
.app-footer {
    position: relative; z-index: 10; text-align: center; padding: 24px; color: #94a3b8; font-size: 12px; line-height: 30px;
}
.app-footer a { color: #64748b; text-decoration: none; margin: 0 10px; transition: 0.2s; }
.app-footer a:hover { color: var(--primary); }

/* 添加针对 1440px 以下分辨率的微调 */
@media (max-width: 1500px) {
    :root {
        --sidebar-width: 210px; /* 缩小侧边栏 */
        --content-padding: 20px; /* 缩小内容边距 */
    }
    .logo-area {
        padding: 0 16px;
        font-size: 16px;
    }
    .logo-area i {
        margin-right: 8px; /* 间距稍微改小 */
        font-size: 20px;
    }
}