/*
 * 老苏 · 内容隐藏 —— 前台样式（主题自适应版）
 *
 * 目标：换任何主题都不突兀，所以这里不写死任何「品牌色」，取色分三层兜底：
 *
 *   ① 主题自己的设计令牌。--primary / --color-primary / --primary-color / --theme-color
 *      / --brand / --link-color / --accent … 叫得出来的名字全串进 var() 的 fallback 链，
 *      主题用哪个就命中哪个（laosu 命中 --primary，Bootstrap 系主题命中 --accent）。
 *   ② 一个令牌都拿不到时，底色与描边退回「中性半透明灰」，文字一律 inherit。
 *      半透明透出的是页面自己的背景，浅底深底都自然，所以深色模式本来不需要另写一套规则。
 *   ③ 支持 color-mix() 的浏览器（Chrome 111+ / Safari 16.2+ / Firefox 113+）
 *      把底色改成「主题主色的淡染 + 主题页面底色」，看起来像主题自己长出来的。
 *
 * 深色模式不需要单独一套规则：主题用令牌做深色时令牌自己会翻；主题若把颜色写死，
 * 第 ② 层的半透明中性灰叠在它的背景上本来就是对的。这个选择比「猜主题的深色选择器」
 * 更稳——猜错的代价是浅色站点在系统深色偏好下出现深字配蓝底。
 *
 * 所有选择器都带 .lsh-lock / .lsh-note 前缀，一是绝不外溢到主题元素，
 * 二是让特异性高于主题常见的 a / button / code / input 规则，换主题不会被串味。
 *
 * 想微调：在你主题的 CSS 里覆盖下面任意一个变量即可，例如
 *     .lsh-lock, .lsh-note { --lsh-accent: #e5484d; }
 */

