/* 重置样式和基础样式 */
/* 清除所有元素的默认内外边距，设置盒模型为border-box（边框和内边距计入宽高） */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 页面整体样式：设置字体、背景色、文字颜色、行高，隐藏溢出内容 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* 字体栈，优先使用系统字体 */
    background-color: #f5f5f5; /* 浅灰色背景，提升内容可读性 */
    color: #333; /* 深灰色文字，避免纯黑过于刺眼 */
    line-height: 1.6; /* 行高1.6，提升文字可读性 */
    overflow: hidden; /* 隐藏页面溢出内容，防止全局滚动 */
}

/* 登录页面样式 */
/* 登录容器：使用flex布局，使内容垂直水平居中，设置全屏高度和渐变背景 */
.login-container {
    display: flex;
    justify-content: center; /* 水平居中 */
    align-items: center; /* 垂直居中 */
    height: 100vh; /* 占满整个视口高度 */
    background: linear-gradient(135deg, #4682D8 0%, #764ba2 100%); /* 从蓝到紫的渐变背景 */
}

/* 登录框样式：白色背景、内边距、圆角、阴影，限制最大宽度 */
.login-box {
    background: white;
    padding: 40px; /* 内边距，使内容不紧贴边框 */
    border-radius: 8px; /* 圆角边框，柔和视觉效果 */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); /* 深阴影，增强立体感 */
    width: 100%;
    max-width: 400px; /* 最大宽度限制，避免在宽屏上过宽 */
}

/* 登录框标题样式：居中、底部间距、颜色和字体大小 */
.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 24px;
}

/* 表单组样式：底部间距（这里设为0，可能在其他地方有调整） */
.form-group {
    margin-bottom: 0px;     
}

/* 表单标签样式：块级显示、底部间距、字体粗细和颜色 */
.form-group label {
    display: block; /* 独占一行 */
    margin-bottom: 8px;
    font-weight: 500; /* 半粗体，突出标签 */
    color: #555; /* 中灰色，比文字浅 */
}

/* 表单输入框样式：宽度、内边距、边框、圆角、字体大小和过渡效果 */
.form-group input {
    width: 50%; /* 宽度50%，可能是特殊设计 */
    padding: 12px;
    border: 1px solid #ddd; /* 浅灰色边框 */
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s; /* 边框颜色变化的过渡动画 */
}

/* 输入框聚焦状态：去除默认轮廓，改变边框颜色 */
.form-group input:focus {
    outline: none; /* 去除浏览器默认聚焦轮廓 */
    border-color: #4682D8; /* 聚焦时边框变为主题色 */
}

/* 登录按钮样式：全宽、内边距、背景色、文字色、无边框、圆角、字体设置和过渡 */
.login-btn {
    width: 100%;
    padding: 12px;
    background: #4682D8; /* 主题蓝色 */
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer; /* 鼠标悬停显示手型 */
    transition: background-color 0.3s; /* 背景色变化的过渡 */
}

/* 登录按钮悬停状态：加深背景色 */
.login-btn:hover {
    background: #5a6fd8;
}

/* 仪表盘布局：使用flex布局，高度占满视口 */
.dashboard {
    display: flex;
    height: 100vh;
}

/* 侧边栏样式：宽度、背景色、文字色，flex垂直布局 */
.sidebar {
    width: 250px;
    background: #292929; /* 深灰色背景 */
    color: white;
    display: flex;
    flex-direction: column; /* 子元素垂直排列 */
}

/* 侧边栏头部：内边距、背景色、文字居中、字体设置 */
.sidebar-header {
    padding: 20px;
    background: #292929; /* 深灰色背景 */
    text-align: center;
    font-size: 18px;
    font-weight: 600;
}

/* 侧边栏菜单：flex占满剩余空间，内边距 */
.sidebar-menu {
    flex: 1; /* 占据剩余空间 */
    padding: 20px 0;
}

/* 侧边栏菜单列表：去除默认列表样式 */
.sidebar-menu ul {
    list-style: none;
}

/* 侧边栏菜单项：底部间距 */
.sidebar-menu li {
    margin-bottom: 5px;
}

/* 侧边栏菜单链接：块级显示、内边距、文字色、无下划线、过渡效果 */
.sidebar-menu a {
    display: block; /* 链接占满父元素，方便点击 */
    padding: 15px 20px;
    color: #ecf0f1; /* 浅灰色文字 */
    text-decoration: none;
    transition: background-color 0.3s; /* 背景色过渡 */
}

/* 菜单链接悬停状态：背景色变化 */
.sidebar-menu a:hover {
    background: #3a3a3a;
}

/* 菜单链接激活状态：主题色背景，左侧边框标识 */
.sidebar-menu a.active {
    background: #4682D8;
    border-left: 4px solid #4682D8; /* 左侧蓝色边框，标识激活 */
}

/* 侧边栏子菜单样式：左内边距、背景色 */
.sidebar-menu ul ul {
    margin-left: 20px; /* 子菜单缩进 */
    background: #3a3a3a;
}

/* 子菜单项：无底部间距 */
.sidebar-menu ul ul li {
    margin-bottom: 0;
}

