/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 默认隐藏所有光标 */
* {
    caret-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

/* 允许显示光标的输入元素 */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="url"],
textarea,
[contenteditable="true"] {
    caret-color: auto;
    user-select: text;
    -webkit-user-select: text;
}

:root {
    --primary-color: #4a90d9;
    --secondary-color: #667eea;
    --background-dark: #f5f7fa;
    --background-light: #ffffff;
    --text-primary: #1a1a2e;
    --text-secondary: #666666;
    --accent-color: #ff6b6b;
    --success-color: #4ecdc4;
    --card-bg: rgba(0, 0, 0, 0.03);
    --card-border: rgba(0, 0, 0, 0.08);
    --icon-radius: 50%;
}

html, body {
    height: 100%;
    overflow: hidden;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: var(--background-dark);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    /* 启用硬件加速 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* GPU 加速优化 */
.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
}

/* 主容器 */
.main-container {
    height: 100vh;
    width: 100%;
    position: relative;
    overflow: hidden;
}

/* 壁纸背景 */
.wallpaper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #e8ecf3 0%, #f5f7fa 50%, #ffffff 100%);
    z-index: 0;
    margin: 0;
    padding: 0;
    /* 优化背景渲染 */
    background-size: cover;
    background-position: center;
}

.wallpaper::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(255, 255, 255, 0.5) 100%);
    pointer-events: none;
    z-index: 1;
}

.wallpaper::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background-image:
        radial-gradient(2px 2px at 20px 30px, rgba(74, 144, 217, 0.3), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(102, 126, 234, 0.2), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(74, 144, 217, 0.4), transparent),
        radial-gradient(2px 2px at 130px 80px, rgba(102, 126, 234, 0.3), transparent),
        radial-gradient(1px 1px at 160px 120px, rgba(74, 144, 217, 0.3), transparent);
    background-repeat: repeat;
    background-size: 200px 200px;
    animation: twinkle 5s ease-in-out infinite;
    pointer-events: none;
    z-index: 2;
    /* 硬件加速 */
    will-change: opacity;
}

.wallpaper.custom-wallpaper::before,
.wallpaper.custom-wallpaper::after {
    display: none;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* 内容区域 */
.content-area {
    position: relative;
    z-index: 10;
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 页面切换动画 */
.content-area.fade-out {
    opacity: 0;
    transform: scale(0.98);
}

.content-area.fade-in {
    opacity: 1;
    transform: scale(1);
}

.content-area {
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* ==================== 搜索页面 ==================== */
.search-overlay {
    text-align: center;
    padding: 60px;
    opacity: 1;
    visibility: visible;
    transition: all 0.5s ease;
}

.search-container {
    text-align: center;
    padding: 60px;
}

/* 搜索引擎Logo */
.engine-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 15px 25px;
    border-radius: 15px;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.engine-logo:hover {
    background: rgba(0, 0, 0, 0.05);
}

.engine-logo img {
    height: 50px;
    width: auto;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.1));
}

.engine-logo i {
    color: var(--text-secondary);
    font-size: 14px;
    transition: transform 0.3s ease;
}

.engine-logo.open i {
    transform: rotate(180deg);
}

/* 搜索引擎选择器 */
.engine-selector {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--background-light);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 20px;
    display: none;
    z-index: 1000;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    min-width: 320px;
}

.engine-selector.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.engine-selector::before {
    content: '选择搜索引擎';
    display: block;
    text-align: left;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--card-border);
}

.engine-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.engine-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.engine-option:hover {
    background: rgba(0, 0, 0, 0.05);
}

.engine-option img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.engine-option[data-engine="baidu"] img,
.engine-option[data-engine="google"] img,
.engine-option[data-engine="yandex"] img,
.engine-option[data-engine="bing"] img,
.engine-option[data-engine="github"] img,
.engine-option[data-engine="bilibili"] img,
.engine-option[data-engine="zhihu"] img {
    width: 38px;
    height: 38px;
}

.engine-option span {
    font-size: 12px;
    color: var(--text-primary);
}

