/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

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

/* 头部样式 */
header {
    background-color: #2c3e50;
    color: white;
    padding: 20px 0;
    margin-bottom: 30px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 28px;
    margin-bottom: 10px;
}

nav {
    display: flex;
    gap: 15px;
}

.admin-btn, .back-btn {
    background-color: #3498db;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.3s;
}

.admin-btn:hover, .back-btn:hover {
    background-color: #2980b9;
}

/* 主内容区域 */
main {
    margin-bottom: 50px;
}

section {
    background-color: white;
    padding: 25px;
    margin-bottom: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 22px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* 添加用户表单 */
.add-user-section form {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.add-user-section input[type="text"] {
    flex: 1;
    min-width: 200px;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

button {
    background-color: #2ecc71;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #27ae60;
}

/* 表格容器 */
.users-table-container, .history-table-container {
    overflow-x: auto;
}

.users-table, .history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.users-table th, .users-table td,
.history-table th, .history-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.users-table th, .history-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #555;
}

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

.points {
    font-weight: 600;
    color: #2c3e50;
}

.points-increase {
    color: #27ae60;
    font-weight: 600;
}

.points-decrease {
    color: #e74c3c;
    font-weight: 600;
}

.no-data {
    text-align: center;
    color: #777;
    padding: 30px 0;
}

/* 按钮样式 */
.history-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.history-btn:hover {
    background-color: #2980b9;
}

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

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 25px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 15px;
    cursor: pointer;
}

.close:hover, .close:focus {
    color: #333;
    text-decoration: none;
    cursor: pointer;
}

#modal-title {
    margin-bottom: 20px;
    color: #2c3e50;
}

/* 后台管理页面样式 */
.admin-section form {
    max-width: 600px;
}

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

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

.form-group select,
.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #777;
    font-size: 14px;
}

/* 消息提示 */
.success-message, .error-message {
    margin-top: 20px;
    padding: 12px 20px;
    border-radius: 4px;
    font-weight: 500;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 响应式设计 */
@media (max-width: 768px) {
    header {
        padding: 15px 0;
    }
    
    header h1 {
        font-size: 24px;
        margin-bottom: 15px;
    }
    
    nav {
        justify-content: center;
    }
    
    section {
        padding: 20px;
    }
    
    section h2 {
        font-size: 20px;
    }
    
    .add-user-section form {
        flex-direction: column;
    }
    
    .add-user-section input[type="text"] {
        min-width: unset;
    }
    
    .users-table th, .users-table td,
    .history-table th, .history-table td {
        padding: 10px;
        font-size: 14px;
    }
    
    .history-btn {
        padding: 5px 10px;
        font-size: 13px;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    header h1 {
        font-size: 22px;
    }
    
    section {
        padding: 15px;
    }
    
    .users-table th, .users-table td,
    .history-table th, .history-table td {
        padding: 8px;
        font-size: 13px;
    }
    
    button {
        padding: 8px 16px;
        font-size: 15px;
    }
}