/* 子菜单链接：更小的内边距和字体，背景色 */
.sidebar-menu ul ul a {
    padding: 10px 20px;
    font-size: 14px;
    background: #292929;
}

/* 子菜单链接悬停状态：背景色变化 */
.sidebar-menu ul ul a:hover {
    background: #3a3a3a;
}

/* 子菜单链接激活状态：主题色背景和左侧边框 */
.sidebar-menu ul ul a.active {
    background: #4682D8;
    border-left: 4px solid #4682D8;
}

/* 主内容区样式：flex占满剩余空间，垂直布局，隐藏溢出 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* 头部样式：白色背景、内边距、阴影、flex布局（两端对齐） */
.header {
    background: white;
    padding: 15px 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* 轻微阴影，区分头部和内容 */
    display: flex;
    justify-content: space-between; /* 左右两端对齐 */
    align-items: center; /* 垂直居中 */
}

/* 头部左侧标题：字体大小和颜色 */
.header-left h1 {
    font-size: 20px;
    color: #333;
}

/* 头部右侧：flex布局，元素间距 */
.header-right {
    display: flex;
    align-items: center;
    gap: 20px; /* 元素间间距 */
}

/* 用户信息：文字右对齐 */
.user-info {
    text-align: left;
}

/* 用户名：半粗体，深灰色 */
.user-info .username {
    font-weight: 500;
    color: #333;
}

/* 积分：绿色，粗体 */
.user-info .credits {
    color: #27ae60; /* 绿色，代表正向信息 */
    font-weight: 600;
}

/* 过期时间：橙色，小字体 */
.user-info .expire-time {
    color: #e67e22; /* 橙色，提示注意 */
    font-size: 12px;
}

/* 内容区域样式：flex占满剩余空间，内边距，垂直滚动，背景色 */
.content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f5f5f5;
    min-height: 0;
}

/* 内容头部：白色背景、内边距、圆角、阴影、底部间距 */
.content-header {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05); /* 浅阴影 */
}

/* 内容头部标题：字体大小、颜色、底部间距 */
.content-header h2 {
    font-size: 22px;
    color: #333;
    margin-bottom: 10px;
}

/* 内容头部描述：颜色和字体大小 */
.content-header p {
    color: #666;
    font-size: 14px;
}

/* 卡片容器：网格布局，自适应列数，间距，底部间距 */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* 自适应列数，最小宽度200px */
    gap: 20px; /* 卡片间距 */
    margin-bottom: 20px;
}

/* 卡片样式：白色背景、内边距、圆角、阴影、过渡效果 */
.card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s; /* 变换和阴影的过渡 */
}

/* 卡片悬停效果：上移、加深阴影 */
.card:hover {
    transform: translateY(-5px); /* 上移5px */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); /* 加深阴影 */
}

/* 卡片图标：字体大小、底部间距、颜色 */
.card-icon {
    font-size: 30px;
    margin-bottom: 15px;
    color: #4682D8; /* 主题色 */
}

/* 卡片标题：字体大小、颜色、底部间距 */
.card-title {
    font-size: 16px;
    color: #666;
    margin-bottom: 10px;
}

/* 卡片数值：大字体、粗体、深颜色 */
.card-value {
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

/* 表格容器：白色背景、圆角、阴影、溢出隐藏、底部间距、过渡效果 */
.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: 2px;
    transition: box-shadow 0.3s ease;
}

/* 设备统计容器：flex布局、底部间距 */
.stats-container {
    display: flex;
    gap: 15px; /* 这是卡片间距 */
    margin-bottom: 2px; /* 这是卡片底部间距 */
}

/* 统计卡片：flex布局、白色背景、圆角、阴影、内边距、flex占满 */
.stat-card {
    display: flex;
    align-items: center;
    gap: 6px;
    background: white;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    padding: 4px 8px;
    flex: 1;
    transition: box-shadow 0.3s ease;
}

/* 统计卡片悬停：加深阴影 */
.stat-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 统计图标：字体大小 */
.stat-icon {
    font-size: 14px;
}

/* 统计信息：flex布局、垂直排列 */
.stat-info {
    display: flex;
    flex-direction: column;
}

/* 统计标签：小字体、灰色 */
.stat-label {
    font-size: 16px;
    color: #666;
    margin-bottom: 0;
}

/* 统计数值：大字体、粗体、深颜色 */
.stat-value {
    font-size: 14px;
    font-weight: 600; /*这是加粗*/
    color: #333;
}

/* 在线状态：绿色边框 */
.stat-online {
    border-left: 1px solid #4caf50;
}

/* 离线状态：橙色边框 */
.stat-offline {
    border-left: 1px solid #ff9800;
}

/* 封号状态：红色边框 */
.stat-banned {
    border-left: 1px solid #f44336;
}

/* 表格容器悬停：加深阴影 */
.table-container:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

/* 搜索表单样式：白色背景、圆角、阴影、内边距、底部间距、过渡、边框、最大宽度 */
.search-form {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    padding: 1px 5px; /* 紧凑内边距 */
    margin-bottom: 2px;
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
    max-width: 100%;
}

