/* public/assets/css/tools/dict-query.css */
.dict-tool-wrapper { 
    --bg-card: var(--bg-surface, #ffffff); 
    --border: var(--border-color, #e2e8f0); 
    --primary: #3b82f6; 
    --text-main: var(--text-main, #1e293b); 
    --text-muted: var(--text-muted, #64748b); 
    width: 100%; max-width: 1000px; margin: 0 auto; color: var(--text-main); 
}

.dict-search-bar { display: flex; gap: 12px; margin-bottom: 24px; background: var(--bg-card); padding: 16px; border-radius: 12px; border: 1px solid var(--border); }
.dict-input { flex: 1; min-width: 0; padding: 12px 16px; font-size: 1.05rem; border: 1px solid var(--border); border-radius: 8px; outline: none; background: var(--bg-body); color: var(--text-main); transition: 0.2s; }
.dict-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15); }
.dict-btn { padding: 0 28px; font-weight: 600; font-size: 1rem; color: #fff; background: var(--primary); border: none; border-radius: 8px; cursor: pointer; transition: 0.2s; white-space: nowrap; }
.dict-btn:hover { background: #2563eb; transform: translateY(-1px); }

.dict-layout { display: grid; grid-template-columns: 1fr 300px; gap: 24px; }
.dict-panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 24px; position: relative; display: flex; flex-direction: column; }
.dict-panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.dict-panel-title { font-size: 1.1rem; font-weight: 600; color: var(--primary); display: flex; align-items: center; gap: 8px; }
.dict-action-btn { background: var(--bg-body); border: 1px solid var(--border); color: var(--text-main); padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 0.85rem; display: none; }
.dict-action-btn:hover { color: var(--primary); border-color: var(--primary); }

.dict-word-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.display-word { font-size: 2.5rem; margin: 0; color: var(--text-main); font-weight: 700; line-height: 1.2; }
.phonetic { font-size: 1.2rem; color: var(--text-muted); font-family: 'Courier New', Courier, monospace; margin-top: 4px; display: block;}
.audio-btn { width: 50px; height: 50px; border-radius: 50%; border: none; background: rgba(59, 130, 246, 0.1); color: var(--primary); cursor: pointer; font-size: 1.4rem; transition: 0.2s; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.audio-btn:hover { background: var(--primary); color: #fff; transform: scale(1.05); }

.part-of-speech { display: inline-block; background: rgba(59, 130, 246, 0.1); color: var(--primary); padding: 4px 12px; border-radius: 6px; font-size: 0.9rem; font-weight: 700; margin-bottom: 12px; text-transform: capitalize; }
.definition-item { margin-bottom: 20px; padding-left: 16px; border-left: 3px solid var(--border); }
.def-text { line-height: 1.6; margin-bottom: 6px; color: var(--text-main); font-size: 1.05rem; }
.example { color: var(--text-muted); font-style: italic; font-size: 0.95rem; }

.dict-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { background: var(--bg-body); border: 1px solid var(--border); padding: 6px 12px; border-radius: 6px; font-size: 0.9rem; cursor: pointer; transition: 0.2s; color: var(--text-main); }
.tag:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.dict-loading-overlay { position: absolute; inset: 0; background: var(--bg-card); opacity: 0.8; display: none; align-items: center; justify-content: center; z-index: 10; border-radius: 12px; }
.dict-spinner { width: 40px; height: 40px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: dict-spin 0.8s linear infinite; }
@keyframes dict-spin { to { transform: rotate(360deg); } }

.dict-error { background: rgba(239, 68, 68, 0.1); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.2); padding: 16px; border-radius: 8px; margin-bottom: 24px; display: none; font-weight: 500; }

@media (max-width: 768px) {
    .dict-layout { grid-template-columns: 1fr; }
    .dict-panel-side { order: 2; }
}
/* 历史记录栏样式 */
.dict-history-wrapper {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
    padding: 0 4px;
    overflow: hidden;
}

.dict-history-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    flex: 1;
    scrollbar-width: none; /* 兼容 Firefox 隐藏滚动条 */
    -ms-overflow-style: none; /* 兼容 IE/Edge */
    padding-bottom: 2px; /* 给 focus 留点空间 */
}

/* 兼容 Chrome/Safari 隐藏滚动条 */
.dict-history-scroll::-webkit-scrollbar {
    display: none;
}

.history-tag {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.history-tag:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.clear-history-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    margin-left: 8px;
    transition: 0.2s;
    font-size: 0.9rem;
}

.clear-history-btn:hover {
    color: #ef4444;
}

[data-theme="dark"] .history-tag {
    background: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}