/* ========================================
   报表管理系统 - 全局样式
   ======================================== */

/* CSS Reset & 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 通用样式 - 防止溢出 */
img,
embed,
object,
video {
    max-width: 100%;
    height: auto;
}

/* 确保所有表单元素都不会溢出 */
input,
textarea,
select,
button {
    max-width: 100%;
    box-sizing: border-box;
}

/* 防止长文本溢出 */
p,
span,
div,
td,
th {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* 布局样式 */
.layout-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.header {
    background: linear-gradient(135deg, #1a1d21 0%, #252a30 100%);
    color: white;
    padding: 0;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15), 0 1px 3px rgba(0,0,0,0.1);
    flex-shrink: 0;
    height: 60px;
    position: relative;
    z-index: 1001;
    width: 100%;
}

.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(0,123,255,0.3), transparent);
}

.header-left {
    flex-shrink: 0;
    padding-left: 24px;
}

.header-left h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 1px;
    color: white;
}

.header-left h1 a {
    display: inline-block;
    color: inherit;
    text-decoration: none;
}

.header-nav {
    display: flex;
    justify-content: flex-start;
    margin-left: 88px;
}

.header-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 4px;
    align-items: center;
}

.header-nav ul li {
    margin: 0;
    position: relative;
}

.header-nav ul li a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 12px 24px;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 15px;
    font-weight: 500;
    position: relative;
    background: transparent;
}

.header-nav ul li a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #00d4ff, #0099cc);
    border-radius: 3px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}

.header-nav ul li a:hover {
    color: #ffffff;
    background: rgba(0, 212, 255, 0.12);
}

.header-nav ul li a:hover::before {
    width: 100%;
}