/* 搜索表单悬停：加深阴影 */
.search-form:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

/* 表单行：flex布局、对齐方式、间距、不换行、横向滚动、内边距 */
.search-form .form-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap; /* 强制一行 */
    overflow-x: auto; /* 内容过多时横向滚动 */
    padding: 4px 0;
}

/* 搜索表单内的表单组：flex布局、方向、间距、占比、最小宽度、对齐 */
.search-form .form-group {
    display: flex;
    flex-direction: row; /* 横向排列 */
    gap: 4px;
    flex: 1; /* 占满剩余空间 */
    min-width: 10px;
    align-items: center;
}

/* 搜索表单标签：粗体、颜色、小字体、大写、字间距 */
.search-form label {
    font-weight: 600;
    color: #374151;
    font-size: 12px;
    text-transform: uppercase; /* 全大写 */
    letter-spacing: 0.5px;
}

/* 搜索表单输入框、日期选择、下拉框：边框、圆角、过渡、背景色、盒模型 */
.search-form input[type="text"],
.search-form input[type="date"],
.search-form select {   
    border: 1px solid #d1d5db;
    border-radius: 8px;  
    transition: all 0.2s ease;
    background-color: #ffffff;  
    box-sizing: border-box;
}

/* 输入框聚焦状态：去除轮廓、边框颜色变化、轻微阴影 */
.search-form input[type="text"]:focus,
.search-form input[type="date"]:focus,
.search-form select:focus {
    outline: none;
    border-color: #4682D8;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15); /* 主题色的轻微阴影 */
}

/* 快捷搜索按钮组：flex布局、间距、对齐、不压缩、不换行、内边距 */
.search-form .quick-search {
    display: flex;
    gap: 2px; /* 紧凑间距 */
    align-items: center;
    flex-shrink: 0; /* 不被压缩 */
    white-space: nowrap;
    padding: 0;
}

