:root {
    --primary-color: #4F46E5;
    --primary-hover: #4338CA;
    --bg-color: #F3F4F6;
    --card-bg: #FFFFFF;
    --text-main: #1F2937;
    --text-muted: #6B7280;
    --border-color: #E5E7EB;
    --error-color: #EF4444;
    --success-color: #10B981;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 导航栏 */
.navbar {
    background-color: var(--card-bg);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.nav-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-muted);
}

.btn-logout {
    color: var(--error-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.btn-logout:hover {
    text-decoration: underline;
}

/* 居中容器 */
.container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.admin-container {
    align-items: flex-start;
}

/* 卡片样式 */
.card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    width: 100%;
    max-width: 400px;
}

.large-card {
    max-width: 800px;
}

h2 {
    margin-bottom: 1.5rem;
    color: var(--text-main);
    text-align: center;
}

/* 表单元素 */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-main);
}

input[type="text"],
input[type="password"],
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    resize: vertical;
}

input:focus,
textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

/* 按钮 */
.btn {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: #E5E7EB;
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: #D1D5DB;
}

.btn-update {
    background-color: var(--success-color);
}

.btn-update:hover {
    background-color: #059669;
}

/* 提示信息 */
.alert {
    padding: 0.75rem;
    background-color: #FEE2E2;
    color: var(--error-color);
    border-radius: 6px;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 0.9rem;
}

.alert.success {
    background-color: #D1FAE5;
    color: var(--success-color);
}

/* 弹窗样式 (Modal) */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    animation: slideIn 0.3s ease-out;
}

.modal-content h3 {
    margin-bottom: 1rem;
}

.modal-content p {
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

@keyframes slideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* 表格样式 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.data-table th, .data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background-color: #F9FAFB;
    font-weight: 600;
}
/* --- 新增：用户状态徽章 --- */
.user-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}
.user-badge.warning {
    background-color: #FEF3C7;
    color: #D97706;
}
.user-badge.success {
    background-color: #D1FAE5;
    color: #059669;
}

/* --- 新增：Admin 选项卡及布局 --- */
.xl-card {
    max-width: 1000px;
}

.tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px; /* 覆盖在边框上 */
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- 新增：内联表单及操作区 --- */
.action-bar {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.upload-section, .add-section {
    flex: 1;
    background-color: #F9FAFB;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px dashed var(--border-color);
}

.upload-section h4, .add-section h4 {
    margin-bottom: 1rem;
    color: var(--text-main);
}

.inline-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.inline-form input[type="file"],
.inline-form input[type="text"] {
    flex: 1;
    padding: 0.5rem;
}

.btn-small {
    width: auto;
    padding: 0.5rem 1rem;
    white-space: nowrap;
}

.text-muted {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.divider {
    border: 0;
    height: 1px;
    background: var(--border-color);
    margin: 2rem 0;
}

/* 删除按钮 */
.btn-delete {
    background: none;
    border: none;
    color: var(--error-color);
    cursor: pointer;
    font-weight: 500;
    text-decoration: underline;
}
.btn-delete:hover {
    color: #B91C1C;
}

/* 消息提示类别支持 */
.alert.error {
    background-color: #FEE2E2;
    color: var(--error-color);
}
