:root {
    --bg: #f0f4f8;
    --card-bg: #ffffff;
    --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
    --card-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.10), 0 3px 8px rgba(0, 0, 0, 0.06);
    --text-primary: #1a1d28;
    --text-secondary: #5a6072;
    --text-muted: #8b919e;
    --border: #e2e7ed;
    --border-focus: #5b7fff;
    --accent: #5b7fff;
    --accent-hover: #4a6aee;
    --accent-light: #eef1ff;
    --input-bg: #f7f9fb;
    --input-bg-focus: #ffffff;
    --select-bg: #f7f9fb;
    --btn-secondary-bg: #f0f2ff;
    --btn-secondary-text: #5b7fff;
    --btn-secondary-hover-bg: #e2e7ff;
    --toast-bg: #1a1d28;
    --toast-text: #ffffff;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --health-bar-bg: #e8edf9;
    --health-bar-fill: #5b7fff;
    /* 通用控件立体质感（浅色主题） */
    --ctrl-grad-a: #ffffff;
    --ctrl-grad-b: #e9edf4;
    --ctrl-inset: rgba(0, 0, 0, 0.06);
    --btn-3d: rgba(0, 0, 0, 0.15);
    --btn-shine: rgba(255, 255, 255, 0.9);
}

body.dark-mode {
    --bg: #111827;
    --card-bg: #1e293b;
    --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.25), 0 1px 3px rgba(0, 0, 0, 0.18);
    --card-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.40), 0 3px 8px rgba(0, 0, 0, 0.25);
    --text-primary: #e8ecf2;
    --text-secondary: #b0b8c5;
    --text-muted: #6b7385;
    --border: #2d3548;
    --border-focus: #7c8fff;
    --accent: #7c8fff;
    --accent-hover: #6b7aee;
    --accent-light: #1e2740;
    --input-bg: #1a2235;
    --input-bg-focus: #1e293b;
    --select-bg: #1a2235;
    --btn-secondary-bg: #2a3350;
    --btn-secondary-text: #a5b4fc;
    --btn-secondary-hover-bg: #353f60;
    --toast-bg: #e8ecf2;
    --toast-text: #111827;
    --health-bar-bg: #2a3350;
    --health-bar-fill: #7c8fff;
    /* 通用控件立体质感（暗色主题） */
    --ctrl-grad-a: #36415f;
    --ctrl-grad-b: #1b2336;
    --ctrl-inset: rgba(0, 0, 0, 0.4);
    --btn-3d: rgba(0, 0, 0, 0.55);
    --btn-shine: rgba(255, 255, 255, 0.16);
}

* { 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;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed; top: -40%; right: -25%;
    width: 70vw; height: 70vw;
    max-width: 800px; max-height: 800px;
    border-radius: 50%;
    background: var(--accent-light);
    opacity: 0.4;
    pointer-events: none;
    z-index: 0;
}
body::after {
    content: '';
    position: fixed; bottom: -30%; left: -20%;
    width: 55vw; height: 55vw;
    max-width: 600px; max-height: 600px;
    border-radius: 50%;
    background: var(--accent-light);
    opacity: 0.25;
    pointer-events: none;
    z-index: 0;
}

.app-container { position: relative; z-index: 1; width: 100%; max-width: 960px; display: flex; flex-direction: column; gap: 16px; }

.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 28px 28px 26px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border);
    transition: all var(--transition);
}
.card:hover { box-shadow: var(--card-shadow-hover); }

.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), inset 0 -1px 0 rgba(255, 255, 255, 0.4);
    appearance: none; -webkit-appearance: none;
    cursor: pointer;
    transition: all var(--transition);
    outline: none;
    font-family: inherit;
    letter-spacing: 0.2px;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-weight: 505;
}
.custom-select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px var(--accent-light);
    background: var(--input-bg-focus);
}
.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), inset 0 -1px 0 rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all var(--transition);
    outline: none;
    font-family: inherit;
    letter-spacing: 0.2px;
    font-weight: 505;
    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); }
.api-dropdown-trigger:focus,
.api-dropdown.open .api-dropdown-trigger {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px var(--accent-light);
    background: var(--input-bg-focus);
}
.api-dropdown.open .select-arrow {
    transform: translateY(-50%) rotate(180deg);
    color: var(--accent);
}
.api-dropdown-menu {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0;
    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: 60;
    display: none;
    max-height: 320px; 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),   /* 顶部内凹阴影 */
                inset 0 -1px 0 rgba(255, 255, 255, 0.4); /* 底部受光 */
    transition: all var(--transition);
    outline: none;
    font-family: inherit;
    letter-spacing: 0.15px;
    min-height: 54px;
}
.input-field::placeholder { color: var(--text-muted); opacity: 0.7; font-weight: 390; }
.input-field:focus {
    border-color: var(--border-focus);
    background: var(--input-bg-focus);
    box-shadow: 0 0 0 4px var(--accent-light);
}

