/* 极光导航 样式表 - 毛玻璃卡片 + 独立滚动 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    min-height: 100vh;
    background: #1a1a2e;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    transition: background-image 0.4s ease;
    position: relative;
    overflow: hidden;
    font-family: 'Segoe UI', 'Inter', system-ui, sans-serif;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 10px;
}

/* 设置按钮 */
.global-settings-btn {
    position: fixed;
    top: 20px;
    right: 24px;
    width: 46px;
    height: 46px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(12px);
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    color: white;
    font-size: 24px;
    border: 1px solid rgba(255,255,255,0.3);
    transition: 0.2s;
}
.global-settings-btn:hover {
    background: rgba(255,255,255,0.35);
    transform: scale(1.02);
}

/* 设置面板 */
.settings-panel {
    position: fixed;
    top: 80px;
    right: 24px;
    width: 280px;
    background: rgba(30, 30, 50, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.25);
    z-index: 999;
    transition: opacity 0.2s, visibility 0.2s;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    color: #f0f0f0;
}
.settings-panel.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.settings-header {
    padding: 12px 18px;
    font-weight: bold;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}
.settings-body {
    padding: 14px;
    max-height: 70vh;
    overflow-y: auto;
}
.setting-group {
    margin-bottom: 18px;
    border-bottom: 1px dashed rgba(255,255,255,0.15);
    padding-bottom: 12px;
}
.setting-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #ffdcb5;
}
.setting-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    padding: 6px 12px;
    border-radius: 28px;
    cursor: pointer;
    font-size: 0.75rem;
    margin-right: 8px;
    margin-bottom: 6px;
    color: white;
}
.setting-btn:hover {
    background: #4f9da6;
}
.danger-btn {
    background: rgba(220, 53, 69, 0.7);
}
.danger-btn:hover {
    background: #dc3545;
}
.setting-btn-sm {
    background: rgba(255,255,255,0.2);
    border: none;
    padding: 4px 10px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.7rem;
    color: white;
}
.wallpaper-thumb {
    background: rgba(255,255,255,0.2);
    border: none;
    padding: 4px 8px;
    border-radius: 16px;
    font-size: 0.65rem;
    cursor: pointer;
    color: white;
}
.local-wallpaper input {
    width: 100%;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.3);
    padding: 5px;
    border-radius: 12px;
    color: white;
    margin: 5px 0;
    font-size: 0.7rem;
}

/* 主布局 */
.app-container {
    display: flex;
    gap: 22px;
    max-width: 1600px;
    margin: 0 auto;
    height: calc(100vh - 70px);
    padding: 16px 16px 8px 16px;
}

/* 左侧分类栏 */
.category-sidebar {
    width: 280px;
    background: rgba(25, 30, 45, 0.6);
    backdrop-filter: blur(16px);
    border-radius: 32px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.2);
    position: relative;
    height: 100%;
}
.nav-header {
    padding: 18px 18px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}
.logo-area {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
}
.logo-area i {
    font-size: 1.4rem;
    color: #7bc5ae;
}
.category-tree-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 12px 8px 20px 12px;
    scroll-behavior: smooth;
}
.category-tree {
    list-style: none;
}
.category-tree li {
    margin: 6px 0;
    cursor: pointer;
}
.tree-node {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 6px;
    border-radius: 16px;
    color: #eef;
}
.tree-node:hover {
    background: rgba(255,255,255,0.2);
}
.tree-node.active {
    background: #4f9da6;
    color: white;
}
.tree-expand {
    width: 20px;
    text-align: center;
    font-size: 12px;
}
.children-list {
    padding-left: 28px;
    list-style: none;
}
.sidebar-to-top-fab {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    font-size: 18px;
    border: 1px solid rgba(255,255,255,0.3);
}
.sidebar-to-top-fab:hover {
    background: #4f9da6;
}

/* 右侧区域 - 透明背景独立滚动 */
.websites-area {
    flex: 1;
    background: transparent !important;
    height: 100%;
    overflow: hidden;
}
.right-scroll-container {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 18px 20px 20px 20px;
    background: transparent;
    scroll-behavior: smooth;
}

/* 时间与一言 */
.time-motd {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(4px);
    padding: 12px 20px;
    border-radius: 44px;
    margin-bottom: 20px;
}
.time-box {
    font-size: 1.2rem;
    font-weight: 600;
    color: #f9f3d9;
}
.hitokoto {
    font-style: italic;
    font-size: 0.85rem;
    color: #ddd;
}

