/* =============================================
   在线汉语词典 - online_chinese_dictionary.css
   三栏布局：历史 | 查询 | 结果
   风格参考 feedback_generation / svg_editor
   ============================================= */

/* ========== 主容器 ========== */
.dict-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #f8f6f0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
    transition: all 0.3s ease;
}

/* 全屏模式 */
.dict-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;
}

/* ========== 顶部工具栏 ========== */
.dict-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 12px;
    min-height: 36px;
    background: linear-gradient(135deg, #c0392b 0%, #96281b 100%);
    color: #fff;
    flex-wrap: wrap;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(192, 57, 43, 0.35);
    flex-shrink: 0;
}

.dict-toolbar .toolbar-group {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
}

.dict-toolbar .toolbar-btn {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.90);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #c0392b;
    transition: all 0.2s;
    white-space: nowrap;
    line-height: 1.4;
}

.dict-toolbar .toolbar-btn:hover:not(:disabled) {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
}

.dict-toolbar .toolbar-btn:active:not(:disabled) {
    transform: translateY(0);
}

.dict-toolbar .toolbar-btn:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

/* 主操作按钮（查询） */
.dict-toolbar .toolbar-btn-primary {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(230, 126, 34, 0.45);
}

.dict-toolbar .toolbar-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(230, 126, 34, 0.55);
}

/* 查询按钮 loading shimmer 流光动画 */
.dict-toolbar .toolbar-btn-primary.dict-btn-loading {
    background: linear-gradient(90deg, #e67e22 0%, #f5b942 35%, #e67e22 65%, #d35400 100%);
    background-size: 200% 100%;
    animation: dictBtnShimmer 1.4s ease-in-out infinite;
    cursor: not-allowed;
    box-shadow: 0 2px 10px rgba(230, 126, 34, 0.5);
}

@keyframes dictBtnShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 工具栏标题 */
.dict-toolbar .toolbar-title {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    letter-spacing: 0.5px;
    margin-right: 4px;
}

/* ========== 主内容：三栏 ========== */
.dict-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #f8f6f0;
}

/* ========== 左栏：历史记录 ========== */
.dict-history-panel {
    width: 200px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #e8e0d5;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.history-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: linear-gradient(to bottom, #fdfaf7 0%, #f7f0e8 100%);
    border-bottom: 1px solid #e8e0d5;
    flex-shrink: 0;
}

.history-panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #5d4037;
}

.history-count {
    font-size: 11px;
    color: #a1887f;
    font-weight: 400;
}

.history-clear-btn {
    background: #fff0ee;
    border: none;
    color: #c0392b;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    transition: background 0.2s;
    white-space: nowrap;
}

.history-clear-btn:hover { background: #fde8e6; }

.history-search {
    padding: 7px;
    border-bottom: 1px solid #e8e0d5;
    flex-shrink: 0;
}

.history-search input {
    width: 100%;
    padding: 5px 9px;
    border: 1px solid #ddd0c8;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #4a3728;
    background: #fdfaf7;
}

.history-search input:focus {
    border-color: #c0392b;
    box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.1);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 5px;
}

