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

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    overflow-x: hidden;
}

.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
    background-color: black;
}

.background-blur {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(0px);
    background-color: rgba(0, 0, 0, 0.1);
    z-index: -1;
    transition: backdrop-filter 0.3s ease;
}

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

.load-in {
    animation: loadIn 0.6s ease forwards;
    will-change: opacity, transform;
}

.search-box {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.search-box:focus-within {
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.search-input {
    background: transparent;
    border: none;
    outline: none;
    resize: none;
    font-size: 14px;
    color: #333;
}

.search-input::placeholder {
    color: #999;
}

.search-engine {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 25px;
    cursor: pointer;
    transition: background 0.2s;
    will-change: background;
}

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

.search-engine img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.engine-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    padding: 8px;
    min-width: 140px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    will-change: opacity, transform;
    z-index: 100;
}

.engine-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.engine-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

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

.engine-option img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.time-display {
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    margin-bottom: 12px;
}

.time-main {
    font-size: 72px;
    font-weight: 300;
    line-height: 1;
    letter-spacing: -2px;
}

.time-date {
    font-size: 16px;
    opacity: 0.9;
    margin-top: 8px;
}

.time-weather-container {
    display: flex;
    align-items: stretch;
    gap: 24px;
}

.time-weather-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 240px;
}

.hot-search-container {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 16px 20px;
    color: #fff;
    box-shadow: none;
    flex: 1;
    height: 240px;
}

.weather-widget {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 16px 20px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.weather-widget:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.bookmark-card {
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    position: relative;
    will-change: transform, box-shadow;
}

.bookmark-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.bookmark-checkbox {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 8px;
    z-index: 20;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 16px;
}

.bookmark-checkbox input {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.bookmark-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.bookmark-icon img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.lazy-image {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lazy-image.loaded {
    opacity: 1;
}

.bookmark-name {
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bookmark-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.bookmark-card:hover .bookmark-actions {
    opacity: 1;
}

.bookmark-action-btn {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    will-change: background;
    color: #fff;
}

.bookmark-action-btn:hover {
    background: rgba(0, 0, 0, 0.2);
}

.category-title {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 16px;
    padding-left: 8px;
    border-left: 3px solid rgba(255, 255, 255, 0.6);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100%;
    width: 70px;
    background: rgba(46, 46, 46, 0.4);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    z-index: 50;
    transition: width 0.3s ease;
    will-change: width;
}

.sidebar:hover {
    width: 200px;
}

.sidebar-item {
    width: 100%;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 12px;
    padding: 0 10px;
}

.sidebar-item i {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

.sidebar-item span {
    margin-left: 12px;
    white-space: nowrap;
    opacity: 0;
    transition: all 0.3s ease;
    font-size: 16px;
    transform: scale(0);
    transform-origin: left center;
    width: 0;
    margin-left: 0;
    display: none;
}

.sidebar:hover .sidebar-item span {
    opacity: 1;
    transform: scale(1);
    width: auto;
    margin-left: 12px;
    display: inline-block;
}

.sidebar-item:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.sidebar-item.active {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.settings-panel {
    position: fixed;
    right: -400px;
    top: 0;
    width: 400px;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    box-shadow: -4px 0 30px rgba(0, 0, 0, 0.1);
    z-index: 100;
    transition: right 0.3s ease;
    will-change: right;
    overflow-y: auto;
}

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

.settings-header {
    padding: 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.settings-content {
    padding: 24px;
}

.setting-item {
    margin-bottom: 24px;
}

.setting-label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 12px;
    display: block;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 28px;
    background: #ddd;
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.3s;
}

.toggle-switch.active {
    background: #4CAF50;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    background: #fff;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active::after {
    transform: translateX(22px);
}

.slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.overlay.show {
    opacity: 1;
    visibility: visible;
}

.context-menu {
    position: fixed;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
    min-width: 160px;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95);
    transition: all 0.15s ease;
}

.context-menu.show {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.context-item {
    padding: 10px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    transition: background 0.2s;
}

.context-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: #fff;
    border-radius: 20px;
    padding: 32px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 201;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.dialog.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.dialog-header {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 24px;
    color: #333;
}

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

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

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

.form-input:focus {
    border-color: #667eea;
}

.dialog-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn {
    flex: 1;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-secondary {
    background: #f3f4f6;
    color: #666;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-danger {
    background: #ef4444;
    color: #fff;
}

.btn-danger:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.bottom-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(46, 46, 46, 0.6);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 12px 24px;
    display: flex;
    gap: 16px;
    z-index: 50;
}

.bottom-bar-item {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
}

.bottom-bar-item:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    
    .time-main {
        font-size: 48px;
    }
    
    .settings-panel {
        width: 100%;
        right: -100%;
        transition: right 0.3s ease;
        will-change: right;
    }
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.city-list {
    margin-top: 10px;
}

.city-item {
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
}

.city-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.city-item-name {
    font-weight: 500;
    color: #333;
}

.city-item-info {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

.hot-search-container {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.hot-search-header {
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.hot-search-list {
    margin-top: 8px;
}

.hot-search-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s;
    cursor: pointer;
}

.hot-search-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.hot-search-rank {
    width: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-right: 12px;
}

.hot-search-rank.top3 {
    color: #ff4757;
}

.hot-search-content {
    flex: 1;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hot-search-hot {
    font-size: 12px;
    color: #ff6b6b;
    margin-left: 8px;
}

/* 热点搜索标签样式 */
.hot-search-tabs {
    display: flex;
    flex-wrap: wrap;
}

.hot-search-tab {
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.hot-search-tab:hover {
    background: rgba(255, 255, 255, 0.3);
}

.hot-search-tab.active {
    background: #3b82f6;
    color: white;
}

/* 热点搜索项样式 */
.hot-search-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    transition: all 0.2s;
    cursor: pointer;
}

.hot-search-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.hot-search-rank {
    width: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-right: 10px;
    text-align: center;
}

.hot-search-rank.top3 {
    color: #ff4757;
}

.hot-search-content {
    flex: 1;
    font-size: 13px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hot-search-hot {
    font-size: 11px;
    color: #ff6b6b;
    margin-left: 6px;
}

.hot-search-count {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    margin-left: 6px;
}

/* 热点搜索容器 */
.hot-search-container {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 16px 20px;
    color: #fff;
    box-shadow: none;
    flex: 1;
    height: 240px;
}

.hot-search-header {
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.hot-search-list {
    height: calc(100% - 36px);
    overflow-y: auto;
}

/* 辅助样式 */
.flex-1 {
    flex: 1;
}

.city-list {
    max-height: 300px;
    overflow-y: auto;
}