/* ============================================
   梅陇中学论坛 - 统一宽屏布局样式
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #e8ecf1;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    background-image: radial-gradient(circle at 20% 30%, rgba(26, 60, 110, 0.06), transparent 50%),
                      radial-gradient(circle at 80% 70%, rgba(26, 60, 110, 0.04), transparent 50%);
}

/* ---- 滚动条 ---- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.02); border-radius: 10px; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.2); }

/* ---- 通用宽屏容器 ---- */
.app-wrapper {
    display: flex;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    background: rgba(255,255,255,0.55);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-radius: 28px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
    border: 1px solid rgba(255,255,255,0.6);
    overflow: hidden;
    min-height: 85vh;
    max-height: calc(100vh - 40px);
    height: auto;
}

/* ---- 左侧边栏（通用） ---- */
.sidebar {
    width: 260px;
    min-width: 260px;
    background: rgba(255,255,255,0.25);
    backdrop-filter: blur(4px);
    border-right: 1px solid rgba(0,0,0,0.04);
    padding: 16px 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    height: 100%;
    max-height: 85vh;
}
.sidebar-header {
    padding: 0 16px 12px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    flex-shrink: 0;
}
.sidebar-header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a2332;
    display: flex;
    align-items: center;
    gap: 6px;
}
.sidebar-nav {
    padding: 8px 0;
    flex: 1;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    color: #1a2332;
    text-decoration: none;
    font-size: 0.95rem;
    transition: background 0.15s;
    border-radius: 8px;
    margin: 0 8px;
    gap: 8px;
}
.sidebar-nav a:hover {
    background: rgba(26,60,110,0.06);
}
.sidebar-nav a.active {
    background: rgba(26,60,110,0.1);
    color: #1a3c6e;
    font-weight: 500;
}
.sidebar-nav .badge {
    margin-left: auto;
    background: #d9534f;
    color: #fff;
    border-radius: 50%;
    padding: 0px 6px;
    font-size: 0.7rem;
    line-height: 18px;
    min-width: 18px;
    text-align: center;
}

/* ---- 右侧主内容 ---- */
.main-content {
    flex: 1;
    padding: 20px 24px;
    overflow-y: auto;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}
.main-content .page-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #1a2332;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.main-content .actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: auto;
}

/* ---- 通用按钮 ---- */
.btn-primary {
    background: #1a3c6e;
    color: #fff;
    border: none;
    padding: 6px 18px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(26,60,110,0.15);
}
.btn-primary:hover {
    background: #2a5a8e;
    transform: translateY(-1px);
}
.btn-secondary {
    background: rgba(0,0,0,0.06);
    color: #1a2332;
    border: 1px solid rgba(0,0,0,0.06);
    padding: 6px 18px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
}
.btn-secondary:hover {
    background: rgba(0,0,0,0.1);
}
.btn-danger {
    background: rgba(217,83,79,0.12);
    color: #d9534f;
    border: 1px solid rgba(217,83,79,0.15);
    padding: 6px 18px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
}
.btn-danger:hover {
    background: #d9534f;
    color: #fff;
}
.btn-sm {
    padding: 3px 12px;
    font-size: 0.8rem;
}

/* ---- 表单 ---- */
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    color: #1a2332;
    font-size: 0.95rem;
}
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(4px);
    font-family: inherit;
    font-size: 1rem;
    transition: border 0.2s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #1a3c6e;
    background: rgba(255,255,255,0.8);
}

/* ---- 头像 ---- */
.avatar-img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.8);
}
.avatar-sm {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* ---- 状态提示 ---- */
.error {
    background: rgba(217,83,79,0.12);
    padding: 8px 12px;
    border-radius: 10px;
    color: #d9534f;
    margin-bottom: 10px;
}
.success {
    background: rgba(92,184,92,0.12);
    padding: 8px 12px;
    border-radius: 10px;
    color: #5cb85c;
    margin-bottom: 10px;
}

/* ---- 列表项 ---- */
.list-item {
    background: rgba(255,255,255,0.3);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.5);
    padding: 10px 14px;
    border-radius: 12px;
    margin-bottom: 8px;
    transition: 0.15s;
}
.list-item:hover {
    background: rgba(255,255,255,0.6);
}
.list-item .title {
    font-weight: 500;
    color: #1a2332;
}
.list-item .meta {
    font-size: 0.8rem;
    color: #6b7a8a;
    margin-top: 2px;
}
.list-item .actions {
    margin-top: 6px;
    display: flex;
    gap: 6px;
}

/* ---- 通知条目 ---- */
.notif-item {
    background: rgba(255,255,255,0.3);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.5);
    padding: 10px 14px;
    border-radius: 12px;
    margin-bottom: 6px;
}
.notif-item.unread {
    border-left: 4px solid #1a3c6e;
    background: rgba(26,60,110,0.06);
}
.notif-item .notif-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ---- 聊天布局 ---- */
.chat-contact {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.15s;
}
.chat-contact:hover {
    background: rgba(255,255,255,0.3);
}
.chat-contact.active {
    background: rgba(26,60,110,0.08);
}
.chat-contact .name {
    font-weight: 500;
}
.chat-contact .last-msg {
    font-size: 0.8rem;
    color: #6b7a8a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}
.chat-message {
    margin-bottom: 8px;
    max-width: 75%;
    padding: 8px 14px;
    border-radius: 16px;
    background: rgba(255,255,255,0.5);
    backdrop-filter: blur(4px);
}
.chat-message.sent {
    margin-left: auto;
    background: #1a3c6e;
    color: #fff;
}
.chat-message .time {
    font-size: 0.7rem;
    color: #8b9aab;
    margin-top: 2px;
    display: block;
}
.chat-message.sent .time {
    color: rgba(255,255,255,0.6);
}

/* ---- 响应式 ---- */
@media (max-width: 768px) {
    body { padding: 8px; align-items: flex-start; }
    .app-wrapper {
        flex-direction: column;
        min-height: 90vh;
        max-height: none;
        border-radius: 16px;
    }
    .sidebar {
        width: 100%;
        min-width: unset;
        border-right: none;
        border-bottom: 1px solid rgba(0,0,0,0.04);
        max-height: 200px;
        overflow-y: auto;
    }
    .main-content {
        padding: 12px 16px;
        max-height: none;
    }
    .chat-message {
        max-width: 90%;
    }
}