/* common.css - 豪猪监控系统全局样式 */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: "Microsoft Yahei", sans-serif; 
}

body { 
    background: #f5f7fa; 
    padding: 20px; 
    min-height: 100vh;
    line-height: 1.5;
}

/* 顶部导航栏 - 一行布局优化 */
.header { 
    display: flex; 
    align-items: center; 
    margin-bottom: 20px; 
    padding-bottom: 10px; 
    border-bottom: 1px solid #eee;
    flex-wrap: nowrap; /* 禁止换行 */
    gap: 10px;
    display: fixed;
}
.header .nav { 
    display: flex; 
    justify-content: space-between; 
    gap: 10px; 
    flex-wrap: nowrap; /* 禁止导航项换行 */
    flex: 1; /* 占满剩余空间 */
    
}
.header .nav .active{
    background: #1677ff !important;
    color: #fff !important;
}
.header .nav a { 
    text-decoration: none; 
    color: #666; 
    padding: 6px 12px; /* 缩小内边距 */
    border-radius: 4px;
    transition: all 0.3s;
    font-size: 13px; /* 缩小字体 */
    white-space: nowrap; /* 禁止文字换行 */
}
.header .logout { 
    color: #f5222d; 
    cursor: pointer; 
    padding: 6px 12px; /* 缩小内边距 */
    border-radius: 4px;
    transition: all 0.3s;
    font-size: 13px; /* 缩小字体 */
    border: none;
    background: none;
    white-space: nowrap; /* 禁止文字换行 */
}
/* 主容器 - 统一风格 */
.container { 
    max-width: 1000px; 
    margin: 0 auto; 
    background: #fff; 
    border-radius: 8px; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); 
    padding: 20px; 
}

/* 页面标题 - 统一风格 */
.page-title {
    font-size: 18px; 
    color: #333; 
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
    font-weight: 600;
}

/* 消息提示 - 统一风格 */
.msg { 
    height: 20px; 
    line-height: 20px; 
    margin-bottom: 15px; 
    font-size: 14px; 
    text-align: center;
}

.msg.success { 
    color: #52c41a; 
}

.msg.error { 
    color: #f5222d; 
}

.msg.warning { 
    color: #faad14; 
}

/* 表单组 - 统一风格 */
.form-group { 
    margin-bottom: 12px; 
}

.form-group label { 
    display: block; 
    margin-bottom: 6px; 
    color: #666; 
    font-size: 13px; 
    font-weight: normal;
}

.form-group input, 
.form-group textarea, 
.form-group select { 
    width: 100%; 
    padding: 10px 15px; 
    border: 1px solid #ddd; 
    border-radius: 4px; 
    font-size: 14px; 
    transition: all 0.3s;
}

.form-group input:focus, 
.form-group textarea:focus, 
.form-group select:focus { 
    outline: none; 
    border-color: #1677ff; 
    box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.1);
}

/* 按钮 - 统一风格 */
.btn { 
    padding: 8px 16px; 
    border: none; 
    border-radius: 4px; 
    background: #1677ff; 
    color: #fff; 
    font-size: 13px; 
    cursor: pointer; 
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn:hover { 
    background: #0958d9; 
}

.btn:disabled {
    background: #d9d9d9;
    cursor: not-allowed;
}

.btn-secondary { 
    background: #666; 
}

.btn-secondary:hover { 
    background: #444; 
}

.btn-success { 
    background: #52c41a; 
}

.btn-success:hover { 
    background: #389e0d; 
}

.btn-danger { 
    background: #f5222d; 
}

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

/* 按钮组 - 统一风格 */
.btn-group { 
    display: flex; 
    gap: 8px; 
    margin-top: 15px; 
    flex-wrap: wrap;
    justify-content: center;
}

/* 加载动画 - 统一风格 */
.loading { 
    display: inline-block; 
    width: 16px; 
    height: 16px; 
    border: 2px solid #fff; 
    border-top: 2px solid transparent; 
    border-radius: 50%; 
    animation: spin 1s linear infinite; 
    margin-right: 8px; 
}

@keyframes spin { 
    to { 
        transform: rotate(360deg); 
    } 
}

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

.modal-content {
    background: white;
    border-radius: 8px;
    width: 500px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    position: relative;
}

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

.modal-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
}

.modal-close:hover {
    color: #333;
    background: #f5f5f5;
    border-radius: 50%;
}

.modal-body {
    margin-bottom: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

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

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

.setting-group select,
.setting-group input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.setting-group select:focus,
.setting-group input[type="number"]:focus {
    outline: none;
    border-color: #1677ff;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
}