/* 搜索框 */
.search-box {
    display: flex;
    width: 512px;
    max-width: calc(100vw - 40px);
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50px;
    padding: 0;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    height: 44px;
    transition: all 0.3s ease;
}

.search-box:focus-within {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(74, 144, 217, 0.5);
    box-shadow: 0 8px 32px rgba(74, 144, 217, 0.15);
}

.search-box-wrapper {
    position: relative;
    width: 512px;
    max-width: calc(100vw - 40px);
    margin: 0 auto 30px;
}

.suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    margin-top: 6px;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 100;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.suggestions-list::-webkit-scrollbar {
    width: 6px;
}

.suggestions-list::-webkit-scrollbar-track {
    background: transparent;
}

.suggestions-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.suggestions-list.show {
    display: block;
}

.suggestion-item {
    padding: 10px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.2s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.active {
    background: rgba(74, 144, 217, 0.1);
}

.suggestion-item i {
    color: #666;
    font-size: 14px;
}

.suggestion-item .text {
    flex: 1;
    color: var(--text-primary);
    font-size: 14px;
    text-align: left;
}

.suggestion-item .text em {
    color: var(--primary-color);
    font-style: normal;
}

.search-box input {
    flex: 1;
    padding: 0 16px;
    background: transparent;
    border: none;
    outline: none;
    font-size: 16px;
    color: var(--text-primary);
    height: 100%;
    line-height: 44px;
}

.search-box input::placeholder {
    color: #666;
}

/* ==================== 导航页面 ==================== */
.nav-page {
    position: relative;
    width: 100%;
    height: 70%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 30px 0 30px;
    display: flex;
    flex-direction: column;
    background: var(--background-light);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

/* 编辑模式下 nav-page 支持自由放置 */
.edit-mode .nav-page {
    position: relative;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--card-border);
    flex-wrap: wrap;
    gap: 15px;
}

.page-header h1 {
    font-size: 32px;
    font-weight: 500;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 天气组件样式 - 右下角定位 */
.weather-widget {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: transparent;
    border-radius: 16px;
    transition: all 0.3s ease;
    z-index: 100;
}

/* 编辑模式下天气组件上移，避免与底部按钮重叠 */
.nav-page:has(.edit-actions-section) .weather-widget {
    bottom: 80px;
}

.weather-widget:hover {
    transform: translateY(-3px);
}

.weather-loading {
    color: var(--text-secondary);
    font-size: 13px;
}

.weather-loading i {
    margin-right: 6px;
}

.weather-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.weather-temp {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1;
}

.weather-temp span {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-secondary);
}

.weather-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

.weather-location {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-secondary);
    padding-left: 10px;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
}

.weather-location i {
    font-size: 10px;
}

.weather-error {
    color: var(--text-secondary);
    font-size: 13px;
}

.weather-error i {
    margin-right: 6px;
    color: #f59e0b;
}

.page-content {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.page-content::-webkit-scrollbar {
    display: none;
}

.auth-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.auth-btn,
.wallpaper-btn,
.logout-btn,
.settings-btn,
.admin-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--background-light);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-btn:hover,
.wallpaper-btn:hover,
.logout-btn:hover,
.settings-btn:hover,
.admin-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

.admin-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
}

.admin-btn:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

/* ==================== 设置弹窗 ==================== */
.settings-section {
    margin-bottom: 20px;
}

.settings-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.settings-label i {
    color: var(--primary-color);
}

.settings-select {
    width: 100%;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    transition: all 0.2s ease;
}

.settings-select:hover {
    border-color: var(--primary-color);
    background-color: rgba(74, 144, 217, 0.05);
}

.settings-select:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--background-light);
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.15);
}

.settings-select option {
    padding: 12px 15px;
    background: var(--background-light);
    color: var(--text-primary);
    font-size: 14px;
}

/* 自定义下拉列表 */
.custom-select-wrapper {
    position: relative;
}

.custom-select {
    position: relative;
}

.custom-select-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-select-header:hover {
    border-color: var(--primary-color);
    background: rgba(74, 144, 217, 0.05);
}

.custom-select.open .custom-select-header {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.15);
}

.custom-select-header img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border-radius: 4px;
}

