/* Split from the original style.css; loaded in original order (after style.css). */
/* ── Dead keys tab ─────────────────────────────────────────────────────── */
/* Shared framed panel surface (with .proxy-toolbar defined below) */
.dk-filter-panel,
.proxy-toolbar {
    padding: 1.25rem;
    margin-bottom: 1rem;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.dk-filter-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
}

.dk-filter-field--host {
    flex: 0 0 17rem;
    min-width: 0;
    max-width: 100%;
}

.dk-filter-field--key {
    flex: 1 1 12rem;
    min-width: 0;
}

.dk-filter-field--code {
    flex: 0 0 8.25rem;
    min-width: 0;
    max-width: 100%;
}

.dk-filter-field--date {
    flex: 0 0 auto;
}

.dk-date-wrap {
    position: relative;
    width: 10.5rem;
    max-width: 100%;
}

.dk-date-input {
    padding: 0 2.15rem 0 0.75rem;
    font-variant-numeric: tabular-nums;
}

.dk-date-input.is-invalid {
    border-color: var(--fail);
}

.dk-date-picker {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    margin: 0;
    padding: 0;
    border: 0;
}

/* Embedded right-side square icon buttons inside inputs (calendar & reveal eye). */
.dk-date-btn,
.input-secret-toggle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    transition:
        color 0.15s,
        opacity 0.15s,
        background 0.15s;
}

.input-secret-wrap {
    position: relative;
    display: flex;
    flex: 1 1 0;
    min-width: 0;
    align-items: center;
}

/* Only the settings dialog's proxy-password field uses this wrap; the key keeps
   the UI font, not monospace. */
.input-secret-wrap .input-secret {
    padding-right: 2.4rem;
    font-size: var(--text-xs);
}

/* Edge/IE draw their own reveal eye inside type="password" inputs; hide it so our
   cross-browser eye toggle sits alone in that corner. */
.input-secret::-ms-reveal,
.input-secret::-ms-clear {
    display: none;
}

.input-secret-toggle {
    right: 0.3rem;
    width: 1.85rem;
    height: 1.85rem;
    cursor: pointer;
}

.input-secret-toggle:hover {
    color: var(--text);
    background: var(--bg-3);
}

.dk-date-btn {
    right: 0.15rem;
    width: 2rem;
    height: 2rem;
    cursor: pointer;
}

.dk-date-btn:hover {
    color: var(--text);
    background: var(--bg-3);
}

.dk-date-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

/* 内层跟着格子走。改栏宽请改下面 .dk-host-col 的 width，不要改这里。 */
.dk-host-cell {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 同上：跟着 .dk-key-col 的 width。 */
.dk-key-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    min-width: 0;
    max-width: 100%;
}

.dk-key-cell {
    display: block;
    font-family: var(--mono);
    font-size: var(--text-xs);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.dk-key-mobile {
    display: none;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
    line-height: 1;
    color: var(--text-muted);
    flex-shrink: 0;
    border-radius: var(--radius-sm);
}

.btn-icon:hover:not(:disabled):not([aria-disabled="true"]) {
    color: var(--text);
}

.btn-icon.copied {
    color: var(--ok) !important;
}

.dk-date-cell {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* 错误讯息吃剩余栏宽时，内层也跟着撑满，避免再截成比栏更短。 */
.dk-msg-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    max-width: 100%;
}

.dk-msg {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

/* 只有失效密钥表用 fixed。
 * 电脑随窗口变宽/变窄：只有没写 width 的那一栏会跟着伸缩（现在是错误讯息）。
 * 其它栏写死 width，改其中一栏不必重算其余。
 * min-width = 各固定栏 + 错误讯息下限，窄于这个值时表格比容器宽，走 .table-scroll 横滑，
 * 而不是把 100% 硬塞进屏幕导致错误讯息和编辑叠在一起。 */
.dk-table {
    table-layout: fixed;
    width: 100%;
    min-width: 53.5rem;
}

.dk-table th,
.dk-table td {
    overflow: hidden;
}

.data-table th.dk-host-col,
.data-table td.dk-host-col {
    width: 14rem;
}

.data-table th.dk-key-col,
.data-table td.dk-key-col {
    width: 10.5rem;
}

.data-table th.dk-date-col,
.data-table td.dk-date-col {
    width: 8rem;
}

/* 够放「状态码▲」；fixed 表里不要用 1%（会变成整表的 1%）。 */
.data-table th.dk-code-col,
.data-table td.dk-code-col {
    width: 5.5rem;
    white-space: nowrap;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    font-variant-numeric: tabular-nums;
}

/* 唯一弹性栏：不设 width。min-width 是缩到多窄为止。 */
.data-table th.dk-msg-col,
.data-table td.dk-msg-col {
    min-width: 10rem;
}

/* 平板：栏仍横滑（.table-scroll），先把供应商 / KEY 收一档。错误讯息仍是弹性栏。 */
@media (max-width: 900px) {
    .dk-table {
        min-width: 53rem;
    }

    .data-table th.dk-host-col,
    .data-table td.dk-host-col {
        width: 10.5rem;
    }

    .data-table th.dk-key-col,
    .data-table td.dk-key-col {
        width: 10.5rem;
    }

    .data-table th.dk-date-col,
    .data-table td.dk-date-col {
        width: 8rem;
    }

    .data-table th.dk-msg-col,
    .data-table td.dk-msg-col {
        min-width: 8.5rem;
    }
}
