/* =========================================
   1. 全局配置 (已移除冗余白天模式代码，大幅缩减体积)
   ========================================= */
:root {
    --bg-body: #0f1218;
    --bg-card: #1c212c;
    --bg-search: #1c212c;
    --bg-hover: #2d3342;
    --bg-input: #151921;
    --text-primary: #ffffff;
    --text-secondary: #8b949e;
    --text-desc: #6b7280;
    --accent-color: #2ecc71;
    --border-color: #2d3342;
    --line-color: #4b5563; 
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --engine-bg: #252a35;
    --overlay-bg: rgba(0, 0, 0, 0.85);
    
    /* 移动端优先默认值 */
    --grid-cols: 4;
    --icon-size: 48px;
    --icon-radius: 50%;
    --font-size-app: 13px;
    --container-width: 480px;
    
    /* 后台变量 */
    --admin-bg: #0f1218;
    --admin-sidebar-bg: #161b22;
    --admin-header-bg: rgba(22, 27, 34, 0.8);
    --admin-card-bg: #1c212c;
    --admin-hover: #2d3342;
    --admin-border: #30363d;
}

/* =========================================================
   【全新视觉跃升】毛玻璃拟态 & 底层画布
   ========================================================= */
html { background-color: var(--bg-body); }
html:not([data-bg="default"]) body:not(.admin-page) { background-color: transparent !important; }

#global-bg-layer {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1; 
    background-position: center center;
    background-size: cover; 
    background-repeat: no-repeat;
    transform: translateZ(0) scale(1);
    backface-visibility: hidden;
    transition: background-image 0.5s ease, filter 0.4s ease, transform 0.4s ease;
    will-change: transform; 
}
#global-bg-layer::after { display: none !important; }

body.search-focus #global-bg-layer {
    filter: blur(12px) brightness(0.85);
    transform: scale(1.05) translateZ(0);
}
body.search-focus .launchpad-section {
    opacity: 0.15;
    pointer-events: none;
}
.launchpad-section { transition: opacity 0.4s ease; }

