* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* 记住我复选框样式 */
.remember-me {
    margin: 15px 0;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: relative;
    height: 18px;
    width: 18px;
    background-color: #f8f9fa;
    border: 2px solid #ddd;
    border-radius: 4px;
    margin-right: 10px;
    transition: all 0.3s ease;
}

.checkbox-container:hover input ~ .checkmark {
    border-color: #667eea;
}

.checkbox-container input:checked ~ .checkmark {
    background-color: #667eea;
    border-color: #667eea;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 5px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-text {
    font-weight: 500;
}

/* 登录页面样式 */
.login-container {
    background-color: white;
    width: 100%;
    max-width: 400px;
    padding: 30px 25px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    margin: 50px auto;
}

.login-container h2 {
    text-align: center;
    color: #333;
    margin-bottom: 25px;
    font-size: 24px;
    font-weight: 600;
}

/* 管理页面样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
}

.header {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.header h1 {
    color: #333;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 5px;
}

.subtitle {
    color: #666;
    font-size: 14px;
}

.logout-btn {
    padding: 10px 20px;
    background-color: #dc3545;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.logout-btn:hover {
    background-color: #c82333;
}

.super-user-info {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 1px solid #ffc107;
    color: #856404;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.super-user-info::before {
    content: "👑";
    margin-right: 10px;
    font-size: 18px;
}

.message {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: none;
    font-size: 14px;
    font-weight: 500;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
    font-size: 14px;
}

input[type="text"], input[type="password"], input[type="number"] {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
}

input[type="text"]:focus, input[type="password"]:focus, input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 按钮样式 */
button, .btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

button {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    margin-top: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* 表格样式 */
.users-section {
    background-color: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
    display: flex;
    align-items: center;
}

.section-title::before {
    content: "➕";
    margin-right: 8px;
}

.section-title.table-title::before {
    content: "📋";
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

th, td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

td {
    font-size: 14px;
}

tr:hover {
    background-color: #f8f9fa;
}

.active {
    color: #28a745;
    font-weight: 600;
    background-color: #f0fff4;
    padding: 4px 8px;
    border-radius: 4px;
}

.expired {
    color: #dc3545;
    font-weight: 600;
    background-color: #fff5f5;
    padding: 4px 8px;
    border-radius: 4px;
}

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
    padding: 15px;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 25px;
    width: 100%;
    max-width: 500px;
    border-radius: 12px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    cursor: pointer;
    color: #aaa;
    transition: color 0.3s ease;
}

.close:hover {
    color: #333;
}

.modal h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 20px;
}

/* 欢迎页面样式 */
.welcome-box {
    background-color: white;
    padding: 40px 30px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
    margin: 50px auto;
    text-align: center;
}

.welcome-box h1 {
    color: #28a745;
    font-size: 28px;
    margin-bottom: 15px;
}

.welcome-box p {
    color: #666;
    margin: 15px 0;
    font-size: 16px;
}

.welcome-box a {
    display: inline-block;
    margin-top: 25px;
    padding: 14px 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.welcome-box a:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* 信息提示样式 */
.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    font-size: 13px;
    margin-top: 25px;
    padding: 15px;
    border-radius: 10px;
}

.password-hint {
    font-size: 13px;
    color: #666;
    margin-top: 6px;
    display: flex;
    align-items: center;
}

.password-hint::before {
    content: "💡";
    margin-right: 6px;
}

/* 响应式设计 */
@media screen and (max-width: 768px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .logout-btn {
        align-self: stretch;
        text-align: center;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .btn-sm {
        width: 100%;
        text-align: center;
    }
    
    th, td {
        padding: 10px 8px;
        font-size: 13px;
    }
}

@media screen and (max-width: 480px) {
    .login-container, .welcome-box {
        padding: 25px 20px;
        border-radius: 12px;
        margin: 20px auto;
    }
    
    .container {
        padding: 10px;
    }
    
    .header, .add-user-form, .users-section {
        padding: 15px;
    }
    
    h1, .header h1 {
        font-size: 20px;
    }
    
    .modal-content {
        margin: 10% auto;
        padding: 20px;
    }
}