/* ============================================================
   Docker 镜像加速站 · 设计系统
   - 设计语言：iOS 26 液态玻璃 + 现代 DevOps 工具的层次
   - 暗色优先（更符合运维场景），亮色走低饱和度
   - 状态色：pending=running=蓝, success=翠绿, failed=朱红
   ============================================================ */

/* ---------- 设计 token：暗色（默认） ---------- */
:root,
body[data-theme="dark"] {
    /* 背景层 */
    --bg-base: #0a0c10;
    --bg-elev-1: rgba(22, 26, 34, 0.72);
    --bg-elev-2: rgba(28, 33, 44, 0.85);
    --bg-input: rgba(13, 16, 22, 0.6);
    --bg-input-focus: rgba(13, 16, 22, 0.85);

    /* 边框 / 分隔 */
    --border-soft: rgba(255, 255, 255, 0.07);
    --border-mid: rgba(255, 255, 255, 0.12);
    --border-strong: rgba(255, 255, 255, 0.2);

    /* 文字 */
    --text-1: rgba(238, 242, 248, 0.96);
    --text-2: rgba(203, 213, 225, 0.82);
    --text-3: rgba(148, 163, 184, 0.7);
    --text-4: rgba(100, 116, 139, 0.55);
    --text-on-accent: #ffffff;

    /* 主题色：蓝紫渐变（devops / speed 感） */
    --accent: #5b8def;
    --accent-2: #8b5cf6;
    --accent-3: #06b6d4;
    --accent-soft: rgba(91, 141, 239, 0.18);
    --accent-glow: rgba(91, 141, 239, 0.35);

    /* 状态色 */
    --status-pending: #94a3b8;
    --status-running: #5b8def;
    --status-running-bg: rgba(91, 141, 239, 0.12);
    --status-success: #10d39c;
    --status-success-bg: rgba(16, 211, 156, 0.12);
    --status-failed: #f87171;
    --status-failed-bg: rgba(248, 113, 113, 0.12);

    /* 阴影 */
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--border-soft);
    --shadow-2: 0 8px 24px -8px rgba(0, 0, 0, 0.6), 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 0 1px var(--accent-glow), 0 0 32px -4px var(--accent-glow);

    /* 玻璃材质 */
    --glass-blur: saturate(180%) blur(20px);
    --glass-bg: rgba(20, 24, 32, 0.55);
    --glass-border: rgba(255, 255, 255, 0.08);

    /* 半径 */
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-xl: 20px;
    --r-full: 9999px;

    /* 字体 */
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --font-mono: "JetBrains Mono", "SF Mono", "Cascadia Code", "Consolas", "Menlo", monospace;

    /* 动效 */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

    color-scheme: dark;
}

/* ---------- 亮色主题：低饱和、高级灰 ---------- */
body[data-theme="light"] {
    --bg-base: #f6f7f9;
    --bg-elev-1: rgba(255, 255, 255, 0.78);
    --bg-elev-2: rgba(255, 255, 255, 0.92);
    --bg-input: rgba(255, 255, 255, 0.7);
    --bg-input-focus: rgba(255, 255, 255, 0.95);

    --border-soft: rgba(15, 23, 42, 0.06);
    --border-mid: rgba(15, 23, 42, 0.1);
    --border-strong: rgba(15, 23, 42, 0.18);

    --text-1: #0f172a;
    --text-2: #334155;
    --text-3: #64748b;
    --text-4: #94a3b8;
    --text-on-accent: #ffffff;

    --accent: #4f6fef;
    --accent-2: #7c3aed;
    --accent-3: #0891b2;
    --accent-soft: rgba(79, 111, 239, 0.1);
    --accent-glow: rgba(79, 111, 239, 0.25);

    --status-pending: #94a3b8;
    --status-running: #4f6fef;
    --status-running-bg: rgba(79, 111, 239, 0.1);
    --status-success: #059669;
    --status-success-bg: rgba(5, 150, 105, 0.1);
    --status-failed: #dc2626;
    --status-failed-bg: rgba(220, 38, 38, 0.1);

    --shadow-1: 0 1px 2px rgba(15, 23, 42, 0.04), 0 0 0 1px var(--border-soft);
    --shadow-2: 0 8px 28px -8px rgba(15, 23, 42, 0.12), 0 2px 4px rgba(15, 23, 42, 0.04);
    --shadow-glow: 0 0 0 1px var(--accent-glow), 0 0 32px -4px var(--accent-glow);

    --glass-blur: saturate(180%) blur(20px);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(15, 23, 42, 0.06);

    color-scheme: light;
}

