/* ============================================================
   微信公众号文章下载管理工具 — 设计系统
   Premium Dark Theme with Glassmorphism
   ============================================================ */

/* ── CSS 变量 ──────────────────────────────────────────── */
:root {
    /* 主色调 */
    --primary: #667eea;
    --primary-light: #7c94f4;
    --primary-dark: #5567d5;
    --primary-glow: rgba(102, 126, 234, 0.3);

    /* 渐变 */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-accent: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-success: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --gradient-warning: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --gradient-bg: linear-gradient(135deg, #0a0a1a 0%, #1a1a2e 50%, #16213e 100%);

    /* 背景色 */
    --bg-primary: #0a0a1a;
    --bg-secondary: #111128;
    --bg-card: rgba(25, 25, 50, 0.6);
    --bg-card-hover: rgba(35, 35, 65, 0.7);
    --bg-input: rgba(20, 20, 40, 0.8);
    --bg-sidebar: rgba(10, 10, 26, 0.95);
    --bg-glass: rgba(255, 255, 255, 0.05);
    --bg-glass-hover: rgba(255, 255, 255, 0.08);

    /* 文字色 */
    --text-primary: #e8e8f0;
    --text-secondary: #9898b0;
    --text-muted: #6868a0;
    --text-accent: #667eea;

    /* 边框 */
    --border-color: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --border-focus: rgba(102, 126, 234, 0.5);

    /* 状态色 */
    --success: #43e97b;
    --error: #f5576c;
    --warning: #fee140;
    --info: #667eea;

    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(102, 126, 234, 0.2);

    /* 间距 */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;

    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* 尺寸 */
    --sidebar-width: 240px;
    --sidebar-collapsed: 72px;

    /* 字体 */
    --font-family: 'Inter', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;

    /* 动画 */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s 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: var(--font-family);
    background: var(--gradient-bg);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ── 应用布局 ──────────────────────────────────────────── */
#app {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* ── 侧边栏 ───────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 100;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: width var(--transition-slow), min-width var(--transition-slow);
}

.sidebar-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.logo-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    color: white;
    flex-shrink: 0;
    box-shadow: var(--shadow-glow);
}

.logo-icon svg {
    width: 22px;
    height: 22px;
}

.logo-text h1 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* ── 系统切换器 ─────────────────────────────────────────── */
.system-switcher {
    display: flex;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-top: var(--spacing-lg);
}

.sys-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.sys-btn:hover {
    color: var(--text-primary);
}

.sys-btn.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.sys-nav-group {
    display: none;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.sys-nav-group.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

/* ── 导航菜单 ──────────────────────────────────────────── */
.sidebar-nav {
    flex: 1;
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    overflow-y: auto;
}

.nav-group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    padding: 16px var(--spacing-md) 8px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    user-select: none;
    cursor: pointer;
    transition: color var(--transition-normal);
}

.nav-group-title:hover {
    color: var(--text-primary);
}

.group-arrow {
    font-size: 0.65rem;
    opacity: 0.6;
    transition: transform var(--transition-normal);
}

.nav-group-items {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    transition: all 0.3s ease;
}

.nav-group-items.collapsed {
    display: none;
}

.nav-group-icon {
    font-size: 0.9rem;
    opacity: 0.8;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: 10px var(--spacing-md);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-normal);
    position: relative;
    cursor: pointer;
}

.nav-item:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
    transform: translateX(2px);
}

.nav-item.active {
    background: rgba(102, 126, 234, 0.12);
    color: var(--primary-light);
    box-shadow: inset 3px 0 0 var(--primary);
}

.nav-item.active .nav-icon {
    color: var(--primary-light);
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-icon svg {
    width: 20px;
    height: 20px;
}

.nav-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: auto;
    flex-shrink: 0;
}

.nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: var(--spacing-sm) var(--spacing-md);
}

/* ── 侧边栏底部 ────────────────────────────────────────── */
.sidebar-footer {
    padding: var(--spacing-md) var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

.user-status {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background var(--transition-normal);
}

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 8px rgba(67, 233, 123, 0.5);
    animation: pulse-green 2s ease-in-out infinite;
}

.status-dot.offline {
    background: var(--text-muted);
}

.status-dot.warning {
    background: var(--warning);
    box-shadow: 0 0 8px rgba(254, 225, 64, 0.5);
}

.status-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

@keyframes pulse-green {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.85); }
}

/* ── 主内容区 ──────────────────────────────────────────── */
.main-content {
    flex: 1;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
}

.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-2xl);
    animation: fadeIn 0.3s ease;
}

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

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

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* ── 页面标题 ──────────────────────────────────────────── */
.page-header {
    margin-bottom: var(--spacing-xl);
}

