/* style.css - 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

td {
    width: 6rem;
    max-width: 10rem;
}

/* 通用容器 */
.container {
    max-width: 100%;
    margin: 0 auto;
    background-color: white;
    min-height: 100vh;
}

/* 顶部导航栏 */
.navbar {
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    height: 30%;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #64b5f6, #1a73e8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.user-info h2 {
    font-size: 18px;
    margin-bottom: 2px;
}

.user-info p {
    font-size: 12px;
    opacity: 0.9;
}

.nav-right {
    display: flex;
    gap: 10px;
}

.logout-btn {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s;
}

.logout-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* 主要内容区域 */
.main-content {
    padding: 20px;
}

.section-title {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eaeaea;
}

.section-title h2 {
    font-size: 22px;
    color: #1a237e;
    margin-right: 15px;
}

.section-badge {
    background-color: #e8f0fe;
    color: #1a73e8;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

table {
    width: 100%;
    border-collapse: collapse;
    /* min-width: 600px; */
}

thead {
    background-color: #1a73e8;
    color: white;
}

th {
    padding: 5px;
    text-align: left;
    font-weight: 600;
    font-size: 15px;
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.2s;
}

tbody tr:hover {
    background-color: #f5f7fa;
}

td {
    padding: 5px;
    font-size: 15px;
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background-color: #1a73e8;
    color: white;
}

.btn-primary:hover {
    background-color: #0d47a1;
}

.btn-success {
    background-color: #43a047;
    color: white;
}

.btn-success:hover {
    background-color: #388e3c;
}

.btn-danger {
    background-color: #e53935;
    color: white;
}

.btn-danger:hover {
    background-color: #c62828;
}

.btn-warning {
    background-color: #f9a825;
    color: white;
}

.btn-warning:hover {
    background-color: #f57f17;
}

/* 统计卡片 */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-left: 5px solid #1a73e8;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card h3 {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-note {
    font-size: 13px;
    color: #888;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn 0.3s;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 500px;
    margin: 10% auto;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s;
}

.modal-header {
    background: #1a73e8;
    color: white;
    padding: 20px;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 25px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1a73e8;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
}

/* 状态标签 */
.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-normal {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-warning {
    background: #fff3e0;
    color: #f57c00;
}

.status-expired {
    background: #ffebee;
    color: #c62828;
}

/* 工具编号 */
.tool-number {
    background: #f5f5f5;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 14px;
}

/* 车次标签 */
.train-number {
    background: #e3f2fd;
    color: #1565c0;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.expired-tools-thead {
    background-color: #e53935;
}

.expired-days {
    color: #e53935;
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 响应式设计 */

@media (max-width: 768px) {
    /* .navbar {
        flex-direction: row;
        gap: 15px;
    }
    
    .nav-left, .nav-right {
        justify-content: center;
        flex-direction: column;
    }

    .nav-left {
        width: 70%;
    }

    .nav-right {
        width: 30%;
    } */

    .expired-tools-table-continer {
        width: 100%;
        overflow-x: auto;
        min-width: 600px;
        border-collapse: collapse;
    }

    .stats-cards {
        grid-template-columns: repeat(2,2fr);
        line-height: 1.2;
    }
    
    .section-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .section-actions{
        display: flex;
        flex-direction: row;
        justify-content: left;
        align-items: center;
        gap:10px;
    }
    
    th, td {
        padding: 5px;
        font-size: 14px;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
}

/* 响应式设计 */
/* @media (max-width: 768px) {
    .container {
        width: 100%;
        padding: 10px;
    }
    
    .navbar {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
    }
    
    .nav-left, .nav-right {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .nav-right {
        justify-content: flex-start;
    }
    
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-value {
        font-size: 28px;
    }
    
    .section-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .section-actions {
        width: 100%;
        justify-content: flex-start;
        gap: 10px;
    }
    
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    th, td {
        padding: 10px 8px;
        font-size: 14px;
        min-width: 80px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px auto;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-actions .btn {
        width: 100%;
        margin-bottom: 5px;
    }
} */

/* @media (max-width: 480px) {
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    .btn {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px;
        font-size: 14px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .pagination-info {
        width: 100%;
        text-align: center;
        margin: 10px 0;
    }
} */

/* 访客模式样式 */
.guest-mode .team-stats,
.guest-mode .add-btn,
.guest-mode .expired-tools {
    display: none !important;
}

/* 权限相关样式 */
.no-permission {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

/* 错误状态 */
.error {
    color: #e53935;
    text-align: center;
    padding: 20px;
}

/* 空数据状态 */
.no-data {
    text-align: center;
    padding: 40px;
    color: #888;
}

.no-data i {
    font-size: 48px;
    margin-bottom: 15px;
    color: #ddd;
}