.header-nav ul li a.active {
    color: #ffffff;
    background: rgba(0, 212, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.header-nav ul li a.active::before {
    width: 80%;
    background: linear-gradient(90deg, #00d4ff, #0099cc);
}

/* 下拉菜单样式 */
.header-nav ul li.dropdown {
    position: relative;
}

.header-nav ul li.dropdown .dropdown-toggle {
    padding-right: 32px;
}

.header-nav ul li.dropdown .dropdown-toggle::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid rgba(255,255,255,0.6);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-nav ul li.dropdown:hover .dropdown-toggle::after {
    transform: translateY(-50%) rotate(180deg);
    border-top-color: #00d4ff;
}

.header-nav ul li.dropdown .dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    min-width: 180px;
    background: linear-gradient(180deg, #2d3436 0%, #212529 100%);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.05);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow: hidden;
    backdrop-filter: blur(10px);
    display: block;
}

.header-nav ul li.dropdown .dropdown-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: #2d3436;
    border-left: 1px solid rgba(255,255,255,0.05);
    border-top: 1px solid rgba(255,255,255,0.05);
}

.header-nav ul li.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.header-nav ul li.dropdown .dropdown-menu li {
    padding: 0;
    display: block !important;
    width: 100%;
}

.header-nav ul li.dropdown .dropdown-menu li:not(:last-child) {
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.header-nav ul li.dropdown .dropdown-menu li a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    font-size: 14px;
    border-radius: 0;
    color: rgba(255,255,255,0.8);
    white-space: nowrap;
    transform: none;
    width: 100%;
    position: relative;
    min-height: 48px;
    box-sizing: border-box;
    text-align: center;
}

.header-nav ul li.dropdown .dropdown-menu li a::before {
    display: none;
}

.header-nav ul li.dropdown .dropdown-menu li a:hover {
    background: rgba(0, 212, 255, 0.15);
    color: #00d4ff;
    transform: none;
    padding-left: 24px;
}

.header-nav ul li.dropdown .dropdown-menu li a:hover::after {
    content: '';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background: #00d4ff;
    border-radius: 50%;
}

.header-nav ul li.dropdown .dropdown-menu li a.active {
    background: rgba(0, 212, 255, 0.1);
    color: #00d4ff;
    box-shadow: none;
}

/* 菜单项禁用状态（首次登录未设置用户名密码时） */
.header-nav ul li.dropdown .dropdown-menu li .menu-disabled,
.sidebar-submenu li .menu-disabled {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    font-size: 14px;
    color: #666;
    cursor: not-allowed;
    opacity: 0.5;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s;
    position: relative;
}

.header-nav ul li.dropdown .dropdown-menu li .menu-disabled::after {
    content: ' (请先设置用户名密码)';
    font-size: 11px;
    color: #999;
}

.header-nav ul li.dropdown .dropdown-menu li a.active::after {
    content: '';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background: #00d4ff;
    border-radius: 50%;
}

.header-right {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 20px;
    padding-right: 24px;
    margin-left: auto;
}

.header-right .user-name {
    font-size: 13px;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    transition: all 0.25s ease;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
}

.header-right .user-name:hover {
    color: #00d4ff;
    background: rgba(0,123,255,0.15);
    text-decoration: none;
}

.header-right .logout-btn {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.25s ease;
    background: rgba(220,53,69,0.15);
    border: 1px solid rgba(220,53,69,0.3);
}

.header-right .logout-btn:hover {
    background: rgba(220,53,69,0.25);
    color: #ff6b6b;
    border-color: rgba(220,53,69,0.5);
}

.main-container {
    display: flex;
    flex: 1;
    position: relative;
    overflow: visible;
}

/* ========================================
   分组侧边栏样式
   ======================================== */
.group-sidebar {
    flex-shrink: 0;
    min-width: 60px;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    z-index: 10;
    display: flex;
    flex-direction: column;
    position: sticky;
    align-self: flex-start;
    transition: width 0.3s ease;
}

.group-sidebar.collapsed {
    width: 60px;
}

.group-sidebar-header {
    padding: 15px 16px;
    font-size: 15px;
    font-weight: bold;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    letter-spacing: 0.5px;
    position: relative;
}

.group-sidebar-header .sidebar-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.3s ease;
}

.group-sidebar.collapsed .sidebar-title {
    opacity: 0;
    width: 0;
}

.group-sidebar-toggle {
    position: absolute;
    right: 10px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.3s ease;
    padding: 0;
}

.group-sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

.group-sidebar.collapsed .group-sidebar-toggle {
    right: 50%;
    transform: translateX(50%);
}

.group-sidebar-header.report-header {
    background: linear-gradient(135deg, #165DFF 0%, #0FC6C2 100%);
}

.group-sidebar-header.attendance-header {
    background: linear-gradient(135deg, #F53F3F 0%, #F77234 100%);
}

.group-sidebar-header.app-header {
    background: linear-gradient(135deg, #722ED1 0%, #F5319D 100%);
}

.group-sidebar-header.setting-header {
    background: linear-gradient(135deg, #165DFF 0%, #0FC6C2 100%);
}

.group-sidebar-header > i:first-child {
    font-size: 16px;
    transition: opacity 0.3s ease;
}

.group-sidebar.collapsed .group-sidebar-header > i:first-child {
    opacity: 0;
    width: 0;
    display: none;
}

.group-sidebar-body {
    padding: 4px 0;
    flex: 1;
    overflow-y: auto;
}

.group-sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    text-decoration: none;
    color: #1D2129;
    font-size: 14px;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
}

.group-sidebar.collapsed .group-sidebar-item {
    padding: 12px 0;
    justify-content: center;
    gap: 0;
}

.group-sidebar.collapsed .group-sidebar-item span,
.group-sidebar.collapsed .group-sidebar-item::after,
.group-sidebar.collapsed .sidebar-text {
    display: none;
}

.group-sidebar-item::after {
    content: '';
    position: absolute;
    right: 16px;
    top: 50%;
    width: 6px;
    height: 6px;
    border-right: 1.5px solid #C9CDD4;
    border-top: 1.5px solid #C9CDD4;
    transform: translateY(-50%) rotate(45deg);
    opacity: 0;
    transition: all 0.3s ease;
}

.group-sidebar-item:hover {
    background: #F2F3F5;
    color: #1D2129;
    text-decoration: none;
    padding-left: 24px;
}

.group-sidebar-item:hover::after {
    opacity: 1;
    right: 14px;
}

.group-sidebar-item.active {
    color: #165DFF;
    background: #F0F5FF;
    border-left-color: #165DFF;
    font-weight: 500;
}

.group-sidebar-item.active::after {
    border-right-color: #165DFF;
    border-top-color: #165DFF;
    opacity: 1;
}

.group-sidebar-item i {
    width: 20px;
    text-align: center;
    font-size: 15px;
    opacity: 0.65;
    transition: all 0.3s ease;
}

.group-sidebar-item:hover i,
.group-sidebar-item.active i {
    opacity: 1;
}

/* 分组侧边栏响应式：移动端隐藏 */
@media (max-width: 768px) {
    .group-sidebar {
        display: none !important;
    }
}

.content {
    flex: 1;
    overflow-y: auto;
    overflow-x: visible;
    background: #f5f7fa;
    min-width: 0;
    position: relative;
    z-index: 1;
    min-height: calc(100vh - 60px);
    box-sizing: border-box;
}

/* 内容容器 - 统一页边距 */
.container {
    padding: 20px 24px;
    max-width: 100%;
    overflow-x: visible;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .container {
        padding: 12px 12px;
    }
}

/* ========================================
   链接样式
   ======================================== */
a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* 用户信息区域样式已整合到 .header-right */

/* ========================================
   按钮样式
   ======================================== */
.btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #007bff 0%, #0069d9 100%);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,123,255,0.3);
}

/* 按年查看按钮包装器 - 确保与其他按钮保持一致 */
#yearViewBtnWrapper_attendance,
#yearViewBtnWrapper {
    display: inline-block;
    vertical-align: middle;
}

/* 确保按年查看按钮在flex布局中与其他按钮保持一致的尺寸 */
.actions-bar #yearViewBtnWrapper_attendance,
.actions-bar #yearViewBtnWrapper {
    display: flex;
    align-items: stretch;
}

.actions-bar #yearViewBtnWrapper_attendance .btn,
.actions-bar #yearViewBtnWrapper .btn {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn:hover {
    background: linear-gradient(135deg, #0069d9 0%, #0056b3 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,123,255,0.4);
    text-decoration: none;
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0069d9 100%);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    box-shadow: 0 2px 4px rgba(40,167,69,0.3);
}

