/**
 * 雷鸣科化石料考核系统 - 现代化样式
 */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #16a085;
    --light-bg: #ecf0f1;
    --dark-text: #2c3e50;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.navbar-brand i {
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.nav-link {
    transition: all 0.3s ease;
    border-radius: 5px;
    margin: 0 5px;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    font-weight: bold;
}

.container-fluid {
    max-width: 1400px;
}

.card {
    border: none;
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: white;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2) !important;
}

.card-header {
    border-bottom: 3px solid rgba(255, 255, 255, 0.2);
    padding: 1.25rem;
    font-weight: 600;
}

.card-header h5 {
    margin: 0;
    display: flex;
    align-items: center;
}

.card-header h5 i {
    margin-right: 10px;
    font-size: 1.3rem;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    vertical-align: middle;
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
    transform: scale(1.01);
}

.btn {
    border-radius: 8px;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn i {
    margin-right: 5px;
}

.form-control, .form-select {
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.modal-content {
    border-radius: 15px;
    border: none;
    overflow: hidden;
}

.modal-header {
    border-bottom: 3px solid rgba(0, 0, 0, 0.1);
}

.footer {
    background: white !important;
    margin-top: 3rem;
    box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.1);
}

/* 表格状态颜色 */
.table-success {
    background-color: #d4edda !important;
}

.table-danger {
    background-color: #f8d7da !important;
}

.table-warning {
    background-color: #fff3cd !important;
}

.table-info {
    background-color: #d1ecf1 !important;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.2rem;
    }

    .card {
        margin-bottom: 1rem;
    }

    .table {
        font-size: 0.85rem;
    }

    .btn {
        padding: 0.4rem 1rem;
        font-size: 0.9rem;
    }
}

/* 加载动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.5s ease;
}

/* 输入框特效 */
.form-control-sm {
    transition: all 0.2s ease;
}