/* ---------- 基础 ---------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.55;
    color: var(--text-1);
    background: var(--bg-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background 0.4s var(--ease), color 0.4s var(--ease);
    overflow-x: hidden;
    min-height: 100vh;
}

.mono {
    font-family: var(--font-mono);
    font-size: 0.92em;
    letter-spacing: -0.01em;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: transparent;
    color: inherit;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

input {
    font-family: inherit;
    color: inherit;
    background: transparent;
    border: none;
    outline: none;
}

input::placeholder {
    color: var(--text-4);
}

/* ---------- 背景装饰：流光 ---------- */
.bg-aurora {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.aurora-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    will-change: transform;
}

.aurora-1 {
    top: -10%;
    left: -10%;
    width: 480px;
    height: 480px;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
    animation: aurora-float 22s var(--ease) infinite;
}

.aurora-2 {
    top: 20%;
    right: -15%;
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, var(--accent-2) 0%, transparent 70%);
    animation: aurora-float 28s var(--ease) infinite reverse;
    animation-delay: -7s;
}

.aurora-3 {
    bottom: -20%;
    left: 30%;
    width: 560px;
    height: 560px;
    background: radial-gradient(circle, var(--accent-3) 0%, transparent 70%);
    animation: aurora-float 32s var(--ease) infinite;
    animation-delay: -14s;
}

body[data-theme="light"] .aurora-blob {
    opacity: 0.3;
}

@keyframes aurora-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(40px, -30px) scale(1.1); }
    66% { transform: translate(-30px, 40px) scale(0.95); }
}

/* ---------- 玻璃材质通用 ---------- */
.glass {
    background: var(--glass-bg);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-2);
}

