:root {
    --primary-color: #4a6cf7;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
}

body {
    background-color: #f5f7fb;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.navbar {
    background: linear-gradient(135deg, var(--primary-color), #6a8dff);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-tabs {
    border-bottom: 2px solid #dee2e6;
}

.nav-tabs .nav-link {
    border: none;
    color: #6c757d;
    font-weight: 500;
    padding: 12px 20px;
    transition: all 0.3s;
}

.nav-tabs .nav-link:hover {
    color: var(--primary-color);
    border: none;
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    border: none;
    border-bottom: 3px solid var(--primary-color);
    background: transparent;
}

.duty-plan-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s;
}

.duty-plan-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.duty-plan-date {
    font-weight: 600;
    color: #333;
}

.duty-plan-person {
    color: #666;
    font-size: 0.95rem;
}

.duty-plan-type {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-left: 10px;
}

.type-weekend {
    background: #ffc107;
    color: #000;
}

.type-holiday {
    background: #dc3545;
    color: #fff;
}

.type-custom {
    background: #17a2b8;
    color: #fff;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 20px;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color), #6a8dff);
    color: white;
    border-radius: 15px 15px 0 0 !important;
    padding: 15px 20px;
    font-weight: 600;
}

.calendar-container {
    background: white;
    border-radius: 15px;
    padding: 20px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-nav-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s;
}

.calendar-nav-btn:hover {
    background: #3a5bd7;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.calendar-day-header {
    text-align: center;
    font-weight: 600;
    padding: 10px 5px;
    color: var(--secondary-color);
}

