/* 生产管理系统 - 主样式文件 */
/* 科技深蓝主题，白色字体，卡片交互效果 */

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

html {
    height: 100%;
}

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

/* ============================================
   头部导航样式 - 科技深蓝主题
============================================ */
.main-header {
    background: #1e3c72;
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 100%; /* 关键修改：全屏宽度 */
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 70px;
}

.system-title {
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
}

.system-title i {
    font-size: 1.8rem;
    color: #4dabf7;
}

.role-badge {
    background: #4dabf7;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: normal;
    margin-left: 10px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 25px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: white;
}

.user-info i {
    font-size: 1.2rem;
    color: #4dabf7;
}

.header-nav {
    display: flex;
    gap: 10px;
}

.nav-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
}

.nav-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.nav-button.logout-btn {
    background: rgba(255, 107, 107, 0.2);
    border-color: rgba(255, 107, 107, 0.3);
}

.nav-button.logout-btn:hover {
    background: rgba(255, 107, 107, 0.3);
}

/* ============================================
   主内容区 - 关键修改：全屏宽度
============================================ */
.content-wrapper {
    max-width: 100%; /* 关键修改：全屏宽度 */
    margin: 0 auto;
    padding: 30px 20px;
    min-height: calc(100vh - 70px);
}

/* ============================================
   看板样式
============================================ */
.dashboard-container {
    padding: 20px 0;
}

.dashboard-header {
    margin-bottom: 40px;
    text-align: center;
}

.dashboard-header h2 {
    font-size: 2rem;
    color: #1e3c72;
    margin-bottom: 10px;
}

.dashboard-header p {
    color: #666;
    font-size: 1.1rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.function-card {
    background: white;
    border-radius: 10px;
    padding: 30px 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    text-decoration: none;
    color: inherit;
    display: block;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    text-align: center;
    cursor: pointer;
}

.function-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #4dabf7;
}

.card-icon {
    width: 70px;
    height: 70px;
    background: #4dabf7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 1.8rem;
    color: white;
    transition: transform 0.3s ease;
}

.function-card:hover .card-icon {
    transform: scale(1.1);
}

.function-card h3 {
    font-size: 1.3rem;
    color: #1e3c72;
    margin-bottom: 10px;
}

.function-card p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ============================================
   用户管理页面样式
============================================ */
.page-container {
    max-width: 100%;
    margin: 0 auto;
}

.page-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.page-header h2 {
    font-size: 1.8rem;
    color: #1e3c72;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-header p {
    color: #666;
    font-size: 1.05rem;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    margin-bottom: 25px;
    overflow: hidden;
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.card-header h3 {
    font-size: 1.4rem;
    color: #1e3c72;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 25px;
}

/* 表单样式 */
.user-form {
    width: 100%;
}

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

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

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
    background: white;
    color: #495057;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #4dabf7;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    margin-top: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    border: 1px solid #e9ecef;
}

.checkbox-label:hover {
    background: #f1f3f5;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.checkbox-text {
    font-size: 0.9rem;
    color: #495057;
}

.form-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
    text-align: right;
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: #4dabf7;
    color: white;
    border: none;
}

.btn-primary:hover {
    background: #339af0;
}

