/* 基础重置与全局配置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'PingFang SC', 'Microsoft Yahei', 'Segoe UI', sans-serif;
}
:root {
    /* 配色系统（统一柔和色调） */
    --primary: #2563eb; /* 主色调：柔和蓝色 */
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;
    --secondary: #f97316; /* 辅助色：橙色（用于强调） */
    --neutral-100: #f8fafc;
    --neutral-200: #e2e8f0;
    --neutral-300: #cbd5e1;
    --neutral-700: #334155;
    --neutral-900: #0f172a;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --transition: all 0.3s ease;
}
body {
    background-color: var(--neutral-100);
    color: var(--neutral-700);
    line-height: 1.6;
}

/* 容器适配（响应式） */
.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 16px; /* 移动端留边距 */
}

/* 头部导航 */
header {
    background-color: #fff;
    box-shadow: var(--shadow-sm);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 999;
}
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* 移动端换行 */
    gap: 16px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-dark);
    text-decoration: none;
}
.logo img {
    height: 36px;
    border-radius: var(--radius-sm);
}
.nav {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}
.nav a {
    text-decoration: none;
    color: var(--neutral-700);
    font-size: 15px;
    font-weight: 500;
    position: relative;
    transition: var(--transition);
}
.nav a:hover {
    color: var(--primary);
}
.nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary);
    transition: var(--transition);
}
.nav a:hover::after {
    width: 100%;
}

/* 按钮样式优化 */
.btn {
    padding: 9px 18px;
    border-radius: var(--radius-md);
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-primary {
    background-color: var(--primary);
    color: #fff;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}
.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}
.btn-danger {
    background-color: #ef4444;
    color: #fff;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}
.btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

/* 卡片模块（核心容器优化） */
.card {
    background-color: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 24px;
    transition: var(--transition);
    border-top: 3px solid transparent;
}
.card:hover {
    box-shadow: var(--shadow-md);
}
/* 不同模块的卡片区分 */
.card.ads-card {
    border-top-color: var(--secondary);
}
.card.notice-card {
    border-top-color: var(--primary);
}
.card.circle-card {
    border-top-color: #10b981;
}

/* 表单样式优化 */
.form-group {
    margin-bottom: 20px;
}
.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--neutral-700);
    font-size: 14px;
}
.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-md);
    font-size: 15px;
    transition: var(--transition);
    background-color: #fff;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* 登录/注册容器 */
.login-container, .register-container {
    max-width: 420px;
    margin: 60px auto;
}
.page-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 24px;
    text-align: center;
    color: var(--neutral-900);
    position: relative;
}
.page-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background-color: var(--primary);
    border-radius: var(--radius-sm);
}

/* 广告区域 */
.ads-container {
    margin: 32px 0;
}
.ads-container h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--neutral-900);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ads-container h3::before {
    content: '';
    width: 4px;
    height: 18px;
    background-color: var(--secondary);
    border-radius: var(--radius-sm);
}
.ads-list {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 12px 0 16px;
    scrollbar-width: thin;
}
.ads-list::-webkit-scrollbar {
    height: 6px;
}
.ads-list::-webkit-scrollbar-thumb {
    background-color: var(--neutral-300);
    border-radius: var(--radius-sm);
}
.ads-item {
    min-width: 280px;
    height: 160px;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.ads-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}
.ads-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}
.ads-item:hover img {
    transform: scale(1.08);
}
.ads-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.2));
}

/* 系统公告 */
.notice-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--neutral-200);
    transition: var(--transition);
}
.notice-item:last-child {
    border-bottom: none;
}
.notice-item:hover {
    padding-left: 8px;
    border-left: 3px solid var(--primary);
}
.notice-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    color: var(--neutral-900);
}
.notice-title .top-tag {
    background-color: var(--secondary);
    color: #fff;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    margin-right: 8px;
    font-weight: 400;
}
.notice-time {
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 4px;
}
.notice-content {
    font-size: 14px;
    color: var(--neutral-700);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 热门圈子 */
.circle-list {
    margin-top: 24px;
}
.circle-item {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--neutral-200);
    transition: var(--transition);
}
.circle-item:last-child {
    border-bottom: none;
}
.circle-item:hover {
    transform: translateX(4px);
}
.circle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.circle-author {
    font-weight: 500;
    color: var(--primary-dark);
    font-size: 14px;
}
.circle-time {
    font-size: 13px;
    color: #94a3b8;
}
.circle-title {
    font-size: 19px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--neutral-900);
    line-height: 1.4;
}
.circle-content {
    color: var(--neutral-700);
    line-height: 1.7;
    margin-bottom: 16px;
    font-size: 15px;
}
.circle-cover {
    width: 100%;
    height: 240px;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}
.circle-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}
.circle-cover:hover img {
    transform: scale(1.05);
}

/* 聊天页面 */
.chat-container {
    display: flex;
    height: calc(100vh - 100px);
    margin-top: 20px;
    background-color: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.chat-contacts {
    width: 300px;
    border-right: 1px solid var(--neutral-200);
    overflow-y: auto;
    background-color: var(--neutral-100);
}
.contact-item {
    padding: 16px;
    cursor: pointer;
    transition: var(--transition);
    border-left: 3px solid transparent;
}
.contact-item:hover, .contact-item.active {
    background-color: #fff;
    border-left-color: var(--primary);
    box-shadow: var(--shadow-sm);
}
.contact-name {
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--neutral-900);
}
.contact-lastmsg {
    font-size: 13px;
    color: #94a3b8;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.chat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.chat-header {
    padding: 16px;
    border-bottom: 1px solid var(--neutral-200);
    background-color: var(--neutral-100);
    font-weight: 500;
    color: var(--neutral-900);
}
.chat-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background-color: #f1f5f9;
}
.message-item {
    margin-bottom: 20px;
    max-width: 75%;
    display: flex;
    flex-direction: column;
}
.message-left {
    align-self: flex-start;
}
.message-right {
    align-self: flex-end;
}
.message-bubble {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 15px;
    position: relative;
}
.message-left .message-bubble {
    background-color: #fff;
    box-shadow: var(--shadow-sm);
    border-bottom-left-radius: 2px;
}
.message-right .message-bubble {
    background-color: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-sm);
    border-bottom-right-radius: 2px;
}
.message-time {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
    align-self: flex-end;
}
.message-right .message-time {
    color: rgba(255,255,255,0.8);
}
.chat-input {
    padding: 16px;
    border-top: 1px solid var(--neutral-200);
    display: flex;
    gap: 12px;
    background-color: #fff;
}
.chat-input input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-md);
    font-size: 15px;
    transition: var(--transition);
}
.chat-input input:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.chat-input .btn {
    white-space: nowrap;
}

/* 移动端适配（768px以下） */
@media (max-width: 768px) {
    .nav {
        gap: 16px;
        margin-top: 8px;
    }
    .ads-item {
        min-width: 240px;
        height: 140px;
    }
    .circle-cover {
        height: 200px;
    }
    .chat-container {
        height: calc(100vh - 80px);
    }
    .chat-contacts {
        width: 260px;
    }
}
