/* style.css - 共享样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Microsoft YaHei', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

:root {
    /* 颜色系统 */
    --primary-color: #4361ee;
    --primary-light: #4895ef;
    --primary-dark: #3a0ca3;
    --secondary-color: #4cc9f0;
    --success-color: #4ade80;
    --warning-color: #fbbf24;
    --danger-color: #f87171;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --gray-color: #6c757d;
    --gray-light: #e9ecef;
    --border-radius: 12px;
    --box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --box-shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.1);
    --transition: all 0.2s ease;
}

/* 基础样式 */
body {
    background-color: #f5f7fb;
    color: var(--dark-color);
    line-height: 1.5;
    min-height: 100vh;
    padding-bottom: env(safe-area-inset-bottom);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

/* 头部导航 */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(67, 97, 238, 0.2);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 44px;
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: center;
    margin: 0 8px;
}

.header-title i {
    margin-right: 8px;
    font-size: 20px;
}

.back-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition);
    flex-shrink: 0;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* 卡片基础样式 */
.card {
    background: white;
    border-radius: var(--border-radius);
    margin: 12px;
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    padding: 16px;
    border-bottom: 1px solid var(--gray-light);
    color: var(--dark-color);
    display: flex;
    align-items: center;
}

.card-title i {
    margin-right: 8px;
    color: var(--primary-color);
    font-size: 18px;
}

.card-content {
    padding: 16px;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    outline: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
}

.btn-secondary {
    background: var(--gray-light);
    color: var(--dark-color);
}

.btn-secondary:hover {
    background: #dee2e6;
}

.btn-block {
    width: 100%;
    margin-top: 8px;
}

/* 表单控件 - 优化版本 */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--dark-color);
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    font-size: 14px;
    transition: var(--transition);
    background: white;
    box-sizing: border-box;
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

/* 单选按钮组样式 */
.radio-group {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
}

.radio-label input[type="radio"] {
    margin-right: 6px;
    accent-color: var(--primary-color);
}

/* 人员列表页面 */
.staff-list-container {
    padding: 8px 12px;
}

.staff-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: white;
    border-radius: var(--border-radius);
    margin-bottom: 8px;
    box-shadow: var(--box-shadow);
}

.staff-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin-right: 12px;
    flex-shrink: 0;
}

.staff-info {
    flex: 1;
    min-width: 0;
}

.staff-name {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 15px;
    color: var(--dark-color);
}

.staff-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: var(--gray-color);
}

.staff-detail {
    display: flex;
    align-items: center;
}

.staff-detail i {
    margin-right: 4px;
    font-size: 11px;
}

.staff-actions {
    display: flex;
    gap: 6px;
    margin-left: 8px;
}

.action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-light);
    color: var(--dark-color);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.action-btn.edit {
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary-color);
}

.action-btn.delete {
    background: rgba(248, 113, 113, 0.1);
    color: var(--danger-color);
}

/* 多选框样式 */
.checkbox-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: white;
    border-radius: var(--border-radius);
    margin-bottom: 8px;
    box-shadow: var(--box-shadow);
}

.checkbox-item input {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
}

/* 设置页面 */
.settings-list {
    list-style: none;
}

.settings-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: white;
    border-bottom: 1px solid var(--gray-light);
    cursor: pointer;
    transition: var(--transition);
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-item:hover {
    background: var(--gray-light);
}

.settings-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(67, 97, 238, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    color: var(--primary-color);
    font-size: 18px;
    flex-shrink: 0;
}

.settings-info {
    flex: 1;
}

.settings-title {
    font-weight: 500;
    font-size: 15px;
    margin-bottom: 4px;
}

.settings-desc {
    font-size: 12px;
    color: var(--gray-color);
}

.settings-arrow {
    color: var(--gray-color);
    font-size: 14px;
}

/* 首页仪表板样式 */
.dashboard {
    padding-top: 4px;
}

.welcome-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 20px 16px;
    margin: 12px;
    border-radius: var(--border-radius);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(67, 97, 238, 0.3);
}

.welcome-card h1 {
    font-size: 20px;
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
}

.welcome-card p {
    opacity: 0.9;
    font-size: 14px;
    position: relative;
    z-index: 1;
}

.welcome-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 60px;
    opacity: 0.15;
    z-index: 0;
}