.lsh-lock,
.lsh-note {
    --lsh-accent: var(--primary,
        var(--color-primary,
        var(--primary-color,
        var(--theme-color,
        var(--theme-primary,
        var(--brand,
        var(--brand-color,
        var(--link-color,
        var(--accent,
        var(--accent-color, #2f6bff))))))))));

    --lsh-on-accent: var(--bg, var(--bg-color, var(--page-bg, #ffffff)));

    --lsh-surface: rgba(127, 127, 127, .055);
    --lsh-line: rgba(127, 127, 127, .30);
    --lsh-line-strong: rgba(127, 127, 127, .45);
    --lsh-sunken: rgba(127, 127, 127, .10);

    --lsh-radius: var(--radius-lg, var(--radius, 12px));
    --lsh-radius-sm: var(--radius, 8px);
    --lsh-mono: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace);
    --lsh-danger: var(--danger, #d93025);
}

@supports (background: color-mix(in srgb, currentColor 5%, transparent)) {
    .lsh-lock,
    .lsh-note {
        --lsh-surface: color-mix(in srgb, var(--lsh-accent) 7%, var(--bg, transparent));
        --lsh-line: color-mix(in srgb, var(--lsh-accent) 24%, transparent);
        --lsh-line-strong: color-mix(in srgb, var(--lsh-accent) 45%, transparent);
        --lsh-sunken: color-mix(in srgb, var(--lsh-accent) 12%, var(--bg, transparent));
    }
}

.lsh-lock {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .55em .8em;
    box-sizing: border-box;
    margin: 1.4em 0;
    padding: .95em 1.1em;
    border: 1px dashed var(--lsh-line);
    border-radius: var(--lsh-radius);
    background-color: var(--lsh-surface);
    color: inherit;
    font-family: inherit;
    font-size: .95em;
    line-height: 1.7;
    text-align: start;
    overflow-wrap: break-word;
}

.lsh-lock .lsh-lock-badge {
    flex: 0 0 auto;
    font-size: 1.1em;
    line-height: 1;
    opacity: .8;
    filter: grayscale(.2);
}

.lsh-lock .lsh-lock-body {
    display: flex;
    flex: 1 1 12em;
    flex-direction: column;
    gap: .15em;
    min-width: 0;
}

.lsh-lock .lsh-lock-title {
    color: inherit;
    font-size: 1em;
    font-weight: 600;
    letter-spacing: normal;
}

.lsh-lock .lsh-lock-tip {
    color: inherit;
    font-size: .88em;
    line-height: 1.6;
    opacity: .8;
}

.lsh-lock .lsh-lock-meta {
    color: inherit;
    font-size: .8em;
    letter-spacing: .01em;
    opacity: .78;
}

.lsh-lock .lsh-lock-acts {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    align-items: center;
    gap: .45em;
}

.lsh-lock .lsh-btn,
.lsh-note .lsh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35em;
    box-sizing: border-box;
    min-height: 2.2em;
    margin: 0;
    padding: .45em .95em;
    border: 1px solid var(--lsh-line-strong);
    border-radius: var(--lsh-radius-sm);
    background: transparent;
    background-image: none;
    color: inherit;
    font-family: inherit;
    font-size: .85em;
    font-weight: 500;
    line-height: 1.25;
    letter-spacing: normal;
    text-align: center;
    text-decoration: none;
    text-transform: none;
    white-space: nowrap;
    box-shadow: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color .18s ease, background-color .18s ease, color .18s ease, transform .18s ease;
}

.lsh-lock .lsh-btn:hover,
.lsh-lock .lsh-btn:focus,
.lsh-note .lsh-btn:hover,
.lsh-note .lsh-btn:focus {
    border-color: var(--lsh-accent);
    color: var(--lsh-accent);
    text-decoration: none;
}

.lsh-lock .lsh-btn:active {
    transform: translateY(1px);
}

.lsh-lock .lsh-btn:focus-visible,
.lsh-note .lsh-btn:focus-visible {
    outline: 2px solid var(--lsh-accent);
    outline-offset: 2px;
}

.lsh-lock .lsh-btn.lsh-btn-main {
    border-color: transparent;
    background-color: var(--lsh-accent);
    background-image: none;
    color: var(--lsh-on-accent);
    font-weight: 600;
}

.lsh-lock .lsh-btn.lsh-btn-main:hover,
.lsh-lock .lsh-btn.lsh-btn-main:focus {
    border-color: transparent;
    color: var(--lsh-on-accent);
    filter: brightness(1.06);
}

.lsh-lock .lsh-btn-quiet,
.lsh-note .lsh-btn-quiet {
    border-color: transparent;
    background: transparent;
    opacity: .85;
}

.lsh-lock .lsh-btn-quiet:hover,
.lsh-note .lsh-btn-quiet:hover {
    opacity: 1;
    border-color: var(--lsh-line-strong);
}

.lsh-lock .lsh-btn-mini,
.lsh-note .lsh-btn-mini {
    min-height: 1.9em;
    padding: .3em .7em;
    font-size: .78em;
}

.lsh-lock .lsh-btn[disabled],
.lsh-note .lsh-btn[disabled] {
    opacity: .55;
    cursor: default;
    transform: none;
}

.lsh-lock.lsh-inline {
    display: inline-flex;
    margin: 0 .15em;
    padding: .1em .5em;
    border-radius: var(--lsh-radius-sm);
    font-size: .94em;
    vertical-align: baseline;
    gap: .3em;
}

.lsh-lock.lsh-inline .lsh-lock-body {
    flex: 0 1 auto;
    flex-direction: row;
    align-items: baseline;
    gap: .3em;
}

.lsh-lock.lsh-inline .lsh-lock-title {
    font-weight: 500;
}

.lsh-lock.lsh-inline .lsh-lock-tip,
.lsh-lock.lsh-inline .lsh-lock-meta {
    display: none;
}

.lsh-lock .lsh-lock-acts .lsh-pw {
    flex: 1 1 100%;
}

.lsh-lock .lsh-code.lsh-pw {
    margin: .1em 0 0;
    padding: .1em 0 0;
    border-top: 0;
}

.lsh-lock .lsh-code.lsh-pw input {
    flex: 1 1 8em;
    letter-spacing: .08em;
}

.lsh-lock .lsh-code {
    display: flex;
    flex-wrap: wrap;
    gap: .5em;
    box-sizing: border-box;
    width: 100%;
    margin: .35em 0 0;
    padding: .7em 0 0;
    border-top: 1px dashed var(--lsh-line);
}

.lsh-lock .lsh-code[hidden] {
    display: none;
}

.lsh-lock .lsh-code input {
    flex: 1 1 11em;
    box-sizing: border-box;
    min-width: 0;
    height: auto;
    margin: 0;
    padding: .55em .7em;
    border: 1px solid var(--lsh-line);
    border-radius: var(--lsh-radius-sm);
    background-color: var(--lsh-sunken);
    background-image: none;
    color: inherit;
    font-family: inherit;
    font-size: .85em;
    line-height: 1.3;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
}

.lsh-lock .lsh-code input::placeholder {
    color: inherit;
    opacity: .45;
}

.lsh-lock .lsh-code input:focus {
    border-color: var(--lsh-accent);
    outline: none;
}

.lsh-lock .lsh-msg {
    display: none;
    width: 100%;
    margin: 0;
    color: inherit;
    font-size: .85em;
    line-height: 1.6;
    opacity: .8;
}

.lsh-lock .lsh-msg.is-on {
    display: block;
}

.lsh-lock .lsh-msg.is-bad {
    color: var(--lsh-danger);
    opacity: 1;
}

.lsh-note {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5em .7em;
    box-sizing: border-box;
    margin: 1.2em 0;
    padding: .65em .9em;
    border: 1px solid var(--lsh-line);
    border-radius: var(--lsh-radius-sm);
    background-color: var(--lsh-surface);
    color: inherit;
    font-family: inherit;
    font-size: .85em;
    line-height: 1.65;
    text-align: start;
}

.lsh-note .lsh-note-label {
    color: var(--lsh-accent);
    font-weight: 600;
    white-space: nowrap;
}

.lsh-note .lsh-note-code {
    padding: .1em .5em;
    border: 0;
    border-radius: 6px;
    background-color: var(--lsh-sunken);
    color: inherit;
    font-family: var(--lsh-mono);
    font-size: .95em;
    letter-spacing: .06em;
}

.lsh-note .lsh-note-code[hidden] {
    display: none;
}

.lsh-note .lsh-note-hint {
    flex: 1 1 12em;
    min-width: 0;
    opacity: .8;
}

@media (max-width: 640px) {
    .lsh-lock {
        padding: .85em .9em;
    }

    .lsh-lock .lsh-lock-acts {
        width: 100%;
    }

    .lsh-lock .lsh-lock-acts .lsh-btn {
        flex: 1 1 auto;
    }

    .lsh-lock .lsh-lock-acts .lsh-btn-quiet {
        flex: 1 1 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lsh-lock .lsh-btn,
    .lsh-note .lsh-btn {
        transition: none;
    }

    .lsh-lock .lsh-btn:active {
        transform: none;
    }
}

@media print {
    .lsh-lock .lsh-lock-acts,
    .lsh-lock .lsh-code,
    .lsh-lock .lsh-msg,
    .lsh-note {
        display: none !important;
    }

    .lsh-lock {
        border-style: solid;
    }
}
