/*
 * 在线工具公共样式（表单 / 按钮 / 布局约定）
 * ============================================================================
 * 版权所有 (C) 西安尊云信息科技有限公司，并保留所有权利。
 * 网站地址: http://www.zunyunkeji.com
 * ----------------------------------------------------------------------------
 * 许可声明：未经许可不得将本软件的整体或任何部分用于商业用途及再发布。
 * ============================================================================
 * Author: 缘境 (yvsm@zunyunkeji.com) QQ:316430983 微信：yvsm316
 *
 * 约定：
 * - 控件统一高度 40px（.tool-btn-sm / .tool-mini-btn 为 32px）
 * - 工具页按钮请使用 .btn / .m-btn，复制等次要操作用 .tool-btn-sm
 * - 输入用 .tool-input / .tool-select / .tool-textarea，避免各自再写高度
*/
:root {
    --tool-ctrl-h: 40px;
    --tool-ctrl-h-sm: 32px;
    --tool-ctrl-radius: 8px;
    --tool-ctrl-border: #d5e0ef;
    --tool-ctrl-bg: #fff;
    --tool-ctrl-color: #1e293b;
    --tool-ctrl-font: 13px;
    --tool-gap: 10px;
    --tool-blue: #2563eb;
    --tool-blue-hover: #1d4ed8;
    --tool-line: #d9e3f1;
    --tool-muted: #64748b;
    --tool-panel-bg: #fff;
    --tool-soft-bg: #f8fbff;
}