/* 统计卡片 - 强制3列布局 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 8px 0;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 12px 8px;
    text-align: center;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80px;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-lg);
}

.stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(67, 97, 238, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 6px;
    color: var(--primary-color);
    font-size: 14px;
}

.stat-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 2px;
    line-height: 1;
}

.stat-label {
    font-size: 11px;
    color: var(--gray-color);
    line-height: 1.2;
}

/* 功能菜单网格 - 强制3列布局 */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 8px 0;
}

.feature-item {
    background: white;
    border-radius: var(--border-radius);
    padding: 12px 8px;
    text-align: center;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
    min-height: 90px;
}

.feature-item:active {
    transform: scale(0.98);
}

.feature-item:hover {
    box-shadow: var(--box-shadow-lg);
}

.feature-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    color: white;
    font-size: 16px;
}

.feature-title {
    font-weight: 500;
    margin-bottom: 2px;
    color: var(--dark-color);
    font-size: 12px;
    line-height: 1.2;
}

.feature-desc {
    font-size: 10px;
    color: var(--gray-color);
    line-height: 1.2;
}

/* 筛选器容器 */
.filter-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.filter-item {
    margin-bottom: 0;
}

/* 列表视图样式（替代表格） */
.detail-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 0;
}

.list-item {
    background: white;
    border-radius: var(--border-radius);
    padding: 12px;
    box-shadow: var(--box-shadow);
    border-left: 4px solid var(--primary-color);
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-light);
}

.list-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--dark-color);
}

.list-date {
    font-size: 11px;
    color: var(--gray-color);
}

.list-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.list-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
}

.list-label {
    font-weight: 500;
    color: var(--gray-color);
    font-size: 12px;
}

.list-value {
    font-weight: 500;
    color: var(--dark-color);
    font-size: 12px;
}

.list-value.highlight {
    color: var(--primary-color);
    font-weight: 600;
}

/* 模态窗口 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--gray-light);
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--gray-color);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--danger-color);
}

.modal-body {
    padding: 16px;
}

/* 下拉刷新和加载更多 */
.pull-refresh {
    text-align: center;
    padding: 16px;
    color: var(--gray-color);
    font-size: 13px;
}

.load-more {
    text-align: center;
    padding: 20px 12px;
}

.load-more .btn {
    width: 100%;
}

/* 登录页面 */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

.login-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 24px 20px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.login-logo {
    text-align: center;
    margin-bottom: 24px;
}

.login-logo i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.login-logo h1 {
    font-size: 24px;
    color: var(--primary-dark);
    margin-bottom: 4px;
}

.login-logo p {
    color: var(--gray-color);
    font-size: 14px;
}

/* 响应式调整 - 只在非常小的屏幕上改为1列 */
@media (max-width: 360px) {
    .feature-grid,
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .list-content {
        grid-template-columns: 1fr;
    }

    .filter-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 280px) {
    .feature-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .feature-item,
    .stat-card {
        padding: 10px 6px;
        min-height: auto;
    }

    .feature-icon {
        width: 30px;
        height: 30px;
        font-size: 14px;
        margin-bottom: 6px;
    }

    .feature-title {
        font-size: 11px;
    }

    .feature-desc {
        font-size: 9px;
    }

    .stat-icon {
        width: 28px;
        height: 28px;
        font-size: 12px;
        margin-bottom: 4px;
    }

    .stat-value {
        font-size: 14px;
    }

    .stat-label {
        font-size: 10px;
    }
}

/* 工具类 */
.text-center {
    text-align: center;
}

.text-muted {
    color: var(--gray-color);
}

.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }

.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }

/* 优化加班设置表单 */
.overtime-form-group {
    margin-bottom: 16px;
}

.overtime-form-group .form-label {
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--dark-color);
}

.overtime-radio-group {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
}

.overtime-input-wrapper {
    background: rgba(67, 97, 238, 0.05);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid var(--gray-light);
    margin-top: 8px;
}

.overtime-input-wrapper .form-control {
    background: white;
}

/* 优化checkbox列表 */
.checkbox-list {
    max-height: 500px;
    overflow-y: auto;
    margin-bottom: 8px;
}

.checkbox-list .checkbox-item {
    margin-bottom: 6px;
    padding: 12px;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.checkbox-list .checkbox-item:hover {
    background: rgba(67, 97, 238, 0.03);
    border-left-color: var(--primary-color);
}

.checkbox-list .checkbox-item:last-child {
    margin-bottom: 0;
}

/* 优化人员信息显示 */
.staff-info-compact {
    flex: 1;
    min-width: 0;
}

.staff-name-compact {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 14px;
    color: var(--dark-color);
}

.staff-details-compact {
    font-size: 12px;
    color: var(--gray-color);
    line-height: 1.3;
}