/* ======= 删除线生成器：专属样式（三语共享） =======
   只写本工具专属部件；.btn / .form-input / .toast / .info-card / .feature-grid /
   .tutorial-steps / .scenario-grid / .glossary-item / .faq-item / .related-tools 等共享类在 /style.css。 */

.st-tool-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ---------- 输入区 ---------- */

.st-input-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.st-input-area {
    width: 100%;
    min-height: 96px;
    padding: 0.75rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-white);
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.7;
    font-family: inherit;
    resize: vertical;
    transition: var(--transition-fast);
    box-sizing: border-box;
}

.st-input-area:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.st-examples {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.625rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* 输入提示（本站未放入 style.css，本工具自带一份） */
.input-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.input-hint i {
    color: var(--primary-color);
}

/* 输入里已带旧划线符号、被自动忽略时的提示条。
   默认 display:none，靠 .is-on 显示（不用 [hidden]，避免作者样式覆盖 UA 规则）。 */
.st-note {
    display: none;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.5rem 0.625rem;
    border: 1px solid #ffe58f;
    border-radius: var(--radius-md);
    background: #fffbe6;
    color: #8a6100;
    font-size: 0.8rem;
    line-height: 1.5;
}

.st-note.is-on {
    display: flex;
}

.st-note i {
    flex: none;
    margin-top: 0.1rem;
    color: var(--warning-color);
}

.st-example {
    padding: 0.1875rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-light);
    color: var(--text-secondary);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.st-example:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--primary-light);
}

/* ---------- 样式选择 ---------- */

.st-section-title {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin: 0 0 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.st-styles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
}

.st-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.625rem 0.375rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-white);
    cursor: pointer;
    transition: var(--transition-fast);
    min-width: 0;
}

.st-chip:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.st-chip.active {
    border-color: var(--primary-color);
    background: var(--primary-light);
    box-shadow: inset 0 0 0 1px var(--primary-color);
}

.st-chip-demo {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: nowrap;
}

.st-chip-name {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.st-chip.active .st-chip-name {
    color: var(--primary-color);
}

/* ---------- 选项 ---------- */

.st-options {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-top: 1rem;
}

.st-check {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.st-check input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--primary-color);
    cursor: pointer;
    margin: 0;
}

/* ---------- 操作按钮 ---------- */

.st-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.st-actions .btn {
    flex: 1 1 150px;
}

/* ---------- 结果区 ---------- */

.st-result {
    border-top: 1px solid var(--border-color);
    padding-top: 1.25rem;
}

.st-result-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.st-stat {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.st-preview {
    min-height: 84px;
    padding: 1rem 1.125rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-light);
    color: var(--text-primary);
    font-size: 1.5rem;
    line-height: 2;
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.st-preview.is-empty {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* ---------- 预览划线：用 CSS 绘制，保证汉字也能正确显示 ----------
   Unicode 组合符号（U+0336 等）是「零宽叠加符号」，需要字体同时覆盖汉字和符号
   才能正确叠加。Windows 上所有中文正文字体都不含这些符号，浏览器只能回退到
   拉丁字体，于是整个字符簇渲染成缺字方框（看起来就是乱码）。
   因此预览改用 CSS 划线来呈现效果，任何字体/平台下都正常；
   「生成结果」框里仍然是含组合符号的真实文本，复制出来可直接使用。 */

.st-pv-ch {
    text-decoration-color: currentColor;
}

.st-pv-strike {
    text-decoration: line-through;
}

.st-pv-strike2 {
    text-decoration: line-through;
    text-decoration-style: double;
}

.st-pv-underline {
    text-decoration: underline;
}

.st-pv-underline2 {
    text-decoration: underline;
    text-decoration-style: double;
}

.st-pv-overline {
    text-decoration: overline;
}

.st-pv-wavy {
    text-decoration: underline;
    text-decoration-style: wavy;
}

/* 斜删除线：CSS 没有对角划线，用背景渐变在每个字上画一条斜线。
   注意不能用「绝对定位伪元素」——预览容器会折行，伪元素的包含块会退化成整个块，
   结果画成一整条大斜线；改用背景层则每个字各自生效。 */
.st-pv-slash,
.st-pv-strikeSlash {
    background-repeat: no-repeat;
    background-position: 0 50%;
    background-size: 100% 1.05em;
    background-image: linear-gradient(to top right,
        transparent 44%, currentColor 44%, currentColor 56%, transparent 56%);
}

/* 删除线 + 斜线：再叠一层水平线 */
.st-pv-strikeSlash {
    background-image:
        linear-gradient(to top right,
            transparent 44%, currentColor 44%, currentColor 56%, transparent 56%),
        linear-gradient(to bottom,
            transparent calc(50% - 0.5px), currentColor calc(50% - 0.5px),
            currentColor calc(50% + 0.5px), transparent calc(50% + 0.5px));
    background-size: 100% 1.05em, 100% 1.05em;
    background-position: 0 50%, 0 50%;
}

/* ---------- 格式切换 ---------- */

.st-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin: 1rem 0 0.625rem;
}

.st-tab {
    padding: 0.375rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-white);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition-fast);
}

