/* 文本翻译页 - 独立样式 */

.texttranslate-page-content {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.ai-tool-main:has(.texttranslate-page-content) {
    min-width: 0;
}

.ai-tool-main:has(.texttranslate-page-content) .ai-tool-header {
    display: none;
}

.ai-tool-page:has(.texttranslate-page-content) .ai-tool-layout {
    align-items: flex-start;
}

.ai-tool-page:has(.texttranslate-page-content) .ai-tool-sidebar {
    position: sticky;
    top: 76px;
    align-self: flex-start;
    flex: 0 0 200px;
    width: 200px;
    height: fit-content;
    max-height: calc(100vh - 92px);
    z-index: 20;
}

.texttranslate-workspace {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: calc(100vh - 200px);
    box-sizing: border-box;
}

/* Hero 区 */
.texttranslate-hero {
    padding: 16px 20px;
    border-radius: 14px;
    background: linear-gradient(135deg, #0a1628 0%, #1a3a6b 45%, #2563eb 100%);
    color: #fff;
    box-shadow: 0 8px 28px rgb(37 99 235 / 22%);
}
.texttranslate-hero-main {}
.texttranslate-hero-title {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.02em;
}
.texttranslate-hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}
.texttranslate-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    opacity: .9;
}
.texttranslate-hero-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #60a5fa;
    display: inline-block;
}
.texttranslate-hero-desc {
    margin: 0;
    font-size: 13px;
    opacity: .85;
    line-height: 1.6;
}

/* 语言栏 */
.texttranslate-lang-bar {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #e8eef5;
    background: #fff;
}
.texttranslate-lang-bar-inner {
    display: flex;
    align-items: center;
    flex: 1;
    height: 48px;
    white-space: nowrap;
}
.texttranslate-lang-group {
    display: flex;
    align-items: center;
    flex: 1;
    overflow: visible;
    padding-left: 12px;
    position: relative;
}
.texttranslate-lang-tabs {
    position: relative;
    display: flex;
}
.texttranslate-lang-tab {
    padding: 0 8px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    outline: none;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    color: #5f6368;
    min-width: 75px;
    border-bottom: 2px solid #fff;
}
.texttranslate-lang-tab:hover {
    background: #f9f9f9;
}
.texttranslate-lang-tab.is-active {
    border-bottom-color: #1a73e8;
    color: #1a73e8;
}
.texttranslate-lang-dropdown-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-right: 16px;
    border: none;
    outline: none;
    border-radius: 50%;
    background: #fff;
    color: #5f6368;
    cursor: pointer;
    flex-shrink: 0;
}
.texttranslate-lang-dropdown-btn:hover {
    background: #f1f3f4;
}
.texttranslate-lang-swap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 0 4px;
    border: none;
    border-radius: 50%;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .2s, color .2s;
}
.texttranslate-lang-swap:hover {
    background: #eff6ff;
    color: #2563eb;
}

/* 语言下拉面板 */
.texttranslate-lang-dropdown {
    display: none;
    position: absolute;
    left: 0;
    top: 48px;
    width: 100%;
    z-index: 10;
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    box-shadow: 0 2px 2px rgb(0 0 0 / 22%);
    padding: 10px 5px;
    box-sizing: border-box;
}
.texttranslate-lang-dropdown.show {
    display: block;
}
.texttranslate-lang-search {
    padding: 8px 12px;
    border-bottom: 1px solid #e8eaed;
    display: flex;
    align-items: center;
    gap: 8px;
}
.texttranslate-lang-search-input {
    flex: 1;
    min-width: 0;
    height: 40px;
    border: 0;
    outline: none;
    font-size: 16px;
    color: #3c4043;
    background: transparent;
}
.texttranslate-lang-search-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}
.texttranslate-lang-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #5f6368;
    cursor: pointer;
    flex-shrink: 0;
}
.texttranslate-lang-search-btn:hover {
    background: #f1f3f4;
    color: #202124;
}
.texttranslate-lang-search-btn svg {
    fill: #5f6368;
    display: block;
}
.texttranslate-lang-search-btn:hover svg {
    fill: #202124;
}
.texttranslate-lang-list {
    margin-top: 10px;
}
.texttranslate-lang-list::after {
    content: "";
    display: table;
    clear: both;
}
.texttranslate-lang-item {
    display: block;
    float: left;
    height: 30px;
    line-height: 30px;
    padding: 0 8px;
    color: #333;
    text-decoration: none;
    width: 20%;
    box-sizing: border-box;
    cursor: pointer;
}
.texttranslate-lang-item:hover {
    background: #f8f8f8;
    color: #555;
}
.texttranslate-lang-item.is-selected {
    background: #e8f0fe;
    color: #185abc;
}