/* 快捷搜索标签：flex布局、间距、字体设置、光标、过渡、边距、内边距、圆角 */
.search-form .quick-search label {
    display: flex;
    align-items: center;
    gap: 2px;
    font-weight: 200;
    color: #4b5563;
    font-size: 14px;
    cursor: pointer;
    transition: color 0.2s ease;
    margin: 0;
    padding: 2px 2px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

/* 快捷搜索标签悬停：文字颜色变化、背景色 */
.search-form .quick-search label:hover {
    color: #4682D8;
    background-color: rgba(102, 126, 234, 0.08);
}

/* 自定义单选按钮：隐藏默认样式、大小、边框、圆角、布局、过渡 */
.search-form .quick-search input[type="radio"] {
    appearance: none; /* 隐藏默认样式 */
    width: 16px;
    height: 16px;
    border: 2px solid #9ca3af;
    border-radius: 50%;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

/* 单选按钮选中状态：边框颜色、背景色 */
.search-form .quick-search input[type="radio"]:checked {
    border-color: #4682D8;
    background-color: #4682D8;
}

/* 单选按钮选中后的内部圆点：大小、颜色、圆角 */
.search-form .quick-search input[type="radio"]:checked::after {
    content: '';
    width: 8px;
    height: 8px;
    background-color: white;
    border-radius: 50%;
}

/* 选中状态的文字：颜色、粗体 */
.search-form .quick-search input[type="radio"]:checked + span,
.search-form .quick-search label:has(input[type="radio"]:checked) {
    color: #4682D8;
    font-weight: 600;
}

/* 日期范围：flex布局、间距、对齐 */
.search-form .date-range {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* 日期范围文字：颜色、粗体、大小、不换行 */
.search-form .date-range span {
    color: #6b7280;
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
}

/* 表单操作按钮组：flex布局、间距、左外边距、不压缩 */
.search-form .form-actions {
    display: flex;
    gap: 10px;
    margin-left: 12px;
    flex-shrink: 0;
}

/* 搜索表单按钮：内边距、无边框、圆角、字体大小、光标、粗体、大写、字间距、过渡、高度、布局、不换行、不压缩 */
.search-form .btn {
    padding: 0 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 按钮悬停：上移、阴影 */
.search-form .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 主要按钮：渐变背景、白色文字 */
.search-form .btn-primary {
    background: linear-gradient(135deg, #4682D8, #764ba2);
    color: white;
}

/* 主要按钮悬停：加深渐变 */
.search-form .btn-primary:hover {
    background: linear-gradient(135deg, #3958e3, #5a3fc0);
}

/* 次要按钮：浅灰背景、深灰文字 */
.search-form .btn-secondary {
    background-color: #f3f4f6;
    color: #374151;
}

/* 次要按钮悬停：加深背景色 */
.search-form .btn-secondary:hover {
    background-color: #e5e7eb;
}

/* 成功按钮：绿色渐变背景、白色文字 */
.search-form .btn-success {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
}

/* 成功按钮悬停：加深渐变 */
.search-form .btn-success:hover {
    background: linear-gradient(135deg, #219653, #27ae60);
}

/* 美化横向滚动条（Webkit浏览器） */
.search-form .form-row::-webkit-scrollbar {
    height: 6px; /* 滚动条高度 */
}

.search-form .form-row::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2); /* 滚动条颜色 */
    border-radius: 3px;
}

/* 表格头部：内边距、渐变背景、文字色、flex布局（两端对齐）、无边框 */
.table-header {
    padding: 12px 16px;
    background: #4682D8;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: none;
}

/* 表格头部标题：字体大小、颜色、粗体、无外边距 */
.table-header h3 {
    font-size: 18px;
    color: white;
    font-weight: 600;
    margin: 0;
}

/* 表格头部中的统计容器：flex布局、无底部间距 */
.table-header .stats-container {
    display: flex;
    gap: 12px;
    margin-bottom: 0;
}

/* 表格头部中的统计卡片：flex布局、半透明白色背景、圆角、无阴影、内边距、不占满 */
.table-header .stat-card {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    box-shadow: none;
    padding: 4px 10px;
    flex: 0 0 auto;
    transition: background 0.3s ease;
}

/* 表格头部中的统计卡片悬停：加深背景透明度 */
.table-header .stat-card:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 表格头部中的统计标签：小字体、白色 */
.table-header .stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0;
}

/* 表格头部中的统计数值：大字体、粗体、白色 */
.table-header .stat-value {
    font-size: 16px;
    font-weight: 600;
    color: white;
}

/* 表格内容区：横向和纵向滚动，最大高度（计算值） */
.table-content {
    overflow-x: auto;
    overflow-y: auto;
    max-height: calc(100vh - 260px);
}

/* SMS表格内容区：滚动设置，最大高度（计算值） */
.table-sms-content {
    overflow-x: auto;
    overflow-y: auto;
    max-height: calc(100vh - 180px);
}

/* 表格样式：全宽、边框合并、白色背景 */
table {
    width: 100%;
    border-collapse: collapse; /* 边框合并 */
    background: white;
}

/* 表格表头和单元格：内边距、对齐方式、底部边框、过渡 */
table th,
table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0; /* 浅色分隔线 */
    transition: background-color 0.3s ease;
}

/* 表头：背景色、粗体、颜色、不换行、小字体、大写、字间距 */
table th {
    background: #4682D8;
    font-weight: 600;
    color: white;
    white-space: nowrap; /* 不换行 */
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 表格行：过渡效果 */
table tr {
    transition: all 0.3s ease;
}

/* 表格行悬停：背景色、上移、阴影 */
table tr:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* 最后一行单元格：无底部边框 */
table tr:last-child td {
    border-bottom: none;
}

/* 单元格：颜色、小字体 */
table td {
    color: #6c757d;
    font-size: 13px;
}

/* 第一列单元格：深颜色、半粗体 */
table td:first-child {
    color: #333;
    font-weight: 500;
}

/* 状态徽章：行内块、内边距、圆角、小字体、粗体、大写、字间距 */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px; /* 圆形徽章 */
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 待处理状态：浅黄背景、深黄文字 */
.status-badge.pending {
    background-color: #fff3cd;
    color: #856404;
}

/* 已发送状态：浅绿背景、深绿文字 */
.status-badge.sent {
    background-color: #d4edda;
    color: #155724;
}

/* 失败状态：浅红背景、深红文字 */
.status-badge.failed {
    background-color: #f8d7da;
    color: #721c24;
}

/* 改密码表单容器：白色背景、内边距、圆角、阴影、最大宽度、居中 */
.form-container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    width: 100%;
    box-sizing: border-box;
}

/* 表单容器标题：底部间距、颜色、居中 */
.form-container h2 {
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

.setting-item {
    flex: 1;    
}

/* 设置项信息：flex布局、间距 */
.setting-info {
    flex: 1;
    margin-right: 20px;
}

/* 设置项标题：底部间距、颜色 */
.setting-info h3 {    
    margin-bottom: 8px;
    color: #333;
    font-size: 16px;
}

/* 设置项描述：小字体、灰色 */
.setting-info p {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

/* 设置控制区：flex布局、居中对齐、间距 */
.setting-control {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* 切换开关容器 */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

/* 切换开关输入框：隐藏 */
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* 切换滑块：绝对定位、圆角、背景色、过渡 */
.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 26px;
}

/* 切换滑块圆形按钮：绝对定位、高度、宽度、背景色、圆角、过渡 */
.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

/* 选中状态：滑块背景色 */
.toggle-switch input:checked + .toggle-slider {
    background-color: #4682D8;
}

/* 选中状态：滑块按钮位置 */
.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* 设置状态文字：字体大小、颜色、宽度 */
.setting-status {
    font-size: 14px;
    color: #666;
    min-width: 40px;
    text-align: right;
}

/* 表单操作区：顶部间距、文本对齐 */
.form-actions {
    margin-top: 30px;
    text-align: center;
}

/* 表单行：底部间距 */
.form-row {
    margin-bottom: 20px;
}

/* 表单行标签：块级、底部间距、粗体、颜色 */
.form-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

/* 表单行输入框：全宽、内边距、边框、圆角、字体大小、过渡 */
.form-row input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

/* 输入框聚焦：去除轮廓、边框颜色变化 */
.form-row input:focus {
    outline: none;
    border-color: #4682D8;
}

/* 保存按钮：全宽、内边距、绿色背景、白色文字、无边框、圆角、字体设置、光标、过渡 */
.save-btn {
    width: 100%;
    padding: 12px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}

/* 保存按钮悬停：加深背景色 */
.save-btn:hover {
    background: #219653;
}

/* 短信聊天容器：flex垂直布局、高度、白色背景、圆角、阴影、溢出隐藏 */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 500px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

/* 聊天头部：内边距、主题色背景、文字色、底部边框 */
.chat-header {
    padding: 20px;
    background: #4682D8;
    color: white;
    border-bottom: 1px solid #e9ecef;
}

/* 聊天头部标题：字体大小、底部间距 */
.chat-header h3 {
    font-size: 18px;
    margin-bottom: 5px;
}

/* 聊天头部手机号：小字体、透明度 */
.chat-header .phone-number {
    font-size: 14px;
    opacity: 0.9;
}

/* 聊天消息区：flex占满剩余空间、内边距、垂直滚动、浅灰背景 */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
}

/* 消息项：底部间距、flex布局、对齐 */
.message {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-end;
}

/* 消息头像：大小、圆角、间距、溢出隐藏 */
.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin: 0 10px;
    overflow: hidden;
}

/* 头像图片：全宽高、填充方式 */
.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 发送者头像：主题色背景 */
.sender-avatar {
    background: #4682D8;
}

/* 接收者头像：绿色背景 */
.receiver-avatar {
    background: #34A853;
}

/* 发送的消息：右对齐 */
.message.sent {
    justify-content: flex-end;
}

/* 接收的消息：左对齐 */
.message.received {
    justify-content: flex-start;
}

/* 消息内容：最大宽度、内边距、圆角、自动换行 */
.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
}

/* 发送的消息对齐 */
.message.sent {
    align-items: flex-end;
}

/* 接收的消息对齐 */
.message.received {
    align-items: flex-start;
}

/* 发送的消息内容：主题色背景、白色文字、右下角圆角 */
.message.sent .message-content {
    background: #4682D8;
    color: white;
    border-bottom-right-radius: 4px; /* 右下角圆角减小，模拟气泡效果 */
}

/* 接收的消息内容：白色背景、深灰文字、边框、左下角圆角 */
.message.received .message-content {
    background: white;
    color: #333;
    border: 1px solid #e9ecef;
    border-bottom-left-radius: 4px; /* 左下角圆角减小 */
}

/* 消息时间：小字体、灰色、顶部间距 */
.message-time {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
}

/* 消息状态：小字体、顶部间距、粗体 */
.message-status {
    font-size: 11px;
    margin-top: 5px;
    font-weight: 500;
}

/* 聊天图片：大小、填充方式、光标、过渡 */
.chat-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s ease;
}

/* 聊天图片悬停：轻微放大 */
.chat-image:hover {
    transform: scale(1.05);
}

/* 待发送状态：黄色 */
.status-pending {
    color: #ffc107;
}

/* 已发送状态：绿色 */
.status-sent {
    color: #28a745;
}

/* 发送失败状态：红色 */
.status-failed {
    color: #dc3545;
}

/* 聊天输入区：内边距、顶部边框、白色背景 */
.chat-input {
    padding: 20px;
    border-top: 1px solid #e9ecef;
    background: white;
}

/* 聊天表单：flex布局、间距 */
.chat-form {
    display: flex;
    gap: 10px;
}

/* 聊天输入框：flex占满、内边距、边框、圆角、字体大小 */
.chat-form input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 20px; /* 大圆角，类似聊天软件输入框 */
    font-size: 14px;
}

