* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    max-width: 1400px;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    backdrop-filter: blur(10px);
}

/* 导航栏 */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px 30px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
}

.logo i {
    margin-right: 10px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* 标签页 */
.tabs {
    display: flex;
    gap: 10px;
    padding: 20px 30px;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
}

.tab {
    padding: 10px 25px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.tab:hover {
    background: #e0e0e0;
}

.tab.active {
    background: #667eea;
    color: white;
}

/* 内容区域 */
.content {
    padding: 30px;
}

/* 网格布局 */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

/* 传感器卡片 */
.card {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.card:hover {
    transform: translateY(-5px);
}

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

.card-header h3 {
    font-size: 18px;
    color: #333;
}

.card-header i {
    color: #667eea;
    font-size: 24px;
}

/* 开关样式 */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #667eea;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* 数值显示 */
.value-display {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 12px;
    margin: 15px 0;
    font-size: 16px;
    color: #555;
    border: 1px solid #e9ecef;
}

/* 按钮样式 */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.btn:hover {
    background: #e9ecef;
}

.btn-primary {
    background: #667eea;
    color: white;
    border: none;
}

.btn-primary:hover {
    background: #5a67d8;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #c82333;
}

/* 摄像头预览 */
.camera-preview {
    width: 100%;
    height: 200px;
    background: #2d3748;
    border-radius: 15px;
    margin: 15px 0;
    object-fit: cover;
    border: 3px solid #e2e8f0;
}

/* 共享码区域 */
.share-code-box {
    background: linear-gradient(135deg, #667eea20 0%, #764ba220 100%);
    padding: 25px;
    border-radius: 20px;
    margin-top: 30px;
    border: 2px dashed #667eea;
}

.code-display {
    font-family: monospace;
    font-size: 24px;
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    margin: 15px 0;
    letter-spacing: 2px;
    border: 1px solid #ddd;
}

.qr-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.qr-image {
    max-width: 200px;
    border: 10px solid white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

/* 扫码结果 */
.scan-result {
    background: white;
    border-radius: 20px;
    padding: 25px;
    margin-top: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.data-row {
    display: flex;
    padding: 15px;
    border-bottom: 1px solid #eee;
    font-size: 16px;
}

.data-row:last-child {
    border-bottom: none;
}

.data-label {
    width: 120px;
    font-weight: 600;
    color: #555;
}

.data-value {
    flex: 1;
    color: #333;
}

/* 管理面板表格 */
.admin-table {
    width: 100%;
    overflow-x: auto;
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #f8f9fa;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #dee2e6;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid #e9ecef;
}

tr:hover {
    background: #f8f9fa;
}

/* 登录/注册表单 */
.auth-container {
    max-width: 450px;
    margin: 50px auto;
    background: white;
    border-radius: 30px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.auth-tab {
    flex: 1;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    border-radius: 15px;
    transition: all 0.3s;
    font-weight: 600;
}

.auth-tab.active {
    background: #667eea;
    color: white;
}

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

.form-group input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    font-size: 16px;
    transition: all 0.3s;
}

.form-group input:focus {
    border-color: #667eea;
    outline: none;
}

/* 提示框 */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    z-index: 9999;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr;
    }
    
    .navbar {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .tabs {
        flex-wrap: wrap;
    }
    
    .tab {
        flex: 1;
        text-align: center;
        font-size: 14px;
        padding: 8px 12px;
    }
}