/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: SimSun, "Times New Roman", serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1960px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(106, 17, 203, 0.2);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 主要内容区域 */
.main-content {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
}

.sidebar {
    flex: 1;
    min-width: 300px;
}

.content {
    flex: 3;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #eef2f7;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

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

.card-header h3 {
    font-size: 1.4rem;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a5568;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #d1d9e6;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(to right, #4299e1, #3182ce);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(to right, #3182ce, #2c5282);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(49, 130, 206, 0.4);
}

.btn-secondary {
    background: linear-gradient(to right, #48bb78, #38a169);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(to right, #38a169, #2f855a);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: #4a5568;
    border: 1px solid #cbd5e0;
}

.btn-outline:hover {
    background: #f7fafc;
    border-color: #a0aec0;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
}

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

table thead {
    background: #f8fafc;
}

table th {
    padding: 16px 15px;
    text-align: left;
    font-weight: 600;
    color: #4a5568;
    border-bottom: 2px solid #e2e8f0;
}

table td {
    padding: 16px 15px;
    border-bottom: 1px solid #e2e8f0;
}

table tbody tr {
    transition: background-color 0.2s;
}

table tbody tr:hover {
    background-color: #f8fafc;
}

.loading {
    text-align: center;
    padding: 40px !important;
    color: #a0aec0;
}

/* 标签样式 */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tag {
    background: #edf2f7;
    color: #4a5568;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* 操作按钮 */
.actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.action-btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.edit-btn {
    background: #e6fffa;
    color: #0d9488;
}

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

.delete-btn {
    background: #fff5f5;
    color: #e53e3e;
}

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

.view-btn {
    background: #ebf8ff;
    color: #3182ce;
}

.view-btn:hover {
    background: #bee3f8;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #eef2f7;
}

.modal-header h3 {
    font-size: 1.5rem;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-modal {
    font-size: 1.8rem;
    cursor: pointer;
    color: #a0aec0;
    transition: color 0.3s;
}

.close-modal:hover {
    color: #4a5568;
}

.modal-body {
    padding: 25px;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

/* 页脚样式 */
footer {
    text-align: center;
    padding: 25px;
    color: #718096;
    border-top: 1px solid #e2e8f0;
    margin-top: 30px;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        min-width: 100%;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .card {
        padding: 20px;
    }
    
    table {
        font-size: 0.9rem;
    }
    
    table th, table td {
        padding: 12px 10px;
    }
}

.device-status {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(76, 175, 80, 0.9);
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 14px;
    z-index: 10000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: opacity 0.5s ease;
}

.device-status.expiring {
    background: rgba(255, 152, 0, 0.9);
}

.device-status.expired {
    background: rgba(244, 67, 54, 0.9);
}

.device-status.hidden {
    opacity: 0;
    pointer-events: none;
}

/* 管理员联系弹窗样式 */
.admin-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 10001;
    justify-content: center;
    align-items: center;
}

.admin-modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.admin-modal h2 {
    color: #F44336;
    margin-bottom: 15px;
}

.admin-modal p {
    margin: 10px 0;
    color: #333;
}

.admin-modal button {
    background: #4361ee;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 15px;
}

.admin-modal button:hover {
    background: #3a56d4;
}
/* 确保弹窗样式正确 */
#adminModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5); /* 半透明背景 */
    z-index: 10000;
    justify-content: center;
    align-items: center;
    background: transparent !important;
}

.admin-modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    position: relative;
   
   
    z-index: 10001;
    /* 确保不被模糊 */
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* 阻止页面滚动 */
body.blocked {
    overflow: hidden;
}