/* ---------- 隐私提示 / 特性 / SEO / FAQ ---------- */
.tool-privacy-note {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    padding: 8px 14px;
    border: 1px solid #c9dbf7;
    border-radius: 999px;
    background: #f3f7ff;
    color: var(--tool-blue);
    font-size: 13px;
    font-weight: 600;
}
.tool-feature-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 8px;
}
.tool-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--tool-line);
    border-radius: 10px;
    background: #fff;
}
.tool-feature-item i { flex-shrink: 0; margin-top: 3px; color: var(--tool-blue); }
.tool-feature-item p {
    margin: 0;
    min-width: 0;
    color: #52627a;
    font-size: 14px;
    line-height: 1.7;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.tool-seo-block {
    margin-top: 22px;
    padding: 24px 26px;
    border: 1px solid var(--tool-line);
    border-radius: 12px;
    background: #fff;
}
.tool-seo-block h2 { margin: 0 0 12px; color: #1c2f4c; font-size: 20px; }
.tool-seo-block h2::after { display: none; }
.tool-seo-block p { margin: 0; color: #61728a; font-size: 15px; line-height: 1.9; }
.tool-seo-block p + p,
.tool-seo-block p + ul,
.tool-seo-block ul + p { margin-top: 12px; }
.tool-seo-block code,
.tool-faq-item code {
    padding: 1px 6px;
    border-radius: 4px;
    background: #eef3fb;
    color: #1d4ed8;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.92em;
}
.tool-intro-list {
    margin: 0;
    padding-left: 1.2em;
    color: #61728a;
    font-size: 15px;
    line-height: 1.9;
}
.tool-intro-list li + li { margin-top: 6px; }
.tool-faq-list { display: grid; gap: 10px; }
.tool-faq-item {
    border: 1px solid #e5edf7;
    border-radius: 10px;
    background: var(--tool-soft-bg);
    overflow: hidden;
}
.tool-faq-item summary {
    cursor: pointer;
    list-style: none;
    padding: 14px 16px;
    color: #1c2f4c;
    font-size: 15px;
    font-weight: 650;
    user-select: none;
}
.tool-faq-item summary::-webkit-details-marker { display: none; }
.tool-faq-item summary::before {
    content: '+';
    display: inline-block;
    width: 1.1em;
    margin-right: 8px;
    color: var(--tool-blue);
    font-weight: 700;
}
.tool-faq-item[open] summary::before { content: '−'; }
.tool-faq-item p {
    margin: 0;
    padding: 0 16px 14px 16px;
    color: #61728a;
    font-size: 14px;
    line-height: 1.85;
}

/* ---------- 面板 / 工具条 ---------- */
.tool-panel {
    margin-bottom: 18px;
    padding: 22px;
    border: 1px solid var(--tool-line);
    border-radius: 12px;
    background: var(--tool-panel-bg);
}
.tool-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 14px;
    margin-bottom: 14px;
}
.tool-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}
.tool-field {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #334155;
    font-size: 14px;
}
.tool-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #475569;
    font-size: 14px;
}
.tool-check input { width: 16px; height: 16px; }
.tool-label {
    display: block;
    margin-bottom: 8px;
    color: #334155;
    font-size: 13px;
    font-weight: 650;
}
.tool-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 650;
    background: #f1f5f9;
    color: var(--tool-muted);
}
.tool-status.is-ok { background: #ecfdf5; color: #047857; }
.tool-status.is-err { background: #fef2f2; color: #b91c1c; }
.tool-status.is-idle { background: #f1f5f9; color: var(--tool-muted); }

/* ---------- 表单控件（统一高度） ---------- */
.tool-input,
.tool-select,
.tool-field select,
.tool-toolbar select,
.tool-toolbar input[type="text"],
.tool-toolbar input[type="number"],
.tool-toolbar input[type="datetime-local"],
.tool-panel select,
.tool-panel input[type="text"],
.tool-panel input[type="number"],
.tool-panel input[type="password"],
.tool-panel input[type="search"],
.tool-panel input[type="url"],
.tool-panel input[type="datetime-local"],
.tool-panel input[type="email"],
.tool-json-panel select,
.tool-json-panel input[type="text"],
.tool-ws-panel select,
.tool-ws-panel input[type="text"],
.tool-ws-panel input[type="number"],
.tool-http-panel select,
.tool-http-panel input[type="text"],
.tool-http-panel input[type="number"],
.tool-http-panel input[type="password"],
.tool-diff-toolbar select {
    box-sizing: border-box;
    height: var(--tool-ctrl-h);
    min-height: var(--tool-ctrl-h);
    padding: 0 12px;
    border: 1px solid var(--tool-ctrl-border);
    border-radius: var(--tool-ctrl-radius);
    background: var(--tool-ctrl-bg);
    color: var(--tool-ctrl-color);
    font-size: var(--tool-ctrl-font);
    line-height: 1.2;
    outline: none;
}
.tool-input,
.tool-select {
    width: 100%;
    font-family: Consolas, "Courier New", monospace;
}
.tool-input:focus,
.tool-select:focus,
.tool-field select:focus,
.tool-toolbar select:focus,
.tool-panel select:focus,
.tool-panel input:focus,
.tool-textarea:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.tool-textarea {
    width: 100%;
    box-sizing: border-box;
    min-height: 160px;
    padding: 12px 14px;
    border: 1px solid var(--tool-ctrl-border);
    border-radius: 10px;
    background: var(--tool-ctrl-bg);
    color: var(--tool-ctrl-color);
    font-family: Consolas, "Courier New", monospace;
    font-size: var(--tool-ctrl-font);
    line-height: 1.7;
    resize: vertical;
    outline: none;
}
.tool-pre {
    margin: 0;
    max-height: 320px;
    overflow: auto;
    padding: 14px;
    border: 1px solid #e5edf7;
    border-radius: 10px;
    background: var(--tool-soft-bg);
    color: #334155;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}
.tool-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.tool-form-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--tool-gap);
    align-items: end;
}

/* ---------- 按钮（覆盖站点默认大按钮） ---------- */
.tool-panel .btn,
.tool-panel .m-btn,
.tool-json-panel .btn,
.tool-json-panel .m-btn,
.tool-ws-panel .btn,
.tool-ws-panel .m-btn,
.tool-http-panel .btn,
.tool-http-panel .m-btn,
.tool-diff-toolbar .btn,
.tool-diff-toolbar .m-btn,
.tool-toolbar .btn,
.tool-toolbar .m-btn,
.tool-actions .btn,
.tool-actions .m-btn,
.tool-form-row .btn,
.tool-form-row .m-btn,
.tool-json-actions .btn,
.tool-json-actions .m-btn,
.tool-json-path-row .btn,
.tool-json-path-row .m-btn,
.tool-ws-connect-row .btn,
.tool-ws-connect-row .m-btn,
.tool-ws-send-actions .btn,
.tool-ws-send-actions .m-btn,
.tool-http-url-row .btn,
.tool-http-url-row .m-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
    height: var(--tool-ctrl-h);
    min-height: var(--tool-ctrl-h);
    padding: 0 14px;
    border-radius: var(--tool-ctrl-radius);
    font-size: var(--tool-ctrl-font);
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
}
.tool-panel .btn i,
.tool-panel .m-btn i,
.tool-actions .btn i,
.tool-toolbar .btn i {
    margin: 0;
    font-size: 13px;
    line-height: 1;
}
.tool-panel .btn:not(.btn-outline):not(.m-outline),
.tool-toolbar .btn:not(.btn-outline),
.tool-actions .btn:not(.btn-outline),
.tool-form-row .btn:not(.btn-outline) {
    background: var(--tool-blue);
    border-color: var(--tool-blue);
    color: #fff !important;
}
.tool-panel .btn:not(.btn-outline):hover,
.tool-toolbar .btn:not(.btn-outline):hover,
.tool-actions .btn:not(.btn-outline):hover,
.tool-form-row .btn:not(.btn-outline):hover {
    background: var(--tool-blue-hover);
    border-color: var(--tool-blue-hover);
}
.tool-panel .btn-outline,
.tool-panel .m-outline,
.tool-toolbar .btn-outline,
.tool-actions .btn-outline,
.tool-form-row .btn-outline {
    background: #fff;
    border: 1px solid #c9dbf7;
    color: var(--tool-blue) !important;
}
.tool-panel .btn-outline:hover,
.tool-panel .m-outline:hover,
.tool-toolbar .btn-outline:hover,
.tool-actions .btn-outline:hover,
.tool-form-row .btn-outline:hover {
    background: #f8fbff;
    border-color: #93c5fd;
}

/* 小号按钮：复制、添加行、次要操作 */
.tool-btn-sm,
.tool-mini-btn,
.tool-panel .tool-btn-sm,
.tool-panel .tool-mini-btn,
.tool-panel .btn.tool-btn-sm,
.tool-panel .btn.tool-mini-btn,
.tool-panel .m-btn.tool-btn-sm,
.tool-panel .m-btn.tool-mini-btn {
    height: var(--tool-ctrl-h-sm) !important;
    min-height: var(--tool-ctrl-h-sm) !important;
    padding: 0 10px !important;
    font-size: 12px !important;
    line-height: 1 !important;
    border-radius: 6px;
}

@media (max-width: 1023px) {
    .tool-actions { margin-left: 0; width: 100%; }
    .tool-feature-grid,
    .tool-grid-2 { grid-template-columns: 1fr; }
    .tool-form-row { grid-template-columns: 1fr; }
    .tool-form-row .btn,
    .tool-form-row .m-btn { width: 100%; }
}
@media (max-width: 767px) {
    .tool-panel { padding: 16px; }
}