.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: 515;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    letter-spacing: 0.3px;
    white-space: nowrap;
    font-family: inherit;
    user-select: none;
    background: linear-gradient(180deg, var(--ctrl-grad-a), var(--ctrl-grad-b)); /* 凸起键帽渐变 */
    color: var(--btn-secondary-text);
    box-shadow: 0 3px 0 var(--btn-3d),                    /* 底部厚度 */
                0 3px 10px rgba(0, 0, 0, 0.10),           /* 悬浮投影 */
                inset 0 1px 0 var(--btn-shine);           /* 顶部高光 */
    position: relative;
}
.btn::after {
    content: ''; position: absolute; inset: 0;
    background: transparent; transition: background var(--transition);
    border-radius: inherit; pointer-events: none;
}
.btn:active::after { background: rgba(0,0,0,0.08); }
body.dark-mode .btn:active::after { background: rgba(255,255,255,0.07); }
.btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 1px 0 var(--btn-3d),                    /* 厚度随升起收薄 */
                0 7px 16px rgba(0, 0, 0, 0.14),           /* 投影更远 */
                inset 0 1px 0 var(--btn-shine);
    filter: brightness(1.03);
}
.btn:active:not(:disabled) {
    transform: translateY(2px) scale(0.98);               /* 按下：厚度被压扁 */
    box-shadow: 0 1px 0 var(--btn-3d), inset 0 2px 5px rgba(0, 0, 0, 0.18);
}
.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.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 auto 0;
    max-width: calc(100% - 32px);
    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; align-items: flex-start; }
    .app-container { gap: 14px; }
    .card { padding: 22px 16px 20px; border-radius: var(--radius); }
    .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; }
    .upload-progress { gap: 8px; padding: 6px 10px; }
    .progress-track-upload { min-width: 56px; }
    .drop-icon { display: none; }   /* 移动端上传框内不显示上传图标 */
}
@media (max-width: 430px) {
    .card { padding: 15px 10px 16px; }
    .btn { padding: 12px 14px; font-size: 0.825rem; }
    .health-bar-container { min-width: 40px; }
    .progress-track-upload { min-width: 40px; }
    .health-label, .health-score { min-width: 0; }
    .progress-label-upload, .progress-text-upload { min-width: 0; }
}
/* ===== 宽屏（电脑/大平板）：解析模块两行布局 ===== */
@media (min-width: 1024px) {
    .parse-card {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 12px;
    }
    /* 第一行：接口下拉框 + 链接输入框 + 解析按钮 + 粘贴按钮 */
    .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-mode .float-btn,
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; }
}

/* ===== 图床上传区 ===== */
.upload-section {
    margin-top: 4px;
    /* 宽屏下 parse-card 为 flex 容器，图床区沉底排最后 */
    order: 9;
    flex-basis: 100%;
}

.upload-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

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

.upload-badge {
    font-size: 0.72rem;
    color: var(--accent);
    background: var(--accent-light);
    padding: 3px 10px;
    border-radius: 20px;
}

/* 标题右侧标签组：智能感知 + 警示标签并排靠右 */
.badge-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 解析模块标题头：与图床模块同款，宽屏 flex 布局下位于空调模块之后占整行 */
.parse-head {
    order: 4;
    flex-basis: 100%;
}

.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 36px 20px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: linear-gradient(180deg, var(--ctrl-grad-a), var(--input-bg)); /* 受光渐变 */
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55),   /* 顶部受光 */
                inset 0 3px 8px var(--ctrl-inset),          /* 内凹 */
                0 3px 10px rgba(0, 0, 0, 0.05);             /* 轻微投影 */
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.drop-zone:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.drop-zone.dragging {
    border-color: var(--accent);
    background: var(--accent-light);
    transform: scale(1.01);
}

.drop-zone:focus-visible {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(91, 127, 255, 0.15);
}

.drop-icon {
    font-size: 2.4rem;
    line-height: 1;
    margin-bottom: 8px;
}

