@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --bg-body: #f0f4fa;
    --bg-container: #ffffff;
    --bg-toolbar: #f9fbfe;
    --bg-btn: #ffffff;
    --bg-btn-hover: #e9f0fe;
    --bg-hot: #eef4ff;
    --bg-preview: #ffffff;
    --bg-input: #fefefe;
    --bg-footer: #fafcff;
    --bg-preset: #f8faff;
    --bg-preset-hover: #eef4ff;
    --bg-modal-overlay: rgba(0,0,0,0.4);
    --bg-modal: #ffffff;
    --bg-toast: #1e2f3e;
    --bg-history-item: #f8faff;
    --bg-history-item-hover: #eef4ff;
    --bg-ac: #ffffff;
    --bg-ac-hover: #eef4ff;
    --bg-ac-selected: #dbeafe;
    --bg-fav: #fff8e7;
    --bg-card: #ffffff;
    --bg-main: #f0f4fa;

    --text-main: #1a2332;

    --shadow-card: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-btn: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-panel: 0 4px 12px rgba(0,0,0,0.06);

    --border-main: #eef2f8;
    --border-toolbar: #e9edf2;
    --border-btn: #dce5ef;
    --border-hot: #a0c4e8;
    --border-input: #d7e2ee;
    --border-input-focus: #3b82f6;
    --border-preview: #eef2fa;
    --border-preset: #e2eaf1;

    --text-primary: #1e2f3e;
    --text-secondary: #4b6584;
    --text-muted: #5f7d9c;
    --text-heading: #1e3a5f;
    --text-placeholder: #8ba0bc;
    --text-error: #c7254e;
    --text-link: #3b82f6;

    --color-accent: #2c5a7a;
    --color-accent-light: #3a6b92;
    --color-success: #0f6e3f;
    --color-error-bg: #f9f0f0;
    --color-warning: #b8860b;
    --color-warning-bg: #fff8e7;
    --color-shadow: rgba(0, 0, 0, 0.08);
    --color-shadow-lg: rgba(0, 0, 0, 0.12);
    --color-glow: rgba(59, 130, 246, 0.15);

    --radius-lg: 28px;
    --radius-md: 20px;
    --radius-sm: 14px;
    --radius-xs: 8px;
    --radius-round: 40px;

    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;

    --font-sans: 'Inter', 'Segoe UI', 'Roboto', system-ui, -apple-system, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    --font-math: 'Courier New', 'KaTeX_Main', 'KaTeX_Math', monospace;
}

[data-theme="dark"] {
    --bg-body: #0f172a;
    --bg-container: #1e293b;
    --bg-toolbar: #1a2332;
    --bg-btn: #1e293b;
    --bg-btn-hover: #2d3a52;
    --bg-hot: #1e3a5f;
    --bg-preview: #1a2332;
    --bg-input: #0f172a;
    --bg-footer: #1a2332;
    --bg-preset: #1a2332;
    --bg-preset-hover: #2d3a52;
    --bg-modal-overlay: rgba(0,0,0,0.7);
    --bg-modal: #1e293b;
    --bg-toast: #e2e8f0;
    --bg-history-item: #1a2332;
    --bg-history-item-hover: #2d3a52;
    --bg-ac: #1e293b;
    --bg-ac-hover: #2d3a52;
    --bg-ac-selected: #1e3a5f;
    --bg-fav: #2a2510;
    --bg-card: #1e293b;
    --bg-main: #0f172a;

    --text-main: #e2e8f0;

    --shadow-card: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-btn: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-panel: 0 4px 12px rgba(0,0,0,0.4);

    --border-main: #2d3a52;
    --border-toolbar: #2d3a52;
    --border-btn: #3b4a66;
    --border-hot: #4a6a8a;
    --border-input: #3b4a66;
    --border-input-focus: #60a5fa;
    --border-preview: #2d3a52;
    --border-preset: #3b4a66;

    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-heading: #93c5fd;
    --text-placeholder: #64748b;
    --text-error: #fca5a5;
    --text-link: #60a5fa;

    --color-accent: #60a5fa;
    --color-accent-light: #93c5fd;
    --color-success: #4ade80;
    --color-error-bg: #3b1a1a;
    --color-warning: #fbbf24;
    --color-warning-bg: #2a2510;
    --color-shadow: rgba(0, 0, 0, 0.3);
    --color-shadow-lg: rgba(0, 0, 0, 0.5);
    --color-glow: rgba(96, 165, 250, 0.2);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    background: var(--bg-body);
    font-family: var(--font-sans);
    padding: 0.8rem 1.2rem 1.5rem;
    min-height: 100vh;
    color: var(--text-primary);
    transition: background var(--transition-base), color var(--transition-base);
}

body.fullscreen {
    padding: 0;
    overflow: hidden;
}
body.fullscreen .editor-container {
    border-radius: 0;
    max-width: 100%;
    min-height: 100vh;
    border: none;
}
body.fullscreen .theme-toggle,
body.fullscreen .lang-toggle { display: none; }

.theme-toggle, .lang-toggle {
    position: fixed; z-index: 100;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--bg-container);
    border: 1px solid var(--border-main);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-btn);
    font-size: 1.1rem; user-select: none;
}
.theme-toggle:hover, .lang-toggle:hover {
    background: var(--bg-btn-hover);
    transform: scale(1.1);
}
.theme-toggle { top: 16px; right: 16px; }
.lang-toggle {
    top: 16px; right: 64px;
    width: auto; padding: 0 10px;
    border-radius: var(--radius-round);
    font-size: 0.75rem; font-weight: 600;
    color: var(--color-accent);
}

