* { margin: 0; padding: 0; box-sizing: border-box; }
/* 滚动策略：回归浏览器自然行为——高度不足一屏不显示滚动条，
   超出时因文档高度恒定而绝不抽搐 */
html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background var(--transition), color var(--transition);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding: 24px 16px 60px;
    position: relative;
    overflow-x: hidden;
    /* ⚠️ 勿在此处添加 perspective / transform 家族属性：
       会把 body 内所有 position:fixed 后代劫持为以 body 为锚，
       导致文档溢出计算异常、滚动条抖动 */
}

/* 立体光效背景（body::before 光斑 / body::after 网格）已于 2026-08-27 整体退役：
   按老大要求背景特效全取消，用于终验滚动稳定性。页面回归纯静态底色 */

.app-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 960px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin: 0 auto;
}.form-row { display: flex; gap: 12px; align-items: stretch; flex-wrap: wrap; }

.custom-select-wrapper { position: relative; flex: 0 0 auto; width: 200px; }
.input-wrapper { position: relative; display: flex; align-items: center; flex: 1; min-width: 230px; }

.custom-select {
    width: 100%; height: 100%; min-height: 54px;
    padding: 12px 38px 12px 16px;
    font-size: 0.89rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(180deg, var(--select-bg), var(--ctrl-grad-a));
    color: var(--text-primary);
    box-shadow:
        inset 0 2px 5px var(--ctrl-inset),
        0 2px 8px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    appearance: none; -webkit-appearance: none;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    font-family: inherit;
    letter-spacing: 0.2px;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-weight: 500;
}
.custom-select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px var(--accent-light), 0 4px 12px rgba(91, 127, 255, 0.1);
    background: var(--input-bg-focus);
    transform: translateY(-1px);
}
.select-arrow {
    position: absolute; right: 14px; top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-muted);
    font-size: 0.68rem;
    transition: color var(--transition);
}
.custom-select:focus + .select-arrow { color: var(--accent); }

/* ===== 自定义接口下拉（原生 select 隐藏，此结构接管展示与交互） ===== */
.api-dropdown { position: relative; width: 200px; }
.api-dropdown-trigger {
    width: 100%; min-height: 54px;
    padding: 12px 38px 12px 16px;
    font-size: 0.89rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(180deg, var(--select-bg), var(--ctrl-grad-a));
    color: var(--text-primary);
    box-shadow:
        inset 0 2px 5px var(--ctrl-inset),
        0 2px 8px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    font-family: inherit;
    letter-spacing: 0.2px;
    font-weight: 500;
    text-align: left;
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    white-space: nowrap;
}
.api-dropdown-trigger:hover {
    border-color: var(--border-focus);
    transform: translateY(-1px);
    box-shadow: inset 0 2px 5px var(--ctrl-inset), 0 4px 12px rgba(91, 127, 255, 0.1);
}
.api-dropdown-trigger:focus,
.api-dropdown.open .api-dropdown-trigger {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px var(--accent-light), 0 4px 12px rgba(91, 127, 255, 0.1);
    background: var(--input-bg-focus);
    transform: translateY(-1px);
}
.api-dropdown.open .select-arrow {
    transform: translateY(-50%) rotate(180deg);
    color: var(--accent);
}
.api-dropdown-menu {
    position: fixed;           /* fixed 脱离窗格，不再被 .win-frame 的 overflow:hidden 裁剪，可完整展开 */
    top: 0; left: 0;           /* 打开时由 JS 按触发器视口坐标定位 */
    list-style: none; margin: 0; padding: 6px;
    background: var(--select-bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
    z-index: 999;
    display: none;
    max-height: calc(100vh - 130px);   /* 极限矮窗口兜底（JS 会按实际空间覆盖） */
    overflow-y: auto;
}
.api-dropdown.open .api-dropdown-menu { display: block; }
.api-option {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 9px 10px;
    border-radius: calc(var(--radius) - 4px);
    cursor: pointer;
    font-size: 0.87rem;
    color: var(--text-primary);
    letter-spacing: 0.2px;
    transition: background var(--transition);
}
.api-option:hover { background: var(--accent-light); }
.api-option.active { background: var(--accent-light); font-weight: 600; }
.api-option-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.api-copy-btn {
    flex: 0 0 auto;
    border: none;
    background: var(--accent);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 500;
    font-family: inherit;
    padding: 4px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition);
}
.api-copy-btn:hover { filter: brightness(1.12); }
.api-copy-btn:active { transform: scale(0.94); }
.api-copy-btn:disabled { opacity: 0.35; cursor: not-allowed; filter: none; }