/* 聊天发送按钮：内边距、主题色背景、白色文字、无边框、圆角、光标、过渡 */
.chat-form button {
    padding: 12px 20px;
    background: #4682D8;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.3s;
}

/* 发送按钮悬停：加深背景色 */
.chat-form button:hover {
    background: #5a6fd8;
}

/* 聊天页面：flex垂直布局、间距、最小高度 */
.chat-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 0;
}

/* 聊天头部按钮组：flex布局、间距 */
.chat-header-buttons {
    display: flex;
    gap: 10px;
}

/* 聊天标签和搜索区：flex布局（两端对齐）、白色背景、内边距、圆角、阴影 */
.chat-tabs-search {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* 聊天标签：flex布局、间距 */
.chat-tabs {
    display: flex;
    gap: 5px;
}

/* 标签按钮：内边距、边框、白色背景、圆角、光标、过渡 */
.tab-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

/* 标签按钮悬停：浅灰背景 */
.tab-btn:hover {
    background: #f8f9fa;
}

/* 激活的标签按钮：主题色背景和边框、白色文字 */
.tab-btn.active {
    background: #4682D8;
    color: white;
    border-color: #4682D8;
}

/* 聊天搜索框：相对定位、宽度 */
.chat-search {
    position: relative;
    width: 300px;
}

/* 聊天搜索输入框：全宽、内边距、边框、圆角、字体大小 */
.chat-search input {
    width: 100%;
    padding: 10px 30px 10px 12px; /* 右侧预留图标空间 */
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* 聊天主区域：flex布局、间距、高度（计算值）、最小高度 */
.chat-main {
    display: flex;
    gap: 20px;
    height: calc(100vh - 250px);
    min-height: 0;
}

/* 聊天会话列表：宽度、白色背景、圆角、阴影、垂直滚动 */
.chat-sessions {
    width: 300px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    overflow-y: auto;
}

/* 会话项：flex布局、对齐、内边距、底部边框、光标、过渡 */
.session-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.3s;
}

/* 会话项悬停：浅灰背景 */
.session-item:hover {
    background: #f8f9fa;
}

/* 激活的会话项：浅蓝背景、左侧主题色边框 */
.session-item.active {
    background: #e3f2fd;
    border-left: 4px solid #4682D8;
}

/* 会话头像：大小、圆角、溢出隐藏、flex布局、背景色、右间距 */
.session-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #4682D8;
    margin-right: 12px;
}