.editor-container {
    max-width: 1500px; margin: 0 auto;
    background: var(--bg-container);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: all var(--transition-base);
    border: 1px solid var(--border-main);
}

.editor-header {
    background: var(--bg-container);
    padding: 0.9rem 2rem;
    border-bottom: 1px solid var(--border-main);
    transition: background var(--transition-base);
}
.editor-header h1 {
    font-size: 1.7rem; font-weight: 700;
    display: inline-flex; align-items: center; gap: 10px;
}
.editor-header h1 .logo-icon { font-size: 1.5rem; }
.free-badge {
    background: #e9f6ef; color: var(--color-success);
    font-size: 0.7rem; font-weight: 600;
    padding: 4px 12px; border-radius: var(--radius-round);
    vertical-align: middle; margin-left: 12px;
}
[data-theme="dark"] .free-badge { background: #1a3a2a; color: #4ade80; }
.editor-header p { color: var(--text-secondary); font-size: 0.85rem; margin-top: 6px; }

.toolbar {
    background: var(--bg-toolbar);
    border-bottom: 1px solid var(--border-toolbar);
    padding: 0.8rem 1.2rem;
    transition: background var(--transition-base);
}
.toolbar-search {
    display: flex; gap: 8px; align-items: center;
    margin-bottom: 1rem;
}
.toolbar-search-input {
    flex: 1; max-width: 400px;
    padding: 8px 16px;
    border: 1px solid var(--border-btn);
    border-radius: var(--radius-round);
    font-family: var(--font-sans); font-size: 0.8rem;
    background: var(--bg-btn); color: var(--text-primary);
    outline: none; transition: all var(--transition-fast);
}
.toolbar-search-input:focus { border-color: var(--border-input-focus); box-shadow: 0 0 0 3px var(--color-glow); }
.toolbar-search-input::placeholder { color: var(--text-placeholder); }
.toolbar-fullscreen-btn { flex-shrink: 0; }

.toolbar-category { margin-bottom: 0.8rem; transition: opacity var(--transition-base); }
.toolbar-category.hidden { display: none; }
.category-title {
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.6px;
    color: var(--color-accent-light); margin-bottom: 0.5rem; text-transform: uppercase;
}
.button-grid { display: flex; flex-wrap: wrap; gap: 7px; }

.math-btn {
    background: var(--bg-btn); border: 1px solid var(--border-btn);
    border-radius: 34px; padding: 5px 14px;
    font-family: var(--font-math); font-size: 0.9rem; font-weight: 500;
    color: var(--text-primary); cursor: pointer;
    transition: all var(--transition-fast); box-shadow: var(--shadow-btn);
    white-space: nowrap;
}
.math-btn:hover { background: var(--bg-btn-hover); border-color: #5f9ad6; transform: translateY(-1px); box-shadow: 0 2px 4px var(--color-shadow); }
.math-btn:active { transform: translateY(0); }
.hot-btn { background: var(--bg-hot); border-color: var(--border-hot); }

.edit-preview-area { display: flex; flex-wrap: wrap; gap: 1.6rem; padding: 1.5rem 2rem; }
.editor-panel { flex: 1.4; min-width: 280px; }
.preview-panel {
    flex: 1; min-width: 260px;
    background: var(--bg-preview);
    border-radius: 1.4rem; border: 1px solid var(--border-preview);
    padding: 1.2rem; box-shadow: var(--shadow-panel);
    transition: background var(--transition-base), border var(--transition-base);
}

.panel-label {
    font-size: 0.8rem; font-weight: 600; color: var(--color-accent);
    margin-bottom: 0.7rem; display: flex; align-items: center; gap: 8px;
}
.panel-badge {
    font-size: 0.65rem; background: #eef2ff;
    padding: 2px 10px; border-radius: var(--radius-round);
}
[data-theme="dark"] .panel-badge { background: #1e2d4a; }
.panel-shortcuts { margin-left: auto; cursor: pointer; opacity: 0.6; transition: opacity var(--transition-fast); font-size: 1rem; }
.panel-shortcuts:hover { opacity: 1; }
.panel-chars {
    font-size: 0.65rem; color: var(--text-muted);
    font-family: var(--font-mono); min-width: 24px; text-align: right;
}

.editor-wrapper { position: relative; }

.latex-input {
    width: 100%; min-height: 260px;
    background: var(--bg-input); border: 1px solid var(--border-input);
    border-radius: var(--radius-md); padding: 1rem 1.2rem;
    font-family: var(--font-mono); font-size: 0.95rem; line-height: 1.45;
    resize: vertical; outline: none;
    transition: all var(--transition-fast);
    color: var(--text-primary);
}
.latex-input:focus { border-color: var(--border-input-focus); box-shadow: 0 0 0 3px var(--color-glow); }
.latex-input::placeholder { color: var(--text-placeholder); }

.autocomplete-box {
    display: none;
    position: absolute;
    z-index: 999;
    background: var(--bg-ac);
    border: 1px solid var(--border-btn);
    border-radius: var(--radius-xs);
    box-shadow: 0 8px 24px var(--color-shadow-lg);
    max-height: 220px;
    overflow-y: auto;
    min-width: 220px;
    font-family: var(--font-mono);
    font-size: 0.82rem;
}
.autocomplete-box.active { display: block; }
.autocomplete-box .ac-item {
    padding: 7px 14px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-primary);
    transition: background var(--transition-fast);
}
.autocomplete-box .ac-item:hover,
.autocomplete-box .ac-item.hover {
    background: var(--bg-ac-hover);
}
.autocomplete-box .ac-item.selected {
    background: var(--bg-ac-selected);
}
.autocomplete-box .ac-item .ac-cmd { font-weight: 600; }
.autocomplete-box .ac-item .ac-desc { font-size: 0.75rem; color: var(--text-muted); margin-left: 12px; }

.preview-box {
    background: var(--bg-preview);
    min-height: 260px; border-radius: 1rem;
    padding: 1rem; display: flex;
    align-items: center; justify-content: center;
    border: 1px solid var(--border-preview);
    transition: background var(--transition-base);
    position: relative;
}
.rendered-formula {
    font-size: 1.35rem; text-align: center;
    overflow-x: auto; width: 100%; word-break: break-word;
}
.error-message { color: var(--text-error); background: var(--color-error-bg); padding: 0.6rem; border-radius: var(--radius-sm); font-size: 0.8rem; }

.action-buttons { display: flex; gap: 12px; margin-top: 1rem; flex-wrap: wrap; }
.sec-btn {
    background: var(--bg-toolbar); border: 1px solid var(--border-btn);
    padding: 7px 18px; border-radius: var(--radius-round);
    font-weight: 500; font-size: 0.75rem; cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-primary); font-family: var(--font-sans);
}
.sec-btn:hover { background: var(--bg-btn-hover); transform: translateY(-1px); }
.copy-btn { background: var(--color-accent) !important; color: #ffffff !important; border-color: var(--color-accent) !important; }
.copy-btn:hover { filter: brightness(1.15); }

.presets-section { border-top: 1px solid var(--border-main); padding: 1.5rem 2rem; transition: border var(--transition-base); }
.presets-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; flex-wrap: wrap; gap: 8px; }
.presets-title { font-size: 1rem; font-weight: 700; color: var(--text-heading); }
.presets-actions { display: flex; gap: 8px; }

.presets-filters {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin-bottom: 1rem;
}
.preset-filter {
    background: var(--bg-btn); border: 1px solid var(--border-btn);
    border-radius: var(--radius-round);
    padding: 4px 14px;
    font-size: 0.72rem; font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer; transition: all var(--transition-fast);
    font-family: var(--font-sans);
}
.preset-filter:hover { background: var(--bg-btn-hover); }
.preset-filter.active { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }

.presets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.preset-card {
    background: var(--bg-preset); border: 1px solid var(--border-preset);
    border-radius: var(--radius-sm); padding: 12px 16px;
    cursor: pointer; transition: all var(--transition-fast);
    text-align: left; display: flex; flex-direction: column; gap: 4px;
    font-family: var(--font-sans); position: relative;
}
.preset-card:hover { background: var(--bg-preset-hover); border-color: var(--color-accent); transform: translateY(-2px); box-shadow: 0 4px 8px var(--color-shadow); }
.preset-card:active { transform: translateY(0); }
.preset-card.fav { background: var(--bg-fav); border-color: var(--color-warning); }
.preset-card .fav-star {
    position: absolute; top: 6px; right: 8px;
    font-size: 0.9rem; cursor: pointer; opacity: 0.3;
    transition: all var(--transition-fast); user-select: none;
}
.preset-card .fav-star:hover,
.preset-card.fav .fav-star { opacity: 1; }
.preset-card.fav .fav-star { color: #f59e0b; }
.preset-name { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); padding-right: 20px; }
.preset-preview { font-size: 0.72rem; color: var(--text-muted); font-family: var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.history-section { border-top: 1px solid var(--border-main); padding: 1.5rem 2rem; transition: border var(--transition-base); }
.history-grid { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; }
.history-item {
    background: var(--bg-history-item); border: 1px solid var(--border-preset);
    border-radius: var(--radius-xs); padding: 10px 14px;
    cursor: pointer; transition: all var(--transition-fast);
    font-family: var(--font-mono); font-size: 0.82rem;
    color: var(--text-primary);
    display: flex; align-items: center; justify-content: space-between;
}
.history-item:hover { background: var(--bg-history-item-hover); border-color: var(--color-accent); }
.history-item .history-time { font-family: var(--font-sans); font-size: 0.65rem; color: var(--text-muted); flex-shrink: 0; margin-left: 12px; }

.footer-note {
    font-size: 0.7rem; text-align: center;
    border-top: 1px solid var(--border-main);
    padding: 0.9rem; background: var(--bg-footer);
    color: var(--text-muted);
    transition: background var(--transition-base), border var(--transition-base);
}

.toast-container {
    position: fixed; bottom: 24px; right: 24px; z-index: 9999;
    display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
    background: var(--bg-toast); color: var(--bg-body);
    padding: 12px 20px; border-radius: var(--radius-sm);
    font-size: 0.85rem; font-weight: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    animation: toastIn var(--transition-slow) ease forwards;
    pointer-events: auto; max-width: 360px;
}
[data-theme="dark"] .toast { color: #0f172a; }
.toast.toast-out { animation: toastOut var(--transition-base) ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastOut { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(-10px) scale(0.95); } }

.modal-overlay {
    display: none; position: fixed; inset: 0;
    background: var(--bg-modal-overlay); z-index: 9998;
    justify-content: center; align-items: center;
    backdrop-filter: blur(4px);
}
.modal-overlay.active { display: flex; }
.modal-content {
    background: var(--bg-modal); border-radius: var(--radius-lg);
    padding: 2rem; max-width: 480px; width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    border: 1px solid var(--border-main);
    animation: modalIn var(--transition-slow) ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.9) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.modal-header h2 { font-size: 1.2rem; color: var(--text-primary); }
.modal-close { background: none; border: none; font-size: 1.5rem; color: var(--text-muted); cursor: pointer; padding: 4px 8px; border-radius: var(--radius-xs); transition: all var(--transition-fast); }
.modal-close:hover { background: var(--bg-btn-hover); color: var(--text-primary); }
.modal-body { display: flex; flex-direction: column; gap: 10px; }
.shortcut-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border-toolbar); font-size: 0.85rem; color: var(--text-primary); }
.shortcut-row:last-child { border-bottom: none; }
kbd { background: var(--bg-toolbar); border: 1px solid var(--border-btn); border-radius: 4px; padding: 3px 10px; font-family: var(--font-mono); font-size: 0.75rem; box-shadow: 0 1px 0 var(--border-btn); }

@media (max-width: 860px) {
    body { padding: 0.5rem; }
    .edit-preview-area { flex-direction: column; padding: 1rem; }
    .latex-input { min-height: 200px; }
    .preview-box { min-height: 200px; }
    .editor-header { padding: 0.7rem 1rem; }
    .editor-header h1 { font-size: 1.3rem; }
    .toolbar { padding: 0.6rem 0.8rem; }
    .presets-grid { grid-template-columns: 1fr; }
    .presets-section, .history-section { padding: 1rem; }
    .presets-filters { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
    .presets-filters::-webkit-scrollbar { height: 2px; }
    .presets-filters::-webkit-scrollbar-thumb { background: var(--border-btn); border-radius: 4px; }
    .theme-toggle, .lang-toggle { width: 34px; height: 34px; font-size: 0.9rem; }
    .lang-toggle { width: auto; padding: 0 8px; font-size: 0.65rem; }
    .theme-toggle { top: 10px; right: 10px; }
    .lang-toggle { top: 10px; right: 52px; }
}

@media (min-width: 1400px) {
    .editor-container { max-width: 1600px; }
    .latex-input { min-height: 280px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ── Site Navigation ── */
.site-nav {
    background: var(--bg-container);
    border-bottom: 1px solid var(--border-main);
    position: sticky;
    top: 0;
    z-index: 90;
    transition: background var(--transition-base);
}
.site-nav-inner {
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
}
.site-logo {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-heading);
    text-decoration: none;
}
.site-nav-links { display: flex; gap: 4px; }
.site-nav-link, .site-nav-links a {
    padding: 6px 14px;
    border-radius: var(--radius-round);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
}
.site-nav-link:hover, .site-nav-links a:hover {
    background: var(--bg-btn-hover);
    color: var(--text-primary);
}

/* ── Breadcrumb ── */
.header-breadcrumb {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 4px;
}
.header-breadcrumb a {
    color: var(--color-accent);
    text-decoration: none;
}
.header-breadcrumb a:hover { text-decoration: underline; }

/* ── Content Pages (About, Guide, Blog, Privacy) ── */
.content-page {
    max-width: 1500px;
    margin: 0 auto;
    padding: 2rem;
    background: var(--bg-container);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-main);
    transition: all var(--transition-base);
}
.content-page-inner {
    max-width: 900px;
    margin: 0 auto;
}
.content-page h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-heading);
    margin: 0.5rem 0 0.3rem;
}
.content-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}
.content-date {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 1.5rem;
}

