/* ======================================================================
 *  文本域 / 代码块 共用样式 /crypto-common.css
 *  供 aes-tool / rsa-keygen / hmac-tool / pbkdf2-tool 复用
 *  文件类工具（需要大文本域或结果块时）也会一起引用
 *  依赖 home.css 全局变量 + calc-common.css，支持黑夜模式。
 * ====================================================================== */

/* ---------- 文本域 ---------- */
.ct-ta {
    width: 100%;
    min-height: 120px;
    padding: 12px 14px;
    font-size: 13px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    line-height: 1.75;
    color: var(--c-text);
    background: var(--c-surface-soft);
    border: 1px solid var(--c-border);
    border-radius: 12px;
    outline: none;
    resize: vertical;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
    word-break: break-all;
}
.ct-ta:focus {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px var(--c-primary-soft);
}
.ct-ta::placeholder { color: var(--c-text-muted); font-family: inherit; }
.ct-ta-out { background: rgba(0, 150, 220, 0.05); }
.ct-ta--tall { min-height: 200px; }

.ct-ta-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 6px;
    font-size: 11.5px;
    color: var(--c-text-muted);
}
.ct-mini {
    border: none;
    background: none;
    padding: 0;
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--c-primary);
    cursor: pointer;
}
.ct-mini:hover { text-decoration: underline; }

/* ---------- 按钮行 ---------- */
.ct-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.ct-btns .btn { flex: 1 1 30%; min-width: 110px; }

/* ---------- 安全上下文提示 ---------- */
.ct-gate {
    border-color: rgba(224, 68, 124, 0.4);
    background: rgba(224, 68, 124, 0.06);
}
.ct-gate code {
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.06);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
}

/* ---------- 密钥 / 摘要展示块 ---------- */
.ct-block {
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--c-border);
    background: var(--c-surface-soft);
}
.ct-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}
.ct-block-title {
    font-size: 12.5px;
    font-weight: 800;
    color: var(--c-text-sub);
}
.ct-block-body {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11.5px;
    line-height: 1.7;
    color: var(--c-text-sub);
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 190px;
    overflow-y: auto;
}
.ct-block-body--empty { color: var(--c-text-muted); font-family: inherit; }

/* ---------- 对照校验 ---------- */
.ct-compare {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}
.ct-compare.is-ok { background: rgba(52, 199, 89, 0.12); color: #15803d; }
.ct-compare.is-bad { background: rgba(224, 68, 124, 0.1); color: #b91c1c; }
.ct-compare.is-idle { background: var(--c-surface-soft); color: var(--c-text-muted); }

/* ---------- 强度条 ---------- */
.ct-strength { margin-top: 10px; }
.ct-strength-bar {
    height: 9px;
    border-radius: 99px;
    background: var(--c-surface-soft);
    border: 1px solid var(--c-border);
    overflow: hidden;
}
.ct-strength-bar i {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 99px;
    transition: width 0.35s ease, background 0.35s ease;
}
.ct-strength-txt {
    margin-top: 6px;
    font-size: 12px;
    color: var(--c-text-sub);
}

@media (max-width: 620px) {
    .ct-btns .btn { flex: 1 1 100%; }
}

[data-theme="dark"] .ct-gate { background: rgba(224, 68, 124, 0.12); }
[data-theme="dark"] .ct-gate code { background: rgba(255, 255, 255, 0.08); }
[data-theme="dark"] .ct-ta-out { background: rgba(0, 150, 220, 0.12); }
[data-theme="dark"] .ct-compare.is-ok { color: #4ede78; }
[data-theme="dark"] .ct-compare.is-bad { color: #f87171; }
