/* ========================================
   FlowShuttle_Vid V2 - 管理面板样式
   ======================================== */

:root {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: #16213e;
    --bg-card-hover: #1c2a4a;
    --bg-input: #0f1629;
    --border-color: #2a2a4a;
    --border-focus: #667eea;
    --text-primary: #e8e8f0;
    --text-secondary: #8888aa;
    --text-muted: #555577;
    --accent-primary: #667eea;
    --accent-secondary: #764ba2;
    --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --success: #43e97b;
    --warning: #f8d347;
    --danger: #f5576c;
    --info: #4facfe;
    --sidebar-width: 240px;
    --topbar-height: 64px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ---------- Sidebar ---------- */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-header {
    padding: 24px 20px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 24px;
    filter: drop-shadow(0 0 8px rgba(102, 126, 234, 0.5));
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-sub {
    font-size: 12px;
    padding: 2px 8px;
    background: var(--accent-gradient);
    border-radius: 12px;
    color: white;
    font-weight: 600;
}

.nav-menu {
    list-style: none;
    padding: 12px 8px;
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    margin: 2px 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13px;
}

.nav-item:hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

.nav-icon {
    font-size: 16px;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.version {
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
}

/* ---------- Main ---------- */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: var(--topbar-height);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    background: rgba(15, 15, 26, 0.8);
    backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    font-size: 20px;
    font-weight: 600;
}

.topbar-actions {
    display: flex;
    gap: 12px;
}

.page {
    display: none;
    padding: 24px 32px;
    flex: 1;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- Stats ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--accent-primary);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 2px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ---------- Cards ---------- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    border-color: rgba(102, 126, 234, 0.3);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.card-header h3 {
    font-size: 15px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* ---------- Bars ---------- */
.platform-bar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.platform-name {
    width: 80px;
    font-size: 13px;
    flex-shrink: 0;
}

.bar-track {
    flex: 1;
    height: 24px;
    background: var(--bg-input);
    border-radius: 12px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 12px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 4px;
}

.bar-fill.douyin {
    background: linear-gradient(90deg, #fe2c55, #ff6b6b);
}

.bar-fill.bilibili {
    background: linear-gradient(90deg, #00a1d6, #4fc3f7);
}

.bar-fill.wechat {
    background: linear-gradient(90deg, #07c160, #43e97b);
}

.bar-fill.tiktok {
    background: linear-gradient(90deg, #25f4ee, #fe2c55);
}

.bar-fill.xiaohongshu {
    background: linear-gradient(90deg, #ff2442, #ff6b81);
}

.bar-fill.kuaishou {
    background: linear-gradient(90deg, #ff6600, #ffaa00);
}

.bar-count {
    width: 40px;
    text-align: right;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
}

/* ---------- Recent ---------- */
.recent-list {
    max-height: 220px;
    overflow-y: auto;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(42, 42, 74, 0.5);
}

.recent-item:last-child {
    border-bottom: none;
}

.recent-platform {
    font-size: 20px;
    flex-shrink: 0;
}

.recent-info {
    flex: 1;
    min-width: 0;
}

.recent-title {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-meta {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.recent-status {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
    flex-shrink: 0;
}

/* ---------- Forms ---------- */
.collect-form,
.publish-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.input-text,
.input-select,
.input-textarea {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    transition: var(--transition);
    outline: none;
    width: 100%;
}

.input-text:focus,
.input-select:focus,
.input-textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.input-textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.6;
}

.input-sm {
    padding: 6px 10px;
    font-size: 13px;
    width: auto;
}

.input-color {
    width: 60px;
    height: 36px;
    padding: 2px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    cursor: pointer;
}

.filter-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 2px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.5);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-ghost:hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.btn-danger {
    background: linear-gradient(135deg, #f5576c, #f093fb);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #43e97b, #38f9d7);
    color: #0f0f1a;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 15px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ---------- Progress ---------- */
.progress-bar {
    height: 6px;
    background: var(--bg-input);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 3px;
    transition: width 0.5s ease;
    width: 0;
}

.progress-text {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ---------- Video Grid ---------- */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.video-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
}

.video-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--accent-primary);
}

.video-card.selected {
    border-color: var(--success);
    box-shadow: 0 0 0 2px rgba(67, 233, 123, 0.3);
}

.video-select-check {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    font-size: 14px;
    color: white;
    transition: var(--transition);
}

.video-card.selected .video-select-check {
    background: var(--success);
    border-color: var(--success);
}

.video-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    position: relative;
    overflow: hidden;
}

.video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-duration {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
}

.platform-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    z-index: 4;
    backdrop-filter: blur(4px);
    line-height: 1;
}

.platform-badge svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.platform-badge.douyin {
    background: rgba(254, 44, 85, 0.85);
}

.platform-badge.bilibili {
    background: rgba(0, 161, 214, 0.85);
}

.platform-badge.wechat {
    background: rgba(7, 193, 96, 0.85);
}

.platform-badge.tiktok {
    background: rgba(0, 0, 0, 0.8);
}

.platform-badge.xiaohongshu {
    background: rgba(255, 36, 66, 0.85);
}

.platform-badge.kuaishou {
    background: rgba(255, 102, 0, 0.85);
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    color: white;
    background: rgba(0, 0, 0, 0.5);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.video-thumb:hover .play-icon {
    opacity: 1;
}

.preview-info {
    padding: 12px 16px;
    color: var(--text-secondary);
    font-size: 13px;
    border-top: 1px solid var(--border);
}

.video-card-body {
    padding: 12px;
}

.video-card-title {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.video-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
}

.video-error-hint {
    font-size: 11px;
    color: #ff6b6b;
    padding: 2px 0;
    line-height: 1.3;
    word-break: break-all;
}

.video-card-actions {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    border-top: 1px solid var(--border-color);
}

/* ---------- Accounts ---------- */
.accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.account-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

.account-card:hover {
    border-color: var(--accent-primary);
}

.account-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.account-avatar.douyin {
    background: linear-gradient(135deg, #fe2c55, #25f4ee);
}

.account-avatar.bilibili {
    background: linear-gradient(135deg, #00a1d6, #4fc3f7);
}

.account-avatar.wechat {
    background: linear-gradient(135deg, #07c160, #43e97b);
}

.account-avatar.tiktok {
    background: linear-gradient(135deg, #25f4ee, #fe2c55);
}

.account-avatar.xiaohongshu {
    background: linear-gradient(135deg, #ff2442, #ff6b81);
}

.account-avatar.kuaishou {
    background: linear-gradient(135deg, #ff6600, #ffaa00);
}

.account-info {
    flex: 1;
    min-width: 0;
}

.account-name {
    font-weight: 600;
    margin-bottom: 2px;
}

.account-nickname {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.account-platform {
    font-size: 12px;
    color: var(--text-secondary);
}

.account-actions {
    display: flex;
    gap: 6px;
}

/* ---------- Tags Grid ---------- */
.tags-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.tag-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.tag-card:hover {
    border-color: var(--accent-primary);
}

.tag-color-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tag-name {
    font-weight: 500;
    font-size: 14px;
}

.tag-count {
    font-size: 12px;
    color: var(--text-secondary);
}

.tag-actions {
    display: flex;
    gap: 4px;
    margin-left: 8px;
}

/* ---------- Tables ---------- */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 12px 14px;
    font-size: 13px;
    border-bottom: 1px solid rgba(42, 42, 74, 0.3);
}

.data-table tr:hover td {
    background: rgba(102, 126, 234, 0.05);
}

/* ---------- Status ---------- */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.completed,
.status-badge.published,
.status-badge.success {
    background: rgba(67, 233, 123, 0.15);
    color: var(--success);
}

.status-badge.pending,
.status-badge.untested {
    background: rgba(248, 211, 71, 0.15);
    color: var(--warning);
}

.status-badge.downloading,
.status-badge.uploading,
.status-badge.running {
    background: rgba(79, 172, 254, 0.15);
    color: var(--info);
}

.status-badge.failed {
    background: rgba(245, 87, 108, 0.15);
    color: var(--danger);
}

.status-badge.active {
    background: rgba(67, 233, 123, 0.15);
    color: var(--success);
}

.status-badge.inactive {
    background: rgba(136, 136, 170, 0.15);
    color: var(--text-secondary);
}

/* ---------- Tag Cloud ---------- */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-item {
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 13px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: default;
}

.tag-item:hover {
    background: rgba(102, 126, 234, 0.15);
    border-color: var(--accent-primary);
}

/* ---------- Duration ---------- */
.duration-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.duration-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.duration-label {
    width: 100px;
    font-size: 13px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.duration-track {
    flex: 1;
    height: 24px;
    background: var(--bg-input);
    border-radius: 12px;
    overflow: hidden;
}

.duration-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 12px;
    transition: width 0.8s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    font-size: 11px;
    color: white;
    font-weight: 600;
    min-width: 30px;
}

/* ---------- Checkbox List ---------- */
.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.checkbox-item:hover {
    background: rgba(102, 126, 234, 0.1);
}

.checkbox-item input {
    accent-color: var(--accent-primary);
}

.modal-info {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

/* ---------- Modal ---------- */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.3s ease;
}

.modal-content.modal-lg {
    max-width: 600px;
}

.modal-content.modal-xl {
    max-width: 900px;
}

/* 扫码登录 loading */
.qr-loading {
    padding: 48px 0;
    color: var(--text-secondary);
}

.qr-spinner {
    width: 36px;
    height: 36px;
    margin: 0 auto 16px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: qrSpin 0.8s linear infinite;
}

@keyframes qrSpin {
    to { transform: rotate(360deg); }
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 16px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
    max-height: 75vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ---------- Toast ---------- */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: white;
    box-shadow: var(--shadow);
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
    max-width: 360px;
}

.toast.success {
    background: linear-gradient(135deg, #43e97b, #38f9d7);
    color: #0f0f1a;
}

.toast.error {
    background: linear-gradient(135deg, #f5576c, #f093fb);
}

.toast.info {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: #0f0f1a;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 20px;
    font-size: 14px;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
}

.pagination .btn {
    min-width: 36px;
    justify-content: center;
}

.pagination .btn.active {
    background: var(--accent-gradient);
    color: white;
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .main-content {
        margin-left: 0;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        padding: 0 16px;
    }

    .page {
        padding: 16px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ========== 登录页 ========== */
.login-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
}

.login-card {
    width: 380px;
    max-width: 90%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.login-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.login-card .form-group {
    margin-bottom: 20px;
}

.login-card label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.login-card .form-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
    box-sizing: border-box;
}

.login-card .form-input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.login-error {
    color: var(--danger);
    font-size: 13px;
    margin-bottom: 12px;
    text-align: center;
}

.login-btn {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

/* 退出登录按钮 */
.btn-logout {
    display: block;
    width: 100%;
    padding: 8px;
    margin-bottom: 8px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-logout:hover {
    color: var(--danger);
    border-color: var(--danger);
}

/* 侧边栏备份按钮 */
.sidebar-backup-actions {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.btn-backup {
    flex: 1;
    padding: 6px 8px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.btn-backup:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    background: rgba(102, 126, 234, 0.1);
}

/* card-header 内多按钮对齐 */
.header-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}