/* 会话信息：flex占满、最小宽度 */
.session-info {
    flex: 1;
    min-width: 0; /* 允许内容溢出时隐藏 */
}

/* 会话名称：半粗体、深灰、底部间距、不换行、溢出隐藏 */
.session-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* 溢出显示省略号 */
}

/* 会话最后一条消息：小字体、中灰、底部间距、不换行、溢出隐藏 */
.session-last-message {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

/* 会话时间：小字体、浅灰 */
.session-time {
    font-size: 11px;
    color: #999;
}

/* 未读消息数：红色背景、白色文字、圆角、大小、小字体、内边距、左间距、flex布局 */
.session-unread {
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    padding: 0;
    margin-left: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}

/* 聊天内容区：flex占满、flex垂直布局、白色背景、圆角、阴影、最小高度 */
.chat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    min-height: 0;
}

/* 确保聊天消息容器高度和滚动正常 */
.chat-messages {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    min-height: 0;
}

/* 聊天内容占位符：flex占满、flex布局、对齐、颜色、字体大小、背景色 */
.chat-content-placeholder {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 16px;
    background: #f8f9fa;
}

/* 聊天内容区域：flex占满、flex垂直布局、最小高度 */
.chat-content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* 聊天头部：flex布局（两端对齐）、对齐、内边距、主题色背景、文字色、底部边框 */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #4682D8;
    color: white;
    border-bottom: 1px solid #e9ecef;
}

/* 聊天联系人：flex布局、间距 */
.chat-contact {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 聊天联系人头像：大小、圆角、溢出隐藏、flex布局、半透明白色背景、右间距 */
.chat-contact-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    margin-right: 12px;
}

/* 联系人头像图片：全宽高、填充方式 */
.chat-contact-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 联系人信息：flex垂直布局 */
.chat-contact-info {
    display: flex;
    flex-direction: column;
}

/* 联系人名称：半粗体 */
.chat-contact-name {
    font-weight: 500;
}

/* 联系人状态：小字体、透明度 */
.chat-contact-status {
    font-size: 12px;
    opacity: 0.9;
}

/* 聊天操作按钮组：flex布局、间距 */
.chat-actions {
    display: flex;
    gap: 10px;
}

/* 小按钮：内边距、小字体、半透明白色背景、边框、白色文字、圆角、光标、过渡 */
.chat-actions .btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

/* 小按钮悬停：加深背景透明度 */
.chat-actions .btn-sm:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 聊天输入区域：内边距、顶部边框 */
.chat-input-area {
    padding: 15px;
    border-top: 1px solid #e9ecef;
}

/* 聊天输入框容器：flex布局、间距 */
.chat-input {
    display: flex;
    gap: 10px;
}

/* 聊天输入框：flex占满、内边距、边框、圆角、字体大小 */
.chat-input input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
}

/* 模态框：默认隐藏、固定定位、层级、覆盖全屏、半透黑背景 */
.modal {
    display: none; /* 默认隐藏 */
    position: fixed;
    z-index: 1000; /* 高层级，确保在最上层 */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5); /* 半透明黑色背景 */
}

/* 模态框内容：白色背景、居中、圆角、最大宽度、阴影、动画 */
.modal-content {
    background-color: white;
    margin: 5% auto;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease; /* 滑入动画 */
}

/* 模态框滑入动画：从上方滑入 */
@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-50px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 模态框头部：内边距、底部边框、flex布局（两端对齐）、对齐 */
.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 模态框标题：无外边距、颜色 */
.modal-header h3 {
    margin: 0;
    color: #333;
}

/* 关闭按钮：大字体、粗体、颜色、光标、行高 */
.close {
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
}

/* 关闭按钮悬停：深色 */
.close:hover {
    color: #333;
}

/* 模态框主体：内边距 */
.modal-body {
    padding: 20px;
}

