@charset "UTF-8";

:root {
    --primary: #0066FF;
    --primary-dark: #0052CC;
    --primary-light: #E8F0FE;
    --secondary: #00C6FF;
    --accent: #00D4AA;
    --danger: #FF4757;
    --warning: #FFA502;
    --success: #2ED573;
    --text: #1a1a2e;
    --text-light: #4a4a5a;
    --text-muted: #888;
    --bg: #f1f5f9;
    --bg-card: #ffffff;
    --sidebar-bg: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-active: #0066FF;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.2s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
}

/* 登录页 */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-box {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.login-brand {
    text-align: center;
    margin-bottom: 32px;
}

.login-brand img {
    height: 50px;
    margin-bottom: 16px;
}

.login-brand h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-brand p {
    color: var(--text-muted);
    font-size: 14px;
}

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

.login-form label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.login-form label i {
    color: var(--primary);
    margin-right: 6px;
    width: 16px;
}

.login-form input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    transition: var(--transition);
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

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

.btn-success:hover {
    background: #25b562;
}

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

.btn-danger:hover {
    background: #e03e4d;
}

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

.btn-block {
    width: 100%;
    padding: 14px;
    font-size: 16px;
}

.login-tips {
    margin-top: 20px;
    padding: 12px;
    background: var(--primary-light);
    border-radius: var(--radius);
    text-align: center;
}

.login-tips p {
    font-size: 13px;
    color: var(--primary);
}

.login-tips i {
    margin-right: 4px;
}

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

/* 侧边栏 */
.admin-sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.admin-sidebar.collapsed {
    width: 70px;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-header img {
    height: 36px;
    margin-bottom: 8px;
    transition: var(--transition);
}

.admin-sidebar.collapsed .sidebar-header img {
    height: 28px;
}

.sidebar-header span {
    display: block;
    font-size: 12px;
    color: rgba(255,255,255,0.5);
}

.admin-sidebar.collapsed .sidebar-header span {
    display: none;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin: 2px 12px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: var(--radius);
    transition: var(--transition);
    font-size: 14px;
}

.sidebar-nav a:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}

.sidebar-nav li.active a {
    background: var(--sidebar-active);
    color: #fff;
}

.sidebar-nav a i {
    font-size: 18px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.admin-sidebar.collapsed .sidebar-nav a span {
    display: none;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 13px;
    transition: var(--transition);
}

.sidebar-footer a:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}

.admin-sidebar.collapsed .sidebar-footer a span {
    display: none;
}

/* 主内容区 */
.admin-main {
    flex: 1;
    margin-left: 260px;
    transition: var(--transition);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.admin-sidebar.collapsed + .admin-main {
    margin-left: 70px;
}

/* 顶部栏 */
.admin-header {
    height: 64px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.sidebar-toggle:hover {
    background: var(--bg);
}

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

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
}

.user-info i {
    font-size: 24px;
    color: var(--primary);
}

/* 内容区 */
.admin-content {
    flex: 1;
    padding: 24px;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title i {
    color: var(--primary);
}

/* 卡片 */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
}

.stat-card.blue .stat-icon { background: var(--primary); }
.stat-card.green .stat-icon { background: var(--success); }
.stat-card.orange .stat-icon { background: var(--warning); }
.stat-card.purple .stat-icon { background: #8b5cf6; }

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
}

.stat-label {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* 仪表盘卡片 */
.dashboard-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.quick-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    background: var(--bg);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
}

.quick-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.quick-btn i {
    font-size: 20px;
    color: var(--primary);
}

.system-info p {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.system-info p:last-child {
    border-bottom: none;
}

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

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    background: #fff;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* 图片上传 */
.image-upload {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 12px;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-upload:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.image-upload img[src=""],
.image-upload img:not([src]) {
    display: none;
}

.image-upload.has-image img {
    display: block;
}

.image-upload.has-image .upload-hint {
    display: none;
}

.image-upload > input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.upload-hint {
    color: var(--text-muted);
}

.upload-hint i {
    font-size: 32px;
    display: block;
    margin-bottom: 8px;
    color: var(--primary);
}

/* 表格 */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    font-weight: 700;
    background: var(--bg);
    color: var(--text-light);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody tr:hover {
    background: var(--bg);
}

.data-table input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 13px;
    width: 100%;
}

.data-table input:focus {
    outline: none;
    border-color: var(--primary);
}

/* 开关 */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--border);
    border-radius: 24px;
    transition: var(--transition);
}

.toggle-slider:before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: var(--transition);
}

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

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

