/* ===== 对称加密工具共用样式（AES / DES / 3DES / SM4） ===== */

/* 左右两栏骨架（与 hash-tool.css / tax-calc / char-count 保持一致） */
.convert-grid { margin: 0 !important; }
.convert-grid > div { padding: 0 20px 20px 20px !important; box-sizing: border-box; }
.convert-grid > div:first-child { border-right: 1px solid var(--border); }
.section-title {
    font-size: 16px; font-weight: 600; line-height: 50px;
    display: flex; gap: 5px; align-items: center;
}
.section-title i { color: var(--link); }
.ct-title-hint { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 2px; }

/* ===== 加密 / 解密方向切换 ===== */
.ct-switch {
    display: inline-flex; padding: 3px; gap: 3px; margin-bottom: 12px;
    background: var(--panel-head-bg); border: 1px solid var(--border); border-radius: 7px;
}
.ct-switch-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 16px; font-size: 13px; line-height: 1.5;
    border: none; border-radius: 5px; background: transparent;
    color: var(--muted); cursor: pointer; transition: all .15s;
}
.ct-switch-btn:hover { color: var(--text); }
.ct-switch-btn.on { background: var(--panel-bg); color: var(--link); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* textarea 必须用 .editor-row .ct-textarea (0,2,0) 压过 tool.css 的 .editor-row textarea (0,1,1) */
.editor-row .ct-textarea {
    width: 100%; box-sizing: border-box;
    height: 150px; padding: 12px;
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: 13px; line-height: 1.7;
    color: var(--editor-text); background: var(--editor-bg);
    border: 1px solid var(--editor-border); border-radius: 6px;
    resize: vertical;
}
.editor-row .ct-textarea::placeholder { color: var(--muted); opacity: 1; }
.editor-row .ct-textarea:focus { outline: none; border-color: var(--link); }

/* ===== 参数区 ===== */
.ct-params { display: flex; flex-direction: column; gap: 11px; margin-top: 6px; }
.ct-prow { display: grid; grid-template-columns: 78px minmax(0, 1fr); align-items: start; gap: 10px; }
.ct-prow > label {
    font-size: 13px; font-weight: 600; color: var(--text);
    line-height: 36px; white-space: nowrap;
}
.ct-pfield { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.ct-kv { display: flex; align-items: center; gap: 7px; min-width: 0; }
.ct-kv > .ct-input, .ct-kv > .ct-select { flex: 1 1 auto; min-width: 0; }
.ct-kv.ct-two { gap: 8px; }
.ct-kv.ct-two > * { flex: 1 1 0; }

.editor-row .ct-input {
    width: 100%; min-width: 0; box-sizing: border-box;
    padding: 6px 10px; font-size: 13px; line-height: 1.7;
    color: var(--editor-text); background: var(--editor-bg);
    border: 1px solid var(--editor-border); border-radius: 5px;
}
.editor-row .ct-input:focus { outline: none; border-color: var(--link); }
.editor-row .ct-input::placeholder { color: var(--muted); opacity: 1; }
.editor-row .ct-input.bad { border-color: #dc2626; }
.editor-row .ct-input:disabled { background: var(--panel-head-bg); color: var(--muted); cursor: not-allowed; }
.ct-input.mono { font-family: Consolas, Monaco, "Courier New", monospace; }

/* ⚠️ select 必须去掉原生外观，否则长选项文字会被原生箭头盖住 */
.editor-row .ct-select {
    width: 100%; box-sizing: border-box;
    padding: 6px 24px 6px 10px; font-size: 13px; line-height: 1.7;
    border: 1px solid var(--editor-border); border-radius: 5px;
    background-color: var(--editor-bg); color: var(--editor-text); cursor: pointer;
    -webkit-appearance: none; -moz-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5' fill='none' stroke='%23888888' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 7px center; background-size: 11px 11px;
    text-overflow: ellipsis;
}
.editor-row .ct-select:focus { outline: none; border-color: var(--link); }
.editor-row .ct-select:disabled { background-color: var(--panel-head-bg); color: var(--muted); cursor: not-allowed; opacity: .75; }

/* 文本 / Hex 切换段控件 */
.ct-seg {
    display: inline-flex; flex: 0 0 auto;
    border: 1px solid var(--editor-border); border-radius: 5px; overflow: hidden;
}
.ct-seg-btn {
    padding: 6px 9px; font-size: 12px; line-height: 1.7;
    border: none; background: var(--editor-bg); color: var(--muted); cursor: pointer;
    transition: all .15s;
}
.ct-seg-btn + .ct-seg-btn { border-left: 1px solid var(--editor-border); }
.ct-seg-btn:hover { color: var(--link); }
.ct-seg-btn.on { background: var(--link); color: #fff; font-weight: 600; }
.ct-seg.off { opacity: .45; pointer-events: none; }

/* 行内小图标按钮（随机 / 生成） */
.ct-icon-btn {
    flex: 0 0 auto;
    display: inline-flex; align-items: center; gap: 4px;
    padding: 6px 9px; font-size: 12px; line-height: 1.7;
    border: 1px solid var(--editor-border); border-radius: 5px;
    background: var(--panel-bg); color: var(--muted); cursor: pointer; transition: all .15s;
}
.ct-icon-btn:hover { color: var(--link); border-color: var(--link); }
.ct-icon-btn i { font-size: 13px; }
.ct-icon-btn:disabled { opacity: .45; cursor: not-allowed; color: var(--muted); border-color: var(--editor-border); }

/* 提示 / 校验文案 */
.ct-hint { font-size: 12px; line-height: 1.6; color: var(--muted); }
.ct-hint.ok { color: #0d9e6c; }
.ct-hint.bad { color: #c0392b; }
.ct-hint code { font-family: Consolas, Monaco, monospace; }

.ct-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ct-chip {
    padding: 4px 10px; font-size: 12px; line-height: 1.7;
    border: 1px dashed var(--editor-border); border-radius: 12px;
    background: transparent; color: var(--muted); cursor: pointer; transition: all .15s;
}
.ct-chip:hover { border-style: solid; color: var(--link); border-color: var(--link); }
.ct-chip.on { border-style: solid; color: var(--link); border-color: var(--link); background: rgba(70,132,255,.08); font-weight: 600; }

.ct-note { font-size: 12px; line-height: 1.75; color: var(--muted); margin-top: 12px; }
.ct-note b { color: var(--text); }
.ct-note code { font-family: Consolas, Monaco, monospace; }
.ct-note i { color: var(--link); margin-right: 2px; }

.ct-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.ct-tools .tbtn { margin: 0; }

/* ===== 结果区 ===== */
.ct-copy {
    margin-left: auto;
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 9px; font-size: 12px; font-weight: 500; line-height: 1.7;
    border: 1px solid var(--editor-border); border-radius: 4px;
    background: var(--panel-bg); color: var(--muted);
    cursor: pointer; transition: color .15s, border-color .15s;
}
.ct-copy:hover { color: var(--link); border-color: var(--link); }
.section-title .ct-copy i { color: inherit; font-size: 12px; }
.ct-copy:disabled { opacity: .45; cursor: not-allowed; }

#outputCol { display: flex; flex-direction: column; }
#outputCol > .section-title { flex: 0 0 auto; }
.ct-result { flex: 1 1 auto; min-height: 260px; max-height: 505px; overflow-y: auto; }

.ct-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px; height: 100%; min-height: 240px;
    color: var(--muted); font-size: 13px; text-align: center;
}
.ct-empty > i { font-size: 30px; opacity: .5; }

.ct-field { margin-bottom: 14px; }
.ct-label {
    display: flex; align-items: center; gap: 5px;
    font-size: 12px; font-weight: 600; color: var(--muted);
    margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em;
}

.ct-out {
    display: block; padding: 12px; min-height: 56px;
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: 13.5px; line-height: 1.85; word-break: break-all;
    color: var(--hl-tpl); background: var(--editor-bg);
    border: 1px solid var(--editor-border); border-radius: 6px;
    cursor: pointer; transition: border-color .15s;
}
.ct-out:hover { border-color: var(--link); }
.ct-out.lg { font-size: 15px; }

.ct-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.ct-meta b { color: var(--text); font-weight: 600; margin-right: 3px; }

.ct-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ct-actions .tbtn { margin: 0; }

.ct-status {
    display: flex; align-items: center; gap: 7px;
    padding: 9px 12px; margin-bottom: 14px; border-radius: 6px; font-size: 13px;
}
.ct-status.ok { background: rgba(40,167,69,.1); color: #0d9e6c; }
.ct-status.warn { background: rgba(243,156,18,.12); color: #d68910; }
.ct-status.err { background: rgba(231,76,60,.1); color: #c0392b; }

/* ===== 移动端（Pure 的 md 断点 48em = 768px） ===== */
@media (max-width: 767px) {
    .convert-grid > div { padding: 14px !important; }
    .convert-grid > div:first-child { border-right: none; border-bottom: 1px solid var(--border); }
    .section-title { line-height: 40px; font-size: 15px; }
    #outputCol { display: block; }
    .ct-result { flex: none; height: auto; min-height: 0; max-height: none; overflow: visible; }
    .editor-row .ct-textarea { height: 130px; }
    .ct-prow { grid-template-columns: 1fr; gap: 4px; }
    .ct-prow > label { line-height: 1.6; }
    .ct-switch { width: 100%; }
    .ct-switch-btn { flex: 1 1 0; justify-content: center; }
    .ct-empty { min-height: 140px; }
}