/* ---------- 顶部条 ---------- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 28px;
    padding: 18px 36px;
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--glass-bg);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-soft);
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.topbar-divider {
    width: 1px;
    height: 22px;
    background: var(--border-mid);
    margin: 0 4px;
    flex-shrink: 0;
}

.topbar-right {
    gap: 10px;
}

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

.brand-mark {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-md);
    background: linear-gradient(135deg, rgba(91, 141, 239, 0.15), rgba(139, 92, 246, 0.15));
    border: 1px solid var(--border-soft);
    box-shadow: 0 4px 12px -4px var(--accent-glow);
}

.brand-text h1 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.brand-sub {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mode-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--r-full);
    background: var(--status-success-bg);
    border: 1px solid var(--border-soft);
    color: var(--status-success);
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s var(--ease);
}

.mode-chip[data-mode="ssh"] {
    background: var(--accent-soft);
    color: var(--accent);
}

.mode-chip[data-mode="local"] {
    background: var(--status-success-bg);
    color: var(--status-success);
}

.mode-chip[data-mode="error"] {
    background: var(--status-failed-bg);
    color: var(--status-failed);
}

.mode-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
    animation: pulse 2s ease-in-out infinite;
}

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

.user-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px 4px 4px;
    border-radius: var(--r-full);
    background: var(--bg-elev-1);
    border: 1px solid var(--border-soft);
    font-size: 12px;
    color: var(--text-2);
    font-weight: 500;
}

.user-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

.user-name {
    padding-right: 2px;
}

.ghost-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: var(--r-md);
    color: var(--text-2);
    font-size: 12.5px;
    font-weight: 500;
    background: var(--bg-elev-1);
    border: 1px solid var(--border-soft);
    transition: all 0.15s var(--ease);
}

.ghost-btn:hover {
    color: var(--text-1);
    background: var(--bg-elev-2);
    border-color: var(--border-mid);
}

.theme-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-md);
    color: var(--text-2);
    background: var(--bg-elev-1);
    border: 1px solid var(--border-soft);
    transition: all 0.15s var(--ease);
}

.theme-btn:hover {
    color: var(--text-1);
    background: var(--bg-elev-2);
}

.theme-sun,
.theme-moon {
    position: absolute;
    transition: transform 0.4s var(--ease-out), opacity 0.3s var(--ease);
}

.theme-btn {
    position: relative;
}

body[data-theme="dark"] .theme-sun,
body:not([data-theme]) .theme-sun {
    transform: rotate(0) scale(1);
    opacity: 1;
}

body[data-theme="dark"] .theme-moon,
body:not([data-theme]) .theme-moon {
    transform: rotate(-90deg) scale(0);
    opacity: 0;
}

body[data-theme="light"] .theme-sun {
    transform: rotate(90deg) scale(0);
    opacity: 0;
}

body[data-theme="light"] .theme-moon {
    transform: rotate(0) scale(1);
    opacity: 1;
}

/* ---------- 主区域 ---------- */
.page {
    max-width: 920px;
    margin: 0 auto;
    padding: 32px 24px 64px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ---------- 概览条 ---------- */
.overview {
    display: flex;
    align-items: stretch;
    padding: 16px 20px;
    gap: 4px;
}

.overview-item {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.overview-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-md);
    flex-shrink: 0;
}

.overview-icon-ssh {
    background: var(--accent-soft);
    color: var(--accent);
}

.overview-icon-server {
    background: rgba(139, 92, 246, 0.14);
    color: var(--accent-2);
}

.overview-icon-harbor {
    background: rgba(6, 182, 212, 0.14);
    color: var(--accent-3);
}

.overview-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.overview-label {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.overview-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.overview-divider {
    width: 1px;
    background: var(--border-soft);
    margin: 4px 12px;
}

/* ---------- 输入区 ---------- */
.composer {
    padding: 22px 24px 18px;
}

.composer-head {
    margin-bottom: 14px;
}

.composer-head h2 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-1);
    letter-spacing: -0.01em;
}

.composer-hint {
    font-size: 12.5px;
    color: var(--text-3);
    margin-top: 2px;
}

.composer-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border-mid);
    border-radius: var(--r-md);
    padding: 5px 6px 5px 16px;
    gap: 10px;
    transition: all 0.2s var(--ease);
}

.input-wrap:focus-within {
    border-color: var(--accent);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.input-icon {
    color: var(--text-3);
    display: flex;
    margin-right: 4px;
    flex-shrink: 0;
}

.input-wrap:focus-within .input-icon {
    color: var(--accent);
}

#image-input {
    flex: 1;
    padding: 12px 12px 12px 0;
    font-size: 14px;
    color: var(--text-1);
    font-family: var(--font-mono);
    letter-spacing: -0.01em;
    min-width: 0;
}

.primary-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: var(--text-on-accent);
    border-radius: var(--r-md);
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: -0.005em;
    box-shadow: 0 4px 12px -2px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transition: all 0.15s var(--ease);
    white-space: nowrap;
}

.primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px -2px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

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

.composer-meta {
    min-height: 18px;
    padding: 0 4px;
}

.hint {
    font-size: 12px;
    color: var(--text-3);
    line-height: 1.5;
}

.hint.is-error {
    color: var(--status-failed);
}

.hint.is-success {
    color: var(--status-success);
}

/* ---------- 任务区 ---------- */
.tasks {
    padding: 18px 18px 14px;
    min-height: 320px;
    display: flex;
    flex-direction: column;
}

.tasks-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 6px 14px;
    border-bottom: 1px solid var(--border-soft);
    margin-bottom: 14px;
}

