/* ============================================================
   Nice工具箱 · 全站设计系统
   与 web-design/index.html、tool.html 保持一致
   ============================================================ */

/* ---------- 主题变量 ---------- */
:root {
    --primary: #4A7CF7;       /* 主色：柔和蓝 */
    --primary-soft: #EAF1FE;  /* 主色浅底 */
    --text-main: #2B3445;     /* 主文字 */
    --text-sub: #6B7280;      /* 次级文字 */
    --border: #EBEEF3;        /* 边框 */
    --bg-page: #F7F8FA;       /* 页面浅灰底 */
    --success: #2FA36B;       /* 成功绿 */
    --danger: #D65A5A;        /* 错误红 */
    --radius: 12px;
    --shadow-sm: 0 2px 8px rgba(43, 52, 69, .06);
    --shadow-md: 0 10px 28px rgba(43, 52, 69, .10);
}

/* ---------- 基础 ---------- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: var(--text-main);
    background: #fff;
    font-size: 15px;
    line-height: 1.7;
    /* 吸底布局：body 改为纵向弹性容器，内容不足一屏时页脚也能贴住视口底部 */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 禁用移动端双击（连击）放大：manipulation 保留平移与捏合缩放，仅取消双击缩放 */
* {
    touch-action: manipulation;
}

/* 中间内容区自适应剩余空间：导航与页脚高度固定，main 占满剩余高度并把页脚顶到底部 */
body > main {
    flex: 1 0 auto;
}

a { text-decoration: none; color: inherit; transition: color .2s; }

/* Bootstrap 按钮对齐设计稿观感 */
.btn {
    border-radius: 9px;
    padding: 8px 16px;
    font-size: 13.5px;
    border-color: var(--border);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
}
.btn-primary:hover { background: #3D6BE0; border-color: #3D6BE0; color: #fff; }
.btn-outline-primary { color: var(--primary); }
.btn-outline-secondary { color: var(--text-sub); }

/* 按钮 loading / 禁用态：原分散在各工具 <style scoped> 中，构建后未被页面引用，现合并为全局 */
.btn:disabled {
    opacity: .6;
    cursor: not-allowed;
    pointer-events: none;
}
.btn.loading svg { display: none; }
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 参数滑块：标签与数值不换行，数值右对齐保持等宽（图片压缩工具） */
.opt-slider { flex-wrap: nowrap; }
.opt-slider .opt-value {
    min-width: 42px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ============================================================
   导航栏（毛玻璃吸顶）
   ============================================================ */
.navbar-site {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.navbar-site .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
}
.logo .logo-mark {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 15px;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.nav-links a { color: var(--text-sub); font-size: 14px; }
.nav-links a:hover, .nav-links a.active { color: var(--primary); }
.nav-toggle {
    display: none;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    color: var(--text-main);
}

/* ============================================================
   Hero 区（首页）
   ============================================================ */
.hero {
    background: linear-gradient(180deg, #F2F6FF 0%, #FDFEFF 100%);
    padding: 88px 0 72px;
    text-align: center;
}
.hero h1 { font-size: 34px; font-weight: 700; letter-spacing: .5px; }
.hero h1 .accent { color: var(--primary); }
.hero p { color: var(--text-sub); margin: 14px auto 34px; max-width: 480px; }

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 520px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 8px 8px 20px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s, border-color .2s;
}
.search-box:focus-within { border-color: var(--primary); box-shadow: 0 6px 20px rgba(74, 124, 247, .14); }
.search-box svg { flex-shrink: 0; color: #A2AAB8; }
.search-box input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    color: var(--text-main);
    background: transparent;
    min-width: 0;
}
.search-box button {
    border: none;
    background: var(--primary);
    color: #fff;
    border-radius: 999px;
    padding: 9px 26px;
    font-size: 14px;
    cursor: pointer;
    transition: background .2s;
}
.search-box button:hover { background: #3D6BE0; }

/* 搜索框清空按钮 */
.search-clear {
    border: none;
    background: transparent;
    color: #A2AAB8;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .2s;
}
.search-clear:hover { color: var(--text-sub); }

/* 搜索无结果空状态 */
.search-empty {
    text-align: center;
    padding: 48px 16px;
    color: var(--text-sub);
}
.search-empty-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}
.search-empty p { font-size: 15px; margin-bottom: 18px; }
.search-empty-reset {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-main);
    border-radius: 999px;
    padding: 8px 22px;
    font-size: 14px;
    cursor: pointer;
    transition: all .2s;
}
.search-empty-reset:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }

.hero-tags {
    margin-top: 22px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}
.hero-tags a {
    font-size: 13px;
    color: var(--text-sub);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 5px 14px;
    transition: all .2s;
}
.hero-tags a:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }

/* ============================================================
   区块通用
   ============================================================ */
.section { padding: 64px 0; }
.section-alt { background: var(--bg-page); }
.section-head { margin-bottom: 38px; }
.section-head h2 { font-size: 24px; font-weight: 700; }
.section-head p { color: var(--text-sub); margin-top: 8px; font-size: 14px; }

/* ============================================================
   工具卡片
   ============================================================ */