/* ── About Page ── */
.about-section { margin-bottom: 2.5rem; }
.about-section h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 0.8rem;
}
.about-section p, .about-section li {
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.7;
}
.about-section ul { padding-left: 1.5rem; margin-top: 0.5rem; }
.about-section li { margin-bottom: 0.4rem; }
.about-section a { color: var(--color-accent); }
.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}
.about-card {
    background: var(--bg-preset);
    border: 1px solid var(--border-preset);
    border-radius: var(--radius-sm);
    padding: 1.2rem;
    transition: all var(--transition-fast);
}
.about-card:hover {
    background: var(--bg-preset-hover);
    border-color: var(--color-accent);
    transform: translateY(-2px);
}
.about-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}
.about-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ── Testimonials ── */
.testimonials-section {
    border-top: 1px solid var(--border-main);
    padding: 1.5rem 2rem;
    transition: border var(--transition-base);
}
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}
.testimonial-card {
    background: var(--bg-preset);
    border: 1px solid var(--border-preset);
    border-radius: var(--radius-sm);
    padding: 1.2rem;
    transition: all var(--transition-fast);
}
.testimonial-card:hover {
    background: var(--bg-preset-hover);
    border-color: var(--color-accent);
    transform: translateY(-2px);
}
.testimonial-quote {
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.6;
    font-style: italic;
    margin-bottom: 0.8rem;
}
.testimonial-author {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-heading);
}
.testimonial-role {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ── Guide Page ── */
.guide-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--bg-toolbar);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-toolbar);
}
.guide-nav-item {
    padding: 5px 14px;
    background: var(--bg-btn);
    border: 1px solid var(--border-btn);
    border-radius: var(--radius-round);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
}
.guide-nav-item:hover {
    background: var(--bg-btn-hover);
    color: var(--color-accent);
    border-color: var(--color-accent);
}
.guide-section {
    margin-bottom: 2.5rem;
    scroll-margin-top: 60px;
}
.guide-section h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-main);
}
.guide-back {
    display: inline-block;
    margin-top: 0.8rem;
    font-size: 0.78rem;
    color: var(--color-accent);
    text-decoration: none;
}
.guide-back:hover { text-decoration: underline; }
.guide-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.guide-table th, .guide-table td {
    padding: 8px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-toolbar);
    color: var(--text-primary);
}
.guide-table th {
    font-weight: 600;
    color: var(--text-heading);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.guide-table tr:hover td {
    background: var(--bg-btn-hover);
}
.guide-table code {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    background: var(--bg-toolbar);
    padding: 2px 6px;
    border-radius: 4px;
}
.guide-section ul {
    padding-left: 1.5rem;
}
.guide-section li {
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.8;
}
.guide-section li code {
    font-family: var(--font-mono);
    background: var(--bg-toolbar);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* ── Blog ── */
.blog-list {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}
.blog-card {
    background: var(--bg-preset);
    border: 1px solid var(--border-preset);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    transition: all var(--transition-fast);
}
.blog-card:hover {
    background: var(--bg-preset-hover);
    border-color: var(--color-accent);
    transform: translateY(-2px);
}
.blog-card h2 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}
.blog-card h2 a {
    color: var(--text-heading);
    text-decoration: none;
}
.blog-card h2 a:hover { color: var(--color-accent); text-decoration: underline; }
.blog-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
    display: flex;
    gap: 12px;
}
.blog-summary {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 0.8rem;
}
.blog-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 0.6rem;
}
.blog-tag {
    background: var(--bg-btn);
    border: 1px solid var(--border-btn);
    border-radius: var(--radius-round);
    padding: 2px 10px;
    font-size: 0.68rem;
    color: var(--text-muted);
}
.blog-read-more {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--color-accent);
    text-decoration: none;
}
.blog-read-more:hover { text-decoration: underline; }