.input-field {
    width: 100%;
    padding: 14px 58px 14px 18px;
    font-size: 0.95rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(180deg, var(--input-bg), var(--ctrl-grad-a));
    color: var(--text-primary);
    box-shadow:
        inset 0 2px 5px var(--ctrl-inset),
        0 2px 8px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    outline: none;
    font-family: inherit;
    letter-spacing: 0.15px;
    min-height: 54px;
}
.input-field::placeholder { color: var(--text-muted); opacity: 0.7; font-weight: 400; }
.input-field:focus {
    border-color: var(--border-focus);
    background: var(--input-bg-focus);
    box-shadow: 0 0 0 4px var(--accent-light), 0 4px 12px rgba(91, 127, 255, 0.1);
    transform: translateY(-1px);
}

.input-clear-btn {
    position: absolute; right: 14px; width: 36px; height: 36px;
    border-radius: 50%; border: none;
    background: transparent; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 1.2rem;
    transition: all var(--transition);
    opacity: 0; pointer-events: none; z-index: 2;
}
.input-clear-btn.visible { opacity: 1; pointer-events: auto; }
.input-clear-btn:hover { background: var(--border); color: var(--text-primary); }

.health-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    padding: 8px 12px;
    background: var(--accent-light);
    border-radius: var(--radius-sm);
    flex-wrap: wrap;
}
.health-label {
    font-size: 0.71rem;
    color: var(--text-muted);
    letter-spacing: 0.2px;
    font-weight: 470;
    white-space: nowrap;
}
.health-bar-container {
    flex: 1;
    min-width: 120px;
    height: 8px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.14), rgba(255, 255, 255, 0.07)), var(--health-bar-bg); /* 轨道凹槽渐变 */
    border-radius: 99px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.22),
                inset 0 -1px 0 rgba(255, 255, 255, 0.3);
}
.health-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--health-bar-fill);
    border-radius: 99px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55),   /* 填充顶部高光 */
                inset 0 -1px 0 rgba(0, 0, 0, 0.18),        /* 填充底部投影 */
                0 0 7px rgba(124, 143, 255, 0.45);         /* 辉光 */
    transition: width 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}
.health-score {
    font-size: 0.79rem;
    font-weight: 570;
    color: var(--accent);
    min-width: 64px;
    text-align: right;
    letter-spacing: 0.2px;
}

.actions-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 18px;
    justify-content: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    font-size: 0.88rem;
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.3px;
    white-space: nowrap;
    font-family: inherit;
    user-select: none;
    background: linear-gradient(145deg, var(--ctrl-grad-a), var(--ctrl-grad-b));
    color: var(--btn-secondary-text);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.08),
        0 2px 4px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
}
.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(91,127,255,0.15), rgba(167,139,250,0.15));
    opacity: 0;
    transition: opacity 0.3s;
}
.btn:hover::before { opacity: 1; }
.btn:hover {
    transform: translateY(-3px) translateZ(10px);
    box-shadow:
        0 8px 25px rgba(91, 127, 255, 0.2),
        0 4px 10px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border-color: var(--accent);
}
.btn:active {
    transform: translateY(0) translateZ(0) scale(0.96);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}
.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.5), transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s, opacity 0.6s;
    opacity: 0;
}
.btn:active::after {
    width: 200px;
    height: 200px;
    opacity: 0;
}

.divider { border: none; border-top: 1px solid var(--border); margin: 22px 0 10px 0; transition: border-color var(--transition); }
.footer-note {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.3px;
    padding: 12px 16px;
    margin: 8px 0 0;
    width: 100%;
    border-top: 1px solid var(--border);
}

.toast-container {
    position: fixed; top: 28px; left: 50%; transform: translateX(-50%);
    z-index: 9999; display: flex; flex-direction: column; gap: 8px;
    pointer-events: none; width: auto; max-width: 94vw;
}
.toast {
    padding: 14px 27px; border-radius: 60px;
    background: var(--toast-bg); color: var(--toast-text);
    font-weight: 625; font-size: 0.855rem; letter-spacing: 0.3px;
    box-shadow: 0 12px 38px rgba(0,0,0,0.22);
    animation: toastIn 0.43s cubic-bezier(0.16,1,0.33,1), toastOut 0.37s cubic-bezier(0.41,0,0.21,1) 2.2s forwards;
    text-align: center; white-space: nowrap; pointer-events: auto;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateY(-24px) scale(0.88); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(-18px) scale(0.82); }
}

