/* 全局基础设置 */
html {
    font-size: 14px; /* 默认是16px，调小到14px */
}

body {
    font-size: 0.875rem; /* 约等于 12.25px */
}

/* 登录页面样式 */
.login-body {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 后台管理主界面样式 */
.sidebar { transition: width 0.3s; font-size: 0.9rem; }
.content-area { flex-grow: 1; overflow-y: auto; background-color: #f3f4f6; }
.nav-item { cursor: pointer; transition: all 0.2s; font-size: 0.85rem; }
.nav-item:hover { background-color: #374151; }
.nav-item.active { background-color: #2563eb; color: white; }
.module-section { display: none; }
.module-section.active { display: block; }

/* 表格字体微调 */
table thead th {
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}
table tbody td {
    font-size: 0.8rem;
}

/* 全局加载样式 */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: none; /* 默认隐藏 */
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 表单通用样式优化 */
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background-color: #ffffff;
    color: #111827; /* 强制深色文字 */
    font-size: 0.875rem;
    line-height: 1.25rem;
    transition: all 0.2s;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.form-label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151; /* 明显的深灰色 */
}

/* 优化下拉框箭头 */
.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* 弹窗标题 */
.modal-title {
    color: #111827;
    font-size: 1.25rem;
    font-weight: 700;
}

/* 弹窗样式优化 */
.modal-container {
    max-height: 85vh;
    overflow-y: auto;
}

/* 自定义滚动条样式 */
.modal-container::-webkit-scrollbar {
    width: 6px;
}

.modal-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.modal-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.modal-container::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 弹窗/通知样式 */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 12px 24px;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: toastIn 0.3s ease-out forwards;
    min-width: 200px;
}

.toast-success { background-color: #10B981; }
.toast-error { background-color: #EF4444; }
.toast-info { background-color: #3B82F6; }

@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

.toast.hiding {
    animation: toastOut 0.3s ease-in forwards;
}

/* 确认弹窗样式 */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.2s ease-out;
}

.confirm-modal {
    background: white;
    padding: 24px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

