/* ────────────────────────────────────────────────────────────
 * GitCenter · Web UI · 视觉规范
 * 对齐 assets/gitcenter_*.png 设计图
 * 主色 #0078D4 (Fluent Blue) · 中文字体 Microsoft YaHei UI
 * ──────────────────────────────────────────────────────────── */

:root {
    --gc-primary: #0078D4;
    --gc-primary-hover: #106EBE;
    --gc-primary-active: #005A9E;
    --gc-danger: #DC2626;
    --gc-warn: #F59E0B;
    --gc-success: #16A34A;

    --gc-font-sans: "Microsoft YaHei UI", "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", -apple-system, BlinkMacSystemFont, sans-serif;
    --gc-font-mono: "Cascadia Code", "SF Mono", "JetBrains Mono",
        Consolas, "Courier New", monospace;
}

html, body {
    font-family: var(--gc-font-sans);
    font-size: 13px;
    color: #1F2937;
    -webkit-font-smoothing: antialiased;
}

body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.gc-mono { font-family: var(--gc-font-mono); }

/* ─── 主色按钮 ─── */
.gc-btn-primary {
    background-color: var(--gc-primary);
    color: white;
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: background-color 0.15s, box-shadow 0.15s;
    border: 1px solid transparent;
    white-space: nowrap;
}
.gc-btn-primary:hover {
    background-color: var(--gc-primary-hover);
    box-shadow: 0 1px 3px rgba(0, 120, 212, 0.35);
}
.gc-btn-primary:active { background-color: var(--gc-primary-active); }

