/* ============ 自定义主题变量 ============ */
:root {
    --primary: #4F6EF7;
    --primary-dark: #3B5BDB;
    --primary-light: #6C8CFF;
    --bg-main: #F5F7FA;
    --bg-white: #FFFFFF;
    --bg-sidebar: #1E2A3A;
    --bg-sidebar-hover: #283848;
    --bg-sidebar-active: #2D4A6F;
    --text-dark: #1F2937;
    --text-muted: #6B7280;
    --text-light: #FFFFFF;
    --text-sidebar: #B0BEC5;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --info: #3B82F6;
    --border-color: #E5E7EB;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.2s ease;
}

/* ============ 全局样式 ============ */
* { box-sizing: border-box; }

body {
    font-family: 'PingFang SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-main);
    color: var(--text-dark);
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* ============ 布局 ============ */
.layout {
    display: flex;
    min-height: 100vh;
}

/* ============ 侧边栏 ============ */
.sidebar {
    width: 240px;
    background: var(--bg-sidebar);
    color: var(--text-sidebar);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 200;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    box-shadow: 2px 0 8px rgba(0,0,0,0.15);
}

.sidebar-logo {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo .logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    font-weight: bold;
}

.sidebar-logo .logo-text {
    font-size: 18px;
    font-weight: 600;
    color: #FFFFFF;
    letter-spacing: 0.5px;
}

.sidebar-logo .logo-sub {
    font-size: 11px;
    color: var(--text-sidebar);
    opacity: 0.7;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.sidebar-nav .nav-label {
    font-size: 11px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
    padding: 12px 12px 6px;
    letter-spacing: 1px;
    font-weight: 600;
}

.sidebar-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    color: var(--text-sidebar);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 2px;
    transition: var(--transition);
    font-size: 14px;
    font-weight: 400;
}

.sidebar-nav .nav-item:hover {
    background: var(--bg-sidebar-hover);
    color: #FFFFFF;
}

.sidebar-nav .nav-item.active {
    background: var(--primary);
    color: #FFFFFF;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(79, 110, 247, 0.4);
}

.sidebar-nav .nav-item .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

/* ============ 主内容区 ============ */
.main-content {
    margin-left: 240px;
    flex: 1;
    min-height: 100vh;
}

/* ============ 顶部导航 ============ */
.topbar {
    background: var(--bg-white);
    padding: 0 28px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.topbar-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ============ 内容容器 ============ */
.content-wrapper {
    padding: 28px;
}

/* ============ 卡片 ============ */
.card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: var(--text-dark);
}

.card-body {
    padding: 24px;
}

/* ============ 统计卡片 ============ */
.stat-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    opacity: 0.06;
    transform: translate(30px, -30px);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card.primary::after { background: var(--primary); }
.stat-card.success::after { background: var(--success); }
.stat-card.warning::after { background: var(--warning); }
.stat-card.info::after { background: var(--info); }

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 16px;
}

.stat-card.primary .stat-icon { background: rgba(79,110,247,0.1); color: var(--primary); }
.stat-card.success .stat-icon { background: rgba(16,185,129,0.1); color: var(--success); }
.stat-card.warning .stat-icon { background: rgba(245,158,11,0.1); color: var(--warning); }
.stat-card.info .stat-icon { background: rgba(59,130,246,0.1); color: var(--info); }

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============ 表格 ============ */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table thead th {
    background: #F8FAFC;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid #F1F5F9;
    font-size: 14px;
    color: var(--text-dark);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: #F8FAFC;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ============ 标签 ============ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
}

.badge-authorized { background: rgba(79,110,247,0.1); color: var(--primary); }
.badge-landing { background: rgba(16,185,129,0.1); color: var(--success); }
.badge-backup { background: rgba(245,158,11,0.1); color: var(--warning); }
.badge-enabled { background: rgba(16,185,129,0.1); color: var(--success); }
.badge-disabled { background: rgba(239,68,68,0.1); color: var(--danger); }
.badge-active { background: rgba(16,185,129,0.1); color: var(--success); }
.badge-paused { background: rgba(239,68,68,0.1); color: var(--danger); }

/* ============ 按钮 ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
    text-decoration: none;
    white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 2px 6px rgba(79,110,247,0.3);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    box-shadow: 0 4px 12px rgba(79,110,247,0.4);
}

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #DC2626; }

.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover { background: #D97706; }

.btn-outline {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(79,110,247,0.04);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 8px;
    font-size: 16px;
}

/* ============ 开关 ============ */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input { display: none; }

