/* 现代化UI设计 - Emby代理管理系统 */

/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS变量 - 现代配色方案 */
:root {
    /* 主色调 - 深蓝渐变 */
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --primary-light: #7c3aed;
    
    /* 辅助色 */
    --secondary: #38b2ac;
    --accent: #ed8936;
    --success: #48bb78;
    --warning: #ed8936;
    --error: #f56565;
    --info: #4299e1;
    
    /* 中性色 */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* 背景 */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    
    /* 文字 */
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --text-inverse: #ffffff;
    
    /* 阴影 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* 边框 */
    --border-color: #e2e8f0;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
    
    /* 动画 */
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* 尺寸 */
    --sidebar-width: 280px;
    --header-height: 80px;
}

/* 暗色模式 */
[data-theme="dark"] {
    --bg-primary: #1a202c;
    --bg-secondary: #2d3748;
    --bg-tertiary: #4a5568;
    --text-primary: #f7fafc;
    --text-secondary: #e2e8f0;
    --text-muted: #a0aec0;
    --border-color: #4a5568;
}

/* 基础字体和布局 */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    font-size: 14px;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* 应用布局 */
.app {
    display: flex;
    min-height: 100vh;
    background: var(--bg-secondary);
}

/* 侧边栏 */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.9) 100%);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255,255,255,0.2);
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
    overflow-y: auto;
}

.sidebar-header {
    padding: 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: linear-gradient(135deg, rgba(102,126,234,0.1) 0%, rgba(116,75,162,0.1) 100%);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    font-weight: bold;
}

.sidebar-title {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    padding: 1.5rem 0;
}

.nav-section {
    margin-bottom: 2rem;
}

.nav-title {
    padding: 0 2rem 0.5rem;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-item {
    margin: 0.25rem 1rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    opacity: 0;
    transition: var(--transition);
    border-radius: var(--border-radius-sm);
}

.nav-link:hover::before,
.nav-link.active::before {
    opacity: 0.1;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
    transform: translateX(4px);
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.nav-text {
    position: relative;
    z-index: 1;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
}

/* 侧边栏遮罩层 */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 999;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    cursor: pointer;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.user-menu:hover {
    background: rgba(255,255,255,0.15);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.user-role {
    font-size: 12px;
    color: var(--text-muted);
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg-secondary);
}

/* 顶部导航 */
.header {
    height: var(--header-height);
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 1001;
}

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

.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    position: relative;
    z-index: 1002;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}

.menu-toggle:hover {
    background: var(--gray-100);
}

.menu-toggle:active {
    transform: scale(0.95);
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 内容区域 */
.content {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* 卡片组件 */
.card {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--gray-50);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.card-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin: 4px 0 0 0;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    background: var(--gray-50);
    border-top: 1px solid var(--border-color);
}

/* 按钮组件 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    line-height: 1.4;
    min-height: 40px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.2);
    opacity: 0;
    transition: var(--transition);
}

.btn:hover::before {
    opacity: 1;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #38a169 100%);
    color: white;
    box-shadow: var(--shadow);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning) 0%, #dd6b20 100%);
    color: white;
    box-shadow: var(--shadow);
}

.btn-danger {
    background: linear-gradient(135deg, var(--error) 0%, #e53e3e 100%);
    color: white;
    box-shadow: var(--shadow);
}

.btn-info {
    background: linear-gradient(135deg, var(--info) 0%, #3182ce 100%);
    color: white;
    box-shadow: var(--shadow);
}

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

.btn-lg {
    padding: 14px 24px;
    font-size: 16px;
    min-height: 48px;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
}

/* 表单组件 */
.form-group {
    margin-bottom: 1.5rem;
}

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

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    transition: var(--transition);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

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

/* 网格布局 */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
}

/* 状态标签 */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: rgba(72, 187, 120, 0.1);
    color: var(--success);
}

.badge-warning {
    background: rgba(237, 137, 54, 0.1);
    color: var(--warning);
}

.badge-danger {
    background: rgba(245, 101, 101, 0.1);
    color: var(--error);
}

.badge-info {
    background: rgba(66, 153, 225, 0.1);
    color: var(--info);
}