.tasks-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tasks-title h2 {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.tasks-count {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-3);
    background: var(--bg-elev-2);
    padding: 2px 8px;
    border-radius: var(--r-full);
    min-width: 22px;
    text-align: center;
}

.tasks-tools {
    display: flex;
    gap: 6px;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ---------- 任务卡片 ---------- */
.task-card {
    position: relative;
    background: var(--bg-elev-1);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-md);
    padding: 14px 16px;
    transition: all 0.2s var(--ease);
    animation: card-in 0.35s var(--ease-out);
    overflow: hidden;
}

@keyframes card-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.task-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--status-pending);
    transition: background 0.3s var(--ease);
}

.task-card[data-status="running"]::before {
    background: var(--status-running);
    box-shadow: 0 0 12px var(--status-running);
}

.task-card[data-status="success"]::before {
    background: var(--status-success);
}

.task-card[data-status="failed"]::before {
    background: var(--status-failed);
}

.task-card:hover {
    border-color: var(--border-mid);
    background: var(--bg-elev-2);
}

.task-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.task-source {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

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

.task-card[data-status="running"] .status-dot {
    background: var(--status-running);
    box-shadow: 0 0 0 4px var(--status-running-bg);
    animation: pulse 1.5s ease-in-out infinite;
}

.task-card[data-status="success"] .status-dot {
    background: var(--status-success);
    box-shadow: 0 0 0 4px var(--status-success-bg);
}

.task-card[data-status="failed"] .status-dot {
    background: var(--status-failed);
    box-shadow: 0 0 0 4px var(--status-failed-bg);
}

.task-source-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-status-badge {
    font-size: 10.5px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: var(--r-full);
    background: var(--bg-elev-2);
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    flex-shrink: 0;
}

.task-card[data-status="running"] .task-status-badge {
    background: var(--status-running-bg);
    color: var(--status-running);
}

.task-card[data-status="success"] .task-status-badge {
    background: var(--status-success-bg);
    color: var(--status-success);
}

.task-card[data-status="failed"] .task-status-badge {
    background: var(--status-failed-bg);
    color: var(--status-failed);
}

.task-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-left: 16px;
}

.task-target {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-3);
    font-size: 12px;
    min-width: 0;
}

.task-target-label {
    color: var(--text-4);
    flex-shrink: 0;
}

.task-target-ref {
    color: var(--text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: var(--r-sm);
    color: var(--text-3);
    flex-shrink: 0;
    transition: all 0.15s var(--ease);
}

.copy-btn:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.copy-btn.is-copied {
    color: var(--status-success);
}

/* 进度条 */
.task-progress {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 2px;
}

.progress-track {
    height: 6px;
    background: var(--bg-elev-2);
    border-radius: var(--r-full);
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    border-radius: var(--r-full);
    transition: width 0.4s var(--ease-out);
    position: relative;
    overflow: hidden;
}

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

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

.task-card[data-status="success"] .progress-bar {
    background: var(--status-success);
}

.task-card[data-status="success"] .progress-bar::after {
    display: none;
}

.task-card[data-status="failed"] .progress-bar {
    background: var(--status-failed);
}

.task-card[data-status="failed"] .progress-bar::after {
    display: none;
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-3);
    font-weight: 500;
}

.progress-stage {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--text-3);
}

.progress-pct {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: var(--text-2);
}

.task-message {
    font-size: 12px;
    color: var(--text-3);
    padding: 6px 10px;
    background: var(--bg-elev-2);
    border-radius: var(--r-sm);
    border-left: 2px solid var(--text-4);
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1.5;
    word-break: break-all;
}

.task-card[data-status="failed"] .task-message {
    border-left-color: var(--status-failed);
    color: var(--status-failed);
}

/* 日志展开 */
.task-card-foot {
    margin-top: 10px;
    padding-left: 16px;
}