/* ── Blog Article ── */
.blog-article h1 {
    font-size: 1.6rem;
    margin-bottom: 0.8rem;
}
.blog-content {
    margin-top: 1.5rem;
}
.blog-content p {
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.8;
    margin-bottom: 1rem;
}
.blog-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-heading);
    margin: 1.5rem 0 0.6rem;
}
.blog-content ul {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}
.blog-content li {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.7;
    margin-bottom: 0.3rem;
}
.blog-content code {
    font-family: var(--font-mono);
    background: var(--bg-toolbar);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--text-error);
}
.blog-cta {
    margin-top: 2rem;
    padding: 1.2rem;
    background: var(--bg-hot);
    border: 1px solid var(--border-hot);
    border-radius: var(--radius-sm);
    text-align: center;
}
.blog-cta p {
    font-size: 0.95rem;
    color: var(--text-primary);
}
.blog-cta a {
    color: var(--color-accent);
    font-weight: 600;
    text-decoration: none;
}
.blog-cta a:hover { text-decoration: underline; }
.blog-nav-links {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-main);
}
.blog-nav-links a {
    font-size: 0.9rem;
    color: var(--color-accent);
    text-decoration: none;
}
.blog-nav-links a:hover { text-decoration: underline; }

/* ── Site Footer ── */
.footer-friendly {
    max-width: 1500px;
    margin: 2.5rem auto 0;
    background: var(--bg-container);
    border: 1px solid var(--border-main);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    transition: background var(--transition-base);
}
.footer-friendly h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 1rem;
}
.friendly-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: center;
    align-items: center;
}
.friendly-links a {
    display: inline-block;
    padding: 0.4rem 1rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
    text-decoration: none;
    border: 1px solid var(--border-main);
    border-radius: 999px;
    transition: all var(--transition-fast);
}
.friendly-links a:hover {
    color: var(--color-accent);
    border-color: var(--color-accent);
    background: rgba(44,90,122,0.06);
    transform: translateY(-1px);
}

