/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    margin-top: 20px;
    margin-bottom: 20px;
}

/* 标题栏样式 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 3px solid #667eea;
    margin-bottom: 25px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    padding: 25px;
    border-radius: 8px;
    color: white;
}

.header h1 {
    color: white;
    font-size: 28px;
    font-weight: bold;
    margin: 0;
}

.header h1 i {
    margin-right: 10px;
    color: #fff;
}

.header-info {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 15px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

#status {
    font-weight: bold;
    color: #4ade80;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 控制面板样式 */
.control-panel {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.control-group {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-group label {
    font-weight: 600;
    color: #4a5568;
    min-width: 100px;
    font-size: 14px;
    white-space: nowrap;
}

.text-input,
.select-input {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background-color: white;
    font-weight: 500;
}

.text-input {
    flex: 1;
    min-width: 250px;
}

.select-input {
    min-width: 150px;
    cursor: pointer;
}

.text-input:focus,
.select-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

/* 按钮样式 */
.button-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn i {
    font-size: 14px;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, #a0aec0 0%, #718096 100%);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #718096 0%, #4a5568 100%);
}

.btn-success {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
}

.btn-warning {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #dd6b20 0%, #c05621 100%);
}

/* 按钮组内的按钮在响应式布局下自动调整大小 */
.button-group .btn {
    flex: 1;
    min-width: 120px;
    justify-content: center;
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
    margin-bottom: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    background-color: white;
    padding: 20px;
}

.duty-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
}

.duty-table th,
.duty-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.duty-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 1px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.duty-table tr {
    transition: all 0.3s ease;
    cursor: pointer;
}

.duty-table tr:hover {
    background-color: #f0f4ff;
    transform: scale(1.005);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.duty-table tr:nth-child(even) {
    background-color: #f7fafc;
}

.duty-table tr:nth-child(even):hover {
    background-color: #f0f4ff;
}

.duty-table td {
    font-size: 14px;
    font-weight: 500;
    color: #4a5568;
}

.duty-table td:nth-child(1),
.duty-table td:nth-child(2) {
    min-width: 250px;
}

/* 操作按钮样式 */
.action-btn {
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 8px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.action-btn:last-child {
    margin-right: 0;
}

.edit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.edit-btn:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.move-up-btn,
.move-down-btn {
    background: linear-gradient(135deg, #a0aec0 0%, #718096 100%);
    color: white;
    padding: 8px 12px;
}

.move-up-btn:hover,
.move-down-btn:hover {
    background: linear-gradient(135deg, #718096 0%, #4a5568 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 拖拽样式 */
.dragging {
    opacity: 0.6;
    background-color: #e0f2fe !important;
    transform: scale(1.01);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    border: 2px dashed #667eea;
}

.drag-over {
    border-top: 3px solid #667eea;
    background-color: #f0f4ff;
    transform: translateY(2px);
}

/* 文件状态样式 */
.file-status {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 25px;
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.file-status h3 {
    margin-bottom: 20px;
    color: #4a5568;
    font-size: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-status h3 i {
    color: #667eea;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: white;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.status-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.status-label {
    font-weight: 600;
    color: #4a5568;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-label i {
    color: #667eea;
    font-size: 16px;
}

.status-value {
    font-weight: bold;
    color: #48bb78;
    font-size: 14px;
    background: #e6fffa;
    padding: 6px 12px;
    border-radius: 15px;
    border: 1px solid #b2f5ea;
}

/* 模态框样式 */
.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);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    margin: 0;
    padding: 0;
    border: none;
    width: 90%;
    max-width: 550px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
    overflow: hidden;
}

.modal-header {
    padding: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: bold;
}

.close {
    color: white;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
}

.close:hover,
.close:focus {
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a5568;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-body .text-input {
    width: 100%;
    min-width: auto;
}

.modal-footer {
    padding: 20px 30px;
    background-color: #f7fafc;
    border-radius: 0 0 12px 12px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid #e2e8f0;
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 15px;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        padding: 20px;
    }

    .header h1 {
        font-size: 24px;
    }

    .header-info {
        flex-direction: column;
        gap: 10px;
        width: 100%;
        text-align: center;
    }

    .control-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .control-group label {
        min-width: auto;
    }

    .text-input {
        width: 100%;
        min-width: auto;
    }

    .button-group {
        width: 100%;
        flex-direction: column;
    }

    .button-group .btn {
        width: 100%;
        margin-bottom: 10px;
    }

    .button-group .btn:last-child {
        margin-bottom: 0;
    }

    .status-grid {
        grid-template-columns: 1fr;
    }

    .duty-table th,
    .duty-table td {
        padding: 12px 8px;
        font-size: 13px;
    }

    .duty-table td:nth-child(1),
    .duty-table td:nth-child(2) {
        min-width: 150px;
    }

    .action-btn {
        padding: 6px 10px;
        font-size: 12px;
        margin-right: 5px;
    }

    .modal-content {
        width: 95%;
        margin: 10px;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 20px;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 错误和成功消息样式 */
.message {
    padding: 12px 20px;
    border-radius: 8px;
    margin: 15px 0;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    animation: slideInRight 0.3s ease;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

/* 操作提示样式 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: #4a5568;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
    font-weight: normal;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #4a5568 transparent transparent transparent;
}

/* 按钮激活状态 */
.btn.active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 输入框焦点动画 */
.text-input,
.select-input {
    position: relative;
    overflow: hidden;
}

.text-input::after,
.select-input::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #667eea, transparent);
    transition: left 0.5s;
}

.text-input:focus::after,
.select-input:focus::after {
    left: 100%;
}

/* 操作成功反馈动画 */
@keyframes successPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(74, 222, 128, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
    }
}

.success-pulse {
    animation: successPulse 0.6s ease-in-out;
}

/* 加载状态 */
.loading-state {
    opacity: 0.7;
    pointer-events: none;
}

/* 交换模式激活行 */
.swap-mode-active {
    background-color: #e3f2fd !important;
    border: 2px dashed #2196f3;
    border-radius: 8px;
}

/* 按钮悬停时的图标旋转效果 */
.btn:hover i {
    transform: rotate(180deg);
    transition: transform 0.3s ease;
}

/* 表格行选中状态 */
.row-selected {
    background-color: #e3f2fd !important;
    border-left: 4px solid #667eea;
}

/* 响应式字体大小 */
html {
    font-size: 16px;
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
}