/* 智慧搜索 - Wisdom Search Web App */
:root {
    --primary: #4F7DF3;
    --primary-light: #7B9EF6;
    --primary-dark: #3A62C9;
    --bg-color: #F5F7FA;
    --card-bg: #FFFFFF;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border-color: #E8ECF1;
    --shadow: 0 2px 8px rgba(79, 125, 243, 0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --font-scale: 1;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: calc(14px * var(--font-scale));
}
#app { display: flex; flex-direction: column; min-height: 100vh; }
.app-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 16px 20px;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
}
.app-title { font-size: calc(20px * var(--font-scale)); font-weight: 600; }
.main-content { flex: 1; padding-bottom: 70px; }
.page { display: none; padding: 16px; animation: fadeIn 0.2s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.search-container { margin-bottom: 20px; }
.search-box {
    display: flex;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--border-color);
}
.search-box input {
    flex: 1;
    padding: 14px 16px;
    border: none;
    outline: none;
    font-size: calc(15px * var(--font-scale));
    background: transparent;
}
.search-box input::placeholder { color: var(--text-muted); }
.search-btn {
    width: 50px;
    background: var(--primary);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.search-btn:hover { background: var(--primary-dark); }
.search-btn svg { width: 20px; height: 20px; }
.section-title { font-size: calc(15px * var(--font-scale)); font-weight: 600; margin-bottom: 12px; }
.hot-searches { margin-bottom: 24px; }
.hot-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.tag {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: var(--card-bg);
    border-radius: 20px;
    font-size: calc(13px * var(--font-scale));
    color: var(--text-secondary);
    cursor: pointer;
    border: 1px solid var(--border-color);
}
.tag:hover { background: var(--primary); color: white; border-color: var(--primary); }
.tag.hot { background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%); color: white; border: none; }
.search-history { margin-bottom: 24px; }
.history-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.clear-btn { background: none; border: none; color: var(--primary); font-size: calc(13px * var(--font-scale)); cursor: pointer; }
.history-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.search-results { margin-top: 0; }
.results-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border-color); }
.results-count { color: var(--text-secondary); font-size: calc(13px * var(--font-scale)); }
.back-btn { background: none; border: none; color: var(--primary); font-size: calc(13px * var(--font-scale)); cursor: pointer; }
.results-list { display: flex; flex-direction: column; gap: 12px; }
.result-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    cursor: pointer;
    position: relative;
}
.result-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(79, 125, 243, 0.15); }
.result-card .card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.result-card .card-no { font-size: calc(12px * var(--font-scale)); color: var(--primary); font-weight: 500; }
.result-card .card-date { font-size: calc(12px * var(--font-scale)); color: var(--text-muted); }
.result-card .card-title { font-size: calc(16px * var(--font-scale)); font-weight: 600; margin-bottom: 8px; }
.result-card .card-context { font-size: calc(13px * var(--font-scale)); color: var(--text-secondary); line-height: 1.5; }
.result-card .favorite-icon { position: absolute; top: 16px; right: 16px; background: none; border: none; cursor: pointer; }
.result-card .favorite-icon svg { width: 22px; height: 22px; stroke: var(--text-muted); fill: none; }
.result-card .favorite-icon.active svg { stroke: #FF6B6B; fill: #FF6B6B; }
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 20px; padding: 16px 0; }
.pagination button { padding: 8px 14px; border: 1px solid var(--border-color); background: var(--card-bg); border-radius: var(--radius-sm); cursor: pointer; }
.pagination button.active { background: var(--primary); color: white; border-color: var(--primary); }
.page-header { margin-bottom: 20px; }
.page-header h2 { font-size: calc(18px * var(--font-scale)); font-weight: 600; }
.favorites-list { display: flex; flex-direction: column; gap: 12px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state svg { width: 64px; height: 64px; margin-bottom: 16px; }
.settings-list { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.setting-item { display: flex; justify-content: space-between; align-items: center; padding: 16px; border-bottom: 1px solid var(--border-color); }
.setting-info { display: flex; flex-direction: column; gap: 4px; }
.setting-label { font-size: calc(15px * var(--font-scale)); color: var(--text-primary); }
.setting-desc { font-size: calc(12px * var(--font-scale)); color: var(--text-muted); }
.setting-value { font-size: calc(14px * var(--font-scale)); color: var(--primary); font-weight: 500; }
.setting-control input[type="range"] { width: 140px; height: 4px; background: var(--border-color); border-radius: 2px; -webkit-appearance: none; }
.setting-control input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; background: var(--primary); border-radius: 50%; cursor: pointer; }
.switch { position: relative; display: inline-block; width: 48px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: var(--border-color); transition: 0.3s; border-radius: 26px; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 3px; bottom: 3px; background: white; transition: 0.3s; border-radius: 50%; }
input:checked + .slider { background: var(--primary); }
input:checked + .slider:before { transform: translateX(22px); }
.edit-btn { padding: 6px 14px; background: var(--primary); color: white; border: none; border-radius: var(--radius-sm); cursor: pointer; }
.danger-btn { padding: 6px 14px; background: #FF6B6B; color: white; border: none; border-radius: var(--radius-sm); cursor: pointer; }
.settings-footer { text-align: center; padding: 24px; color: var(--text-muted); font-size: calc(12px * var(--font-scale)); }
.detail-page { padding: 0; }
.detail-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--card-bg); border-bottom: 1px solid var(--border-color); position: sticky; top: 0; z-index: 50; }
.detail-header .back-btn { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--bg-color); }
.detail-header .back-btn svg { width: 20px; height: 20px; }
.detail-title { font-size: calc(16px * var(--font-scale)); font-weight: 600; }
.detail-header .favorite-btn { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--bg-color); border: none; cursor: pointer; }
.detail-header .favorite-btn svg { width: 20px; height: 20px; stroke: var(--text-muted); fill: none; }
.detail-header .favorite-btn.active svg { stroke: #FF6B6B; fill: #FF6B6B; }
.detail-content { padding: 20px 16px 100px; background: var(--card-bg); min-height: calc(100vh - 140px); }
.detail-meta { display: flex; gap: 16px; margin-bottom: 12px; }
.detail-no { font-size: calc(13px * var(--font-scale)); color: var(--primary); font-weight: 500; }
.detail-date { font-size: calc(13px * var(--font-scale)); color: var(--text-muted); }
.detail-heading { font-size: calc(22px * var(--font-scale)); font-weight: 700; margin-bottom: 20px; }
.detail-body { font-size: calc(15px * var(--font-scale)); color: var(--text-secondary); line-height: 1.8; white-space: pre-wrap; word-break: break-word; }
.detail-toolbar { position: fixed; bottom: 70px; left: 0; right: 0; display: flex; justify-content: center; gap: 16px; padding: 12px 20px; background: var(--card-bg); border-top: 1px solid var(--border-color); }
.detail-toolbar.hidden { display: none; }
.toolbar-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 16px; background: var(--bg-color); border: 1px solid var(--border-color); border-radius: var(--radius); cursor: pointer; }
.toolbar-btn svg { width: 22px; height: 22px; stroke: var(--primary); }
.toolbar-btn span { font-size: calc(11px * var(--font-scale)); color: var(--text-secondary); }
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: var(--card-bg); box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08); z-index: 100; }
.nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0; background: none; border: none; cursor: pointer; color: var(--text-muted); }
.nav-item svg { width: 24px; height: 24px; }
.nav-item span { font-size: calc(11px * var(--font-scale)); }
.nav-item.active { color: var(--primary); }
.toast { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%) translateY(20px); background: rgba(0, 0, 0, 0.8); color: white; padding: 12px 24px; border-radius: 24px; font-size: calc(14px * var(--font-scale)); opacity: 0; visibility: hidden; transition: all 0.3s; z-index: 200; }
.toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; display: none; align-items: center; justify-content: center; z-index: 300; }
.modal.show { display: flex; }
.modal-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.5); }
.modal-content { position: relative; background: var(--card-bg); border-radius: var(--radius); width: 90%; max-width: 400px; z-index: 1; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px; border-bottom: 1px solid var(--border-color); }
.modal-header h3 { font-size: calc(16px * var(--font-scale)); }
.modal-close { background: none; border: none; font-size: 24px; color: var(--text-muted); cursor: pointer; }
.modal-body { padding: 16px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group label { font-size: calc(14px * var(--font-scale)); color: var(--text-secondary); }
.form-group input { padding: 12px; border: 1px solid var(--border-color); border-radius: var(--radius-sm); font-size: calc(14px * var(--font-scale)); }
.modal-footer { display: flex; justify-content: flex-end; gap: 12px; padding: 16px; border-top: 1px solid var(--border-color); }
.btn-secondary { padding: 8px 16px; background: var(--bg-color); border: 1px solid var(--border-color); border-radius: var(--radius-sm); cursor: pointer; }
.btn-primary { padding: 8px 16px; background: var(--primary); color: white; border: none; border-radius: var(--radius-sm); cursor: pointer; }
