* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #ff8a80 0%, #ff5252 30%, #e53935 70%, #c62828 100%);
    min-height: 100vh;
}

/* 登录页面样式 */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-card h2 {
    text-align: center;
    color: #333;
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.login-card .subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

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

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

.btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #ff5252 0%, #e53935 50%, #c62828 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(229, 57, 53, 0.4);
}

.error-msg {
    color: #ff4757;
    text-align: center;
    margin-bottom: 15px;
    display: none;
}

/* 主页面样式 */
.main-page {
    display: none;
}

.navbar {
    background: white;
    padding: 15px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: #e53935;
}

.nav-links {
    display: flex;
    gap: 10px;
    align-items: center;
}

.nav-links a {
    color: #333;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 25px;
    transition: all 0.3s;
    font-weight: 500;
}

.nav-links a:hover {
    background: #f0f0f0;
}

.nav-links a.active {
    background: linear-gradient(135deg, #ff5252 0%, #e53935 50%, #c62828 100%);
    color: white;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logout-btn {
    background: #ff4757 !important;
    color: white !important;
    padding: 10px 20px !important;
    width: auto !important;
}

/* 移动端菜单 */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #333;
}

/* 主内容区域 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Tab 内容区域 */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

/* 仪表盘 */
.dashboard h2 {
    color: white;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

/* 全局搜索框 */
.global-search {
    position: relative;
    margin-bottom: 20px;
}

.global-search input {
    width: 100%;
    padding: 15px 20px;
    border: none;
    border-radius: 15px;
    font-size: 1rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.global-search input:focus {
    outline: none;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.global-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 10px;
    margin-top: 5px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    z-index: 1000;
    display: none;
}

.global-search-results.active {
    display: block;
}

.global-search-results .result-item {
    padding: 12px 20px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
}

.global-search-results .result-item:hover {
    background: #f0f0f0;
}

.global-search-results .result-item:last-child {
    border-bottom: none;
}

.global-search-results .result-type {
    font-size: 0.75rem;
    color: #999;
    margin-left: 5px;
}

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

.stat-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.stat-card .icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.stat-card .number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #e53935;
}

.stat-card .label {
    color: #666;
    font-size: 1rem;
}

.stat-card.clickable {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card.clickable:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(229, 57, 53, 0.4);
}

/* 搜索栏 */
.search-bar {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.search-bar input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
}

.search-bar input:focus {
    outline: none;
    border-color: #667eea;
}

/* 管理面板 */
.panel {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
}

.panel-header {
    background: linear-gradient(135deg, #ff5252 0%, #e53935 50%, #c62828 100%);
    color: white;
    padding: 15px 20px;
    font-size: 1.3rem;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-content {
    padding: 20px;
}

.btn:active {
    transform: translateY(0);
}

.list-section {
    margin-top: 20px;
    max-height: 500px;
    overflow-y: auto;
}

.list-section::-webkit-scrollbar {
    width: 6px;
}

.list-section::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.list-section::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

.item-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    gap: 15px;
    align-items: center;
    transition: transform 0.2s;
    cursor: pointer;
}

.item-card:hover {
    transform: translateX(5px);
    background: #f0f0f0;
}

.item-icon {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    background: #e8f4ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    flex-shrink: 0;
}

.item-info {
    flex: 1;
}

.item-info h4 {
    color: #333;
    margin-bottom: 5px;
}

.item-info p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 3px;
}

.badge {
    display: inline-block;
    background: #e53935;
    color: white;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
}

.badge-cabinet {
    background: #c62828;
}

.badge-location {
    background: #ff7043;
}

.delete-btn {
    background: #ff4757;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
    margin-left: 5px;
}

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

.edit-btn {
    background: #e53935;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.edit-btn:hover {
    background: #c62828;
}

.empty-state {
    text-align: center;
    color: #999;
    padding: 40px 20px;
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* 图片上传 */
.image-upload {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.image-preview {
    width: 100px;
    height: 100px;
    border-radius: 10px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px dashed #ccc;
    cursor: pointer;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview .placeholder {
    color: #999;
    font-size: 2rem;
}

.upload-btn {
    padding: 10px 20px;
    background: #f0f0f0;
    border: 2px dashed #667eea;
    border-radius: 10px;
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 图片预览模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
}

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

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
}

.modal-close:hover {
    color: #667eea;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 10px;
}

/* 仪表盘详细统计 */
.dashboard-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.detail-panel {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.detail-panel h3 {
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-item small {
    color: #999;
}

/* 搜索结果高亮 */
.highlight {
    background: #fff3cd;
    padding: 0 2px;
    border-radius: 2px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 10px;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-user {
        display: none;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .item-card {
        flex-direction: column;
        text-align: center;
    }

    .delete-btn {
        margin-top: 10px;
    }

    .login-card {
        padding: 30px 20px;
    }
    
    .global-search-results {
        max-height: 200px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .image-upload {
        flex-direction: column;
    }

    .nav-links a {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.stat-card, .panel, .detail-panel {
    animation: fadeIn 0.5s ease;
}

/* 表格样式 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

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

.data-table .delete-btn {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.list-section {
    max-height: 400px;
    overflow-y: auto;
}

.list-section::-webkit-scrollbar {
    width: 8px;
}

.list-section::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.list-section::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}
