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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

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

/* 头部 */
header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

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

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* 主要内容区域 */
main {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

section {
    margin-bottom: 40px;
}

section:last-child {
    margin-bottom: 0;
}

h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

h3 {
    color: #555;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

/* 状态显示 */
.status-success {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #28a745;
}

.status-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #dc3545;
}

.status-loading {
    background: #d1ecf1;
    color: #0c5460;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #17a2b8;
}

/* 表单样式 */
.add-user {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

input[type="text"],
input[type="email"] {
    flex: 1;
    min-width: 200px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
}

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

button:hover {
    background: #5a6fd8;
}

.refresh-btn {
    background: #28a745;
    margin-bottom: 15px;
}

.refresh-btn:hover {
    background: #218838;
}

/* 用户列表 */
.user-list {
    margin-top: 30px;
}

.user-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.user-info {
    flex: 1;
}

.user-info strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.user-info span {
    color: #666;
    margin-right: 15px;
}

.user-info small {
    color: #888;
    font-size: 0.9rem;
}

.delete-btn {
    background: #dc3545;
    padding: 8px 16px;
    font-size: 14px;
}

.delete-btn:hover {
    background: #c82333;
}

/* 加载和空状态 */
.loading,
.empty,
.error {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

.error {
    color: #dc3545;
}

/* 响应式设计 */
@media (max-width: 600px) {
    .container {
        padding: 10px;
    }
    
    main {
        padding: 20px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    form {
        flex-direction: column;
    }
    
    .user-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .delete-btn {
        align-self: flex-end;
    }
}

/* 页脚 */
footer {
    text-align: center;
    margin-top: 40px;
    color: white;
    opacity: 0.8;
}

footer a {
    color: white;
    text-decoration: underline;
}

footer a:hover {
    opacity: 0.7;
}