.form-control-sm:focus {
    transform: scale(1.02);
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* 提示文本 */
.text-muted {
    color: #6c757d !important;
    font-style: italic;
}

/* 数字输入框优化 */
input[type="number"] {
    text-align: center;
}

/* 只读输入框样式 */
input[readonly] {
    background-color: #e9ecef;
    cursor: not-allowed;
}

/* 表格边框美化 */
.table-bordered {
    border: 2px solid #dee2e6;
}

.table-bordered th,
.table-bordered td {
    border: 1px solid #dee2e6;
}

/* 成功/失败标记样式 */
.fw-bold {
    font-size: 1.2rem;
}

/* 卡片阴影层次 */
.shadow-sm {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
}

/* ============================================
   销量录入页面专属样式
   ============================================ */

/* 日报卡片样式 */
.daily-input-card {
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.daily-input-card:hover {
    transform: translateY(-3px);
}

/* 渐变背景 */
.bg-gradient-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

/* 操作按钮样式 */
.btn-action {
    border-radius: 12px;
    font-weight: 600;
    padding: 12px 24px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-action:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.btn-action i {
    font-size: 1.1rem;
}

/* 销量输入表格样式 */
.sales-input-table {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sales-input-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.sales-input-table thead th {
    padding: 18px 15px;
    font-weight: 600;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

.sales-input-table tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid #f0f0f0;
}

.sales-input-table tbody tr:hover {
    background-color: #f8f9ff;
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

/* 聚焦行高亮 */
.sales-row.row-focused {
    background: linear-gradient(90deg, #e3f2fd 0%, #f3e5f5 100%) !important;
    box-shadow: inset 4px 0 0 #667eea;
}

/* 已填写数据的行 */
.sales-row.has-data {
    background-color: #e8f5e9;
}

.sales-row.has-data .unit-name-cell {
    font-weight: 700;
    color: #2e7d32;
}

/* 销量为0的行（浅黄色标记） */
.sales-row.has-zero-data {
    background-color: #fff9e6;
}

.sales-row.has-zero-data .unit-name-cell {
    font-weight: 700;
    color: #f57c00;
}

/* 0值输入框特殊样式 */
.sales-row.has-zero-data .sales-input {
    border-color: #ff9800;
    background-color: #fff9e6;
    color: #e65100;
    font-weight: 600;
}

/* 单位名称单元格 */
.unit-name-cell {
    font-size: 1.05rem;
    color: #2c3e50;
    padding: 15px;
}

/* 销量输入框样式 */
.sales-input {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
    transition: all 0.3s ease;
    text-align: right;
    padding-right: 15px;
}

.sales-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    background-color: #f8f9ff;
    transform: scale(1.02);
}

.sales-input::placeholder {
    color: #bdbdbd;
    font-weight: 400;
}

/* 输入组样式 */
.input-group-text {
    border: 2px solid #e0e0e0;
    background-color: #f8f9fa;
    color: #667eea;
    font-weight: 600;
}

.sales-input:focus + .input-group-text,
.input-group:focus-within .input-group-text {
    border-color: #667eea;
    background-color: #f8f9ff;
}

/* 合计显示样式 */
.total-display {
    padding: 15px;
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-radius: 12px;
    display: inline-block;
    min-width: 200px;
}

#total_sales {
    font-family: 'Courier New', monospace;
    color: #667eea;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* 合计更新动画 */
@keyframes totalPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.total-updated {
    animation: totalPulse 0.5s ease;
    color: #4caf50 !important;
}

/* 表格容器样式 */
.sales-table-container {
    border-radius: 15px;
    overflow: hidden;
    background: white;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* 序号徽章样式 */
.badge.bg-primary {
    padding: 8px 12px;
    font-size: 1rem;
    border-radius: 8px;
}

/* 提示信息样式 */
.alert-info {
    border-left: 4px solid #667eea;
    border-radius: 12px;
    background: linear-gradient(90deg, #e3f2fd 0%, #f3e5f5 100%);
    color: #2c3e50;
}

/* 进度条容器 */
#progress-container {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    text-align: center;
}

#progress-container .progress {
    border-radius: 10px;
}

/* ============================================
   考核表格优化样式
   ============================================ */

/* 考核等级行颜色 */
.table-success {
    background-color: #d4edda !important;
    border-left: 4px solid #28a745;
}

.table-info {
    background-color: #d1ecf1 !important;
    border-left: 4px solid #17a2b8;
}

.table-warning {
    background-color: #fff3cd !important;
    border-left: 4px solid #ffc107;
}

.table-danger {
    background-color: #f8d7da !important;
    border-left: 4px solid #dc3545;
}

/* 考核标记样式 */
.text-success.fw-bold {
    font-size: 1.3rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.text-danger.fw-bold {
    font-size: 1.3rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

/* ============================================
   月度报表优化样式
   ============================================ */

/* 表头双行样式 */
.table thead th[rowspan] {
    vertical-align: middle;
}

.table thead th[colspan] {
    border-bottom: none;
}

/* 天数统计单元格 */
.table tbody td {
    font-size: 1.1rem;
}

/* 合计行样式 */
.table-secondary {
    background-color: #e9ecef !important;
    border-top: 3px solid #495057 !important;
}

/* 完成率标记 */
.completion-rate-cell {
    font-size: 1.2rem;
    font-weight: 700;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .sales-input-table {
        font-size: 0.9rem;
    }

    .unit-name-cell {
        font-size: 0.95rem;
    }

    .sales-input {
        font-size: 1rem;
    }

    .total-display {
        min-width: 150px;
    }

    #total_sales {
        font-size: 1.5rem !important;
    }

    .btn-action {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

/* 加载动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sales-row {
    animation: fadeInUp 0.3s ease forwards;
}

.sales-row:nth-child(1) { animation-delay: 0.05s; }
.sales-row:nth-child(2) { animation-delay: 0.1s; }
.sales-row:nth-child(3) { animation-delay: 0.15s; }
.sales-row:nth-child(4) { animation-delay: 0.2s; }
.sales-row:nth-child(5) { animation-delay: 0.25s; }
.sales-row:nth-child(6) { animation-delay: 0.3s; }
.sales-row:nth-child(7) { animation-delay: 0.35s; }
.sales-row:nth-child(8) { animation-delay: 0.4s; }
.sales-row:nth-child(9) { animation-delay: 0.45s; }

/* ============================================
   单位管理页面按钮优化
   ============================================ */

/* 操作按钮样式 */
.btn-outline-primary,
.btn-outline-danger {
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-outline-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.3);
}

.btn-outline-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

/* 确保按钮可点击 */
.edit-btn,
.delete-btn {
    cursor: pointer;
    user-select: none;
}

.edit-btn i,
.delete-btn i {
    pointer-events: none;
}

/* 按钮禁用状态 */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 模态框优化 */
.modal-content {
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-bottom: 2px solid #f0f0f0;
}

.modal-footer {
    border-top: 2px solid #f0f0f0;
}

/* ============================================
   数据导入页面样式
   ============================================ */

/* 渐变成功色背景 */
.bg-gradient-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%) !important;
}

/* 模板下载按钮区域 */
.btn-lg {
    padding: 12px 30px;
    font-size: 1.1rem;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.btn-lg:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* 文件上传框美化 */
input[type="file"] {
    cursor: pointer;
    transition: all 0.3s ease;
}

input[type="file"]:hover {
    border-color: #667eea;
    background-color: #f8f9ff;
}

/* 代码示例框 */
pre {
    font-family: 'Courier New', Consolas, monospace;
    font-size: 0.9rem;
}

/* 预览表格样式 */
#previewTable {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

#previewTable thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

#previewTable tbody tr:hover {
    background-color: #f8f9ff;
}

/* 结果展示动画 */
#resultArea {
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 警告提示框 */
.alert-warning small {
    font-size: 0.9rem;
}