.btn-success:hover {
    background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
    box-shadow: 0 4px 8px rgba(40,167,69,0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    box-shadow: 0 2px 4px rgba(220,53,69,0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    box-shadow: 0 4px 8px rgba(220,53,69,0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    box-shadow: 0 2px 4px rgba(108,117,125,0.3);
    text-align: center;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268 0%, #545b62 100%);
    box-shadow: 0 4px 8px rgba(108,117,125,0.4);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

/* ========================================
   输入框样式
   ======================================== */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
textarea,
select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
    color: #333;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="datetime-local"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

input[type="text"]:hover,
input[type="password"]:hover,
input[type="email"]:hover,
input[type="number"]:hover,
input[type="tel"]:hover,
input[type="url"]:hover,
input[type="date"]:hover,
input[type="time"]:hover,
input[type="datetime-local"]:hover,
textarea:hover,
select:hover {
    border-color: #adb5bd;
}

input[type="text"][disabled],
input[type="password"][disabled],
input[type="email"][disabled],
input[type="number"][disabled],
textarea[disabled],
select[disabled] {
    background: #e9ecef;
    cursor: not-allowed;
    opacity: 0.7;
}

/* 输入框占位符样式 */
input::placeholder,
textarea::placeholder {
    color: #6c757d;
    opacity: 1;
}

input:focus::placeholder,
textarea:focus::placeholder {
    color: #adb5bd;
}

/* ========================================
   下拉列表样式
   ======================================== */
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: white;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-clip: padding-box;
    background-origin: padding-box;
    padding-right: 36px;
    min-width: 100px;
    cursor: pointer;
    max-width: 100%;
    box-sizing: border-box;
}

/* 优化下拉选项样式 */
select option {
    padding: 8px 12px;
    max-width: 100%;
    word-wrap: break-word;
    background-color: white;
    background-image: none;
    -webkit-appearance: none;
    appearance: none;
}

/* IE/Edge 隐藏默认下拉箭头 */
select::-ms-expand {
    display: none;
}

select:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23007bff' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
}

select option {
    padding: 8px 12px;
}

/* ========================================
   单选框和复选框样式
   ======================================== */
input[type="radio"],
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0 8px 0 0;
    cursor: pointer;
    accent-color: #007bff;
}

input[type="radio"]:focus,
input[type="checkbox"]:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* 自定义单选框样式 */
.radio-group,
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-label,
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.radio-label:hover,
.checkbox-label:hover {
    background: rgba(0,123,255,0.05);
}

/* form-check 样式（用于复选框和标签在同一行） */
.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: nowrap;
}

