/* 基础重置和变量定义 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --accent-color: #4895ef;
    --danger-color: #f72585;
    --warning-color: #f8961e;
    --success-color: #4cc9f0;
    --info-color: #560bad;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --gray-color: #6c757d;
    --light-gray: #e9ecef;
    --border-radius: 8px;
    --border-radius-sm: 4px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --box-shadow-md: 0 6px 12px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #f5f7fa;
}

/* 布局样式 */
.wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1.5rem 0;
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 主要内容区 */
.main-content {
    flex: 1;
    padding: 2rem 0;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 2rem;
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--box-shadow-md);
}

.card-header {
    padding: 1.2rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.card-header h2 {
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    background-color: var(--light-gray);
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: flex-end;
}

/* 管理操作区 */
.admin-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

/* 表单样式 */
.auth-form, .admin-login-form, .auth-edit-form {
    max-width: 100%;
}

.auth-edit-form .form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 1rem;
}

.auth-edit-form .form-group {
    flex: 1;
    margin-bottom: 0;
}

.auth-edit-form .form-group.full-width {
    flex: 0 0 100%;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark-color);
}

.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 15px;
    color: var(--gray-color);
}

.input-with-icon input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 1px solid #ced4da;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

input, textarea, select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ced4da;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

.focused {
    position: relative;
}

.focused::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid var(--accent-color);
    border-radius: var(--border-radius);
    pointer-events: none;
    animation: focus-fade 1.5s ease-out;
}

@keyframes focus-fade {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--gray-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #e3176a;
    transform: translateY(-2px);
}

.btn-warning {
    background-color: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background-color: #e07c10;
    transform: translateY(-2px);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #3aa8d8;
    transform: translateY(-2px);
}

.btn-info {
    background-color: var(--info-color);
    color: white;
}

.btn-info:hover {
    background-color: #4a08a1;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.875rem;
}

.btn-edit {
    background-color: var(--warning-color);
    color: white;
}

.btn-delete {
    background-color: var(--danger-color);
    color: white;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 2rem;
    justify-content: flex-end;
}

/* 表格样式 */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.auth-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.9em;
    min-width: 600px;
}

.auth-table thead tr {
    background-color: var(--primary-color);
    color: white;
    text-align: left;
}

.auth-table th, 
.auth-table td {
    padding: 12px 15px;
}

.auth-table tbody tr {
    border-bottom: 1px solid var(--light-gray);
}

.auth-table tbody tr:nth-of-type(even) {
    background-color: #f9f9f9;
}

.auth-table tbody tr:last-of-type {
    border-bottom: 2px solid var(--primary-color);
}

.auth-table tbody tr:hover {
    background-color: rgba(67, 97, 238, 0.1);
}

.auth-table .actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* 空状态提示 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-color);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--light-gray);
}

.empty-state p {
    font-size: 1.2rem;
}

/* 提示信息 */
.alert {
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert.error {
    background-color: #fff5f5;
    color: var(--danger-color);
    border-left: 4px solid var(--danger-color);
}

.alert.success {
    background-color: #f0fdf4;
    color: #166534;
    border-left: 4px solid #166534;
}

/* 页脚 */
.footer {
    background-color: var(--dark-color);
    color: white;
    padding: 1.5rem 0;
    text-align: center;
    margin-top: auto;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .auth-edit-form .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .auth-edit-form .form-group {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .card-header h2 {
        font-size: 1.2rem;
    }
    
    .form-actions, .admin-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .auth-table .actions {
        flex-direction: column;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 15px;
    }
    
    .header h1 {
        font-size: 1.3rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .input-with-icon input {
        padding: 10px 10px 10px 40px;
    }
    
    .auth-table td, 
    .auth-table th {
        padding: 8px 10px;
    }
}