/* 模态框底部：内边距、顶部边框、flex布局（右对齐）、间距 */
.modal-footer {
    padding: 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 模态框表单组：底部间距 */
.modal-body .form-group {
    margin-bottom: 20px;
}

/* 模态框标签：块级、底部间距、粗体、颜色 */
.modal-body label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

/* 模态框文本域、输入框、下拉框：全宽、内边距、边框、圆角、字体大小、继承字体 */
.modal-body textarea, .modal-body input[type="text"], .modal-body select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit; /* 继承父元素字体 */
}

/* 模态框文本域：可垂直 resize、最小高度 */
.modal-body textarea {
    resize: vertical;
    min-height: 100px;
}

/* 图片预览容器：flex布局、自动换行、间距、顶部间距 */
#image-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

/* 图片预览项：大小、填充方式、圆角、边框 */
.image-preview-item {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ddd;
}

/* 图片模态框内容：黑色半透明背景、居中、内边距、边框、宽高限制、flex布局 */
.image-modal-content {
    background-color: rgba(0, 0, 0, 0.9);
    margin: auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 模态框图片：最大宽高、块级、居中 */
.modal-image {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    margin: 0 auto;
}

/* 按钮基础样式：内边距、无边框、圆角、字体大小、粗体、光标、过渡 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}

/* 主要按钮：主题色背景、白色文字 */
.btn-primary {
    background: #4682D8;
    color: white;
}

/* 主要按钮悬停：加深背景色 */
.btn-primary:hover {
    background: #5a6fd8;
}

/* 次要按钮：中灰背景、白色文字 */
.btn-secondary {
    background: #6c757d;
    color: white;
}

/* 次要按钮悬停：加深背景色 */
.btn-secondary:hover {
    background: #545b62;
}

/* 管理员特定样式 */

/* 成功按钮：绿色背景、白色文字 */
.btn-success {
    background: #27ae60;
    color: white;
}

/* 成功按钮悬停：加深背景色 */
.btn-success:hover {
    background: #219653;
}

/* 危险按钮：红色背景、白色文字 */
.btn-danger {
    background: #e74c3c;
    color: white;
}

/* 危险按钮悬停：加深背景色 */
.btn-danger:hover {
    background: #c0392b;
}

/* 警告按钮：橙色背景、白色文字 */
.btn-warning {
    background: #f39c12;
    color: white;
}

/* 警告按钮悬停：加深背景色 */
.btn-warning:hover {
    background: #e67e22;
}

/* 小按钮：小内边距、小字体 */
.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

/* 大按钮：大内边距、大字体 */
.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

/* 表单组：底部间距 */
.form-group {
    margin-bottom: 20px;
}

/* 表单标签：块级、底部间距、粗体、颜色 */
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

/* 表单输入框、下拉框、文本域：全宽、内边距、边框、圆角、字体大小、继承字体、过渡 */
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s;
}

/* 表单元素聚焦：去除轮廓、边框颜色变化 */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4682D8;
}

/* 表单行：flex布局、间距、自动换行 */
.form-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

/* 表单行内的表单组：flex占满、最小宽度 */
.form-row .form-group {
    flex: 1;
    min-width: 200px;
}

/* 统计卡片容器：网格布局、自适应列数、间距、底部间距 */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* 统计卡片：白色背景、内边距、圆角、阴影、过渡、左侧主题色边框 */
.stat-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    border-left: 4px solid #4682D8; /* 左侧主题色边框，增强视觉 */
}

/* 统计卡片悬停：上移、加深阴影 */
.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* 统计卡片标题：小字体、颜色、底部间距、大写、字间距 */
.stat-card h3 {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 统计数值：大字体、粗体、颜色、底部间距 */
.stat-card .value {
    font-size: 32px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

/* 统计变化值：小字体、粗体 */
.stat-card .change {
    font-size: 12px;
    font-weight: 500;
}

/* 正向变化：绿色 */
.stat-card .change.positive {
    color: #27ae60;
}

/* 负向变化：红色 */
.stat-card .change.negative {
    color: #e74c3c;
}

/* 表格操作按钮组：flex布局、间距、自动换行 */
.table-actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

/* 通知容器：固定定位、右上角、高层级、flex垂直布局、间距 */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 通知项：flex布局、对齐、内边距、圆角、阴影、动画、最大宽度、白色背景 */
.notification {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    animation: slideInRight 0.3s ease-out; /* 从右侧滑入 */
    max-width: 400px;
    background: white;
}

/* 通知滑入动画：从右侧进入 */
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

/* 成功通知：左侧绿色边框、对应颜色和背景 */
.notification-success {
    border-left: 4px solid #28a745;
    color: #155724;
    background-color: #d4edda;
}

/* 错误通知：左侧红色边框、对应颜色和背景 */
.notification-error {
    border-left: 4px solid #dc3545;
    color: #721c24;
    background-color: #f8d7da;
}

/* 警告通知：左侧黄色边框、对应颜色和背景 */
.notification-warning {
    border-left: 4px solid #ffc107;
    color: #856404;
    background-color: #fff3cd;
}

/* 通知内容：flex占满、自动换行 */
.notification-content {
    flex: 1;
    word-break: break-word;
}

/* 通知关闭按钮：无背景、无边框、大字体、光标、透明度、左间距、无内边距、继承颜色 */
.notification-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.7;
    margin-left: 15px;
    padding: 0;
    color: inherit;
}

/* 关闭按钮悬停：不透明 */
.notification-close:hover {
    opacity: 1;
}

/* 表格操作按钮：小内边距、小字体 */
.table-actions .btn {
    padding: 6px 12px;
    font-size: 12px;
}

/* 筛选区域：白色背景、内边距、圆角、阴影、底部间距、flex布局、间距、自动换行、对齐 */
.filter-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

/* 筛选区域的表单组：无底部间距、flex占满、最小宽度 */
.filter-section .form-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 200px;
}