@media (max-width: 740px) {
    body { padding: 18px 12px; }
    .toast { max-width: 92vw; white-space: normal; }   /* 移动端长文案 toast 允许换行，避免横向溢出 */
    .app-container { gap: 16px; }
    
    .form-row { flex-direction: column; gap: 12px; }
    .custom-select-wrapper { width: 100%; }
    .api-dropdown { width: 100%; }
    .input-wrapper { min-width: 100%; }
    .btn { justify-content: center; padding: 13px 18px; font-size: 0.92rem; }
    .actions-row {
        gap: 10px;
        flex-direction: row;
        justify-content: stretch;
    }
    .actions-row .btn { flex: 1; width: auto; }
    .custom-select { font-size: 0.865rem; min-height: 49px; }
    .api-dropdown-trigger { font-size: 0.865rem; min-height: 49px; }
    .input-field { font-size: 0.915rem; min-height: 49px; }
    .health-indicator { gap: 8px; padding: 6px 10px; }
    .health-score { text-align: right; }
    .health-bar-container { min-width: 56px; }
}
@media (max-width: 430px) {
    .btn { padding: 12px 14px; font-size: 0.825rem; }
    .health-bar-container { min-width: 40px; }
    .health-label, .health-score { min-width: 0; }
}
/* 宽屏（电脑/大平板）：解析模块两行布局 */
@media (min-width: 1024px) {
    .form-row { order: 5; flex: 1 1 420px; }
    .custom-select-wrapper { width: 180px; }
    .api-dropdown { width: 100%; }
    .custom-select { min-height: 50px; }
    .api-dropdown-trigger { min-height: 50px; }
    .input-wrapper { min-width: 200px; }
    .input-field { min-height: 50px; }

    .actions-row {
        order: 6;
        flex: 0 0 auto;
        margin-top: 0;
        gap: 10px;
    }
    .btn { padding: 10px 18px; font-size: 0.85rem; }

    /* 第二行：接口健康度长条 + 当前接口健康度分数 */
    .health-indicator {
        order: 7;
        flex-basis: 100%;
        margin-top: 0;
        padding: 8px 12px;
        gap: 12px;
    }
    .health-label { display: inline-block; }
    .health-bar-container { flex: 1; min-width: 120px; }
    .health-score { min-width: 64px; font-size: 0.79rem; }

    /* 分隔线：解析区与到账音效区之间（order 8） */
    .divider { order: 8; flex-basis: 100%; margin: 16px 0 8px; }
}
/* ===== 悬浮操作按钮（右下角竖排） ===== */
.float-actions {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.float-btn {
    position: relative;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
    transition: all var(--transition);
    -webkit-tap-highlight-color: transparent;
}
.float-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.20);
    border-color: var(--accent);
}
.float-btn:active { transform: scale(0.95); }
body.dark .float-btn {
    background: var(--card-bg);
    border-color: var(--border);
}

/* 返回顶部：圆形滚动进度条 */
.progress-ring {
    position: absolute;
    inset: 3px;
    width: calc(100% - 6px);
    height: calc(100% - 6px);
    transform: rotate(-90deg);
}
.progress-track {
    fill: none;
    stroke: var(--border);
    stroke-width: 3;
}
.progress-bar {
    fill: none;
    stroke: var(--accent);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 100.53;
    stroke-dashoffset: 100.53;
    transition: stroke-dashoffset 0.1s linear;
}
.float-icon {
    position: relative;
    font-size: 19px;
    font-weight: 700;
    line-height: 1;
}

@media (max-width: 640px) {
    .float-actions { right: 12px; bottom: 12px; gap: 10px; }
    .float-btn { width: 42px; height: 42px; font-size: 17px; }
    .float-icon { font-size: 17px; }
}