.switch .slider {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #CBD5E1;
    border-radius: 24px;
    cursor: pointer;
    transition: var(--transition);
}

.switch .slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    top: 3px;
    left: 3px;
    transition: var(--transition);
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.switch input:checked + .slider {
    background: var(--success);
}

.switch input:checked + .slider::before {
    transform: translateX(20px);
}

/* ============ 表单 ============ */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-dark);
    background: var(--bg-white);
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,110,247,0.15);
}

.form-control::placeholder {
    color: #9CA3AF;
}

textarea.form-control {
    resize: vertical;
    min-height: 60px;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 13px;
    line-height: 1.6;
}

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 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpolyline points='6,9 12,15 18,9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* ============ 搜索框 ============ */
.search-box {
    position: relative;
}

.search-box input {
    padding-left: 40px;
}

.search-box .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}

/* ============ 模态框 ============ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 520px;
    max-width: 90vw;
    max-height: 85vh;
    overflow: hidden;
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from { transform: translateY(-20px) scale(0.97); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 8px;
    font-size: 18px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: #F1F5F9;
    color: var(--text-dark);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(85vh - 140px);
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ============ Toast 提示 ============ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 20px;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    min-width: 280px;
}

.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-warning { background: var(--warning); }

@keyframes toastIn {
    from { transform: translateX(100px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ============ 标签页 ============ */
.tabs {
    display: flex;
    gap: 4px;
    background: #F1F5F9;
    padding: 4px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.tab-item {
    padding: 8px 18px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    background: none;
}

.tab-item:hover {
    color: var(--text-dark);
}

.tab-item.active {
    background: var(--bg-white);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.tab-stat {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 4px;
    line-height: 1.5;
    vertical-align: middle;
}
.tab-stat-success {
    background: rgba(16,185,129,0.12);
    color: var(--success);
}
.tab-stat-danger {
    background: rgba(239,68,68,0.1);
    color: var(--danger);
}
.tab-stat.active {
    cursor: pointer;
    box-shadow: 0 0 0 2px currentColor;
}
.tab-stat-success.active {
    background: rgba(16,185,129,0.25);
    font-weight: 700;
}
.tab-stat-danger.active {
    background: rgba(239,68,68,0.2);
    font-weight: 700;
}

/* ============ 空状态 ============ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h4 {
    font-size: 16px;
    color: var(--text-dark);
    margin: 0 0 8px;
}

.empty-state p {
    font-size: 14px;
}

/* ============ 二维码容器 ============ */
.qrcode-wrapper {
    display: inline-flex;
    padding: 12px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

.qrcode-wrapper canvas,
.qrcode-wrapper img {
    display: block;
}

/* ============ 链接展示 ============ */
.link-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #F8FAFC;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 13px;
    color: var(--primary);
    word-break: break-all;
}

.link-display .copy-btn {
    flex-shrink: 0;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
    background: none;
    border: none;
    font-size: 16px;
    padding: 4px;
}

.link-display .copy-btn:hover {
    color: var(--primary);
}

/* ============ 已选域名标签 ============ */
.selected-domains {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.domain-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(79,110,247,0.1);
    color: var(--primary);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

.domain-tag .remove-tag {
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    opacity: 0.6;
    transition: var(--transition);
}

.domain-tag .remove-tag:hover {
    opacity: 1;
}

/* ============ 域名搜索下拉 ============ */
.domain-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 50;
    max-height: 240px;
    overflow-y: auto;
    margin-top: 4px;
}

.domain-search-dropdown .dropdown-item {
    padding: 10px 14px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid #F1F5F9;
    display: flex;
    align-items: center;
    gap: 10px;
}

.domain-search-dropdown .dropdown-item:last-child {
    border-bottom: none;
}

.domain-search-dropdown .dropdown-item:hover {
    background: #F8FAFC;
}

.domain-search-dropdown .dropdown-item .item-domain {
    font-weight: 500;
    color: var(--text-dark);
}

.domain-search-dropdown .dropdown-item .item-remark {
    font-size: 12px;
    color: var(--text-muted);
}

/* ============ 页面加载动画 ============ */
.page-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 300px;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============ 分页 ============ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-muted);
}

