/* ========================================
   后台管理系统样式
   精心设计的人工风格UI
======================================== */

:root {
    --primary: #1e40af;
    --primary-dark: #1e3a8a;
    --primary-light: #3b82f6;
    --secondary: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --dark: #1e293b;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    /* 侧边栏深蓝主题 */
    --sidebar-bg: #1e3a5f;
    --sidebar-bg-dark: #172a45;
    --sidebar-text: #a8c5e8;
    --sidebar-text-active: #ffffff;
    --sidebar-hover: #2a4a73;
    --sidebar-active: #345a8c;
    --sidebar-width: 220px;
    --header-height: 70px;
    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

* {
    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;
    font-size: 14px;
    line-height: 1.5;
    color: var(--gray-700);
    background: var(--gray-100);
}

/* ========================================
   登录页面
======================================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    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.08'%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");
    animation: move 20s linear infinite;
}

@keyframes move {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-50%, -50%); }
}

.login-container {
    width: 420px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 50px 45px;
    box-shadow: var(--shadow-xl);
    position: relative;
    z-index: 1;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--info) 100%);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 10px 30px -10px var(--primary);
}

.login-logo i {
    font-size: 40px;
    color: white;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.login-header p {
    color: var(--gray-500);
    font-size: 14px;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--gray-700);
    font-size: 14px;
}

.form-input {
    width: 100%;
    height: 50px;
    padding: 0 18px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 15px;
    transition: all 0.3s ease;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.1);
}

.form-input-icon {
    position: relative;
}

.form-input-icon input {
    padding-left: 50px;
}

.form-input-icon i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 18px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 28px;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 15px -3px rgba(30, 64, 175, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px -5px rgba(30, 64, 175, 0.5);
}

.btn-block {
    width: 100%;
}

.btn-lg {
    height: 54px;
    font-size: 16px;
}

/* ========================================
   布局
======================================== */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 - 深色主题 */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    background: var(--sidebar-bg-dark);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-brand {
    color: white;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.sidebar-menu::-webkit-scrollbar {
    width: 4px;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
}

.menu-item {
    position: relative;
    margin: 2px 0;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 13px;
    font-weight: 400;
}

.menu-link:hover {
    color: var(--sidebar-text-active);
    background: var(--sidebar-hover);
}

.menu-link.active {
    color: var(--sidebar-text-active);
    background: var(--sidebar-active);
}

.menu-link i:first-child {
    width: 20px;
    font-size: 14px;
    margin-right: 12px;
    text-align: center;
}

.menu-arrow {
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.3s ease;
    opacity: 0.6;
}

.menu-item.open > .menu-link .menu-arrow {
    transform: rotate(180deg);
}

.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: transparent;
}

.menu-item.open > .submenu {
    max-height: 500px;
}

.submenu .menu-link {
    padding-left: 52px;
    padding-top: 10px;
    padding-bottom: 10px;
    font-size: 12px;
    position: relative;
}

.submenu-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--sidebar-text);
    margin-right: 10px;
    opacity: 0.4;
    transition: all 0.2s ease;
}

.submenu .menu-link:hover .submenu-dot,
.submenu .menu-link.active .submenu-dot {
    background: var(--primary-light);
    opacity: 1;
}

.submenu .menu-link.active {
    color: var(--primary-light);
    background: transparent;
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 顶部导航 */
.header {
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.toggle-sidebar {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--gray-600);
    font-size: 18px;
    transition: all 0.3s ease;
}

.toggle-sidebar:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.breadcrumb a {
    color: var(--gray-500);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb .current {
    color: var(--gray-700);
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-btn {
    width: 42px;
    height: 42px;
    border: none;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--gray-600);
    font-size: 18px;
    position: relative;
    transition: all 0.3s ease;
}

.header-btn:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

.header-btn .badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 600;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 页面内容 */
.page-content {
    flex: 1;
    padding: 32px;
}

.page-header {
    margin-bottom: 28px;
}

.page-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.page-subtitle {
    color: var(--gray-500);
    font-size: 14px;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.blue {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.stat-icon.green {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.stat-icon.orange {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.stat-icon.red {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.stat-icon.blue {
    background: rgba(30, 64, 175, 0.1);
    color: var(--primary);
}

.stat-icon.cyan {
    background: rgba(6, 182, 212, 0.1);
    color: var(--secondary);
}

.stat-trend {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}

.stat-trend.up {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.stat-trend.down {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 6px;
}

.stat-label {
    color: var(--gray-500);
    font-size: 14px;
}

/* 卡片 */
.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.card-header {
    padding: 24px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-800);
}

.card-body {
    padding: 24px;
}

/* 搜索栏 */
.search-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 200px;
    height: 44px;
    padding: 0 18px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, var(--info) 0%, #2563eb 100%);
    color: white;
}

.btn-sm {
    height: 36px;
    padding: 0 16px;
    font-size: 13px;
}

/* 表格 */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 16px;
    text-align: left;
}

.data-table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-600);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--gray-200);
}

.data-table td {
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}

.data-table tr:hover td {
    background: var(--gray-50);
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* 用户头像 */
.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-cell-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--gray-100);
}

.user-cell-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 2px;
}

