﻿/* ============================================================
   txt.css - 文本编辑器页面 (txt) 专用样式
   借用 style.css 中已定义的 CSS 变量 (--bg-*, --text-*, --accent, --border, --radius-*)
   不修改 style.css；本文件仅声明 txt的布局/控件样式。
   兼容桌面端 + 移动端。
   ============================================================ */

/* ---------- 容器 ---------- */
#texttospeech {
    text-align: center;
    width: 100%;
    max-width: calc(var(--max-width) * 2);
    margin: 0 auto;
    padding: calc(var(--nav-height) + 15px) 15px 0;
    background: var(--bg-primary);
    color: var(--text-primary);
    box-sizing: border-box;
}

#texttospeech h1 {
    color: var(--text-primary);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: 1px;
    display: none;
}

#texttospeech .subtitle {
    color: var(--text-secondary);
    font-size: .95rem;
    margin-bottom: 20px;
}

/* ---------- 字数统计 ---------- */
#option {
    width: 100%;
    max-width: 1920px;
    margin: 0 auto 16px;
    //text-align: left;
    text-align: center;
    font-size: 1rem;
    line-height: 1.85;
    color: var(--text-secondary);
    //background: var(--bg-card);
    //border: 1px solid var(--border);
    //border-radius: var(--radius-md);
    //padding: 14px 18px;
    box-sizing: border-box;
}

#option strong {
    color: var(--accent);
    font-weight: 600;
}

#option span {
    color: var(--text-primary);
    min-width: 6px;
    display: inline-block;
}

/* ---------- 工具条 ---------- */
#speech {
    width: 100%;
    max-width: 1920px;
    margin: 0 auto 16px;
    //padding: 10px;
    //background: var(--bg-card);
    //border: 1px solid var(--border);
    //border-radius: var(--radius-md);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    box-sizing: border-box;
}

/* ---------- 工具条按钮（统一外观，替代原 #link/#linkcopy） ---------- */
#speech .btn-tool,
#speech .btn-tool-accent {
    font-size: .9rem;
    padding: 7px 12px;
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    line-height: 1.4;
    min-width: 48px;
    text-align: center;
    transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.05s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    outline: none;
    white-space: nowrap;
}

#speech .btn-tool:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 500;
}

#speech .btn-tool:active {
    transform: translateY(1px);
}

#speech .btn-tool:focus-visible {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-bg);
}

/* 强调按钮（复制/剪切/撤销/复原/存档/载入） */
#speech .btn-tool-accent {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 500;
}

#speech .btn-tool-accent:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

/* 隐藏的 file input */
#speech input[type="file"] {
    display: none;
}

/* 隐藏 number 输入框的 spin button */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] { -moz-appearance: textfield; }

/* ---------- 文本框 ---------- */
#text {
    width: 90%;
    max-width: 1920px;
    height: 60vh;
    min-height: 520px;
    font-size: 1.05rem;
    line-height: 1.7;
    padding: 14px 18px;
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor:pointer;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
    resize: vertical;
    font-family: inherit;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #bbb transparent;
    -webkit-overflow-scrolling: touch;
}
#text::-webkit-scrollbar {width: 1px;}
#text::-webkit-scrollbar-thumb {border-radius: 10px;}
#text:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-bg);
}

#text::placeholder {
    color: var(--text-tertiary);
}

/* 滚动条样式（WebKit） */
#text::-webkit-scrollbar {
    width: 8px;
}
#text::-webkit-scrollbar-track {
    background: transparent;
}
#text::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}
#text::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

/* sup 上标 */
sup {
    color: var(--text-tertiary);
    font-size: .6em;
}
.tvso_img{display:none; position:absolute; cursor:pointer;width: 24px;height: 24px;border-radius: 22px;z-index: 9999;}
/* ---------- 响应式：移动端 ---------- */
@media (max-width: 768px) {
    #texttospeech {
        padding: calc(var(--nav-height) + 5px) 5px 0;
    }
    #texttospeech h1 {
        font-size: 1.4rem;
        display: block;

    }
    #option {
        font-size: .85rem;
        line-height: 1.7;
        padding: 0 5px;
    }
    #speech {
        padding: 0;
        gap: 5px;
    }
    #speech .btn-tool,
    #speech .btn-tool-accent {
        padding: 6px 9px;
        font-size: .82rem;
        min-width: 42px;
        flex: 0 0 auto;
    }
    #text {
        width: 100%;
        font-size: 1rem;
        height: 50vh;
        min-height: 240px;
        padding: 12px 14px;
    }
}

@media (max-width: 480px) {
    #speech .btn-tool,
    #speech .btn-tool-accent {
        padding: 6px 8px;
        font-size: .78rem;
        min-width: 38px;
    }
}

/* ---------- 打印 ---------- */
@media print {
    #speech, #option,.navbar, .texttospeech h1 { display: none; }
    #text {
        height: auto;
        min-height: 640px;
        border: none;
        background: #fff;
        color: #000;
    }
}