.pagination-info {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-pages {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-pages a,
.pagination-pages span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid transparent;
}

.pagination-pages a {
    color: var(--text-dark);
    cursor: pointer;
}

.pagination-pages a:hover {
    background: #F1F5F9;
    border-color: var(--border-color);
}

.pagination-pages span.current {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination-pages span.ellipsis {
    color: var(--text-muted);
    cursor: default;
}

.pagination-pages a.prev,
.pagination-pages a.next {
    color: var(--text-muted);
}

.pagination-pages a.prev:hover,
.pagination-pages a.next:hover {
    color: var(--primary);
    background: rgba(79,110,247,0.06);
}

/* ============ 标签样式 ============ */
.tag {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 4px;
    margin-right: 4px;
}
.tag-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}
.tag-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}
.tag-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}
.tag-info {
    background: rgba(59, 130, 246, 0.1);
    color: #3B82F6;
}

/* ============ 移动端汉堡菜单按钮 ============ */
.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--text-dark);
    transition: background 0.2s ease;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}
.menu-toggle:hover {
    background: #F1F5F9;
}
.menu-toggle:active {
    background: #E2E8F0;
}

/* 侧边栏遮罩层 */
.sidebar-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* ============ 响应式 ============ */
@media (max-width: 768px) {
    /* 侧边栏 */
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0,0,0,0.3);
    }

    /* 汉堡按钮显示 */
    .menu-toggle {
        display: flex;
    }

    /* 主内容区 */
    .main-content {
        margin-left: 0;
    }
    .content-wrapper {
        padding: 16px;
    }

    /* 顶栏 */
    .topbar {
        padding: 0 12px;
        height: 56px;
        gap: 8px;
    }
    .topbar-title {
        font-size: 16px;
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .topbar-right span {
        display: none;
    }

    /* 卡片 */
    .card-header {
        padding: 14px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }
    .card-body {
        padding: 16px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* 统计卡片 */
    .stat-card {
        padding: 16px;
    }
    .stat-card .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
        margin-bottom: 10px;
    }
    .stat-card .stat-value {
        font-size: 22px;
    }
    .stat-card .stat-label {
        font-size: 12px;
    }

    /* 表格 - 横向滚动 */
    .data-table {
        min-width: 600px;
    }
    .data-table thead th,
    .data-table tbody td {
        padding: 10px 12px;
        font-size: 13px;
    }

    /* 模态框全屏 */
    .modal-overlay.show {
        align-items: flex-end;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
    }
    .modal {
        max-width: 100vw;
        width: 100%;
        max-height: 90vh;
        border-radius: 16px 16px 0 0;
        position: relative;
        z-index: 1001;
    }
    .modal-body {
        max-height: calc(90vh - 120px);
    }

    /* 按钮 */
    .btn {
        padding: 8px 14px;
        font-size: 13px;
    }
    .btn-sm {
        padding: 5px 10px;
        font-size: 12px;
    }

    /* 搜索框适配 */
    .search-box .form-control {
        width: 100% !important;
    }

    /* 标签页适配 */
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
    }
    .tab-item {
        flex-shrink: 0;
        padding: 7px 14px;
        font-size: 12px;
    }

    /* 分页适配 */
    .pagination {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    /* Toast 适配 */
    .toast-container {
        left: 12px;
        right: 12px;
        top: 12px;
    }
    .toast {
        min-width: auto;
        font-size: 13px;
        padding: 12px 16px;
    }

    /* 批量操作栏适配 */
    #batchBar {
        flex-wrap: wrap;
        gap: 10px !important;
        font-size: 13px;
    }

    /* 表格内操作按钮换行 */
    .data-table td div[style*="display:flex;gap:6px"] {
        flex-wrap: wrap;
    }

    /* 顶部操作栏换行 */
    .content-wrapper > div:first-child {
        flex-wrap: wrap !important;
    }
}

@media (max-width: 480px) {
    .content-wrapper {
        padding: 12px;
    }
    .card-body {
        padding: 12px;
    }
    .card-header {
        padding: 12px 14px;
    }
    .stat-card {
        padding: 14px;
    }
    .stat-card .stat-value {
        font-size: 20px;
    }
    .data-table {
        min-width: 520px;
    }
    .btn-sm {
        padding: 4px 8px;
        font-size: 11px;
    }
}
