diff --git a/index.html b/index.html index e9ed4dc..21fdb5b 100644 --- a/index.html +++ b/index.html @@ -85,6 +85,13 @@ body { .search-box input::placeholder { color: var(--text-tertiary); } .search-box input:focus { border-color: var(--color-primary); box-shadow: 0 0 0 2px var(--color-primary-bg); background: var(--bg-container); } .search-box .search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-tertiary); font-size: 15px; pointer-events: none; } +.header-bar .theme-btn { + width: 36px; height: 36px; border: none; background: none; + cursor: pointer; border-radius: var(--radius-sm); + display: flex; align-items: center; justify-content: center; + font-size: 16px; color: var(--text-secondary); flex-shrink: 0; padding: 0; +} +.header-bar .theme-btn:hover { background: var(--bg-elevated); } .chip-bar { display: none; padding: 10px 16px 0; background: var(--bg-container); @@ -269,6 +276,7 @@ body { 🔍 + @@ -297,9 +305,10 @@ var themeLabel = ''; function setTheme(t) { htmlEl.setAttribute('data-theme', t); localStorage.setItem('wiki-theme', t); - themeLabel = t === 'dark' ? '☀️ 切换浅色模式' : '🌙 切换深色模式'; - document.getElementById('drawerThemeBtn').textContent = themeLabel; - document.querySelectorAll('.sidebar .theme-toggle-btn').forEach(function(b) { b.textContent = themeLabel; }); + var label = t === 'dark' ? '☀️' : '🌙'; + document.getElementById('themeBtn').textContent = label; + document.getElementById('drawerThemeBtn').textContent = label + ' 切换' + (t === 'dark' ? '浅色' : '深色') + '模式'; + document.querySelectorAll('.sidebar .theme-toggle-btn').forEach(function(b) { b.textContent = label + ' 切换' + (t === 'dark' ? '浅色' : '深色') + '模式'; }); } var saved = localStorage.getItem('wiki-theme');