/* 搜索区域 */
.search-section {
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(8px);
    border-radius: 28px;
    padding: 16px 20px;
    margin-bottom: 20px;
}
.search-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}
.search-input {
    flex: 2;
    min-width: 180px;
    padding: 10px 16px;
    border: none;
    border-radius: 40px;
    background: rgba(255,255,255,0.2);
    color: white;
    font-size: 0.9rem;
    outline: none;
}
.search-input::placeholder {
    color: rgba(255,255,255,0.7);
}
.search-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 40px;
    background: #4f9da6;
    color: white;
    cursor: pointer;
}
.search-btn.web {
    background: #ff9800;
}
.search-engines {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}
.engine-label {
    font-size: 0.75rem;
    color: #ddd;
    background: rgba(0,0,0,0.4);
    padding: 4px 8px;
    border-radius: 20px;
}
.engine-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    padding: 5px 12px;
    border-radius: 30px;
    color: white;
    font-size: 0.7rem;
    cursor: pointer;
}
.engine-btn:hover {
    background: #4f9da6;
}
.search-status {
    font-size: 0.7rem;
    color: #ffd966;
    margin-top: 8px;
    text-align: center;
}

/* 毛玻璃卡片 */
.websites-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}
.website-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    padding: 20px 12px;
    text-align: center;
    transition: 0.2s;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.25);
    position: relative;
}
.website-card:hover {
    transform: translateY(-4px);
    background: rgba(255,255,255,0.25);
}
.website-icon {
    width: 52px;
    height: 52px;
    border-radius: 20px;
    margin-bottom: 10px;
    background: white;
    object-fit: contain;
    padding: 6px;
}
.website-name {
    font-weight: bold;
    color: white;
    margin: 8px 0 4px;
}
.website-url {
    font-size: 0.7rem;
    color: #e0e0e0;
    overflow: hidden;
    text-overflow: ellipsis;
}
.website-category {
    display: inline-block;
    font-size: 10px;
    background: transparent !important;
    padding: 2px 0;
    margin-top: 6px;
    border-radius: 0;
    color: white;
}
.card-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: none;
    gap: 6px;
}
.website-card:hover .card-actions {
    display: flex;
}
.edit-btn, .delete-btn {
    width: 28px;
    height: 28px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    background: #2c3e66;
    color: white;
}

/* 白天主题 */
body.light-theme .category-sidebar {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    border-color: rgba(0,0,0,0.1);
}
body.light-theme .tree-node {
    color: #2c3e50;
}
body.light-theme .tree-node.active {
    background: #4f9da6;
    color: white;
}
body.light-theme .website-card {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(0,0,0,0.1);
}
body.light-theme .website-name {
    color: #1e2a3a;
}
body.light-theme .website-url {
    color: #4a5a6a;
}
body.light-theme .website-category {
    color: #ffffff !important;
}
body.light-theme .time-box,
body.light-theme .hitokoto {
    color: #1e2a3a;
}
body.light-theme .global-footer {
    background: rgba(255,255,255,0.6);
    color: #333;
}

/* 黑夜模式下分类标签文字黑色 */
body:not(.light-theme) .website-category {
    color: #000000 !important;
}

/* 音乐播放器 - 右下角固定，鼠标离开自动折叠 */
.music-player-bottom-right {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1100;
    width: 300px;
    background: rgba(30, 30, 50, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.25);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}
.music-player-header {
    padding: 10px 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    color: white;
}
.music-player-body {
    padding: 12px;
    max-height: 480px;
    overflow-y: auto;
    transition: max-height 0.3s;
}
.music-player-bottom-right.collapsed .music-player-body {
    max-height: 0;
    padding: 0;
    overflow: hidden;
}
#audioPlayer {
    width: 100%;
    margin: 8px 0;
    border-radius: 20px;
}
.music-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 8px 0;
}
.music-control-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    color: white;
    font-size: 14px;
}
.playlist {
    list-style: none;
    max-height: 150px;
    overflow-y: auto;
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    padding: 6px;
    margin: 8px 0;
}
.playlist li {
    padding: 6px 8px;
    font-size: 0.7rem;
    cursor: pointer;
    color: #eee;
    white-space: nowrap;
    overflow-x: hidden;
    text-overflow: ellipsis;
}
.playlist li.active {
    background: #4f9da6;
    border-radius: 8px;
}
/* 歌词控制面板内嵌 */
.lyrics-control-panel {
    margin-top: 10px;
    padding: 8px;
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
}
.lyrics-control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    font-weight: bold;
    margin-bottom: 8px;
    color: #ddd;
}
.lyrics-toggle-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 16px;
    padding: 2px 10px;
    font-size: 0.65rem;
    cursor: pointer;
    color: white;
}
.lyrics-control-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
    font-size: 0.7rem;
    color: #ccc;
}
.lyrics-control-row input {
    flex: 1;
}
.small-btn {
    background: rgba(79,157,166,0.7);
    border: none;
    border-radius: 12px;
    padding: 2px 8px;
    cursor: pointer;
    color: white;
    font-size: 0.65rem;
}
.lyrics-container {
    margin-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 8px;
}
.lyrics-title {
    font-size: 0.7rem;
    opacity: 0.8;
    color: white;
}
.lyrics-display {
    font-size: 0.7rem;
    line-height: 1.5;
    max-height: 200px;
    overflow-y: auto;
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    padding: 10px;
    text-align: left;
    white-space: pre-wrap;
    color: #eee;
    transition: all 0.2s;
}