.site-footer {
    max-width: 1500px;
    margin: 1.5rem auto 0;
    background: var(--bg-container);
    border: 1px solid var(--border-main);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: background var(--transition-base);
}
.footer-content {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: space-between;
}
.footer-col h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 0.6rem;
}
.footer-col p {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 300px;
}
.footer-col a {
    display: block;
    font-size: 0.78rem;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 3px 0;
    transition: color var(--transition-fast);
}
.footer-col a:hover { color: var(--color-accent); }
.footer-bottom {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-main);
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: center;
}

/* ── Tools Grid ── */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.tool-card { display: flex; align-items: center; gap: 1rem; padding: 1.2rem; background: var(--bg-card); border: 1px solid var(--border-main); border-radius: var(--radius-md); text-decoration: none; color: var(--text-main); transition: all 0.2s; }
.tool-card:hover { border-color: var(--color-accent); box-shadow: 0 2px 12px rgba(44,90,122,0.1); transform: translateY(-2px); }
.tool-card-icon { font-size: 2.2rem; flex-shrink: 0; }
.tool-card-info h3 { margin: 0 0 0.3rem; font-size: 1rem; }
.tool-card-info p { margin: 0; font-size: 0.85rem; color: var(--text-muted); }
.tool-card-category { display: inline-block; margin-top: 0.4rem; padding: 0.15rem 0.5rem; background: var(--bg-hot); border-radius: 999px; font-size: 0.7rem; text-transform: capitalize; }
.tool-content { margin: 1.5rem 0; }
.tool-info-section { margin: 2rem 0; padding: 1.5rem; background: var(--bg-card); border-radius: var(--radius-md); border: 1px solid var(--border-main); }

