/* ==================== EPUB 转 TXT ==================== */

/* --- Hero 区域 --- */
.et-hero {
    position: relative;
    min-height: 52vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    padding: calc(var(--navbar-height) + var(--space-lg)) var(--space-sm) var(--space-lg);
    background: var(--bg-dark);
}

.et-hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.et-gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.16;
    animation: etOrbFloat 9s ease-in-out infinite;
}

.et-gradient-orb.orb-1 {
    width: 420px;
    height: 420px;
    background: var(--primary);
    top: -130px;
    right: -110px;
}

.et-gradient-orb.orb-2 {
    width: 320px;
    height: 320px;
    background: var(--secondary);
    bottom: -100px;
    left: -90px;
    animation-delay: -3s;
}

.et-gradient-orb.orb-3 {
    width: 260px;
    height: 260px;
    background: var(--accent);
    top: 42%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.09;
    animation-delay: -6s;
}

@keyframes etOrbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(26px, -28px) scale(1.05); }
    66% { transform: translate(-18px, 22px) scale(0.95); }
}

.et-hero-content {
    position: relative;
    z-index: 1;
    max-width: 760px;
}

.et-hero-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.et-hero-title .title-line {
    color: var(--text-primary);
    opacity: 0.9;
}

.et-hero-title .title-accent {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.et-hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
    font-weight: 500;
}

.et-hero-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    max-width: 620px;
    margin: 0 auto;
    line-height: 1.85;
}

.et-hero-tags {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: var(--space-sm);
}

.et-hero-tags span {
    padding: 5px 14px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(79, 142, 247, 0.32);
    background: rgba(79, 142, 247, 0.12);
    color: var(--primary);
    font-size: 13px;
}

/* --- 主体 --- */
.et-main {
    padding: var(--space-lg) 0 var(--space-xl);
    min-height: 50vh;
}

.et-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    align-items: start;
}

.et-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
}

.et-panel .section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border);
}

/* --- 拖拽上传区 --- */
.et-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: var(--space-lg) var(--space-md);
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    background: rgba(79, 142, 247, 0.04);
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

.et-drop:hover,
.et-drop:focus-visible,
.et-drop.is-dragging {
    border-color: var(--primary);
    background: rgba(79, 142, 247, 0.12);
    outline: none;
    transform: translateY(-2px);
}

.et-drop-icon {
    width: 46px;
    height: 46px;
    color: var(--primary);
    opacity: 0.9;
}

.et-drop-title {
    font-size: 15px;
    color: var(--text-primary);
}

.et-drop-title em {
    font-style: normal;
    color: var(--primary);
    font-weight: 600;
}

.et-drop-hint {
    font-size: 12.5px;
    color: var(--text-secondary);
}

/* --- 文件信息卡 --- */
.et-file-card {
    margin-top: var(--space-sm);
    padding: var(--space-sm);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-card-hover);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.et-file-head {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1 1 auto;
}

.et-file-head > div {
    flex: 1 1 auto;
    min-width: 0;
}

.et-file-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 12px;
    background: rgba(79, 142, 247, 0.14);
    color: var(--primary);
}

.et-file-icon svg {
    width: 22px;
    height: 22px;
}

.et-file-head b {
    display: block;
    font-size: 15px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 320px;
}

.et-file-head small {
    display: block;
    margin-top: 4px;
    font-size: 12.5px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 320px;
}

.et-file-actions {
    display: flex;
    gap: 8px;
}

.et-format-badge {
    flex: 0 0 auto;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(79, 142, 247, 0.4);
    background: rgba(79, 142, 247, 0.14);
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.4px;
}

/* --- 输出格式切换 --- */
.et-output-tabs {
    display: flex;
    gap: 6px;
    padding: 4px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.05);
    margin-bottom: var(--space-md);
}

.et-output-tab {
    flex: 1 1 0;
    padding: 9px 8px;
    border-radius: var(--radius-full);
    font-size: 13.5px;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.et-output-tab:hover {
    color: var(--text-primary);
}

.et-output-tab.is-active {
    background: var(--gradient-primary);
    color: #fff;
    font-weight: 600;
}

.et-input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-dark);
    color: var(--text-primary);
    font-size: 13.5px;
    font-family: inherit;
}

.et-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 142, 247, 0.16);
}

.et-warning {
    margin-top: var(--space-sm);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(245, 166, 35, 0.4);
    background: rgba(245, 166, 35, 0.12);
    color: #ffd399;
    font-size: 13px;
    line-height: 1.7;
}

/* --- 通用小按钮 --- */
.et-btn-ghost {
    padding: 7px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    transition: all var(--transition-fast);
}

.et-btn-ghost:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(79, 142, 247, 0.1);
}

/* --- 进度与错误 --- */
.et-progress {
    margin-top: var(--space-sm);
}

.et-progress-track {
    height: 6px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.et-progress-track span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    transition: width 200ms ease;
}

.et-progress-text {
    margin-top: 8px;
    font-size: 12.5px;
    color: var(--text-secondary);
}

.et-error {
    margin-top: var(--space-sm);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 107, 53, 0.42);
    background: rgba(255, 107, 53, 0.12);
    color: #ffb08a;
    font-size: 13.5px;
    line-height: 1.7;
}