/* ===== 支付宝到账音效 ===== */
.receipt-wrap {
    display: flex;
    flex-direction: column;        /* 窗格内竖排布局：输入框在上、按钮组在下且居中 */
                                      按钮组在下且居中——废除老版 row+space-between 的
                                      左右两端贴齐布局，杜绝"按钮全靠左"的观感 */
    align-items: center;
    gap: 16px;
}
.receipt-input-row {
    display: flex;
    align-items: center;
    flex: 1 1 auto;          /* 拉伸占满剩余空间，消除按钮前的空隙 */
    min-width: 220px;
}
.receipt-input-field {
    position: relative;        /* ¥ 符号的定位基准：始终贴合输入框，不与左侧 logo 重叠 */
    flex: 1;
    min-width: 0;
}
.receipt-symbol {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 1;
}
.receipt-input {
    padding-left: 34px;        /* 给 ¥ 符号留出空间 */
    text-align: left;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.receipt-input-field .input-clear-btn { top: 50%; transform: translateY(-50%); }  /* 金额框内的清空按钮垂直居中 */
.receipt-actions {
    margin-top: 0;              /* 竖排布局下由 .receipt-wrap 的 gap 统一管控 */
}
@media (max-width: 740px) {
    .receipt-wrap {
        flex-direction: column;    /* 移动端纵向堆叠 */
        align-items: stretch;
    }
    .receipt-input-row {
        width: 100%;               /* 移动端输入框拉满全宽 */
        max-width: none;
        flex: none;
    }
}

/* ---- 滚动条：全局接管绘制权，经典常驻模式，绝不淡入淡出 ----
   Win11 新版 Chrome/Edge 默认浮动式(overlay)滚动条会自动淡出/浮现；
   声明 ::-webkit-scrollbar 后浏览器强制回退经典渲染模式。
   配色低调化（2026-08-27 老大反馈"太亮眼太抢眼"）：中性灰半透明，
   静默存在感，hover 才微微提亮；Firefox scrollbar-color 同步 */
html::-webkit-scrollbar { width: 12px; height: 12px; }
/* 明暗双主题通吃的中性配色（2026-08-27 自检优化）：轨道近乎隐形，
   thumb 石板灰半透明——深底浅底都不抢戏 */
html::-webkit-scrollbar-track { background: rgba(128, 128, 128, .10); }
html::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, .42);
    border-radius: 10px;
    border: 3px solid transparent;
    background-clip: padding-box;
}
html::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, .62);
    background-clip: padding-box;
}
html { scrollbar-width: thin; scrollbar-color: rgba(148, 163, 184, .42) rgba(128, 128, 128, .10); }


/* 动画总闸：URL 带 ?calm=1 时全站动画熄火（配合 script.js 顶部开关，
   用于抖动问题的 A/B 二分定位：calm 版不抖=凶手在某动画，仍抖=环境因素） */
html.no-motion *, html.no-motion *::before, html.no-motion *::after {
    animation: none !important;
    transition: none !important;
}

/* ---- 平铺窗格布局 ---- */
.sub-window { margin: 0; }
.sub-window[hidden] { display: none; }

/* ---- 17. PC 大屏排版精修（2026-09-04 老大反馈） ----
   视频窗格：接口/输入/健康度居左，智能解析+快速粘贴竖排居右；
   音效窗格：logo+金额输入居左（与视频窗格左缘对齐），三钮竖排居右；
   版权状态栏居中。全部仅 PC(≥741px) 生效，手机端布局原样保留 */
@media (min-width: 741px) {
    .vd-layout {
        display: flex;
        gap: 14px;
        align-items: flex-start;
    }
    .vd-main { flex: 1 1 auto; min-width: 0; }
    .vd-main .health-indicator { margin-top: 12px; }
    .vd-side {
        flex: 0 0 auto;
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding-top: 2px;
    }
    .vd-side .btn { width: 100%; white-space: nowrap; }

    .receipt-wrap {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 12px;
    }
    .receipt-input-row { flex: 1 1 auto; min-width: 0; }
    /* 三按钮横排（2026-09-04 老大定稿）：输入框自动缩短让位 */
    .receipt-actions {
        flex: 0 0 auto;
        display: flex;
        flex-direction: row;
        gap: 8px;
    }
    .receipt-actions .btn { width: auto; white-space: nowrap; }
}
.footer-note { text-align: center; }   /* 版权居中（两端通用） */