/* ─── 次要按钮 ─── */
.gc-btn {
    background-color: white;
    color: #1F2937;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: background-color 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.gc-btn:hover { background-color: #F3F4F6; border-color: #9CA3AF; }
.gc-btn:active { background-color: #E5E7EB; }
.gc-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ─── 危险按钮 ─── */
.gc-btn-danger {
    background-color: white;
    color: var(--gc-danger);
    border: 1px solid #FCA5A5;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: background-color 0.15s;
    white-space: nowrap;
}
.gc-btn-danger:hover { background-color: #FEF2F2; border-color: var(--gc-danger); }

/* ─── 胶囊按钮（工具栏用） ─── */
.gc-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 13px;
    border: 1px solid #D1D5DB;
    background: white;
    color: #1F2937;
    transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}
.gc-pill:hover { background-color: #F9FAFB; border-color: #9CA3AF; }

.gc-pill-primary {
    background-color: var(--gc-primary);
    color: white;
    border-color: var(--gc-primary);
}
.gc-pill-primary:hover {
    background-color: var(--gc-primary-hover);
    border-color: var(--gc-primary-hover);
    box-shadow: 0 1px 4px rgba(0, 120, 212, 0.35);
}

.gc-pill-danger {
    background-color: #DC2626;
    color: white;
    border-color: #DC2626;
}
.gc-pill-danger:hover { background-color: #B91C1C; border-color: #B91C1C; }

/* ─── 状态徽章 pill（严格对齐 UI_SPEC § 3.3） ─── */
.gc-status {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
}
.gc-status-ok             { background-color: #DCFCE7; color: #166534; }
.gc-status-unknown        { background-color: #F3F4F6; color: #374151; }
.gc-status-not_found      { background-color: #FEE2E2; color: #991B1B; }
.gc-status-suspended      { background-color: #FECACA; color: #7F1D1D; }
.gc-status-password_wrong { background-color: #FEF3C7; color: #92400E; }
.gc-status-2fa_broken     { background-color: #FED7AA; color: #9A3412; }
.gc-status-flagged        { background-color: #E9D5FF; color: #6B21A8; }
.gc-status-captcha        { background-color: #DBEAFE; color: #1E40AF; }
.gc-status-rate_limited   { background-color: #FEF9C3; color: #713F12; }
.gc-status-frozen         { background-color: #D1D5DB; color: #111827; }
.gc-status-renamed        { background-color: #E0F2FE; color: #075985; }
.gc-status-rebound        { background-color: #E0F2FE; color: #075985; }

/* ─── Tab ⑦ 独立子系统琥珀 badge ─── */
.gc-badge-amber {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: 6px;
    font-size: 11px;
    background-color: #FEF3C7;
    color: #92400E;
    border: 1px solid #FDE68A;
}

/* ─── 表格 ─── */
.gc-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}
.gc-table thead {
    background-color: #F9FAFB;
    position: sticky;
    top: 0;
    z-index: 10;
}
.gc-table thead th {
    text-align: left;
    padding: 8px 10px;
    font-weight: 500;
    font-size: 12px;
    color: #4B5563;
    border-bottom: 1px solid #E5E7EB;
    white-space: nowrap;
    user-select: none;
}
.gc-table tbody td {
    padding: 6px 10px;
    border-bottom: 1px solid #F3F4F6;
    vertical-align: middle;
}
.gc-table tbody tr { cursor: pointer; transition: background-color 0.1s; }
.gc-table tbody tr:hover { background-color: #EFF6FF; }
.gc-table tbody tr.gc-row-highlight { background-color: #DBEAFE; }
.gc-table tbody tr.gc-row-checked   { background-color: #EEF2FF; }
.gc-table tbody tr.gc-row-flash-ok  { animation: gcRowFlashOk  0.9s ease-out; }
.gc-table tbody tr.gc-row-flash-err { animation: gcRowFlashErr 0.9s ease-out; }

/* ─── FIX 4 · 拖拽多选中的行 ─── */
.gc-table tbody tr.gc-row-drag {
    background-color: #DBEAFE !important;
    box-shadow: inset 2px 0 0 var(--gc-primary);
}
.gc-table tbody tr.gc-row-drag td { border-bottom-color: #93C5FD; }

/* ─── FIX 3 · 冻结账号：整行淡化 ─── */
.gc-table tbody tr.gc-row-frozen td { color: #9CA3AF; }
.gc-table tbody tr.gc-row-frozen td:first-child + td,
.gc-table tbody tr.gc-row-frozen .gc-status { opacity: 0.75; }

@keyframes gcRowFlashOk {
    0%   { background-color: #86EFAC; }
    100% { background-color: transparent; }
}
@keyframes gcRowFlashErr {
    0%   { background-color: #FCA5A5; }
    100% { background-color: transparent; }
}

/* ─── 卡片 ─── */
.gc-card {
    background-color: white;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    padding: 12px;
}

/* ─── Chip（已应用条件） ─── */
.gc-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px 2px 4px;
    border-radius: 999px;
    background-color: #EFF6FF;
    color: #1E40AF;
    border: 1px solid #BFDBFE;
    font-size: 12px;
}
.gc-chip button {
    padding: 0 4px;
    color: #6B7280;
    line-height: 1;
    transition: color 0.15s;
}
.gc-chip button:hover { color: var(--gc-danger); }

/* ─── 右键菜单 ─── */
.gc-ctxmenu {
    position: fixed;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.06);
    padding: 6px 0;
    min-width: 240px;
    max-width: 320px;
    z-index: 100;
    font-size: 13px;
}
/* FIX 7 · 内容太长时优雅滚动 */
.gc-ctxmenu-scroll {
    scrollbar-width: thin;
    scrollbar-color: #CBD5E1 transparent;
    overscroll-behavior: contain;
}
.gc-ctxmenu-scroll::-webkit-scrollbar { width: 8px; }
.gc-ctxmenu-scroll::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 4px;
}
.gc-ctxmenu-scroll::-webkit-scrollbar-track { background: transparent; }
.gc-ctxmenu-group {
    padding: 4px 12px 2px;
    font-size: 11px;
    text-transform: uppercase;
    color: #9CA3AF;
    letter-spacing: 0.5px;
}
.gc-ctxmenu-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 6px 14px;
    color: #1F2937;
    transition: background-color 0.1s;
}
.gc-ctxmenu-item:hover { background-color: #EFF6FF; color: #1E40AF; }
.gc-ctxmenu-item.gc-danger:hover { background-color: #FEF2F2; color: var(--gc-danger); }
.gc-ctxmenu-item .gc-shortcut { float: right; color: #9CA3AF; font-size: 11px; }
.gc-ctxmenu-divider { border-top: 1px solid #F3F4F6; margin: 4px 0; }

/* ─── 详情面板 ─── */
.gc-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 40%;
    min-width: 480px;
    max-width: 720px;
    background: white;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.08);
    border-left: 1px solid #E5E7EB;
    z-index: 40;
    display: flex;
    flex-direction: column;
}
.gc-drawer-header {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid #E5E7EB;
    background-color: #F9FAFB;
    flex-shrink: 0;
}
.gc-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* ─── 详情面板小节标题 ─── */
.gc-section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #F3F4F6;
}

/* ─── 恢复码 pill 网格 ─── */
.gc-recovery-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    background-color: #F3F4F6;
    color: #374151;
    font-family: var(--gc-font-mono);
    font-size: 12px;
    border: 1px solid #E5E7EB;
}
.gc-recovery-pill.used {
    background-color: #F9FAFB;
    color: #9CA3AF;
    text-decoration: line-through;
}

/* ─── TOTP 圆环倒计时 ─── */
.gc-totp-ring circle {
    fill: none;
    stroke-width: 3;
}
.gc-totp-ring .bg { stroke: #E5E7EB; }
.gc-totp-ring .fg {
    stroke: var(--gc-primary);
    transform: rotate(-90deg);
    transform-origin: center;
    transition: stroke-dashoffset 1s linear;
}

/* ─── Toast ─── */
.gc-toast {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 10px 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 240px;
    font-size: 13px;
    animation: gcToastIn 0.25s ease-out;
}
.gc-toast-success { border-left: 3px solid var(--gc-success); }
.gc-toast-warn    { border-left: 3px solid var(--gc-warn); }
.gc-toast-error   { border-left: 3px solid var(--gc-danger); }
.gc-toast-info    { border-left: 3px solid var(--gc-primary); }

@keyframes gcToastIn {
    from { transform: translateX(20px); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

/* ─── 高级筛选浮出面板 ─── */
.gc-float-panel {
    position: absolute;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
    z-index: 30;
    padding: 16px;
}

/* ─── 高级筛选：一键预设 chip（顶部 8 个） ─── */
.gc-quick-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 9px;
    border-radius: 999px;
    background: #F0F9FF;
    color: #075985;
    border: 1px solid #BAE6FD;
    font-size: 11px;
    line-height: 1.4;
    transition: background-color 0.12s, border-color 0.12s, transform 0.05s;
    white-space: nowrap;
    cursor: pointer;
}
.gc-quick-chip:hover {
    background: #DBEAFE;
    border-color: var(--gc-primary);
    color: #1E40AF;
}
.gc-quick-chip:active { transform: scale(0.97); }

/* ─── 高级筛选：常用值 mini chip（数字 / 日期天数） ─── */
.gc-mini-chip {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: 4px;
    background: #F3F4F6;
    color: #4B5563;
    border: 1px solid #E5E7EB;
    font-size: 10px;
    line-height: 1.6;
    transition: background-color 0.1s, color 0.1s;
    cursor: pointer;
    white-space: nowrap;
}
.gc-mini-chip:hover {
    background: #DBEAFE;
    color: var(--gc-primary);
    border-color: #93C5FD;
}

/* ─── 高级筛选：bool toggle 开关 ─── */
.gc-bool-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #D1D5DB;
    transition: background-color 0.12s, border-color 0.12s, color 0.12s;
    cursor: pointer;
    white-space: nowrap;
    min-width: 68px;
}
.gc-bool-on  {
    background: #DCFCE7;
    color: #166534;
    border-color: #86EFAC;
}
.gc-bool-on:hover { background: #BBF7D0; border-color: #4ADE80; }
.gc-bool-off {
    background: #F3F4F6;
    color: #6B7280;
    border-color: #D1D5DB;
}
.gc-bool-off:hover { background: #E5E7EB; border-color: #9CA3AF; }

/* ─── 跨页全选按钮（工具栏专用） ─── */
.gc-pill-select-all {
    background: #ECFEFF;
    color: #0E7490;
    border-color: #A5F3FC;
}
.gc-pill-select-all:hover {
    background: #CFFAFE;
    border-color: #22D3EE;
    color: #155E75;
}
.gc-pill-select-all[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ─── 顶部计数栏三段数字（已选 / 筛选出 / 全库） ─── */
.gc-count-bar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: 6px;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    font-size: 12px;
    color: #4B5563;
    white-space: nowrap;
}
.gc-count-bar .gc-count-num {
    font-weight: 600;
    color: #1F2937;
    font-variant-numeric: tabular-nums;
}
.gc-count-bar .gc-count-num-primary { color: var(--gc-primary); }
.gc-count-bar .gc-count-sep {
    color: #D1D5DB;
    padding: 0 2px;
}

/* ─── 复选框 (自定义) ─── */
input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--gc-primary);
    cursor: pointer;
}

/* ─── 单选按钮 ─── */
input[type="radio"] { accent-color: var(--gc-primary); cursor: pointer; }

/* ─── 输入框 ─── */
.gc-input {
    padding: 4px 10px;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    font-size: 13px;
    background: white;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.gc-input:focus {
    outline: none;
    border-color: var(--gc-primary);
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.15);
}

.gc-select {
    padding: 4px 8px;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    font-size: 13px;
    background: white;
    cursor: pointer;
}
.gc-select:focus {
    outline: none;
    border-color: var(--gc-primary);
}

/* ─── 滚动条美化 ─── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 5px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: #9CA3AF; background-clip: padding-box; border: 2px solid transparent; }

/* ─── 分割线 ─── */
.gc-divider-v {
    width: 1px;
    background-color: #E5E7EB;
    align-self: stretch;
    margin: 0 4px;
}

/* ─── 空态 ─── */
.gc-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #9CA3AF;
    font-size: 13px;
}
.gc-empty-icon { font-size: 32px; margin-bottom: 8px; }

/* ─── 微光动画（loading） ─── */
.gc-skeleton {
    background: linear-gradient(90deg, #F3F4F6 25%, #E5E7EB 50%, #F3F4F6 75%);
    background-size: 200% 100%;
    animation: gcShimmer 1.4s infinite;
    border-radius: 4px;
}
@keyframes gcShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 隐藏 Tailwind CDN 加载前闪烁 */
[x-cloak] { display: none !important; }

/* ═══════════════════════════════════════════════════════════════
 * ✨ 账户时间线（详情面板 + Tab⑤ 时间线视图共用）
 * ═══════════════════════════════════════════════════════════════ */

/* 卡片本身在滚动容器里不额外限高，跟 details 面板一起滚 */
.gc-timeline-card { padding: 10px 12px 12px; }

/* 分组头（今天 / 昨天 / N 天前） */
.gc-timeline-group-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    margin: 6px 0 4px;
    padding: 4px 0;
}
.gc-timeline-group-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background-color: var(--gc-primary);
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.15);
    display: inline-block;
}

/* 单条操作卡片 */
.gc-timeline-item {
    position: relative;
    border: 1px solid #E5E7EB;
    border-left: 3px solid #9CA3AF;
    border-radius: 6px;
    padding: 6px 10px;
    margin-bottom: 6px;
    background: #FFFFFF;
    transition: background-color 0.1s, border-color 0.1s;
}
.gc-timeline-item:hover { background-color: #F9FAFB; }

/* 状态色（左侧粗竖条） */
.gc-tl-success { border-left-color: var(--gc-success); }
.gc-tl-failed  { border-left-color: var(--gc-danger); }
.gc-tl-warn    { border-left-color: var(--gc-warn); }
.gc-tl-running { border-left-color: var(--gc-primary); }
.gc-tl-inter   { border-left-color: #9CA3AF; }

.gc-tl-success { background: linear-gradient(90deg, #F0FDF4 0%, #FFFFFF 30%); }
.gc-tl-failed  { background: linear-gradient(90deg, #FEF2F2 0%, #FFFFFF 30%); }
.gc-tl-warn    { background: linear-gradient(90deg, #FFFBEB 0%, #FFFFFF 30%); }
.gc-tl-running { background: linear-gradient(90deg, #EFF6FF 0%, #FFFFFF 30%); }
.gc-tl-inter   { background: linear-gradient(90deg, #F9FAFB 0%, #FFFFFF 30%); }

/* 卡片头行 */
.gc-timeline-head {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    line-height: 1.5;
}
.gc-timeline-time  { color: #6B7280; font-size: 12px; min-width: 56px; }
.gc-timeline-icon  { font-size: 14px; }
.gc-timeline-title { color: #1F2937; font-weight: 500; }

/* Meta 行（IP / op_id） */
.gc-timeline-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding-left: 62px;
    font-size: 11px;
    color: #6B7280;
    margin-top: 2px;
}
.gc-timeline-meta-item { white-space: nowrap; }

/* 亮点行 */
.gc-timeline-highlight {
    padding-left: 62px;
    font-size: 12px;
    color: #1F2937;
    margin-top: 2px;
    line-height: 1.5;
}

/* 错误行 */
.gc-timeline-error {
    padding-left: 62px;
    font-size: 12px;
    color: var(--gc-danger);
    margin-top: 2px;
    line-height: 1.5;
    background: #FEF2F2;
    border-radius: 4px;
    padding: 3px 8px 3px 62px;
    margin-left: -6px;
    margin-right: -6px;
}

/* 操作按钮行 */
.gc-timeline-actions {
    display: flex;
    gap: 8px;
    padding-left: 62px;
    margin-top: 4px;
}
.gc-timeline-action {
    font-size: 11px;
    color: var(--gc-primary);
    padding: 1px 6px;
    border-radius: 3px;
    transition: background-color 0.1s;
}
.gc-timeline-action:hover { background-color: #EFF6FF; text-decoration: underline; }
.gc-tl-rerun { color: var(--gc-danger); }
.gc-tl-rerun:hover { background-color: #FEF2F2; }

/* 展开的步骤 */
.gc-timeline-steps {
    margin-left: 62px;
    margin-top: 6px;
    padding: 6px 8px;
    background: #F9FAFB;
    border-left: 2px solid #D1D5DB;
    border-radius: 3px;
    font-size: 11px;
}
.gc-timeline-step-row {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    padding: 2px 0;
    line-height: 1.4;
}
.gc-timeline-step-row + .gc-timeline-step-row { border-top: 1px dashed #F3F4F6; }

/* ─── Tab ⑤ 日志时间线视图（复用 .gc-timeline-item） ─── */
.gc-logs-timeline {
    padding: 8px 16px;
    overflow-y: auto;
    height: 100%;
}
.gc-logs-timeline .gc-timeline-item { margin-bottom: 8px; }

/* 视图切换 tab */
.gc-view-tabs { display: flex; border-bottom: 1px solid #E5E7EB; }
.gc-view-tab {
    padding: 6px 14px;
    font-size: 12px;
    color: #6B7280;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color 0.1s, border-color 0.1s;
}
.gc-view-tab:hover { color: var(--gc-primary); }
.gc-view-tab.active {
    color: var(--gc-primary);
    border-bottom-color: var(--gc-primary);
    font-weight: 500;
}

/* 实时 toggle */
.gc-live-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background-color: #DC2626;
    margin-right: 4px;
    animation: gcLivePulse 1.4s infinite;
}
@keyframes gcLivePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.6); }
    50%      { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0);   }
}