.drop-text {
    font-size: 0.98rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.drop-link {
    color: var(--accent);
    font-weight: 600;
}

.drop-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* 上传进度条 —— 与接口健康度同款 */
.progress-label-upload {
    font-size: 0.71rem;
    color: var(--text-muted);
    letter-spacing: 0.2px;
    font-weight: 470;
    white-space: nowrap;
}

.upload-progress {
    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;
}

.upload-progress[hidden] { display: none; }

.progress-track-upload {
    flex: 1;
    min-width: 120px;
    height: 8px;
    border-radius: 99px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.14), rgba(255, 255, 255, 0.07)), var(--health-bar-bg);
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.22),
                inset 0 -1px 0 rgba(255, 255, 255, 0.3);
}

.progress-fill-upload {
    height: 100%;
    width: 0%;
    border-radius: 99px;
    background: var(--health-bar-fill);
    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);
}

.progress-text-upload {
    font-size: 0.79rem;
    font-weight: 570;
    color: var(--accent);
    min-width: 64px;
    text-align: right;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

/* 结果列表 */
.result-list {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.result-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--input-bg);
    transition: border-color var(--transition);
}

.result-item:hover {
    border-color: var(--border-focus);
}

.result-preview {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--health-bar-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    cursor: pointer;
    transition: box-shadow var(--transition);
}

.result-preview:hover {
    box-shadow: 0 0 0 2px var(--accent);
}

.result-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.result-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.result-links {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.result-link-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.result-link-tag {
    flex-shrink: 0;
    width: 62px;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: right;
}

.result-link-input {
    flex: 1;
    min-width: 0;
    font-size: 0.76rem;
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-family: inherit;
    transition: border-color var(--transition);
}

.result-link-input:focus {
    outline: none;
    border-color: var(--border-focus);
}

.result-copy-btn {
    flex-shrink: 0;
    padding: 5px 12px;
    font-size: 0.74rem;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.result-copy-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
}

@media (max-width: 640px) {
    .drop-zone { padding: 26px 14px; }
    .result-item { flex-direction: column; align-items: stretch; }
    .result-preview { width: 100%; height: 140px; }
    .result-link-tag { width: 54px; }
}

/* ===== 在线小空调 ===== */
/* 图标统一使用内联 SVG（.ac-ic），不加载任何自定义字体 */
.ac-ic {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
}

:root {
    --ac-body-bg: #f0eff2;
    --ac-body-border: #e0dfe2;
    --ac-body-grad-a: #ffffff;
    --ac-body-grad-b: #e6e4e9;
    --ac-hw: #9a9ea1;
    --ac-hw-grad-a: #a8aeb4;
    --ac-hw-grad-b: #7f858c;
    --ac-hw-dark: #666;
    --ac-logo: #9a9ea1;
    --ac-screen-bg: #101418;
    --ac-remote-bg: #ffffff;
    --ac-remote-border: #d8dce2;
    --ac-btn-bg: #ffffff;
    --ac-btn-border: #c9ced6;
    --ac-btn-text: #333940;
    --ac-btn-hover: #eef1f6;
    /* 立体质感（浅色主题） */
    --ac-remote-grad-a: #ffffff;
    --ac-remote-grad-b: #e4e8ef;
    --ac-remote-shine: rgba(255, 255, 255, 0.8);
    --ac-remote-shade: rgba(0, 0, 0, 0.07);
    --ac-btn-grad-a: #ffffff;
    --ac-btn-grad-b: #dfe4ec;
    --ac-btn-3d: rgba(0, 0, 0, 0.18);
    --ac-btn-shine: rgba(255, 255, 255, 0.9);
}
body.dark-mode {
    --ac-body-bg: #2b3446;
    --ac-body-border: #1f2635;
    --ac-body-grad-a: #3a4663;
    --ac-body-grad-b: #222b3e;
    --ac-hw: #5b6472;
    --ac-hw-grad-a: #6b7480;
    --ac-hw-grad-b: #454c58;
    --ac-hw-dark: #3a4250;
    --ac-logo: #8b93a5;
    --ac-screen-bg: #05070c;
    --ac-remote-bg: #1e293b;
    --ac-remote-border: #2d3548;
    --ac-btn-bg: #1a2235;
    --ac-btn-border: #3a4558;
    --ac-btn-text: #e8ecf2;
    --ac-btn-hover: #262f45;
    /* 立体质感（暗色主题） */
    --ac-remote-grad-a: #323e5c;
    --ac-remote-grad-b: #161d2e;
    --ac-remote-shine: rgba(255, 255, 255, 0.1);
    --ac-remote-shade: rgba(0, 0, 0, 0.35);
    --ac-btn-grad-a: #35425f;
    --ac-btn-grad-b: #191f33;
    --ac-btn-3d: rgba(0, 0, 0, 0.55);
    --ac-btn-shine: rgba(255, 255, 255, 0.14);
}

.ac-wrap {
    display: flex;
    align-items: flex-start;   /* 顶部对齐：空调本体与遥控器顶端齐平 */
    justify-content: space-between;   /* 宽屏下左右两端贴齐卡片边缘 */
    gap: 30px;
    flex-wrap: wrap;
    padding: 4px 0 8px;
}

/* ===== 空调本体 ===== */
.ac-unit {
    width: auto;
    min-width: 0;
    flex: 1 1 auto;   /* 拉伸吸满与遥控器之间的全部宽度 */
    padding: 0 0 8px; /* 去掉左右内边距，造型直接顶到卡片边缘 */
    position: relative;
    /* 整机双层投影：收窄扩散，阴影紧贴机身，避免影响周围 */
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.10))
            drop-shadow(0 12px 20px rgba(0, 0, 0, 0.14));
}
.ac-body {
    position: relative;
    width: 100%;
    height: 174px;
    background: linear-gradient(180deg, var(--ac-body-grad-a), var(--ac-body-grad-b));
    border: 1px solid var(--ac-body-border);
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65),   /* 顶部受光高光 */
                inset 0 -2px 8px rgba(0, 0, 0, 0.06);      /* 底部微暗 */
    transition: background var(--transition), border-color var(--transition);
}
.ac-logo {
    position: absolute;
    left: 8%; bottom: 30px;   /* 百分比定位，拉伸时保持内边距比例 */
    font-size: 18px;
    color: var(--ac-logo);
    font-weight: 400;         /* 不加粗 */
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;  /* 英文标识用无衬线，避免书法字体笔迹显粗 */
    letter-spacing: 1px;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}