/* 手机端：智能解析/快速粘贴横排拉伸占满（补 vd-side 丢失的 actions-row 行为，2026-09-04） */
@media (max-width: 740px) {
    .vd-side { display: flex; gap: 10px; margin-top: 14px; }   /* 与健康度条拉开间距 */
    .vd-side .btn { flex: 1; width: auto; }
}

/* ---- 18. 子窗格收起态（2026-09-04）：_ / ✕ 收起正文只剩标题栏，点标题栏展开 ---- */
.sub-window.collapsed .win-frame-body { display: none; }
.sub-window.collapsed .win-titlebar { background: var(--ctrl-hover); border-radius: 6px; }
.sub-window.collapsed .win-tb-text { color: var(--text-secondary); }

/* ---- 19. 日志行样式（2026-09-04：提示改道进日志） ---- */
.ftp-log-line { color: #113c11; }
.ftp-log-line .ftp-log-time { color: #8a8a8a; margin-right: 4px; }
.ftp-log-line a {
    color: #0000c0;
    text-decoration: underline;
    word-break: break-all;
}
.ftp-log-line a:hover { color: #1084d0; }
.ftp-log-line a:visited { color: #551a8b; }

/* ---- 20. 主窗壳退役（2026-09-04）：三窗格直坐桌面，状态栏独立成条 ---- */
.app-container { background: none; }
.footer-note { box-shadow: none; background: transparent; }

/* ---- 21. 日志内复制链接样式（2026-09-04） ---- */
.ftp-log-line .ftp-copy-link {
    color: #0000c0;
    text-decoration: underline;
    word-break: break-all;
    cursor: pointer;
}
.ftp-log-line .ftp-copy-link:hover { color: #1084d0; background: rgba(91,127,255,.12); }
.ftp-log-line .ftp-open-link {
    color: #555;
    font-size: 11px;
    text-decoration: none;
    white-space: nowrap;
}
.ftp-log-line .ftp-open-link:hover { color: var(--accent); text-decoration: underline; }

/* ============================================================
   🪟 Win11 Fluent 双主题换肤（2026-09-09 老大拍板方案3：浅/深随切）
   设计令牌：:root=浅色为默认，body.dark=深色；浮起投影+大圆角+细描边
   ============================================================ */

/* ---- 22. 双主题设计令牌 ---- */
:root {
    --bg: #f3f3f3;
    --card-bg: #ffffff;
    --text-primary: #1b1b1b;
    --text-secondary: #5c5c5c;
    --text-muted: #8a8a8a;
    --border: #e5e5e5;
    --border-strong: #d1d1d1;
    --accent: #0067c0;
    --accent-light: rgba(0, 103, 192, .08);
    --ctrl-bg: #ffffff;
    --ctrl-hover: #f5f5f5;
    --ctrl-active: #ececec;
    --log-bg: #f9f9f9;
    --win-shadow: 0 2px 4px rgba(0, 0, 0, .05), 0 8px 24px rgba(0, 0, 0, .10);
    --win-shadow-hover: 0 4px 8px rgba(0, 0, 0, .07), 0 12px 32px rgba(0, 0, 0, .13);
    --wall: linear-gradient(165deg, #edf1f6 0%, #f3f3f3 48%, #edeff3 100%);
    --radius-win: 8px;
    --radius-ctrl: 4px;
    --titlebar-hover: #e9e9e9;
    --btn-close-hover: #c42b1c;
}
body.dark {
    --bg: #202020;
    --card-bg: #2b2b2b;
    --text-primary: #ffffff;
    --text-secondary: #c8c8c8;
    --text-muted: #8f8f8f;
    --border: #3d3d3d;
    --border-strong: #4a4a4a;
    --accent: #4cc2ff;
    --accent-light: rgba(76, 194, 255, .10);
    --ctrl-bg: #333333;
    --ctrl-hover: #3d3d3d;
    --ctrl-active: #454545;
    --log-bg: #272727;
    /* 旧组件变量补齐：api-dropdown / 健康度条等仍引用早期 --select-bg、--ctrl-grad-a 系列变量，
       不给深色值就会回落浅色 :root 值，造成夜间浅底白字看不清 */
    --border-focus: #4cc2ff;
    --input-bg: #333333;
    --input-bg-focus: #3d3d3d;
    --select-bg: #333333;
    --ctrl-grad-a: #333333;
    --ctrl-grad-b: #2b2b2b;
    --ctrl-inset: rgba(0, 0, 0, 0.4);
    --health-bar-bg: #3a3a3a;
    --health-bar-fill: #4cc2ff;
    --win-shadow: 0 2px 4px rgba(0, 0, 0, .25), 0 8px 24px rgba(0, 0, 0, .35);
    --win-shadow-hover: 0 4px 8px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .45);
    --wall: linear-gradient(165deg, #1c1c1e 0%, #202020 48%, #26262a 100%);
    --titlebar-hover: #383838;
    --btn-close-hover: #c42b1c;
}
body {
    background: var(--wall) fixed;
    transition: background 0.3s ease, color 0.3s ease;
}

/* ---- 23. 组件 Win11 化 ---- */
/* 窗格：白/深卡片 + 浮起投影 + 大圆角 */
.win-frame.sub-window {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-win);
    box-shadow: var(--win-shadow);
    overflow: hidden;
    transition: box-shadow 0.2s ease, background 0.3s ease;
}
.win-frame.sub-window:hover { box-shadow: var(--win-shadow-hover); }

/* 标题栏：透明细条，整条可点击切换 展开/收起（窗控三件套已退役） */
.win-titlebar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: var(--text-primary);
    padding: 8px 6px 8px 12px;
    margin: 0;
    border: none;
    user-select: none;
    cursor: pointer;
    transition: background 0.12s ease;
}
.win-titlebar:hover { background: var(--ctrl-hover); }
.win-titlebar::after {
    content: '🔼 点击收起';
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    margin-right: 6px;
}
.sub-window.collapsed .win-titlebar::after { content: '🔽 点击展开'; }
.win-tb-icon { font-size: 15px; filter: none; }
.win-tb-text {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 13px;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 正文区 */
.win-frame-body { padding: 10px 12px 14px; }

/* 控件：4px 微圆角 + 细描边 + 焦点强调 */
.btn {
    background: var(--ctrl-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-ctrl);
    box-shadow: none;
    transition: background 0.12s ease, border-color 0.12s ease, transform 0.1s ease;
}
.btn:hover { background: var(--ctrl-hover); border-color: var(--border-strong); }
.btn:active { background: var(--ctrl-active); transform: scale(0.98); box-shadow: none; }
.input-field, .custom-select {
    background: var(--ctrl-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-ctrl);
    box-shadow: none;
    transition: border-color 0.12s ease, background 0.3s ease;
}
.input-field:focus, .custom-select:focus {
    background: var(--ctrl-active);   /* 覆盖旧版 :focus 引用 --input-bg-focus 的白底，夜间不再闪白 */
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
    transform: none;
    outline: none;
}
/* 接口下拉触发器：覆盖旧版白色渐变底与白色内高光，夜间不再现白底 */
.api-dropdown-trigger { box-shadow: none; }
.api-dropdown-trigger:focus,
.api-dropdown.open .api-dropdown-trigger {
    background: var(--ctrl-active);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
    transform: none;
}

/* ===== Windows 激活小抄 ===== */
.act-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-ctrl);
    background: var(--log-bg);
}
.act-title { font-size: 0.86rem; font-weight: 600; color: var(--text-primary); }
.cmd-line {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--ctrl-bg);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-ctrl);
    padding: 8px 10px;
    word-break: break-all;
}
.cmd-code {
    flex: 1;
    min-width: 0;
    font-family: Consolas, Menlo, "Courier New", monospace;
    font-size: 0.8rem;
    color: var(--accent);
    word-break: break-all;      /* 长命令/链接按需断行，窄屏不横向溢出 */
    overflow-wrap: anywhere;
    user-select: all;
}
.act-desc { font-size: 0.78rem; color: var(--text-secondary); line-height: 1.55; }
.act-desc a { color: var(--accent); text-decoration: none; }
.act-desc a:hover { text-decoration: underline; }
.act-desc code {
    font-size: 0.75rem;
    background: var(--ctrl-bg);
    border: 1px solid var(--border-strong);
    border-radius: 3px;
    padding: 1px 5px;
    word-break: break-all;         /* 长链接不溢出屏幕（iPhone 等窄屏） */
    overflow-wrap: anywhere;
}
.act-desc { max-width: 100%; }
.act-warn {
    font-size: 0.78rem;
    color: var(--text-primary);
    background: rgba(255, 152, 0, 0.12);
    border: 1px solid rgba(255, 152, 0, 0.45);
    border-radius: var(--radius-ctrl);
    padding: 8px 10px;
    line-height: 1.55;
}
.act-warn code {
    font-size: 0.75rem;
    background: var(--ctrl-bg);
    border: 1px solid var(--border-strong);
    border-radius: 3px;
    padding: 1px 5px;
    word-break: break-all;
    overflow-wrap: anywhere;
}

/* 日志屏：浅色 Fluent 卡 */
.ftp-log { background: var(--log-bg); border-radius: 6px; border: 1px solid var(--border); overflow: hidden; margin-top: 12px; }  /* margin-top 与上方功能内容拉开，不再贴在一起 */
.ftp-log-bar {
    background: transparent;
    color: var(--text-secondary);
    font-size: 11px;
    padding: 5px 8px;
    border-bottom: 1px solid var(--border);
    box-shadow: none;
}
.ftp-log-body { background: transparent; color: var(--text-secondary); font-size: 0.75rem; line-height: 1.55; }
.ftp-log-line { color: var(--text-secondary); }   /* 覆盖旧版硬编码深绿 #113c11，让提示文字跟随浅/深主题 */
.ftp-log-line .ftp-log-time { color: var(--text-muted); }
.ftp-log-line .ftp-copy-link { color: var(--accent); }
.ftp-log-line .ftp-copy-link:hover { background: var(--accent-light); }
.ftp-log-line a:visited { color: var(--accent); opacity: 0.75; }

/* 状态栏 */
.footer-note {
    background: transparent;
    color: var(--text-muted);
    box-shadow: none;
    border: none;
    text-align: center;
    padding: 2px 10px 6px;
    font-size: 11px;
}

/* 滚动条：Win11 细圆角浮动风 */
html::-webkit-scrollbar { width: 8px; height: 8px; }
html::-webkit-scrollbar-track { background: transparent; border-radius: 0; box-shadow: none; }
html::-webkit-scrollbar-thumb {
    background: rgba(128, 128, 128, 0.4);
    border: none;
    border-radius: 4px;
    box-shadow: none;
    background-clip: border-box;
}
html::-webkit-scrollbar-thumb:hover { background: rgba(128, 128, 128, 0.65); }
html { scrollbar-width: thin; scrollbar-color: rgba(128, 128, 128, 0.4) transparent; }

/* toast / 悬浮钮 / 健康度跟随 */
.toast {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-ctrl);
    box-shadow: var(--win-shadow);
}
.float-btn {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 50%;
    box-shadow: var(--win-shadow);
}
.float-btn:hover { background: var(--ctrl-hover); }
.health-indicator { color: var(--text-secondary); }

