/* ======================
基础样式和变量定义
====================== */
:root {
--primary-color: #2196F3;
--secondary-color: #667eea;
--success-color: #4CAF50;
--danger-color: #F44336;
--warning-color: #FFC107;
--text-color: #333;
--light-text: #666;
--bg-color: #f5f5f5;
--card-bg: white;
}

/* 全局样式 */
body {
font-family: 'Segoe UI', Arial, sans-serif;
margin: 0;
padding: 0;
background: var(--bg-color);
color: var(--text-color);
line-height: 1.6;
}

/* 响应式布局基础 */
.container {
width: 100%;
 
margin: 0 auto;
padding: 0 15px;
box-sizing: border-box;
}
 

/* ======================
导航栏组件
====================== */
.nav-container {
background: #333;
padding: 10px 0;
margin-bottom: 20px;
display: flex;
justify-content: space-between;
align-items: center;
position: sticky;
top: 0;
z-index: 1000;
}

.nav-container-item  ul{
display: flex;         flex-direction:row;
}


.nav-container-item.site {
color: white;
margin-left: 20px;
}

.logo-title {
display: flex;
align-items: center;
gap: 10px;
}

.site-logo {
height: 30px;
width: auto;
}

.site-name {
font-size: 1.2rem;
font-weight: bold;
color: white;
}

.nav-container-item.main-nav ul {
list-style: none;
margin: 0;
padding: 0;
/*display: flex;*/
justify-content: center;
}

.nav-container-item.main-nav li {
margin: 0 15px;
}

.nav-container-item.main-nav a {
color: white;
text-decoration: none;
padding: 5px 10px;
border-radius: 3px;
transition: background-color 0.3s;
}

.nav-container-item.main-nav a:hover {
background-color: #555;
}

.nav-container-item.main-nav .active a {
background-color: #2196F3;
font-weight: bold;
}

/* 容器样式 */
.container {
max-width: 99%;
margin: 0 auto;
}

.header {
background: #333;
color: white;
padding: 15px;
border-radius: 5px;
margin-bottom: 20px;
}

/* 状态卡片样式 */
.status-card-box {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}

.status-card {
background: white;
border-radius: 5px;
padding: 15px;
margin-bottom: 15px;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.status-up {
border-left: 5px solid #4CAF50;
}

.status-down {
border-left: 5px solid #F44336;
}

.status-unknown {
border-left: 5px solid #FFC107;
}

/* 按钮样式 */
.refresh-btn {
background: #2196F3;
color: white;
border: none;
padding: 8px 15px;
border-radius: 3px;
cursor: pointer;
margin-right: 10px;
}

.auto-refresh {
color: #666;
font-size: 0.9em;
}

.last-check {
color: #666;
font-size: 0.9em;
margin-bottom: 15px;
}
.user-menu-box{
padding-left: 20px;

}
/* 用户菜单样式 */
.user-menu {
background: white;
border-radius: 10px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
padding: 15px;
margin-bottom: 20px;
}

.menu-header {
padding: 10px 15px;
border-bottom: 1px solid #eee;
margin-bottom: 10px;
}

.menu-header h3 {
margin: 0;
color: #333;
font-size: 1.1em;
}

#userMenuList {
list-style: none;
padding: 0;
margin: 0;
}

#userMenuList li {
margin-bottom: 5px;
}

#userMenuList li a {
display: flex;
align-items: center;
padding: 10px 15px;
color: #555;
text-decoration: none;
border-radius: 5px;
transition: all 0.2s ease;
}

#userMenuList li a:hover {
background: #f0f5ff;
color: #2196F3;
}

#userMenuList li.active a {
background: #e3f2fd;
color: #2196F3;
font-weight: 500;
}

.menu-item {
display: flex;
align-items: center;
gap: 10px;
}

.menu-icon {
font-size: 1.2em;
}


.user-content-wrapper-user-avatar { 
    display: flex;   
    flex-direction: row;   
    align-items: center;   
    gap: 10px
}  
.user-content-wrapper-user-avatar  .avatar{
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
}
.user-content-wrapper-user-avatar  .avatar img{
    width: 100%;
    height: 100%;
    object-fit: cover;
}  
.user-content-wrapper-user-avatar .username{
    color: #0056b3;
}  
 

/* 用户头像样式 */
.user-avatar {
width: 32px;
height: 32px;
border-radius: 50%;
overflow: hidden;
}

.user-avatar img {
width: 100%;
height: 100%;
object-fit: cover;
}

