/* Ant Design Pro 风格样式 */
:root {
    --primary-color: #1890ff;
    --success-color: #52c41a;
    --warning-color: #faad14;
    --error-color: #f5222d;
    --font-size-base: 14px;
    --border-radius-base: 6px;
    --box-shadow-base: 0 3px 6px -4px rgba(0,0,0,.12), 0 6px 16px 0 rgba(0,0,0,.08), 0 9px 28px 8px rgba(0,0,0,.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: var(--font-size-base);
    color: rgba(0, 0, 0, 0.85);
    background-color: #f0f2f5;
}

/* 登录页面样式 */
.login-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.login-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 32px;
    position: relative;
    z-index: 1;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 8px;
    box-shadow: var(--box-shadow-base);
    padding: 40px;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-logo {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
}

.login-title {
    font-size: 28px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.85);
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 14px;
    color: rgba(0, 0, 0, 0.45);
}

.login-form .form-group {
    margin-bottom: 24px;
}

.login-form .form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.85);
}

.login-form .form-control {
    width: 100%;
    height: 40px;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #d9d9d9;
    border-radius: var(--border-radius-base);
    transition: all 0.3s;
    outline: none;
}

.login-form .form-control:hover {
    border-color: var(--primary-color);
}

.login-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.login-form .form-control.is-invalid {
    border-color: var(--error-color);
}

.login-form .invalid-feedback {
    color: var(--error-color);
    font-size: 12px;
    margin-top: 4px;
}

.login-form .form-check {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}

.login-form .form-check-input {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    cursor: pointer;
}

.login-form .form-check-label {
    color: rgba(0, 0, 0, 0.65);
    cursor: pointer;
    user-select: none;
}

.btn-primary {
    width: 100%;
    height: 40px;
    background: var(--primary-color);
    border: none;
    border-radius: var(--border-radius-base);
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover {
    background: #40a9ff;
}

.btn-primary:active {
    background: #096dd9;
}

.btn-primary:disabled {
    background: #d9d9d9;
    cursor: not-allowed;
}

.alert {
    padding: 12px 16px;
    border-radius: var(--border-radius-base);
    margin-bottom: 24px;
    font-size: 14px;
}

.alert-danger {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: var(--error-color);
}

.alert-success {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    color: var(--success-color);
}

/* 后台布局样式 */
.admin-layout {
    min-height: 100vh;
    display: flex;
}

.admin-sider {
    width: 256px;
    background: #001529;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
}

.admin-sider-logo {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
}

.admin-sider-logo h1 {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.admin-menu {
    list-style: none;
    padding: 16px 0;
}

.admin-menu-item {
    margin: 4px 8px;
}

.admin-menu-item a {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    border-radius: var(--border-radius-base);
    transition: all 0.3s;
}

.admin-menu-item a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.admin-menu-item.active a {
    color: #fff;
    background: var(--primary-color);
}

.admin-menu-item .menu-icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
}

.admin-main {
    flex: 1;
    margin-left: 256px;
    display: flex;
    flex-direction: column;
}

.admin-header {
    height: 64px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 99;
}

.admin-header-left {
    display: flex;
    align-items: center;
}

.admin-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-user-dropdown {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--border-radius-base);
    transition: background 0.3s;
}

.admin-user-dropdown:hover {
    background: rgba(0, 0, 0, 0.025);
}

.admin-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 8px;
}

.admin-user-name {
    color: rgba(0, 0, 0, 0.85);
    font-size: 14px;
}

.admin-content {
    flex: 1;
    padding: 24px;
    background: #f0f2f5;
}

.admin-page-header {
    background: #fff;
    padding: 16px 24px;
    margin: -24px -24px 24px -24px;
}

.admin-page-title {
    font-size: 20px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.85);
    margin: 0;
}

/* 统计卡片 */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.stat-card-title {
    font-size: 14px;
    color: rgba(0, 0, 0, 0.45);
    margin-bottom: 8px;
}

.stat-card-value {
    font-size: 30px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.85);
}

.stat-card-footer {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
    font-size: 14px;
    color: rgba(0, 0, 0, 0.45);
}

.stat-card-footer .trend-up {
    color: var(--success-color);
}

.stat-card-footer .trend-down {
    color: var(--error-color);
}

/* 内容卡片 */
.content-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.content-card-header {
    padding: 16px 24px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.content-card-title {
    font-size: 16px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.85);
    margin: 0;
}

.content-card-body {
    padding: 24px;
}

/* 表格样式 */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.data-table th {
    background: #fafafa;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.85);
}

.data-table tr:hover td {
    background: #fafafa;
}

