* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 50%, #16213e 100%);
    color: #00ff88;
    min-height: 100vh;
    overflow-x: auto;
}

body.loading-auth .login-container,
body.loading-auth .main-container {
    display: none;
}

.hidden {
    display: none !important;
}

.login-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.login-box {
    background: rgba(26, 26, 46, 0.9);
    padding: 40px;
    border-radius: 15px;
    border: 2px solid #00ff88;
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.3);
    text-align: center;
    min-width: 300px;
}

.login-box h2 {
    margin-bottom: 30px;
    color: #00ff88;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.login-box input {
    width: 100%;
    padding: 15px;
    margin: 10px 0;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #00ff88;
    border-radius: 8px;
    color: #00ff88;
    font-size: 16px;
}

.login-box button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(45deg, #00ff88, #00cc6a);
    border: none;
    border-radius: 8px;
    color: #000;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-box button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 136, 0.4);
}

.error-message {
    color: #ff4444;
    margin-top: 10px;
}

.header {
    text-align: center;
    padding: 20px;
    background: rgba(26, 26, 46, 0.8);
    border-bottom: 2px solid #00ff88;
    margin-bottom: 20px;
}

.header h1 {
    font-size: 2.5em;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.8);
    margin-bottom: 10px;
}

.server-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.control-btn {
    padding: 10px 20px;
    background: rgba(26, 26, 46, 0.8);
    border: 1px solid #00ff88;
    border-radius: 8px;
    color: #00ff88;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-btn:hover, .control-btn.active {
    background: rgba(0, 255, 136, 0.2);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.servers-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 15px;
    max-width: 1400px;
    margin: 0 auto;
}

.server-card {
    background: rgba(26, 26, 46, 0.8);
    border: 2px solid #00ff88;
    border-radius: 10px;
    padding: 10px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 255, 136, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.server-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 255, 136, 0.2);
}

.server-card.offline {
    border-color: #ff4444;
    opacity: 0.7;
}

.server-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(0, 255, 136, 0.3);
}

.server-name {
    font-size: 1.1em;
    font-weight: bold;
    color: #00ff88;
}

.server-status {
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: bold;
}

.status-online {
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
    border: 1px solid #00ff88;
}

.status-offline {
    background: rgba(255, 68, 68, 0.2);
    color: #ff4444;
    border: 1px solid #ff4444;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #888;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
    margin-top: 5px;
}

.metric-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 6px;
    padding: 8px;
    text-align: center;
    min-height: 65px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.metric-title {
    font-size: 0.9em;
    color: #ccc;
    margin-bottom: 5px;
}

.metric-value {
    font-size: 1.2em;
    font-weight: bold;
}

.metric-detail {
    font-size: 0.8em;
    color: #888;
}

.progress-bar {
    height: 5px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 3px;
    margin-top: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00ff88, #00cc6a);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.progress-fill.warning {
    background: linear-gradient(90deg, #ffcc00, #ffaa00);
}

.progress-fill.danger {
    background: linear-gradient(90deg, #ff4444, #cc0000);
}

.network-info {
    display: flex;
    justify-content: space-around;
}

.network-item {
    text-align: center;
}

/* Config page styles */
.config-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.form-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: center; /* 新增此行来居中按钮 */
}

.form-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

fieldset {
    border: 1px solid #178552;
    padding: 15px;
    border-radius: 8px;
    max-width: 760px; /* 限制fieldset的最大宽度 */
}

legend {
    color: #00ff88;
    padding: 0 10px;
}

.field-group {
    margin-bottom: 8px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.field-group label {
    min-width: 150px;
}

.field-group input[type="text"],
.field-group input[type="password"],
.field-group input[type="email"],
.field-group input[type="number"] {
    flex-grow: 1;
    padding: 8px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #1c7b4e;
    border-radius: 5px;
    color: #fff;
}

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

.server-fields-wrapper {
    display: flex;
    flex-direction: column;

}

.field-group-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-section {
    padding-left: 20px;
    border-left: 2px solid #00ff88;
    margin-top: 10px;
}
