* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    background-color: #f5f5f5;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 15px;
    margin-top: 200px;
}

.header {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header h1 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #2c3e50;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.search-box input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    min-width: 200px;
}

.search-box button {
    padding: 10px 20px;
    background: #4CAF50;
    border: none;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.search-box select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    background-color: white;
    color: #333;
    cursor: pointer;
    width: 120px;
    flex-shrink: 0;
}

.search-box select:focus {
    outline: none;
    border-color: #4CAF50;
}

.statistics {
    max-width: 800px;
    margin: 0 auto 10px;
    display: flex;
    justify-content: space-between;
    background: white;
    padding: 20px 30px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    gap: 30px;
}

.stat-card {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 0;
    background: none;
    box-shadow: none;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s;
}

.stat-card:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -15px;
    top: 50%;
    transform: translateY(-50%);
    height: 70%;
    width: 1px;
    background-color: #e0e0e0;
}

.stat-card i {
    font-size: 24px;
}

.stat-card:nth-child(1) i {
    color: #1976d2;
}

.stat-card:nth-child(2) i {
    color: #4CAF50;
}

.stat-card:nth-child(3) i {
    color: #9e9e9e;
}

.stat-info {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 16px;
    color: #666;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 26px;
    font-weight: bold;
}

.stat-card:nth-child(1) .stat-value {
    color: #1976d2;
}

.stat-card:nth-child(2) .stat-value {
    color: #4CAF50;
}

.stat-card:nth-child(3) .stat-value {
    color: #9e9e9e;
}

.device-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

.device-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.device-info {
    margin-bottom: 15px;
}

.device-info p {
    margin: 8px 0;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
    padding: 8px 0;
}

.device-info p:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: #666;
    flex: 0 0 100px;  /* 定宽度 */
}

.info-value {
    flex: 1;
    text-align: right;
    color: #333;
}

/* 在线状态的特殊样式 */
.info-value.online {
    color: #4CAF50;
}

.info-value.offline {
    color: #9e9e9e;
}

/* 盘点状态的特殊样式 */
.info-value.status-normal {
    color: #4CAF50;
}

.info-value.status-lost {
    color: #f44336;
}

.info-value.status-damaged {
    color: #ff9800;
}

.info-value.status-offline {
    color: #9e9e9e;
}

/* 移动端适配 */
@media (max-width: 600px) {
    .fixed-header {
        padding: 5px;
    }

    .container {
        margin-top: 180px;
        padding: 10px;
    }

    .statistics {
        padding: 15px;
        gap: 15px;
    }

    .header {
        padding: 10px 15px;
    }

    .header-content {
        flex-direction: row;
        gap: 5px;
    }
    
    .search-box {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 5px;
        width: 100%;
        min-width: 0;
    }
    
    .search-box input {
        flex: 1;
        min-width: 0;
        font-size: 12px;
        padding: 6px;
    }
    
    .search-box button,
    .search-box select {
        flex: none;
        padding: 6px 8px;
        font-size: 12px;
        white-space: nowrap;
        min-width: 70px;
        height: 32px;
        line-height: 20px;
    }
    
    .stat-card {
        gap: 8px;
    }
    
    .stat-card i {
        font-size: 20px;
    }
    
    .stat-label {
        font-size: 14px;
    }
    
    .stat-value {
        font-size: 22px;
    }
    
    .device-list {
        grid-template-columns: 1fr;
    }

    .current-time {
        padding: 0 0 10px 0;
        font-size: 14px;
    }

    .status-tag {
        padding: 3px 10px;
        font-size: 11px;
    }
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    margin-top: 15px;
}

.button-group button {
    flex: 1 1 calc(33.333% - 8px);  /* 每行显示3个按钮 */
    min-width: 80px;
    padding: 8px 4px;
    border: none;  /* 移除边框 */
    border-radius: 5px;
    color: white;
    cursor: pointer;
    font-size: 13px;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.button-group button:hover {
    opacity: 0.9;
}

/* 按钮颜色 */
.btn-normal { background-color: #4CAF50; }
.btn-lost { background-color: #f44336; }
.btn-damaged { background-color: #ff9800; }
.btn-offline { background-color: #9e9e9e; }
.btn-poweroff { background-color: #607D8B; }

/* 移动端适配 */
@media (max-width: 600px) {
    .button-group button {
        flex: 1 1 calc(50% - 4px);  /* 在移动端每行显示2个按钮 */
        font-size: 12px;
        padding: 8px 4px;
    }
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
}

.modal-content {
    background-color: white;
    margin: 20% auto;
    padding: 25px;
    width: 90%;
    max-width: 400px;
    border-radius: 10px;
}

.modal-content h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.modal-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.btn-confirm {
    background-color: #4CAF50;
    color: white;
}

.btn-cancel {
    background-color: #f5f5f5;
    color: #333;
}

.loading {
    text-align: center;
    padding: 20px;
    display: none;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4CAF50;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card.active {
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    padding: 8px 12px;
}

.stat-card.active .stat-label {
    font-weight: 500;
} 

/* 添加固定头部样式 */
.fixed-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #f5f5f5;
    z-index: 100;
    padding: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 添加状态标签样式 */
.status-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-online {
    background-color: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
}

.status-offline {
    background-color: rgba(244, 67, 54, 0.1);
    color: #f44336;
}

.current-time {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 0 15px 0;
    color: #666;
    font-size: 16px;
}

.current-time i {
    color: #1976d2;
}

.logout-button {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    background: #f44336;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.logout-button:hover {
    opacity: 0.9;
}

.photo-upload {
    margin: 15px 0;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #f9f9f9;
}

.btn-upload {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    padding: 10px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.btn-upload:hover {
    opacity: 0.9;
}

.photo-preview {
    margin-top: 10px;
    border-radius: 5px;
    overflow: hidden;
}

.photo-preview img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
}

.no-photo {
    text-align: center;
    color: #666;
    padding: 10px;
    font-size: 14px;
}

/* 移动端适配 */
@media (max-width: 600px) {
    .btn-upload {
        padding: 12px;
        font-size: 16px;
    }
}

.upload-status {
    margin-top: 10px;
    text-align: center;
    font-size: 14px;
    color: #666;
    padding: 8px;
    border-radius: 4px;
    background: #f5f5f5;
}

.upload-status .success {
    color: #4CAF50;
}

.upload-status .error {
    color: #f44336;
}

.btn-upload:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* 添加加载动画样式 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fa-spinner {
    animation: spin 1s linear infinite;
}

/* 添加被断电状态的文本样式 */
.info-value.status-poweroff {
    color: #607D8B;
}

/* 移动端适配 */
@media (max-width: 600px) {
    .button-group button {
        flex: 1 1 calc(50% - 4px);  /* 在移动端每行显示2个按钮 */
        font-size: 12px;
        padding: 8px 4px;
    }
}