.page-title {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: var(--spacing-xs);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 400;
}

/* ── 卡片组件 ──────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: all var(--transition-normal);
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-lg);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: var(--spacing-xs);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: var(--spacing-lg);
}

/* ── 按钮 ──────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(255,255,255,0.1), transparent);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

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

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.45);
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-hover);
}

.btn-danger {
    background: linear-gradient(135deg, #f5576c, #ff6b81);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.3);
}

.btn-danger:hover {
    box-shadow: 0 6px 25px rgba(245, 87, 108, 0.45);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--gradient-success);
    color: #0a1a10;
    box-shadow: 0 4px 15px rgba(67, 233, 123, 0.3);
}

.btn-success:hover {
    box-shadow: 0 6px 25px rgba(67, 233, 123, 0.45);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
}

.btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-group {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

/* ── 表单控件 ──────────────────────────────────────────── */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px var(--spacing-md);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.9rem;
    transition: all var(--transition-normal);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

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

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

.form-select {
    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='%239898b0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.form-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: var(--spacing-xs);
}

/* Switch 开关 */
.switch-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md);
    background: var(--bg-glass);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: var(--spacing-md);
}

.switch-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.switch-label .label-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.switch-label .label-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

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

.switch-slider {
    position: absolute;
    inset: 0;
    cursor: pointer;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    transition: all var(--transition-normal);
}

.switch-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all var(--transition-normal);
}

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

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

/* ── 表格 ──────────────────────────────────────────────── */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    padding: 12px var(--spacing-md);
    text-align: left;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 12px var(--spacing-md);
    font-size: 0.88rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.data-table tr:last-child td {
    border-bottom: none;
}

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

/* ── 标签/徽章 ─────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-success {
    background: rgba(67, 233, 123, 0.12);
    color: var(--success);
}

.badge-error {
    background: rgba(245, 87, 108, 0.12);
    color: var(--error);
}

.badge-warning {
    background: rgba(254, 225, 64, 0.12);
    color: var(--warning);
}

.badge-info {
    background: rgba(102, 126, 234, 0.12);
    color: var(--info);
}

/* ── 进度条 ────────────────────────────────────────────── */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ── 搜索框 ────────────────────────────────────────────── */
.search-box {
    position: relative;
    max-width: 400px;
}

.search-box .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-box .form-input {
    padding-left: 42px;
}

/* ── 空状态 ────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: var(--spacing-2xl) var(--spacing-lg);
    color: var(--text-muted);
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-lg);
    opacity: 0.3;
}

.empty-state-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.empty-state-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    max-width: 400px;
    margin: 0 auto var(--spacing-lg);
}

/* ── 加载状态 ──────────────────────────────────────────── */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    color: var(--text-muted);
    gap: var(--spacing-md);
}

.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); }
}

/* ── 文章列表项 ────────────────────────────────────────── */
.article-controls {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
}

.article-control-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.article-date-row .form-input {
    width: auto;
    min-width: 150px;
    padding: 6px var(--spacing-sm);
}

.article-date-label,
.article-date-separator {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.article-mode-switch {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.article-item {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-glass);
    transition: all var(--transition-normal);
    animation: slideIn 0.3s ease;
    cursor: pointer;
}

.article-item:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.article-item.selected {
    border-color: var(--primary);
    background: rgba(102, 126, 234, 0.08);
}

.article-checkbox {
    flex-shrink: 0;
    margin-top: 4px;
}

.article-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.article-cover {
    width: 100px;
    height: 70px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-input);
}

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

.article-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.article-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-digest {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.article-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

/* ── 公众号卡片 ────────────────────────────────────────── */
.account-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    cursor: pointer;
}

.account-card:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.account-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-input);
}

.account-avatar-placeholder {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
}

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

.account-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.account-id {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.account-actions {
    display: flex;
    gap: var(--spacing-xs);
}

/* ── 统计卡片 ──────────────────────────────────────────── */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-xs);
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* ── 登录页面特殊样式 ──────────────────────────────────── */
.login-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.login-illustration {
    width: 200px;
    height: 200px;
    margin: 0 auto var(--spacing-xl);
    background: var(--bg-glass);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border-color);
    position: relative;
}

.login-illustration::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px dashed rgba(102, 126, 234, 0.2);
    animation: rotateOrbit 30s linear infinite;
}

@keyframes rotateOrbit {
    to { transform: rotate(360deg); }
}

.login-illustration svg {
    width: 80px;
    height: 80px;
    color: var(--primary);
}

.login-status-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-top: var(--spacing-xl);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.login-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--border-color);
}

.login-info-row:last-child {
    border-bottom: none;
}