.btn-edit {
    background: #40c057;
    color: white;
    border: none;
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-edit:hover {
    background: #2f9e44;
}

.btn-delete {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-delete:hover {
    background: #fa5252;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    background: white;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th {
    background: #f8f9fa;
    color: #495057;
    font-weight: 600;
    padding: 15px 20px;
    text-align: left;
    border-bottom: 2px solid #e9ecef;
    white-space: nowrap;
}

.data-table td {
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    color: #495057;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* 角色标签样式 */
.role-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    min-width: 80px;
}

.role-admin { background: #4dabf7; color: white; }
.role-order_publisher { background: #40c057; color: white; }
.role-technician { background: #be4bdb; color: white; }
.role-dispatcher { background: #fd7e14; color: white; }
.role-producer { background: #20c997; color: white; }
.role-inspector { background: #495057; color: white; }
.role-transporter { background: #ff6b6b; color: white; }
.role-shipper { background: #868e96; color: white; }

/* 操作按钮组 */
.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* 消息提示样式 */
.alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
}

.alert-success {
    background: #d3f9d8;
    color: #2b8a3e;
    border-color: #b2f2bb;
}

.alert-success i {
    color: #40c057;
}

.alert-error {
    background: #ffe3e3;
    color: #c92a2a;
    border-color: #ffc9c9;
}

.alert-error i {
    color: #ff6b6b;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #adb5bd;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #ced4da;
}

.empty-state p {
    font-size: 1.1rem;
    color: #868e96;
}

/* ============================================
   订单相关样式
============================================ */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
    border-left: 4px solid;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.stat-card-primary { border-left-color: #4dabf7; }
.stat-card-success { border-left-color: #28a745; }
.stat-card-warning { border-left-color: #ffc107; }
.stat-card-danger { border-left-color: #dc3545; }
.stat-card-info { border-left-color: #17a2b8; }
.stat-card-secondary { border-left-color: #6c757d; }

.stat-value {
    font-size: 2.2rem;
    font-weight: bold;
    color: #1e3c72;
    margin: 10px 0;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 订单状态标签 */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    min-width: 80px;
}

.status-待审核 { background: #ffc107; color: #000; }
.status-待排产 { background: #fd7e14; color: white; }
.status-已排产 { background: #17a2b8; color: white; }
.status-已完工 { background: #28a745; color: white; }
.status-在发货 { background: #007bff; color: white; }
.status-结束 { background: #6c757d; color: white; }

/* 文件图标颜色 */
.fa-image { color: #e74c3c; }
.fa-drafting-compass { color: #9b59b6; }
.fa-file-archive { color: #f39c12; }
.fa-file-excel { color: #27ae60; }
.fa-file-pdf { color: #e74c3c; }
.fa-file-word { color: #3498db; }
.fa-file { color: #95a5a6; }

/* ============================================
   物料详情页面专用样式 - 全屏优化
============================================ */
.bom-section-excel {
    background: white;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    width: 100%; /* 关键修改：全屏宽度 */
}

.table-header-excel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f0f0f0;
    border-bottom: 2px solid #d0d0d0;
}

.header-left, .header-right { flex: 1; }
.header-center { flex: 2; text-align: center; }

.table-title {
    margin: 0;
    color: #1e3c72;
    font-size: 1.4rem;
    font-weight: 600;
}

.bom-name {
    margin: 5px 0 0 0;
    color: #666;
    font-size: 0.9rem;
}

.order-number, .create-time {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.table-container-excel { 
    overflow-x: auto; 
    width: 100%; /* 关键修改：全屏宽度 */
}

.excel-style-table {
    width: 100%; /* 关键修改：全屏宽度 */
    border-collapse: collapse;
    font-size: 0.85rem;
    min-width: 100%; /* 关键修改：最小宽度100% */
}

.excel-style-table th {
    background: #1e3c72;
    color: white;
    font-weight: 600;
    padding: 10px 8px;
    text-align: center;
    border: 1px solid #e0e0e0;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

.excel-style-table td {
    padding: 8px;
    border: 1px solid #e0e0e0;
    text-align: left;
    vertical-align: middle;
}

.excel-style-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.excel-style-table tbody tr:hover {
    background-color: #e3f2fd;
}

/* 列宽设置 - 优化全屏显示 */
.col-index { width: 60px; text-align: center; }
.col-name { width: 200px; min-width: 180px; }
.col-spec { width: 180px; min-width: 150px; }
.col-workshop { width: 120px; text-align: center; }
.col-process { width: 180px; min-width: 150px; }
.col-model { width: 140px; }
.col-unit { width: 100px; text-align: center; }
.col-quantity { width: 100px; text-align: right; }
.col-unit-weight { width: 100px; text-align: right; }
.col-total-weight { width: 120px; text-align: right; }
.col-unit-price { width: 120px; text-align: right; }
.col-amount { width: 120px; text-align: right; }
.col-notes { width: 200px; min-width: 150px; }
.col-actions { width: 100px; text-align: center; }

/* 数字列样式 */
.number {
    font-family: 'Courier New', monospace;
    text-align: right;
}

/* 合计行样式 */
.total-row {
    background: #e3f2fd !important;
    font-weight: 600;
}

.total-row td {
    border-top: 2px solid #1e3c72;
    padding: 10px 8px;
}

.total-label {
    text-align: right !important;
    font-weight: 600;
    color: #1e3c72;
}

/* Excel样式输入框 */
.excel-input {
    width: 100%;
    border: none;
    padding: 4px 6px;
    font-size: 0.85rem;
    background: transparent;
    outline: none;
}

.excel-input:focus {
    background: #e3f2fd;
    border: 1px solid #4dabf7;
}

.unit-select {
    width: 100%;
    border: none;
    padding: 4px 2px;
    font-size: 0.85rem;
    background: transparent;
    outline: none;
}

/* 物料详情页面按钮样式 */
.btn-export-table, .btn-print, .btn-back, .btn-save, .btn-add-row, .btn-save-review {
    background: linear-gradient(to bottom, #4dabf7, #1c7ed6);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 14px;
}

.btn-export-table:hover, .btn-print:hover, .btn-back:hover, .btn-save:hover, 
.btn-add-row:hover, .btn-save-review:hover {
    background: linear-gradient(to bottom, #339af0, #1971c2);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-print { background: linear-gradient(to bottom, #20c997, #12b886); }
.btn-print:hover { background: linear-gradient(to bottom, #12b886, #0ca678); }

.btn-back { background: linear-gradient(to bottom, #6c757d, #5a6268); }
.btn-back:hover { background: linear-gradient(to bottom, #5a6268, #495057); }

.btn-save { background: linear-gradient(to bottom, #28a745, #218838); }
.btn-save:hover { background: linear-gradient(to bottom, #218838, #1e7e34); }

.btn-add-row { background: linear-gradient(to bottom, #fd7e14, #e8590c); }
.btn-add-row:hover { background: linear-gradient(to bottom, #e8590c, #d9480f); }

.btn-save-review { background: linear-gradient(to bottom, #17a2b8, #138496); }
.btn-save-review:hover { background: linear-gradient(to bottom, #138496, #117a8b); }

.main-action-buttons {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-start;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

/* 审核区域样式 */
.review-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    border: 1px solid #e9ecef;
}

.review-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #1e3c72;
}

.review-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.review-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.review-notes {
    min-height: 80px;
    resize: vertical;
}

/* ============================================
   打印样式
============================================ */
@media print {
    .bom-section-excel {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .excel-style-table {
        border: 1px solid #000;
    }
    
    .excel-style-table th,
    .excel-style-table td {
        border: 1px solid #000;
    }
    
    .main-action-buttons,
    .review-section {
        display: none;
    }
}

/* ============================================
   响应式设计
============================================ */

/* 平板设备 (768px及以下) */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        height: auto;
        padding: 15px;
    }
    
    .header-right {
        width: 100%;
        justify-content: space-between;
        margin-top: 15px;
    }
    
    .content-wrapper {
        padding: 20px 15px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .checkbox-group {
        grid-template-columns: 1fr;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 12px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .table-header-excel {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .header-left, .header-center, .header-right {
        flex: none;
    }
    
    .table-title {
        font-size: 1.2rem;
    }
    
    .excel-style-table {
        font-size: 0.7rem;
    }
    
    .excel-style-table th,
    .excel-style-table td {
        padding: 6px 4px;
    }
    
    .col-actions {
        width: 60px;
    }
}

/* 手机设备 (480px及以下) */
@media (max-width: 480px) {
    .system-title {
        font-size: 1.3rem;
    }
    
    .nav-button {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    .function-card {
        padding: 25px 20px;
    }
    
    .card-body {
        padding: 20px;
    }
    
    .main-action-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .review-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn-export-table, .btn-print, .btn-back, .btn-save, 
    .btn-add-row, .btn-save-review {
        width: 100%;
        justify-content: center;
        margin-bottom: 8px;
    }
    
    .excel-style-table {
        font-size: 0.6rem;
    }
    
   .excel-style-table th,
    .excel-style-table td {
        padding: 4px 2px;
    }
    
    .col-actions {
        width: 50px;
    }
}

/* 超大屏幕设备 (1920px及以上) 的优化 */
@media (min-width: 1920px) {
    .dashboard-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
    
    .function-card {
        padding: 40px 30px;
    }
    
    .table-container {
        border-radius: 8px;
    }
    
    .data-table th,
    .data-table td {
        padding: 20px 25px;
        font-size: 1rem;
    }
    
    .bom-section-excel {
        border-radius: 8px;
    }
    
    .excel-style-table {
        font-size: 1rem;
    }
    
    .excel-style-table th,
    .excel-style-table td {
        padding: 12px 10px;
    }
    
    .col-index { width: 80px; }
    .col-name { width: 250px; min-width: 220px; }
    .col-spec { width: 200px; min-width: 180px; }
    .col-process { width: 200px; min-width: 180px; }
    .col-amount { width: 140px; }
    .col-unit-price { width: 140px; }
}

/* 中屏设备 (992px-1279px) 优化 */
@media (min-width: 992px) and (max-width: 1279px) {
    .dashboard-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

/* 滚动条美化（仅Webkit浏览器） */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 焦点样式改进 */
*:focus {
    outline: 2px solid #4dabf7;
    outline-offset: 2px;
}

*:focus:not(.focus-visible) {
    outline: none;
}

/* 表格加载状态 */
.table-loading {
    position: relative;
    min-height: 200px;
}

.table-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

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

.mb-0 { margin-bottom: 0; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }

.mt-0 { margin-top: 0; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
    padding: 20px 0;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    background: white;
    border: 1px solid #e9ecef;
    color: #495057;
    text-decoration: none;
    transition: all 0.2s ease;
}

.page-link:hover {
    background: #4dabf7;
    color: white;
    border-color: #4dabf7;
}

.page-link.active {
    background: #4dabf7;
    color: white;
    border-color: #4dabf7;
}

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 90%;
    max-height: 90%;
    overflow: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: modalAppear 0.3s ease-out;
}

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

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

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

/* 表单验证样式 */
.form-control.is-invalid {
    border-color: #ff6b6b;
}

.form-control.is-valid {
    border-color: #40c057;
}

.invalid-feedback {
    color: #ff6b6b;
    font-size: 0.85rem;
    margin-top: 4px;
    display: block;
}

/* 标签样式 */
.label {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0 2px;
}

.label-primary { background: #4dabf7; color: white; }
.label-success { background: #40c057; color: white; }
.label-warning { background: #ffc107; color: #000; }
.label-danger { background: #ff6b6b; color: white; }
.label-info { background: #17a2b8; color: white; }
.label-secondary { background: #6c757d; color: white; }

/* 卡片网格布局优化 */
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* 鼠标悬停工具提示 */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    white-space: nowrap;
    z-index: 10;
    margin-bottom: 8px;
}

.tooltip:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #333;
    z-index: 10;
    margin-bottom: 2px;
}

/* 移动端文件上传优化 */
@media (max-width: 480px) {
    .file-upload-area {
        padding: 20px 15px;
    }
    
    .file-upload-icon {
        font-size: 2rem;
    }
    
    .upload-hint {
        font-size: 0.8rem;
        line-height: 1.3;
    }
    
    .mobile-hint {
        font-size: 0.8rem;
    }
    
    .file-item {
        padding: 8px 10px;
    }
    
    .file-name {
        font-size: 0.9rem;
    }
    
    .file-size {
        font-size: 0.8rem;
    }
    
    .mobile-btn {
        padding: 14px 16px;
        font-size: 1rem;
    }
}

/* 触摸反馈 */
button:active, .nav-button:active, .file-upload-area:active {
    opacity: 0.8;
    transition: opacity 0.1s;
}

/* 移动端表单优化 */
input, select, textarea {
    font-size: 16px; /* 防止iOS缩放 */
}

/* 防止移动端点击延迟 */
* {
    touch-action: manipulation;
}