/* ===== 哈希工具共用样式（MD5 / SHA / Bcrypt / Argon2 / PBKDF2） ===== */

/* 左右两栏骨架（与 tax-calc / char-count / cron-generator 保持一致） */
.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); }
.section-title .ht-title-hint {
    font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 2px;
}

/* ===== 输入区 ===== */
.ht-switch {
    display: inline-flex; padding: 3px; gap: 3px; margin-bottom: 12px;
    background: var(--panel-head-bg); border: 1px solid var(--border); border-radius: 7px;
}
.ht-switch-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 14px; font-size: 13px; line-height: 1.5;
    border: none; border-radius: 5px; background: transparent;
    color: var(--muted); cursor: pointer; transition: all .15s;
}
.ht-switch-btn:hover { color: var(--text); }
.ht-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 .ht-textarea (0,2,0) 压过 tool.css 的 .editor-row textarea (0,1,1) */
.editor-row .ht-textarea {
    width: 100%; box-sizing: border-box;
    height: 232px; 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 .ht-textarea::placeholder { color: var(--muted); opacity: 1; }
.editor-row .ht-textarea:focus { outline: none; border-color: var(--link); }

/* 文件拖放区 */
.ht-drop {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px; height: 232px; padding: 16px; box-sizing: border-box;
    border: 1px dashed var(--editor-border); border-radius: 6px;
    background: var(--editor-bg); color: var(--muted);
    text-align: center; cursor: pointer; transition: all .15s;
}
.ht-drop:hover, .ht-drop.over { border-color: var(--link); color: var(--link); background: rgba(70,132,255,.06); }
.ht-drop > i { font-size: 34px; }
.ht-drop-main { font-size: 14px; color: var(--text); font-weight: 500; }
.ht-drop-hint { font-size: 12px; line-height: 1.7; max-width: 300px; }

.ht-fileinfo {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin-top: 10px; padding: 9px 12px; font-size: 12.5px;
    border: 1px solid var(--border); border-radius: 6px; background: var(--panel-head-bg);
}
.ht-fileinfo > i { color: var(--link); font-size: 15px; }
.ht-fileinfo .ht-fname { font-weight: 600; color: var(--text); word-break: break-all; }
.ht-fileinfo .ht-fsize { color: var(--muted); }

.ht-progress { height: 5px; border-radius: 3px; background: var(--border); overflow: hidden; margin-top: 10px; }
.ht-progress > i { display: block; height: 100%; width: 0; background: var(--link); transition: width .12s linear; }

.ht-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.ht-tools .tbtn { margin: 0; }
.ht-tools-right { margin-left: auto; font-size: 12px; color: var(--muted); }

/* ===== 参数行（密码哈希类） ===== */
.ht-params { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.ht-prow { display: grid; grid-template-columns: 88px minmax(0, 1fr); align-items: center; gap: 10px; }
.ht-prow > label { font-size: 13px; font-weight: 600; color: var(--text); }
.ht-pctrl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; position: relative; }
.ht-pctrl .ht-unit { font-size: 12px; color: var(--muted); white-space: nowrap; }

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

.editor-row .ht-num { width: 108px; }
.editor-row .ht-select {
    width: 100%; box-sizing: border-box;
    padding: 7px 24px 7px 10px; font-size: 13px; line-height: 1.6;
    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 .ht-select:focus { outline: none; border-color: var(--link); }

.ht-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ht-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;
}
.ht-chip:hover { border-style: solid; color: var(--link); border-color: var(--link); }
.ht-chip.on { border-style: solid; color: var(--link); border-color: var(--link); background: rgba(70,132,255,.08); }

.ht-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); cursor: pointer; }
.ht-check input { width: 15px; height: 15px; accent-color: var(--link); cursor: pointer; }

