* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-primary: #333;
    --text-secondary: #666;
    --accent-color: #4f46e5;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: var(--solid-bg-color, transparent);
    background-image: var(--bg-image, none);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text-primary);
    overflow-x: hidden;
    position: relative;
}

/* 动态背景动画层 */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -3;
    background: linear-gradient(45deg, #12c2e9, #c471ed, #f64f59, #12c2e9);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    opacity: 1;
    transition: opacity 0.5s;
}

.bg-animation.hidden {
    opacity: 0;
    pointer-events: none;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 纯色背景层 */
.solid-bg-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
}

.solid-bg-layer.active {
    opacity: 1;
}

/* 暗角遮罩 */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    z-index: -1;
    pointer-events: none;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
}

/* 背景控制按钮 */
.bg-control {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 100;
}

.bg-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--card-bg);
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow);
    font-size: 20px;
    color: var(--accent-color);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.bg-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.bg-btn.active {
    background: var(--accent-color);
    color: white;
}

/* 顶部时间 */
.header-time {
    text-align: center;
    color: white;
    margin-bottom: 50px;
    cursor: pointer;
    transition: transform 0.3s;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.header-time:hover {
    transform: scale(1.02);
}

.time-display {
    font-size: 100px;
    font-weight: 200;
    letter-spacing: -3px;
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.date-display {
    font-size: 20px;
    opacity: 0.9;
    margin-top: 10px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* 搜索栏 */
.search-container {
    max-width: 700px;
    margin: 0 auto 60px;
    position: relative;
}

.search-box {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 30px;
    padding: 5px;
    display: flex;
    align-items: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    transition: transform 0.3s;
}

.search-box:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 15px 50px rgba(0,0,0,0.3);
}

.search-engine-selector {
    padding: 12px 20px;
    border-right: 1px solid #eee;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
    border-radius: 25px 0 0 25px;
    transition: background 0.3s;
    min-width: 100px;
    justify-content: center;
}

.search-engine-selector:hover {
    background: #f5f5f5;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 20px;
    font-size: 16px;
    background: transparent;
}

.search-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.3s, background 0.3s;
}

.search-btn:hover {
    transform: scale(1.1);
    background: #4338ca;
}

/* 网站导航区域 */
.nav-section {
    margin-top: 20px;
    margin-bottom: 30px;
}

.section-header {
    margin-bottom: 25px;
    color: white;
    text-align: center;
}

.section-title {
    font-size: 28px;
    font-weight: 600;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    margin-bottom: 8px;
}

.section-subtitle {
    font-size: 14px;
    opacity: 0.8;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* 分类标签 */
.category-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    justify-content: center;
}

.category-tab {
    padding: 8px 16px;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 20px;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
}

.category-tab.active {
    background: white;
    color: #333;
}

/* 图标网格 */
.icons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.icon-item {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 20px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    backdrop-filter: blur(10px);
    border: 2px solid transparent;
}

.icon-item:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border-color: rgba(255,255,255,0.5);
}

.icon-item.dragging {
    opacity: 0.5;
}

.icon-logo {
    width: 50px;
    height: 50px;
    margin: 0 auto 10px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    position: relative;
}

.icon-delete {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: #ff6b6b;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s;
    cursor: pointer;
}

.icon-item:hover .icon-delete {
    opacity: 1;
}

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

.add-icon {
    border: 2px dashed rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.1);
    color: white;
}

.add-icon:hover {
    background: rgba(255,255,255,0.2);
}

.add-icon .icon-logo {
    background: transparent;
    border: 2px dashed currentColor;
    color: currentColor;
}