/* 状态徽章：内边距、圆角、小字体、半粗体、大写 */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

/* 激活状态：浅绿背景、深绿文字 */
.status-badge.active {
    background: #d4edda;
    color: #155724;
}

/* 未激活状态：浅红背景、深红文字 */
.status-badge.inactive {
    background: #f8d7da;
    color: #721c24;
}

/* 过期状态：浅黄背景、深黄文字 */
.status-badge.expired {
    background: #fff3cd;
    color: #856404;
}

/* 提示消息：内边距、圆角、底部间距、小字体、半粗体 */
.alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}

/* 成功提示：浅绿背景、深绿文字、边框 */
.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* 错误提示：浅红背景、深红文字、边框 */
.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 警告提示：浅黄背景、深黄文字、边框 */
.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* 信息提示：浅蓝背景、深蓝文字、边框 */
.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* 通知容器（重复定义，可能为了覆盖）：固定定位、右上角、高层级、flex垂直布局、间距 */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 通知项（重复定义）：flex布局、对齐、内边距、圆角、阴影、动画、最大宽度、白色背景 */
.notification {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    animation: slideInRight 0.3s ease-out;
    max-width: 400px;
    background: white;
}

/* 通知滑入动画（重复定义） */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 通知内容（重复定义）：flex占满、字体大小、半粗体 */
.notification-content {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

/* 通知关闭按钮（重复定义）：无背景、无边框、大字体、光标、透明度、左间距、继承颜色、大小、flex布局 */
.notification-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.7;
    margin-left: 15px;
    color: inherit;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 关闭按钮悬停（重复定义）：不透明 */
.notification-close:hover {
    opacity: 1;
}

/* 成功通知（重复定义）：左侧绿色边框、颜色和背景 */
.notification-success {
    border-left: 4px solid #28a745;
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

/* 错误通知（重复定义）：左侧红色边框、颜色和背景 */
.notification-error {
    border-left: 4px solid #dc3545;
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* 警告通知（重复定义）：左侧黄色边框、颜色和背景 */
.notification-warning {
    border-left: 4px solid #ffc107;
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

/* 信息通知（重复定义）：左侧浅蓝色边框、颜色和背景 */
.notification-info {
    border-left: 4px solid #17a2b8;
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

/* 响应式样式：屏幕宽度<=768px时生效 */
@media (max-width: 768px) {
    /* 侧边栏：窄宽度 */
    .sidebar {
        width: 200px;
    }
    
    /* 侧边栏头部：小字体 */
    .sidebar-header {
        font-size: 16px;
    }
    
    /* 侧边栏菜单链接：小内边距和字体 */
    .sidebar-menu a {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    /* 头部：小内边距 */
    .header {
        padding: 10px 15px;
    }
    
    /* 头部标题：小字体 */
    .header-left h1 {
        font-size: 18px;
    }
    
    /* 头部右侧：小间距 */
    .header-right {
        gap: 10px;
    }
    
    /* 内容区：小内边距 */
    .content {
        padding: 15px;
    }
    
    /* 卡片和统计卡片：单列布局 */
    .cards,
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    /* 表单行：垂直布局、无间距 */
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    /* 筛选区域：垂直布局、拉伸对齐 */
    .filter-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    /* 表格操作按钮：垂直布局 */
    .table-actions {
        flex-direction: column;
    }
    
    /* 聊天页面响应式：垂直布局、高度自适应 */
    .chat-main {
        flex-direction: column;
        height: auto;
    }
    
    /* 聊天会话列表：全宽、最大高度 */
    .chat-sessions {
        width: 100%;
        max-height: 300px;
    }
    
    /* 聊天标签和搜索区：垂直布局、间距、拉伸对齐 */
    .chat-tabs-search {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    /* 聊天搜索框：全宽 */
    .chat-search {
        width: 100%;
    }
    
    /* 聊天头部按钮组：自动换行 */
    .chat-header-buttons {
        flex-wrap: wrap;
    }
}

/* MMS历史记录样式：垂直滚动、最大高度、右侧内边距 */
.mms-history {
    overflow-y: auto;
    max-height: calc(100vh - 150px);
    padding-right: 5px;
}

/* MMS历史记录滚动条美化（Webkit） */
.mms-history::-webkit-scrollbar {
    width: 8px;
}

.mms-history::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.mms-history::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.mms-history::-webkit-scrollbar-thumb:hover {
    background: #555;
}