/* ── Tool Controls ── */
.tool-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-bottom: 1rem; }
.tool-input { padding: 0.5rem 0.7rem; border: 1px solid var(--border-main); border-radius: var(--radius-sm); background: var(--bg-main); color: var(--text-main); font-size: 0.9rem; }
.tool-input-sm { padding: 0.4rem 0.6rem; border: 1px solid var(--border-main); border-radius: var(--radius-sm); background: var(--bg-main); color: var(--text-main); width: 70px; font-size: 0.9rem; }
.tool-input-row { display: flex; align-items: center; gap: 0.5rem; margin: 0.3rem 0; }
.tool-input-row label { font-size: 0.85rem; color: var(--text-muted); white-space: nowrap; }
.tool-canvas { max-width: 100%; height: auto; border: 1px solid var(--border-main); border-radius: var(--radius-sm); background: #fff; }
.tool-tabs { display: flex; gap: 0; margin-bottom: 1rem; border-bottom: 2px solid var(--border-main); }
.tool-tab { padding: 0.5rem 1rem; border: none; background: none; cursor: pointer; font-size: 0.85rem; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tool-tab.active { color: var(--color-accent); border-bottom-color: var(--color-accent); }
.tool-tab:hover { color: var(--text-main); }
.eqn-mode, .stats-mode { display: none; }
.eqn-mode:first-of-type, .stats-mode:first-of-type { display: block; }
.eqn-result { margin-top: 1rem; padding: 1rem; background: var(--bg-card); border-radius: var(--radius-sm); border: 1px solid var(--border-main); }

/* ── Scientific Calculator ── */
.sci-calc-display { background: var(--bg-main); border: 1px solid var(--border-main); border-radius: var(--radius-sm); padding: 0.5rem; margin-bottom: 0.5rem; text-align: right; }
.sci-history { font-size: 0.75rem; color: var(--text-muted); min-height: 1.2rem; }
.sci-input { width: 100%; border: none; background: none; font-size: 1.1rem; text-align: right; color: var(--text-main); outline: none; }
.sci-result { font-size: 1.5rem; font-weight: bold; color: var(--color-accent); padding: 0.3rem 0; }
.sci-buttons { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.sci-btn { padding: 0.7rem 0.3rem; border: 1px solid var(--border-main); border-radius: var(--radius-sm); background: var(--bg-card); color: var(--text-main); font-size: 0.85rem; cursor: pointer; text-align: center; }
.sci-btn:hover { background: var(--bg-hot); }
.sci-num { font-weight: bold; }
.sci-fn { background: var(--bg-hot); font-size: 0.78rem; }
.sci-op { background: var(--bg-main); }
.sci-eq { background: var(--color-accent); color: #fff; font-weight: bold; }

/* ── Matrix Calculator ── */
.matrix-container { display: flex; flex-wrap: wrap; gap: 1.5rem; margin: 1rem 0; }
.matrix-panel { flex: 1; min-width: 180px; }
.matrix-panel h4 { margin: 0 0 0.5rem; font-size: 0.9rem; }
.matrix-table { border-collapse: collapse; }
.matrix-table td { padding: 4px; }
.matrix-input { width: 60px; padding: 4px 6px; border: 1px solid var(--border-main); border-radius: var(--radius-sm); text-align: center; font-size: 0.85rem; }
.matrix-table td { text-align: center; padding: 6px 8px; font-size: 0.85rem; border: 1px solid var(--border-main); }

/* ── FAQ ── */
.faq-list { margin: 1.5rem 0; }
.faq-item { border: 1px solid var(--border-main); border-radius: var(--radius-md); margin-bottom: 0.7rem; overflow: hidden; }
.faq-question { padding: 0.8rem 1rem; background: var(--bg-hot); cursor: pointer; font-weight: 600; font-size: 0.92rem; }
.faq-question:hover { background: var(--border-main); }
.faq-question::before { content: '▶ '; font-size: 0.75rem; transition: transform 0.2s; }
.faq-item.open .faq-question::before { transform: rotate(90deg); }
.faq-answer { padding: 0 1rem 0.8rem; font-size: 0.88rem; color: var(--text-muted); line-height: 1.7; display: none; }
.faq-item.open .faq-answer { display: block; }

/* ── Stats Table ── */
.stats-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.stats-table th, .stats-table td { padding: 6px 12px; border: 1px solid var(--border-main); text-align: left; }
.stats-table th { background: var(--bg-hot); font-weight: 600; }

/* ── Conv Steps ── */
.conv-steps { margin-top: 0.5rem; padding: 0.5rem; background: var(--bg-hot); border-radius: var(--radius-sm); font-size: 0.82rem; }

/* ── Geo Params ── */
.geo-params { margin: 1rem 0; }

@media (max-width: 860px) {
    .site-nav-inner { padding: 0 1rem; }
    .content-page { padding: 1rem; }
    .testimonials-section { padding: 1rem; }
    .about-grid { grid-template-columns: 1fr; }
    .testimonials-grid { grid-template-columns: 1fr; }
    .footer-content { flex-direction: column; gap: 1.5rem; }
    .blog-card h2 { font-size: 1rem; }
    .blog-article h1 { font-size: 1.3rem; }
    .guide-nav { overflow-x: auto; flex-wrap: nowrap; }
    .guide-table { font-size: 0.78rem; }
    .guide-table th, .guide-table td { padding: 6px 8px; }
    .tools-grid { grid-template-columns: 1fr; }
    .sci-buttons { grid-template-columns: repeat(5, 1fr); }
    .matrix-container { flex-direction: column; }
    .tool-controls { flex-direction: column; align-items: stretch; }
    .tool-input-row { flex-wrap: wrap; }
    .hero-section { padding: 2rem 1rem; }
    .hero-title { font-size: 1.8rem; }
    .hero-subtitle { font-size: 0.95rem; }
    .site-nav-link, .site-nav-links a { padding: 4px 10px; font-size: 0.72rem; }
    .tool-detail-layout { flex-direction: column; }
    .tool-widget-area { min-width: auto; }
}

/* ── Hero Section (Homepage) ── */
.hero-section {
    background: linear-gradient(135deg, var(--bg-container) 0%, var(--bg-body) 100%);
    padding: 3rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 50%, rgba(59,130,246,0.06) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 50%, rgba(139,92,246,0.05) 0%, transparent 50%);
    pointer-events: none;
}
[data-theme="dark"] .hero-section::before {
    background: radial-gradient(ellipse at 30% 50%, rgba(59,130,246,0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 50%, rgba(139,92,246,0.06) 0%, transparent 50%);
}
.hero-title {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--text-heading);
    margin-bottom: 0.8rem;
    letter-spacing: -0.5px;
    position: relative;
}
.hero-title-span {
    background: linear-gradient(135deg, var(--color-accent), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 650px;
    margin: 0 auto 1.5rem;
    line-height: 1.7;
    position: relative;
}
.hero-cta {
    display: inline-flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    justify-content: center;
    position: relative;
}
.hero-cta .primary-btn {
    background: linear-gradient(135deg, var(--color-accent), #7c3aed);
    color: #fff;
    border: none;
    padding: 0.9rem 2rem;
    border-radius: var(--radius-round);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-slow);
    text-decoration: none;
    font-family: var(--font-sans);
    box-shadow: 0 4px 16px rgba(59,130,246,0.3);
}
.hero-cta .primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(59,130,246,0.4);
}
.hero-cta .sec-btn-hero {
    background: var(--bg-container);
    border: 1px solid var(--border-main);
    padding: 0.9rem 2rem;
    border-radius: var(--radius-round);
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    font-family: var(--font-sans);
}
.hero-cta .sec-btn-hero:hover {
    background: var(--bg-btn-hover);
    border-color: var(--color-accent);
    transform: translateY(-2px);
}
.hero-stats {
    display: flex;
    gap: 2.5rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
    position: relative;
}
.hero-stat-item {
    text-align: center;
}
.hero-stat-number {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-heading);
    letter-spacing: -0.5px;
}
.hero-stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── Glass Navigation ── */
.site-nav {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(255,255,255,0.85);
    border-bottom: 1px solid var(--border-main);
}
[data-theme="dark"] .site-nav {
    background: rgba(15,23,42,0.85);
}
.site-nav-inner {
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}
.site-logo {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-heading);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: -0.3px;
}
.site-logo-icon {
    font-size: 1.3rem;
}
.site-nav-links {
    display: flex;
    gap: 2px;
}
.site-nav-link, .site-nav-links a {
    padding: 8px 16px;
    border-radius: var(--radius-round);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
    position: relative;
}
.site-nav-link:hover, .site-nav-links a:hover {
    background: var(--bg-btn-hover);
    color: var(--text-primary);
}
.site-nav-link.active, .site-nav-links a.active {
    color: var(--color-accent);
    font-weight: 600;
}
.site-nav-link.active::after, .site-nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--color-accent);
    border-radius: 2px;
}