.login-info-label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.login-info-value {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.85rem;
}

/* ── Toast 通知 ────────────────────────────────────────── */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04);
    animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    min-width: 320px;
    max-width: 460px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.toast:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.16), 0 4px 12px rgba(0, 0, 0, 0.06);
}

.toast.toast-exit {
    animation: toastSlideOut 0.25s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.toast-success { border-left: 4px solid #07c160; }
.toast-error   { border-left: 4px solid #ff4d4f; }
.toast-warning { border-left: 4px solid #faad14; }
.toast-info    { border-left: 4px solid #1890ff; }

.toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.toast-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

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

.toast-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.35;
    margin-bottom: 4px;
}

.toast-message {
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.55;
    word-break: break-word;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 4px;
    font-size: 1.25rem;
    line-height: 1;
    border-radius: 6px;
    opacity: 0.6;
    transition: opacity 0.2s, background-color 0.2s;
    margin-top: -2px;
    margin-right: -4px;
}

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

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    transform-origin: left;
    animation: toastProgressBar linear forwards;
}

.toast:hover .toast-progress {
    animation-play-state: paused;
}

.toast-progress-success { background: #07c160; }
.toast-progress-error   { background: #ff4d4f; }
.toast-progress-warning { background: #faad14; }
.toast-progress-info    { background: #1890ff; }

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(110%) scale(0.95);
    }
}

@keyframes toastProgressBar {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

/* ── 模态框 ────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    transform: translateZ(0);
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.15s ease;
}

.modal-dialog {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: translateZ(0);
    will-change: transform;
    animation: scaleIn 0.2s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-lg);
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.3rem;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

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

.modal-body {
    margin-bottom: var(--spacing-lg);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
}

/* ── 分页 ──────────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-xl);
}

.pagination .btn {
    min-width: 36px;
}

.pagination-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 var(--spacing-md);
}

/* ── URL 下载区域 ──────────────────────────────────────── */
.url-input-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-2xl);
    text-align: center;
    transition: all var(--transition-normal);
    background: var(--bg-glass);
}

.url-input-area:hover {
    border-color: var(--primary);
    background: rgba(102, 126, 234, 0.05);
}

.url-input-area.dragover {
    border-color: var(--primary);
    background: rgba(102, 126, 234, 0.1);
    box-shadow: var(--shadow-glow);
}

/* ── 下载进度卡片 ──────────────────────────────────────── */
.download-progress-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.download-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.download-progress-stats {
    display: flex;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-md);
    font-size: 0.85rem;
}

.download-progress-stats span {
    color: var(--text-secondary);
}

.download-progress-stats strong {
    color: var(--text-primary);
}

/* ── 下载结果列表 ──────────────────────────────────────── */
.download-result-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.download-result-item.success {
    color: var(--success);
}

.download-result-item.failed {
    color: var(--error);
}

/* ── 代理测试结果 ──────────────────────────────────────── */
.proxy-test-result {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-top: var(--spacing-md);
    animation: scaleIn 0.2s ease;
}

.proxy-test-result.success {
    background: rgba(67, 233, 123, 0.08);
    border: 1px solid rgba(67, 233, 123, 0.2);
    color: var(--success);
}

.proxy-test-result.failure {
    background: rgba(245, 87, 108, 0.08);
    border: 1px solid rgba(245, 87, 108, 0.2);
    color: var(--error);
}

/* ── 工具栏 ────────────────────────────────────────────── */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* ── 标签选择器 ────────────────────────────────────────── */
.tab-selector {
    display: flex;
    background: var(--bg-glass);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 3px;
    gap: 2px;
}

.tab-item {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-normal);
    border: none;
    background: none;
    font-family: var(--font-family);
}

.tab-item:hover {
    color: var(--text-primary);
}

.tab-item.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

/* ── 响应式 ────────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -100%;
        transition: left var(--transition-slow);
        z-index: 200;
    }

    .sidebar.open {
        left: 0;
    }

    .page-container {
        padding: var(--spacing-lg);
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .stat-cards {
        grid-template-columns: 1fr 1fr;
    }
}

/* ── 选中文本颜色 ──────────────────────────────────────── */
::selection {
    background: rgba(102, 126, 234, 0.3);
    color: white;
}

/* ── 搜索结果列表 ──────────────────────────────────────── */
.search-results {
    margin-top: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

/* ── 下载历史 ──────────────────────────────────────────── */
.history-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.history-item .history-status {
    font-size: 1rem;
}

.history-item .history-title {
    flex: 1;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-item .history-time {
    color: var(--text-muted);
    font-size: 0.78rem;
    white-space: nowrap;
}

/* ── 动画入场延迟 ──────────────────────────────────────── */
.animate-stagger > * {
    animation: slideIn 0.3s ease both;
}

.animate-stagger > *:nth-child(1) { animation-delay: 0.05s; }
.animate-stagger > *:nth-child(2) { animation-delay: 0.1s; }
.animate-stagger > *:nth-child(3) { animation-delay: 0.15s; }
.animate-stagger > *:nth-child(4) { animation-delay: 0.2s; }
.animate-stagger > *:nth-child(5) { animation-delay: 0.25s; }
.animate-stagger > *:nth-child(6) { animation-delay: 0.3s; }
.animate-stagger > *:nth-child(7) { animation-delay: 0.35s; }
.animate-stagger > *:nth-child(8) { animation-delay: 0.4s; }

/* ── 白色主题模态框 ────────────────────────────────────── */
.modal-dialog.theme-white {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #1e293b !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
}

.modal-dialog.theme-white .modal-title {
    color: #0f172a !important;
}

.modal-dialog.theme-white .modal-close {
    color: #64748b !important;
}

.modal-dialog.theme-white .modal-close:hover {
    background: rgba(0, 0, 0, 0.05) !important;
    color: #0f172a !important;
}

.modal-dialog.theme-white .btn-secondary {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border: 1px solid #cbd5e1 !important;
}

.modal-dialog.theme-white .btn-secondary:hover {
    background: #e2e8f0 !important;
}

/* ── 选项卡片组件 ──────────────────────────────────────── */
.option-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    user-select: none;
}

.option-card:hover {
    border-color: var(--color-primary);
    background: var(--bg-glass-hover);
    transform: translateY(-2px);
}

.option-card.active {
    border-color: var(--color-primary);
    box-shadow: 0 0 12px rgba(102, 126, 234, 0.2);
    background: rgba(102, 126, 234, 0.05);
}

.option-card-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.option-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}

.option-card-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* User Profile Tab Switcher */
.dy-user-tabs {
    display: flex;
    gap: 8px;
    background: var(--bg-glass);
    padding: 6px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.tab-item {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px 20px;
    border-radius: 8px;
    transition: all var(--transition-fast);
}

.tab-item:hover {
    color: var(--text-primary);
    background: var(--bg-glass-hover);
}

.tab-item.active {
    color: #ffffff;
    background: var(--gradient-primary);
    box-shadow: 0 4px 12px var(--primary-glow);
}

/* ========================================================
   腾讯防水墙 (TCaptcha) 拦截提示条
   ======================================================== */
#waterwall-banner {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 14px;
    width: min(860px, calc(100vw - 32px));
    padding: 14px 18px;
    background: rgba(30, 24, 15, 0.95);
    border: 1px solid rgba(245, 158, 11, 0.6);
    border-radius: var(--radius-md, 10px);
    box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(14px);
    animation: wwDrop 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes wwDrop {
    from { transform: translate(-50%, -16px); opacity: 0; }
    to   { transform: translate(-50%, 0); opacity: 1; }
}

#waterwall-banner .ww-icon {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f59e0b;
    color: #1a1206;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#waterwall-banner .ww-body {
    flex: 1;
    min-width: 0;
}

#waterwall-banner .ww-title {
    color: #fde68a;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 3px;
}

#waterwall-banner .ww-desc {
    color: #e7d7b8;
    font-size: 0.8rem;
    line-height: 1.5;
}