/* ---- 24. 移动端 Win11 微调 ---- */
@media (max-width: 560px) {
    .win-frame.sub-window { border-radius: 6px; }
    .win-titlebar { padding: 6px 4px 6px 10px; }
}



/* ============================================================
   现代简洁卡片风（2026-10 视觉改版）：纯样式覆盖层
   结构与 JS 不动；删掉本块即可整体回退旧外观
   ============================================================ */

/* —— 1. 设计令牌升级 —— */
:root {
    --bg: #f4f6fb;
    --card-bg: #ffffff;
    --text-primary: #1f2430;
    --text-secondary: #5b6472;
    --text-muted: #98a1b0;
    --border: #e7ebf3;
    --border-strong: #d6dce8;
    --accent: #3d7eff;
    --accent-hover: #2f6ef0;
    --accent-light: rgba(61, 126, 255, 0.08);
    --ctrl-bg: #f1f4fa;
    --ctrl-hover: #e8edf6;
    --ctrl-active: #dde4f0;
    --log-bg: #f7f9fd;
    --radius-win: 16px;
    --radius-ctrl: 10px;
    --win-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 10px 28px rgba(16, 24, 40, .06);
    --win-shadow-hover: 0 2px 4px rgba(16, 24, 40, .05), 0 18px 44px rgba(16, 24, 40, .11);
    --wall: linear-gradient(180deg, #f7f9fd 0%, #eff3fa 100%);
    --titlebar-hover: rgba(61, 126, 255, 0.06);
}
body.dark {
    --bg: #0e1016;
    --card-bg: #171a22;
    --text-primary: #eceff5;
    --text-secondary: #b6bdcc;
    --text-muted: #7d8698;
    --border: #272d3a;
    --border-strong: #353d4e;
    --accent: #5b9dff;
    --accent-hover: #4a8ef6;
    --accent-light: rgba(91, 157, 255, 0.13);
    --ctrl-bg: #20242f;
    --ctrl-hover: #2a2f3d;
    --ctrl-active: #343b4c;
    --log-bg: #1b1f29;
    --win-shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 14px 36px rgba(0, 0, 0, .38);
    --win-shadow-hover: 0 4px 8px rgba(0, 0, 0, .4), 0 22px 52px rgba(0, 0, 0, .55);
    --wall: linear-gradient(180deg, #13161e 0%, #0c0e14 100%);
    --titlebar-hover: rgba(91, 157, 255, 0.09);
}

/* —— 2. 全局字体与页面背景 —— */
body {
    font-family: "Segoe UI Variable Text", "Segoe UI", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
    background:
        radial-gradient(1100px 520px at 15% -12%, rgba(61, 126, 255, 0.07), transparent 60%),
        radial-gradient(900px 460px at 95% 0%, rgba(94, 190, 255, 0.06), transparent 55%),
        var(--wall);
    background-attachment: fixed;
}

/* —— 3. 窗格：大圆角柔和卡片 —— */
.win-frame.sub-window {
    border-radius: var(--radius-win);
    border: 1px solid var(--border);
    box-shadow: var(--win-shadow);
    background: var(--card-bg);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.win-frame.sub-window:not(.collapsed):hover { box-shadow: var(--win-shadow-hover); transform: translateY(-2px); }

/* —— 4. 标题栏 —— */
.win-titlebar { padding: 13px 16px 11px; }
.win-titlebar:hover { background: var(--titlebar-hover); }
.win-tb-icon { font-size: 16px; }
.win-tb-text { font-size: 14px; letter-spacing: 0.2px; }
.win-titlebar::after { font-weight: 500; letter-spacing: 0.2px; }
.sub-window.collapsed .win-titlebar { background: var(--titlebar-hover); }

/* —— 5. 内容区留白 —— */
.win-frame-body { padding: 13px 14px 16px; }

/* —— 6. 控件：统一圆角 + 柔和填色 —— */
.btn,
.input-field,
.custom-select,
.api-dropdown-trigger,
.api-dropdown-menu,
.cmd-line,
.act-item,
.act-warn,
.ftp-log {
    border-radius: var(--radius-ctrl);
}
.btn { box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05); }
.btn:hover { box-shadow: 0 2px 8px rgba(16, 24, 40, 0.08); }
.api-option { border-radius: 8px; }
.cmd-line { background: var(--ctrl-bg); border-color: var(--border-strong); }
.act-item { background: var(--ctrl-bg); border-color: var(--border); }
.act-warn { background: rgba(245, 158, 11, 0.10); border-color: rgba(245, 158, 11, 0.35); }
.health-indicator { background: var(--accent-light); }
.ftp-log { margin-top: 14px; }
.ftp-log-bar { font-weight: 600; letter-spacing: 0.3px; }

/* —— 7. 悬浮按钮 —— */
.float-btn { border-radius: 14px; }

/* —— 8. 页脚 —— */
.footer-note { letter-spacing: 0.3px; }

/* —— 9. 移动端圆角微调 —— */
@media (max-width: 560px) {
    .win-frame.sub-window { border-radius: 12px; }
    .win-titlebar { padding: 10px 12px 9px; }
}
/* —— 10. 兼容变量：旧组件残留引用的兜底（2026-10 遗留清理时迁入） —— */
:root {
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --border-focus: var(--accent);
    --input-bg: var(--ctrl-bg);
    --input-bg-focus: var(--ctrl-active);
    --select-bg: var(--ctrl-bg);
    --ctrl-grad-a: var(--ctrl-bg);
    --ctrl-grad-b: var(--ctrl-active);
    --ctrl-inset: rgba(0, 0, 0, 0.05);
    --health-bar-bg: rgba(128, 134, 150, 0.18);
    --health-bar-fill: var(--accent);
    --toast-bg: #1f2430;
    --toast-text: #ffffff;
}
/* 下拉触发器/菜单底色从旧渐变迁移到主题变量 */
.api-dropdown-trigger { background: var(--ctrl-bg); }
.api-dropdown-menu { background: var(--card-bg); }