/* 编辑表单组 */
.edit-form {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}

.edit-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.edit-form-header h4 {
    font-size: 16px;
    font-weight: 700;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-row.three-col {
    grid-template-columns: repeat(3, 1fr);
}

.tag-input-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    min-height: 44px;
    align-items: center;
}

.tag-input-container:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.tag-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 20px;
    font-size: 13px;
}

.tag-item .remove-tag {
    cursor: pointer;
    font-size: 12px;
    opacity: 0.7;
}

.tag-item .remove-tag:hover {
    opacity: 1;
}

.tag-input-container input {
    border: none;
    outline: none;
    flex: 1;
    min-width: 80px;
    background: transparent;
    padding: 4px;
}

/* 列表项 */
.list-item {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 12px;
    position: relative;
}

.list-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.list-item-header h4 {
    font-size: 16px;
    font-weight: 700;
}

.list-item-actions {
    display: flex;
    gap: 8px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-icon {
    padding: 6px 10px;
    font-size: 12px;
}

/* 响应式 */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
    
    .form-row,
    .form-row.three-col {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    
    .admin-sidebar.open {
        transform: translateX(0);
    }
    
    .admin-main {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .admin-content {
        padding: 16px;
    }
}

/* 状态标签 */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-pending {
    background: #fef3c7;
    color: #d97706;
}

.status-processed {
    background: #d1fae5;
    color: #059669;
}

/* 通知 */
.notification {
    position: fixed;
    top: 80px;
    right: 24px;
    padding: 16px 24px;
    border-radius: var(--radius);
    background: var(--bg-card);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    border-left: 4px solid var(--success);
}

.notification.error {
    border-left: 4px solid var(--danger);
}

.notification i {
    font-size: 20px;
}

.notification.success i {
    color: var(--success);
}

.notification.error i {
    color: var(--danger);
}

/* 遮罩层 */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
    display: none;
}

.overlay.show {
    display: block;
}

/* 滚动条 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

/* ==================== 模态弹窗 ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-box {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 18px;
    color: var(--text);
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg);
    color: var(--text);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

/* ==================== 管理列表项 ==================== */
.manage-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    transition: all 0.2s;
}

.manage-item:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.manage-item-thumb {
    flex-shrink: 0;
    width: 80px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border-radius: 8px;
    overflow: hidden;
}

.manage-item-body {
    flex: 1;
    min-width: 0;
}

.manage-item-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* ==================== 徽章 ==================== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-primary {
    background: rgba(99, 102, 241, 0.12);
    color: #6366f1;
}

.badge-info {
    background: rgba(14, 165, 233, 0.12);
    color: #0ea5e9;
}

.badge-success {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

/* ==================== 按钮 ==================== */
.btn-sm {
    padding: 5px 10px;
    font-size: 13px;
    min-width: 34px;
}

.btn-info {
    background: #0ea5e9;
    color: #fff;
    border: none;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-info:hover {
    background: #0284c7;
}

.btn-success {
    background: #10b981;
    color: #fff;
    border: none;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-success:hover {
    background: #059669;
}

.btn-warning {
    background: #f59e0b;
    color: #fff;
    border: none;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-warning:hover {
    background: #d97706;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group textarea {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.form-group input[type="text"]:focus,
.form-group input[type="date"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group textarea {
    resize: vertical;
    font-family: inherit;
}