#waterwall-banner .ww-actions {
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
}

#waterwall-banner .ww-btn {
    border: 1px solid transparent;
    border-radius: var(--radius-sm, 6px);
    padding: 7px 14px;
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

#waterwall-banner .ww-verify-now {
    background: linear-gradient(135deg, #0284c7, #38bdf8);
    color: #ffffff;
    font-weight: 600;
}

#waterwall-banner .ww-verify-now:hover:not(:disabled) {
    filter: brightness(1.15);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

#waterwall-banner .ww-retry {
    background: #f59e0b;
    color: #1a1206;
    font-weight: 600;
}

#waterwall-banner .ww-retry:hover:not(:disabled) {
    background: #fbbf24;
}

#waterwall-banner .ww-retry:disabled {
    opacity: 0.6;
    cursor: default;
}

#waterwall-banner .ww-ghost {
    background: transparent;
    border-color: rgba(253, 230, 138, 0.35);
    color: #e7d7b8;
}

#waterwall-banner .ww-ghost:hover {
    background: rgba(253, 230, 138, 0.15);
}

@media (max-width: 640px) {
    #waterwall-banner {
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px 14px;
    }
    #waterwall-banner .ww-actions {
        width: 100%;
    }
    #waterwall-banner .ww-btn {
        flex: 1;
    }
}



