/* =============================================
   作文范文 - essay_samples.css
   三栏布局，仿纸质作文本预览风格
   主色调：暖琥珀 #92400e + 金黄 #d97706
   ============================================= */

/* ========== 主容器 ========== */
.es-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #fffbeb;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
    transition: box-shadow 0.3s ease, background 0.3s ease;
}

.es-container.fullscreen {
    position: fixed;
    top: 0; left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
    min-height: unset;
}

/* ========== 顶部工具栏 ========== */
.es-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: linear-gradient(135deg, #92400e 0%, #d97706 100%);
    color: white;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(146, 64, 14, 0.4);
    flex-shrink: 0;
}

.es-toolbar .toolbar-title {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    letter-spacing: 0.5px;
    margin-right: 8px;
}

.es-toolbar .toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    min-height: 28px;
}

.es-toolbar .toolbar-btn {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.92);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #92400e;
    transition: all 0.2s;
    white-space: nowrap;
}

.es-toolbar .toolbar-btn:hover:not(:disabled) {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.es-toolbar .toolbar-btn:active:not(:disabled) { transform: translateY(0); }

.es-toolbar .toolbar-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.es-toolbar .toolbar-btn-primary {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.4);
}

.es-toolbar .toolbar-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.5);
    color: #fff;
}

/* Shake 抖动校验动画 */
@keyframes esShake {
    0%, 100% { transform: translateX(0); }
    10%, 50%, 90% { transform: translateX(-5px); }
    30%, 70% { transform: translateX(5px); }
}

.es-input.shake,
.es-select.shake,
.es-textarea.shake {
    animation: esShake 0.5s ease-in-out;
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important;
}

/* ========== 主内容区：三栏布局 ========== */
.es-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #fffbeb;
}

/* ========== 左栏：历史记录 ========== */
.es-history-panel {
    width: 200px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #fde68a;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.es-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: linear-gradient(to bottom, #fefce8 0%, #fef9c3 100%);
    border-bottom: 1px solid #fde68a;
    flex-shrink: 0;
}

.es-history-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #78350f;
}

.es-history-count {
    font-size: 11px;
    color: #b45309;
    font-weight: 400;
}

.es-history-clear {
    background: #fff0f0;
    border: none;
    color: #ef4444;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 7px;
    border-radius: 3px;
    transition: background 0.2s;
    white-space: nowrap;
}

.es-history-clear:hover { background: #fde8e8; }

.es-history-search {
    padding: 8px;
    border-bottom: 1px solid #fde68a;
    flex-shrink: 0;
    position: relative;
}

.es-history-search input {
    width: 100%;
    padding: 6px 26px 6px 10px;
    border: 1px solid #fde68a;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #374151;
    background: #fffbeb;
}

.es-history-search input:focus {
    border-color: #d97706;
    box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.12);
    background: #fff;
}

.es-history-search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #b0b7c3;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 3px;
    line-height: 1;
    transition: color 0.2s;
}

.es-history-search-clear:hover { color: #ef4444; }

.es-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
    min-height: 0;
}