html:not([data-bg="default"]) {
    --bg-card: rgba(28, 33, 44, 0.45);
    --bg-search: rgba(28, 33, 44, 0.55);
    --bg-input: rgba(0, 0, 0, 0.25);
    --bg-hover: rgba(255, 255, 255, 0.1);
    --border-color: rgba(255, 255, 255, 0.12);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

html:not([data-bg="default"]) .list-card, 
html:not([data-bg="default"]) .modal-card, 
html:not([data-bg="default"]) .engine-dropdown {
    backdrop-filter: blur(24px) saturate(1.2);
    -webkit-backdrop-filter: blur(24px) saturate(1.2);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}

@media (max-width: 768px) {
    html:not([data-bg="default"]) .modal-card, 
    html:not([data-bg="default"]) .engine-dropdown,
    .search-box-pill,
    .search-suggestion-container {
        backdrop-filter: blur(12px) saturate(1.2) !important;
        -webkit-backdrop-filter: blur(12px) saturate(1.2) !important;
    }
    .app-card:hover {
        transform: translateZ(0) !important;
    }
}

@media (min-width: 768px) { 
    :root { --grid-cols: 6; --container-width: 680px; --icon-size: 50px; } 
}
@media (min-width: 1024px) { 
    /* 电脑端标准模式：8列，适当放宽容器 (从860px提升至940px)，呼吸感更好 */
    :root { --grid-cols: 8; --container-width: 1000px; --icon-size: 52px; } 
}

/* 手机端：无论什么模式都强制 4 个，避免太拥挤 */
[data-layout="compact"] { --grid-cols: 4; --icon-size: 44px; --font-size-app: 12px; }
@media (min-width: 768px) { 
    [data-layout="compact"] { --grid-cols: 6; --icon-size: 46px; --container-width: 600px; } 
}
@media (min-width: 1024px) { 
    /* 电脑端紧凑模式：适当放宽容器 (从720px提升至780px) */
    [data-layout="compact"] { --grid-cols: 8; --icon-size: 46px; --container-width: 820px; } 
}

/* =========================================================
   【背景皮肤】
   ========================================================= */
html[data-bg="default"] #global-bg-layer { background-image: none; } 
.bg-preview-default { background: #1c212c; }

html[data-bg="aurora"] #global-bg-layer { background-image: linear-gradient(135deg, #0f1218, #064e3b); } 
.bg-preview-aurora { background: linear-gradient(135deg, #0f1218, #064e3b); }

html[data-bg="nebula"] #global-bg-layer { background-image: linear-gradient(135deg, #0f1218, #1e1b4b); } 
.bg-preview-nebula { background: linear-gradient(135deg, #0f1218, #1e1b4b); }

html[data-bg="sunset"] #global-bg-layer { background-image: linear-gradient(135deg, #1f1008, #7c2d12); } 
.bg-preview-sunset { background: linear-gradient(135deg, #1f1008, #7c2d12); }

html[data-bg="ocean"] #global-bg-layer { background-image: linear-gradient(135deg, #020617, #0e7490); } 
.bg-preview-ocean { background: linear-gradient(135deg, #020617, #0e7490); }

html[data-bg="cyber"] #global-bg-layer { background-image: linear-gradient(135deg, #180918, #701a75); } 
.bg-preview-cyber { background: linear-gradient(135deg, #180918, #701a75); }

[data-zen="on"] .launchpad-section { display: none !important; }

/* === 基础重置与布局 === */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
html, body { scrollbar-width: none; -ms-overflow-style: none; height: 100%; }
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; }

body:not(.admin-page) { 
    background-color: var(--bg-body); 
    color: var(--text-primary); 
    display: flex; justify-content: center; overflow-x: hidden; transition: background 0.5s ease;
}

.container { 
    width: 100%; max-width: var(--container-width); padding: 16px; 
    display: flex; flex-direction: column; gap: 24px; transition: 0.3s; position: relative; 
}

.icon-btn { 
    width: 36px; height: 36px; border-radius: 8px; 
    background: var(--bg-card); border: 1px solid var(--border-color); 
    display: flex; align-items: center; justify-content: center; 
    cursor: pointer !important; color: var(--text-secondary); 
    transition: 0.2s; flex-shrink: 0; position: relative; pointer-events: auto !important;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.avatar-img { 
    width: 100%; height: 100%; border-radius: 50%; background-color: #333; 
    display: flex; align-items: center; justify-content: center; 
    font-size: 16px; font-weight: bold; color: white; 
    background-size: cover; background-position: center; 
}

#clock-widget { 
    text-align: center; display: none; width: fit-content; 
    margin-left: auto; margin-right: auto; align-self: center; 
}
#clock-time { font-size: 36px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; line-height: 1.1; }
#clock-date { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
#clock-widget.show { display: block; animation: fadeIn 0.5s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* =========================================================
   【全新核心】极致丝滑的动态搜索框
   ========================================================= */
.search-container {
    position: relative; width: 100%; display: flex; flex-direction: column; align-items: center;
    z-index: 100; margin: 10px 0 20px 0; transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-box-pill {
    width: 580px; max-width: 90vw; height: 46px; border-radius: 30px;
    background-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(15px) saturate(1.5);
    -webkit-backdrop-filter: blur(15px) saturate(1.5);
    position: relative; transition: background-color 0.3s, box-shadow 0.3s;
    display: flex; align-items: center; margin: 0 auto;
}

@media (max-width: 768px) {
    .search-box-pill { width: 340px; max-width: 80vw; }
    .search-suggestion-container { width: 350px !important; max-width: 88vw !important; }
}

.search-container.focus .search-box-pill {
    background-color: rgba(255, 255, 255, 0.85); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.search-input-inner { flex: 1; height: 100%; padding: 0 46px; display: flex; align-items: center; }
.search-input-inner input {
    width: 100%; height: 20px; min-height: 20px; background: transparent; border: none;
    outline: none; color: #fff; text-align: center; font-size: 16px; transition: color 0.3s;
    padding: 0; margin: 0; line-height: normal; -webkit-appearance: none; transform: translateZ(0);
}
.search-container.focus .search-input-inner input { color: #000; }
.search-input-inner input::placeholder { color: rgba(255, 255, 255, 0.6); transition: color 0.3s; }
.search-container.focus .search-input-inner input::placeholder { color: transparent; }

.search-btn-icon {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 36px; height: 36px; border-radius: 50%; display: flex;
    align-items: center; justify-content: center; cursor: pointer;
    opacity: 0; pointer-events: none; transition: opacity 0.3s, background-color 0.3s, color 0.3s; 
    color: rgba(255, 255, 255, 0.7);
}
.search-container.focus .search-btn-icon { opacity: 1; pointer-events: auto; color: #333; } 
.search-btn-icon:hover { background-color: rgba(0, 0, 0, 0.1); }
#SearchEngBtn { left: 6px; }
#SearchBtn { right: 6px; }

.engine-dropdown { 
    position: absolute; top: calc(100% + 4px); left: 10px;
    background: rgba(255, 255, 255, 0.95); border: 1px solid rgba(0, 0, 0, 0.1); 
    border-radius: 12px; padding: 6px; width: 140px; display: none; flex-direction: column; 
    gap: 4px; z-index: 100; box-shadow: 0 10px 30px rgba(0,0,0,0.3); 
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.engine-dropdown.show { display: flex; animation: fadeIn 0.2s ease; }
.engine-option { padding: 10px 12px; display: flex; align-items: center; gap: 10px; cursor: pointer; border-radius: 8px; color: #333; font-size: 13px; font-weight: bold; }
.engine-option:hover { background: rgba(0, 0, 0, 0.06); }

.search-suggestion-container {
    position: absolute; top: 60px; width: 580px; max-width: 90vw;
    background: rgba(255, 255, 255, 0.15); border-radius: 16px; overflow: hidden;
    backdrop-filter: blur(30px) saturate(1.25); -webkit-backdrop-filter: blur(30px) saturate(1.25);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3); opacity: 0; visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 40; border: 1px solid rgba(255, 255, 255, 0.1);
}
.search-container.focus.has-suggestions .search-suggestion-container { opacity: 1; visibility: visible; }
#suggestion-list { list-style: none; margin: 0; padding: 8px 0; }
#suggestion-list li {
    padding: 0 20px; height: 38px; line-height: 38px; font-size: 13px;
    color: rgba(255,255,255,0.95); cursor: pointer; transition: 0.25s cubic-bezier(0.65, 0.05, 0.1, 1);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; font-weight: 500;
}
#suggestion-list li:hover { background-color: rgba(255, 255, 255, 0.2); padding-left: 30px; }

.search-tools {
    margin-top: 20px; opacity: 0.5; transition: 0.3s; display: flex;
    justify-content: center; width: 100%; z-index: 30;
}
.search-container.focus .search-tools, .search-container.hover .search-tools { opacity: 1; }
.toggle-wrapper {
    display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, 0.1); 
    padding: 6px 8px 6px 12px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.1); 
    cursor: pointer; backdrop-filter: blur(10px);
}
.toggle-label { font-size: 12px; font-weight: bold; color: var(--accent-color); }
.toggle-switch { width: 34px; height: 18px; background: #4b5563; border-radius: 9px; position: relative; transition: 0.3s; }
.toggle-switch.active { background: var(--accent-color); }
.toggle-knob { width: 14px; height: 14px; background: white; border-radius: 50%; position: absolute; left: 2px; top: 2px; transition: 0.3s; }
.toggle-switch.active .toggle-knob { transform: translateX(16px); }

/* =======================================================
   【启动台交互线】
   ======================================================= */
.interactive-header {
    display: flex; justify-content: center; align-items: center; 
    padding: 15px 0; margin-bottom: 5px; cursor: pointer; position: relative;
}
.interactive-line {
    position: absolute; top: 50%; left: 0; width: 100%; height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.15) 50%, transparent 100%); transition: 0.3s;
}
.line-hint {
    font-size: 11px; color: var(--text-desc); padding: 4px 12px; border-radius: 12px;
    background: var(--bg-card); border: 1px solid var(--border-color);
    opacity: 0; transform: scale(0.9); transition: 0.3s; z-index: 2;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1); pointer-events: none;
}
.interactive-header:hover .interactive-line { opacity: 0.2; }
.interactive-header:hover .line-hint { opacity: 1; transform: scale(1); }
.interactive-header.editing .line-hint { 
    opacity: 1; transform: scale(1); 
    color: white; background: var(--accent-color); border-color: var(--accent-color);
}

.app-grid { display: grid; grid-template-columns: repeat(var(--grid-cols), 1fr); gap: 12px; }

.app-card { 
    min-width: 0; text-decoration: none; background: transparent !important; 
    border: none !important; border-radius: 10px; aspect-ratio: 1; 
    display: flex; flex-direction: column; align-items: center; justify-content: center; 
    gap: 8px; cursor: pointer; transition: 0.2s; box-shadow: none !important; position: relative; 
    -webkit-touch-callout: none; user-select: none;
}
.app-card:hover { transform: translateY(-3px) scale(1.02); }

.app-card.add-btn { display: none; border: 1px dashed var(--border-color) !important; background: rgba(0,0,0,0.1) !important; opacity: 0.8; }
.app-grid.editing .app-card.add-btn { display: flex; }

.app-icon { 
    width: var(--icon-size); height: var(--icon-size); border-radius: var(--icon-radius); 
    display: flex; align-items: center; justify-content: center; font-size: 20px; 
    font-weight: bold; overflow: hidden; color: white; transition: 0.2s; 
    background: transparent; border: none; box-shadow: none; 
}
.app-icon img { width: 100%; height: 100%; object-fit: contain; display: block; }

.app-name { 
    width: 100%; padding: 0 4px; box-sizing: border-box; font-size: var(--font-size-app); 
    color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; 
    text-align: center; text-shadow: 0 1px 4px rgba(0,0,0,0.5); font-weight: 500; 
}

/* 按钮样式（编辑模式） */
.remove-app-btn { 
    position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; 
    background: #ef4444; color: white; border-radius: 50%; display: flex; 
    align-items: center; justify-content: center; font-size: 14px; cursor: pointer; 
    z-index: 10; box-shadow: 0 2px 4px rgba(0,0,0,0.2); transition: 0.2s; line-height: 1; 
}
.remove-app-btn:hover { transform: scale(1.1); background: #dc2626; }

.add-app-btn {
    position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; 
    background: #2ecc71; color: white; border-radius: 50%; display: flex; 
    align-items: center; justify-content: center; font-size: 16px; cursor: pointer; 
    z-index: 10; box-shadow: 0 2px 4px rgba(0,0,0,0.2); transition: 0.2s; line-height: 1; font-weight: bold;
}
.add-app-btn:hover { transform: scale(1.1); background: #27ae60; }

/* 简约美观的弹窗内编辑按钮 (原生系统级质感) */
.lib-edit-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 5px 12px; border-radius: 8px;
    background: transparent; color: var(--accent-color);
    font-size: 14px; font-weight: 600; cursor: pointer; 
    transition: all 0.2s ease; margin-left: 15px; flex-shrink: 0;
}
.lib-edit-btn:hover { opacity: 0.8; background: rgba(46, 204, 113, 0.1); }
.lib-edit-btn.active { color: #ef4444; }
.lib-edit-btn.active:hover { background: rgba(239, 68, 68, 0.1); }

.category-grid { 
    display: flex; flex-wrap: nowrap; gap: 16px; margin: 10px 0 24px 0; 
    overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; 
    scrollbar-width: none; scroll-behavior: smooth; padding-bottom: 4px; 
}
.category-grid::-webkit-scrollbar { display: none; }
.category-tag { 
    background: transparent; border: none; padding: 6px 4px; color: var(--text-secondary); 
    font-size: 14px; font-weight: 500; cursor: pointer; transition: 0.2s; 
    flex-shrink: 0; position: relative; 
}
.category-tag:hover { color: var(--text-primary); }
.category-tag.active { color: var(--accent-color); font-weight: 600; }
.category-tag.active::after { 
    content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); 
    width: 16px; height: 3px; background: var(--accent-color); border-radius: 2px; 
}

.pagination-wrapper { 
    grid-column: 1 / -1; display: flex; justify-content: center; align-items: center;
    gap: 8px; margin-top: 15px; padding-top: 20px; border-top: 1px dashed var(--border-color); flex-wrap: wrap; 
}
.page-btn { 
    padding: 6px 12px; border-radius: 8px; background: var(--bg-card); border: 1px solid var(--border-color); 
    color: var(--text-primary); cursor: pointer; transition: 0.2s; font-size: 13px; font-weight: bold;
    min-width: 32px; display: flex; justify-content: center; align-items: center; box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.page-btn:hover:not(.disabled):not(.active) { 
    border-color: var(--accent-color); color: var(--accent-color); 
    background: color-mix(in srgb, var(--accent-color), transparent 90%);
}
.page-btn.active { 
    background: var(--accent-color); color: white; border-color: var(--accent-color); cursor: default; 
    box-shadow: 0 4px 10px color-mix(in srgb, var(--accent-color), transparent 60%);
}
.page-btn.disabled { opacity: 0.3; cursor: not-allowed; background: transparent; box-shadow: none; }

/* 弹窗通用 */
.modal-overlay { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: var(--overlay-bg); backdrop-filter: blur(5px); display: none; 
    align-items: center; justify-content: center; z-index: 3000; opacity: 0; 
    pointer-events: none; transition: 0.3s; 
}
.modal-overlay.active { display: flex; opacity: 1; pointer-events: auto; }
.modal-card { 
    background: var(--bg-card); width: 90%; max-width: 320px; border-radius: 12px; 
    padding: 20px; border: 1px solid var(--border-color); box-shadow: 0 10px 25px rgba(0,0,0,0.2); 
    transform: scale(0.9); transition: 0.3s; max-height: 80vh; overflow-y: auto; scrollbar-width: none; 
}
.modal-card::-webkit-scrollbar { display: none; }
.modal-overlay.active .modal-card { transform: scale(1); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.modal-title { font-size: 16px; font-weight: bold; color: var(--text-primary); }
.modal-close { background: none; border: none; color: var(--text-desc); cursor: pointer; padding: 4px; font-size: 18px; }
.modal-close:hover { color: var(--text-primary); }

.form-group { margin-bottom: 12px; }
.form-label { display: block; color: var(--text-secondary); font-size: 12px; margin-bottom: 4px; }
.form-input, .form-select, textarea.form-input { 
    width: 100%; padding: 10px; background: var(--bg-input); 
    border: 1px solid var(--border-color); border-radius: 6px; 
    color: var(--text-primary); font-size: 13px; outline: none; box-sizing: border-box; 
}
.form-input:focus, .form-select:focus { border-color: var(--accent-color); }
textarea.form-input { resize: vertical; min-height: 60px; }
.captcha-group { display: flex; align-items: center; gap: 8px; }
.captcha-group .form-input { flex: 1; margin-bottom: 0; }
.captcha-img { height: 38px; width: 90px; border-radius: 6px; border: 1px solid var(--border-color); cursor: pointer; background-color: #fff; }
.btn-submit { 
    width: 100%; padding: 10px; background: var(--accent-color); color: white; 
    border: none; border-radius: 6px; font-size: 14px; font-weight: bold; 
    cursor: pointer; margin-top: 8px; transition: 0.2s; 
}
.btn-submit:hover { background: color-mix(in srgb, var(--accent-color), black 10%); }
.btn-danger { background: #ef4444; margin-top: 8px; }
.btn-danger:hover { background: #dc2626; }
.modal-footer { margin-top: 12px; text-align: center; font-size: 12px; color: var(--text-secondary); }
.link-text { color: var(--accent-color); cursor: pointer; font-weight: 500; }

.settings-section { margin-bottom: 12px; padding-bottom: 0; border-bottom: none; }
.settings-row { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; margin-bottom: 8px; }

.bg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.bg-option { height: 40px; border-radius: 6px; cursor: pointer; border: 2px solid transparent; position: relative; overflow: hidden; }
.bg-option.selected { border-color: var(--accent-color); }
.bg-option::after { content: '✓'; position: absolute; bottom: 2px; right: 4px; color: white; font-size: 10px; opacity: 0; }
.bg-option.selected::after { opacity: 1; }
.row-text { font-size: 14px; color: var(--text-primary); display: flex; align-items: center; gap: 6px; }

/* 全局提示 */
#toast { 
    visibility: hidden; min-width: 250px; background-color: var(--accent-color); 
    color: #fff; text-align: center; border-radius: 8px; padding: 12px; 
    position: fixed; z-index: 4000; left: 50%; transform: translateX(-50%); 
    bottom: 30px; font-size: 14px; opacity: 0; transition: 0.3s; pointer-events: none; 
}
#toast.show { visibility: visible; opacity: 1; }

/* 后台管理系统样式 (Admin) */
body.admin-page { display: flex; flex-direction: row; width: 100vw; height: 100vh; overflow: hidden; padding: 0; margin: 0; background: var(--bg-body); color: var(--text-primary); }
.admin-login-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; background: radial-gradient(circle at center, var(--bg-hover) 0%, var(--bg-body) 100%); z-index: 1000; }
.admin-layout { display: flex; flex-direction: row; width: 100%; height: 100%; overflow: hidden; }
.admin-sidebar-layout { 
    width: 240px; height: 100%; background: var(--bg-card); 
    border-right: 1px solid var(--border-color); display: flex; flex-direction: column; 
    padding: 20px; gap: 10px; flex-shrink: 0; z-index: 20; 
    box-shadow: 2px 0 10px rgba(0,0,0,0.05); transition: transform 0.3s; 
}
.admin-logo { font-size: 20px; font-weight: 800; color: var(--text-primary); margin-bottom: 20px; padding-left: 5px; display: flex; align-items: center; }
.admin-menu-scroll { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.admin-nav-item { padding: 12px 16px; border-radius: 6px; color: var(--text-secondary); font-size: 14px; cursor: pointer; display: flex; align-items: center; gap: 12px; transition: all 0.2s; font-weight: 500; white-space: nowrap; }
.admin-nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.admin-nav-item.active { background: color-mix(in srgb, var(--accent-color), transparent 90%); color: var(--accent-color); font-weight: 600; }
.logout-btn { color: #ef4444; margin-top: auto; border-top: 1px solid var(--border-color); padding-top: 15px; }
.logout-btn:hover { background: #fee2e2; color: #dc2626; }
.admin-main-layout { flex: 1; display: flex; flex-direction: column; height: 100%; width: 100%; overflow: hidden; background: var(--bg-input); }
.admin-header { height: 60px; background: var(--bg-card); border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; flex-shrink: 0; }
.admin-title { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.admin-content-scroll { flex: 1; padding: 24px; overflow-y: auto; scrollbar-width: thin; }
.table-responsive { width: 100%; overflow-x: auto; border-radius: 8px; border: 1px solid var(--border-color); background: var(--bg-card); }
.admin-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.admin-table th, .admin-table td { text-align: left; padding: 14px 20px; border-bottom: 1px solid var(--border-color); font-size: 14px; color: var(--text-primary); }
.admin-table th { background: var(--bg-input); color: var(--text-secondary); font-weight: 600; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg-hover); }
.admin-toolbar { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
.admin-btn { padding: 8px 16px; border-radius: 6px; font-size: 13px; cursor: pointer; font-weight: 500; border: 1px solid var(--border-color); background: var(--bg-card); color: var(--text-primary); transition: 0.2s; display: inline-flex; align-items: center; gap: 6px; }
.admin-btn:hover { background: var(--bg-hover); }
.admin-btn-primary { background: var(--accent-color); color: white; border-color: var(--accent-color); }
.admin-btn-primary:hover { opacity: 0.9; }
.admin-btn-danger { color: #ef4444; border-color: rgba(239, 68, 68, 0.3); }
.admin-btn-danger:hover { background: #ef4444; color: white; border-color: #ef4444; }
.admin-panel-section { display: none; animation: fadeIn 0.3s; }
.admin-panel-section.active { display: block; }
.mobile-menu-btn { display: none; background: none; border: none; color: var(--text-primary); font-size: 24px; cursor: pointer; padding: 0; margin-right: 15px; }
.mobile-menu-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 15; display: none; }
.mobile-menu-overlay.active { display: block; }

@media (max-width: 768px) {
    body.admin-page { flex-direction: column; }
    .admin-layout { flex-direction: column; }
    .admin-sidebar-layout { position: fixed; left: -240px; top: 0; height: 100%; z-index: 20; transition: left 0.3s ease; box-shadow: 2px 0 10px rgba(0,0,0,0.5); }
    .admin-sidebar-layout.active { left: 0; }
    .mobile-menu-btn { display: block; }
    .admin-header { padding: 0 15px; height: 50px; }
    .admin-content-scroll { padding: 15px; }
    .admin-table th:nth-child(4), .admin-table td:nth-child(4) { display: none; } 
    .modal-card { width: 95%; max-width: 95%; padding: 20px; }
}

html { height: auto !important; min-height: 100vh !important; min-height: 100dvh !important; }
body:not(.admin-page) { height: auto !important; min-height: 100vh !important; min-height: 100dvh !important; padding-bottom: 0 !important; }
.container { display: flex !important; flex-direction: column !important; min-height: 100vh !important; min-height: 100dvh !important; padding-bottom: 0 !important; }
.site-footer { 
    position: static !important; margin-top: auto !important; width: 100% !important; 
    padding-top: 30px !important; margin-bottom: 0 !important; padding-bottom: 15px !important; 
    display: flex !important; justify-content: center !important; align-items: center !important; text-align: center !important;
    font-size: 11px !important; color: var(--text-desc) !important; opacity: 0.6 !important; 
}
.site-footer a { color: inherit !important; text-decoration: none !important; }

.pure-icon-btn { display: none; }