.badge-secondary {
    background: var(--gray-100);
    color: var(--text-muted);
}

/* 通知组件 */
.alerts {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.alert {
    padding: 16px 20px;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    animation: slideIn 0.3s ease-out;
    border-left: 4px solid;
    position: relative;
    overflow: hidden;
}

.alert::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    animation: progress 5s linear;
}

.alert-success {
    background: rgba(72, 187, 120, 0.05);
    border-color: var(--success);
    color: var(--success);
}

.alert-success::before {
    background: var(--success);
}

.alert-error {
    background: rgba(245, 101, 101, 0.05);
    border-color: var(--error);
    color: var(--error);
}

.alert-error::before {
    background: var(--error);
}

.alert-warning {
    background: rgba(237, 137, 54, 0.05);
    border-color: var(--warning);
    color: var(--warning);
}

.alert-warning::before {
    background: var(--warning);
}

.alert-info {
    background: rgba(66, 153, 225, 0.05);
    border-color: var(--info);
    color: var(--info);
}

.alert-info::before {
    background: var(--info);
}

.alert-icon {
    font-size: 20px;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.alert-message {
    font-size: 14px;
    opacity: 0.9;
}

.alert-close {
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.5;
    transition: var(--transition);
    padding: 4px;
    border-radius: 4px;
}

.alert-close:hover {
    opacity: 1;
    background: rgba(0,0,0,0.1);
}

/* 安全提示框优化样式 */
.security-tips-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-size: 200% 200%;
    border-radius: 12px;
    padding: 1px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: gradient-shift 8s ease infinite;
}

@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.security-tips-container:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.25);
    transform: translateY(-2px);
}

.security-tip-header {
    background: white;
    border-radius: 11px 11px 0 0;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
}

.tip-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    flex-shrink: 0;
}

