/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #ffffff 0%, #f0f8ff 25%, #e3f2fd 50%, #bbdefb 75%, #e3f2fd 100%);
    background-attachment: fixed;
    color: #333;
    font-weight: 400;
    line-height: 1.5;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* 科技感背景网格 */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.12;
    background-image: linear-gradient(rgba(25, 118, 210, 0.4) 1px, transparent 1px), linear-gradient(90deg, rgba(25, 118, 210, 0.4) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
    z-index: 0;
}

/* 科技感装饰元素 */
body::after {
    content: '';
    position: absolute;
    top: 5%;
    left: 5%;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    background: rgba(25, 118, 210, 0.12);
    filter: blur(60px);
    pointer-events: none;
    z-index: 0;
}

/* 添加额外的装饰元素 */
/* 注意：由于一个元素只能有一个::before和一个::after，我们使用body的父元素或其他方式添加更多装饰 */
/* 这里我们通过在body上添加一个额外的背景层来模拟第三个装饰元素 */
body {
    background: 
        radial-gradient(circle at 85% 95%, rgba(76, 175, 80, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(103, 58, 183, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, #ffffff 0%, #f0f8ff 25%, #e3f2fd 50%, #bbdefb 75%, #e3f2fd 100%);
    background-attachment: fixed;
}

/* 容器层级调整 */
.container, .dashboard-container {
    position: relative;
    z-index: 1;
}

/* 登录页面 */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 30px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.login-container h1 {
    margin-bottom: 30px;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #3498db;
    color: #fff;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-success {
    background-color: #27ae60;
    color: #fff;
}

.btn-success:hover {
    background-color: #219a52;
}

.btn-danger {
    background-color: #e74c3c;
    color: #fff;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 14px;
}

.error-message {
    color: #e74c3c;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #fee;
    border-radius: 4px;
}

.login-info {
    margin-top: 20px;
    font-size: 14px;
    color: #7f8c8d;
}

/* 导航栏 */
.navbar {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #fff;
    padding: 15px 30px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand {
    font-size: 16px;
    font-weight: 700;
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    min-width: 0;
    flex: 1;
    justify-content: flex-start;
}

.navbar-menu {
    flex: 3;
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-right: 0;
}

.navbar-user {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    margin-left: 40px;
}

.navbar-brand img {
    height: 40px;
    width: 40px;
    object-fit: contain;
    background: none;
    border: none;
    box-shadow: none;
    display: inline-block;
    vertical-align: middle;
}

.navbar-brand span {
    display: inline-block;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.navbar-menu {
    display: flex;
    gap: 20px;
}

.nav-item {
    color: #ecf0f1;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.5s ease;
}

.nav-item:hover::before {
    left: 100%;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.nav-item.active {
    background: linear-gradient(135deg, #3498db, #2980b9);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.4);
}

/* 下拉菜单样式 */
.nav-item.dropdown {
    position: relative;
    display: flex;
    align-items: center;
    color: #ecf0f1;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
}

.nav-item.dropdown::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.5s ease;
}

.nav-item.dropdown:hover::before {
    left: 100%;
}

.nav-item.dropdown:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.nav-item.dropdown.active {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: #ecf0f1;
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.4);
}

.nav-item.dropdown .nav-link {
    color: inherit;
    text-decoration: none;
    padding: 0;
    border-radius: 0;
    display: block;
    transition: all 0.3s ease;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-item.dropdown:hover .nav-link {
    background: none;
    color: inherit;
}

.nav-item.dropdown.active .nav-link {
    background: none;
    color: inherit;
    padding: 0;
    border-radius: 0;
}

.dropdown-content {
    display: none;
    position: absolute;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    min-width: 200px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    z-index: 1000;
    border-radius: 10px;
    margin-top: 8px;
    left: 50%;
    transform: translateX(-50%);
    top: 100%;
    padding: 8px 0;
    box-sizing: border-box;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-item.dropdown:hover .dropdown-content,
.nav-item.dropdown .dropdown-content:hover {
    display: block;
}

.dropdown-item {
    color: #ecf0f1;
    padding: 12px 20px;
    text-decoration: none;
    display: block;
    transition: all 0.3s ease;
    border-radius: 8px;
    text-align: center;
    margin: 4px 8px;
    width: calc(100% - 16px);
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

.dropdown-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.5s ease;
}

.dropdown-item:hover::before {
    left: 100%;
}

.nav-link {
    text-align: center;
    display: block;
    width: 100%;
}

.dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateX(4px);
}

.dropdown-item.active {
    background: linear-gradient(135deg, #3498db, #2980b9);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.4);
}

.nav-item.logout {
    background-color: #e74c3c;
}

.nav-item.logout:hover {
    background-color: #c0392b;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-role {
    font-size: 14px;
    color: #bdc3c7;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 30px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* 标题样式 */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #2c3e50;
}

.dashboard-container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 20px;
}

/* 功能导航 */
.navigation-menu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.nav-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 40px 30px;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(5px);
}

.nav-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    border-color: #3498db;
    background: linear-gradient(135deg, #f8f9fa 0%, #e3f2fd 100%);
}

.nav-icon {
    font-size: 48px;
    margin-bottom: 20px;
    display: block;
}

.nav-card h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 20px;
}

.nav-card p {
    margin-bottom: 30px;
    color: #7f8c8d;
    line-height: 1.5;
}

.nav-card .btn {
    min-width: 120px;
}

.welcome-section {
    margin-top: 50px;
    padding: 30px;
    background-color: #f8f9fa;
    border-radius: 12px;
    text-align: center;
    border-left: 4px solid #3498db;
}

.welcome-section h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 22px;
}

.welcome-section p {
    margin-bottom: 10px;
    color: #555;
    line-height: 1.6;
}

.welcome-section p:first-of-type {
    font-weight: bold;
    color: #3498db;
    font-size: 18px;
}

/* 表格 */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-family: 'Microsoft YaHei', Arial, sans-serif;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    letter-spacing: 0.5px;
}

.table tr:hover {
    background-color: #f5f5f5;
}

/* 表单 */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    flex: 1;
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    color: #333;
    font-size: 13px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    background: #ffffff;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

/* 表单容器样式 */
.add-application-form,
.add-inventory-form,
.remove-inventory-form {
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 25px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* 按钮样式优化 */
.btn {
    display: inline-block;
    padding: 10px 18px;
    border: none;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: all 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(52, 152, 219, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(231, 76, 60, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: #fff;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(149, 165, 166, 0.4);
}

/* 状态样式 */
.status-pending {
    color: #f39c12;
    font-weight: bold;
}

.status-approved {
    color: #27ae60;
    font-weight: bold;
}

.status-rejected {
    color: #e74c3c;
    font-weight: bold;
}

.status-normal {
    color: #27ae60;
    font-weight: bold;
}

.status-expired {
    color: #e74c3c;
    font-weight: bold;
}

.record-in {
    color: #27ae60;
    font-weight: bold;
}

.record-out {
    color: #e74c3c;
    font-weight: bold;
}

/* 工器具管理 */
.add-tool-form {
    margin-bottom: 40px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.add-tool-form h3 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.tools-sections {
    margin-top: 30px;
}

.tools-section {
    margin-bottom: 40px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.tools-section h3 {
    margin-bottom: 20px;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

/* 检测周期提醒 */
.alert-section {
    margin-bottom: 30px;
}

.alert {
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.alert h4 {
    margin-bottom: 15px;
    color: #856404;
}

.alert ul {
    margin-left: 20px;
}

.alert li {
    margin-bottom: 8px;
    line-height: 1.4;
}

.alert strong {
    color: #d63031;
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 5px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.modal-actions {
    margin-top: 30px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* 合格状态样式 */
.qualified-True {
    color: #27ae60;
    font-weight: bold;
}

.qualified-False {
    color: #e74c3c;
    font-weight: bold;
}

.qualified-None {
    color: #7f8c8d;
    font-style: italic;
}

/* 分页导航 */
.pagination {
    margin-top: 30px;
    text-align: center;
}

.pagination-list {
    display: inline-flex;
    list-style: none;
    padding: 0;
    gap: 5px;
}

.pagination-link {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #3498db;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-link:hover:not(.disabled) {
    background-color: #f8f9fa;
    border-color: #3498db;
}

.pagination-link.active {
    background-color: #3498db;
    color: #fff;
    border-color: #3498db;
}

.pagination-link.disabled {
    color: #7f8c8d;
    background-color: #f8f9fa;
    border-color: #ddd;
    cursor: not-allowed;
}

.pagination-ellipsis {
    display: inline-block;
    padding: 8px 12px;
    color: #7f8c8d;
}

/* 仓库管理 */
.inventory-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.add-inventory-form,
.remove-inventory-form {
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.add-inventory-form h3,
.remove-inventory-form h3 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.inventory-sections {
    margin-top: 40px;
}

.inventory-section {
    margin-bottom: 40px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.inventory-section h3 {
    margin-bottom: 20px;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.inventory-records {
    margin-top: 40px;
}

.records-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.records-header h3 {
    margin: 0;
    color: #2c3e50;
}

.inventory-list h3 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.form-hint {
    color: #7f8c8d;
    font-size: 14px;
    margin-top: 10px;
    margin-bottom: 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 15px;
        align-items: center;
        padding: 15px 20px;
    }
    
    .navbar-brand {
        width: 100%;
        justify-content: center;
        text-align: center;
        margin: 0;
    }
    
    .navbar-brand span {
        font-size: 16px;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }
    
    .navbar-menu {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        width: 100%;
        justify-content: center;
        margin: 0;
        flex: none;
    }
    
    .nav-item {
        text-align: center;
        justify-content: center;
        padding: 8px 12px;
        font-size: 14px;
        flex: 0 0 auto;
        width: auto;
    }
    
    .navbar-user {
        margin: 0;
        flex: none;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
    
    .inventory-actions {
        grid-template-columns: 1fr;
    }
    
    .table {
        font-size: 14px;
    }
    
    .table th,
    .table td {
        padding: 8px;
    }
}