.ac-screen {
    position: absolute;
    right: 8%; top: 59px;     /* 百分比定位，拉伸时保持内边距比例 */
    width: 56px; height: 56px;
    background: var(--ac-screen-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.16),  /* 圆形玻璃高光 */
                inset 0 -1px 4px rgba(0, 0, 0, 0.6),
                inset 0 2px 10px rgba(0, 0, 0, 0.5);
}
.ac-number {
    display: none;               /* 默认（PC）：关机黑屏 */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    color: #ffffff;
    font-size: 24px;
    line-height: 1;                                  /* 去掉行高 hack，配合 flex 精确居中 */
    font-family: 'Consolas', 'Menlo', 'Courier New', monospace;  /* 系统等宽字体，无额外加载 */
    transition: color var(--transition), text-shadow var(--transition);
}
/* 温度数字行（数字 + ℃ 横排） */
.ac-temp-row {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    line-height: 1;
}
/* 模式/状态小字（关机显示 OFF；开机按原样只显示温度时留空隐藏） */
.ac-mode-tag {
    font-size: 9px;
    letter-spacing: 1.5px;
    margin-top: 3px;
    line-height: 1;
    opacity: 0.9;
}
.ac-mode-tag:empty { display: none; }
/* ℃ 上标符号：与数字同一行、顶部对齐，整体居中 */
.ac-number-unit {
    align-self: flex-start;
    font-size: 13px;
    line-height: 1;
    margin: 2px 0 0 1px;
}
.ac-unit.active .ac-number {
    display: flex;
    align-items: center;
    justify-content: center;
}
.ac-unit.unactive .ac-number { display: none; }
.ac-unit.active.cold .ac-number { color: #03a9f4; text-shadow: 0 0 12px rgba(3, 169, 244, 0.8); }
.ac-unit.active.heat .ac-number { color: #ff9800; text-shadow: 0 0 12px rgba(255, 152, 0, 0.8); }

.ac-bottom {
    width: 100%;
    height: 30px;
    border-bottom-left-radius: 50px;
    border-bottom-right-radius: 50px;
    border: 5px solid var(--ac-body-border);
    background: linear-gradient(180deg, var(--ac-hw-grad-a), var(--ac-hw-grad-b));
    box-sizing: border-box;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35),   /* 底槽顶部受光 */
                inset 0 -2px 4px rgba(0, 0, 0, 0.18);      /* 底槽底部阴影 */
}
.ac-bottom-main {
    position: relative;
    width: 85%;
    margin: 0 auto;
    height: 20px;
    background: var(--ac-hw-dark);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);  /* 出风口凹槽 */
}
.ac-bottom-outlet {
    width: calc(100% - 2px);
    height: 19px;
    margin: 0 auto;
    background: repeating-linear-gradient(180deg, var(--ac-hw) 0 5px, var(--ac-hw-dark) 5px 6px);  /* 横向百叶格栅（真实出风口为横向叶片） */
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
    transform-origin: top center;
}
.ac-unit.active .ac-bottom-outlet { animation: ac-open 2s ease forwards; }
.ac-unit.unactive .ac-bottom-outlet { transform: rotateX(60deg); animation: ac-close 2s ease forwards; }
@keyframes ac-open { to { transform: rotateX(75deg) translateY(55%); } }
@keyframes ac-close { to { transform: rotateX(0deg); } }