.tip-title {
    font-size: 15px;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.security-tip-content {
    background: white;
    border-radius: 0 0 11px 11px;
    padding: 16px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tip-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(102, 126, 234, 0.03);
    border-radius: 8px;
    border-left: 3px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tip-item:hover {
    background: rgba(102, 126, 234, 0.08);
    border-left-color: #667eea;
    transform: translateX(4px);
}

.tip-bullet {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    flex-shrink: 0;
    margin-top: 2px;
}

.tip-item span {
    flex: 1;
    font-size: 14px;
    line-height: 1.6;
    color: #4a5568;
}

.tip-item strong {
    color: #667eea;
    font-weight: 600;
}

/* 增强加载动画系统 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    display: none; /* 默认隐藏 */
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 当需要显示时，通过 JS 设置 display: flex */
.loading-overlay:not(.d-none) {
    display: flex;
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
    animation: loadingEnter 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.loading-spinner-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(var(--primary-rgb), 0.1);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1.2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    position: relative;
    z-index: 1;
}

.loading-dots {
    position: absolute;
    display: flex;
    gap: 4px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.loading-dots span {
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
    animation: dotPulse 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(1) { animation-delay: 0s; }
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

.loading-message {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    opacity: 0.8;
    letter-spacing: 0.5px;
}

.loading-progress {
    width: 200px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(var(--primary-rgb), 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 2px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
}

.progress-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
}

/* 加载类型特定样式 */
.loading-refresh .loading-spinner-wrapper {
    animation: refreshBounce 0.8s ease-out;
}

.loading-refresh .loading-spinner {
    border-top-color: #10b981;
    animation: spin 0.8s linear infinite;
}

.loading-save .loading-spinner-wrapper {
    animation: savePulse 1s ease-in-out infinite;
}

.loading-save .loading-spinner {
    border-top-color: #f59e0b;
}

/* 骨架屏加载 */
.skeleton-loading {
    pointer-events: none;
}

.skeleton-wrapper {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    animation: skeletonFadeIn 0.3s ease-out;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    flex-shrink: 0;
}

.skeleton-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.skeleton-line {
    height: 16px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-title {
    height: 20px;
    width: 60%;
}

/* 页面过渡动画 */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateX(-100%);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-transition.active {
    opacity: 1;
    transform: translateX(0);
}

.page-transition.complete {
    transform: translateX(100%);
}

.page-transition.backward {
    transform: translateX(100%);
}

.page-transition.backward.active {
    transform: translateX(0);
}

.page-transition.backward.complete {
    transform: translateX(-100%);
}

.transition-progress {
    width: 300px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.transition-line {
    width: 0%;
    height: 100%;
    background: white;
    border-radius: 2px;
    animation: transitionProgress 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* 动画 */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes progress {
    from { width: 100%; }
    to { width: 0%; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 新增加载动画关键帧 */
@keyframes loadingEnter {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes dotPulse {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes refreshBounce {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.1) rotate(-5deg);
    }
    50% {
        transform: scale(0.95) rotate(180deg);
    }
    75% {
        transform: scale(1.05) rotate(185deg);
    }
}

@keyframes savePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes skeletonShimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes skeletonFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes transitionProgress {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}

@keyframes ripple {
    from {
        opacity: 1;
        transform: scale(0);
    }
    to {
        opacity: 0;
        transform: scale(4);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes breathe {
    0%, 100% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .header {
        padding: 0 1rem;
    }
    
    .header-left {
        gap: 12px;
        z-index: 1002;
    }
    
    .content {
        padding: 1rem;
    }
    
    .alerts {
        left: 1rem;
        right: 1rem;
        top: 1rem;
    }
    
    .alert {
        min-width: auto;
        max-width: none;
    }
}

@media (max-width: 640px) {
    .header {
        padding: 0 0.75rem;
        height: 60px;
    }
    
    .header-left {
        gap: 8px;
    }
    
    .menu-toggle {
        width: 44px;
        height: 44px;
        font-size: 20px;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    .menu-toggle span {
        pointer-events: none;
    }
    
    .page-title {
        font-size: 18px;
    }
    
    .sidebar-header {
        padding: 1.5rem;
    }
    
    .content {
        padding: 1rem 0.5rem;
    }
    
    .card-header,
    .card-body,
    .card-footer {
        padding: 1rem;
    }
}

/* 工具类 */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.text-primary { color: var(--primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--error); }
.text-info { color: var(--info); }

.bg-primary { background: var(--primary); }
.bg-secondary { background: var(--bg-secondary); }
.bg-success { background: var(--success); }
.bg-warning { background: var(--warning); }
.bg-danger { background: var(--error); }
.bg-info { background: var(--info); }

.border { border: 1px solid var(--border-color); }
.border-0 { border: none; }
.rounded { border-radius: var(--border-radius-sm); }
.rounded-lg { border-radius: var(--border-radius); }

.shadow { box-shadow: var(--shadow); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-none { box-shadow: none; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.flex-1 { flex: 1; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-end { display: flex; align-items: center; justify-content: flex-end; }

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

.m-0 { margin: 0; }
.m-1 { margin: 0.25rem; }
.m-2 { margin: 0.5rem; }
.m-3 { margin: 0.75rem; }
.m-4 { margin: 1rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }

.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

.select-none { user-select: none; }

.animate-fade-in { animation: fadeIn 0.3s ease-out; }
.animate-slide-up { animation: slideUp 0.3s ease-out; }

/* 网盘规则开关按钮样式 - 限定作用域避免影响其他UI */
.regex-item .form-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.regex-item .form-switch .switch-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.regex-item .form-switch .switch-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin: 0;
    font-weight: 500;
    color: var(--text-primary);
    transition: var(--transition);
    font-size: 13px;
}

.regex-item .form-switch .switch-slider {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
    background-color: var(--gray-300);
    border-radius: 20px;
    transition: var(--transition);
    flex-shrink: 0;
}

.regex-item .form-switch .switch-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 2px;
    top: 2px;
    background-color: white;
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

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

.regex-item .form-switch .switch-input:checked + .switch-label .switch-slider::before {
    transform: translateX(20px);
}

.regex-item .form-switch .switch-input:disabled + .switch-label {
    opacity: 0.5;
    cursor: not-allowed;
}

.regex-item .form-switch .switch-input:disabled + .switch-label .switch-slider {
    background-color: var(--gray-200);
    cursor: not-allowed;
}

.regex-item .form-switch:hover .switch-input:not(:disabled) + .switch-label .switch-slider {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.regex-item .form-switch .switch-text {
    font-size: 13px;
    color: var(--text-secondary);
}

/* 优化规则优先级控制栏布局 */
.regex-item .regex-priority {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
    padding: 12px 16px;
    border-radius: 8px 8px 0 0;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border-color);
}

.regex-item .priority-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 统一删除按钮样式 - 适用于路径映射和规则 */
.mapping-actions,
.regex-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.mapping-actions .btn,
.regex-actions .btn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    padding: 6px 12px;
    transition: all 0.2s ease;
}

.mapping-actions .btn span,
.regex-actions .btn span {
    font-size: 14px;
}

.mapping-actions .btn:hover,
.regex-actions .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 101, 101, 0.3);
}

/* 配置卡片样式 */
.config-cards-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.config-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    border: 1px solid var(--border-color);
    position: relative;
}

.config-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border-color: var(--primary);
}

.config-card-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 24px 24px 16px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(255, 255, 255, 0.8) 100%);
}

.config-icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

.config-icon {
    font-size: 24px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.config-info {
    flex: 1;
    min-width: 0;
}

.config-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 6px 0;
    line-height: 1.3;
}

.config-description {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

.config-card-body {
    padding: 0 24px 24px;
}

.config-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.feature-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: var(--gray-100);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    border-radius: 20px;
    transition: var(--transition);
}

.config-card:hover .feature-tag {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary);
}

.config-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.config-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.config-btn:active {
    transform: translateY(0);
}

.btn-text {
    flex: 1;
    text-align: left;
}

.btn-arrow {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.config-btn:hover .btn-arrow {
    transform: translateX(4px);
}

/* 响应式布局 */
@media (max-width: 768px) {
    .config-cards-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .config-card-header {
        padding: 20px 20px 12px;
        gap: 12px;
    }
    
    .config-icon-wrapper {
        width: 48px;
        height: 48px;
        border-radius: 12px;
    }
    
    .config-icon {
        font-size: 20px;
    }
    
    .config-title {
        font-size: 16px;
    }
    
    .config-card-body {
        padding: 0 20px 20px;
    }
}

/* ========================================
   订阅模块响应式设计
   ======================================== */

/* 基础断点定义 */
/* 移动设备: < 768px */
/* 平板设备: 768px - 1023px */
/* 桌面设备: >= 1024px */

/* 订阅页面容器 */
.subscription-page {
    width: 100%;
    max-width: 100%;
}

/* 页面头部响应式 */
.page-header-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.header-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.header-text {
    flex: 1;
    min-width: 0;
}

.page-main-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.25rem 0;
    color: var(--text-primary);
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* 统计面板响应式 */
.statistics-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 120px;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* 视图控件响应式 */
.view-controls {
    display: flex;
    gap: 0.5rem;
    background: white;
    padding: 0.25rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.view-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
}

.view-btn:hover {
    background: var(--gray-100);
    color: var(--text-primary);
}

.view-btn.active {
    background: var(--primary);
    color: white;
}

/* 搜索筛选栏响应式 */
.search-filter-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.search-filter-bar input,
.search-filter-bar select {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
}

/* 批量操作工具栏响应式 */
.batch-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.selected-count {
    font-weight: 600;
    color: var(--text-primary);
    margin-right: auto;
}

.batch-toolbar .btn {
    min-width: 44px;
    min-height: 44px;
}

/* 订阅网格布局 */
.subscriptions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

/* 订阅卡片 */
.subscription-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
}

.subscription-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.subscription-card-poster {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    background: var(--gray-200);
}

.subscription-card-body {
    padding: 1rem;
}

.subscription-card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 列表视图 */
.subscriptions-list {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.subscription-list-item {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    transition: background 0.2s ease;
}

.subscription-list-item:hover {
    background: var(--gray-50);
}

.subscription-list-item:last-child {
    border-bottom: none;
}

.subscription-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.subscription-info {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 100px;
    gap: 1rem;
    align-items: center;
}

.subscription-actions {
    display: flex;
    gap: 0.5rem;
}

/* 自定义标签页 */
.custom-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 0;
}

.custom-tab {
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    position: relative;
    bottom: -2px;
    min-height: 44px;
}

.custom-tab:hover {
    color: var(--text-primary);
    background: var(--gray-50);
}

.custom-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* 进度条 */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* 转存记录列表 */
.transfer-records-list {
    max-height: 400px;
    overflow-y: auto;
}

.transfer-record-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.transfer-record-item:last-child {
    border-bottom: none;
}

/* ========================================
   平板设备响应式 (768px - 1023px)
   ======================================== */
@media (min-width: 768px) and (max-width: 1023px) {
    /* 统计面板 - 2列布局 */
    .statistics-panel {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    /* 订阅网格 - 3列布局 */
    .subscriptions-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 1rem;
    }
    
    /* 页面头部 */
    .page-header-card {
        padding: 1.5rem;
    }
    
    .header-content {
        gap: 1rem;
    }
    
    .page-main-title {
        font-size: 1.5rem;
    }
    
    /* 列表视图信息 - 调整列宽 */
    .subscription-info {
        grid-template-columns: 2fr 1fr 1fr 80px;
        gap: 0.75rem;
        font-size: 0.875rem;
    }
    
    /* 批量工具栏 */
    .batch-toolbar {
        padding: 0.75rem;
        gap: 0.75rem;
    }
    
    /* 搜索筛选栏 */
    .search-filter-bar input,
    .search-filter-bar select {
        min-width: 150px;
    }
}

/* ========================================
   移动设备响应式 (< 768px)
   ======================================== */
@media (max-width: 767px) {
    /* 页面头部 - 垂直布局 */
    .page-header-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .header-left {
        width: 100%;
    }
    
    .header-icon {
        font-size: 2rem;
    }
    
    .page-main-title {
        font-size: 1.25rem;
    }
    
    .page-subtitle {
        font-size: 0.8125rem;
    }
    
    .header-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .header-actions .btn {
        flex: 1;
        min-width: calc(50% - 0.375rem);
        justify-content: center;
        font-size: 0.8125rem;
        padding: 0.625rem 0.75rem;
    }
    
    /* 统计面板 - 单列布局 */
    .statistics-panel {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
        min-height: 100px;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.8125rem;
    }
    
    /* 标签页和视图控件 */
    .custom-tabs {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .custom-tab {
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
        flex: 1;
        min-width: calc(50% - 0.125rem);
        text-align: center;
    }
    
    .view-controls {
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
    }
    
    .view-btn {
        flex: 1;
        padding: 0.625rem;
    }
    
    .view-btn span {
        display: none;
    }
    
    /* 搜索筛选栏 - 垂直布局 */
    .search-filter-bar {
        flex-direction: column;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .search-filter-bar input,
    .search-filter-bar select {
        width: 100%;
        min-width: 0;
    }
    
    /* 批量操作工具栏 - 垂直布局 */
    .batch-toolbar {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .selected-count {
        margin-right: 0;
        text-align: center;
    }
    
    .batch-toolbar .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* 订阅网格 - 2列布局 */
    .subscriptions-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .subscription-card-body {
        padding: 0.75rem;
    }
    
    .subscription-card-title {
        font-size: 0.875rem;
    }
    
    /* 列表视图 - 简化布局 */
    .subscription-list-item {
        grid-template-columns: 40px 1fr;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
    }
    
    .subscription-info {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        font-size: 0.8125rem;
    }
    
    .subscription-actions {
        margin-top: 0.5rem;
        width: 100%;
    }
    
    .subscription-actions .btn {
        flex: 1;
    }
    
    /* 模态框 - 全屏 */
    .modal {
        padding: 0;
    }
    
    .modal-dialog {
        margin: 0;
        max-width: 100%;
        min-height: 100vh;
    }
    
    .modal-dialog.modal-xl,
    .modal-dialog.modal-lg,
    .modal-dialog.modal-fullscreen {
        max-width: 100%;
        width: 100%;
    }
    
    .modal-content {
        border-radius: 0;
        min-height: 100vh;
    }
    
    .modal-header {
        padding: 1rem 1.5rem;
    }
    
    .modal-title {
        font-size: 1.125rem;
    }
    
    .modal-body {
        padding: 1rem 1.5rem;
    }
    
    .modal-footer {
        padding: 1rem 1.5rem;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    /* 转存记录 */
    .transfer-records-list {
        max-height: 300px;
    }
    
    .transfer-record-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.75rem;
        gap: 0.5rem;
    }
    
    /* 表单组 */
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-group label {
        font-size: 0.875rem;
    }
    
    .form-control,
    .form-select {
        font-size: 0.875rem;
        padding: 0.625rem 0.875rem;
    }
}

/* ========================================
   超小屏幕设备 (< 480px)
   ======================================== */
@media (max-width: 479px) {
    /* 订阅网格 - 单列布局 */
    .subscriptions-grid {
        grid-template-columns: 1fr;
    }
    
    /* 统计卡片 - 更紧凑 */
    .stat-card {
        padding: 0.875rem;
    }
    
    /* 按钮文字 - 隐藏部分文字 */
    .header-actions .btn span {
        display: none;
    }
    
    .header-actions .btn i {
        margin: 0;
    }
    
    /* 标签页 - 单列 */
    .custom-tab {
        min-width: 100%;
    }
}

/* ========================================
   触摸设备优化
   ======================================== */
@media (hover: none) and (pointer: coarse) {
    /* 增大触摸目标 */
    .btn,
    .view-btn,
    .custom-tab,
    .subscription-card,
    .subscription-list-item {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* 移除悬停效果 */
    .subscription-card:hover,
    .subscription-list-item:hover,
    .stat-card:hover {
        transform: none;
    }
    
    /* 添加触摸反馈 */
    .btn:active,
    .view-btn:active,
    .custom-tab:active,
    .subscription-card:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
    
    /* 优化滚动 */
    .transfer-records-list,
    .modal-body {
        -webkit-overflow-scrolling: touch;
    }
}

/* ========================================
   打印样式
   ======================================== */
@media print {
    .header-actions,
    .view-controls,
    .batch-toolbar,
    .search-filter-bar,
    .subscription-actions,
    .modal-footer {
        display: none !important;
    }
    
    .subscription-card,
    .subscription-list-item {
        break-inside: avoid;
    }
    
    .subscriptions-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ========================================
   高对比度模式
   ======================================== */
@media (prefers-contrast: high) {
    .subscription-card,
    .stat-card,
    .batch-toolbar {
        border: 2px solid currentColor;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

/* ========================================
   减少动画模式
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .subscription-card:hover,
    .stat-card:hover {
        transform: none;
    }
}

/* ========================================
   暗色模式支持
   ======================================== */
@media (prefers-color-scheme: dark) {
    [data-theme="auto"] .subscription-card,
    [data-theme="auto"] .batch-toolbar,
    [data-theme="auto"] .subscriptions-list {
        background: var(--bg-secondary);
        border-color: var(--border-color);
    }
    
    [data-theme="auto"] .subscription-list-item:hover {
        background: var(--bg-tertiary);
    }
}

/* ========================================
   横屏模式优化
   ======================================== */
@media (max-width: 767px) and (orientation: landscape) {
    .modal-dialog {
        max-height: 100vh;
        overflow-y: auto;
    }
    
    .statistics-panel {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .subscriptions-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ========================================
   可访问性增强
   ======================================== */

/* 焦点指示器 */
.btn:focus-visible,
.view-btn:focus-visible,
.custom-tab:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.subscription-checkbox:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

/* 跳过链接 */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 0 0 8px 0;
    z-index: 10001;
}

.skip-link:focus {
    top: 0;
}

/* 屏幕阅读器专用文本 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* 高对比度文本 */
.high-contrast-text {
    color: var(--text-primary);
    font-weight: 600;
}

/* 禁用状态 */
.btn:disabled,
.view-btn:disabled,
.custom-tab:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* 加载状态 */
.btn.loading,
.subscription-card.loading {
    position: relative;
    pointer-events: none;
}

.btn.loading::after,
.subscription-card.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