/* 右侧独立置顶按钮 */
.right-to-top-btn {
    position: fixed;
    bottom: 70px;
    right: 24px;
    width: 44px;
    height: 44px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    color: white;
    font-size: 20px;
    border: 1px solid rgba(255,255,255,0.3);
}
.right-to-top-btn:hover {
    background: #4f9da6;
}

/* 左下角数据仓库面板 */
.data-repo-panel {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1100;
}
.repo-trigger {
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(12px);
    border-radius: 40px;
    padding: 8px 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: white;
    font-size: 0.9rem;
    border: 1px solid rgba(255,255,255,0.3);
    transition: 0.2s;
}
.repo-trigger:hover {
    background: #4f9da6;
}
.repo-content {
    position: absolute;
    bottom: 50px;
    left: 0;
    width: 260px;
    background: rgba(20, 25, 40, 0.95);
    backdrop-filter: blur(16px);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.25);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    transition: opacity 0.2s, visibility 0.2s;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.data-repo-panel.open .repo-content {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.repo-header {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    color: white;
}
.repo-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 14px;
}
.repo-list {
    max-height: 280px;
    overflow-y: auto;
    padding: 8px;
}
.preset-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin: 4px 0;
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    cursor: pointer;
    transition: 0.1s;
    color: #eee;
}
.preset-item:hover {
    background: rgba(255,255,255,0.25);
}
.preset-name {
    flex: 1;
    font-size: 0.8rem;
}
.preset-delete {
    background: rgba(220,53,69,0.6);
    border: none;
    color: white;
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 0.65rem;
    cursor: pointer;
}
.preset-delete:hover {
    background: #dc3545;
}
.repo-actions {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid rgba(255,255,255,0.2);
}
.repo-btn {
    background: rgba(79,157,166,0.7);
    border: none;
    padding: 6px 12px;
    border-radius: 24px;
    color: white;
    cursor: pointer;
    font-size: 0.7rem;
    transition: 0.2s;
}
.repo-btn:hover {
    background: #4f9da6;
}
.repo-note {
    font-size: 0.6rem;
    text-align: center;
    padding: 8px;
    color: #aaa;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* 页脚 */
.global-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    padding: 8px;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
    color: #ccc;
    font-size: 0.7rem;
    z-index: 900;
}
.footer-content p {
    margin: 0;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}
.modal.show {
    display: flex;
}
.modal-content {
    background: rgba(30,35,55,0.95);
    backdrop-filter: blur(16px);
    border-radius: 32px;
    padding: 28px;
    width: 90%;
    max-width: 500px;
    color: white;
}
.close-modal {
    float: right;
    font-size: 28px;
    cursor: pointer;
}
.btn-primary {
    background: #4f9da6;
    border: none;
    padding: 8px 16px;
    border-radius: 40px;
    color: white;
    width: 100%;
    margin-top: 12px;
    cursor: pointer;
}
input, select {
    width: 100%;
    padding: 10px;
    margin: 8px 0;
    background: rgba(0,0,0,0.5);
    border: 1px solid #aaa;
    border-radius: 24px;
    color: white;
}
/* 导出模态框中的复选框树样式 */
.cat-checkbox-item {
    margin: 5px 0;
    cursor: pointer;
}
.cat-checkbox-item label {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}
.cat-checkbox-children {
    margin-left: 24px;
    padding-left: 8px;
    border-left: 1px solid #555;
}
@media (max-width: 700px) {
    .app-container { flex-direction: column; }
    .category-sidebar { width: 100%; max-height: 40vh; }
    .search-bar { flex-direction: column; }
    .music-player-bottom-right { width: 260px; }
}