/* 扩句训练器 /tool/expand-sentence 样式（v2 - 打开即玩版） */

/* 主布局：单栏为主 */
.es-main {
    margin-bottom: 24px;
}

/* ============ 顶部小工具栏 ============ */
.es-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    margin-bottom: 14px;
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
}
.es-toolbar-left,
.es-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.es-toolbar-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--c-text-sub);
}

/* 难度 mini 按钮 */
.es-level-mini { display: flex; gap: 3px; }
.es-mini-btn {
    padding: 5px 10px;
    border: 1px solid var(--c-border);
    border-radius: 99px;
    background: var(--c-surface-soft);
    font-family: inherit;
    font-size: 12px;
    color: var(--c-text);
    cursor: pointer;
    transition: all .14s ease;
}
.es-mini-btn:hover { border-color: #ea580c; color: #ea580c; }
.es-mini-btn.active {
    background: #ea580c;
    color: #fff;
    border-color: #ea580c;
}

/* 主题 emoji mini */
.es-topic-mini { display: flex; gap: 3px; }
.es-mini-chip {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--c-border);
    border-radius: 50%;
    background: var(--c-surface-soft);
    font-size: 16px;
    cursor: pointer;
    transition: all .14s ease;
    padding: 0;
}
.es-mini-chip:hover { border-color: #ea580c; transform: scale(1.1); }
.es-mini-chip.active {
    background: #ea580c;
    border-color: #ea580c;
    box-shadow: 0 0 0 3px rgba(234,88,12,.2);
}

/* 换一个按钮 */
.es-refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: 1px solid #ea580c;
    border-radius: 99px;
    background: transparent;
    color: #ea580c;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all .14s ease;
}
.es-refresh-btn:hover { background: rgba(234,88,12,.08); transform: translateY(-1px); }
.es-refresh-btn:disabled { opacity: .5; cursor: not-allowed; }
.refresh-icon { font-size: 14px; }

/* ============ 加载中 ============ */
.es-loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--c-text-muted);
}
.loading-spinner {
    width: 36px;
    height: 36px;
    margin: 0 auto 12px;
    border: 3px solid var(--c-border);
    border-top-color: #ea580c;
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ 工作卡 ============ */
.es-work-card {
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 22px;
}

/* ============ 基础句来源切换 tab ============ */
.es-source-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    background: var(--c-surface-soft);
    border-radius: 99px;
    padding: 3px;
    width: fit-content;
}
.es-source-tab {
    padding: 6px 14px;
    border: none;
    border-radius: 99px;
    background: transparent;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--c-text-muted);
    cursor: pointer;
    transition: all .14s ease;
    white-space: nowrap;
}
.es-source-tab:hover { color: var(--c-text-sub); }
.es-source-tab.active {
    background: #ea580c;
    color: #fff;
    box-shadow: 0 1px 4px rgba(234,88,12,.3);
}

/* ============ 基础句 ============ */
.es-basis-box {
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(234,88,12,.08), rgba(249,115,22,.04));
    border: 1px solid rgba(234,88,12,.25);
    border-radius: 14px;
    margin-bottom: 20px;
}
.es-basis-label {
    font-size: 11.5px;
    font-weight: 700;
    color: #ea580c;
    margin-bottom: 6px;
}
.es-basis-sentence {
    font-size: 22px;
    font-weight: 800;
    color: var(--c-text);
    line-height: 1.7;
    letter-spacing: 1px;
}
.es-basis-hint {
    font-size: 12.5px;
    color: var(--c-text-muted);
    margin-top: 6px;
}

