/* ===================================================
   英文字母加圆圈工具 - 样式文件
   =================================================== */

/* ---------- 整体容器 ---------- */
.elc-container {
    max-width: 800px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* ---------- 通用 section 标签 ---------- */
.elc-section-label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    letter-spacing: 0.03em;
    user-select: none;
}

/* ---------- 模式选择区 ---------- */
.elc-mode-section {
    margin-bottom: 14px;
}

.elc-mode-section .elc-section-label {
    display: block;
    margin-bottom: 8px;
}

.elc-mode-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.elc-mode-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 16px;
    border: 2px solid #dde3ec;
    border-radius: 10px;
    background: #f7f9fb;
    cursor: pointer;
    position: relative;
    transition: border-color 0.18s, background 0.18s, box-shadow 0.18s, transform 0.1s;
    min-width: 118px;
    text-align: center;
    user-select: none;
}

.elc-mode-btn:hover {
    background: #eef3ff;
    border-color: #4f8ef7;
    box-shadow: 0 2px 8px rgba(79, 142, 247, 0.12);
    transform: translateY(-1px);
}

.elc-mode-btn.active {
    background: linear-gradient(135deg, #eef3ff, #e0eaff);
    border-color: #4f8ef7;
    box-shadow: 0 2px 10px rgba(79, 142, 247, 0.2);
}

.elc-mode-btn.active::after {
    content: '✓';
    position: absolute;
    top: 4px;
    right: 7px;
    font-size: 10px;
    color: #4f8ef7;
    font-weight: 700;
    line-height: 1;
}

.elc-mode-btn:active {
    transform: scale(0.97);
}

.elc-mode-preview {
    font-size: 16px;
    font-weight: 700;
    color: #2a5ef7;
    letter-spacing: 0.06em;
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', sans-serif;
}

.elc-mode-btn.active .elc-mode-preview {
    color: #1a40d8;
}

.elc-mode-name {
    font-size: 11px;
    color: #888;
    white-space: nowrap;
}

.elc-mode-btn.active .elc-mode-name {
    color: #4f8ef7;
    font-weight: 600;
}

/* ---------- 输入区 ---------- */
.elc-input-section {
    margin-bottom: 12px;
}

.elc-input-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.elc-char-count {
    font-size: 12px;
    color: #aaa;
    flex: 1;
    transition: color 0.2s;
}

.elc-char-count.warn-red    { color: #e55; font-weight: 600; }
.elc-char-count.warn-orange { color: #f90; font-weight: 600; }
.elc-char-count.warn-green  { color: #4c9; font-weight: 600; }

.elc-clear-btn {
    padding: 3px 10px;
    border: 1px solid #e0e5ec;
    border-radius: 12px;
    background: #f5f7fb;
    color: #999;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.elc-clear-btn:hover {
    background: #fff0f0;
    color: #e55;
    border-color: #f5b8b8;
}

.elc-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #dde3ec;
    border-radius: 10px;
    font-size: 14px;
    color: #333;
    background: #fff;
    resize: vertical;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    line-height: 1.6;
}

.elc-textarea:focus {
    border-color: #4f8ef7;
    box-shadow: 0 0 0 3px rgba(79, 142, 247, 0.12);
}

.elc-textarea::placeholder {
    color: #ccc;
}

/* ---------- 操作行 ---------- */
.elc-action-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.elc-submit-btn {
    padding: 9px 28px;
    background: linear-gradient(135deg, #4f8ef7, #3a72d8);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.18s, transform 0.12s, box-shadow 0.18s;
    box-shadow: 0 2px 8px rgba(79, 142, 247, 0.28);
    white-space: nowrap;
}

.elc-submit-btn:hover {
    opacity: 0.9;
    transform: scale(1.02) translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 142, 247, 0.35);
}

.elc-submit-btn:active {
    transform: scale(0.97);
}

.elc-shortcut-key {
    display: inline-block;
    font-size: 0.8em;
    color: #bbb;
    opacity: 0.7;
    white-space: nowrap;
    user-select: none;
    transition: opacity 0.15s, transform 0.15s;
    cursor: default;
}

.elc-shortcut-key:hover {
    opacity: 1;
    transform: scale(1.05);
}

/* ---------- 快捷键提示 ---------- */
.ael-shortcut-tip {
    font-size: 11px;
    color: #c0c8d8;
    margin-bottom: 10px;
    user-select: none;
    letter-spacing: 0.01em;
}

/* ---------- 结果区 ---------- */
@keyframes elcFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.elc-result {
    display: none;
    margin-bottom: 14px;
}

.elc-result.visible {
    display: block;
    animation: elcFadeIn 0.22s ease;
}

.elc-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 6px;
}

.elc-result-title {
    font-size: 13px;
    font-weight: 600;
    color: #555;
}

.elc-result-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.elc-stat-badge {
    font-size: 12px;
    color: #888;
    background: #f0f4fb;
    border: 1px solid #dde6ff;
    border-radius: 10px;
    padding: 2px 10px;
}

.elc-stat-badge:empty {
    display: none;
}

/* 转换成功时的绿色强调态 */
.elc-stat-badge--success {
    color: #1b7a50;
    background: #edfaf3;
    border-color: #a8dfbf;
    font-weight: 600;
}

.elc-copy-btn {
    padding: 5px 14px;
    border: 1px solid #dde3ec;
    border-radius: 16px;
    background: #f7f9fb;
    color: #555;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
    white-space: nowrap;
}

.elc-copy-btn:hover {
    background: #eef3ff;
    border-color: #4f8ef7;
    color: #4f8ef7;
    transform: scale(1.02);
}

.elc-copy-btn:active {
    transform: scale(0.96);
}

.elc-copy-btn.success {
    background: #eaffec;
    border-color: #5cc;
    color: #0a9;
    pointer-events: none;
}

/* 结果文本框 */
.elc-result-box {
    padding: 16px 18px;
    background: linear-gradient(135deg, #f7f9ff, #eef3ff);
    border: 2px solid #c8d9ff;
    border-radius: 10px;
    font-size: 24px;
    letter-spacing: 0.06em;
    color: #2a4ad0;
    word-break: break-all;
    line-height: 1.8;
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
    user-select: all;
    min-height: 56px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.elc-result-box:empty {
    display: none;
}

.elc-result-box:hover {
    background: linear-gradient(135deg, #eef3ff, #dde8ff);
    border-color: #4f8ef7;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

@keyframes elcCopiedFlash {
    0%   { background: linear-gradient(135deg, #c8e4ff, #b0d4ff); }
    70%  { background: linear-gradient(135deg, #c8e4ff, #b0d4ff); }
    100% { background: linear-gradient(135deg, #f7f9ff, #eef3ff); }
}

.elc-result-box.copied {
    animation: elcCopiedFlash 0.7s ease;
}

@keyframes elcResultPulse {
    0%   { box-shadow: 0 0 0 0 rgba(79, 142, 247, 0.45); border-color: #4f8ef7; }
    65%  { box-shadow: 0 0 0 7px rgba(79, 142, 247, 0); border-color: #7aabff; }
    100% { box-shadow: 0 0 0 0 rgba(79, 142, 247, 0); border-color: #c8d9ff; }
}

.elc-result-box.mode-updated {
    animation: elcResultPulse 0.52s ease;
}

/* 结果框底部复制引导 */
.elc-result-copy-hint {
    font-size: 11px;
    color: #a8b8c8;
    text-align: right;
    margin-top: 4px;
    user-select: none;
    letter-spacing: 0.01em;
}

/* ---------- 错误提示栏 ---------- */
.elc-error-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    padding: 10px 14px;
    background: #fff8f0;
    border: 1px solid #fdd8aa;
    border-radius: 8px;
    font-size: 13px;
    color: #c75;
    animation: elcFadeIn 0.2s ease;
}

.elc-error-icon {
    flex-shrink: 0;
    font-size: 15px;
}

/* ---------- 快速模板 ---------- */
.elc-templates-section {
    margin-bottom: 14px;
    padding-top: 12px;
    border-top: 1px solid #eef0f5;
}

.elc-templates-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.elc-template-hint {
    font-size: 11px;
    color: #bbb;
    font-weight: 400;
}

.elc-template-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.elc-tpl-btn {
    padding: 4px 12px;
    border: 1px solid #dde3ec;
    border-radius: 14px;
    background: #f7f9fb;
    color: #555;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
    white-space: nowrap;
}

.elc-tpl-btn:hover {
    background: #eef3ff;
    border-color: #4f8ef7;
    color: #4f8ef7;
    transform: translateY(-1px);
}

.elc-tpl-btn:active {
    transform: scale(0.95);
}

.elc-tpl-btn.tpl-active {
    background: linear-gradient(135deg, #eef3ff, #e0eaff);
    border-color: #4f8ef7;
    color: #2a5ef7;
    font-weight: 600;
}

/* ---------- 字母对照表 ---------- */
.elc-ref-section {
    margin-bottom: 14px;
}

.elc-ref-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 14px;
    border: 1px solid #dde3ec;
    border-radius: 8px;
    background: #f7f9fb;
    color: #666;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    text-align: left;
    letter-spacing: 0.02em;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.elc-ref-toggle:hover {
    background: #eef3ff;
    border-color: #4f8ef7;
    color: #4f8ef7;
}

.elc-ref-arrow {
    font-size: 11px;
    transition: transform 0.22s ease;
}

.elc-ref-arrow.open {
    transform: rotate(90deg);
}

.elc-ref-panel {
    max-height: 0;
    overflow: hidden;
    margin-top: 0;
    padding: 0 12px;
    background: #fafbff;
    border: 1px solid transparent;
    border-radius: 8px;
    transition: max-height 0.28s ease, padding 0.22s ease, margin-top 0.22s ease, border-color 0.22s ease;
}

.elc-ref-panel.open {
    max-height: 900px;
    margin-top: 8px;
    padding: 12px;
    border-color: #e8edf5;
}

.elc-ref-group {
    margin-bottom: 10px;
}

.elc-ref-group:last-child {
    margin-bottom: 0;
}

.elc-ref-group-title {
    font-size: 11px;
    color: #999;
    font-weight: 600;
    margin-bottom: 6px;
    letter-spacing: 0.03em;
}

.elc-ref-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.elc-ref-item {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px 7px;
    background: #fff;
    border: 1px solid #e0e5ec;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, transform 0.1s;
    white-space: nowrap;
    user-select: none;
}

.elc-ref-item:hover {
    background: #eef3ff;
    border-color: #4f8ef7;
    transform: scale(1.08);
}

.elc-ref-item:active {
    transform: scale(0.95);
}

.elc-ref-item-orig {
    color: #888;
    font-family: 'Courier New', Courier, monospace;
    font-weight: 600;
    font-size: 11px;
}

.elc-ref-item-arrow {
    color: #ccc;
    font-size: 9px;
}

.elc-ref-item-circled {
    color: #2a5ef7;
    font-size: 14px;
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', sans-serif;
}

/* ---------- Toast 通知 ---------- */
@keyframes elcToastIn {
    from { opacity: 0; transform: translateY(12px) translateX(-50%) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) translateX(-50%) scale(1); }
}

@keyframes elcToastOut {
    from { opacity: 1; transform: translateY(0) translateX(-50%) scale(1); }
    to   { opacity: 0; transform: translateY(8px) translateX(-50%) scale(0.95); }
}

.elc-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    padding: 9px 22px;
    background: rgba(40, 56, 90, 0.92);
    color: #fff;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    z-index: 9999;
    cursor: pointer;
    display: none;
    white-space: nowrap;
}

.elc-toast.show {
    display: block;
    animation: elcToastIn 0.2s ease forwards;
}

.elc-toast.hide {
    animation: elcToastOut 0.2s ease forwards;
}

/* ---------- 响应式适配 ---------- */
@media (max-width: 768px) {
    .elc-container {
        max-width: 100%;
    }

    .elc-mode-btn {
        min-width: 100px;
        padding: 7px 12px;
    }
}

@media (max-width: 640px) {
    .elc-mode-grid {
        gap: 6px;
    }

    .elc-mode-btn {
        min-width: 88px;
        padding: 7px 10px;
    }

    .elc-result-box {
        font-size: 19px;
    }

    .ael-shortcut-tip {
        display: none;
    }

    .elc-action-row {
        gap: 8px;
    }
}
