/* 图片工具箱（功能台）样式
   延续全站深灰底 + 778px 白色内容块，配色跟 member.css 的按钮蓝保持一致 */

/* ---------- 分组标题 ---------- */
.tb-group {
    font-size: 15px;
    color: #0f172a;
    font-weight: bold;
    margin: 24px 0 10px;
    padding-left: 9px;
    border-left: 3px solid #2563eb;
    line-height: 1.2;
}
.tb-group span {
    display: block;
    font-weight: normal;
    font-size: 11.5px;
    color: #94a3b8;
    margin-top: 4px;
    padding-left: 1px;
}

/* ---------- 工具卡片 ---------- */
.tb-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.tb-card {
    display: block;
    padding: 13px 14px 14px;
    border: 1px solid #c6d3e3;
    border-radius: 8px;
    background: #ffffff;
    text-decoration: none;
    color: #1e293b;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
    transition: border-color .15s, box-shadow .15s;
}
.tb-card:hover {
    border-color: #bfdbfe;
    box-shadow: 0 3px 10px rgba(37, 99, 235, .10);
    text-decoration: none;
    color: #1e293b;
}

.tb-glyph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 9px;
}

.tb-card-name {
    display: block;
    font-size: 14px;
    font-weight: bold;
    color: #0f172a;
    margin-bottom: 5px;
}

.tb-card-desc {
    display: block;
    font-size: 11.5px;
    color: #64748b;
    line-height: 1.7;
}