.user-avatar-large {
width: 100px;
height: 100px;
border-radius: 50%;
overflow: hidden;
margin: 0 auto 20px;
}

.user-avatar-large img {
width: 100%;
height: 100%;
object-fit: cover;
}

/* 监控指标样式 */
.metrics {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 15px;
}

.metric-card {
border: 1px solid #ddd;
border-radius: 5px;
padding: 15px;
}

.alert {
border-left: 5px solid #F44336;
}

/* 错误页面样式 */
.error-container {
text-align: center;
padding: 50px;
}

.error-title {
color: #d9534f;
}

/* ======================
页面特定样式
====================== */

/* 首页样式 */
.index-container {

margin: 50px auto;
padding: 30px;
background: var(--card-bg);
border-radius: 10px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
text-align: center;
}

/* 仪表盘样式 */
.dashboard-container {
margin: 0  ;
padding:  0px 20px 20px 20px;
width: 100%;
}

.dashboard-header {
background: linear-gradient(135deg, var(--secondary-color) 0%, #764ba2 100%);
color: white;
padding:  0px 12px 2px 12px;
border-radius: 10px;
margin-bottom: 20px;
text-align: center;
 
}


.index-container h1 {
color: #333;
margin-bottom: 30px;
}

.actions {
display: flex;
justify-content: center;
gap: 20px;
margin-top: 20px;
}

.btn {
display: inline-block;
padding: 10px 20px;
background: #2196F3;
color: white;
text-decoration: none;
border-radius: 5px;
transition: background 0.3s;
}

.btn:hover {
background: #0b7dda;
}

/*.nav-container-item {  }*/
.nav-container-item.user-info {
color: white;
/* padding-right: 20px; */
/* background: #0b7dda; */
/* margin: 0;
padding:  0px; */
}
.nav-container-item.user-info  ul{  margin: 0; display: flex;  flex-direction: row; }
.nav-container-item.user-info  ul li{
padding-right: 20px;
list-style: none;
}
.nav-container-item.user-info a {
color: white;
}

 
.dashboard-header {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
padding: 30px  12px 2px  12px;
border-radius: 10px;
margin-bottom: 0px;
text-align: center;
}
.stats-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 20px;
margin-bottom: 30px;
}
.stat-card {
background: white;
padding: 20px;
border-radius: 10px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
text-align: center;
}
.stat-value {
font-size: 2.5em;
font-weight: bold;
color: #667eea;
}
.stat-label {
color: #666;
font-size: 0.9em;
}
.services-list {
background: white;
border-radius: 10px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
overflow: hidden;
}
.service-item {
padding: 15px 20px;
border-bottom: 1px solid #eee;
display: flex;
justify-content: space-between;
align-items: center;
}
.service-item:last-child {
border-bottom: none;
}
.status-badge {
padding: 5px 10px;
border-radius: 20px;
font-size: 0.8em;
font-weight: bold;
}
.status-up {
background: #d4edda;
color: #155724;
}
.status-down {
background: #f8d7da;
color: #721c24;
}
.status-unknown {
background: #fff3cd;
color: #856404;
}
.last-update {
text-align: center;
color: #666;
margin-top: 20px;
font-size: 0.9em;
background: white;
padding: 15px;
border-radius: 8px;
margin-bottom: 20px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);

background: linear-gradient(135deg, #b9c2eb 100%, #764ba2 0%);
}

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













.metrics {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 20px;
margin: 20px 0;
}
.metric-card {
background: white;
border-radius: 8px;
padding: 20px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
border-left: 4px solid #007bff;
}
.metric-card.alert {
border-left-color: #dc3545;
background-color: #fff5f5;
}
.metric-card.warning {
border-left-color: #ffc107;
background-color: #fffbf0;
}
.metric-card h3 {
margin: 0 0 15px 0;
color: #333;
font-size: 18px;
}
.metric-card p {
margin: 5px 0;
color: #666;
}
.metric-value {
font-weight: bold;
color: #007bff;
}
.metric-unit {
font-size: 12px;
color: #999;
}
.refresh-info {
text-align: center;
margin: 10px 0;
color: #666;
font-size: 14px;
}
.progress-bar {
height: 8px;
background: #f0f0f0;
border-radius: 4px;
margin: 10px 0;
overflow: hidden;
}
.progress-fill {
height: 100%;
background: #007bff;
border-radius: 4px;
transition: width 0.3s ease;
}
.process-list {
max-height: 200px;
overflow-y: auto;
border: 1px solid #eee;
border-radius: 4px;
padding: 10px;
margin-top: 10px;
}
.process-item {
padding: 5px 0;
border-bottom: 1px solid #f0f0f0;
}
.process-item:last-child {
border-bottom: none;
}