.es-history-list::-webkit-scrollbar { width: 4px; }
.es-history-list::-webkit-scrollbar-track { background: transparent; }
.es-history-list:hover::-webkit-scrollbar-track { background: #fef9c3; }
.es-history-list::-webkit-scrollbar-thumb { background: #fcd34d; border-radius: 2px; }
.es-history-list::-webkit-scrollbar-thumb:hover { background: #d97706; }

.es-history-empty {
    text-align: center;
    color: #b45309;
    font-size: 12px;
    padding: 24px 8px;
    user-select: none;
    opacity: 0.6;
}

.es-history-item {
    display: flex;
    flex-direction: column;
    padding: 9px 11px;
    margin: 3px 0;
    background: #fefce8;
    border: 1px solid #fde68a;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    animation: esHiFadeIn 0.2s ease;
}

@keyframes esHiFadeIn {
    from { opacity: 0; transform: translateX(-4px); }
    to   { opacity: 1; transform: translateX(0); }
}

.es-history-item:hover {
    background: #fef3c7;
    border-color: #fbbf24;
    transform: translateX(2px);
}

.es-history-item.active {
    background: #fffbeb;
    border-color: #d97706;
    box-shadow: 0 1px 3px rgba(217, 119, 6, 0.2);
}

.es-history-item-del {
    position: absolute;
    top: 4px; right: 4px;
    width: 18px; height: 18px;
    background: #fde8e8;
    color: #ef4444;
    border: none;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
    padding: 0;
    line-height: 1;
}

.es-history-item:hover .es-history-item-del { opacity: 1; }
.es-history-item-del:hover { background: #ef4444; color: #fff; }

/* 历史标题行：flex 布局，山脉号不会被截断 */
.es-history-item-title {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-right: 22px;
    margin-bottom: 2px;
}

.es-history-item-title-text {
    font-size: 12px;
    font-weight: 600;
    color: #78350f;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.es-history-item-meta {
    font-size: 11px;
    color: #b45309;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.es-history-item-time {
    font-size: 10px;
    color: #92400e;
    opacity: 0.6;
}

/* ========== 中栏：表单输入 ========== */
.es-input-panel {
    width: 370px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #fde68a;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ========== 右栏：作文预览 ========== */
.es-result-panel {
    flex: 1;
    background: #fffbeb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 300px;
}

/* ========== 通用面板头部 ========== */
.es-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    padding: 12px 16px;
    background: linear-gradient(to bottom, #fefce8 0%, #fef9c3 100%);
    border-bottom: 1px solid #fde68a;
    flex-shrink: 0;
    min-height: 44px;
}

.es-panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #78350f;
    white-space: nowrap;
}

.es-panel-tip {
    font-size: 11px;
    color: #b45309;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.es-result-meta {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex-shrink: 1;
    overflow: hidden;
}

.es-result-meta-info {
    font-size: 11px;
    color: #92400e;
    background: #fef3c7;
    padding: 2px 10px;
    border-radius: 10px;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1;
}

.es-result-char-count {
    font-size: 11px;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 10px;
    transition: background 0.25s, color 0.25s;
}

.es-result-char-count.good {
    background: #ecfdf5;
    color: #059669;
}

.es-result-time {
    font-size: 11px;
    color: #b45309;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ========== 表单区域 ========== */
.es-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    min-height: 0;
}

.es-input-body::-webkit-scrollbar { width: 4px; }
.es-input-body::-webkit-scrollbar-track { background: transparent; }
.es-input-body:hover::-webkit-scrollbar-track { background: #fef9c3; }
.es-input-body::-webkit-scrollbar-thumb { background: #fcd34d; border-radius: 2px; }
.es-input-body::-webkit-scrollbar-thumb:hover { background: #d97706; }

.es-section-label {
    font-size: 11px;
    font-weight: 700;
    color: #b45309;
    letter-spacing: 0.5px;
    padding: 0 0 6px 0;
    margin: 6px 0 10px 0;
    border-bottom: 1px solid #fde68a;
    user-select: none;
}

.es-form-group {
    margin-bottom: 12px;
}

.es-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}

.es-required-mark { color: #ef4444; margin-left: 2px; }

.es-label-tip {
    font-size: 11px;
    font-weight: 400;
    color: #9ca3af;
}

.es-input, .es-select, .es-textarea {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #fde68a;
    border-radius: 5px;
    font-size: 13px;
    color: #374151;
    background: #fffbeb;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}

.es-input:focus, .es-select:focus, .es-textarea:focus {
    border-color: #d97706;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1);
}

.es-input:hover:not(:focus),
.es-select:hover:not(:focus),
.es-textarea:hover:not(:focus) {
    border-color: #fbbf24;
    background: #fff;
}

.es-input::placeholder, .es-textarea::placeholder { color: #b0b7c3; }

.es-textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.6;
}

.es-textarea::-webkit-scrollbar { width: 4px; }
.es-textarea::-webkit-scrollbar-thumb { background: #fcd34d; border-radius: 2px; }

.es-textarea-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.es-textarea-hint { font-size: 11px; color: #b0b7c3; user-select: none; }

.es-char-count { font-size: 11px; color: #b0b7c3; transition: color 0.2s; }
.es-char-count.warn   { color: #f97316; font-weight: 600; }
.es-char-count.danger { color: #ef4444; font-weight: 600; }

.es-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23b45309'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

.es-form-row { display: flex; gap: 10px; }
.es-form-half { flex: 1; min-width: 0; }

/* ========== 结果区域 ========== */
.es-result-body {
    flex: 1;
    overflow-y: auto;
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fffbeb;
    min-height: 0;
}

.es-result-body::-webkit-scrollbar { width: 6px; }
.es-result-body::-webkit-scrollbar-track { background: transparent; }
.es-result-body:hover::-webkit-scrollbar-track { background: #fef9c3; }
.es-result-body::-webkit-scrollbar-thumb { background: #fcd34d; border-radius: 3px; }
.es-result-body::-webkit-scrollbar-thumb:hover { background: #d97706; }

/* 占位提示 */
.es-result-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    text-align: center;
    color: #94a3b8;
    user-select: none;
}

.es-placeholder-icon {
    font-size: 52px;
    margin-bottom: 16px;
    opacity: 0.5;
    animation: esFloatIcon 3s ease-in-out infinite;
}

@keyframes esFloatIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.es-placeholder-title {
    font-size: 16px;
    font-weight: 600;
    color: #78350f;
    margin: 0 0 8px;
    opacity: 0.6;
}

.es-placeholder-desc {
    font-size: 13px;
    color: #b45309;
    margin: 0 0 4px;
    opacity: 0.6;
}

.es-placeholder-tip {
    font-size: 12px;
    color: #92400e;
    background: #fef3c7;
    padding: 5px 14px;
    border-radius: 20px;
    margin-top: 12px;
    opacity: 0.8;
}

/* 加载中 */
.es-result-loading {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.es-loading-pen {
    font-size: 40px;
    animation: esPenWrite 1.2s ease-in-out infinite;
    margin-bottom: 16px;
}

@keyframes esPenWrite {
    0%, 100% { transform: rotate(-10deg) translateY(0); }
    50% { transform: rotate(10deg) translateY(-4px); }
}

.es-loading-dots {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.es-loading-dots span {
    width: 8px; height: 8px;
    background: #d97706;
    border-radius: 50%;
    animation: esDotBounce 1.2s ease-in-out infinite;
}

.es-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.es-loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes esDotBounce {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1.2); opacity: 1; }
}

/* 题目输入行 字数计数底部 */
.es-input-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 3px;
}

.es-topic-char-count {
    font-size: 11px;
    color: #b0b7c3;
    transition: color 0.2s;
}

.es-topic-char-count.near-limit { color: #f97316; font-weight: 600; }
.es-topic-char-count.at-limit   { color: #ef4444; font-weight: 600; }

/* 历史字数徽章 - 规范类名 */
.es-history-wordcount-badge {
    display: inline-block;
    font-size: 10px;
    background: #fef3c7;
    color: #92400e;
    border-radius: 8px;
    padding: 1px 5px;
    font-weight: 500;
    flex-shrink: 0;
    white-space: nowrap;
}

.es-loading-text {
    font-size: 14px;
    color: #b45309;
    font-weight: 500;
    transition: opacity 0.3s ease;
    min-height: 20px;
}

.es-loading-text.fade-out { opacity: 0; }

/* ========== 作文纸张 ========== */
.essay-paper-wrap {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #fffbeb;
}

.essay-paper-wrap::-webkit-scrollbar { width: 6px; }
.essay-paper-wrap::-webkit-scrollbar-thumb { background: #fcd34d; border-radius: 3px; }
.essay-paper-wrap::-webkit-scrollbar-thumb:hover { background: #d97706; }

.essay-paper {
    background: #fff;
    border-radius: 4px;
    padding: 36px 44px;
    max-width: 680px;
    margin: 0 auto;
    box-shadow: 0 2px 12px rgba(146, 64, 14, 0.1), 0 6px 24px rgba(146, 64, 14, 0.07);
    border-top: 3px solid #d97706;
    position: relative;
    /* 作文纸网格背景 */
    background-image:
        linear-gradient(rgba(253, 230, 138, 0.3) 1px, transparent 1px);
    background-size: 100% 2em;
    background-position: 0 2.5em;
    line-height: 2em;
}

.essay-paper::before {
    content: '';
    position: absolute;
    top: 0; left: 60px; bottom: 0;
    width: 1px;
    background: rgba(253, 186, 116, 0.4);
    pointer-events: none;
}

.essay-title {
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    color: #1c1917;
    margin-bottom: 1.5em;
    letter-spacing: 2px;
    padding-bottom: 0.5em;
    border-bottom: 1px dashed #fde68a;
    background: transparent;
    line-height: 1.5;
}

.essay-body {
    font-size: 15px;
    color: #292524;
    line-height: 2em;
    overflow-wrap: break-word;
    word-break: break-word;
    background: transparent;
}

.essay-body p {
    margin: 0;
    text-indent: 2em;
}

/* 作文正文区域 Markdown 内容重置 */
.essay-body blockquote,
.result-content blockquote {
    margin: 0;
    padding: 0 0 0 1em;
    border-left: 3px solid #fcd34d;
    color: #78350f;
    background: #fffbeb;
}

/* Markdown 全套标签基础样式 */
.essay-body strong, .result-content strong { font-weight: 700; }
.essay-body em,     .result-content em     { font-style: italic; }

.essay-body h3, .result-content h3 {
    font-size: 16px; font-weight: 700; color: #1c1917;
    margin: 1.2em 0 0.4em; text-indent: 0; line-height: 1.5;
}
.essay-body h4, .result-content h4 {
    font-size: 15px; font-weight: 600; color: #292524;
    margin: 1em 0 0.3em; text-indent: 0; line-height: 1.5;
}
.essay-body h5, .result-content h5 {
    font-size: 14px; font-weight: 600; color: #44403c;
    margin: 0.8em 0 0.3em; text-indent: 0; line-height: 1.5;
}
.essay-body pre, .result-content pre {
    background: #fef9c3;
    border: 1px solid #fde68a;
    border-radius: 4px;
    padding: 10px 14px;
    font-size: 13px;
    overflow-x: auto;
    white-space: pre;
    margin: 0.6em 0;
}
.essay-body code, .result-content code {
    background: #fef3c7;
    color: #92400e;
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 0.9em;
    font-family: ui-monospace, 'Cascadia Mono', monospace;
}
.essay-body pre code, .result-content pre code {
    background: none;
    padding: 0;
    color: #374151;
}

/* 错误区域 */
.es-error-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.es-error-block {
    text-align: center;
}

.es-error-icon { font-size: 42px; margin-bottom: 12px; }

.es-error-title {
    font-size: 15px;
    font-weight: 600;
    color: #ef4444;
    margin: 0 0 6px;
}

.es-error-hint {
    font-size: 12px;
    color: #94a3b8;
    margin: 0 0 16px;
}

.es-error-retry {
    padding: 8px 20px;
    background: linear-gradient(135deg, #92400e 0%, #d97706 100%);
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(146, 64, 14, 0.3);
}

.es-error-retry:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(146, 64, 14, 0.4);
}

/* ========== 示例模态框 ========== */
.es-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.42);
    z-index: 100000;
    backdrop-filter: blur(2px);
}

.es-modal-overlay.anim-in {
    animation: meOverlayFadeIn 0.22s ease forwards;
}

@keyframes meOverlayFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.es-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 680px;
    max-width: calc(100vw - 40px);
    max-height: 80vh;
    background: #fff;
    border-radius: 10px;
    z-index: 100001;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

.es-modal.anim-in {
    animation: meModalSlideIn 0.32s cubic-bezier(.34, 1.4, .64, 1) forwards;
}

@keyframes meModalSlideIn {
    from { opacity: 0; transform: translate(-50%, calc(-50% + 18px)); }
    to   { opacity: 1; transform: translate(-50%, -50%); }
}

.es-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #fde68a;
    flex-shrink: 0;
    background: linear-gradient(135deg, #92400e 0%, #d97706 100%);
    color: #fff;
}

.es-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.es-modal-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 28px; height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.es-modal-close:hover { background: rgba(255, 255, 255, 0.3); }

.es-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
    align-content: start;
    background: #fffbeb;
}

.es-modal-body::-webkit-scrollbar { width: 4px; }
.es-modal-body::-webkit-scrollbar-thumb { background: #fcd34d; border-radius: 2px; }
.es-modal-body::-webkit-scrollbar-thumb:hover { background: #d97706; }

/* 示例卡片 */
.es-example-card {
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
    position: relative;
    overflow: hidden;
}

.es-example-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(135deg, #92400e 0%, #d97706 100%);
    opacity: 0;
    transition: opacity 0.2s;
}

.es-example-card:hover {
    border-color: #fbbf24;
    background: #fefce8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.12);
}

.es-example-card:hover::before { opacity: 1; }

.es-example-card-title {
    font-size: 13px;
    font-weight: 700;
    color: #1c1917;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.es-example-badge {
    font-size: 10px;
    font-weight: 500;
    background: #fef3c7;
    color: #92400e;
    padding: 1px 6px;
    border-radius: 10px;
    white-space: nowrap;
}

.es-example-desc {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.5;
    margin: 0 0 4px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.es-example-import {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
    font-size: 11px;
    font-weight: 600;
    color: #92400e;
    background: #fef3c7;
    border: none;
    border-radius: 4px;
    padding: 3px 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.es-example-import:hover {
    background: #d97706;
    color: #fff;
}

/* ========== 打印样式 ========== */
@media print {
    body > *:not(.component),
    .es-toolbar,
    .es-history-panel,
    .es-input-panel,
    #resultPlaceholder,
    #resultLoading,
    #resultErrorWrap,
    .es-result-meta {
        display: none !important;
    }
    .es-container,
    .es-container.fullscreen {
        position: static !important;
        height: auto;
        box-shadow: none;
        background: #fff;
    }
    .es-main-content { display: block; }
    .es-result-panel { width: 100%; background: #fff; }
    .es-result-body { overflow: visible; background: #fff; }
    .essay-paper-wrap { overflow: visible; background: #fff; padding: 0; }
    .essay-paper {
        box-shadow: none;
        border-top: 2px solid #d97706;
        max-width: 100%;
        padding: 20px 40px;
        background-image: none;
    }
    .essay-paper::before { display: none; }
    .es-panel-header { display: none; }
}

/* ========== 响应式 ========== */
@media (max-width: 1100px) {
    .es-input-panel { width: 320px; }
    .es-panel-tip { display: none; }
}

@media (max-width: 800px) {
    .es-main-content {
        flex-direction: column;
        overflow-y: auto;
    }
    .es-history-panel {
        width: 100%;
        max-height: 160px;
        border-right: none;
        border-bottom: 1px solid #fde68a;
    }
    .es-input-panel {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #fde68a;
        max-height: 400px;
    }
    .es-result-panel {
        width: 100%;
        min-height: 320px;
    }
    .es-form-row { flex-direction: column; }
    .essay-paper { padding: 24px 20px; }
    .es-modal-body { grid-template-columns: 1fr; }
}

/* ========== 暗黑模式 ========== */
body.dark .es-container {
    background: #1c1008;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

body.dark .es-main-content { background: #1c1008; }

body.dark .es-history-panel {
    background: #1e1a14;
    border-color: #3d2f0e;
}

body.dark .es-history-header {
    background: #2a2014;
    border-color: #3d2f0e;
}

body.dark .es-history-header h3 { color: #fcd34d; }
body.dark .es-history-count { color: #d97706; }

body.dark .es-history-search input {
    background: #2a2014;
    border-color: #3d2f0e;
    color: #fde68a;
}

body.dark .es-history-search input:focus {
    border-color: #d97706;
    box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.2);
}

body.dark .es-history-search input::placeholder { color: #6b5a30; }

body.dark .es-history-item {
    background: #2a2014;
    border-color: #3d2f0e;
}

body.dark .es-history-item:hover {
    background: #3a2c14;
    border-color: #d97706;
}

body.dark .es-history-item.active {
    background: #3a2c14;
    border-color: #f59e0b;
}

body.dark .es-history-item-title-text { color: #fde68a; }
body.dark .es-history-item-title { color: #fde68a; }
body.dark .es-history-item-meta  { color: #d97706; }
body.dark .es-history-empty { color: #6b5a30; }

body.dark .es-input-panel {
    background: #1e1a14;
    border-color: #3d2f0e;
}

body.dark .es-result-panel { background: #1c1008; }

body.dark .es-panel-header {
    background: #2a2014;
    border-color: #3d2f0e;
}

body.dark .es-panel-header h3 { color: #fcd34d; }
body.dark .es-panel-tip { color: #6b5a30; }

body.dark .es-result-meta-info { background: #3a2c14; color: #fcd34d; }

body.dark .es-section-label { color: #d97706; border-color: #3d2f0e; }
body.dark .es-form-group label { color: #d4c5a0; }

body.dark .es-input, body.dark .es-textarea {
    background: #2a2014;
    border-color: #3d2f0e;
    color: #fde68a;
}

/* select 必须分离 background-color 和 background-image，防止简写覆盖 SVG 箭头 */
body.dark .es-select {
    background-color: #2a2014;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23d97706'/%3E%3C/svg%3E");
    border-color: #3d2f0e;
    color: #fde68a;
}

body.dark .es-input:focus,
body.dark .es-textarea:focus {
    border-color: #d97706;
    background: #3a2c14;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15);
}

body.dark .es-select:focus {
    border-color: #d97706;
    background-color: #3a2c14;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15);
}

body.dark .es-input:hover:not(:focus),
body.dark .es-textarea:hover:not(:focus) {
    border-color: #b45309;
    background: #332510;
}

body.dark .es-select:hover:not(:focus) {
    border-color: #b45309;
    background-color: #332510;
}

body.dark .es-input::placeholder, body.dark .es-textarea::placeholder { color: #5a4a25; }
body.dark .es-textarea-hint { color: #5a4a25; }

/* 删除独立的 background-image 规则（已并入上方 es-select 块） */

body.dark .es-select option { background: #1e1a14; color: #fde68a; }

body.dark .es-result-body { background: #1c1008; }

body.dark .es-result-placeholder { color: #5a4a25; }
body.dark .es-placeholder-title { color: #d97706; }
body.dark .es-placeholder-desc { color: #8a6a30; }
body.dark .es-placeholder-tip { background: #2a2014; color: #d97706; }

body.dark .es-loading-dots span { background: #d97706; }
body.dark .es-loading-text { color: #d97706; }

body.dark .essay-paper-wrap { background: #1c1008; }

body.dark .essay-paper {
    background: #1e1a14;
    border-top-color: #d97706;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4), 0 6px 24px rgba(0, 0, 0, 0.3);
    background-image: linear-gradient(rgba(61, 47, 14, 0.4) 1px, transparent 1px);
}

body.dark .essay-paper::before { background: rgba(217, 119, 6, 0.2); }

body.dark .essay-title { color: #fde68a; border-color: #3d2f0e; }
body.dark .essay-body  { color: #d4c5a0; }

body.dark .essay-body blockquote { color: #d97706; border-color: #b45309; background: #2a2014; }

/* 暗黑模式 Markdown 全套标签深色覆盖 */
body.dark .essay-body h3, body.dark .result-content h3 { color: #fde68a; }
body.dark .essay-body h4, body.dark .result-content h4 { color: #d4c5a0; }
body.dark .essay-body h5, body.dark .result-content h5 { color: #b4a080; }
body.dark .essay-body pre, body.dark .result-content pre { background: #2a2014; border-color: #3d2f0e; }
body.dark .essay-body code, body.dark .result-content code { background: #3a2c14; color: #fcd34d; }
body.dark .essay-body pre code, body.dark .result-content pre code { background: none; color: #d4c5a0; }

body.dark .es-error-title { color: #f87171; }
body.dark .es-error-hint  { color: #64748b; }

body.dark .es-result-time { color: #d97706; }

body.dark .es-modal { background: #1e1a14; }
body.dark .es-modal-body { background: #1e1a14; }
/* 暗黑模式模态框滚动条 */
body.dark .es-modal-body::-webkit-scrollbar { width: 4px; }
body.dark .es-modal-body::-webkit-scrollbar-track { background: #1e1a14; }
body.dark .es-modal-body::-webkit-scrollbar-thumb { background: #3d2f0e; border-radius: 2px; }
body.dark .es-modal-body::-webkit-scrollbar-thumb:hover { background: #d97706; }
body.dark .es-example-card { background: #2a2014; border-color: #3d2f0e; }
body.dark .es-example-card:hover { background: #3a2c14; border-color: #d97706; }
body.dark .es-example-card-title { color: #fde68a; }
body.dark .es-example-badge { background: #3a2c14; color: #fcd34d; }
body.dark .es-example-desc { color: #8a6a30; }
body.dark .es-example-import { background: #3a2c14; color: #fcd34d; }
body.dark .es-example-import:hover { background: #d97706; color: #fff; }

body.dark .es-history-wordcount-badge { background: #3a2c14; color: #fcd34d; }
body.dark .es-topic-char-count { color: #5a4a25; }
body.dark .es-topic-char-count.near-limit { color: #fb923c; }
body.dark .es-topic-char-count.at-limit   { color: #f87171; }

body.dark .es-history-clear { background: #3d1f1f; color: #f87171; }
body.dark .es-history-clear:hover { background: #4d2020; }
body.dark .es-history-search-clear { color: #6b5a30; }
body.dark .es-history-search-clear:hover { color: #f87171; }
body.dark .es-result-char-count { background: #2a2014; color: #8a6a30; }
body.dark .es-result-char-count.good { background: #022c22; color: #34d399; }

/* 暗黑模式补全项 */
body.dark .es-char-count { color: #5a4a25; }
body.dark .es-char-count.warn   { color: #fb923c; }
body.dark .es-char-count.danger { color: #f87171; }
body.dark .es-label-tip  { color: #5a4a25; }
body.dark .es-history-item-del {
    background: #3d1f1f;
    color: #f87171;
    opacity: 0;
}
body.dark .es-history-item:hover .es-history-item-del { opacity: 1; }
body.dark .es-history-item-del:hover { background: #ef4444; color: #fff; }