/* 下拉菜单 */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border-radius: var(--border-radius-base);
    box-shadow: var(--box-shadow-base);
    min-width: 160px;
    padding: 4px 0;
    display: none;
    z-index: 1000;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 8px 16px;
    color: rgba(0, 0, 0, 0.85);
    text-decoration: none;
    transition: background 0.3s;
}

.dropdown-item:hover {
    background: #f5f5f5;
}

.dropdown-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 4px 0;
}

/* ==================== Ant Design 表单组件样式 ==================== */

/* 通用表单控件 */
.form-control {
    width: 100%;
    height: 32px;
    padding: 4px 11px;
    font-size: 14px;
    line-height: 1.5715;
    color: rgba(0, 0, 0, 0.85);
    background-color: #fff;
    background-image: none;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    transition: all 0.3s;
    outline: none;
}

.form-control:hover {
    border-color: #40a9ff;
}

.form-control:focus {
    border-color: #40a9ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.form-control:disabled {
    color: rgba(0, 0, 0, 0.25);
    background-color: #f5f5f5;
    cursor: not-allowed;
}

.form-control::placeholder {
    color: rgba(0, 0, 0, 0.25);
}

/* 大尺寸输入框 */
.form-control-lg {
    height: 40px;
    padding: 6.5px 11px;
    font-size: 16px;
}

/* 小尺寸输入框 */
.form-control-sm {
    height: 24px;
    padding: 0 7px;
    font-size: 12px;
}

/* 文本域 */
textarea.form-control {
    height: auto;
    min-height: 32px;
    padding: 4px 11px;
    resize: vertical;
    line-height: 1.5715;
}

/* Select 下拉框 */
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
    padding-right: 30px;
    cursor: pointer;
}

/* 表单标签 */
.form-label {
    display: inline-block;
    margin-bottom: 8px;
    color: rgba(0, 0, 0, 0.85);
    font-size: 14px;
    line-height: 1.5715;
}

.form-label-required::before {
    display: inline-block;
    margin-right: 4px;
    color: #ff4d4f;
    font-size: 14px;
    font-family: SimSun, sans-serif;
    line-height: 1;
    content: '*';
}

/* 表单组 */
.form-group {
    margin-bottom: 24px;
}

.form-group:last-child {
    margin-bottom: 0;
}

/* 表单提示文字 */
.form-text {
    margin-top: 4px;
    font-size: 12px;
    color: rgba(0, 0, 0, 0.45);
}

/* 错误状态 */
.form-control.is-invalid,
.form-control.is-invalid:hover,
.form-control.is-invalid:focus {
    border-color: #ff4d4f;
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 2px rgba(255, 77, 79, 0.2);
}

.invalid-feedback {
    display: block;
    margin-top: 4px;
    color: #ff4d4f;
    font-size: 12px;
}

/* 成功状态 */
.form-control.is-valid,
.form-control.is-valid:hover,
.form-control.is-valid:focus {
    border-color: #52c41a;
}

.form-control.is-valid:focus {
    box-shadow: 0 0 0 2px rgba(82, 196, 26, 0.2);
}