.ht-note { font-size: 12px; line-height: 1.7; color: var(--muted); }
.ht-note.warn { color: #d68910; }
.ht-note code { font-family: Consolas, Monaco, monospace; }

/* ===== 结果区 ===== */
.ht-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;
}
.ht-copy:hover { color: var(--link); border-color: var(--link); }
.section-title .ht-copy i { color: inherit; font-size: 12px; }
.ht-copy:disabled { opacity: .45; cursor: not-allowed; }

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

.ht-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;
}
.ht-empty > i { font-size: 30px; opacity: .5; }

.ht-field { margin-bottom: 14px; }
.ht-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;
}

.ht-hash {
    display: block; padding: 12px;
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: 14px; line-height: 1.8; 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;
}
.ht-hash:hover { border-color: var(--link); }
.ht-hash.lg { font-size: 16px; }
.ht-hash.sm { font-size: 12px; color: var(--editor-text); }

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

.ht-sub { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.ht-sub-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px; align-items: start; font-size: 12px; }
.ht-sub-row > span { color: var(--muted); line-height: 1.8; }
.ht-sub-row > code {
    font-family: Consolas, Monaco, "Courier New", monospace; font-size: 12px; line-height: 1.8;
    color: var(--editor-text); word-break: break-all;
    padding: 1px 7px; border-radius: 4px; background: var(--panel-head-bg); cursor: pointer;
}
.ht-sub-row > code:hover { color: var(--link); }

.ht-verify { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border); }
.ht-verdict { margin-top: 8px; font-size: 13px; line-height: 1.7; min-height: 20px; }
.ht-verdict.ok { color: #0d9e6c; font-weight: 600; }
.ht-verdict.bad { color: #c0392b; font-weight: 600; }
.ht-verdict.idle { color: var(--muted); }
.ht-verdict i { margin-right: 3px; }

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

.ht-spin { display: inline-block; animation: ht-rotate 1s linear infinite; }
@keyframes ht-rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* 校验面板里的哈希串输入框（textarea 需用 .editor-row .ht-vfhash 压过全局规则） */
.editor-row .ht-vfhash {
    width: 100%; box-sizing: border-box; height: 104px; padding: 9px 10px;
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: 13px; line-height: 1.65; resize: vertical;
    color: var(--editor-text); background: var(--editor-bg);
    border: 1px solid var(--editor-border); border-radius: 5px;
}
.editor-row .ht-vfhash:focus { outline: none; border-color: var(--link); }
.editor-row .ht-vfhash::placeholder { color: var(--muted); opacity: 1; }

.ht-kv { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.ht-kv-row { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; }
.ht-kv-row > span { color: var(--muted); }
.ht-kv-row > b { color: var(--text); font-weight: 600; font-family: Consolas, Monaco, monospace; word-break: break-all; text-align: right; }

/* ===== 密码框的显示 / 隐藏按钮 =====
   .ht-eye 同时带 .ht-chip 类，这里靠「源码顺序在后」覆盖 .ht-chip 的 padding 与虚线边框，
   否则按钮会作为普通 flex 项被挤到输入框下一行。 */
.ht-pctrl:has(> .ht-eye) > .ht-input { padding-right: 34px; }
.ht-eye {
    position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
    width: 24px; height: 24px; margin: 0; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border: none; border-radius: 4px; background: transparent;
    color: var(--muted); cursor: pointer; z-index: 2;
}
.ht-eye i { font-size: 14px; line-height: 1; }
.ht-eye:hover { color: var(--link); }

/* ===== 移动端 ===== */
@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; }
    .ht-result { flex: none; height: auto; min-height: 0; max-height: none; overflow: visible; }
    .editor-row .ht-textarea { height: 180px; }
    .ht-drop { height: 180px; }
    .ht-prow { grid-template-columns: 1fr; gap: 5px; }
    .ht-sub-row { grid-template-columns: 1fr; gap: 2px; }
    .ht-switch { width: 100%; }
    .ht-switch-btn { flex: 1 1 0; justify-content: center; }
}