.user-cell-info p {
    font-size: 12px;
    color: var(--gray-500);
}

/* 状态标签 */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-badge.active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-badge.active::before {
    background: var(--success);
}

.status-badge.inactive {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.status-badge.inactive::before {
    background: var(--danger);
}

.status-badge.pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.status-badge.pending::before {
    background: var(--warning);
}

/* 操作按钮 */
.action-btns {
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.action-btn.edit {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.action-btn.edit:hover {
    background: var(--info);
    color: white;
}

.action-btn.delete {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.action-btn.delete:hover {
    background: var(--danger);
    color: white;
}

.action-btn.view {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.action-btn.view:hover {
    background: var(--success);
    color: white;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 24px;
}

.page-btn {
    min-width: 40px;
    height: 40px;
    border: 1px solid var(--gray-200);
    background: white;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    color: var(--gray-600);
    transition: all 0.3s ease;
}

.page-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-lg {
    max-width: 900px;
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-800);
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 18px;
    color: var(--gray-500);
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(90vh - 160px);
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--gray-100);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* 表单样式 */
.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 14px;
}

.form-label.required::after {
    content: '*';
    color: var(--danger);
    margin-left: 4px;
}

.form-control {
    width: 100%;
    height: 46px;
    padding: 0 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.1);
}

textarea.form-control {
    height: auto;
    padding: 12px 16px;
    min-height: 100px;
    resize: vertical;
}

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='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* 图片上传 */
.image-upload {
    width: 120px;
    height: 120px;
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.image-upload:hover {
    border-color: var(--primary);
    background: rgba(30, 64, 175, 0.02);
}

.image-upload i {
    font-size: 32px;
    color: var(--gray-400);
    margin-bottom: 8px;
}

.image-upload span {
    font-size: 12px;
    color: var(--gray-500);
}

.image-upload input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.image-upload img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 角色选择 */
.role-select {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.role-option {
    flex: 1;
    min-width: 100px;
}

.role-option input {
    display: none;
}

.role-option label {
    display: block;
    padding: 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.role-option label i {
    font-size: 28px;
    margin-bottom: 8px;
    display: block;
}

.role-option input:checked + label {
    border-color: var(--primary);
    background: rgba(30, 64, 175, 0.05);
    color: var(--primary);
}

/* 开关 */
.switch {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.switch-input {
    display: none;
}

.switch-slider {
    width: 52px;
    height: 28px;
    background: var(--gray-300);
    border-radius: 14px;
    position: relative;
    transition: all 0.3s ease;
}

.switch-slider::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.switch-input:checked + .switch-slider {
    background: var(--primary);
}

.switch-input:checked + .switch-slider::before {
    left: 27px;
}

.switch-label {
    font-weight: 500;
    color: var(--gray-700);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 64px;
    color: var(--gray-300);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 18px;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--gray-500);
}

/* 响应式 */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   标签页导航
======================================== */

.tabs-container {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 0 24px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--gray-300) transparent;
}

.tabs-container::-webkit-scrollbar {
    height: 4px;
}

.tabs-container::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 2px;
}

.tabs-nav {
    display: flex;
    gap: 4px;
    padding: 8px 0;
    min-width: max-content;
}

.tab-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    color: var(--gray-600);
    border: 1px solid transparent;
    position: relative;
    user-select: none;
}

.tab-item:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

.tab-item.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.3);
}

.tab-item.active .tab-close {
    color: rgba(255, 255, 255, 0.8);
}

.tab-item.active .tab-close:hover {
    color: white;
    background: rgba(255, 255, 255, 0.2);
}

.tab-title {
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tab-close {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 10px;
    color: var(--gray-400);
    transition: all 0.2s ease;
}

.tab-close:hover {
    background: var(--gray-300);
    color: var(--gray-700);
}

.tab-item.active .tab-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 标签页滚动按钮 */
.tabs-scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: none;
    background: white;
    border-radius: 50%;
    box-shadow: var(--shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    z-index: 10;
    transition: all 0.3s ease;
}

.tabs-scroll-btn:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.tabs-scroll-btn.left {
    left: 8px;
}

.tabs-scroll-btn.right {
    right: 8px;
}

/* Toast 提示 */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    min-width: 300px;
    padding: 16px 20px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
    border-left: 4px solid;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.warning {
    border-left-color: var(--warning);
}

.toast i {
    font-size: 20px;
}

.toast.success i {
    color: var(--success);
}

.toast.error i {
    color: var(--danger);
}

.toast.warning i {
    color: var(--warning);
}