/* ===== 遥控器（右侧并列） ===== */
.ac-remote {
    flex: 0 0 auto;
    width: 152px;
    height: 204px;               /* 与空调本体等高（174+30），实现上下完全对齐 */
    background: linear-gradient(160deg, var(--ac-remote-grad-a), var(--ac-remote-grad-b));
    border: 1px solid var(--ac-remote-border);
    border-radius: 16px;
    padding: 14px 14px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.13),
                0 2px 8px rgba(0, 0, 0, 0.10),
                inset 0 1px 0 var(--ac-remote-shine),
                inset 0 -1px 0 var(--ac-remote-shade);
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;   /* 垂直均匀分布，元素间留出呼吸空间 */
    gap: 8px;
    transition: background var(--transition), border-color var(--transition);
}
.remote-screen {
    position: relative;
    background: #0b0f14;
    border: 1px solid rgba(0, 0, 0, 0.55);
    border-radius: 8px;
    padding: 4px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 24px;
    font-family: 'Consolas', 'Menlo', 'Courier New', monospace;  /* 系统等宽字体，无额外加载 */
    color: #7ef0a0;
    letter-spacing: 1px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.8), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
/* LCD 玻璃反光 */
.remote-screen::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(125deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.05) 30%, transparent 45%);
}
.remote-mode { font-size: 12px; }
.remote-temp { font-size: 15px; }
.remote-btn {
    height: 28px;
    border-radius: 14px;
    border: 1px solid var(--ac-btn-border);
    background: linear-gradient(180deg, var(--ac-btn-grad-a), var(--ac-btn-grad-b));
    color: var(--ac-btn-text);
    font-size: 12px;
    cursor: pointer;
    user-select: none;
    transition: all 0.12s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 2px 0 var(--ac-btn-3d),
                0 2px 8px rgba(0, 0, 0, 0.10),
                inset 0 1px 0 var(--ac-btn-shine);
}
.remote-btn:hover { filter: brightness(1.04); }
.remote-btn:active {
    transform: translateY(1px) scale(0.97);
    box-shadow: 0 1px 0 var(--ac-btn-3d), inset 0 2px 5px rgba(0, 0, 0, 0.2);
}
.remote-power {
    width: 88px;               /* 缩短为胶囊形，不再撑满全宽 */
    align-self: center;        /* 水平居中 */
    height: 32px;
    border-radius: 16px;
    letter-spacing: 3px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(180deg, #ff8a65, #f4511e);
    border-color: #d84315;
    box-shadow: 0 2px 0 #bf360c, 0 2px 8px rgba(244, 81, 30, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.remote-power .ac-ic { color: #ffffff; }
.remote-row { display: flex; gap: 14px; justify-content: center; }
.remote-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 15px;
}
.remote-circle .ac-ic { width: 14px; height: 14px; }
/* 图标颜色直接继承按钮文字色（SVG 用 currentColor） */
#acCold { color: var(--ac-cold, #03a9f4); }
#acAdd { color: var(--ac-btn-text); }
#acHeat { color: var(--ac-heat, #ff9800); }
#acMinus { color: var(--ac-btn-text); }
/* 遥控器按钮组容器：宽屏下保持纵向排列（与手机端横向布局共用） */
.remote-btns {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ===== 宽屏卡片内排序（解析→图床→空调） ===== */
@media (min-width: 1024px) {
    .divider.divider--ac { order: 1; }
    .upload-section.ac-section { order: 0; }
    .divider.divider--receipt { order: 3; }
    .upload-section.receipt-section { order: 2; }
}

/* ===== 空调模块响应式 ===== */
@media (max-width: 740px) {
    .ac-wrap {
        gap: 18px;
        justify-content: center;   /* 窄屏恢复居中，避免单行 item 被 space-between 顶到一侧 */
    }
    .ac-unit {
        max-width: 420px;          /* 与遥控器同宽，两侧不留内边距 */
        flex: 1 1 340px;
        padding: 0 0 8px;          /* 去掉左右 padding，空调机身与遥控器机身严格同宽 */
    }
    .ac-remote {
        width: 100%;
        max-width: 420px;          /* 移动端加宽遥控器，按钮不再拥挤 */
        height: auto;
        flex-direction: row;       /* 移动端：隐藏显示屏，5 个按键横排成一行 */
        justify-content: center;
        align-items: center;
        gap: 14px;
        padding: 14px 16px;
    }
    .remote-screen { display: none; }   /* 移动端不显示 LCD，状态显示在空调本体屏幕上 */
    .remote-btns {
        display: contents;         /* 按钮直接参与遥控器一排布局 */
    }
    .remote-row {
        display: contents;
    }
    .remote-power {
        width: 48px;               /* 电源键圆形图标键，与其余四键并列 */
        height: 48px;
        border-radius: 50%;
        font-size: 0;              /* 圆形内隐藏文字（状态由空调屏幕显示） */
        line-height: 0;            /* 清除文字占位，让图标精确居中 */
        gap: 0;                    /* 隐藏文字后不再有间距偏移 */
        letter-spacing: 0;
        padding: 0;
    }
    .remote-power .ac-ic {
        width: 22px;
        height: 22px;
    }
    .remote-circle {
        width: 42px;
        height: 42px;
    }
    .remote-circle .ac-ic { width: 17px; height: 17px; }
    /* 移动端一排5键：制冷 制热 电源 加 减（电源居中） */
    #acCold  { order: 0; }
    #acHeat  { order: 1; }
    #acPower { order: 2; }
    #acAdd   { order: 3; }
    #acMinus { order: 4; }
    .ac-body { height: 150px; }
    .ac-screen { top: 42px; }
    .ac-unit.unactive .ac-number { display: flex; }   /* 移动端：关机时空调屏幕显示 OFF */
    .ac-mode-tag { font-size: 12px; letter-spacing: 2px; }  /* 移动端 OFF 字更大更清晰 */
}
@media (max-width: 450px) {
    .ac-body { height: 140px; }
    .ac-logo { font-size: 14px; }
    .ac-screen { top: 38px; width: 52px; height: 52px; }
    .ac-number { font-size: 21px; }
    .ac-mode-tag { font-size: 11px; }
    .ac-remote { gap: 12px; padding: 12px 14px; }
    .remote-power { width: 44px; height: 44px; }
    .remote-power .ac-ic { width: 20px; height: 20px; }
    .remote-circle { width: 38px; height: 38px; }
    .remote-circle .ac-ic { width: 15px; height: 15px; }
}

/* ===== 支付宝到账音效 ===== */
.receipt-wrap {
    display: flex;
    flex-direction: row;           /* 横向排列：输入框在左、按钮在右 */
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between; /* 左右两端贴齐卡片边缘 */
    gap: 14px;
}
.receipt-input-row {
    display: flex;
    align-items: center;
    flex: 1 1 auto;          /* 拉伸占满剩余空间，消除按钮前的空隙 */
    min-width: 220px;
}
.receipt-logo {
    display: block;
    height: 44px;              /* 完整横版 logo，等比显示，不做任何裁切 */
    width: auto;
    object-fit: contain;
    flex: 0 0 auto;
    margin-right: 14px;
    background: #ffffff;       /* 白色圆角底：暗色模式下保持清晰可读 */
    border-radius: 10px;
    padding: 4px 10px;
    box-sizing: border-box;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);   /* 轻投影与整体立体感呼应 */
}
.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-actions {
    margin-top: 0;
    flex: 0 0 auto;
    order: 0;   /* 覆盖宽屏下 .actions-row 的 order:6，与输入框同一行并排 */
}
@media (max-width: 740px) {
    .receipt-wrap {
        flex-direction: column;    /* 移动端纵向堆叠 */
        align-items: stretch;
    }
    .receipt-input-row {
        width: 100%;               /* 移动端输入框拉满全宽 */
        max-width: none;
        flex: none;
    }
    .receipt-logo { display: none; }   /* 移动端不显示支付宝图标 */
    .receipt-symbol { left: 16px; }    /* 无图标时 ¥ 符号回到原位 */
    .receipt-input { padding-left: 42px; }
}