.custom-select-header span {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
}

.custom-select-header i {
    font-size: 12px;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}

.custom-select.open .custom-select-header i {
    transform: rotate(180deg);
}

.custom-select-options {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: var(--background-light);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 100;
}

.custom-select.open .custom-select-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.custom-option:hover {
    background: rgba(74, 144, 217, 0.1);
}

.custom-option.selected {
    background: rgba(74, 144, 217, 0.15);
    color: var(--primary-color);
}

.custom-option img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border-radius: 4px;
}

.custom-option span {
    font-size: 14px;
    color: var(--text-primary);
}

.custom-option.selected span {
    color: var(--primary-color);
    font-weight: 500;
}

.settings-range {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.1);
    outline: none;
    -webkit-appearance: none;
    margin-top: 5px;
}

.settings-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    cursor: pointer;
}

.radius-preview {
    display: flex;
    justify-content: center;
    padding: 15px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 10px;
    margin-top: 15px;
}

.preview-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.settings-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.settings-actions button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(74, 144, 217, 0.4);
}

.btn-secondary {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--card-border);
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.08);
}

/* 开关样式 */
.settings-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.1);
    transition: 0.3s;
    border-radius: 26px;
    border: 1px solid var(--card-border);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-color: transparent;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

#grid-align-status {
    font-size: 14px;
    color: var(--text-secondary);
}

/* 分类 */
.categories-container {
    padding-bottom: 20px;
    flex: 1;
    overflow-y: auto;
    min-height: 550px;
    scrollbar-width: thin;
    scrollbar-color: rgba(74, 144, 217, 0.3) transparent;
}

.categories-container::-webkit-scrollbar {
    width: 6px;
}

.categories-container::-webkit-scrollbar-track {
    background: transparent;
}

.categories-container::-webkit-scrollbar-thumb {
    background: rgba(74, 144, 217, 0.3);
    border-radius: 3px;
}

.categories-container::-webkit-scrollbar-thumb:hover {
    background: rgba(74, 144, 217, 0.5);
}

.category-section {
    margin-bottom: 40px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.category-section.dragging {
    opacity: 0.5;
    transform: scale(1.02);
}

.category-section.drag-over {
    border: 2px dashed var(--primary-color);
    border-radius: 12px;
    background: rgba(74, 144, 217, 0.1);
    padding: 10px;
    margin: -10px;
    margin-bottom: 30px;
}

.category-title-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.category-title {
    font-size: 20px;
    font-weight: 500;
    padding-left: 15px;
    border-left: 3px solid var(--primary-color);
    color: var(--text-primary);
    margin: 0;
    flex: 1;
}

.category-title.editable {
    cursor: pointer;
    transition: color 0.2s ease;
}

.category-title.editable:hover {
    color: var(--primary-color);
}

.category-delete-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-color);
    color: white;
    border: none;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.category-title-wrapper:hover .category-delete-btn {
    opacity: 1;
}

.category-delete-btn:hover {
    background: #ff4757;
    transform: scale(1.1);
}

.category-edit-input {
    font-size: 18px;
    font-weight: 500;
    padding: 4px 10px;
    border: 2px solid var(--primary-color);
    border-radius: 6px;
    background: white;
    color: var(--text-primary);
    outline: none;
    flex: 1;
}

.add-category-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 15px;
    margin-bottom: 20px;
    background: rgba(74, 144, 217, 0.1);
    border: 2px dashed var(--primary-color);
    border-radius: 12px;
    color: var(--primary-color);
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-category-btn:hover {
    background: rgba(74, 144, 217, 0.15);
    transform: translateY(-2px);
}

.sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
}

.site-card {
    background: transparent;
    border: none;
    border-radius: 12px;
    padding: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.site-card:hover {
    transform: scale(1.05);
}

.site-card:active {
    transform: scale(0.95);
}

.site-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--icon-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 4px;
    font-size: 22px;
    background: #ffffff;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: visible;
    position: relative;
    flex-shrink: 0;
}

.site-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    border-radius: var(--icon-radius);
    z-index: 0;
}