/* ---------- 说明块 ---------- */
.tb-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.tb-note {
    border-radius: 8px;
    padding: 13px 15px;
    font-size: 12px;
    line-height: 1.75;
    color: #475569;
}
.tb-note b {
    display: block;
    margin-bottom: 6px;
    font-size: 12.5px;
}
.tb-note ul {
    margin: 0;
    padding-left: 16px;
}
.tb-note li {
    margin-bottom: 4px;
}
.tb-note-ok {
    background: #dcfce7;
    border: 1px solid #bbf7d0;
}
.tb-note-ok b { color: #15803d; }
.tb-note-no {
    background: #fef2f2;
    border: 1px solid #fecaca;
}
.tb-note-no b { color: #b91c1c; }
.tb-note-tip {
    margin-top: 14px;
    background: #fffbeb;
    border: 1px solid #fde68a;
}
.tb-note-tip b { color: #b45309; }

/* 使用说明块（给用户看的操作指引，不是技术说明） */
.tb-note-guide {
    margin-bottom: 10px;
    background: #eff6ff;
    border: 1px solid #c6d3e3;
}
.tb-note-guide b { color: #1e40af; }
.tb-note-guide li b { color: #1e293b; }
.tb-note code {
    background: #ffffff;
    border: 1px solid #c6d3e3;
    border-radius: 3px;
    padding: 0 4px;
    font-size: 11px;
    color: #334155;
}

/* ---------- 鼠标框选器（裁剪 / 打码 / 调尺寸） ---------- */
.tb-picker {
    margin: 0 0 16px;
    padding: 12px 14px 14px;
    border: 1px solid #c6d3e3;
    border-radius: 8px;
    background: #eff6ff;
}

.tb-picker-tip {
    font-size: 12px;
    color: #1e40af;
    line-height: 1.7;
    margin-bottom: 8px;
}

.tb-picker-empty {
    border: 1px dashed #bfcbdb;
    border-radius: 6px;
    background: #ffffff;
    color: #94a3b8;
    font-size: 12px;
    text-align: center;
    padding: 26px 10px;
}

.tb-picker-stage {
    position: relative;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    background: #f2f5f9;
    line-height: 0;
    cursor: crosshair;
    -webkit-user-select: none;
    user-select: none;
}

.tb-picker-stage img {
    display: block;
    pointer-events: none;
}

.tb-box {
    position: absolute;
    left: 0;
    top: 0;
    box-sizing: border-box;
    border: 1px solid #2563eb;
    outline: 1px solid rgba(255, 255, 255, .75);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, .42);
    cursor: move;
}

.tb-box-tag {
    position: absolute;
    left: 0;
    top: 0;
    display: inline-block;
    padding: 1px 6px;
    background: #2563eb;
    color: #ffffff;
    font-size: 11px;
    font-weight: normal;
    line-height: 18px;
    border-radius: 0 0 3px 0;
    white-space: nowrap;
    pointer-events: none;
    z-index: 1;
}

/* 手柄压在框内侧，保证框贴到画布边缘时也点得到 */
.tb-h {
    position: absolute;
    display: block;
    width: 10px;
    height: 10px;
    margin: -5px 0 0 -5px;
    background: #ffffff;
    border: 1px solid #2563eb;
    border-radius: 2px;
    z-index: 3;
}
.tb-h-nw { left: 6px; top: 6px; cursor: nw-resize; }
.tb-h-n  { left: 50%; top: 6px; cursor: n-resize; }
.tb-h-ne { left: calc(100% - 6px); top: 6px; cursor: ne-resize; }
.tb-h-w  { left: 6px; top: 50%; cursor: w-resize; }
.tb-h-e  { left: calc(100% - 6px); top: 50%; cursor: e-resize; }
.tb-h-sw { left: 6px; top: calc(100% - 6px); cursor: sw-resize; }
.tb-h-s  { left: 50%; top: calc(100% - 6px); cursor: s-resize; }
.tb-h-se { left: calc(100% - 6px); top: calc(100% - 6px); cursor: se-resize; }

.tb-picker-read {
    margin-top: 9px;
    font-size: 12px;
    color: #334155;
    line-height: 1.7;
}
.tb-picker-read b { color: #1d4ed8; }

.tb-picker-hint {
    margin-top: 4px;
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.65;
}

/* ---------- 加水印预览 ---------- */
.tb-wm-box {
    border: 1px dashed #2563eb;
    box-shadow: none;
    background: rgba(37, 99, 235, .08);
    cursor: move;
}
.tb-wm-preview {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: normal;
    overflow: hidden;
    pointer-events: none;
}
.tb-wm-preview img { display: block; }
.tb-wm-preview span {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    white-space: pre;
}
.tb-wm-placeholder {
    font-size: 11px;
    color: #64748b;
    background: #ffffff;
    border: 1px dashed #bfcbdb;
    padding: 2px 6px;
}
.tb-wm-stage { background: #334155; }

/* ---------- 边框预览 ---------- */
.tb-bd-stage {
    background: #f2f5f9;
    box-shadow: inset 0 0 0 1px #bfcbdb;
}
.tb-bd-stage img {
    position: absolute;
}
.tb-bd-band {
    position: absolute;
    display: none;
    box-sizing: border-box;
    border: 0 solid #ffffff;
    border-style: solid;
    pointer-events: none;
    z-index: 2;
}
.tb-bd-content {
    position: absolute;
    box-sizing: border-box;
    border: 1px dashed #2563eb;
    z-index: 3;
}
.tb-bd-h { background: rgba(37, 99, 235, .95); border-color: #ffffff; }
.tb-bd-h-n { left: 50%; top: 0; cursor: ns-resize; }
.tb-bd-h-s { left: 50%; top: 100%; cursor: ns-resize; }
.tb-bd-h-w { left: 0; top: 50%; cursor: ew-resize; }
.tb-bd-h-e { left: 100%; top: 50%; cursor: ew-resize; }

/* ---------- 圆角预览 ---------- */
.tb-rd-stage { background: #c6d3e3; line-height: 0; }
.tb-rd-clip {
    position: absolute;
    left: 0;
    top: 0;
    overflow: hidden;
    background: #ffffff;
}
.tb-rd-clip img {
    display: block;
    width: 100%;
    height: 100%;
}
.tb-rd-knob {
    position: absolute;
    display: block;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #2563eb;
    cursor: nw-resize;
    z-index: 4;
}

/* ---------- 切图网格 ---------- */
.tb-sp-stage { line-height: 0; }
.tb-sp-grid {
    position: absolute;
    left: 0;
    top: 0;
    pointer-events: none;
}

/* ---------- 表单 ---------- */
.tb-back {
    font-size: 12px;
    color: #94a3b8;
    margin: 0 0 12px;
}
.tb-back a { color: #2563eb; text-decoration: none; }
.tb-back a:hover { text-decoration: underline; }

.tb-form { max-width: 660px; }

.tb-upload {
    border: 1px dashed #bfcbdb;
    border-radius: 8px;
    background: #f8fafc;
    padding: 14px 16px;
    margin-bottom: 14px;
    text-align: left;
}
.tb-upload-sub {
    background: #ffffff;
    margin-top: -4px;
}
.tb-upload-label {
    font-size: 13px;
    color: #1e293b;
    font-weight: bold;
    margin-bottom: 8px;
}
.tb-file {
    font-size: 12.5px;
    color: #475569;
}

.tb-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 18px;
}

.tb-field label {
    display: block;
    font-size: 12.5px;
    color: #334155;
    margin-bottom: 5px;
}

.tb-input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid #bfcbdb;
    border-radius: 6px;
    background: #ffffff;
    font-size: 13px;
    color: #0f172a;
    font-family: inherit;
    outline: none;
}
.tb-input:focus { border-color: #3b82f6; }

/* 多行输入（条码批量数据） */
.tb-textarea {
    min-height: 132px;
    line-height: 1.6;
    resize: vertical;
    font-family: Consolas, Menlo, "Courier New", monospace;
    white-space: pre;
    overflow: auto;
}

.tb-color {
    width: 52px;
    height: 32px;
    padding: 0;
    border: 1px solid #bfcbdb;
    border-radius: 6px;
    background: #ffffff;
    cursor: pointer;
}

.tb-field-check label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: #334155;
}
.tb-field-check input { margin: 0; }

.tb-hint {
    font-size: 11.5px;
    color: #94a3b8;
    line-height: 1.65;
    margin-top: 5px;
}
.tb-note-inline {
    margin: 10px 0 0;
    color: #b45309;
}

.tb-actions {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f2f5f9;
}
.tb-actions .mf-btn { border: 0; }
.tb-actions .mf-btn-ghost { border: 1px solid #c6d3e3; }
.tb-actions input[disabled] { background: #94a3b8; cursor: not-allowed; }

/* ---------- 结果页 ---------- */
.tb-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 4px 0 16px;
}
.tb-stat {
    flex: 0 1 auto;
    min-width: 110px;
    background: #f8fafc;
    border: 1px solid #c6d3e3;
    border-radius: 8px;
    padding: 10px 16px;
    text-align: left;
}
.tb-stat b {
    display: block;
    font-size: 18px;
    color: #0f172a;
}
.tb-stat span {
    font-size: 11.5px;
    color: #64748b;
}

.tb-res {
    width: 100%;
    border-collapse: collapse;
    margin-top: 6px;
}
.tb-res th {
    background: #f8fafc;
    border-bottom: 1px solid #c6d3e3;
    padding: 8px;
    font-size: 11.5px;
    color: #475569;
    text-align: left;
    font-weight: normal;
}
.tb-res td {
    border-bottom: 1px solid #f2f5f9;
    padding: 9px 8px;
    font-size: 12.5px;
    color: #334155;
    vertical-align: middle;
}
.tb-res td.tb-thumb { width: 108px; }
.tb-thumb img {
    max-width: 96px;
    max-height: 72px;
    border: 1px solid #c6d3e3;
    border-radius: 4px;
    background: #f8fafc;
    padding: 2px;
}
.tb-name {
    word-break: break-all;
}
.tb-row-note {
    display: block;
    font-size: 11px;
    color: #b45309;
    margin-top: 3px;
}

@media (max-width: 640px) {
    .tb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tb-two { grid-template-columns: 1fr; }
    .tb-fields { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
    .tb-grid { grid-template-columns: 1fr; }
}

/* ================================================================== *
 * 吸管取色页（toolbox_eyedropper.js 配合使用）
 * 布局：左边画布、右边色值面板；窄屏改成上下排。
 * ================================================================== */

.oyo {
    margin: 18px 0 6px;
}

.oyo-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 218px;
    gap: 16px;
    align-items: start;
}

.oyo-stage {
    position: relative;
    background: #f2f4f7;
    border: 1px solid #c6d3e3;
    border-radius: 6px;
    padding: 8px;
    text-align: center;
    min-height: 160px;
}

.oyo-canvas {
    display: block;
    max-width: 100%;
    max-height: 66vh;
    margin: 0 auto;
    cursor: crosshair;
    image-rendering: pixelated;
    background: #fff;
}

.oyo-loading {
    position: absolute;
    left: 0;
    right: 0;
    top: 46%;
    color: #6b7280;
    font-size: 13px;
}

.oyo-side {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.oyo-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #c6d3e3;
    border-radius: 6px;
    padding: 10px;
    background: #fff;
}

.oyo-swatch {
    width: 52px;
    height: 52px;
    border-radius: 4px;
    border: 1px solid #d5dde8;
    background: #ffffff;
    flex: 0 0 auto;
}

.oyo-hex {
    font-family: Consolas, Menlo, monospace;
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    letter-spacing: 0.5px;
    word-break: break-all;
}

.oyo-lens-wrap {
    position: relative;
    align-self: center;
    padding: 6px;
    border: 1px solid #c6d3e3;
    border-radius: 6px;
    background: #fff;
    line-height: 0;
}

.oyo-lens {
    display: block;
    width: 132px;
    height: 132px;
    image-rendering: pixelated;
    background: #f2f4f7;
    cursor: crosshair;
}

.oyo-lens-tip {
    position: absolute;
    right: 10px;
    bottom: 8px;
    font-size: 11px;
    color: #6b7280;
    background: rgba(255, 255, 255, 0.86);
    padding: 0 4px;
    border-radius: 3px;
    line-height: 1.6;
}

.oyo-vals {
    margin: 0;
    border: 1px solid #c6d3e3;
    border-radius: 6px;
    padding: 8px 10px;
    background: #fff;
    font-size: 13px;
}

.oyo-vals dt {
    color: #6b7280;
    font-size: 12px;
    margin-top: 4px;
}

.oyo-vals dt:first-child {
    margin-top: 0;
}

.oyo-vals dd {
    margin: 0;
    font-family: Consolas, Menlo, monospace;
    font-size: 12px;
    color: #1f2937;
    word-break: break-all;
}

.oyo-tip {
    margin: 0;
    font-size: 12px;
    color: #b45309;
    line-height: 1.6;
}

.oyo-hist {
    margin-top: 16px;
    border-top: 1px dashed #d5dde8;
    padding-top: 12px;
}

.oyo-hist-title {
    font-size: 13px;
    color: #374151;
    margin-bottom: 8px;
}

.oyo-hist-tip {
    color: #9ca3af;
    font-size: 12px;
}

.oyo-hist-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.oyo-hist-empty {
    font-size: 12px;
    color: #9ca3af;
}

.oyo-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #c6d3e3;
    border-radius: 14px;
    padding: 3px 10px 3px 4px;
    background: #fff;
    cursor: pointer;
    font-family: Consolas, Menlo, monospace;
    font-size: 12px;
    color: #1f2937;
}

.oyo-chip:hover {
    border-color: #2f6fed;
    background: #f5f8ff;
}

.oyo-chip-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid #d5dde8;
    flex: 0 0 auto;
}

@media (max-width: 720px) {
    .oyo-main {
        grid-template-columns: minmax(0, 1fr);
    }

    .oyo-side {
        display: grid;
        grid-template-columns: 156px minmax(0, 1fr);
        gap: 10px;
        align-items: start;
    }

    .oyo-lens-wrap {
        justify-self: start;
    }

    .oyo-tip {
        grid-column: 1 / -1;
    }
}

/* ================================================================== *
 * 实时预览（滤镜特效 8 个工具，toolbox_live.js 配合使用）
 * ================================================================== */

.tb-live {
    margin: 16px 0 4px;
    border: 1px solid #c6d3e3;
    border-radius: 6px;
    background: #f7f9fc;
    padding: 10px 12px 12px;
}

.tb-live-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 8px;
}

.tb-live-head b {
    font-size: 14px;
    color: #1f2937;
}

.tb-live-state {
    font-size: 12px;
    color: #6b7280;
}

.tb-live[data-state="busy"] .tb-live-state {
    color: #2f6fed;
}

.tb-live[data-state="err"] .tb-live-state {
    color: #b91c1c;
}

.tb-live-stage {
    position: relative;
    min-height: 120px;
    border: 1px solid #dbe3ee;
    border-radius: 5px;
    background: #fff;
    text-align: center;
    padding: 8px;
    overflow: hidden;
}

.tb-live-stage img {
    display: none;
    max-width: 100%;
    max-height: 62vh;
    margin: 0 auto;
    vertical-align: middle;
}

.tb-live-stage.is-loading::after {
    content: "正在算效果…";
    position: absolute;
    right: 10px;
    top: 8px;
    font-size: 12px;
    color: #2f6fed;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    padding: 2px 6px;
}

.tb-live-meta {
    margin-top: 8px;
    font-size: 12px;
    color: #4b5563;
    font-family: Consolas, Menlo, monospace;
    word-break: break-all;
}

.tb-live-actions[hidden] {
    display: none;
}

.tb-live-actions {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.tb-live-tip {
    font-size: 12px;
    color: #b45309;
}

@media (max-width: 640px) {
    .tb-live-stage img {
        max-height: 46vh;
    }
}

/* ================================================================== *
 * 移动端（768 及以下）
 * 上面各段已有的 640 / 420 / 720 断点继续生效，这里补 768 这一档：
 * 手机竖屏（375–430）大多同时命中 640 与 420 两档，本档负责
 *   · 工具页表单不再限宽 660、输入框满宽、按钮 44px 高
 *   · 工具箱首页在 768 就排两列（三列在手机上字太小）
 *   · 结果表的缩略图列收窄，表格允许横向滚动而不是撑破屏幕
 *   · 实时预览的按钮条在手机上整行排开
 * ================================================================== */
@media (max-width: 768px) {
    .tb-wrap, .tb-form { max-width: none; }

    /* 工具卡片：768 就两列，420 以下沿用上面的单列 */
    .tb-grid { gap: 9px; }
    .tb-card { padding: 11px 12px 12px; }

    /* 表单控件：16px 起 iOS 聚焦不会放大页面；高度按手指来 */
    .tb-form input[type="text"],
    .tb-form input[type="number"],
    .tb-form input[type="password"],
    .tb-form select,
    .tb-form textarea { font-size: 16px; }
    .tb-form input[type="number"],
    .tb-form select { min-height: 44px; }
    .tb-form textarea { min-height: 96px; }

    /* 提交/下载/返回这类按钮：一行一个或两个，别挤成小字 */
    .tb-form input[type="submit"],
    .tb-form button,
    .tb-actions .tb-btn,
    .tb-live-actions .tb-btn { min-height: 44px; font-size: 15px; }
    .tb-actions, .tb-live-actions { flex-wrap: wrap; }
    .tb-actions .tb-btn, .tb-live-actions .tb-btn { flex: 1 1 auto; }

    /* 结果区：缩略图列收窄，整块允许横向滚动 */
    .tb-res { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .tb-res td.tb-thumb { width: 76px; }
    .tb-res img { max-width: 68px; }

    /* 实时预览：图高再压一点，手机上别占满屏 */
    .tb-live { padding: 9px 10px 10px; }
    .tb-live-stage img { max-height: 40vh; }

    /* 拖框组件（裁剪/打码/边框/水印）：舞台满宽，说明文字缩小 */
    .tb-picker { margin: 12px 0 4px; }
    .tb-box-tag { font-size: 11px; }

    /* 吸管取色：窄屏已经改成上下排，这里只是把色块间距调密 */
    .oyo-stage { padding: 6px; }
    .oyo-chips { gap: 6px; }

    /* 长地址、长文件名不许撑破页面 */
    .tb-wrap { overflow-wrap: break-word; word-break: break-word; }
}