/* 登录页面样式 */
.login-container {
/* max-width: 300px; */
width: 60%;
margin: 100px auto;
padding: 20px;
background: white;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.login-form input {
width: 96%;
padding: 10px;
margin: 10px 0;
border: 1px solid #ddd;
border-radius: 4px;
}
.login-form button {
width: 100%;
padding: 10px;
background: #007bff;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
}
.login-form button:hover {
background: #0056b3;
}
.error-message {
color: red;
margin: 10px 0;
}
.success-message {
color: green;
margin: 10px 0;
}

/* 加载动画 */
.loading-spinner {
border: 3px solid #f3f3f3;
border-top: 3px solid #3498db;
border-radius: 50%;
width: 20px;
height: 20px;
animation: spin 1s linear infinite;
margin: 10px auto;
}

@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}

/* 监控信息卡片样式 */
.monitor-info,
.mail-worker-info {
background: white;
border-radius: 10px;
padding: 20px;
margin-top: 20px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.monitor-info h3,
.mail-worker-info h3 {
margin-top: 0;
color: #333;
border-bottom: 1px solid #eee;
padding-bottom: 10px;
}

.info-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 15px;
margin-top: 15px;
}

.info-card {
background: #f8f9fa;
padding: 15px;
border-radius: 8px;
border-left: 4px solid #667eea;
}

.info-card h4 {
margin: 0 0 5px 0;
color: #667eea;
font-size: 0.9em;
}

.info-card p {
margin: 0;
color: #666;
font-size: 0.85em;
}

/* 登录日志样式 */
.logs-section {
    margin: 2rem 0;
}

.filter-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.filter-group {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.filter-group label {
    width: 80px;
    font-weight: 500;
    color: #495057;
}

.filter-group input[type="date"] {
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    flex: 1;
}

.filter-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.filter-btn:hover {
    background-color: #0069d9;
}

.log-summary {
    margin: 1rem 0;
    font-size: 0.9rem;
    color: #6c757d;
}

.logs-table-container {
    overflow-x: auto;
}

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

.modern-table th {
    background-color: #f8f9fa;
    padding: 0.75rem;
    text-align: left;
    font-weight: 500;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.modern-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #dee2e6;
    vertical-align: top;
}

.modern-table tr:last-child td {
    border-bottom: none;
}

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

.loading-state, .no-logs, .error-logs {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

/* 注册页面样式 */
.register-container {
width: 60%;
margin: 100px auto;
padding: 20px;
background: white;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.register-form input {
width: 96%;
padding: 10px;
margin: 10px 0;
border: 1px solid #ddd;
border-radius: 4px;
}
.register-form button {
width: 100%;
padding: 10px;
background: #007bff;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
}
.register-form button:hover {
background: #0056b3;
}
.error-message {
color: red;
margin: 10px 0;
}
.success-message {
color: green;
margin: 10px 0;
}






.user-main-content {
display: flex;
flex-direction: row;
}
.user-main-content-menu{ 
 width: 300px;
}
.user-main-content-right {
    flex: 1;
}




.site-footer {
text-align: center;
 border-top:2px solid #eee;
    width: 100%;
    color: #969595;
}


.user-content-wrapper {
    display: flex;
    flex-direction: row;
    padding: 10px 20px;
    justify-content: space-between;
}

.user-content-wrapper div:not(:last-child) {
    font-weight: bold;
}

/* //user-main-content-right    dashboard-container */

/* 账户设置页面样式 */
.settings-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin-top: 20px;
}

.settings-card h2 {
    margin-top: 0;
    color: #333;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.profile-item {
    display: flex;
    margin-bottom: 15px;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
}

.profile-item .label {
    font-weight: 500;
    color: #555;
    min-width: 100px;
}

.profile-item .value {
    color: #333;
}

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

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

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

#userAvatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 3px solid #f0f0f0;
}

#avatarUpload {
    display: block;
    margin-bottom: 20px;
}

.save-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.save-btn:hover {
    background: #5a6fd1;
}

.input-note {
    font-size: 13px;
    color: #777;
    margin-top: 5px;
    display: block;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .user-main-content {
        flex-direction: column;
    }
    
    .user-main-content-menu {
        width: 100%;
    }
    
    .profile-item {
        flex-direction: column;
    }
    
    .profile-item .label {
        margin-bottom: 5px;
    }
}