.site-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--icon-radius);
    position: relative;
    z-index: 1;
}

.site-icon i {
    font-size: 22px;
    position: relative;
    z-index: 1;
    color: var(--primary-color);
}

.site-name {
    font-size: 11px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-delete {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-color);
    color: white;
    border: none;
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.site-card:hover .site-delete {
    opacity: 1;
}

/* 编辑模式下图标可点击编辑 */
.edit-mode .site-icon[data-editable="true"] {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.edit-mode .site-icon[data-editable="true"]:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.edit-mode .site-icon[data-editable="true"]:hover::after {
    content: '\f044';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-size: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ==================== 热榜页面 ==================== */
.news-page {
    width: 100%;
    height: 70%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px;
    display: flex;
    flex-direction: column;
    background: var(--background-light);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.news-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.news-tab {
    padding: 10px 20px;
    background: var(--background-light);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.news-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.news-tab.active {
    background: linear-gradient(135deg, var(--accent-color), #ff8787);
    color: white;
    border-color: transparent;
}

/* 热榜编辑模式 */
.news-tabs.edit-mode {
    gap: 8px;
}

.news-tabs.edit-mode .news-tab {
    cursor: grab;
    position: relative;
    transition: all 0.2s ease;
}

.news-tabs.edit-mode .news-tab:active {
    cursor: grabbing;
}

.news-tabs.edit-mode .news-tab.dragging {
    opacity: 0.5;
    transform: scale(1.05);
}

.news-tabs.edit-mode .news-tab.drag-over {
    border: 2px dashed var(--primary-color);
    background: rgba(74, 144, 217, 0.1);
}

.news-tab-delete {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ff4757;
    color: white;
    border: 2px solid var(--background-light);
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.news-tabs.edit-mode .news-tab:hover .news-tab-delete {
    opacity: 1;
}

.news-tab-delete:hover {
    transform: scale(1.2);
    background: #ff6b81;
}

.add-news-tab-btn {
    padding: 10px 20px;
    background: transparent;
    border: 2px dashed var(--card-border);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.add-news-tab-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(74, 144, 217, 0.05);
}

.add-news-tab-btn i {
    font-size: 12px;
}

.exit-news-edit-btn {
    padding: 10px 20px;
    background: var(--primary-color);
    border: none;
    border-radius: 20px;
    color: white;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.exit-news-edit-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 217, 0.3);
}

.exit-news-edit-btn i {
    font-size: 12px;
}

/* 热榜编辑模式操作区 */
.news-edit-actions {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    margin-top: auto;
    border-top: 1px solid var(--card-border);
    background: var(--background-light);
    border-radius: 0 0 20px 20px;
    flex-shrink: 0;
}

.news-page.edit-mode .news-edit-actions {
    display: flex;
}

.news-list {
    display: grid;
    gap: 15px;
    padding-bottom: 50px;
}

.news-item {
    background: var(--background-light);
    border: 1px solid var(--card-border);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.news-item:hover {
    transform: translateX(10px);
    background: rgba(255, 255, 255, 1);
    border-color: var(--primary-color);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.news-rank {
    min-width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
}

.news-item:nth-child(1) .news-rank {
    background: linear-gradient(135deg, #ffd700, #ffb347);
    color: #1a1a2e;
}

.news-item:nth-child(2) .news-rank {
    background: linear-gradient(135deg, #c0c0c0, #a8a8a8);
    color: #1a1a2e;
}

.news-item:nth-child(3) .news-rank {
    background: linear-gradient(135deg, #cd7f32, #b8860b);
    color: white;
}

.news-info {
    flex: 1;
    min-width: 0;
}

.news-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 12px;
    color: var(--text-secondary);
}

.news-hot {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--accent-color);
}

.news-cover {
    width: 120px;
    height: 80px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.loading {
    text-align: center;
    padding: 50px;
    color: var(--text-secondary);
    font-size: 16px;
}

.loading i {
    margin-right: 10px;
}

/* ==================== 视图指示器 ==================== */
/* 已删除 */

/* ==================== 页脚 ==================== */
.page-footer {
    position: absolute;
    bottom: 3px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    z-index: 100;
}

.page-footer.hidden {
    display: none;
}

/* ==================== 关于本站按钮 ==================== */
.about-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 5px;
    border-radius: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 10px;
    opacity: 0.7;
}

.about-btn:hover {
    transform: translateY(-2px);
}

.about-btn i {
    color: var(--text-secondary);
    font-size: 10px;
}

.about-btn span {
    color: var(--text-secondary);
    font-size: 10px;
}

/* ==================== 关于本站弹窗 ==================== */
.shortcut-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.shortcut-modal.hidden {
    display: none;
}

.shortcut-modal-content {
    position: relative;
    background: var(--background-light);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 30px;
    width: 90%;
    max-width: 450px;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalFadeIn 0.3s ease;
}

.shortcut-modal-content .close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.3s;
}

.shortcut-modal-content .close-modal:hover {
    color: var(--primary-color);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 选项卡 */
.about-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.05);
    padding: 5px;
    border-radius: 12px;
}

.about-tab {
    flex: 1;
    padding: 10px 15px;
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.about-tab:hover {
    color: var(--text-primary);
}

.about-tab.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

/* 面板内容 */
.about-panel {
    display: none;
}

.about-panel.active {
    display: block;
}

.about-content h4 {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
    margin-top: 15px;
    color: var(--text-primary);
}

.about-content h4:first-child {
    margin-top: 0;
}

.about-content p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 10px;
}

.about-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.about-content ul li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.about-content ul li:last-child {
    border-bottom: none;
}

.about-content ul li i {
    color: var(--primary-color);
    font-size: 14px;
    width: 20px;
}

.about-content ul li strong {
    color: var(--text-primary);
}

.about-content a {
    color: var(--text-secondary);
    text-decoration: none;
}

.about-content a:hover {
    text-decoration: underline;
}

/* 快捷键列表 */
.shortcut-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.shortcut-item kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 12px;
    color: var(--text-primary);
}

.shortcut-item span {
    color: var(--text-secondary);
    font-size: 14px;
}

.shortcut-close {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ==================== 模态框 ==================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--background-light);
    padding: 40px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    position: relative;
    border: 1px solid var(--card-border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: var(--accent-color);
}

.modal-content h2 {
    margin-bottom: 25px;
    text-align: center;
    font-weight: 400;
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 1);
}

/* 带按钮的输入框 */
.input-with-btn {
    display: flex;
    gap: 10px;
    align-items: center;
}

.input-with-btn input {
    flex: 1;
}

.send-code-btn {
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.send-code-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.send-code-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.category-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.category-input-wrapper select {
    flex: 1;
}

.category-input-wrapper input {
    flex: 1;
}

.quick-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-category {
    padding: 6px 14px;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.quick-category:hover {
    background: rgba(74, 144, 217, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.quick-category .delete-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 10px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.quick-category:hover .delete-btn {
    display: flex;
}

.quick-category .delete-btn:hover {
    background: #ff4757;
    transform: scale(1.1);
}

.quick-category.editing {
    background: rgba(74, 144, 217, 0.15);
    border-color: var(--primary-color);
}

.quick-category.editing .delete-btn {
    display: none !important;
}

.quick-category-edit-input {
    border: none;
    background: transparent;
    font-size: 13px;
    color: var(--primary-color);
    width: 80px;
    text-align: center;
    outline: none;
}

.icon-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.icon-input-wrapper input {
    flex: 1;
}

.icon-preview {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
    font-size: 20px;
}

.icon-preview img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(74, 144, 217, 0.4);
}

.switch-form {
    text-align: center;
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

.switch-form a {
    color: var(--primary-color);
    text-decoration: none;
}

/* ==================== 编辑模式 ==================== */
.edit-mode .site-card {
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.edit-mode .site-card:active {
    cursor: grabbing;
}

/* 拖拽浮动层 */
.site-card.drag-ghost {
    position: fixed;
    z-index: 10000;
    pointer-events: none;
    opacity: 1;
    transform: scale(1.15);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    background: var(--background-light);
    transition: none !important;
}

/* 拖放位置指示器 */
.drop-indicator {
    position: absolute;
    border: 2px dashed var(--primary-color);
    border-radius: 12px;
    background: rgba(74, 144, 217, 0.1);
    pointer-events: none;
    z-index: 100;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.edit-mode .site-card.drag-over {
    transform: scale(0.95);
    opacity: 0.7;
}

.edit-mode .site-delete {
    opacity: 0;
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ff4757;
    color: white;
    border: 2px solid var(--background-light);
    font-size: 10px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.2, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.4);
}

.edit-mode .site-card:hover .site-delete {
    opacity: 1;
}

.edit-mode .site-delete:hover {
    transform: scale(1.2);
    background: #ff6b81;
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.5);
}

.add-site-card {
    background: transparent;
    border: 2px dashed var(--card-border);
    border-radius: 15px;
    padding: 20px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.add-site-card:hover {
    border-color: var(--primary-color);
    background: rgba(74, 144, 217, 0.1);
}

.add-site-card i {
    font-size: 32px;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.add-site-card:hover i {
    color: var(--primary-color);
}

.add-site-card span {
    font-size: 14px;
    color: var(--text-secondary);
}

.add-site-card:hover span {
    color: var(--primary-color);
}

/* ==================== 壁纸设置 ==================== */
/* 壁纸按钮样式已合并到 auth-section 中 */

.wallpaper-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.wallpaper-modal.hidden {
    display: none;
}

/* 编辑模式操作区 - 固定在 nav-page 底部 */
.edit-actions-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    margin-top: auto;
    border-top: 1px solid var(--card-border);
    background: var(--background-light);
    border-radius: 0 0 20px 20px;
    flex-shrink: 0;
}

.add-site-btn {
    padding: 12px 30px;
    background: rgba(74, 144, 217, 0.1);
    border: 2px solid var(--primary-color);
    border-radius: 25px;
    color: var(--primary-color);
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.add-site-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(74, 144, 217, 0.3);
}

.add-site-btn i {
    font-size: 14px;
}

.exit-edit-btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 25px;
    color: white;
    font-size: 15px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.exit-edit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(74, 144, 217, 0.4);
}

.exit-edit-btn i {
    font-size: 14px;
}

/* 自由定位容器 */
.free-position-container {
    position: relative;
    width: 100%;
    min-height: 100%;
    flex: 1;
    overflow: visible;
}

/* 编辑模式下的自由定位容器需要滚动 */
.edit-mode .free-position-container {
    overflow: auto;
    padding: 15px 5px 5px 15px;
    min-height: 550px;
    scrollbar-width: thin;
    scrollbar-color: rgba(74, 144, 217, 0.3) transparent;
}

.edit-mode .free-position-container::-webkit-scrollbar {
    width: 6px;
}

.edit-mode .free-position-container::-webkit-scrollbar-track {
    background: transparent;
}

.edit-mode .free-position-container::-webkit-scrollbar-thumb {
    background: rgba(74, 144, 217, 0.3);
    border-radius: 3px;
}

.edit-mode .free-position-container::-webkit-scrollbar-thumb:hover {
    background: rgba(74, 144, 217, 0.5);
}

/* 自由定位卡片 */
.free-position-card {
    position: absolute;
    cursor: pointer;
    width: 80px;
    height: auto;
    transition: box-shadow 0.2s ease, transform 0.1s ease;
}

/* 编辑模式下的自由定位卡片可拖拽 */
.edit-mode .free-position-card {
    cursor: grab;
}

.free-position-card:active,
.free-position-card.dragging {
    cursor: grabbing;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

/* 非编辑模式下悬停效果 */
.free-position-card:hover:not(.dragging) {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* 拖拽时其他卡片的碰撞提示 */
.free-position-container.dragging-active .free-position-card:not(.dragging) {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* 拖拽时的浮动层 */
.drag-ghost {
    cursor: grabbing;
    pointer-events: none;
}

.wallpaper-modal-content {
    background: var(--background-light);
    padding: 30px;
    border-radius: 20px;
    width: 560px;
    max-width: 90%;
    height: 700px;
    max-height: 85vh;
    border: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.wallpaper-modal-content h2 {
    margin-bottom: 20px;
    text-align: center;
    font-weight: 400;
    flex-shrink: 0;
}

/* 选项卡导航 */
.wallpaper-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.05);
    padding: 5px;
    border-radius: 12px;
}

.wallpaper-tab {
    flex: 1;
    padding: 10px 15px;
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wallpaper-tab:hover {
    color: var(--text-primary);
}

.wallpaper-tab.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

/* 面板容器 */
.wallpaper-panel {
    display: none;
    min-height: 200px;
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
}

.wallpaper-panel::-webkit-scrollbar {
    width: 4px;
}

.wallpaper-panel::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

.wallpaper-panel.active {
    display: block;
}

/* 静态壁纸分类选项卡 */
.static-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--card-border);
}

.static-tab {
    padding: 6px 12px;
    font-size: 12px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.static-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.static-tab.active {
    color: white;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

/* 静态分类内容 */
.static-category {
    display: none;
}

.static-category.active {
    display: block;
}

/* 壁纸网格 */
.wallpaper-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.wallpaper-item {
    cursor: pointer;
    text-align: center;
    padding: 8px;
    border-radius: 10px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.wallpaper-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.wallpaper-item.selected {
    border-color: var(--primary-color);
    background: rgba(74, 144, 217, 0.15);
}

.wallpaper-preview-item {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    margin-bottom: 6px;
}

.wallpaper-preview-item.dynamic-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    overflow: hidden;
}

.wallpaper-preview-item.dynamic-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wallpaper-preview-item.dynamic-preview i {
    font-size: 24px;
    color: var(--primary-color);
}

.wallpaper-item span {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 自定义选项 */
.wallpaper-custom-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.custom-option {
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.custom-option:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
}

.custom-option-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.custom-option-header i {
    font-size: 18px;
    color: var(--primary-color);
}

.custom-option-header span {
    font-size: 14px;
    font-weight: 500;
}

.wallpaper-url-input {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
}

.wallpaper-url-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.wallpaper-upload-area {
    border: 2px dashed var(--card-border);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wallpaper-upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(74, 144, 217, 0.1);
}

.wallpaper-upload-area i {
    font-size: 28px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.wallpaper-upload-area p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 5px;
}

.wallpaper-upload-area .upload-hint {
    font-size: 12px;
    color: var(--text-tertiary);
}

.wallpaper-upload-area input {
    display: none;
}

.wallpaper-preview {
    margin-top: 15px;
    text-align: center;
    flex-shrink: 0;
}

.wallpaper-preview img {
    max-width: 100%;
    max-height: 100px;
    border-radius: 10px;
    object-fit: cover;
}

.wallpaper-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-shrink: 0;
    padding-top: 15px;
    border-top: 1px solid var(--card-border);
}

.wallpaper-actions button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.wallpaper-actions .btn-save {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.wallpaper-actions .btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(74, 144, 217, 0.4);
}

.wallpaper-actions .btn-reset {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.wallpaper-actions .btn-reset:hover {
    background: rgba(255, 255, 255, 0.2);
}

.wallpaper-actions .btn-cancel {
    background: rgba(255, 107, 107, 0.2);
    color: var(--accent-color);
}

.wallpaper-actions .btn-cancel:hover {
    background: rgba(255, 107, 107, 0.3);
}

/* ==================== 隐藏类 ==================== */
.hidden {
    display: none !important;
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    .search-box,
    .search-box-wrapper {
        width: calc(100vw - 32px);
        max-width: calc(100vw - 32px);
    }

    .search-box {
        height: 40px;
    }

    .search-box input {
        font-size: 15px;
        line-height: 40px;
    }

    .view-indicator {
        right: 15px;
    }

    .dot {
        width: 10px;
        height: 10px;
    }

    .page-header {
        flex-direction: column;
        gap: 15px;
    }

    .sites-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 6px;
    }

    .news-tabs {
        padding-bottom: 10px;
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .news-item {
        flex-direction: column;
    }

    .news-cover {
        width: 100%;
        height: 150px;
    }
}