.form-check-input {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: #007bff;
    flex-shrink: 0;
}

.form-check-label {
    margin-bottom: 0;
    cursor: pointer;
    font-weight: 400;
    line-height: 1.5;
}

/* 文本颜色工具类 */
.text-danger {
    color: #dc3545;
}

.text-warning {
    color: #ffc107;
}

.text-success {
    color: #28a745;
}

.text-primary {
    color: #007bff;
}

/* ========================================
   颜色选择器样式
   ======================================== */
input[type="color"] {
    width: 50px;
    height: 35px;
    padding: 2px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

input[type="color"]:hover {
    border-color: #007bff;
    transform: scale(1.05);
}

input[type="color"]:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

/* ========================================
   表单样式
   ======================================== */
.form-group {
    overflow: hidden;
    padding: 10px 32px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* 水平表单布局 - label和input在同一行 */
.form-horizontal .form-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    overflow: hidden;
}

.form-horizontal .form-group label {
    display: block;
    margin-bottom: 0;
    min-width: 140px;
    max-width: 140px;
    text-align: right;
    flex-shrink: 0;
    box-sizing: border-box;
}

.form-horizontal .form-group input,
.form-horizontal .form-group textarea,
.form-horizontal .form-group select {
    flex: 1;
    width: auto;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

/* 响应式 - 移动端恢复垂直布局 */
@media (max-width: 768px) {
    .form-horizontal .form-group {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .form-horizontal .form-group label {
        min-width: auto;
        max-width: none;
        text-align: left;
    }
    
    .form-horizontal .form-group input,
    .form-horizontal .form-group textarea,
    .form-horizontal .form-group select {
        width: 100%;
    }
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-inline {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-inline .form-group {
    margin-bottom: 0;
}

/* ========================================
   表格样式
   ======================================== */
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-radius: 4px;
    overflow: hidden;
    table-layout: fixed;
}

/* 表格容器 - 防止表格溢出 */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
    max-width: 100%;
}

.table-responsive .table {
    min-width: 600px;
}

.table th,
.table td {
    border: 1px solid #dee2e6;
    padding: 12px 15px;
    text-align: left;
}

.table th {
    background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
}

.table tbody tr {
    transition: background 0.2s ease;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

.table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.table tbody tr:nth-child(even):hover {
    background: #f1f3f5;
}

/* ========================================
   搜索表单样式
   ======================================== */
.search-form {
    margin-bottom: 20px;
    padding: 15px 20px;
    background: white;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    overflow: hidden;
}

.search-form input[type="text"],
.search-form select {
    min-width: 200px;
    max-width: 100%;
    box-sizing: border-box;
}

/* 响应式优化 - 搜索表单 */
@media (max-width: 768px) {
    .search-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-form input[type="text"],
    .search-form select {
        width: 100%;
        min-width: auto;
    }
}

/* ========================================
   顶部操作栏样式（标题+按钮+筛选表单在同一行）
   ======================================== */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 5px;
}

.title-with-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.title-with-actions h2 {
    margin: 0;
    font-size: 20px;
    white-space: nowrap;
}

.actions-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* 响应式优化 - 顶部操作栏 */
@media (max-width: 768px) {
    .top-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .title-with-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .actions-bar {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .actions-bar .btn {
        flex: 1;
        min-width: 0;
        font-size: 12px;
        padding: 6px 10px;
    }
}

/* ========================================
   筛选表单样式（统一所有页面）
   ======================================== */
.filter-section {
    overflow: visible;
    flex: 0 0 auto;
    background: transparent;
    border: none;
    box-shadow: none;
    min-width: auto;
    max-width: none;
}

/* inline-flex 确保表单宽度严格等于内容宽度，不会撑满 */
.filter-form {
    display: inline-flex;
    gap: 15px;
    align-items: center;
    flex-wrap: nowrap;
    padding: 10px 15px;
    overflow: visible;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #dee2e6;
}

/* 桌面端：确保筛选表单在一行内显示 */
@media (min-width: 769px) {
    .top-bar {
        flex-wrap: nowrap;
        align-items: center;
    }
    
    .title-with-actions {
        flex-wrap: nowrap;
    }
    
    .filter-section {
        flex: 0 0 auto;
        min-width: auto;
        max-width: none;
        margin-left: auto;
    }
    
    /* 使用极高优先级选择器确保桌面端筛选表单水平排列 */
    html body .filter-section .filter-form,
    html body form.filter-form {
        display: inline-flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 15px !important;
        overflow: visible !important;
        grid-template-columns: none !important;
        margin-left: auto !important;
    }
    
    .filter-form > * {
        flex-shrink: 0;
        flex-grow: 0;
    }
    
    /* 员工选择器在桌面端限制最大宽度 */
    .desktop-employee-selector {
        max-width: 220px;
        flex-shrink: 0;
    }
    
    .desktop-employee-selector .emp-dropdown {
        width: 100px;
    }
}

.filter-form input[type="text"],
.filter-form input[type="month"],
.filter-form input[type="date"],
.filter-form select {
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    min-width: 120px;
    max-width: 100%;
    box-sizing: border-box;
}

.filter-form input[type="text"]:focus,
.filter-form input[type="month"]:focus,
.filter-form input[type="date"]:focus,
.filter-form select:focus {
    outline: none;
    border-color: #40a9ff;
    box-shadow: 0 0 0 2px rgba(24,144,255,0.1);
}

/* 响应式优化 - 筛选表单 */
@media (max-width: 768px) {
    .filter-form {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .filter-form input[type="text"],
    .filter-form input[type="month"],
    .filter-form input[type="date"],
    .filter-form select {
        width: 100%;
        min-width: auto;
    }
}

/* 考勤统计页面：桌面端显示员工选择器，隐藏移动端员工选择器 */
.desktop-employee-selector {
    display: inline-block;
}

.mobile-employee-selector {
    display: none;
}

/* ========================================
   提示信息样式
   ======================================== */
.error {
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.success {
    color: #28a745;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.warning {
    color: #856404;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.info {
    color: #004085;
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* ========================================
   页面标题样式
   ======================================== */
h2 {
    color: #1F2937;
    font-size: 28px;
    font-weight: 600;
    border-bottom: 2px solid #007bff;
}

h2.text-white {
    color: #fff;
}

h3 {
    color: #495057;
    font-size: 18px;
    font-weight: 600;
}

/* ========================================
   卡片样式
   ======================================== */
.card {
    background: white;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
    overflow: hidden;
    box-sizing: border-box;
    max-width: 100%;
}

.card-header {
    font-size: 16px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
    overflow: hidden;
    word-wrap: break-word;
}

/* ========================================
   响应式设计
   ======================================== */
/* ========================================
   响应式设计 - 优化移动端体验
   ======================================== */

/* 平板设备优化 */
@media (max-width: 992px) {
    .header {
        flex-wrap: nowrap;
        height: auto;
        padding: 10px 15px;
        position: relative;
    }
    
    .header-left {
        flex-basis: auto;
        flex-shrink: 0;
        text-align: left;
        margin-bottom: 0;
        padding-left: 0;
        padding-right: 15px;
    }
    
    .header-left h1 {
        font-size: 16px;
        white-space: nowrap;
    }
    
    .header-nav {
        order: 0;
        flex-basis: auto;
        flex: 1;
        margin-top: 0;
        padding-top: 0;
        border-top: none;
        margin-left: 0;
        min-width: 0;
    }
    
    .header-nav ul {
        justify-content: flex-start;
        flex-wrap: nowrap;
        gap: 3px;
        overflow: hidden;
    }
    
    .header-nav ul li {
        display: inline-flex;
        flex-shrink: 0;
    }
    
    .header-nav ul li a {
        padding: 6px 10px;
        font-size: 12px;
        white-space: nowrap;
    }
    
    .header-right {
        position: static;
        flex-basis: auto;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        z-index: auto;
    }
    
    .header-right .user-name {
        display: none;
    }
    
    .header-right .logout-btn,
    .header-right .login-btn,
    .header-right .center-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    /* 节日倒计时在平板端缩小显示 */
    .header-duty {
        margin-left: 15px !important;
        margin-right: 10px !important;
    }
    .header-duty .led-duty-display {
        min-width: auto !important;
        padding: 4px 8px !important;
    }
    #desktop-festival-countdown {
        font-size: 11px !important;
    }
    
    .content {
        padding: 15px;
        min-height: calc(100vh - 130px);
    }
}

/* 手机设备优化 - 主要断点 */
@media (max-width: 768px) {
    .header {
        padding: 8px 10px;
    }
    
    .header-left h1 {
        font-size: 16px;
    }
    
    .header-nav ul {
        gap: 2px;
    }
    
    .header-nav ul li a {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .header-right {
        position: absolute;
        top: 8px;
        right: 10px;
    }
    
    .content {
        padding: 10px;
        min-height: calc(100vh - 120px);
    }
    
    /* 表单优化 */
    .form-inline {
        flex-direction: column;
        gap: 10px;
    }
    
    /* 搜索表单移动端样式已迁移至 mobile.css */
    
    /* 表格优化 - 添加水平滚动 */
    .table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .table th,
    .table td {
        min-width: 100px;
        padding: 10px;
        font-size: 13px;
    }
    
    /* 按钮优化 - 触摸友好 */
    .btn {
        padding: 10px 20px;
        font-size: 14px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    .btn-sm {
        padding: 8px 16px;
        font-size: 13px;
        min-height: 36px;
    }
    
    /* 表单元素优化 */
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="number"],
    input[type="tel"],
    input[type="url"],
    input[type="date"],
    input[type="time"],
    input[type="datetime-local"],
    textarea,
    select {
        padding: 12px;
        font-size: 16px;
        min-height: 44px;
    }
    
    /* 标题优化 */
    h2 {
        font-size: 22px;
        margin-bottom: 15px;
    }
    
    h3 {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    /* 卡片优化 */
    .card {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    /* 操作按钮区域样式已迁移至 mobile.css */
}

/* 小屏手机设备优化 */
@media (max-width: 480px) {
    .header-left h1 {
        font-size: 14px;
    }
    
    .header-nav ul li a {
        padding: 5px 8px;
        font-size: 11px;
    }
    
    .content {
        padding: 8px;
    }
    
    h2 {
        font-size: 20px;
    }
    
    .table th,
    .table td {
        padding: 8px;
        font-size: 12px;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* 侧边栏显示控制 */
@media (max-width: 768px) {
    /* 显示侧边栏切换按钮 */
    .sidebar-toggle {
        display: flex !important;
    }
    
    /* 显示侧边栏（默认隐藏，active时显示） */
    .sidebar {
        display: flex !important;
    }
    
    /* 隐藏桌面端导航 */
    .header-nav {
        display: none !important;
    }
    
    /* 调整header布局 */
    .header {
        padding-left: 50px !important;
        justify-content: flex-start !important;
        flex-wrap: nowrap !important;
    }
    
    .header-left {
        flex-basis: auto;
        margin-bottom: 0;
        flex-shrink: 0;
        text-align: left;
        padding-left: 10px;
    }
    
    .header-duty {
        margin-left: auto !important;
        margin-right: 5px !important;
        flex-shrink: 0;
    }
    
    .header-right {
        flex-shrink: 0;
        margin-left: 0 !important;
        padding-right: 5px !important;
    }
    
    /* 隐藏桌面端用户信息，侧边栏中显示 */
    .header-right .user-name {
        display: none !important;
    }
    .header-right .logout-btn {
        padding: 4px 8px;
        font-size: 12px;
    }
}

/* 桌面端隐藏侧边栏相关元素 */
@media (min-width: 769px) {
    .sidebar-toggle,
    .sidebar-overlay,
    .sidebar {
        display: none !important;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .header-nav ul li a,
    input[type="radio"],
    input[type="checkbox"],
    select {
        min-height: 44px;
        min-width: 44px;
    }
    
    .btn:hover,
    .header-nav ul li a:hover {
        transform: none;
    }
    
    .btn:active {
        transform: scale(0.98);
    }
}

/* 横屏优化 */
@media (max-height: 500px) and (orientation: landscape) {
    .header {
        height: 50px;
        padding: 5px 15px;
    }
    
    .header-left h1 {
        font-size: 16px;
    }
    
    .content {
        min-height: calc(100vh - 50px);
    }
}

/* 打印样式 */
@media print {
    .header,
    .header-nav,
    .header-right,
    .actions-bar,
    .btn,
    .search-form {
        display: none !important;
    }
    
    .content {
        padding: 0;
    }
    
    .table {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}

/* ========================================
   动画效果
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content {
    animation: fadeIn 0.3s ease;
}

/* ========================================
   SQL执行器样式
   ======================================== */
.sql-page {
    max-width: 1200px;
    margin: 0 auto;
}

.sql-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-left: 4px solid #ffc107;
    padding: 16px 20px;
    border-radius: 6px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.2);
}

.sql-warning::before {
    content: '⚠';
    font-size: 24px;
    flex-shrink: 0;
}

.sql-form {
    background: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 24px;
}

.sql-textarea {
    width: 100%;
    min-height: 200px;
    padding: 16px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.sql-textarea:focus {
    outline: none;
    border-color: #007bff;
    background: white;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.sql-textarea::placeholder {
    color: #adb5bd;
}

.sql-confirm {
    margin: 20px 0;
    padding: 16px;
    background: rgba(220, 53, 69, 0.05);
    border: 1px solid rgba(220, 53, 69, 0.2);
    border-radius: 6px;
}

.sql-confirm input[type="checkbox"] {
    margin-right: 10px;
}

.sql-confirm label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #dc3545;
    font-weight: 500;
}

.sql-result {
    background: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    animation: fadeIn 0.3s ease;
}

.sql-result h4 {
    color: #495057;
    font-size: 18px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sql-result h4::before {
    content: '📊';
}

.sql-result .result-count {
    color: #6c757d;
    font-size: 14px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #dee2e6;
}

.sql-result table {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}

.sql-result thead {
    background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
}

.sql-result th {
    background: transparent;
    border-bottom: 2px solid #dee2e6;
    border-right: 1px solid #dee2e6;
    padding: 14px 16px;
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
}

.sql-result th:last-child {
    border-right: none;
}

.sql-result tbody tr {
    transition: background 0.2s ease;
}

.sql-result tbody tr:hover {
    background: #f0f6ff;
}

.sql-result tbody tr:nth-child(even) {
    background: #fafbfc;
}

.sql-result tbody tr:nth-child(even):hover {
    background: #f0f6ff;
}

.sql-result td {
    border-bottom: 1px solid #dee2e6;
    border-right: 1px solid #dee2e6;
    padding: 12px 16px;
    color: #333;
}

.sql-result td:last-child {
    border-right: none;
}

.sql-result tbody tr:last-child td {
    border-bottom: none;
}

.sql-result .success-message {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-left: 4px solid #28a745;
    padding: 16px 20px;
    border-radius: 6px;
    color: #155724;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sql-result .success-message::before {
    content: '✓';
    font-size: 24px;
    font-weight: bold;
}

.sql-error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-left: 4px solid #dc3545;
    padding: 16px 20px;
    border-radius: 6px;
    color: #721c24;
    margin-top: 24px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.2);
}

.sql-error::before {
    content: '✗';
    font-size: 24px;
    flex-shrink: 0;
}

.sql-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.sql-actions .btn {
    min-width: 120px;
}

/* ========================================
   滚动条样式优化 - 更易操作
   ======================================== */
::-webkit-scrollbar {
    width: 14px;  /* 增加垂直滚动条宽度 */
    height: 14px; /* 增加水平滚动条高度（底部滚动条） */
}

::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 7px;
    box-shadow: inset 0 0 3px rgba(0,0,0,0.1);
}

::-webkit-scrollbar-thumb {
    background: #b0b0b0;
    border-radius: 7px;
    border: 2px solid #f0f0f0; /* 添加边框，使滚动条更明显 */
    min-width: 50px; /* 最小宽度，避免太小 */
}

::-webkit-scrollbar-thumb:hover {
    background: #888888;
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
}

::-webkit-scrollbar-thumb:active {
    background: #666666;
}

/* 针对水平滚动条（底部滚动条）的特殊优化 */
::-webkit-scrollbar-horizontal {
    height: 16px; /* 水平滚动条更高一些 */
}

/* Firefox 滚动条样式 */
* {
    scrollbar-width: auto; /* 改为auto，使滚动条更宽 */
    scrollbar-color: #b0b0b0 #f0f0f0;
}

/* 表格容器的滚动提示 */
.table-responsive {
    position: relative;
}

/* 滚动提示箭头 */
.table-responsive::before,
.table-responsive::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 10;
}

.table-responsive::before {
    left: 5px;
    border-width: 8px 10px 8px 0;
    border-color: transparent #666 transparent transparent;
}

.table-responsive::after {
    right: 5px;
    border-width: 8px 0 8px 10px;
    border-color: transparent transparent transparent #666;
}

.table-responsive:hover::before,
.table-responsive:hover::after {
    opacity: 0.8;
}

/* 移动端触摸滚动优化 */
@media (max-width: 768px) {
    ::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }
    
    .table {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    
    /* 移动端添加滚动阴影提示 */
    .table-responsive {
        background: 
            linear-gradient(to right, #fff 30%, rgba(255,255,255,0)),
            linear-gradient(to left, #fff 30%, rgba(255,255,255,0)) right,
            radial-gradient(farthest-side at 0 50%, rgba(0,0,0,0.2), rgba(0,0,0,0)),
            radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,0.2), rgba(0,0,0,0)) right;
        background-repeat: no-repeat;
        background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
        background-attachment: local, local, scroll, scroll;
    }
}

/* ============ 会员中心移动端适配 ============ */
/* 覆盖各会员页内联基础样式（内联样式优先级高，故用 !important） */
@media (max-width: 768px) {
    .center-wrapper {
        flex-direction: column !important;
        max-width: 100% !important;
        margin: 15px auto !important;
        padding: 0 12px !important;
        gap: 12px !important;
    }
    .member-sidebar {
        width: 100% !important;
        flex-shrink: 1 !important;
    }
    /* 用户信息卡：横向紧凑排列 */
    .member-sidebar .user-card {
        display: flex !important;
        align-items: center !important;
        text-align: left !important;
        gap: 12px !important;
        padding: 14px 16px !important;
        margin-bottom: 12px !important;
    }
    .member-sidebar .user-avatar {
        width: 48px !important;
        height: 48px !important;
        font-size: 22px !important;
        margin-bottom: 0 !important;
    }
    .member-sidebar .user-name {
        flex: 1 !important;
        min-width: 0 !important;
        margin-bottom: 2px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }
    /* 导航菜单：横向滚动 */
    .member-sidebar .nav-menu {
        display: flex !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    .member-sidebar .nav-menu a {
        flex: 0 0 auto !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 4px !important;
        padding: 10px 16px !important;
        border-bottom: none !important;
        border-right: 1px solid #f0f0f0 !important;
        white-space: nowrap !important;
        font-size: 13px !important;
    }
    .member-sidebar .nav-menu a:last-child {
        border-right: none !important;
    }
    .member-sidebar .nav-menu a.active {
        border-right: none !important;
        border-bottom: 3px solid #007bff !important;
    }
    .member-sidebar .nav-menu .nav-icon {
        width: auto !important;
        font-size: 18px !important;
    }
    .member-main .panel {
        padding: 18px !important;
    }
    .member-main .panel h2 {
        font-size: 18px !important;
    }
    /* 表格在窄屏横向滚动，避免挤爆 */
    .member-main .article-table,
    .member-main .data-table {
        display: block !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        white-space: nowrap !important;
    }
    /* 成长记录统计卡换行 */
    .growth-summary {
        flex-wrap: wrap !important;
    }
    .growth-summary .stat-card {
        min-width: 120px !important;
    }
}

@media (max-width: 480px) {
    .member-main .panel {
        padding: 14px !important;
    }
    .member-sidebar .nav-menu a {
        padding: 8px 12px !important;
        font-size: 12px !important;
    }
}