.tool-card {
    position: relative;
    display: block;
    height: 100%;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px 22px;
    transition: transform .2s, box-shadow .2s, border-color .2s;
}
.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: transparent;
}
.tool-icon {
    width: 46px;
    height: 46px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.tool-icon svg { width: 22px; height: 22px; }
.tool-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.tool-card p { font-size: 13px; color: var(--text-sub); line-height: 1.6; }

/* 免费 / PRO 徽章 */
.tool-badge {
    font-size: 11px;
    font-weight: 600;
    border-radius: 999px;
    padding: 2px 10px;
    line-height: 1.6;
}
.tool-card .tool-badge { position: absolute; top: 14px; right: 14px; }
.badge-free { background: #E7F6EE; color: #2FA36B; }
.badge-pro { background: linear-gradient(135deg, #4A7CF7, #7BA3FF); color: #fff; }

/* 图标配色（低饱和） */
.tone-blue  { background: var(--primary-soft); color: #3D6BE0; }
.tone-green { background: #E7F6EE; color: #2FA36B; }
.tone-orange{ background: #FEF3E6; color: #E08A2E; }
.tone-purple{ background: #F2EDFC; color: #7C5CD6; }
.tone-cyan  { background: #E6F5F8; color: #2E9BB0; }
.tone-red   { background: #FDECEC; color: #D65A5A; }

/* ============================================================
   特性区（首页）
   ============================================================ */
.feature-item { text-align: center; padding: 10px 18px; }
.feature-item .f-icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}
.feature-item h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.feature-item p { font-size: 13px; color: var(--text-sub); }

/* ============================================================
   会员定价
   ============================================================ */
.price-card {
    position: relative;
    height: 100%;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px 28px 30px;
    text-align: center;
    transition: transform .2s, box-shadow .2s, border-color .2s;
}
.price-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: transparent; }
.price-card.featured { border-color: var(--primary); box-shadow: 0 12px 32px rgba(74, 124, 247, .16); }
.price-card.featured:hover { border-color: var(--primary); }
.plan-tag {
    position: absolute;
    top: -13px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #4A7CF7, #7BA3FF);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    border-radius: 999px;
    padding: 3px 16px;
    white-space: nowrap;
}
.plan-name { font-size: 15px; font-weight: 600; color: var(--text-sub); }
.plan-price { font-size: 38px; font-weight: 700; margin: 10px 0 2px; letter-spacing: -.5px; }
.plan-price small { font-size: 14px; font-weight: 400; color: var(--text-sub); letter-spacing: 0; }
.plan-desc { font-size: 13px; color: var(--text-sub); }
.price-card ul { margin: 24px 0 28px; text-align: left; list-style: none; padding: 0; }
.price-card li {
    display: flex;
    gap: 9px;
    font-size: 13.5px;
    color: var(--text-sub);
    padding: 7px 0;
}
.price-card li svg { flex-shrink: 0; margin-top: 4px; color: #2FA36B; }
.plan-btn {
    display: block;
    border-radius: 999px;
    padding: 10px 0;
    border: 1px solid var(--primary);
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    transition: all .2s;
}
.plan-btn:hover { background: var(--primary-soft); }
.plan-btn.primary { background: var(--primary); color: #fff; }
.plan-btn.primary:hover { background: #3D6BE0; }

/* ============================================================
   底部 CTA
   ============================================================ */
.cta {
    background: linear-gradient(135deg, #4A7CF7, #6E9BFF);
    border-radius: 16px;
    color: #fff;
    padding: 52px 30px;
    text-align: center;
}
.cta h2 { font-size: 22px; font-weight: 700; }
.cta p { opacity: .85; margin: 10px 0 26px; font-size: 14px; }
.cta a {
    display: inline-block;
    background: #fff;
    color: var(--primary);
    border-radius: 999px;
    padding: 11px 34px;
    font-size: 14px;
    font-weight: 600;
    transition: transform .2s, box-shadow .2s;
}
.cta a:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 0, 0, .15); }

/* ============================================================
   页脚（深色）
   ============================================================ */
.footer-site {
    background: #232B3A;
    color: #9AA3B5;
    padding: 44px 0 28px;
    margin-top: 70px;
}
.footer-site .container { text-align: center; }
.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 18px;
    list-style: none;
    padding: 0;
}
.footer-links a { font-size: 13px; color: #9AA3B5; }
.footer-links a:hover { color: #fff; }
.footer-site p { font-size: 12px; color: #6B7488; }

/* ============================================================
   工具页头（面包屑 + 标题）
   ============================================================ */
.tool-header {
    background: linear-gradient(180deg, #F2F6FF 0%, #FDFEFF 100%);
    padding: 34px 0 30px;
    border-bottom: 1px solid var(--border);
}
.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-sub);
    margin-bottom: 18px;
}
.breadcrumb-nav a:hover { color: var(--primary); }
.breadcrumb-nav .sep { color: #C6CCD8; }
.tool-title {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.tool-title .tool-icon-lg {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tool-title .tool-icon-lg svg { width: 26px; height: 26px; }
.tool-title h1 { font-size: 26px; font-weight: 700; line-height: 1.3; }
.tool-title .subtitle { font-size: 14px; color: var(--text-sub); margin-top: 4px; }

/* ============================================================
   工具操作区
   ============================================================ */
.workspace { padding: 34px 0 50px; }

/* 上传区：虚线框 + 拖拽 */
.upload-zone {
    position: relative;
    border: 2px dashed #C9D6F2;
    border-radius: var(--radius);
    background: var(--bg-page);
    padding: 44px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
}
.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-soft);
}
.upload-zone .u-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}
.upload-zone h3 { font-size: 15.5px; font-weight: 600; margin-bottom: 4px; }
.upload-zone p { font-size: 13px; color: var(--text-sub); }
.upload-zone input[type=file] { display: none; }

/* 参数面板滑杆 / 复选框 */
.opt-group input[type=range] {
    accent-color: var(--primary);
    cursor: pointer;
    width: 110px;
}
.opt-group input[type=checkbox] {
    accent-color: var(--primary);
    width: 15px;
    height: 15px;
    cursor: pointer;
}

/* 参数面板 + 操作按钮条 */
.options-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 16px;
}
.opt-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-sub);
}
.opt-group select {
    font-family: inherit;
    font-size: 13px;
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    background: #fff;
    outline: none;
    cursor: pointer;
}
.opt-group select:focus { border-color: var(--primary); }
.options-bar .spacer { flex: 1; }

/* 双栏预览 */
.preview-grid { display: flex; gap: 14px; margin-top: 16px; }
.preview-pane {
    flex: 1;
    min-width: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.pane-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-sub);
    background: var(--bg-page);
}
.pane-head .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 7px;
    display: inline-block;
}
.dot-in { background: #E08A2E; }
.dot-out { background: #2FA36B; }
.pane-head .copy-mini {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: none;
    background: transparent;
    color: var(--primary);
    font-size: 12.5px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
}
.pane-head .copy-mini:hover { background: var(--primary-soft); }
.pane-body {
    min-height: 340px;
    flex: 1;
    padding: 18px;
}
.pane-body textarea {
    width: 100%;
    height: 100%;
    min-height: 300px;
    /* 可输入视觉暗示：浅灰底 + 边框，与白色面板形成区分 */
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    outline: none;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-main);
    background: var(--bg-page);
    cursor: text;
    transition: border-color .18s, box-shadow .18s, background .18s;
}
/* 占位提示文字颜色（原本用浏览器默认色，偏浅） */
.pane-body textarea::placeholder { color: #9AA3B2; }
/* 悬停：边框略深，提示可交互 */
.pane-body textarea:hover { border-color: #D5DCE6; }
/* 聚焦：主色边框 + 浅蓝光晕，并转为白底突出编辑态 */
.pane-body textarea:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px var(--primary-soft);
}
/* 只读结果框（如文本压缩右侧）：保持原边框，不显示编辑光晕 */
.pane-body textarea[readonly] { cursor: default; }
.pane-body textarea[readonly]:hover,
.pane-body textarea[readonly]:focus { border-color: var(--border); box-shadow: none; }

/* 图片 / SVG 预览体：棋盘格背景 + 居中内容 */
.preview-body {
    position: relative;
    min-height: 340px;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: repeating-conic-gradient(#F7F9FC 0% 25%, #fff 0% 50%) 0 0 / 16px 16px;
}
.preview-body img,
.preview-body .svg-output svg {
    max-width: 100%;
    max-height: 380px;
    width: auto;
    height: auto;
    filter: drop-shadow(0 2px 6px rgba(43, 52, 69, .08));
}
.preview-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #B7BECB;
    font-size: 13px;
}
.preview-empty svg { width: 34px; height: 34px; filter: none; }

/* 状态提示条 */
.status-bar {
    display: none;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding: 11px 16px;
    border-radius: 10px;
    font-size: 13.5px;
}
.status-bar.show { display: flex; }
.status-bar.ok { background: #E7F6EE; color: #1E7A50; border: 1px solid #C8E9D6; }
.status-bar.err { background: #FDECEC; color: #B04040; border: 1px solid #F5D4D4; }

/* 转换信息统计 */
.result-stats {
    display: none;
    margin-top: 14px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 18px;
    font-size: 12.5px;
    color: var(--text-sub);
    flex-wrap: wrap;
    gap: 8px 26px;
}
.result-stats.show { display: flex; }
.result-stats b { color: var(--text-main); font-weight: 600; }

/* ============================================================
   文档签名提取（signature-extract 工具）
   ============================================================ */
.sig-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}
.sig-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
/* 透明底签名预览：棋盘格衬托 */
.sig-thumb {
    background: repeating-conic-gradient(#F7F9FC 0% 25%, #fff 0% 50%) 0 0 / 16px 16px;
}
.sig-preview {
    flex: 0 0 120px;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.sig-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.sig-meta { flex: 1; min-width: 0; }
.sig-filename {
    font-size: 13px;
    color: var(--text-sub);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sig-name {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}
.sig-name span { font-size: 13px; color: var(--text-main); flex: 0 0 auto; }
.sig-name input {
    flex: 1;
    min-width: 0;
    font-family: inherit;
    font-size: 13px;
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    background: #fff;
    outline: none;
}
.sig-name input:focus { border-color: var(--primary); }
.sig-stats {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-sub);
}
.sig-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sig-error {
    color: #D65A5A;
    font-size: 12px;
    padding: 0 8px;
    text-align: center;
    word-break: break-all;
}
.sig-wait { color: #B7BECB; font-size: 12px; }
.sig-num input {
    width: 72px;
    font-family: inherit;
    font-size: 13px;
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    background: #fff;
    outline: none;
}
.sig-num input:focus { border-color: var(--primary); }

/* ============================================================
   文本差异对比（text-diff 工具）
   ============================================================ */
.diff-panel {
    margin-top: 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.diff-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 16px;
    padding: 10px 16px;
    background: var(--bg-page);
    border-bottom: 1px solid var(--border);
    font-size: 12.5px;
    color: var(--text-sub);
}
.diff-summary .spacer { flex: 1; }
.diff-stat { display: inline-flex; align-items: center; }
.diff-stat-add { color: #1E7A50; }
.diff-stat-del { color: #B04040; }
.diff-stat-mod { color: #A16207; }

.diff-empty {
    padding: 46px 16px;
    text-align: center;
    color: #B7BECB;
    font-size: 13px;
}

.diff-body {
    max-height: 460px;
    overflow: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
    font-size: 12.5px;
    line-height: 1.75;
}
.diff-row {
    display: grid;
    grid-template-columns: 46px 46px minmax(max-content, 1fr);
    white-space: pre;
}
.diff-body-split .diff-row {
    grid-template-columns: 46px minmax(max-content, 1fr) 46px minmax(max-content, 1fr);
}
.diff-gutter {
    padding: 0 8px;
    text-align: right;
    color: #9AA3B2;
    background: var(--bg-page);
    border-right: 1px solid var(--border);
    user-select: none;
}
.diff-body-split .diff-gutter-new { border-left: 1px solid var(--border); }
.diff-code { display: block; padding: 0 10px; }
.diff-sign {
    display: inline-block;
    width: 14px;
    margin-right: 4px;
    color: #9AA3B2;
    user-select: none;
}

/* 行底色：新增 / 删除 / 修改（修改行本身底色更浅，由行内片段着色突出差异） */
.diff-insert { background: #E7F6EE; }
.diff-delete { background: #FDECEC; }
.diff-replace { background: #FFFDF3; }

/* 行内字符级高亮 */
.seg-insert { background: #B7E4C9; border-radius: 2px; }
.seg-delete { background: #F5C2C2; border-radius: 2px; }

/* ============================================================
   正则表达式测试（regex-test 工具）
   ============================================================ */
/* 常用示例按钮组（单选，点击自动加载） */
.regex-sample-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1 1 100%;
}
.regex-sample-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    color: var(--text-sub);
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
    transition: all .15s;
}
.regex-check {
    width: 16px;
    height: 16px;
    color: #fff;
    background: #22C55E;
    border-radius: 50%;
    flex-shrink: 0;
}
.regex-sample-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
}
.regex-sample-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
}
.regex-config {
    margin-top: 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
}
.regex-input-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
    font-size: 15px;
}
.regex-slash {
    color: #B04040;
    font-weight: 600;
    user-select: none;
}
.regex-pattern-input {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-main);
    background: #fff;
    outline: none;
    transition: border-color .15s;
}
.regex-pattern-input:focus { border-color: var(--primary); }
.regex-pattern-input::placeholder { color: #9AA3B2; }
.regex-flags {
    min-width: 34px;
    padding: 6px 8px;
    text-align: center;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
}
.regex-flag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-top: 12px;
}
.regex-flag-row .opt-group { margin: 0; }

.regex-count {
    margin-left: auto;
    font-weight: 400;
    font-size: 12px;
    color: var(--text-sub);
}

.regex-result-body {
    display: flex;
    flex-direction: column;
    min-height: 340px;
    padding: 0;
}
.regex-error {
    margin: 12px 16px;
    padding: 10px 12px;
    background: #FDECEC;
    color: #B04040;
    border: 1px solid #F5D4D4;
    border-radius: 8px;
    font-size: 12.5px;
    word-break: break-all;
}
.regex-highlight {
    padding: 14px 16px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
    font-size: 12.5px;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-all;
    color: var(--text-main);
    border-bottom: 1px solid var(--border);
    max-height: 180px;
    overflow: auto;
}
.regex-hl-match {
    background: #FFE3A3;
    color: #7A5A00;
    border-radius: 2px;
    padding: 0 1px;
    margin: 0 1px;
}
.regex-match-list {
    margin: 0;
    padding: 0;
    list-style: none;
    max-height: 240px;
    overflow: auto;
}
.regex-match-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 12.5px;
}
.regex-match-item:last-child { border-bottom: none; }
.regex-match-idx {
    flex-shrink: 0;
    min-width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    background: var(--primary-soft);
    color: var(--primary);
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 600;
}
.regex-match-text {
    flex: 1;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
    word-break: break-all;
    color: var(--text-main);
}
.regex-match-pos {
    flex-shrink: 0;
    color: #9AA3B2;
    font-size: 11.5px;
}
.regex-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    color: #B7BECB;
    font-size: 13px;
}

/* ============================================================
   使用步骤 / 特性网格 / FAQ（工具页内容区）
   ============================================================ */
.step-list { counter-reset: step; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step-item {
    position: relative;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 22px 22px;
}
.step-item::before {
    counter-increment: step;
    content: "0" counter(step);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 14px;
}
.step-item h3 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.step-item p { font-size: 13px; color: var(--text-sub); line-height: 1.7; }

.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.feature-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: transform .2s, box-shadow .2s;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.feature-card .f-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}
.feature-card .f-icon svg { width: 20px; height: 20px; }
.feature-card h3 { font-size: 14.5px; font-weight: 600; margin-bottom: 4px; }
.feature-card p { font-size: 13px; color: var(--text-sub); line-height: 1.65; }

.faq-list { max-width: 820px; margin: 0 auto; }
.faq-item {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    overflow: hidden;
    transition: border-color .2s;
}
.faq-item.open { border-color: var(--primary); }
.faq-q {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 16px 20px;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text-main);
}
.faq-q .arrow { flex-shrink: 0; width: 18px; height: 18px; color: var(--text-sub); transition: transform .25s; }
.faq-item.open .arrow { transform: rotate(180deg); color: var(--primary); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.faq-a p { padding: 0 20px 18px; font-size: 13.5px; color: var(--text-sub); line-height: 1.8; }

/* ============================================================
   图片转 ICO 工具 · 尺寸多选芯片
   ============================================================ */
.sizes-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.sizes-label {
    font-size: 13px;
    color: var(--text-sub);
    margin-right: 4px;
}
.sizes-list {
    display: flex;
    gap: 6px;
}
.size-chip {
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12.5px;
    background: #fff;
    color: var(--text-sub);
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    line-height: 1.4;
    position: relative;
}
.size-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.size-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
    padding-right: 22px;
}
.size-chip.active::after {
    content: '✓';
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--success);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.sizes-actions {
    display: flex;
    gap: 10px;
    margin-left: 4px;
}
.link-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 12px;
    cursor: pointer;
    padding: 0;
}
.link-btn:hover { text-decoration: underline; }

/* 阈值滑杆 */
.opt-slider {
    display: flex;
    align-items: center;
    gap: 6px;
}
.opt-slider .opt-label {
    font-size: 13px;
    color: var(--text-sub);
    white-space: nowrap;
}
.opt-slider input[type="range"] {
    width: 100px;
}
.opt-slider .opt-value {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--primary);
    min-width: 28px;
    text-align: center;
}

/* 棋盘格底：显示在去背景预览的左面板 */
.preview-body.checker-bg {
    background:
        linear-gradient(45deg, #e5e7eb 25%, transparent 25%),
        linear-gradient(-45deg, #e5e7eb 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e5e7eb 75%),
        linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    background-color: #f9fafb;
}

/* ============================================================
   文件列表（批量操作表格 · 图片压缩等工具共用）
   ============================================================ */
.file-list {
    margin-top: 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.file-list .list-header {
    display: grid;
    grid-template-columns: 60px 1fr 90px 90px 80px 110px 140px;
    gap: 10px;
    padding: 10px 16px;
    background: var(--bg-page);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-sub);
}
.file-list .lh-thumb { text-align: center; }
/* 表头对齐方式需与对应数据列保持一致：数值列与操作列右对齐，状态列居中，其余左对齐 */
.file-list .lh-size,
.file-list .lh-rate,
.file-list .lh-action { text-align: right; }
.file-list .lh-status { text-align: center; }
.file-list .file-row {
    display: grid;
    grid-template-columns: 60px 1fr 90px 90px 80px 110px 140px;
    gap: 10px;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid #F0F2F7;
    font-size: 13px;
    transition: background .15s;
}
.file-list .file-row:last-child { border-bottom: none; }
.file-list .file-row:hover { background: #FAFBFD; }
.file-list .file-row.done { background: #FAFFFB; }
.file-list .file-row.error { background: #FFF7F7; }
.file-list .file-row.skipped { opacity: 0.55; }
.file-list .col-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-page);
    display: flex;
    align-items: center;
    justify-content: center;
}
.file-list .col-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.file-list .col-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.file-list .col-name .file-dims {
    display: block;
    font-size: 11px;
    color: var(--text-sub);
    margin-top: 2px;
}
.file-list .col-size {
    font-variant-numeric: tabular-nums;
    text-align: right;
}
.file-list .after-size { color: var(--text-main); }
.file-list .muted { color: #B7BECB; }
.file-list .col-rate { text-align: right; font-variant-numeric: tabular-nums; }
.file-list .rate-good {
    color: var(--success);
    font-weight: 600;
}
.file-list .rate-bad {
    color: var(--danger);
    font-weight: 600;
}
.file-list .col-status { font-size: 12.5px; text-align: center; }
.file-list .st-done { color: var(--success); font-weight: 600; }
.file-list .st-err { color: var(--danger); font-weight: 600; }
.file-list .st-skipped { color: var(--text-sub); }
.file-list .st-pending { color: #A2AAB8; }
.file-list .mini-progress {
    width: 80px;
    height: 5px;
    background: #E8EAF0;
    border-radius: 3px;
    overflow: hidden;
}
.file-list .mini-progress .mp-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.12s linear;
}
.file-list .col-action {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
.file-list .col-action .link-btn { font-size: 12px; }
.file-list .col-action .del { color: #A2AAB8; }
.file-list .col-action .del:hover { color: var(--danger); }

/* 汇总统计高亮（与 site.css .result-stats 配合） */
.result-stats .highlight { color: var(--primary) !important; }

/* 文件列表工具页通用空占位 */
.preview-empty-inline {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 36px;
    margin-top: 16px;
    background: var(--bg-page);
    border-radius: var(--radius);
    color: #B7BECB;
    font-size: 13px;
}
.preview-empty-inline svg { width: 38px; height: 38px; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 767.98px) {
    .hero { padding: 60px 0 52px; }
    .hero h1 { font-size: 26px; }
    .search-box button { padding: 9px 18px; }
    .nav-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px 0;
        box-shadow: var(--shadow-md);
    }
    .nav-links.open { display: flex; }
    .nav-links a { display: block; padding: 12px 24px; }
    .nav-toggle { display: block; }
    .section { padding: 48px 0; }
    .plan-price { font-size: 30px; }
    .tool-header { padding: 24px 0 22px; }
    .tool-title h1 { font-size: 21px; }
    .workspace { padding: 24px 0 36px; }
    .preview-grid { flex-direction: column; }
    .pane-body { min-height: 220px; }
    .preview-body { min-height: 220px; }
    .step-list { grid-template-columns: 1fr; }
    .feature-grid { grid-template-columns: 1fr; }
    /* 文件列表移动端 */
    .file-list .list-header { display: none; }
    .file-list .file-row {
        grid-template-columns: 60px 1fr;
        grid-template-areas:
            "thumb main"
            "thumb rate"
            "thumb status";
        gap: 6px 12px;
        padding: 12px;
    }
    .file-list .col-thumb { grid-area: thumb; }
    .file-list .col-name { grid-area: main; font-weight: 600; }
    .file-list .col-name .file-dims { display: none; }
    .file-list .col-size { display: none; }
    .file-list .col-rate { grid-area: rate; text-align: left; font-size: 12.5px; }
    .file-list .col-status { grid-area: status; font-size: 12px; text-align: left; }
    .file-list .col-action {
        grid-column: 1 / -1;
        margin-top: 6px;
        justify-content: flex-start;
    }
    .file-list .mini-progress { width: 100%; max-width: 160px; }
}

/* ============================================================
   图片压缩：弹窗左右对比预览
   ============================================================ */
.ic-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(20, 26, 38, .55);
    backdrop-filter: blur(2px);
}
.ic-dialog {
    width: 100%;
    max-width: 1100px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}
.ic-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}
.ic-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ic-close {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 8px;
    background: var(--bg-page);
    color: var(--text-sub);
    font-size: 14px;
    cursor: pointer;
}
.ic-close:hover { background: var(--border); color: var(--text-main); }

.ic-body {
    display: flex;
    gap: 14px;
    padding: 14px;
    overflow: auto;
}
.ic-pane {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
/* 弹窗内预览图允许更大 */
.ic-pane .preview-body { min-height: 300px; }
.ic-pane .preview-body img { max-height: 62vh; }
.ic-save { color: #2FA36B; margin-left: 6px; }

/* 列表缩略图可点击 */
.file-list .col-thumb.clickable { cursor: zoom-in; }
.file-list .col-thumb.clickable img { transition: transform .18s ease; }
.file-list .col-thumb.clickable:hover img { transform: scale(1.08); }
.file-list .col-thumb.clickable:hover { box-shadow: 0 0 0 2px var(--primary); }

/* 弹窗移动端：左右并排改为上下堆叠 */
@media (max-width: 767.98px) {
    .ic-modal { padding: 12px; }
    .ic-dialog { max-height: 94vh; }
    .ic-body { flex-direction: column; }
    .ic-pane .preview-body { min-height: 200px; }
    .ic-pane .preview-body img { max-height: 38vh; }
}

/* ============================================================
   阴阳师悬赏妖怪图鉴（yys-bounty-yokai 工具）
   ============================================================ */
/* 搜索框：与站点输入控件风格保持一致 */
.search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 520px;
    height: 38px;
    padding: 0 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.search-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 124, 247, 0.12);
}
.search-wrap svg {
    flex-shrink: 0;
    color: #A2AAB8;
}
.search-wrap input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 13.5px;
    color: var(--text-main);
}
.clear-x {
    border: none;
    background: transparent;
    color: #A2AAB8;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
}
.clear-x:hover { color: var(--text-main); }

/* 副本类别筛选 chips */
.chip-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.chip {
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    color: var(--text-sub);
    font-family: inherit;
    font-size: 12.5px;
    cursor: pointer;
    transition: all 0.15s;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
}

/* 左栏：妖怪列表（固定高度内滚动） */
.side-pane { flex: 0 0 300px; height: 620px; }
.list-body { padding: 8px; overflow-y: auto; }
.mon-item {
    display: block;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.mon-item:hover { background: var(--bg-page); }
.mon-item.active {
    background: var(--primary-soft);
    border-color: rgba(74, 124, 247, 0.35);
}
.mi-top { display: flex; align-items: center; gap: 6px; }
.mi-name { font-size: 13.5px; font-weight: 600; color: var(--text-main); }
.mi-tag {
    font-size: 10.5px;
    padding: 1px 6px;
    border-radius: 999px;
    background: #E7F6EE;
    color: #2FA36B;
    white-space: nowrap;
}
.mi-sub { margin-top: 2px; font-size: 11.5px; color: var(--text-sub); }

/* 右栏：出处明细 */
.detail-body { height: 620px; overflow-y: auto; }
.sum-box {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary);
}
.sum-num { font-size: 28px; font-weight: 700; line-height: 1; }
.sum-label { font-size: 13px; }

/* 悬赏线索卡片 */
.clue-box {
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-page);
}
.clue-line + .clue-line { margin-top: 10px; }
.clue-sub { margin-top: 4px; font-size: 12px; color: var(--text-sub); }
.clue-rec { margin-top: 4px; font-size: 12px; color: var(--primary); }
.hint-tag {
    display: inline-block;
    margin: 2px 4px 0 0;
    padding: 1px 7px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: #fff;
    font-size: 11.5px;
    color: var(--text-sub);
}

/* 出处表格 */
.group-title { margin: 16px 0 6px; font-size: 12.5px; font-weight: 600; color: var(--primary); }
.app-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.app-table th {
    padding: 6px 8px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-sub);
    text-align: left;
    white-space: nowrap;
}
.app-table td {
    padding: 7px 8px;
    border-bottom: 1px solid #F1F4F8;
    color: var(--text-main);
}
.app-table tr:hover td { background: #FAFBFD; }
.td-sub { margin-top: 2px; font-size: 11.5px; color: var(--text-sub); }
.num {
    font-weight: 600;
    color: var(--primary);
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* 窄屏：左栏压缩高度、右栏自然高度（双栏堆叠由全局 .preview-grid 规则处理） */
@media (max-width: 767.98px) {
    .side-pane { flex: 1 1 auto; height: 320px; }
    .detail-body { height: auto; }
}

/* ===== GIF 表情包制作 ===== */
/* 编辑区：左侧帧预览 + 右侧字幕段列表 */
.gif-editor {
    display: flex;
    gap: 14px;
    margin-top: 16px;
    /* 两侧卡片等高：默认拉伸，以较高的一侧为准 */
    align-items: stretch;
}
.gif-preview-panel {
    flex: 1 1 340px;
    min-width: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 16px;
    /* 纵向弹性排列：预览区撑满，下方控制器贴底 */
    display: flex;
    flex-direction: column;
}
.gif-preview-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 240px;
    /* 自适应填满剩余空间（内容不足时才拉伸，内容高时正常撑开） */
    flex: 1 1 auto;
    padding: 12px;
    border-radius: 10px;
    /* 棋盘格底：透明区域也能看清，便于判断字幕是否压边 */
    background:
        linear-gradient(45deg, #F1F3F7 25%, transparent 25%) 0 0/16px 16px,
        linear-gradient(-45deg, #F1F3F7 25%, transparent 25%) 0 8px/16px 16px,
        linear-gradient(45deg, transparent 75%, #F1F3F7 75%) 8px -8px/16px 16px,
        linear-gradient(-45deg, transparent 75%, #F1F3F7 75%) -8px 0/16px 16px,
        #FBFCFE;
}
.gif-preview {
    max-width: 100%;
    /* 跟随预览区高度自适应缩放（移动端由下方 300px 规则覆盖） */
    max-height: 100%;
    border-radius: 6px;
    box-shadow: var(--shadow-sm);
    cursor: grab;
    /* 禁用浏览器手势，保证 pointer 拖拽在触屏上可用 */
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}
.gif-preview:active { cursor: grabbing; }
.frame-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}
.frame-bar input[type="range"] { flex: 1; min-width: 0; }
.frame-indicator {
    font-size: 12.5px;
    color: var(--text-sub);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.preview-hint {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-sub);
}

/* 字幕段列表 */
.segment-panel {
    flex: 1 1 380px;
    min-width: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 14px 16px;
}
.segment-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}
.segment-title { font-size: 13px; font-weight: 600; color: var(--text-main); }
.segment-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 440px;
    overflow-y: auto;
    padding-right: 2px;
}
.segment-card {
    /* 两列网格：左列参数、右列九宫格定位，显著压缩卡片高度 */
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 10px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
/* 第 1 行：文本框 + 删除，独占整行 */
.segment-card > .segment-row:nth-child(1) { grid-column: 1 / -1; }
/* 第 2 行：帧范围 / 字号（左列） */
.segment-card > .segment-row:nth-child(2) { grid-column: 1; grid-row: 2; }
/* 第 3 行：颜色 / 描边（左列） */
.segment-card > .segment-row:nth-child(3) { grid-column: 1; grid-row: 3; }
/* 第 4 行：文字位置九宫格（右列，纵向跨左列两行） */
.segment-card > .segment-row:nth-child(4) { grid-column: 2; grid-row: 2 / span 2; }
.segment-card:hover { border-color: #D5DEEE; }
.segment-card.active { border-color: var(--primary); background: var(--primary-soft); }
.segment-row {
    display: flex;
    align-items: center;
    gap: 5px 8px;
    flex-wrap: wrap;
}
.segment-row textarea {
    flex: 1;
    min-width: 120px;
    padding: 5px 7px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    color: var(--text-main);
    font-family: inherit;
    font-size: 12.5px;
    line-height: 1.45;
    resize: vertical;
}
.segment-row input[type="number"] {
    width: 54px;
    padding: 4px 6px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    color: var(--text-main);
    font-size: 12px;
}
.segment-row input[type="color"] {
    width: 30px;
    height: 23px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: none;
    cursor: pointer;
}
.segment-row textarea:focus,
.segment-row input[type="number"]:focus {
    outline: none;
    border-color: var(--primary);
}
.seg-label {
    /* 定宽对齐：各行短标签整齐成列，视觉更利落 */
    display: inline-block;
    min-width: 40px;
    font-size: 11.5px;
    color: var(--text-sub);
    white-space: nowrap;
}
.seg-tilde { color: var(--text-sub); }
.segment-empty {
    padding: 18px 0;
    font-size: 12.5px;
    color: var(--text-sub);
    text-align: center;
}

/* 九宫格文字定位 */
.anchor-group { align-items: center; }
.anchor-grid {
    display: grid;
    grid-template-columns: repeat(3, 20px);
    grid-template-rows: repeat(3, 20px);
    gap: 2px;
}
.anchor-cell {
    width: 20px;
    height: 20px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.anchor-cell:hover { border-color: var(--primary); }
.anchor-cell.active { background: var(--primary); border-color: var(--primary); }

/* 参数面板里的通用标签 / 进度条 / 小按钮 */
.opt-label { font-size: 13px; color: var(--text-sub); white-space: nowrap; }
.opt-value { font-size: 12.5px; font-weight: 600; color: var(--primary); }
.opt-progress { flex-wrap: nowrap; }
.progress-track {
    width: 120px;
    height: 6px;
    border-radius: 3px;
    background: #E9EDF5;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    width: 0;
    border-radius: 3px;
    background: var(--primary);
    transition: width .15s linear;
}
.btn-mini { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.link-btn.del { color: var(--danger); }

@media (max-width: 767.98px) {
    .gif-editor { flex-direction: column; }
    .gif-preview-panel,
    .segment-panel { flex: 1 1 auto; width: 100%; }
    /* 窄屏回落单列堆叠，避免参数被挤压换行（:nth-child(n) 与上方同权重，靠位置靠后生效） */
    .segment-card { grid-template-columns: minmax(0, 1fr); }
    .segment-card > .segment-row:nth-child(n) { grid-column: 1; grid-row: auto; }
    .gif-preview { max-height: 300px; }
    .segment-list { max-height: none; }
}

/* ===== 图片九宫格切割（image-grid-slice） ===== */
/* 参数面板：自定义行列数字输入框 */
.igs-num input[type="number"] {
    width: 56px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text-main);
    font-family: inherit;
    font-size: 13px;
    outline: none;
}
.igs-num input[type="number"]:focus { border-color: var(--primary); }

/* 左栏原图：图片自然撑开完整显示，切割线覆盖层贴合图片实际尺寸 */
.igs-source {
    position: relative;
    display: flex;
    max-width: 100%;
    max-height: 380px;
}
.igs-source img {
    display: block;
    max-width: 100%;
    max-height: 380px;
    width: auto;
    height: auto;
    border-radius: 6px;
}
.igs-lines {
    position: absolute;
    inset: 0;
    display: grid;
    pointer-events: none;
}
.igs-cell {
    border: 1px dashed rgba(255, 255, 255, .85);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18);
}

/* 右栏切片结果网格 */
.igs-pieces {
    display: grid;
    gap: 6px;
    width: 100%;
}
.igs-piece {
    position: relative;
    min-width: 0;
}
.igs-piece img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 5px;
    border: 1px solid var(--border);
}
.igs-piece-idx {
    position: absolute;
    top: 5px;
    left: 5px;
    min-width: 18px;
    padding: 1px 5px;
    border-radius: 9px;
    background: rgba(17, 24, 39, .62);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 16px;
    text-align: center;
}
.igs-piece-dl {
    position: absolute;
    right: 5px;
    bottom: 5px;
    display: none;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    border-radius: 7px;
    background: rgba(17, 24, 39, .62);
    color: #fff;
    cursor: pointer;
}
.igs-piece:hover .igs-piece-dl { display: flex; }
.igs-piece-dl:hover { background: var(--primary); }

@media (max-width: 767.98px) {
    .preview-grid { flex-direction: column; }
    .igs-piece-dl { display: flex; }  /* 触屏无 hover，常显下载按钮 */
}

/* ===== 图片圆角蒙版裁剪（image-mask） ===== */
/* 蒙版 chips 组：去掉 .chip-bar 默认的 margin-top，与参数行对齐 */
.im-masks { flex-wrap: wrap; }
.im-masks .chip-bar { margin-top: 0; }

/* JPEG 背景色选择器外观 */
.im-color input[type='color'] {
    width: 40px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

/* 实时预览批量网格 */
.im-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    margin-top: 16px;
}
.im-item {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.im-thumb {
    position: relative;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: repeating-conic-gradient(#F7F9FC 0% 25%, #fff 0% 50%) 0 0 / 16px 16px;
}
.im-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
/* 加载失败占位 */
.im-broken {
    font-size: 12px;
    color: #B04040;
    padding: 10px;
    text-align: center;
}
.im-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 11.5px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    color: #fff;
}
.im-badge.pending { background: #8A93A5; }
.im-badge.processing { background: #E08A2E; }
.im-badge.done { background: #2FA36B; }
.im-badge.error { background: #D65A5A; }
.im-del {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: rgba(15, 23, 42, .55);
    color: #fff;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.im-del:hover { background: var(--danger); }
.im-meta {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.im-name {
    font-size: 12.5px;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.im-size { font-size: 12px; color: var(--text-sub); }
.im-error {
    font-size: 11.5px;
    color: #B04040;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.im-dl { align-self: flex-start; margin-top: 4px; }

/* ============================================================
   时间戳转换（timestamp 工具）
   ============================================================ */
/* 紧凑型面板体：覆盖 .pane-body 的 340px 最小高度 */
.pane-body.ts-compact { min-height: 0; }

/* 当前时间戳卡片组 */
.ts-cards { display: flex; gap: 16px; }
.ts-card {
    flex: 1;
    background: var(--bg-page);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px 16px 16px;
    text-align: center;
}
.ts-card .label { font-size: 12px; color: var(--text-sub); }
.ts-card .btn {
    padding: 5px 16px;
    font-size: 12.5px;
    border-radius: 8px;
}

/* 复制按钮：结果表内的 copy-mini 原本无样式（仅 pane-head 作用域有定义），统一补齐迷你软色调样式 */
.ts-table .copy-mini {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    font-size: 12.5px;
    color: var(--text-sub);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: color .18s, border-color .18s, background .18s, transform .1s;
}
.ts-table .copy-mini:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-soft);
}
.ts-table .copy-mini:active { transform: scale(.95); }
.ts-card .value {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 26px;
    font-weight: 600;
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
    letter-spacing: .5px;
    margin: 4px 0 12px;
}

/* 转换输入行 */
.ts-toolbar { display: flex; gap: 10px; margin-bottom: 14px; }
.ts-input {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    outline: none;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 14px;
    color: var(--text-main);
    background: #fff;
    transition: border-color .18s, box-shadow .18s;
}
.ts-input:hover { border-color: #D5DCE6; }
.ts-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

/* 结果表：标签列弱化 + 数值列等宽 + 行悬停 */
.ts-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ts-table td { padding: 10px 12px; border-top: 1px solid var(--border); }
.ts-table tr:first-child td { border-top: none; }
.ts-table tr:hover td { background: var(--bg-page); }
.ts-table .lbl { width: 130px; color: var(--text-sub); white-space: nowrap; }
.ts-table .val {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    color: var(--text-main);
    word-break: break-all;
}
.ts-table .act { width: 80px; text-align: right; }

/* 空态提示 */
.ts-empty { padding: 24px 0; text-align: center; color: #B7BECB; font-size: 13px; }

@media (max-width: 767.98px) {
    .ts-cards { flex-direction: column; }
}

/* ===== 二维码生成（/tools/qrcode） ===== */
/* 预览卡片固定 360px 在左，参数面板自适应在右 */
.qr-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 2rem; align-items: start; }
.qr-preview-pane { order: -1; }
.qr-params { display: flex; flex-direction: column; gap: 0.75rem; }
.qr-sec { margin: 0.25rem 0 0; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.05em; color: var(--bs-secondary-color); }
.qr-field { display: flex; flex-direction: column; gap: 0.4rem; }
/* 内容输入框：与全站 .pane-body textarea 同一设计语言 */
.qr-field textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    outline: none;
    resize: vertical;
    min-height: 96px;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-main);
    background: var(--bg-page);
    cursor: text;
    transition: border-color .18s, box-shadow .18s, background .18s;
}
.qr-field textarea::placeholder { color: #9AA3B2; }
.qr-field textarea:hover { border-color: #D5DCE6; }
.qr-field textarea:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px var(--primary-soft);
}
.qr-row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.qr-grow { flex: 1 1 140px; }
.qr-color { width: 2.4rem; height: 2rem; padding: 0; border: none; background: none; cursor: pointer; }
.qr-swap { display: inline-flex; align-items: center; gap: 0.3rem; }
.qr-count { font-size: 0.78rem; color: var(--bs-secondary-color); align-self: flex-end; }
.qr-count.warn { color: #b45309; }
.qr-count.over { color: var(--bs-danger); }
.qr-logo-bar { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.qr-logo-name { font-size: 0.85rem; color: var(--bs-secondary-color); word-break: break-all; }
/* 预览主体强制 1:1 正方形，与二维码宽高比一致 */
.qr-preview-body { display: flex; align-items: center; justify-content: center; padding: 1rem; aspect-ratio: 1 / 1; }
.qr-canvas { max-width: 100%; max-height: 100%; width: auto; height: auto; border-radius: 0.5rem; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12); background: #fff; }
.qr-error { color: var(--bs-danger); font-size: 0.9rem; text-align: center; padding: 1rem; }
.qr-actions { display: flex; gap: 0.5rem; padding: 0.75rem 1rem; border-top: 1px solid var(--bs-border-color); }
.qr-actions .btn { flex: 1; }

@media (max-width: 767.98px) {
    .qr-layout { grid-template-columns: 1fr; }
}

/* ===== PDF 图片互转（/tools/pdf-image） ===== */
.p2i-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.p2i-chip {
    display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px;
    background: #fff; border: 1px solid var(--border); border-radius: 10px; font-size: 13px;
}
.p2i-chip .chip-kind { font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 6px; }
.p2i-chip .chip-kind.img { background: #E7F6EE; color: #2FA36B; }
.p2i-chip .chip-kind.pdf { background: #FDECEC; color: #D65A5A; }
.p2i-chip .chip-name { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p2i-chip .chip-size { color: var(--text-sub); font-size: 12px; }
.p2i-chip .chip-del { border: none; background: none; color: #A2AAB8; cursor: pointer; padding: 0 2px; font-size: 15px; line-height: 1; }
.p2i-chip .chip-del:hover { color: var(--danger); }
.p2i-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-top: 16px; }
.p2i-card {
    background: #fff; border: 1px solid var(--border); border-radius: 12px;
    overflow: hidden; display: flex; flex-direction: column;
}
.p2i-card .card-preview {
    height: 120px; display: flex; align-items: center; justify-content: center;
    background: #F7F8FA; border-bottom: 1px solid var(--border);
}
.p2i-card .card-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.p2i-card .card-preview .pdf-icon { color: #D65A5A; }
.p2i-card .card-meta { padding: 8px 10px; font-size: 12.5px; }
.p2i-card .card-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--text-main); }
.p2i-card .card-sub { display: flex; justify-content: space-between; gap: 8px; color: var(--text-sub); margin-top: 3px; }
.p2i-card .card-dl { margin: 0 10px 10px; }
.btn-vip { background: linear-gradient(135deg, #4A7CF7, #7BA3FF); color: #fff; border: 1px solid transparent; }
.btn-vip:hover { color: #fff; opacity: 0.88; }

/* ===== PDF 合并（pm-） ===== */
.pm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 14px; }
.pm-card {
    position: relative; display: flex; flex-direction: column;
    background: #fff; border: 1px solid var(--border); border-radius: 12px;
    overflow: hidden; cursor: grab; user-select: none;
    transition: border-color .15s, box-shadow .15s, opacity .15s, transform .15s;
}
.pm-card:hover { border-color: var(--primary); box-shadow: 0 4px 14px rgba(74, 124, 247, .10); }
/* 非合并模式：不允许拖拽换位，去掉抓手光标与悬停高亮 */
.pm-card.no-drag { cursor: default; }
.pm-card.no-drag:hover { border-color: var(--border); box-shadow: none; }
/* 拖拽中的视觉反馈：被拖卡片抬起放大高亮，其余卡片变暗 */
.pm-list.dragging-active { cursor: grabbing; }
.pm-list.dragging-active .pm-card:not(.dragging) { opacity: .55; }
.pm-card.dragging {
    opacity: .92; border-style: solid; border-color: var(--primary);
    box-shadow: 0 10px 24px rgba(74, 124, 247, .28);
    transform: scale(1.04) rotate(1.2deg);
    z-index: 5;
}
.pm-thumb {
    position: relative; height: 104px;
    display: flex; align-items: center; justify-content: center;
    background: #F7F8FA; border-bottom: 1px solid var(--border);
}
.pm-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pm-thumb .pdf-icon { color: #D65A5A; }
.pm-thumb .img-icon { color: #2FA36B; }
.pm-order {
    position: absolute; top: 6px; left: 6px;
    width: 20px; height: 20px; border-radius: 50%;
    background: var(--primary-soft); color: #3D6BE0;
    font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.pm-kind { position: absolute; bottom: 6px; left: 6px; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 5px; }
.pm-kind.img { background: #E7F6EE; color: #2FA36B; }
.pm-kind.pdf { background: #FDECEC; color: #D65A5A; }
.pm-del {
    position: absolute; top: 4px; right: 4px;
    width: 20px; height: 20px; border: none; border-radius: 50%;
    background: rgba(43, 52, 69, .45); color: #fff;
    cursor: pointer; font-size: 13px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
}
.pm-del:hover { background: #D65A5A; }
.pm-info { padding: 8px 10px 6px; }
.pm-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 600; color: var(--text-main); }
.pm-meta { display: flex; justify-content: space-between; gap: 6px; color: var(--text-sub); font-size: 11.5px; margin-top: 2px; }
.pm-card .pm-ops { display: flex; border-top: 1px solid var(--border); margin-top: auto; }
.pm-card .pm-ops button {
    flex: 1; border: none; background: none; color: #A2AAB8; cursor: pointer;
    padding: 5px 0; font-size: 12px; display: flex; align-items: center; justify-content: center;
}
.pm-card .pm-ops button + button { border-left: 1px solid var(--border); }
.pm-card .pm-ops button:hover { background: var(--primary-soft); color: var(--primary); }
.pm-card .pm-ops button:disabled { opacity: .3; cursor: default; background: none; color: #A2AAB8; }
.pm-hint { margin-top: 10px; font-size: 12.5px; color: var(--text-sub); }
.pm-result {
    display: flex; align-items: center; gap: 14px; margin-top: 16px; padding: 14px;
    background: #fff; border: 1px solid var(--border); border-radius: 12px;
}
.pm-result .thumb {
    width: 84px; height: 112px; object-fit: cover; flex-shrink: 0;
    border-radius: 6px; border: 1px solid var(--border); background: #fff;
}
.pm-result .pdf-icon { color: #D65A5A; flex-shrink: 0; }
.pm-result-name { font-weight: 600; color: var(--text-main); font-size: 14px; }
.pm-result-sub { color: var(--text-sub); font-size: 12.5px; margin-top: 3px; }

/* ===== 图片批量DPI修改（idpi-，页面挂载点为 image-dpi） ===== */
/* 自定义 DPI 数字输入框 */
.idpi-num input[type="number"] {
    width: 64px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text-main);
    font-family: inherit;
    font-size: 13px;
    outline: none;
}
.idpi-num input[type="number"]:focus { border-color: var(--primary); }

/* 文件列表 */
.idpi-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.idpi-item {
    display: flex; align-items: center; gap: 14px;
    padding: 10px 14px;
    background: #fff; border: 1px solid var(--border); border-radius: 12px;
    transition: border-color .15s, box-shadow .15s;
}
.idpi-item.done { border-color: #C8E9D6; background: #FBFEFC; }
.idpi-item.error { border-color: #F5D4D4; }
.idpi-thumb {
    width: 56px; height: 56px; object-fit: cover; flex-shrink: 0;
    border-radius: 8px; border: 1px solid var(--border); background: #F7F8FA;
}
.idpi-info { flex: 1; min-width: 0; }
.idpi-name { font-weight: 600; font-size: 13.5px; color: var(--text-main); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idpi-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--text-sub); margin-top: 2px; }
.idpi-meta b { color: var(--text-main); font-weight: 600; }
.idpi-kind {
    font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 5px;
    background: var(--primary-soft); color: #3D6BE0; align-self: center;
}
.idpi-badge { color: #1E7A50; font-weight: 600; }
.idpi-ops { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.idpi-del {
    width: 26px; height: 26px; border: none; border-radius: 50%;
    background: none; color: #A2AAB8; cursor: pointer;
    font-size: 16px; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.idpi-del:hover { background: #FDECEC; color: var(--danger); }
@media (max-width: 640px) {
    .idpi-item { flex-wrap: wrap; }
    .idpi-ops { width: 100%; justify-content: flex-end; }
}

/* ===== 图片EXIF批量清理（exc-，页面挂载点为 image-exif-clean） ===== */
.exc-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.exc-item {
    display: flex; align-items: center; gap: 14px;
    padding: 10px 14px;
    background: #fff; border: 1px solid var(--border); border-radius: 12px;
    transition: border-color .15s, background .15s;
}
.exc-item.done { border-color: #C8E9D6; background: #FBFEFC; }
.exc-item.error { border-color: #F5D4D4; }
.exc-thumb {
    width: 56px; height: 56px; object-fit: cover; flex-shrink: 0;
    border-radius: 8px; border: 1px solid var(--border); background: #F7F8FA;
}
.exc-info { flex: 1; min-width: 0; }
.exc-name { font-weight: 600; font-size: 13.5px; color: var(--text-main); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exc-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--text-sub); margin-top: 2px; }
.exc-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.exc-badge {
    font-size: 11px; padding: 1px 7px; border-radius: 9px;
    background: #F1F3F8; color: #6B7280; white-space: nowrap;
}
.exc-badge.warn { background: #FDF3E3; color: #B97A16; }
.exc-badge.ok { background: #E7F6EE; color: #1E7A50; font-weight: 600; }
.exc-badge.sens { background: #FDECEC; color: #D65A5A; font-weight: 600; }
.exc-ops { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.exc-del {
    width: 26px; height: 26px; border: none; border-radius: 50%;
    background: none; color: #A2AAB8; cursor: pointer;
    font-size: 16px; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.exc-del:hover { background: #FDECEC; color: var(--danger); }
@media (max-width: 640px) {
    .exc-item { flex-wrap: wrap; }
    .exc-ops { width: 100%; justify-content: flex-end; }
}

/* ===== 图片局部马赛克（mos-，页面挂载点为 image-mosaic） ===== */
.mos-layout { display: grid; grid-template-columns: 330px 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .mos-layout { grid-template-columns: 1fr; } }

.mos-params {
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px; display: flex; flex-direction: column; gap: 12px;
}
.mos-sec { margin: 4px 0 0; font-size: 13.5px; font-weight: 700; color: var(--text-main); }
.mos-field { display: flex; flex-direction: column; gap: 6px; }

/* 图片缩略图列表 */
.mos-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.mos-thumb {
    width: 56px; height: 56px; padding: 0; overflow: hidden;
    border: 2px solid var(--border); border-radius: 8px; background: #F7F8FA;
    cursor: pointer; transition: border-color .15s;
}
.mos-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mos-thumb.active { border-color: var(--primary); }
.mos-thumb-add {
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: #A2AAB8; border-style: dashed;
}
.mos-thumb-add:hover { color: var(--primary); border-color: var(--primary); }

/* 指定 / 随机样式切换 */
.mos-kind { display: flex; gap: 16px; font-size: 13.5px; color: var(--text-main); }
.mos-kind label { display: flex; align-items: center; gap: 5px; cursor: pointer; }

/* 样式四宫格 */
.mos-mode-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.mos-mode {
    padding: 9px 6px; font-size: 13px; font-weight: 600;
    background: #F7F8FA; border: 1.5px solid var(--border); border-radius: 9px;
    color: var(--text-sub); cursor: pointer; transition: all .15s;
}
.mos-mode:hover { border-color: var(--primary); color: var(--primary); }
.mos-mode.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.mos-mode.disabled { opacity: .45; }

/* 贴图 / 图标 / 表情选择 */
.mos-tile-bar { display: flex; align-items: center; gap: 8px; }
.mos-icon-grid { display: flex; gap: 8px; flex-wrap: wrap; }
.mos-icon {
    width: 38px; height: 38px; padding: 7px;
    border: 1.5px solid var(--border); border-radius: 9px; background: #fff;
    color: #6B7280; cursor: pointer; transition: all .15s;
}
.mos-icon svg { width: 100%; height: 100%; }
.mos-icon:hover { border-color: var(--primary); color: var(--primary); }
.mos-icon.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.mos-emoji-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.mos-emoji {
    width: 36px; height: 36px; font-size: 20px; line-height: 1;
    border: 1.5px solid var(--border); border-radius: 9px; background: #fff;
    cursor: pointer; transition: all .15s;
}
.mos-emoji:hover { border-color: var(--primary); }
.mos-emoji.active { background: var(--primary-soft); border-color: var(--primary); }
.mos-check { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--text-main); cursor: pointer; }

/* 批量固定位置 */
.mos-batch-btn { width: 100%; }
.mos-rect { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.mos-rect label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--text-sub); }
.mos-rect input {
    width: 100%; padding: 5px 6px; font-size: 13px;
    border: 1px solid var(--border); border-radius: 7px;
}

/* 右侧预览区 */
.mos-preview {
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
    padding: 14px; display: flex; flex-direction: column; gap: 12px; min-width: 0;
}
.mos-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mos-tools { display: flex; gap: 8px; }
.mos-brush { flex: 1; max-width: 280px; }
.mos-brush input[type="range"] { flex: 1; width: auto; }

.mos-stage { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.mos-canvas-wrap {
    position: relative; display: inline-block; max-width: 100%;
    align-self: center; line-height: 0;
    border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
    background: var(--primary-soft);
}
.mos-base { max-width: 100%; max-height: 560px; width: auto; height: auto; display: block; }
.mos-overlay {
    position: absolute; inset: 0; width: 100%; height: 100%;
    cursor: crosshair; touch-action: none;
}
.mos-hint { margin: 0; font-size: 12.5px; color: var(--text-sub); text-align: center; }

.mos-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ===== 短视频文案分行断句（ss-，页面挂载点为 subtitle-split） ===== */
/* 原始文案输入框：与全站 textarea 设计语言一致 */
.ss-textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    outline: none;
    resize: vertical;
    min-height: 130px;
    font-family: inherit;
    font-size: 13.5px;
    line-height: 1.9;
    color: var(--text-main);
    background: var(--bg-page);
    cursor: text;
    transition: border-color .18s, box-shadow .18s, background .18s;
}
.ss-textarea::placeholder { color: #9AA3B2; }
.ss-textarea:hover { border-color: #D5DCE6; }
.ss-textarea:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px var(--primary-soft);
}
.ss-input-acts { display: flex; gap: 10px; margin-top: 10px; }

/* 规则面板：紧凑排列数字与标点输入 */
.ss-rules { gap: 10px 16px; }
.ss-num input[type="number"] {
    width: 62px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text-main);
    font-family: inherit;
    font-size: 13px;
    outline: none;
}
.ss-num input[type="number"]:focus { border-color: var(--primary); }
.ss-wide input[type="text"] {
    width: 150px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text-main);
    font-family: inherit;
    font-size: 13px;
    outline: none;
}
.ss-wide input[type="text"]:focus { border-color: var(--primary); }
.opt-check { cursor: pointer; user-select: none; }

/* 分行结果面板：脱离 .preview-grid 容器平级排布，需补齐与导出条的间距 */
.ss-result-pane { margin-top: 16px; }

/* 分组卡片：批量输入按空行分组，每组独立展示 */
.ss-group { margin-bottom: 16px; }
.ss-group:last-child { margin-bottom: 0; }
.ss-group-head {
    display: inline-flex;
    padding: 4px 12px;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #3D6BE0;
    background: var(--primary-soft);
    border-radius: 20px;
}

/* 字幕行：序号 | 时间码 | 文本 | 复制 */
.ss-lines {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.ss-line {
    display: grid;
    grid-template-columns: 36px minmax(128px, auto) 1fr 30px;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-top: 1px solid var(--border);
    transition: background .12s;
}
.ss-line:first-child { border-top: none; }
.ss-line:hover { background: #FAFBFD; }
.ss-line-idx {
    font-size: 11.5px;
    font-weight: 700;
    color: #9AA3B2;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.ss-line-time {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 11.5px;
    color: var(--text-sub);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.ss-line-text { font-size: 14px; line-height: 1.6; color: var(--text-main); word-break: break-word; }
.ss-line-copy {
    width: 24px; height: 24px;
    border: none; border-radius: 6px;
    background: none; color: #C0C7D2;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    opacity: 0;
    transition: all .12s;
}
.ss-line:hover .ss-line-copy { opacity: 1; }
.ss-line-copy:hover { background: var(--primary-soft); color: var(--primary); }
@media (hover: none) {
    .ss-line-copy { opacity: 1; }  /* 触屏无 hover，常显复制按钮 */
}

/* 空态提示 */
.ss-empty {
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    padding: 46px 20px;
    color: #B7BECB; font-size: 13px; text-align: center;
}
.ss-empty svg { width: 44px; height: 44px; }

/* ===== 条形码 / SKU 批量生成（/tools/barcode） ===== */
/* 左右布局：参数面板 360px + 结果区自适应，与 .qr-layout 同构 */
.bc-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 2rem; align-items: start; }
.bc-params { display: flex; flex-direction: column; gap: 0.75rem; }
.bc-sec { margin: 0.25rem 0 0; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.05em; color: var(--bs-secondary-color); }
.bc-field { display: flex; flex-direction: column; gap: 0.4rem; }
/* SKU 输入框：与 .qr-field textarea 同一设计语言 */
.bc-field textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    outline: none;
    resize: vertical;
    min-height: 140px;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-main);
    background: var(--bg-page);
    cursor: text;
    transition: border-color .18s, box-shadow .18s, background .18s;
}
.bc-field textarea::placeholder { color: #9AA3B2; }
.bc-field textarea:hover { border-color: #D5DCE6; }
.bc-field textarea:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px var(--primary-soft);
}
.bc-count { font-size: 0.78rem; color: var(--bs-secondary-color); align-self: flex-end; }
.bc-grow { flex: 1 1 140px; }
.bc-row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.bc-color { width: 2.4rem; height: 2rem; padding: 0; border: none; background: none; cursor: pointer; }
.bc-check { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; color: var(--text-main); cursor: pointer; user-select: none; }

/* 结果卡片网格 */
.bc-preview-body {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    align-content: start;
    padding: 1rem;
    overflow-y: auto;
    max-height: 640px;
}
.bc-card {
    display: flex; flex-direction: column; gap: 0.5rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.75rem;
    transition: border-color .15s, box-shadow .15s;
}
.bc-card:hover { border-color: var(--primary); box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08); }
.bc-card.invalid { background: #FFF8F8; border-color: #F3C8C8; }
.bc-card canvas { max-width: 100%; height: auto; border-radius: 6px; }
.bc-invalid { color: var(--bs-danger); font-size: 0.8rem; line-height: 1.5; min-height: 60px; display: flex; align-items: center; }
.bc-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; border-top: 1px dashed var(--border); padding-top: 0.5rem; }
.bc-sku {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.78rem;
    color: var(--text-sub);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bc-actions { display: flex; gap: 0.5rem; padding: 0.75rem 1rem; border-top: 1px solid var(--bs-border-color); }
.bc-actions .btn { flex: 1; }

@media (max-width: 767.98px) {
    .bc-layout { grid-template-columns: 1fr; }
}

/* ===== Postman 轻量化网页版（/tools/postman，挂载点 app-postman） ===== */
.pm-wrap { display: flex; flex-direction: column; gap: 1rem; }
.pm-note { font-size: 0.8rem; color: var(--bs-secondary-color); text-align: center; }

/* 入场交错淡入 */
.pm-wrap > * { animation: pm-fade-up .4s cubic-bezier(.2, 0, 0, 1) backwards; }
.pm-wrap > *:nth-child(2) { animation-delay: .06s; }
.pm-wrap > *:nth-child(3) { animation-delay: .12s; }
.pm-wrap > *:nth-child(n+4) { animation-delay: .18s; }
@keyframes pm-fade-up { from { opacity: 0; transform: translateY(8px); } }

/* --- 请求地址栏 --- */
.pm-urlbar {
    display: flex; gap: 0.5rem;
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
    padding: 0.6rem 0.75rem; box-shadow: var(--shadow-sm);
}
.pm-method {
    width: 7.5rem; flex-shrink: 0;
    border: 1px solid var(--border); border-radius: 8px;
    padding: 0.45rem 0.5rem; font-weight: 700; font-size: 0.9rem;
    background: #fff; color: var(--text-main); cursor: pointer;
}
/* 方法色彩语义：GET 绿 / POST 蓝 / PUT 橙 / PATCH 紫 / DELETE 红 */
.pm-m-get { color: var(--success); }
.pm-m-post { color: var(--primary); }
.pm-m-put { color: #D97706; }
.pm-m-patch { color: #7C5CFF; }
.pm-m-delete { color: var(--danger); }
.pm-m-head, .pm-m-options { color: var(--text-sub); }
.pm-url {
    flex: 1; min-width: 0;
    border: 1px solid var(--border); border-radius: 8px;
    padding: 0.45rem 0.75rem;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 0.9rem;
    color: var(--text-main); background: #fff;
}
.pm-url:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.pm-send {
    flex-shrink: 0; min-width: 6rem; justify-content: center;
    background: linear-gradient(135deg, var(--primary), #7BA3FF);
    border: none; box-shadow: 0 4px 12px rgba(74, 124, 247, .35);
    transition: transform .15s, box-shadow .15s, filter .15s;
}
.btn-primary.pm-send:hover, .btn-primary.pm-send:focus {
    background: linear-gradient(135deg, var(--primary), #7BA3FF);
    border-color: transparent; color: #fff;
    transform: translateY(-1px); box-shadow: 0 6px 16px rgba(74, 124, 247, .4);
}
.pm-send:active { transform: translateY(0) scale(.97); }

/* --- 通用面板 --- */
.pm-panel {
    background: #fff; border: 1px solid var(--border); border-radius: 12px;
    padding: 0.75rem 1rem; display: flex; flex-direction: column; gap: 0.6rem;
    box-shadow: var(--shadow-sm);
}

/* --- Tabs --- */
.pm-tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; }
.pm-tab {
    position: relative;
    border: none; background: none; padding: 0.3rem 0.75rem;
    font-size: 0.88rem; color: var(--bs-secondary-color); cursor: pointer;
    border-radius: 6px; display: inline-flex; align-items: center; gap: 0.35rem;
    transition: color .2s, background .2s;
}
.pm-tab:hover { background: var(--bs-tertiary-bg); }
.pm-tab.active { color: var(--primary); font-weight: 600; background: none; }
.pm-tab.active::after {
    content: ''; position: absolute; left: .6rem; right: .6rem;
    bottom: calc(-0.5rem - 1px); height: 2px; border-radius: 2px;
    background: var(--primary); animation: pm-underline .25s cubic-bezier(.2, 0, 0, 1);
}
@keyframes pm-underline { from { transform: scaleX(.4); opacity: 0; } }
.pm-count {
    font-size: 0.72rem; line-height: 1; padding: 0.15rem 0.4rem;
    background: var(--bs-tertiary-bg); border-radius: 999px; color: var(--bs-secondary-color);
}
.pm-tab.active .pm-count { background: rgba(74, 124, 247, 0.15); color: var(--primary); }

/* --- 键值对表格 --- */
.pm-kv { width: 100%; border-collapse: collapse; }
.pm-kv th { font-size: 0.78rem; font-weight: 600; color: var(--bs-secondary-color); text-align: left; padding: 0.15rem 0.4rem; }
.pm-kv td { padding: 0.2rem 0.4rem; }
.pm-kv input[type="text"] {
    width: 100%; border: 1px solid var(--border); border-radius: 6px;
    padding: 0.3rem 0.55rem; font-size: 0.85rem;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    color: var(--text-main); background: #fff;
}
.pm-kv input[type="text"]:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.pm-hk { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-weight: 600; width: 35%; }
.pm-rowtype {
    width: 5rem; border: 1px solid var(--border); border-radius: 6px;
    padding: 0.28rem 0.3rem; font-size: 0.8rem; background: #fff; cursor: pointer;
}
.pm-file {
    width: 100%; max-width: 15rem; font-size: 0.78rem; color: var(--text-sub); cursor: pointer;
}
.pm-del {
    border: none; background: none; color: var(--bs-secondary-color);
    font-size: 1.1rem; line-height: 1; cursor: pointer; padding: 0.2rem 0.5rem;
}
.pm-del:hover { color: var(--bs-danger); }
.pm-add {
    align-self: flex-start; border: 1px dashed var(--border); background: none;
    border-radius: 8px; padding: 0.35rem 0.9rem; font-size: 0.85rem;
    color: var(--primary); cursor: pointer;
}
.pm-add:hover { border-color: var(--primary); background: rgba(13, 110, 253, 0.05); }

/* --- Body 编辑 --- */
.pm-body { display: flex; flex-direction: column; gap: 0.6rem; }
.pm-bodytype {
    align-self: flex-start; width: auto;
    border: 1px solid var(--border); border-radius: 8px;
    padding: 0.35rem 0.5rem; font-size: 0.88rem; background: #fff; cursor: pointer;
}
.pm-textarea {
    width: 100%; resize: vertical; min-height: 10rem;
    border: 1px solid var(--border); border-radius: 8px;
    padding: 0.6rem 0.75rem;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 0.85rem;
    color: var(--text-main); background: #fff;
}
.pm-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.pm-hint { font-size: 0.8rem; color: var(--bs-secondary-color); margin: 0; }

/* --- 响应区 --- */
.pm-resp-meta { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.pm-status {
    font-weight: 700; font-size: 0.85rem;
    padding: 0.25rem 0.7rem; border-radius: 999px;
    animation: pm-pulse .45s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes pm-pulse { from { transform: scale(.6); opacity: 0; } }
.pm-st-ok { background: rgba(47, 163, 107, 0.12); color: var(--success); }
.pm-st-warn { background: rgba(217, 119, 6, 0.14); color: #B45309; }
.pm-st-err { background: rgba(214, 90, 90, 0.12); color: var(--danger); }
.pm-meta { font-size: 0.82rem; color: var(--bs-secondary-color); }
.pm-resp-tabs { margin-left: auto; border-bottom: none; }
/* 响应区小 Tab 空间紧凑，保留胶囊底色、不画下划线 */
.pm-resp-tabs .pm-tab.active { background: rgba(74, 124, 247, 0.08); }
.pm-resp-tabs .pm-tab.active::after { display: none; }
.pm-check { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.85rem; cursor: pointer; user-select: none; }
.pm-pre-head { display: flex; justify-content: flex-end; }
.pm-copy {
    border: 1px solid var(--border); background: #fff; border-radius: 6px;
    padding: 0.2rem 0.65rem; font-size: 0.78rem; color: var(--text-sub);
    cursor: pointer; transition: color .15s, border-color .15s, background .15s;
}
.pm-copy:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }

/* 按钮点击波纹（v-ripple 指令生成的 span） */
.pm-ripple {
    position: absolute; border-radius: 50%; pointer-events: none;
    transform: scale(0); opacity: .6;
    animation: pm-ripple .6s cubic-bezier(.2, 0, 0, 1) forwards;
}
.pm-send .pm-ripple { background: rgba(255, 255, 255, .55); }   /* 深底按钮：白色波纹 */
.pm-copy .pm-ripple { background: rgba(74, 124, 247, .3); }     /* 浅底按钮：主色波纹 */
@keyframes pm-ripple { to { transform: scale(2.4); opacity: 0; } }
.pm-error-row {
    background: rgba(214, 90, 90, 0.06); border: 1px solid rgba(214, 90, 90, 0.25);
    border-radius: 8px; padding: 0.5rem 0.75rem;
}
.pm-error { color: var(--danger); font-size: 0.88rem; margin: 0; }
.pm-pre {
    margin: 0; max-height: 26rem; overflow: auto; white-space: pre-wrap; word-break: break-all;
    background: var(--bs-tertiary-bg); border-radius: 8px; padding: 0.75rem 1rem;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 0.82rem;
}
.pm-headers-view td { font-size: 0.82rem; word-break: break-all; }

/* --- 历史记录 --- */
.pm-history { gap: 0.4rem; }
.pm-history-head { display: flex; align-items: center; justify-content: space-between; font-size: 0.9rem; }
.pm-history-head .pm-del { font-size: 0.85rem; }
.pm-hitem {
    display: flex; align-items: center; gap: 0.6rem;
    border: 1px solid var(--border); border-radius: 8px;
    background: #fff; padding: 0.4rem 0.7rem;
    cursor: pointer; text-align: left; font-size: 0.85rem;
    transition: border-color .15s, transform .15s, box-shadow .15s;
}
.pm-hitem:hover { border-color: var(--primary); transform: translateX(3px); box-shadow: var(--shadow-sm); }
.pm-hmethod { font-weight: 700; color: var(--primary); flex-shrink: 0; }
.pm-hdel {
    margin-left: auto; flex-shrink: 0;
    border: none; background: none; color: var(--bs-secondary-color);
    font-size: 1rem; line-height: 1; cursor: pointer; padding: 0.1rem 0.4rem;
}
.pm-hdel:hover { color: var(--danger); }
/* 垃圾桶图标尺寸（替换原文本 ×） */
.pm-del svg, .pm-hdel svg { width: 15px; height: 15px; display: block; }
.pm-hurl {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--text-sub);
}

/* 减动效兜底：跟随系统"减少动态效果"设置 */
@media (prefers-reduced-motion: reduce) {
    .pm-wrap > *, .pm-status, .pm-tab.active::after { animation: none; }
    .pm-send, .pm-hitem, .pm-panel, .pm-copy { transition: none; }
    .pm-ripple { display: none; }
}

/* ===== 图片透视矫正（/tools/perspective-correct） ===== */
/* 角点进度提示：默认灰色，就位后变主题色 */
.pc-progress {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-sub);
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    background: var(--bg-page);
    white-space: nowrap;
}
.pc-progress.done { color: var(--primary); background: var(--primary-soft); }
/* AI 模型下载状态条（复用全局 .model-check / .model-progress-bar / .model-progress-text） */
.pc-model-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    color: var(--text-sub);
    padding: 0.5rem 0.85rem;
    margin-bottom: 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
}
.pc-model-err { color: #e11d48; }
/* 自动尺寸提示文字 */
.pc-size-hint { font-size: 0.82rem; color: var(--text-sub); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* 手动宽高数字输入框 */
.pc-num input[type="number"] {
    width: 84px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 8px;
    outline: none;
    color: var(--text-main);
    background: #fff;
    transition: border-color .15s;
}
.pc-num input[type="number"]:focus { border-color: var(--primary); }
/* 原图画布容器：棋盘格衬托透明预览，画布居中可触控 */
.pc-canvas-body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background-image: conic-gradient(#F1F4F8 25%, transparent 0 50%, #F1F4F8 0 75%, transparent 0);
    background-size: 16px 16px;
}
.pc-canvas {
    max-width: 100%;
    touch-action: none;          /* 拖拽角点时阻止浏览器手势 */
    cursor: crosshair;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border-radius: 6px;
}
/* 矫正结果预览：棋盘格衬托 PNG 透明区域 */
.pc-result {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background-image: conic-gradient(#F1F4F8 25%, transparent 0 50%, #F1F4F8 0 75%, transparent 0);
    background-size: 16px 16px;
}
.pc-result img {
    max-width: 100%;
    max-height: 420px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border-radius: 6px;
}

/* ===== 燕云十六声词条模拟器（/tools/yanyun-affix，ya-） ===== */
/* 顶部提示文字 */
.ya-hint { font-size: 12.5px; color: var(--text-sub); }
/* 部位列表分组小标题 */
.ya-side-title {
    margin: 12px 0 6px;
    font-size: 11.5px;
    font-weight: 700;
    color: #9AA3B2;
    letter-spacing: .05em;
}
.ya-side-title:first-child { margin-top: 0; }
/* 已添加词条行 */
.ya-affix-list { display: flex; flex-direction: column; gap: 8px; }
.ya-affix-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: border-color .15s;
}
.ya-affix-row:hover { border-color: #D5DEEE; }
.ya-affix-name { font-size: 13.5px; font-weight: 600; color: var(--text-main); }
.ya-affix-note { font-size: 12px; color: #B7BECB; cursor: help; }
.ya-affix-val { font-size: 13px; font-weight: 600; color: var(--primary); min-width: 64px; text-align: right; font-variant-numeric: tabular-nums; }
.ya-del {
    width: 24px; height: 24px;
    border: none; border-radius: 7px;
    background: none; color: #C0C7D2;
    font-size: 15px; line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.ya-del:hover { background: #FDECEC; color: var(--danger); }
/* 词条行内数值输入框 */
.ya-input {
    width: 88px;
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #fff;
    color: var(--text-main);
    font-family: inherit;
    font-size: 13px;
    outline: none;
    font-variant-numeric: tabular-nums;
}
.ya-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
/* 词条池 */
.ya-pool-title { margin: 16px 0 8px; font-size: 12.5px; font-weight: 600; color: var(--primary); }
.ya-pool { display: flex; flex-wrap: wrap; gap: 6px; }
.ya-pool .chip:disabled { opacity: .35; cursor: not-allowed; }
/* 下方双面板（面板汇总 + 伤害估算） */
.ya-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; align-items: start; }
@media (max-width: 991.98px) { .ya-bottom { grid-template-columns: 1fr; } }
/* 字段组：标签在上、输入在下的小字段 */
.ya-field-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 767.98px) { .ya-field-grid { grid-template-columns: repeat(2, 1fr); } }
.ya-field { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--text-sub); }
.ya-field .ya-input { width: 100%; }
/* 最终面板网格 */
.ya-stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.ya-stat {
    padding: 9px 12px;
    background: var(--bg-page);
    border: 1px solid var(--border);
    border-radius: 9px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.ya-stat span { font-size: 11.5px; color: var(--text-sub); }
.ya-stat span em { font-style: normal; cursor: help; color: #B7BECB; margin-left: 3px; }
.ya-stat b { font-size: 16px; font-weight: 700; color: var(--text-main); font-variant-numeric: tabular-nums; }
.ya-stat small { font-size: 10.5px; color: #9AA3B2; }
/* 机制预警 */
.ya-hints { margin-top: 12px; display: flex; flex-direction: column; gap: 5px; }
.ya-hint-line {
    font-size: 12px;
    color: #B97A16;
    background: #FDF3E3;
    border-radius: 7px;
    padding: 6px 10px;
}
/* 伤害结果主数字 */
.ya-dmg-hero { display: flex; gap: 12px; margin-top: 14px; }
.ya-dmg-main {
    flex: 1;
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--primary-soft), #F5F8FF);
    border: 1px solid #D8E4FD;
    border-radius: 12px;
    text-align: center;
}
.ya-dmg-num {
    display: block;
    font-size: 26px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}
.ya-dmg-label { font-size: 12px; color: var(--text-sub); }
/* 判定类型配色：会意橙 / 会心黄 / 普通白 / 擦伤灰 */
.ya-type-aff td:first-child { color: #D97B29; font-weight: 600; }
.ya-type-crit td:first-child { color: #C9941A; font-weight: 600; }
.ya-type-normal td:first-child { color: var(--text-main); }
.ya-type-graze td:first-child { color: var(--text-sub); }
.ya-dmg-table { margin-top: 12px; }
/* 公式说明 */
.ya-formula { margin-top: 10px; font-size: 11.5px; line-height: 1.7; color: #9AA3B2; }

/* ============================================================
   证件照制作工具 (.ip-* 前缀)
   ============================================================ */
.ip-container { width: 100%; }

/* 模型选择面板 */
.model-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.model-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}
.model-desc {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-sub);
  margin: 0;
}
.model-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.model-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-main);
  transition: all 0.15s ease;
}
.model-option:hover { border-color: var(--primary, #3b82f6); }
.model-option.active {
  border-color: var(--primary, #3b82f6);
  background: #f0f7ff;
}
.model-label { font-weight: 500; }
.model-size { font-size: 11px; color: var(--text-sub); }
/* 绿色圆形对号 */
.model-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #22c55e;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.model-check svg { width: 11px; height: 11px; }
/* 下载进度 */
.model-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-sub);
}
.model-progress-bar {
  flex: 1;
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
}
.model-progress-fill {
  height: 100%;
  background: var(--primary, #3b82f6);
  border-radius: 3px;
  transition: width 0.2s ease;
}
.model-progress-text { flex-shrink: 0; white-space: nowrap; }
.ip-workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

/* 预览区 */
.ip-preview { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.preview-item { display: flex; flex-direction: column; }
.preview-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-sub);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.preview-box {
  background: #F5F6F8;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 280px;
}
.preview-box.checker {
  background-image:
    linear-gradient(45deg, #ddd 25%, transparent 25%),
    linear-gradient(-45deg, #ddd 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ddd 75%),
    linear-gradient(-45deg, transparent 75%, #ddd 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-color: #fafafa;
}
.preview-img {
  max-width: 100%;
  max-height: 400px;
  object-fit: contain;
  display: block;
}
.preview-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 13px;
  gap: 12px;
}
/* 原图框兼作上传入口 */
.upload-box { cursor: pointer; position: relative; }
.upload-box.is-empty {
  border: 1px dashed var(--border);
  background: #F5F6F8;
}
.upload-box.is-dragover { border-color: var(--primary); background: var(--primary-soft); }
/* 始终悬浮在原图之上的上传交互层 */
.upload-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px;
  text-align: center;
  z-index: 1;
}
/* 有图时默认透明隐藏，hover 浮现提示 */
.upload-box:not(.is-empty) .upload-overlay {
  opacity: 0;
  background: transparent;
  transition: opacity 0.15s ease, background 0.15s ease;
}
.upload-box:not(.is-empty) .upload-overlay:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.65);
}
.upload-overlay .upload-icon {
  width: 40px;
  height: 40px;
  color: var(--primary);
  opacity: 0.5;
  margin-bottom: 4px;
}
.upload-overlay p {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
}
.upload-overlay small {
  font-size: 12px;
  color: var(--text-sub);
}
.badge-done {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(34,197,94,0.1);
  color: #22c55e;
  font-weight: 500;
}
.badge-doing {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(59,130,246,0.1);
  color: #3b82f6;
  font-weight: 500;
}

/* 进度环 */
.progress-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.progress-ring {
  position: relative;
  width: 80px;
  height: 80px;
}
.progress-ring svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}
.progress-bg { fill: none; stroke: #e5e7eb; stroke-width: 3; }
.progress-bar {
  fill: none;
  stroke: var(--primary, #3b82f6);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.2s ease;
}
.progress-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}
.progress-msg { font-size: 12px; color: var(--text-sub); }

/* 控制面板 */
.ip-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 18px;
  align-items: start;
  margin-top: 16px;
}
.panel-section { display: flex; flex-direction: column; gap: 10px; }
.panel-section:first-child { grid-column: 1 / -1; }
.panel-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* 尺寸预设 */
.preset-btn {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  text-align: left;
  transition: all 0.15s ease;
}
.preset-btn:hover { border-color: var(--primary, #3b82f6); background: #f0f7ff; }
.preset-btn.active {
  border-color: var(--primary, #3b82f6);
  background: #e8f2ff;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.18);
}
.preset-name { font-size: 13px; font-weight: 500; color: var(--text-main); }
.preset-btn.active .preset-name {
  color: var(--primary, #3b82f6);
  font-weight: 700;
}
.preset-desc { font-size: 11px; color: var(--text-sub); margin-top: 2px; }
.custom-size { display: flex; flex-direction: column; gap: 6px; }
.custom-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.custom-row label { font-size: 12px; color: var(--text-sub); width: 56px; }
.custom-row input[type="number"] {
  flex: 1;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
}

/* 颜色选择 */
.color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.color-swatch {
  width: 48px;
  height: 36px;
  border: 2px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s ease, border-color 0.1s ease;
}
.color-swatch:hover { transform: scale(1.05); }
.color-swatch.active {
  border-color: var(--primary, #3b82f6);
  box-shadow: 0 0 0 2px rgba(59,130,246,0.2);
}
.color-name {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(255,255,255,0.85);
  color: #333;
}
.color-name.light {
  background: rgba(0,0,0,0.55);
  color: #fff;
}
.color-custom {
  width: 48px;
  height: 36px;
  border: 1px dashed var(--border);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  gap: 2px;
  position: relative;
  overflow: hidden;
}
.color-custom input[type="color"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.color-custom span { font-size: 9px; color: var(--text-sub); pointer-events: none; }

/* 滑块 */
.slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.slider-row label { font-size: 12px; color: var(--text-sub); width: 60px; }
.slider-row input[type="range"] {
  flex: 1;
  height: 4px;
  accent-color: var(--primary, #3b82f6);
}
.slider-val { font-size: 12px; color: var(--primary, #3b82f6); font-weight: 600; width: 36px; text-align: right; }
.slider-hint { font-size: 11px; color: var(--text-muted); }

/* 格式选项 */
.format-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-main);
  transition: all 0.15s ease;
}
.format-option:hover { border-color: var(--primary, #3b82f6); }
.format-option.active {
  border-color: var(--primary, #3b82f6);
  background: #f0f7ff;
}
.format-option input { accent-color: var(--primary, #3b82f6); }

/* 操作按钮 */
.panel-actions {
  display: flex;
  flex-direction: row;
  gap: 8px;
  grid-column: 1 / -1;
}
.panel-actions .btn {
  flex: 1;
  width: auto;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-primary {
  background: var(--primary, #3b82f6);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: #2563eb; }
.btn-success {
  background: #22c55e;
  color: #fff;
}
.btn-success:hover:not(:disabled) { background: #16a34a; }
.btn-outline {
  background: #fff;
  border-color: var(--border);
  color: var(--text-sub);
}
.btn-outline:hover { background: #f9fafb; color: var(--text-main); }

/* 提示 */
.panel-tips {
  padding: 12px;
  background: #FFFBEB;
  border: 1px solid #FCD34D;
  border-radius: 6px;
  font-size: 12px;
  color: #92400E;
  line-height: 1.7;
  grid-column: 1 / -1;
}
.panel-tips ul { margin: 4px 0 0 0; padding-left: 16px; }
.panel-tips li { margin: 0; }

/* 上传区复用全局 .upload-zone（已有样式） */

/* 批量照片列表：任务较多时限高 + 纵向滚动 */
.file-list.ip-list { max-height: 420px; overflow-y: auto; }
/* 表头固定在列表容器顶部，滚动时不被带出 */
.file-list.ip-list .list-header { position: sticky; top: 0; z-index: 1; }
/* 批量照片列表：行可点击切换预览 */
.file-list.ip-list .file-row { cursor: pointer; }
/* 选中照片行高亮（与下方三栏预览联动） */
.file-list.ip-list .file-row.active {
  background: var(--primary-soft);
  box-shadow: inset 3px 0 0 var(--primary), inset 0 0 0 1px rgba(74, 124, 247, .35);
}
/* 选中行的人物缩略图加主色边框高亮，选中一眼可见 */
.file-list.ip-list .file-row.active .col-thumb {
  box-shadow: 0 0 0 2px var(--primary);
}

/* 响应式 */
@media (max-width: 860px) {
  .ip-workspace { grid-template-columns: 1fr; }
  .ip-panel { position: static; grid-template-columns: 1fr; }
  .panel-actions { flex-direction: column; }
  .panel-actions .btn { flex: none; width: 100%; }
}

/* ===== 字幕翻译校对（st-，页面挂载点为 subtitle-translate） ===== */
/* 编辑列表：白底圆角卡片，表头 + 可编辑行 */
.st-list {
    margin-top: 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.st-head,
.st-item {
    display: grid;
    grid-template-columns: 36px 132px 132px minmax(0, 1fr) 36px;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
}
.st-head {
    background: #FAFBFD;
    border-bottom: 1px solid var(--border);
    font-size: 11.5px;
    font-weight: 600;
    color: #9AA3B2;
}
.st-item { border-top: 1px solid var(--border); }
.st-head + .st-item { border-top: none; }
.st-idx {
    font-size: 11.5px;
    font-weight: 700;
    color: #9AA3B2;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.st-time {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text-main);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 12px;
    text-align: center;
    outline: none;
    font-variant-numeric: tabular-nums;
}
.st-time:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.st-text {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 7px 10px;
    background: #fff;
    color: var(--text-main);
    font-family: inherit;
    font-size: 13.5px;
    line-height: 1.5;
    outline: none;
    resize: none;
    min-height: 34px;
}
.st-text:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.st-del {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 6px;
    background: none;
    color: #C0C7D2;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .12s;
}
.st-del:hover { background: #FEE2E2; color: #DC2626; }

/* 空态提示 */
.st-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding: 46px 20px;
    color: #B7BECB;
    font-size: 13px;
    text-align: center;
    border: 1px dashed var(--border);
    border-radius: 10px;
}
.st-empty svg { width: 44px; height: 44px; }

/* ===== 单位换算（uc-，页面挂载点为 unit-convert） ===== */
.uc-input {
    width: 100%;
    font-size: 22px;
    font-weight: 600;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
    background: #fff;
    color: var(--text-main);
}
.uc-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

.uc-select {
    font-family: inherit;
    font-size: 14px;
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    background: #fff;
    outline: none;
    cursor: pointer;
    min-width: 0;
}
.uc-select:focus { border-color: var(--primary); }

.uc-category { display: flex; flex-wrap: wrap; gap: 8px; }
.uc-cat-radio {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-main);
    transition: all .15s ease;
}
.uc-cat-radio:hover { border-color: var(--primary); }
.uc-cat-radio.active { border-color: var(--primary); background: #f0f7ff; }
.uc-check {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #22c55e;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.uc-check svg { width: 11px; height: 11px; }

.uc-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.uc-row { display: flex; align-items: center; gap: 10px; }
.uc-row .uc-select { flex: 1; }
.uc-swap { flex: none; padding: 8px 12px; }

.uc-result {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    background: var(--bg-page);
    text-align: center;
}
.uc-result-value { font-size: 30px; font-weight: 700; color: var(--primary); line-height: 1.1; word-break: break-all; }
.uc-result-symbol { font-size: 18px; font-weight: 600; }
.uc-result-sub { font-size: 13px; color: var(--text-sub); margin-top: 6px; }

.uc-copy { width: 100%; }

.uc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 16px; }
.uc-cell { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--bg-page); }
.uc-cell.active { border-color: var(--primary); background: var(--primary-soft); }
.uc-cell-name { font-size: 12px; color: var(--text-sub); }
.uc-cell-symbol { color: #9AA3B2; }
.uc-cell-value { font-size: 16px; font-weight: 600; margin-top: 2px; word-break: break-all; }

@media (max-width: 575.98px) {
    .uc-grid { grid-template-columns: 1fr; }
}