/* ── Enhanced Cards ── */
.preset-card, .blog-card, .testimonial-card, .about-card, .tool-card {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.preset-card:hover, .blog-card:hover, .testimonial-card:hover, .about-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 8px 24px var(--color-shadow) !important;
}
.tool-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 8px 28px var(--color-shadow-lg) !important;
}

/* ── Enhanced Tool Cards ── */
.tool-card {
    padding: 1.5rem !important;
    gap: 1rem !important;
    background: var(--bg-card) !important;
    border: 1px solid var(--border-main) !important;
    border-radius: var(--radius-md) !important;
    position: relative;
    overflow: hidden;
}
.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-accent), #8b5cf6, var(--color-accent));
    opacity: 0;
    transition: opacity 0.25s ease;
}
.tool-card:hover::before {
    opacity: 1;
}
.tool-card-icon {
    font-size: 2.5rem !important;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hot);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}
.tool-card-info h3 {
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    margin-bottom: 0.3rem !important;
    color: var(--text-heading);
}
.tool-card-info p {
    font-size: 0.82rem !important;
    color: var(--text-muted) !important;
    line-height: 1.5;
}
.tool-card-category {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.2rem 0.6rem;
    background: var(--bg-hot);
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 500;
    text-transform: capitalize;
    color: var(--color-accent);
}