/* --- 选项 --- */
.et-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.et-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
}

.et-option label {
    font-size: 14px;
    color: var(--text-primary);
    flex: 0 0 auto;
}

.et-select {
    flex: 1 1 auto;
    min-width: 0;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-dark);
    color: var(--text-primary);
    font-size: 13.5px;
    font-family: inherit;
}

.et-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 142, 247, 0.16);
}

.et-switch {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    line-height: 1.5;
}

.et-switch input {
    width: 18px;
    height: 18px;
    margin-top: 1px;
    accent-color: var(--primary);
    cursor: pointer;
    flex: 0 0 auto;
}

.et-tip {
    margin-top: var(--space-md);
    padding-top: var(--space-sm);
    border-top: 1px dashed var(--border);
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* --- 结果区 --- */
.et-result {
    margin-top: var(--space-md);
}

.et-result-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    flex-wrap: wrap;
    margin-bottom: var(--space-sm);
}

.et-result-head .section-title {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.et-result-actions {
    display: flex;
    gap: 10px;
}

.et-result-actions .btn {
    padding: 10px 22px;
    font-size: 14px;
}

/* --- 统计 --- */
.et-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: var(--space-sm) 0 var(--space-md);
}

.et-stat {
    padding: 14px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(79, 142, 247, 0.06);
    text-align: center;
}

.et-stat span {
    display: block;
    font-size: 19px;
    font-weight: 600;
    color: var(--primary);
    word-break: break-all;
}

.et-stat small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* --- 标签页 --- */
.et-tabs {
    display: flex;
    gap: 8px;
    padding: 4px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.05);
    width: fit-content;
    margin-bottom: var(--space-sm);
}

.et-tab {
    padding: 8px 18px;
    border-radius: var(--radius-full);
    font-size: 13.5px;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.et-tab em {
    font-style: normal;
    opacity: 0.75;
    font-size: 12.5px;
}

.et-tab.is-active {
    background: var(--gradient-primary);
    color: #fff;
    font-weight: 600;
}

/* --- 章节列表 --- */
.et-chapter-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: var(--space-sm);
}

.et-search {
    flex: 1 1 220px;
    min-width: 0;
    padding: 9px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: var(--bg-dark);
    color: var(--text-primary);
    font-size: 13.5px;
    font-family: inherit;
}

.et-search:focus {
    outline: none;
    border-color: var(--primary);
}

.et-chapter-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.et-chapters {
    max-height: 460px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.18);
    padding: 6px;
    scrollbar-width: thin;
}

.et-chapters::-webkit-scrollbar {
    width: 8px;
}

.et-chapters::-webkit-scrollbar-thumb {
    background: rgba(139, 148, 158, 0.4);
    border-radius: 4px;
}

.et-chapter {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.et-chapter:hover {
    background: rgba(79, 142, 247, 0.1);
}

.et-chapter.is-muted {
    opacity: 0.72;
}

.et-chapter input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    flex: 0 0 auto;
    cursor: pointer;
}

.et-chapter-info {
    flex: 1 1 auto;
    min-width: 0;
}

.et-chapter-info b {
    display: block;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.et-chapter-info i {
    display: block;
    margin-top: 2px;
    font-size: 11.5px;
    font-style: normal;
    color: var(--text-secondary);
}

.et-chapter-tag {
    flex: 0 0 auto;
}

.et-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    white-space: nowrap;
}

.et-tag-warn {
    background: rgba(245, 166, 35, 0.16);
    border: 1px solid rgba(245, 166, 35, 0.4);
    color: var(--secondary);
}

.et-tag-mute {
    background: rgba(139, 148, 158, 0.16);
    border: 1px solid rgba(139, 148, 158, 0.34);
    color: var(--text-secondary);
}

.et-chapter-empty {
    padding: 24px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13.5px;
}

/* --- 预览 --- */
.et-preview-info {
    font-size: 12.5px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.et-preview-box {
    width: 100%;
    height: 460px;
    padding: 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.22);
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.85;
    font-family: 'Noto Sans SC', 'Inter', system-ui, sans-serif;
    resize: vertical;
}

.et-preview-box:focus {
    outline: none;
    border-color: var(--primary);
}

/* --- 说明 / FAQ --- */
.et-faq {
    margin-top: var(--space-xl);
}

.et-faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.et-faq-item {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-card);
}

.et-faq-item h3 {
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.et-faq-item p {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.85;
}

/* --- 响应式 --- */
@media (max-width: 980px) {
    .et-layout {
        grid-template-columns: 1fr;
    }

    .et-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .et-file-head b,
    .et-file-head small {
        max-width: 200px;
    }
}

@media (max-width: 560px) {
    .et-panel {
        padding: var(--space-sm);
    }

    .et-output-tabs {
        flex-direction: column;
        border-radius: var(--radius-md);
    }

    .et-output-tab {
        border-radius: var(--radius-sm);
        text-align: center;
    }

    .et-stat span {
        font-size: 16px;
    }

    .et-result-actions {
        width: 100%;
    }

    .et-result-actions .btn {
        flex: 1 1 auto;
        justify-content: center;
    }

    .et-chapter-btns {
        width: 100%;
    }

    .et-preview-box,
    .et-chapters {
        height: 380px;
        max-height: 380px;
    }
}