/* Checkbox 复选框 */
.form-check {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.form-check-input {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.form-check-label {
    color: rgba(0, 0, 0, 0.85);
    font-size: 14px;
    cursor: pointer;
    user-select: none;
}

/* Radio 单选框 */
.form-radio {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.form-radio-input {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

/* Switch 开关 - 简化版 */
.form-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}

.form-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.form-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.25);
    transition: 0.3s;
    border-radius: 22px;
}

.form-switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.form-switch input:checked + .form-switch-slider {
    background-color: var(--primary-color);
}

.form-switch input:checked + .form-switch-slider:before {
    transform: translateX(22px);
}

/* ==================== 按钮样式 ==================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 4px 15px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5715;
    white-space: nowrap;
    text-align: center;
    background-image: none;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    user-select: none;
    touch-action: manipulation;
}

.btn-primary {
    color: #fff;
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background: #40a9ff;
    border-color: #40a9ff;
}

.btn-primary:active {
    background: #096dd9;
    border-color: #096dd9;
}

.btn-default {
    color: rgba(0, 0, 0, 0.85);
    background: #fff;
    border-color: #d9d9d9;
}

.btn-default:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-danger {
    color: #fff;
    background: #ff4d4f;
    border-color: #ff4d4f;
}

.btn-danger:hover {
    background: #ff7875;
    border-color: #ff7875;
}

.btn-success {
    color: #fff;
    background: #52c41a;
    border-color: #52c41a;
}

.btn-success:hover {
    background: #73d13d;
    border-color: #73d13d;
}

.btn-link {
    color: var(--primary-color);
    background: transparent;
    border-color: transparent;
}

.btn-link:hover {
    color: #40a9ff;
}

.btn-lg {
    height: 40px;
    padding: 6.4px 15px;
    font-size: 16px;
}

.btn-sm {
    height: 24px;
    padding: 0 7px;
    font-size: 12px;
}

.btn:disabled {
    color: rgba(0, 0, 0, 0.25);
    background: #f5f5f5;
    border-color: #d9d9d9;
    cursor: not-allowed;
}

/* 按钮组 */
.btn-group {
    display: inline-flex;
    gap: 8px;
}

/* ==================== 文件上传 ==================== */

.file-upload {
    position: relative;
    display: inline-block;
}

.file-upload-input {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 32px;
    padding: 4px 15px;
    color: rgba(0, 0, 0, 0.85);
    background: #fff;
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.file-upload-btn:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* 拖拽上传区域 */
.file-upload-dragger {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: #fafafa;
    border: 1px dashed #d9d9d9;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.file-upload-dragger:hover {
    border-color: var(--primary-color);
}

.file-upload-dragger-icon {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.file-upload-dragger-text {
    font-size: 16px;
    color: rgba(0, 0, 0, 0.85);
    margin-bottom: 4px;
}

.file-upload-dragger-hint {
    font-size: 14px;
    color: rgba(0, 0, 0, 0.45);
}

/* ==================== 输入框组 ==================== */

.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .form-control {
    flex: 1;
    border-radius: 0;
}

.input-group .form-control:first-child {
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}

.input-group .form-control:last-child {
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
}

.input-group-addon {
    display: flex;
    align-items: center;
    padding: 0 11px;
    color: rgba(0, 0, 0, 0.85);
    font-size: 14px;
    background-color: #fafafa;
    border: 1px solid #d9d9d9;
}

.input-group-addon:first-child {
    border-right: 0;
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}

.input-group-addon:last-child {
    border-left: 0;
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
}

/* ==================== 标签 Tag ==================== */

.tag {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 7px;
    font-size: 12px;
    line-height: 20px;
    white-space: nowrap;
    background: #fafafa;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
}

.tag-primary {
    color: var(--primary-color);
    background: #e6f7ff;
    border-color: #91d5ff;
}

.tag-success {
    color: #52c41a;
    background: #f6ffed;
    border-color: #b7eb8f;
}

.tag-warning {
    color: #faad14;
    background: #fffbe6;
    border-color: #ffe58f;
}

.tag-danger {
    color: #f5222d;
    background: #fff1f0;
    border-color: #ffa39e;
}

/* ==================== 徽标 Badge ==================== */

.badge {
    display: inline-block;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 12px;
    font-weight: 400;
    line-height: 20px;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    background: #ff4d4f;
    border-radius: 10px;
}

/* ==================== 空状态 ==================== */

.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px;
    color: rgba(0, 0, 0, 0.25);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 8px;
}

.empty-text {
    font-size: 14px;
}

/* ==================== 加载状态 ==================== */

.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-lg {
    width: 32px;
    height: 32px;
    border-width: 3px;
}

/* ==================== 工具类 ==================== */

.text-primary { color: var(--primary-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-danger { color: var(--error-color) !important; }
.text-muted { color: rgba(0, 0, 0, 0.45) !important; }

.bg-primary { background-color: var(--primary-color) !important; }
.bg-success { background-color: var(--success-color) !important; }
.bg-warning { background-color: var(--warning-color) !important; }
.bg-danger { background-color: var(--error-color) !important; }

.mt-1 { margin-top: 8px !important; }
.mt-2 { margin-top: 16px !important; }
.mt-3 { margin-top: 24px !important; }
.mb-1 { margin-bottom: 8px !important; }
.mb-2 { margin-bottom: 16px !important; }
.mb-3 { margin-bottom: 24px !important; }

.p-1 { padding: 8px !important; }
.p-2 { padding: 16px !important; }
.p-3 { padding: 24px !important; }

.d-flex { display: flex !important; }
.d-block { display: block !important; }
.d-none { display: none !important; }

.align-center { align-items: center !important; }
.justify-between { justify-content: space-between !important; }
.justify-center { justify-content: center !important; }

.gap-1 { gap: 8px !important; }
.gap-2 { gap: 16px !important; }
.gap-3 { gap: 24px !important; }

/* 响应式 */
@media (max-width: 768px) {
    .admin-sider {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .admin-sider.show {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0;
    }

    .stat-cards {
        grid-template-columns: 1fr;
    }
}