/* 底部功能区 */
.bottom-section {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.bottom-header {
    text-align: center;
    color: white;
    margin-bottom: 25px;
}

.bottom-title {
    font-size: 24px;
    font-weight: 600;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    margin-bottom: 5px;
}

.bottom-subtitle {
    font-size: 13px;
    opacity: 0.8;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* 操作按钮网格 */
.action-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.action-btn {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 25px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
    backdrop-filter: blur(10px);
}

.action-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border-color: rgba(255,255,255,0.5);
}

.action-icon {
    width: 55px;
    height: 55px;
    margin: 0 auto 12px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: white;
}

.action-btn.import .action-icon { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.action-btn.settings .action-icon { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.action-btn.add .action-icon { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }

.action-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

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

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalIn 0.3s;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: #f5f5f5;
    cursor: pointer;
    transition: background 0.2s;
}

.modal-close:hover {
    background: #e0e0e0;
}

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.btn-primary {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    width: 100%;
    font-size: 16px;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #4338ca;
}

.btn-secondary {
    background: #f5f5f5;
    color: #333;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    margin-top: 10px;
    width: 100%;
}

/* 设置面板 */
.settings-panel {
    position: fixed;
    right: -400px;
    top: 0;
    width: 400px;
    height: 100%;
    background: white;
    box-shadow: -5px 0 30px rgba(0,0,0,0.1);
    z-index: 999;
    transition: right 0.3s;
    overflow-y: auto;
    padding: 30px;
}

.settings-panel.active {
    right: 0;
}

.settings-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    z-index: 998;
}

.settings-overlay.active {
    display: block;
}

/* 极简模式 */
body.minimal-mode .nav-section,
body.minimal-mode .bottom-section,
body.minimal-mode .date-display {
    opacity: 0;
    pointer-events: none;
    height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

body.minimal-mode .time-display {
    font-size: 140px;
    margin-top: 35vh;
}

/* 响应式 */
@media (max-width: 768px) {
    .time-display { font-size: 60px; }
    .icons-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
    .settings-panel { width: 100%; right: -100%; }
    .bg-control { bottom: 20px; right: 20px; }
    .bg-btn { width: 45px; height: 45px; font-size: 18px; }
    
    .action-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .action-btn {
        padding: 20px 10px;
    }
    
    .action-icon {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .action-name {
        font-size: 13px;
    }
    
    .action-desc {
        font-size: 11px;
    }
}

/* 导入导出区域 */
.import-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
}

.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
    width: 100%;
}

.file-input-wrapper input[type=file] {
    position: absolute;
    left: -9999px;
}

.file-input-label {
    display: block;
    padding: 12px;
    background: white;
    border: 2px dashed #ccc;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.file-input-label:hover {
    border-color: var(--accent-color);
    background: #f0f0ff;
}

/* 颜色选择器 */
.color-picker {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.color-option {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: transform 0.2s;
}

.color-option:hover {
    transform: scale(1.2);
}

.color-option.selected {
    border-color: #333;
}

/* 纯色背景选择器 */
.solid-color-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.solid-color-option {
    aspect-ratio: 16/9;
    border-radius: 12px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.solid-color-option:hover {
    transform: scale(1.02);
}

.solid-color-option.selected {
    border-color: #333;
    box-shadow: 0 0 0 2px white, 0 0 0 4px #333;
}

/* 背景类型选择 */
.bg-type-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.bg-type-btn {
    flex: 1;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.bg-type-btn:hover {
    border-color: var(--accent-color);
    background: #f0f0ff;
}

.bg-type-btn.active {
    border-color: var(--accent-color);
    background: #f0f0ff;
    color: var(--accent-color);
}

.bg-type-btn i {
    font-size: 24px;
    margin-bottom: 5px;
    display: block;
}

/* 提示消息 */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    opacity: 0;
    transition: all 0.3s;
    z-index: 1001;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 壁纸信息 */
.wallpaper-info {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 12px 20px;
    border-radius: 20px;
    font-size: 13px;
    backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 50;
    max-width: 300px;
}

.wallpaper-info.show {
    opacity: 1;
}

.wallpaper-info .title {
    font-weight: 600;
    margin-bottom: 4px;
}

.wallpaper-info .author {
    font-size: 12px;
    opacity: 0.8;
}

/* 自定义背景预览 */
.custom-bg-preview {
    width: 100%;
    height: 120px;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    margin-top: 10px;
    border: 2px dashed #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    position: relative;
    overflow: hidden;
}

.custom-bg-preview.has-image {
    border-style: solid;
    border-color: var(--accent-color);
}

.custom-bg-preview .remove-bg {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255,0,0,0.8);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
}

.custom-bg-preview.has-image .remove-bg {
    display: flex;
}