/* ── Tool Detail Page ── */
.tool-detail-layout {
    display: flex;
    gap: 2rem;
    margin: 1.5rem 0;
}
.tool-widget-area {
    flex: 1;
    min-width: 360px;
    padding: 1.5rem;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-main);
}
.tool-description-area {
    flex: 1;
    min-width: 280px;
}
.tool-description-area h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 1rem;
}
.tool-description-area p {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1rem;
}
.tool-description-area ul {
    padding-left: 1.2rem;
    margin-bottom: 1rem;
}
.tool-description-area li {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 0.3rem;
}

/* ── Tool Category Headers ── */
.tool-category-header {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-heading);
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-main);
    display: flex;
    align-items: center;
    gap: 8px;
}
.tool-category-header:first-of-type {
    margin-top: 0.5rem;
}

/* ── Enhanced Blog Cards ── */
.blog-card {
    padding: 1.5rem !important;
    position: relative;
    overflow: hidden;
}
.blog-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle at 100% 100%, var(--color-glow) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.blog-card:hover::after {
    opacity: 1;
}
.blog-card h2 {
    font-size: 1.2rem !important;
}
.blog-card h2 a {
    color: var(--text-heading);
    text-decoration: none;
    transition: color var(--transition-fast);
}
.blog-card h2 a:hover {
    color: var(--color-accent);
}
.blog-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}
.blog-summary {
    font-size: 0.88rem !important;
    color: var(--text-primary) !important;
    line-height: 1.65 !important;
}

/* ── Enhanced Buttons ── */
.sec-btn {
    padding: 8px 20px !important;
    font-size: 0.78rem !important;
    border-radius: var(--radius-round) !important;
    font-weight: 600 !important;
}
.copy-btn {
    background: linear-gradient(135deg, var(--color-accent), #7c3aed) !important;
    border: none !important;
}
.copy-btn:hover {
    filter: brightness(1.1) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 16px rgba(59,130,246,0.3) !important;
}

/* ── Smooth Page Transitions ── */
.editor-container, .content-page, .site-footer {
    animation: fadeUp 0.4s ease;
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Custom Scrollbar ── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border-btn);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
.history-grid::-webkit-scrollbar { width: 4px; }
.autocomplete-box::-webkit-scrollbar { width: 4px; }

/* ── Enhanced Tool Tabs ── */
.tool-tab {
    padding: 0.6rem 1.2rem !important;
    font-size: 0.82rem !important;
    font-weight: 500 !important;
    transition: all var(--transition-fast);
    border-radius: 4px 4px 0 0 !important;
}
.tool-tab.active {
    background: var(--bg-hot) !important;
    border-bottom-color: var(--color-accent) !important;
    color: var(--color-accent) !important;
    font-weight: 600 !important;
}

/* ── Focus Mode Glow ── */
*:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--color-glow);
    border-radius: 4px;
}

/* ── Enhanced Preview Box ── */
.preview-box {
    background: linear-gradient(135deg, var(--bg-preview) 0%, var(--bg-body) 100%) !important;
    position: relative;
}
.preview-box::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 1rem;
    border: 1px solid var(--border-preview);
    pointer-events: none;
}

/* ── Article Image Placeholder ── */
.blog-article-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--bg-hot), var(--bg-toolbar));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-main);
}

/* ── Loading Skeleton ── */
.skeleton {
    background: linear-gradient(90deg, var(--bg-toolbar) 25%, var(--bg-btn-hover) 50%, var(--bg-toolbar) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-xs);
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Mobile Nav Toggle ── */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 4px 8px;
}
@media (max-width: 860px) {
    .mobile-nav-toggle { display: block; }
    .site-nav-links {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: var(--bg-container);
        border-bottom: 1px solid var(--border-main);
        flex-direction: column;
        padding: 0.5rem 1rem;
        gap: 2px;
        box-shadow: 0 8px 24px var(--color-shadow);
    }
    .site-nav-links.open { display: flex; }
    .site-nav-link, .site-nav-links a {
        padding: 10px 16px;
        border-radius: var(--radius-xs);
        font-size: 0.85rem;
    }
    .site-nav-inner { position: relative; }
    .hero-stats { gap: 1.5rem; }
    .hero-stat-number { font-size: 1.3rem; }
    .tool-detail-layout { flex-direction: column; }
    .tool-widget-area { min-width: auto; }
}

/* ── Better Code Display ── */
.blog-content pre {
    background: var(--bg-toolbar);
    border: 1px solid var(--border-main);
    border-radius: var(--radius-xs);
    padding: 1rem;
    overflow-x: auto;
    margin-bottom: 1rem;
}
.blog-content pre code {
    background: none;
    padding: 0;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-primary);
}
.blog-content blockquote {
    border-left: 3px solid var(--color-accent);
    padding: 0.5rem 1rem;
    margin: 1rem 0;
    background: var(--bg-hot);
    border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
    color: var(--text-secondary);
    font-style: italic;
}