.log-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    color: var(--text-3);
    padding: 4px 8px;
    border-radius: var(--r-sm);
    transition: all 0.15s var(--ease);
}

.log-toggle:hover {
    color: var(--text-1);
    background: var(--bg-elev-2);
}

.log-toggle svg {
    transition: transform 0.2s var(--ease);
}

.task-card.is-log-open .log-toggle svg {
    transform: rotate(180deg);
}

.task-log {
    margin-top: 10px;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.35);
    color: #cbd5e1;
    font-family: var(--font-mono);
    font-size: 11.5px;
    line-height: 1.55;
    border-radius: var(--r-sm);
    max-height: 280px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
    border: 1px solid var(--border-soft);
    scrollbar-width: thin;
    scrollbar-color: var(--border-mid) transparent;
}

body[data-theme="light"] .task-log {
    background: rgba(15, 23, 42, 0.04);
    color: var(--text-2);
    border-color: var(--border-soft);
}

.task-log::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.task-log::-webkit-scrollbar-thumb {
    background: var(--border-mid);
    border-radius: 3px;
}

/* ---------- 空状态 ---------- */
.task-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px 24px;
    color: var(--text-3);
}

.task-empty-art {
    margin-bottom: 16px;
    color: var(--text-4);
}

.task-empty h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 6px;
}

.task-empty p {
    font-size: 13px;
    color: var(--text-3);
    max-width: 320px;
    line-height: 1.6;
}

/* ---------- 页脚 ---------- */
.page-foot {
    margin-top: 12px;
    padding: 16px 8px 0;
    text-align: center;
    font-size: 12px;
    color: var(--text-4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.foot-sep {
    color: var(--text-4);
    opacity: 0.5;
}

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg-elev-2);
    color: var(--text-1);
    padding: 10px 18px;
    border-radius: var(--r-full);
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--border-mid);
    box-shadow: var(--shadow-2);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    z-index: 100;
    opacity: 0;
    transition: all 0.3s var(--ease-out);
    pointer-events: none;
}

.toast.is-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
    .topbar {
        padding: 14px 16px;
    }

    .brand-text h1 {
        font-size: 15px;
    }

    .page {
        padding: 20px 16px 48px;
        gap: 16px;
    }

    .overview {
        flex-direction: column;
        gap: 12px;
        padding: 14px 16px;
    }

    .overview-divider {
        width: 100%;
        height: 1px;
        margin: 0;
    }

    .overview-item {
        width: 100%;
    }

    .input-wrap {
        flex-wrap: wrap;
        padding: 8px 8px 8px 12px;
    }

    #image-input {
        width: 100%;
        padding: 8px 0;
    }

    .primary-btn {
        width: 100%;
        justify-content: center;
        padding: 12px;
    }
}

/* ---------- 登录页样式（与主页共享设计系统） ---------- */
body.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 40px 32px;
    text-align: center;
    animation: card-in 0.5s var(--ease-out);
}

.login-icon {
    font-size: 56px;
    margin-bottom: 12px;
    filter: drop-shadow(0 4px 12px var(--accent-glow));
}

.login-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.login-sub {
    font-size: 13px;
    color: var(--text-3);
    margin-bottom: 28px;
}

.login-field {
    margin-bottom: 14px;
    text-align: left;
}

.login-field label {
    display: block;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-3);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.login-field input {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-mid);
    border-radius: var(--r-md);
    font-size: 14px;
    transition: all 0.15s var(--ease);
}

.login-field input:focus {
    border-color: var(--accent);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.login-error {
    font-size: 12.5px;
    color: var(--status-failed);
    background: var(--status-failed-bg);
    border: 1px solid var(--status-failed);
    border-radius: var(--r-sm);
    padding: 8px 12px;
    margin: 6px 0 14px;
}

.login-card .primary-btn {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 14px;
    margin-top: 6px;
}

.login-mode {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--border-soft);
    font-size: 11.5px;
    color: var(--text-3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.theme-btn-fixed {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 50;
}