.history-list::-webkit-scrollbar { width: 4px; }
.history-list::-webkit-scrollbar-track { background: transparent; }
.history-list::-webkit-scrollbar-thumb { background: #d7c4b5; border-radius: 2px; }
.history-list::-webkit-scrollbar-thumb:hover { background: #c0392b; }

.history-item {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    padding: 8px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.18s;
    margin-bottom: 3px;
    border: 1px solid transparent;
}

.history-item-main {
    flex: 1;
    min-width: 0;
}

.history-item:hover {
    background: #fdf0ee;
    border-color: #f5cac5;
}

.history-item.active {
    background: #fce4e1;
    border-color: #e8a09a;
}

.history-item-word {
    font-size: 15px;
    font-weight: 700;
    color: #8b1a1a;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item-meta {
    font-size: 10px;
    color: #a1887f;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-item-type {
    background: #fce4e1;
    color: #c0392b;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 10px;
}

.history-item-del {
    background: none;
    border: none;
    color: #e8a09a;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.15s;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 1px;
    opacity: 0;
}

.history-item:hover .history-item-del {
    opacity: 1;
}

.history-item:hover .history-item-del:hover {
    color: #c0392b;
    background: #fce4e1;
}

.history-empty {
    text-align: center;
    color: #c4a898;
    font-size: 12px;
    padding: 24px 8px;
    line-height: 1.7;
}

/* ========== 中栏：查询输入 ========== */
.dict-input-panel {
    width: 280px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #e8e0d5;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: 12px 14px 10px;
    border-bottom: 1px solid #e8e0d5;
    flex-shrink: 0;
    background: linear-gradient(to bottom, #fdfaf7 0%, #f7f0e8 100%);
}

.panel-header h3 {
    margin: 0 0 2px;
    font-size: 13px;
    font-weight: 600;
    color: #5d4037;
}

.panel-tip {
    font-size: 11px;
    color: #a1887f;
    display: block;
}

.dict-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
}

.dict-input-body::-webkit-scrollbar { width: 4px; }
.dict-input-body::-webkit-scrollbar-track { background: transparent; }
.dict-input-body::-webkit-scrollbar-thumb { background: #d7c4b5; border-radius: 2px; }

/* 查询输入框大区域 */
.dict-search-box {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    align-items: stretch;
}

.dict-search-input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #e8d5cc;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 600;
    color: #4a1a0a;
    background: #fdfaf7;
    outline: none;
    transition: all 0.2s;
    font-family: "SimSun", "宋体", serif;
    letter-spacing: 2px;
    text-align: center;
}

.dict-search-input:focus {
    border-color: #c0392b;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.12);
    background: #fff;
}

.dict-search-input::placeholder {
    font-size: 13px;
    color: #c4a898;
    letter-spacing: 0;
    font-family: inherit;
    font-weight: 400;
}

/* 查询按钮（中栏内嵌） */
.dict-search-btn {
    padding: 8px 14px;
    background: linear-gradient(135deg, #c0392b 0%, #96281b 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(192, 57, 43, 0.35);
}

.dict-search-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    box-shadow: 0 4px 12px rgba(192, 57, 43, 0.45);
    transform: translateY(-1px);
}

.dict-search-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* 查询模式切换 */
.dict-mode-group {
    margin-bottom: 14px;
}

.dict-mode-label {
    font-size: 12px;
    color: #7d5c4f;
    font-weight: 600;
    margin-bottom: 7px;
    display: block;
}

.dict-mode-options {
    display: flex;
    gap: 6px;
}

.dict-mode-option {
    flex: 1;
    padding: 7px 6px;
    text-align: center;
    border: 1.5px solid #e8d5cc;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    color: #7d5c4f;
    transition: all 0.18s;
    user-select: none;
    background: #fdfaf7;
}

.dict-mode-option:hover {
    border-color: #c0392b;
    color: #c0392b;
    background: #fdf0ee;
}

.dict-mode-option.selected {
    border-color: #c0392b;
    background: linear-gradient(135deg, #c0392b 0%, #96281b 100%);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(192, 57, 43, 0.3);
}

.dict-mode-icon {
    font-size: 16px;
    display: block;
    margin-bottom: 2px;
}

/* 快捷示例标签 */
.dict-quick-label {
    font-size: 12px;
    color: #7d5c4f;
    font-weight: 600;
    margin-bottom: 7px;
    display: block;
}

.dict-quick-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.dict-quick-tag {
    padding: 4px 10px;
    background: #fdf0ee;
    border: 1px solid #f5cac5;
    border-radius: 20px;
    font-size: 13px;
    color: #8b1a1a;
    cursor: pointer;
    transition: all 0.18s;
    font-family: "SimSun", "宋体", serif;
    font-weight: 600;
}

.dict-quick-tag:hover {
    background: #c0392b;
    border-color: #c0392b;
    color: #fff;
    transform: scale(1.05);
}

/* 使用提示 */
.dict-tips-box {
    background: linear-gradient(135deg, #fef9f0 0%, #fdf4e8 100%);
    border: 1px solid #f0dfc5;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 12px;
    color: #8b6914;
    line-height: 1.7;
}

.dict-tips-box p { margin: 0 0 4px; font-weight: 600; }
.dict-tips-box ul { margin: 0; padding-left: 16px; }
.dict-tips-box li { margin-bottom: 2px; }

/* ========== 右栏：查询结果 ========== */
.dict-result-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fdfaf7;
    min-width: 0;
}

.dict-result-header {
    padding: 10px 16px;
    border-bottom: 1px solid #e8e0d5;
    flex-shrink: 0;
    background: linear-gradient(to bottom, #fdfaf7 0%, #f7f0e8 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dict-result-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #5d4037;
}

.result-meta-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #a1887f;
}

.result-meta-word {
    font-size: 14px;
    font-weight: 700;
    color: #8b1a1a;
    font-family: "SimSun", "宋体", serif;
}

.result-mode-badge {
    background: #fce4e1;
    color: #c0392b;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.dict-result-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
}

.dict-result-body::-webkit-scrollbar { width: 5px; }
.dict-result-body::-webkit-scrollbar-track { background: transparent; }
.dict-result-body::-webkit-scrollbar-thumb { background: #d7c4b5; border-radius: 3px; }
.dict-result-body::-webkit-scrollbar-thumb:hover { background: #c0392b; }

/* 占位提示 */
.result-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #c4a898;
    text-align: center;
    padding: 40px;
    min-height: 180px;
}

.placeholder-icon { font-size: 52px; margin-bottom: 14px; opacity: 0.7; }
.placeholder-title { font-size: 16px; font-weight: 600; color: #a1887f; margin: 0 0 8px; }
.placeholder-desc { font-size: 13px; color: #c4a898; margin: 3px 0; line-height: 1.6; }

/* 加载中 */
.result-loading {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-height: 180px;
}

.loading-dots {
    display: flex;
    gap: 8px;
}

.loading-dots span {
    width: 10px;
    height: 10px;
    background: #c0392b;
    border-radius: 50%;
    animation: dotBounce 1.2s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
    40% { transform: scale(1.1); opacity: 1; }
}

.loading-text {
    font-size: 13px;
    color: #a1887f;
    margin: 0;
}

/* ========== 词典结果内容样式 ========== */
.result-content {
    animation: fadeInUp 0.35s ease;
    min-height: 0;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* AI 生成的词典条目根容器 */
.result-content .dict-entry {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    overflow: hidden;
}

/* 词头区域 */
.result-content .dict-head {
    display: flex;
    align-items: baseline;
    gap: 14px;
    padding: 18px 20px 14px;
    background: linear-gradient(135deg, #8b1a1a 0%, #c0392b 50%, #e74c3c 100%);
    border-bottom: none;
}

.result-content .dict-word-main {
    font-size: 36px;
    font-weight: 900;
    color: #fff;
    font-family: "SimSun", "宋体", "Noto Serif CJK SC", serif;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
    line-height: 1;
}

.result-content .dict-pinyin {
    font-size: 18px;
    color: rgba(255,255,255,0.88);
    font-style: italic;
    font-family: "Palatino Linotype", serif;
}

.result-content .dict-tag {
    font-size: 11px;
    background: rgba(255,255,255,0.2);
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.35);
    font-weight: 500;
    margin-left: auto;
}

/* 基本属性行 */
.result-content .dict-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 20px;
    background: #fff8f4;
    border-bottom: 1px solid #f0e0d5;
}

.result-content .dict-meta-item {
    font-size: 12px;
    color: #7d5c4f;
    background: #fce4e1;
    padding: 2px 10px;
    border-radius: 12px;
    border: 1px solid #f5cac5;
}

/* 各小节 */
.result-content .dict-section {
    padding: 14px 20px;
    border-bottom: 1px solid #f5ede8;
    flex-shrink: 0;
}

.result-content .dict-section:last-child { border-bottom: none; }

.result-content .dict-section h4 {
    margin: 0 0 9px;
    font-size: 13px;
    font-weight: 700;
    color: #8b1a1a;
    display: flex;
    align-items: center;
    gap: 6px;
}

.result-content .dict-section h4::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 14px;
    background: #c0392b;
    border-radius: 2px;
}

/* 释义列表 */
.result-content .dict-senses {
    margin: 0;
    padding-left: 20px;
    color: #3e2723;
    font-size: 14px;
    line-height: 1.85;
}

.result-content .dict-senses li { margin-bottom: 4px; }

/* 例句列表 */
.result-content .dict-examples {
    list-style: none;
    margin: 0;
    padding: 0;
}

.result-content .dict-examples li {
    font-size: 13px;
    color: #5d4037;
    background: #fdf8f5;
    border-left: 3px solid #e8a090;
    padding: 6px 12px;
    margin-bottom: 6px;
    border-radius: 0 4px 4px 0;
    line-height: 1.7;
    font-style: italic;
}

/* 相关词 */
.result-content .dict-related {
    background: #fdfaf7;
}

.result-content .dict-related-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 4px;
}

.result-content .dict-related-tag {
    padding: 4px 12px;
    background: #fce4e1;
    border: 1px solid #f5cac5;
    border-radius: 16px;
    font-size: 13px;
    color: #8b1a1a;
    cursor: pointer;
    transition: all 0.18s;
    font-family: "SimSun", "宋体", serif;
    font-weight: 600;
}

.result-content .dict-related-tag:hover {
    background: #c0392b;
    border-color: #c0392b;
    color: #fff;
}

/* 深度解析专用样式 */
.result-content .dict-section p {
    margin: 0 0 7px;
    font-size: 13px;
    color: #4a3728;
    line-height: 1.8;
}

.result-content .dict-section ul {
    margin: 0;
    padding-left: 18px;
    font-size: 13px;
    color: #4a3728;
    line-height: 1.8;
}

.result-content .dict-section ul li { margin-bottom: 4px; }

/* ol 列表重置 */
.result-content ol.dict-senses {
    padding-left: 24px;
}

/* ========== 结果区 AI 输出基础 HTML 标签样式 ========== */
.result-content .dict-section h2 {
    font-size: 15px;
    font-weight: 700;
    color: #5d1a1a;
    margin: 12px 0 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid #f0d5cc;
}

.result-content .dict-section h3 {
    font-size: 13px;
    font-weight: 700;
    color: #7d3a2a;
    margin: 10px 0 5px;
}

.result-content .dict-section ol {
    margin: 0;
    padding-left: 22px;
    font-size: 14px;
    color: #3e2723;
    line-height: 1.85;
}

.result-content .dict-section ol li {
    margin-bottom: 4px;
}

.result-content .dict-section ol li::marker {
    color: #c0392b;
    font-weight: 700;
}

.result-content .dict-section ul li::marker {
    color: #c0392b;
    font-weight: 600;
}

.result-content .dict-section hr {
    border: none;
    border-top: 1px dashed #e8cfc5;
    margin: 10px 0;
}

.result-content .dict-section blockquote {
    margin: 8px 0;
    padding: 8px 14px;
    border-left: 4px solid #c0392b;
    background: #fff8f5;
    border-radius: 0 6px 6px 0;
    font-size: 13px;
    color: #5d3a2a;
    font-style: italic;
    line-height: 1.75;
}

/* ========== AI 生成结果 table 样式 ========== */
.result-content .dict-section table,
.result-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin: 8px 0;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.result-content .dict-section table th,
.result-content table th {
    background: linear-gradient(135deg, #8b1a1a 0%, #c0392b 100%);
    color: #fff;
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.3px;
}

.result-content .dict-section table td,
.result-content table td {
    padding: 7px 12px;
    color: #3e2723;
    border-bottom: 1px solid #f0e0d5;
    line-height: 1.6;
}

.result-content .dict-section table tr:nth-child(even) td,
.result-content table tr:nth-child(even) td {
    background: #fdf8f5;
}

.result-content .dict-section table tr:hover td,
.result-content table tr:hover td {
    background: #fce9e5;
}

/* ========== 结果内容行内标签强化样式 ========== */
.result-content strong {
    color: #8b1a1a;
    font-weight: 700;
}

.result-content em {
    color: #5d3a2a;
    font-style: italic;
}

.result-content a {
    color: #c0392b;
    text-decoration: none;
    border-bottom: 1px solid rgba(192, 57, 43, 0.3);
    transition: border-color 0.15s, color 0.15s;
}

.result-content a:hover {
    color: #8b1a1a;
    border-bottom-color: #c0392b;
}

/* 错误提示 */
.result-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}

.result-error .error-icon { font-size: 36px; margin-bottom: 10px; }
.result-error .error-msg { font-size: 14px; color: #c0392b; margin: 0 0 6px; font-weight: 600; }
.result-error .error-tip { font-size: 12px; color: #a1887f; margin: 0; }

/* ========== 示例导入模态框 ========== */
.dict-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 10000;
    display: none;
}

.dict-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.22);
    width: 640px;
    max-width: 95vw;
    max-height: 90vh;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.dict-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(135deg, #8b1a1a 0%, #c0392b 100%);
    color: #fff;
    flex-shrink: 0;
}

.dict-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}

.dict-modal-close {
    background: rgba(255,255,255,0.18);
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.dict-modal-close:hover { background: rgba(255,255,255,0.35); }

.dict-modal-body {
    overflow-y: auto;
    padding: 14px;
    flex: 1;
}

.dict-modal-body::-webkit-scrollbar { width: 5px; }
.dict-modal-body::-webkit-scrollbar-track { background: #f5ede8; border-radius: 3px; }
.dict-modal-body::-webkit-scrollbar-thumb { background: #d7c4b5; border-radius: 3px; }
.dict-modal-body::-webkit-scrollbar-thumb:hover { background: #c0392b; }

.example-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* 末项对称处理（奇数个时让最后一项居中独占一行） */
.example-grid > :last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

.example-card {
    padding: 10px 12px;
    border: 1.5px solid #e8d5cc;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fdfaf7;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.example-card:hover {
    border-color: #c0392b;
    background: #fdf0ee;
    box-shadow: 0 3px 10px rgba(192, 57, 43, 0.12);
    transform: translateY(-1px);
}

.example-icon {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
    background: #fce4e1;
    border-radius: 6px;
    padding: 4px 7px;
}

.example-info { flex: 1; min-width: 0; }

.example-word {
    font-size: 18px;
    font-weight: 800;
    color: #8b1a1a;
    font-family: "SimSun", "宋体", serif;
    margin-bottom: 2px;
}

.example-type-badge {
    display: inline-block;
    font-size: 10px;
    background: #fce4e1;
    color: #c0392b;
    padding: 1px 6px;
    border-radius: 8px;
    margin-bottom: 4px;
    border: 1px solid #f5cac5;
}

.example-desc {
    font-size: 12px;
    color: #7d5c4f;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========== Shake 抖动动画 ========== */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    15%, 55%, 85% { transform: translateX(-5px); }
    35%, 70% { transform: translateX(5px); }
}

.dict-search-input.shake {
    animation: shake 0.45s ease-in-out;
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15) !important;
}

/* ========== 实时字数统计 ========== */
.dict-char-counter {
    text-align: right;
    font-size: 11px;
    color: #c4a898;
    margin-top: -8px;
    margin-bottom: 12px;
    transition: color 0.2s;
    line-height: 1;
    user-select: none;
}

.dict-char-counter.warning { color: #e67e22; font-weight: 500; }
.dict-char-counter.limit   { color: #c0392b; font-weight: 600; }

/* ========== 模式切换提示 ========== */
.dict-mode-hint {
    font-size: 11px;
    color: #c0392b;
    background: #fdf0ee;
    border: 1px solid #f5cac5;
    border-radius: 4px;
    padding: 4px 10px;
    margin-top: 5px;
    display: block;
    opacity: 0;
    transform: translateY(-3px);
    transition: opacity 0.25s, transform 0.25s;
    pointer-events: none;
}

.dict-mode-hint.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========== 响应式布局 ========== */
@media (max-width: 900px) {
    .dict-history-panel { display: none; }
    .dict-input-panel { width: 240px; }
}

@media (max-width: 640px) {
    .dict-main-content { flex-direction: column; }
    .dict-input-panel {
        width: 100%;
        flex-shrink: 0;
        max-height: 240px;
        border-right: none;
        border-bottom: 1px solid #e8e0d5;
    }
    .dict-result-panel { flex: 1; min-height: 0; }
    .dict-toolbar { padding: 5px 8px; gap: 5px; }
    .dict-toolbar .toolbar-btn { padding: 3px 8px; font-size: 11px; }
    .example-grid { grid-template-columns: 1fr; }
    .example-grid > :last-child:nth-child(odd) { grid-column: auto; }
    .dict-modal { width: 96vw; }
}

/* ========== 打印样式 ========== */
@media print {
    .dict-toolbar,
    .dict-history-panel,
    .dict-input-panel { display: none !important; }
    .dict-container { height: auto !important; position: static !important; }
    .dict-result-panel { flex: 1; overflow: visible !important; }
    .dict-result-body { overflow: visible !important; padding: 0; }
    .result-content .dict-entry { box-shadow: none; border: 1px solid #ddd; }
}