.calendar-day {
    min-height: 80px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 5px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.calendar-day:hover {
    background-color: #f0f4ff;
    border-color: var(--primary-color);
}

.calendar-day.today {
    background-color: #e6f0ff;
    border-color: var(--primary-color);
    font-weight: bold;
    box-shadow: 0 0 0 2px var(--primary-color);
    position: relative;
    z-index: 1;
}

.calendar-day.today .calendar-day-number {
    color: var(--primary-color);
    font-size: 1.05rem;
}

.calendar-day.weekend {
    background-color: #fff3cd;
}

.calendar-day.holiday {
    background-color: #ffe6e6;
}

.calendar-day.empty {
    background-color: #f8f9fa;
    cursor: default;
}

.calendar-day-number {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.calendar-day-duty {
    font-size: 0.75rem;
    background: var(--primary-color);
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    margin-top: 2px;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.duty-person-list {
    list-style: none;
    padding: 0;
}

.duty-person-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #e9ecef;
    transition: background 0.3s;
}

.duty-person-item:hover {
    background-color: #f8f9ff;
}

.duty-person-item:last-child {
    border-bottom: none;
}

.duty-person-name {
    font-weight: 600;
}

.duty-person-email {
    color: var(--secondary-color);
    font-size: 0.85rem;
}

.btn-duty {
    background: var(--primary-color);
    border: none;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-duty:hover {
    background: #3a5bd7;
    transform: translateY(-2px);
    color: white;
}

.stats-card {
    text-align: center;
    padding: 20px;
}

.stats-card i {
    opacity: 0.8;
}

.stats-card h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 10px 0;
}

.stats-card h5 {
    color: var(--secondary-color);
    margin-bottom: 0;
}

.duty-plan-item {
    padding: 15px;
    border-left: 4px solid var(--primary-color);
    background: white;
    margin-bottom: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
}

.duty-plan-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateX(5px);
}

.duty-plan-date {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.duty-plan-person {
    font-size: 1.1rem;
    font-weight: 600;
}

.duty-plan-type {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 10px;
}

.type-weekend {
    background: #fff3cd;
    color: #856404;
}

.type-holiday {
    background: #ffe6e6;
    color: #721c24;
}

.modal-content {
    border-radius: 15px;
    border: none;
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color), #6a8dff);
    color: white;
    border-radius: 15px 15px 0 0;
}

.modal-header .btn-close {
    filter: invert(1);
}

.duty-code {
    font-family: monospace;
    font-size: 1.1rem;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    letter-spacing: 2px;
    font-weight: 600;
}

.secret-key-input {
    text-align: center;
    font-size: 1.2rem;
    letter-spacing: 3px;
}

.badge-weekend {
    background: #fff3cd;
    color: #856404;
}

.badge-holiday {
    background: #ffe6e6;
    color: #721c24;
}

.badge-custom {
    background: #d1ecf1;
    color: #0c5460;
}

.alert {
    border-radius: 10px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(74, 108, 247, 0.25);
}

@media (max-width: 768px) {
    .calendar-day {
        min-height: 60px;
    }
    
    .calendar-day-number {
        font-size: 0.8rem;
    }
    
    .calendar-day-duty {
        font-size: 0.65rem;
    }
    
    .stats-card h2 {
        font-size: 2rem;
    }
    
    /* 登录页响应式优化 */
    #loginContent {
        padding: 0 15px;
        margin-top: 20px !important;
    }
    
    #loginContent .card {
        margin-bottom: 15px;
    }
    
    #loginContent .card-body {
        padding: 20px 15px;
    }
    
    #loginContent .card-header h4 {
        font-size: 1.2rem;
    }
    
    #loginContent .fa-4x {
        font-size: 3rem !important;
    }
    
    #loginContent .form-control-lg {
        font-size: 1rem;
        padding: 10px 12px;
    }
    
    #loginContent .btn-lg {
        font-size: 1rem;
        padding: 10px 16px;
    }
    
    /* 备案信息横向排列优化 */
    #siteFooter {
        padding: 0 10px;
    }
    
    #siteFooter .gap-3 {
        gap: 0.5rem !important;
    }
    
    #siteFooter span {
        white-space: nowrap;
    }
    
    /* 主内容区响应式 */
    #mainContent {
        padding: 0 10px;
    }
    
    /* 统计卡片在手机上一列显示 */
    .row.mb-4 {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .row.mb-4 .col-md-3 {
        flex: 0 0 calc(50% - 5px);
        max-width: calc(50% - 5px);
    }
    
    .card {
        border-radius: 10px;
        margin-bottom: 15px;
    }
    
    .card-header {
        padding: 12px 15px;
    }
    
    .card-header h4 {
        font-size: 1.1rem;
    }
    
    .card-body {
        padding: 15px;
    }
    
    /* 日历响应式 */
    .calendar-header {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .calendar-header h4 {
        font-size: 1.1rem;
        width: 100%;
        text-align: center;
    }
    
    .calendar-nav-btn {
        padding: 5px 10px;
        font-size: 0.9rem;
    }
    
    /* 日历和侧边栏在手机上的布局 */
    #calendarTab .row {
        display: block;
    }
    
    #calendarTab .col-lg-8,
    #calendarTab .col-lg-4 {
        width: 100%;
        padding: 0;
    }
    
    #calendarTab .col-lg-4 {
        margin-top: 15px;
    }
    
    /* 我的值班标签页响应式 */
    #myDutyTab .row {
        display: block;
    }
    
    #myDutyTab .col-md-8,
    #myDutyTab .col-md-4 {
        width: 100%;
        padding: 0;
    }
    
    #myDutyTab .col-md-4 {
        margin-top: 15px;
    }
    
    /* 统计卡片响应式 */
    .stats-card {
        padding: 15px;
        margin-bottom: 10px;
    }
    
    .stats-card i {
        font-size: 2rem;
    }
    
    .stats-card h2 {
        font-size: 1.5rem;
    }
    
    .stats-card h5 {
        font-size: 0.9rem;
    }
    
    /* 值班计划列表响应式 */
    #upcomingDuties {
        max-height: 300px;
    }
    
    /* 人员列表响应式 */
    .person-item {
        padding: 10px;
    }
    
    /* 按钮响应式 */
    .btn {
        font-size: 0.9rem;
        padding: 8px 12px;
    }
    
    .btn-lg {
        padding: 10px 16px;
        font-size: 1rem;
    }
    
    /* 模态框响应式 */
    .modal-dialog {
        margin: 10px;
    }
    
    .modal-header {
        padding: 12px 15px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    /* 表格响应式 */
    .table-responsive {
        font-size: 0.85rem;
    }
    
    /* 导航栏响应式 */
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .nav-tabs .nav-link {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    /* 邮件提醒设置响应式 */
    #emailReminderSettings .d-flex {
        flex-wrap: wrap;
    }
    
    #emailReminderSettings .form-control {
        font-size: 0.9rem;
    }
    
    /* 人员列表项响应式 */
    .person-item {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .person-item .btn {
        font-size: 0.8rem;
        padding: 4px 8px;
    }
    
    /* 日历格子优化 */
    .calendar-grid {
        font-size: 0.85rem;
    }
    
    .calendar-day-duty {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* 平板响应式 */
@media (min-width: 769px) and (max-width: 1024px) {
    #loginContent {
        margin-top: 30px !important;
    }
    
    .stats-card {
        padding: 20px;
    }
    
    .stats-card i {
        font-size: 2.5rem;
    }
    
    .stats-card h2 {
        font-size: 2.2rem;
    }
    
    .calendar-day {
        min-height: 80px;
    }
}