.st-tab:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.st-tab.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: #fff;
}

.st-output {
    width: 100%;
    min-height: 92px;
    padding: 0.75rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--code-bg, #f5f5f5);
    color: var(--text-primary);
    /* 汉字优先：这些中文字体遇到组合符号时会直接丢弃符号，
       不会像微软雅黑 / 等宽字体那样渲染成缺字方框（乱码）。 */
    font-family: "DengXian", "SimSun", "Microsoft YaHei", "Songti SC", sans-serif;
    font-size: 0.875rem;
    line-height: 1.7;
    resize: vertical;
    box-sizing: border-box;
}

/* HTML / Markdown / CSS 三种代码模式改用等宽字体（内容是 ASCII，不涉及叠加符号） */
.st-output-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* 平台无法显示叠加符号时，结果框用同样的 CSS 划线示意。
   文本框内无法逐字绘制，斜线样式用删除线近似。 */
.st-output.deco-strike,
.st-output.deco-slash {
    text-decoration: line-through;
}

.st-output.deco-strike2,
.st-output.deco-strikeSlash {
    text-decoration: line-through;
    text-decoration-style: double;
}

.st-output.deco-underline {
    text-decoration: underline;
}

.st-output.deco-underline2 {
    text-decoration: underline;
    text-decoration-style: double;
}

.st-output.deco-overline {
    text-decoration: overline;
}

.st-output.deco-wavy {
    text-decoration: underline;
    text-decoration-style: wavy;
}

.st-output:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.st-copy-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.625rem;
}

/* ---------- 速查表 ---------- */

.st-table-wrap {
    overflow-x: auto;
}

.st-table {
    width: 100%;
    min-width: 520px;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.st-table thead th {
    padding: 0.625rem 0.75rem;
    background: var(--bg-light);
    border-bottom: 2px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
}

.st-table td {
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    vertical-align: middle;
}

.st-table td:first-child {
    color: var(--text-primary);
    font-weight: 600;
    white-space: nowrap;
}

.st-table tbody tr:hover {
    background: var(--primary-light);
}

/* ---------- 响应式 ---------- */

@media (max-width: 768px) {
    .st-styles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .st-preview {
        font-size: 1.25rem;
    }

    /* 移动端按钮组用 grid 两列：flex-basis 在 column 方向上会变成高度，会把按钮撑高 */
    .st-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.625rem;
    }

    .st-actions .btn {
        flex: none;
        width: auto;
        min-width: 0;
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }

    .st-actions .btn:first-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 400px) {
    .st-styles {
        grid-template-columns: minmax(0, 1fr);
    }

    .st-actions {
        grid-template-columns: minmax(0, 1fr);
    }

    .st-actions .btn:first-child {
        grid-column: auto;
    }

    .st-chip-demo {
        font-size: 1rem;
    }
}