/* hint */
.texttranslate-hint-line {
    display: flex;
    justify-content: flex-end;
    padding: 6px 12px 10px;
    background: #fff;
}
.texttranslate-hint {
    font-size: 12px;
    color: #94a3b8;
}
.texttranslate-hint kbd {
    padding: 2px 6px;
    border-radius: 4px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    font-size: 11px;
}

/* 示例 */
.texttranslate-samples {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-bottom: 1px solid #eef2f7;
    background: #fafbfc;
}
.texttranslate-samples-label {
    font-size: 13px;
    color: #64748b;
}
.texttranslate-sample-btn {
    padding: 5px 12px;
    border-radius: 8px;
    border: 1px dashed #cbd5e1;
    background: #fff;
    font-size: 13px;
    color: #475569;
    cursor: pointer;
}
.texttranslate-sample-btn:hover {
    border-color: #3b82f6;
    color: #2563eb;
}

/* 主容器 */
.texttranslate-main {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgb(0 0 0 / 6%);
    position: relative;
}

/* 双栏面板 */
.texttranslate-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 16px;
}
.texttranslate-panel {
    display: flex;
    flex-direction: column;
    min-height: 220px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}
.texttranslate-panel--target {
    background: #f8fafc;
    border-color: #dbeafe;
}
.texttranslate-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid #eef2f7;
    background: #fafbfc;
    flex-shrink: 0;
}
.texttranslate-panel--target .texttranslate-panel-head {
    background: #f1f5f9;
}
.texttranslate-panel-title {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.texttranslate-panel-title--target {
    color: #2563eb;
}
.texttranslate-panel-tools {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.texttranslate-panel-body {
    flex: 1;
    min-height: 140px;
    padding: 0;
}
.texttranslate-panel-body--output {
    padding: 12px 16px;
}
.texttranslate-textarea {
    display: block;
    width: 100%;
    min-height: 140px;
    padding: 14px 16px;
    border: none;
    outline: none;
    resize: vertical;
    font-size: 20px;
    line-height: 1.5;
    color: #1e293b;
    font-family: inherit;
    background: transparent;
    box-sizing: border-box;
}
.texttranslate-textarea:focus {
    outline: none;
}
.texttranslate-output {
    font-size: 20px;
    line-height: 1.5;
    color: #1e293b;
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 120px;
}
.texttranslate-panel-foot {
    display: flex;
    justify-content: flex-end;
    padding: 8px 14px;
    border-top: 1px solid #eef2f7;
    flex-shrink: 0;
}
.texttranslate-char-count {
    font-size: 12px;
    color: #94a3b8;
}

/* 按钮 */
.texttranslate-icon-btn {
    padding: 6px 10px;
    border: none;
    border-radius: 6px;
    background: transparent;
    font-size: 12px;
    color: #64748b;
    cursor: pointer;
}
.texttranslate-icon-btn:hover {
    background: #eff6ff;
    color: #2563eb;
}
.texttranslate-icon-btn--icon {
    padding: 6px;
    line-height: 0;
    color: #64748b;
    background: transparent;
}
.texttranslate-icon-btn--icon svg {
    fill: #64748b;
}
.texttranslate-icon-btn--icon:hover {
    background: #eff6ff;
    color: #2563eb;
}
.texttranslate-icon-btn--icon:hover svg {
    fill: #2563eb;
}

/* 输出占位 */
.texttranslate-output-empty,
.texttranslate-loading {
    color: #94a3b8;
    font-size: 15px;
}
.texttranslate-loading {
    color: #64748b;
}

/* 特性 */
.texttranslate-features {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.texttranslate-features li {
    padding: 16px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e8eef5;
    box-shadow: 0 2px 8px rgb(0 0 0 / 4%);
}
.texttranslate-features strong {
    display: block;
    font-size: 14px;
    color: #1e293b;
    margin-bottom: 4px;
}
.texttranslate-features span {
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
}
.texttranslate-features a {
    color: #2563eb;
    text-decoration: none;
}
.texttranslate-features a:hover {
    text-decoration: underline;
}

/* 响应式 */
@media screen and (max-width: 900px) {
    .texttranslate-panels {
        grid-template-columns: 1fr;
    }
    .texttranslate-features {
        grid-template-columns: repeat(2, 1fr);
    }
    .texttranslate-lang-item {
        width: 33.33%;
    }
}
@media screen and (max-width: 560px) {
    .texttranslate-features {
        grid-template-columns: 1fr;
    }
    .texttranslate-lang-item {
        width: 50%;
    }
}