/* 手动输入版基础句 */
.es-basis-box--manual {
    background: linear-gradient(135deg, rgba(59,130,246,.08), rgba(59,130,246,.02));
    border-color: rgba(59,130,246,.3);
}
.es-manual-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.es-manual-field {
    flex: 1;
    min-width: 100px;
}
.es-manual-field > label {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 4px;
}
.es-manual-input {
    width: 100%;
    padding: 9px 12px;
    font-size: 15px;
    font-family: inherit;
    color: var(--c-text);
    background: #fff;
    border: 1.5px solid var(--c-border);
    border-radius: 10px;
    outline: none;
    transition: border-color .16s ease;
    box-sizing: border-box;
}
.es-manual-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.es-manual-input::placeholder { color: var(--c-text-muted); font-size: 12.5px; }
.es-manual-sep {
    font-size: 18px;
    font-weight: 800;
    color: #3b82f6;
    padding-bottom: 9px;
    flex: none;
}

/* 黑夜模式手动输入 */
[data-theme="dark"] .es-manual-input {
    background: var(--c-surface-soft);
    color: var(--c-text);
}

/* ============ 4步引导 ============ */
.es-steps { margin-bottom: 18px; }
.es-step {
    padding: 12px 14px;
    margin-bottom: 10px;
    border: 1px solid var(--c-border);
    border-radius: 12px;
    background: var(--c-surface-soft);
}
.es-step-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.es-step-num {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    flex: none;
}
.es-step--time .es-step-num    { background: #3b82f6; }
.es-step--place .es-step-num   { background: #10b981; }
.es-step--action .es-step-num  { background: #f59e0b; }
.es-step--feeling .es-step-num { background: #ec4899; }

.es-step-title { font-size: 14px; font-weight: 800; color: var(--c-text); }
.es-step-desc {
    font-size: 11.5px;
    color: var(--c-text-muted);
    margin-left: auto;
}

.es-step-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.es-chip {
    padding: 6px 12px;
    border: 1px solid var(--c-border);
    border-radius: 99px;
    background: #fff;
    font-family: inherit;
    font-size: 13px;
    color: var(--c-text);
    cursor: pointer;
    transition: all .14s ease;
    white-space: nowrap;
}
.es-chip:hover {
    border-color: #ea580c;
    color: #ea580c;
    background: rgba(234,88,12,.06);
    transform: translateY(-1px);
}
.es-chip:active { transform: scale(.96); }

/* ============ 扩写输入区 ============ */
.es-expand-box {
    margin-bottom: 16px;
    padding: 16px;
    border: 2px dashed rgba(234,88,12,.35);
    border-radius: 14px;
    background: rgba(234,88,12,.03);
}
.es-expand-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--c-text-sub);
    margin-bottom: 10px;
}
.es-expand-textarea {
    width: 100%;
    padding: 12px 14px;
    font-size: 17px;
    font-family: inherit;
    line-height: 1.9;
    color: var(--c-text);
    background: #fff;
    border: 1.5px solid var(--c-border);
    border-radius: 12px;
    outline: none;
    resize: vertical;
    transition: border-color .16s ease;
    box-sizing: border-box;
}
.es-expand-textarea:focus {
    border-color: #ea580c;
    box-shadow: 0 0 0 3px rgba(234,88,12,.12);
}
.es-expand-textarea::placeholder { color: var(--c-text-muted); font-size: 15px; }
.es-expand-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    justify-content: flex-end;
}
.es-btn {
    height: 40px;
    padding: 0 18px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s ease;
    border: 1.5px solid transparent;
}
.es-btn--primary {
    background: linear-gradient(135deg, #ea580c, #f97316);
    color: #fff;
    border: none;
    box-shadow: 0 2px 8px rgba(234,88,12,.3);
}
.es-btn--primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(234,88,12,.4); }
.es-btn--ghost {
    background: transparent;
    color: var(--c-text-sub);
    border-color: var(--c-border);
}
.es-btn--ghost:hover { border-color: var(--c-primary); color: var(--c-primary); }
.es-btn--block { width: 100%; margin-top: 12px; }
.es-btn:disabled { opacity: .55; cursor: not-allowed; }

/* ============ AI 点评结果 ============ */
.es-review-box {
    padding: 16px;
    border: 1px solid rgba(139,92,246,.35);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(139,92,246,.08), rgba(139,92,246,.02));
    margin-top: 14px;
}
.es-review-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px dashed rgba(139,92,246,.25);
}
.es-stars {
    font-size: 22px;
    letter-spacing: 2px;
    color: #f59e0b;
}
.es-stars .star-empty { color: #d1d5db; }
.es-review-score { font-size: 14px; font-weight: 800; color: var(--c-text); }
.es-teacher-comment {
    font-size: 14px;
    line-height: 1.9;
    color: var(--c-text);
    padding: 10px 12px;
    background: rgba(255,255,255,.6);
    border-radius: 10px;
    margin-bottom: 12px;
    font-style: italic;
}
.es-review-section { margin-bottom: 12px; }
.es-section-title {
    font-size: 12.5px;
    font-weight: 800;
    color: var(--c-text-sub);
    margin-bottom: 6px;
}
.es-highlight-list,
.es-suggest-list { list-style: none; padding: 0; margin: 0; }
.es-highlight-list li,
.es-suggest-list li {
    font-size: 13px;
    line-height: 1.7;
    padding: 5px 10px;
    border-radius: 8px;
    margin-bottom: 4px;
}
.es-highlight-list li {
    background: rgba(22,163,74,.1);
    color: var(--c-text-sub);
}
.es-suggest-list li {
    background: rgba(245,158,11,.1);
    color: var(--c-text-sub);
}
.es-model-sentence {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.9;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(139,92,246,.1);
    border: 1px solid rgba(139,92,246,.3);
    color: var(--c-text);
}

/* ============ 参考词库 ============ */
.es-ref-section {
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 22px;
    margin-bottom: 24px;
}
.es-ref-title { font-size: 16px; font-weight: 800; margin-bottom: 4px; }
.es-ref-hint { font-size: 12.5px; color: var(--c-text-muted); margin-bottom: 14px; }
.es-ref-tabs { display: flex; gap: 4px; margin-bottom: 14px; flex-wrap: wrap; }
.es-ref-tab {
    padding: 7px 14px;
    border: 1px solid var(--c-border);
    border-radius: 99px;
    background: var(--c-surface-soft);
    font-family: inherit;
    font-size: 12.5px;
    color: var(--c-text-sub);
    cursor: pointer;
    transition: all .14s ease;
}
.es-ref-tab:hover { border-color: #ea580c; color: #ea580c; }
.es-ref-tab.active {
    background: #ea580c;
    color: #fff;
    border-color: #ea580c;
}
.es-ref-pane { display: none; }
.es-ref-pane.active { display: block; }
.es-ref-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.es-ref-item {
    padding: 6px 12px;
    border-radius: 99px;
    background: #fff;
    border: 1px solid var(--c-border);
    font-size: 13px;
    color: var(--c-text);
    cursor: pointer;
    transition: all .14s ease;
    user-select: none;
}
.es-ref-item:hover {
    border-color: #ea580c;
    color: #ea580c;
    background: rgba(234,88,12,.06);
    transform: translateY(-1px);
}

/* ============ 点击效果 ============ */
.es-tap-pop { animation: esTapPop .25s ease; }
@keyframes esTapPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

/* ============ 响应式 ============ */
@media (max-width: 640px) {
    .es-toolbar { padding: 8px 10px; }
    .es-basis-sentence { font-size: 18px; letter-spacing: 0; }
    .es-step-chips { gap: 5px; }
    .es-chip { padding: 4px 10px; font-size: 12px; }
    .es-expand-textarea { font-size: 15px; }
    .es-ref-grid { gap: 6px; }
    .es-ref-item { padding: 5px 10px; font-size: 12px; }
}

/* ============ 黑夜模式 ============ */
[data-theme="dark"] .es-chip { background: var(--c-surface-soft); }
[data-theme="dark"] .es-ref-item { background: var(--c-surface-soft); }
[data-theme="dark"] .es-teacher-comment { background: rgba(255,255,255,.05); }
[data-theme="dark"] .es-expand-textarea {
    background: var(--c-surface-soft);
    color: var(--c-text);
}
[data-theme="dark"] .es-stars { color: #fbbf24; }
