:root {
    --sidebar-width: 200px;
    --header-height: 80px;
    /* 优雅蓝色系 - 加深的色彩 */
    --primary-color: #5B8DEF;
    --primary-light: #7BA5FF;
    --primary-dark: #3D6FDB;
    --text-main: #2d3436;
    --text-muted: #636e72;
    /* 优化的玻璃效果 - 更高透明度 */
    --bg-glass: rgba(255, 255, 255, 0.75);
    --bg-glass-strong: rgba(255, 255, 255, 0.90);
    --card-bg: rgba(255, 255, 255, 0.80);
    --border-light: rgba(255, 255, 255, 0.5);
    /* 细腻的多层阴影系统 - 加深的蓝色 */
    --shadow-soft: 0 2px 8px rgba(91, 141, 239, 0.08), 0 8px 24px rgba(91, 141, 239, 0.12);
    --shadow-hover: 0 4px 16px rgba(91, 141, 239, 0.12), 0 12px 32px rgba(91, 141, 239, 0.16);
    --shadow-active: 0 1px 4px rgba(91, 141, 239, 0.15);
    /* 优化的圆角系统 */
    --radius-xl: 24px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-pill: 50px;
    /* 快速响应的过渡时间 */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    height: 100vh;
    overflow: hidden;
    color: var(--text-main);
    background: #dfe6e9;
}

/* Allow scrolling on mobile */
@media (max-width: 768px) {
    body {
        overflow-y: auto;
        height: auto;
    }
}

/* Background */
.background-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-size: cover;
    background-position: center;
    transition: background-image 0.8s ease-in-out;
    animation: backgroundFadeIn 1s ease-out;
}

@keyframes backgroundFadeIn {
    from {
        opacity: 0;
        filter: blur(10px);
    }
    to {
        opacity: 1;
        filter: blur(0);
    }
}

.background-layer::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.1);
    /* backdrop-filter removed to show background image clearly */
}

/* Layout */
.dashboard-container {
    display: flex;
    height: 100vh;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
    gap: 20px;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-glass-strong);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    display: flex;
    flex-direction: column;
    padding: 30px 16px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-light);
    flex-shrink: 0;
    transition: all var(--transition-smooth);
    animation: slideInLeft 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
    padding: 0 8px;
}

.brand-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(91, 141, 239, 0.25);
    transition: all var(--transition-smooth);
}

.brand-icon:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 6px 20px rgba(91, 141, 239, 0.4);
}

.brand h1 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    padding-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(91, 141, 239, 0.3) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: 2px;
}

.nav-item {
    padding: 14px 20px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 16px;
    transition: all var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 2;
    padding-right: 40px;
    white-space: nowrap;
    overflow: visible;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.6);
    color: var(--primary-color);
}

.nav-item.active {
    background: linear-gradient(135deg, #6B9FFF 0%, #8FB5FF 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(91, 141, 239, 0.25);
}

.nav-item.active:hover {
    box-shadow: 0 6px 20px rgba(91, 141, 239, 0.35);
}

.nav-item i {
    width: 18px;
    text-align: center;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(0,0,0,0.06);
}

.clock-widget {
    text-align: center;
}

.clock-widget .time {
    font-size: 32px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1;
    margin-bottom: 5px;
    font-variant-numeric: tabular-nums;
    animation: fadeIn 1s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.clock-widget .date {
    font-size: 13px;
    color: var(--text-muted);
}


/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0; /* Prevent flex overflow */
}

/* Top Header */
.top-header {
    height: var(--header-height);
    /* Removed double layer styling */
    display: flex;
    align-items: center;
    justify-content: center; /* Center the search box */
    padding: 0 20px;
    gap: 20px;
    position: relative;
    z-index: 100;
    margin-top: 60px; /* Move search box down */
    margin-bottom: 20px; /* Push content below down further */
}

.search-container {
    width: 100%;
    max-width: 880px;
    display: flex;
    align-items: center;
    background: var(--bg-glass-strong);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-pill);
    padding: 8px 8px 8px 10px;
    position: relative;
    transition: all var(--transition-smooth);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-soft);
    animation: slideInDown 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.search-container:focus-within {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 12px 40px rgba(91, 141, 239, 0.2);
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-engine-selector {
    position: relative;
    margin-right: 10px;
}

.current-engine {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-color);
    transition: all var(--transition-smooth);
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.current-engine:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 4px 12px rgba(91, 141, 239, 0.2);
}

.engine-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    background: white;
    border-radius: var(--radius-md);
    padding: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    width: 120px;
    display: none;
    z-index: 100;
    animation: slideDown 0.2s ease;
}

.engine-dropdown.active {
    display: block;
}

.engine-option {
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-main);
    transition: all var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 8px;
}

.engine-option:hover {
    background: #f5f6fa;
    color: var(--primary-color);
    transform: translateX(4px);
}

.engine-option.active {
    background: linear-gradient(135deg, rgba(91, 141, 239, 0.1) 0%, rgba(123, 165, 255, 0.1) 100%);
    color: var(--primary-color);
    font-weight: 600;
}

#search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 16px;
    color: var(--text-main);
    outline: none;
    padding: 0 10px;
}

#search-button {
    height: 40px;
    padding: 0 24px;
    border: none;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 17px;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

#search-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

#search-button:hover::before {
    left: 100%;
}

#search-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(91, 141, 239, 0.3);
}

#search-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(91, 141, 239, 0.25);
}

.suggestions-box {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    right: 0;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    border: 1px solid rgba(0,0,0,0.05);
    padding: 8px 0;
    display: none;
    z-index: 90;
    overflow: hidden;
}

.suggestions-box.active {
    display: block;
}

.suggestion-item {
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all var(--transition-fast);
}

.suggestion-item:hover, .suggestion-item.selected {
    background: rgba(91, 141, 239, 0.08);
    color: var(--primary-color);
    transform: translateX(2px);
}

/* Menu Styles */
.menu-container {
    position: fixed;
    right: 30px;
    top: 30px;
    z-index: 1000;
}

.menu-trigger {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-glass-strong);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-light);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all var(--transition-smooth);
    box-shadow: var(--shadow-soft);
}

.menu-trigger:hover {
    background: white;
    transform: translateY(-1px) scale(1.05);
    box-shadow: var(--shadow-hover);
}

.menu-trigger:active {
    transform: translateY(0) scale(1);
}

.hamburger-line {
    width: 18px;
    height: 2px;
    background-color: var(--text-main);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-trigger.active .hamburger-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.menu-trigger.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.menu-trigger.active .hamburger-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.menu-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 240px;
    background: #FFFFFF;
    border-radius: var(--radius-lg);
    padding: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.08);
    display: none;
    z-index: 1000;
    animation: slideDown 0.2s ease;
    border: 1px solid rgba(0,0,0,0.06);
}

.menu-dropdown.active {
    display: block;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    color: var(--text-main);
    text-decoration: none;
    border-radius: 12px;
    transition: background 0.2s;
    font-weight: 500;
    cursor: pointer;
}

.menu-item:hover {
    background: linear-gradient(90deg, rgba(91, 141, 239, 0.08) 0%, rgba(123, 165, 255, 0.08) 100%);
    color: var(--primary-color);
    transform: translateX(4px);
}

/* Menu Action Buttons Row */
.menu-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 2px;
    margin-top: 4px;
    justify-content: center;
    max-width: 240px;
}

.menu-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    background: #f8f9fa;
    transition: all var(--transition-smooth);
    position: relative;
    text-decoration: none;
    font-size: 14px;
    flex-shrink: 0;
}

.menu-action-btn:hover, .menu-action-btn.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(91, 141, 239, 0.3);
}

.menu-action-btn:active {
    transform: translateY(-1px) scale(1);
}

/* Tooltip */
.menu-action-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    margin-bottom: 8px;
    visibility: hidden;
    z-index: 1001;
}

.menu-action-btn:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

/* Tooltip Arrow */
.menu-action-btn::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    border-width: 5px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.8) transparent transparent transparent;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    margin-bottom: -2px; /* Adjust to connect with tooltip */
    visibility: hidden;
    z-index: 1001;
}

.menu-action-btn:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

.menu-divider {
    height: 1px;
    background: #eee;
    margin: 8px 0;
}

.menu-section {
    padding: 8px 12px;
}

.menu-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.menu-value {
    font-size: 14px;
    color: var(--text-main);
    line-height: 1.5;
}

#menu-bing-info {
    cursor: default;
    font-size: 14px;
    color: var(--text-main);
}

.bing-title-container {
    max-width: 140px;
    overflow: hidden;
    white-space: nowrap;
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

.bing-title {
    display: inline-block;
    white-space: nowrap;
}

.bing-title.scrolling {
    animation: scroll-left linear infinite;
}

.weather-display {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.weather-local-location {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.weather-main {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: transparent;
    border-radius: 12px;
    margin-bottom: 4px;
}

.weather-icon {
    font-size: 28px;
    color: var(--primary-color);
    filter: drop-shadow(0 2px 8px rgba(91, 141, 239, 0.25));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

.weather-temp {
    font-size: 20px;
    font-weight: 600;
}

.weather-desc {
    color: var(--text-muted);
}

.weather-details {
    display: flex;
    justify-content: space-between;
    gap: 4px;
    font-size: 12px;
    color: var(--text-muted);
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.weather-detail-item {
    display: flex;
    align-items: center;
    justify-content: center; /* Center content within the item */
    gap: 5px;
    padding: 4px 0; /* Adjusted padding */
    flex-basis: 32%; /* Assign basis for flex items */
    text-align: center;
}

.weather-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    text-align: right;
}


/* Content Area */
.content-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px; /* Space for scrollbar */
}

@media (max-width: 768px) {
    .content-scroll-area {
        overflow: visible; /* Let body handle scrolling on mobile */
        padding-right: 0;
    }
}

/* Custom Scrollbar */
.content-scroll-area::-webkit-scrollbar {
    width: 6px;
}
.content-scroll-area::-webkit-scrollbar-track {
    background: transparent;
}
.content-scroll-area::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: 3px;
    transition: all var(--transition-smooth);
}
.content-scroll-area::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    width: 8px;
}

.sites-wrapper {
    padding-bottom: 40px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: white;
    margin: 40px 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.section-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(91, 141, 239, 0.4);
}

.sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.site-card {
    background: var(--card-bg);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    transition: all var(--transition-smooth);
    border: 1px solid rgba(255,255,255,0.5);
    position: relative;
    overflow: hidden;
    height: 100%;
    box-shadow: var(--shadow-soft);
}

.site-card:hover {
    transform: translateY(-4px) scale(1.01);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-hover);
    border-color: rgba(91, 141, 239, 0.3);
}

.site-card:active {
    transform: translateY(-2px) scale(1);
}

.site-icon {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    margin-bottom: 6px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.9);
    padding: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all var(--transition-smooth);
}

.site-card:hover .site-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 4px 12px rgba(91, 141, 239, 0.2);
}

.site-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-name-text {
    display: inline-block;
}

.site-name-text.scrolling {
    animation: scroll-left 2s linear infinite alternate;
}

@keyframes scroll-left {
    0% { transform: translateX(0); }
    100% { transform: translateX(var(--scroll-distance)); }
}

.site-desc {
    display: none; /* Hidden as requested */
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition-smooth);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    width: 600px;
    max-width: 90%;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: 0 24px 80px rgba(0,0,0,0.25);
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-bounce);
    overflow: hidden;
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 15px;
}

.modal-header i {
    font-size: 20px;
    color: var(--text-muted);
}

#site-search-input {
    flex: 1;
    border: none;
    font-size: 18px;
    outline: none;
    color: var(--text-main);
}

.esc-hint {
    font-size: 12px;
    background: #eee;
    padding: 4px 8px;
    border-radius: 6px;
    color: var(--text-muted);
}

.modal-body {
    max-height: 600px;
    overflow-y: auto;
    padding: 10px;
}

.search-result-row {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-main);
    transition: all var(--transition-smooth);
    gap: 15px;
}

.search-result-row:hover {
    background: linear-gradient(90deg, rgba(91, 141, 239, 0.08) 0%, rgba(123, 165, 255, 0.08) 100%);
    transform: translateX(4px);
}

.search-result-row img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.result-info {
    display: flex;
    flex-direction: column;
}

.result-name {
    font-weight: 600;
    font-size: 14px;
}

.result-meta {
    font-size: 12px;
    color: var(--text-muted);
}

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 80px;
    }
    
    .sidebar {
        padding: 30px 10px; /* Reduce horizontal padding to prevent clipping */
    }

    .brand h1, .nav-item span, .clock-widget {
        display: none;
    }
    
    .brand {
        justify-content: center;
        padding: 0;
    }
    
    .brand-icon {
        width: 40px;
        height: 40px;
        border-radius: 50%; /* Circle to match nav items */
        font-size: 20px; /* Match nav item icon size */
    }
    
    .nav-item {
        justify-content: center;
        padding: 0;
        width: 40px; /* Match sidebar content width */
        height: 40px;
        margin: 8px auto;
        border-radius: 50%;
    }
    
    /* Ensure no horizontal scrollbar appears in sidebar and hide scrollbar track */
    .sidebar-nav {
        overflow-x: hidden;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
    }
    
    .sidebar-nav::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }
    
    .nav-item i {
        font-size: 20px;
        width: auto; /* Allow icon to take natural width for centering */
        text-align: center;
    }
}

@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
        padding: 10px;
        height: auto;
        min-height: 100vh;
    }
    
    .sidebar {
        width: 100%;
        flex-direction: row;
        align-items: center;
        padding: 10px 20px;
        height: 70px;
        overflow-x: auto;
        overflow-y: hidden; /* Prevent vertical scrollbar */
        -ms-overflow-style: none;  /* IE and Edge */
        scrollbar-width: none;  /* Firefox */
    }
    
    .sidebar::-webkit-scrollbar {
        display: none;
    }
    
    .brand {
        margin-bottom: 0;
        margin-right: 20px;
        display: flex;
        align-items: center;
        height: 100%;
    }
    
    .sidebar-nav {
        flex-direction: row;
        overflow-y: hidden;
        overflow-x: auto;
        align-items: center;
        display: flex;
        gap: 10px; /* Ensure spacing between items */
        padding: 0; /* Remove inherited padding to fix alignment */
        height: 100%;
        /* Hide scrollbar for cleaner look */
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .sidebar-nav::-webkit-scrollbar {
        display: none;
    }
    
    .nav-item {
        padding: 0;
        width: 40px;
        height: 40px;
        min-width: 40px; /* Prevent shrinking */
        border-radius: 50%;
        margin: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .sidebar-footer {
        display: none;
    }
    
    .top-header {
        padding: 0 15px;
        height: 60px;
        margin-top: 10px; /* Reduce top margin on mobile */
        margin-bottom: 10px; /* Reduce bottom margin on mobile */
    }
    
    .search-container {
        margin-right: 10px;
        padding-right: 10px; /* Increase right padding to prevent button overflow */
    }
    
    .action-btn {
        width: 40px;
        height: 40px;
    }

    /* Mobile adjustments for search button */
    #search-button {
        padding: 0 14px; /* Reduce padding on mobile */
        font-size: 15px;
    }

    /* Mobile adjustments for site cards */
    .sites-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); /* Smaller cards */
        gap: 10px;
    }

    .site-card {
        padding: 10px;
        border-radius: var(--radius-lg);
    }

    .site-icon {
        width: 24px;
        height: 24px;
    }

    .site-name {
        font-size: 12px;
    }
}
/* Hot Search Styles */
.menu-hot-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hot-item {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-main);
    font-size: 13px;
    padding: 6px 4px;
    overflow: hidden;
    border-radius: 8px;
    transition: all var(--transition-smooth);
}

.hot-item:hover {
    background: rgba(91, 141, 239, 0.08);
    transform: translateX(2px);
}

.hot-item:hover .hot-title {
    color: var(--primary-color);
}

.hot-item:hover .hot-title {
    color: var(--primary-color);
}

/* Pagination Buttons */
.page-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 6px;
    font-size: 12px;
    transition: color 0.2s;
    border-radius: 4px;
}

.page-btn:hover {
    color: var(--primary-color);
    background: rgba(0,0,0,0.05);
}

.page-btn.disabled {
    color: #e0e0e0;
    cursor: not-allowed;
    background: transparent;
}

.hot-index {
    font-weight: bold;
    color: var(--text-muted);
    min-width: 20px;
    text-align: center;
    font-size: 13px;
    padding: 2px 6px;
    border-radius: 6px;
    background: #f5f6fa;
    transition: all var(--transition-smooth);
}

.hot-item:hover .hot-index {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    transform: scale(1.1);
}

.hot-index.top-3 {
    background: linear-gradient(135deg, #FF6B81 0%, #FF8FA3 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(255, 107, 129, 0.3);
}

.hot-title-container {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    /* Mask to fade out text if it's too long */
    mask-image: linear-gradient(to right, black 90%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 90%, transparent 100%);
}

.hot-title {
    display: inline-block;
    white-space: nowrap;
    /* Will be animated via JS/CSS class */
}

.hot-title.scrolling {
    animation: scroll-left linear infinite alternate;
    /* Duration will be set by JS based on length */
}

@keyframes scroll-left {
    0% { transform: translateX(0); }
    100% { transform: translateX(var(--scroll-distance)); }
}

.hot-loading {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    padding: 10px 0;
}
/* Custom Select Wrapper */
.custom-select-wrapper {
    position: relative;
    display: inline-block;
}

.custom-select-wrapper::after {
    content: '\f078'; /* Font Awesome caret down */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-muted);
    font-size: 12px;
}

.weather-city-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding: 6px 28px 6px 12px; /* Make space for arrow */
    border-radius: 12px;
    border: none;
    background: #f1f2f6;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    transition: background 0.2s;
}

.weather-city-select:hover {
    background: #e8e9ed;
}

/* Small Button Style */
.small-btn {
    padding: 8px 12px !important;
    font-size: 13px !important;
    justify-content: center;
    background: #f1f2f6;
    margin-top: 8px;
}

/* Weather Warning Colors */
.weather-warn {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 6px;
    margin-top: 4px;
    text-align: center;
}
.weather-warn.blue {
    background-color: #e6f7ff;
    color: #1890ff;
    border: 1px solid #91d5ff;
}
.weather-warn.yellow {
    background-color: #fffbe6;
    color: #faad14;
    border: 1px solid #ffe58f;
}
.weather-warn.orange {
    background-color: #fff7e6;
    color: #fa8c16;
    border: 1px solid #ffd591;
}
.weather-warn.red {
    background-color: #fff1f0;
    color: #f5222d;
    border: 1px solid #ffa39e;
}

/* 添加网站按钮样式 */
.add-site-card {
    cursor: pointer;
    border: 2px dashed rgba(91, 141, 239, 0.3);
    background: rgba(91, 141, 239, 0.05);
    transition: all var(--transition-smooth);
}

.add-site-card:hover {
    border-color: var(--primary-color);
    background: rgba(91, 141, 239, 0.1);
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-hover);
}

.add-site-card:active {
    transform: translateY(-4px) scale(1);
}

.add-site-icon {
    color: var(--primary-color);
    font-size: 24px;
    margin-bottom: 6px;
    transition: all var(--transition-smooth);
}

.add-site-card:hover .add-site-icon {
    transform: scale(1.2) rotate(90deg);
}

.add-site-card .site-name {
    color: var(--primary-color);
    font-weight: 600;
}

/* 添加类别按钮样式 */
.add-category-btn {
    background: linear-gradient(135deg, rgba(91, 141, 239, 0.08) 0%, rgba(123, 165, 255, 0.08) 100%);
    border: 1px solid rgba(91, 141, 239, 0.2);
    padding-right: 16px;
    white-space: nowrap;
    margin-top: 8px;
}

.add-category-btn:hover {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(91, 141, 239, 0.3);
}

/* 表单样式 */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 6px;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e8e9ed;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    transition: all var(--transition-smooth);
    background: white;
}

.form-group input:focus, .form-group select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(91, 141, 239, 0.1);
    transform: translateY(-1px);
}

.input-with-button {
    position: relative;
    display: flex;
}

.input-with-button input[type="url"] {
    flex: 1;
    padding-right: 80px; /* 为按钮留出空间 */
}

.input-button {
    position: absolute;
    right: 2px;
    top: 2px;
    bottom: 2px;
    padding: 0 12px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
}

.input-button:hover {
    box-shadow: 0 4px 12px rgba(91, 141, 239, 0.3);
    transform: scale(1.02);
}

.input-button:active {
    transform: scale(0.98);
}


.form-group select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.form-row {
    display: flex;
    gap: 15px;
    align-items: end;
}

.form-row .form-group {
    flex: 1;
}

.form-row .form-group:first-child {
    flex: 2;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.form-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-smooth);
}

.form-actions button[type="submit"] {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(91, 141, 239, 0.3);
}

.form-actions button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(91, 141, 239, 0.4);
}

.form-actions button[type="submit"]:active {
    transform: translateY(0);
}

.form-actions button[type="button"] {
    background: #f5f6fa;
    color: var(--text-main);
}

.form-actions button[type="button"]:hover {
    background: #e8e9ed;
    transform: translateY(-1px);
}

/* 类别选项卡样式 */
.category-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fafbfc;
}

.category-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 12px;
    border-radius: 12px;
    background: white;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-smooth);
    text-align: center;
    min-height: 80px;
    position: relative;
}

.category-option:hover {
    border-color: var(--primary-color);
    background: rgba(91, 141, 239, 0.05);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 20px rgba(91, 141, 239, 0.2);
}

.category-option.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(91, 141, 239, 0.1) 0%, rgba(123, 165, 255, 0.1) 100%);
    box-shadow: 0 8px 20px rgba(91, 141, 239, 0.3);
    transform: translateY(-4px) scale(1.02);
}

.category-option i {
    font-size: 24px;
    color: var(--text-muted);
    margin-bottom: 8px;
    transition: all var(--transition-smooth);
}

.category-option:hover i,
.category-option.selected i {
    color: var(--primary-color);
    transform: scale(1.2);
}

.category-option span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.category-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5 !important;
    border-color: #ddd !important;
}

.category-option.disabled:hover {
    border-color: #ddd !important;
    background: #f5f5f5 !important;
    transform: none !important;
    box-shadow: none !important;
}

.category-option.disabled i,
.category-option.disabled span {
    color: #999 !important;
}

.existing-label {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 10px;
    color: #999;
    background: rgba(255, 255, 255, 0.8);
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 500;
}

/* 网站卡片容器和收藏按钮 */
.site-card-container {
    position: relative;
}

.favorite-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    color: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-smooth);
    z-index: 10;
    font-size: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    opacity: 0;
}

.site-card-container:hover .favorite-btn {
    opacity: 1;
}

.favorite-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.2) rotate(15deg);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.favorite-btn.active {
    color: #ffd700;
    background: rgba(255, 215, 0, 0.15);
    opacity: 1;
}

.favorite-btn.active:hover {
    background: rgba(255, 215, 0, 0.25);
    transform: scale(1.2) rotate(-15deg);
}

.favorite-btn.readonly {
    cursor: default;
    opacity: 0.8;
}

.favorite-btn.readonly:hover {
    transform: none;
    background: rgba(255, 215, 0, 0.1);
}

/* 删除按钮样式 */
.delete-category-btn {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
    font-size: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.delete-category-btn:hover {
    background: rgba(220, 53, 69, 1);
    transform: translateY(-50%) scale(1.1);
}

.delete-site-btn {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: none;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-smooth);
    z-index: 10;
    font-size: 9px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    opacity: 0;
}

.site-card-container:hover .delete-site-btn {
    opacity: 1;
}

.delete-site-btn:hover {
    background: rgba(220, 53, 69, 1);
    transform: scale(1.2) rotate(90deg);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.4);
}

.refresh-site-btn {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: none;
    background: rgba(91, 141, 239, 0.9);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-smooth);
    z-index: 10;
    font-size: 9px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    opacity: 0;
}

.site-card-container:hover .refresh-site-btn {
    opacity: 1;
}

.refresh-site-btn:hover {
    background: rgba(91, 141, 239, 1);
    transform: translateX(-50%) scale(1.2) rotate(180deg);
    box-shadow: 0 4px 8px rgba(91, 141, 239, 0.4);
}

/* 拖拽排序样式 */
.site-card-container[draggable] {
    cursor: grab;
}

.site-card-container[draggable]:active {
    cursor: grabbing;
}

.site-card-container.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
    z-index: 1000;
}

.site-card-container[draggable]:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* 退出编辑模式按钮样式 */
.exit-edit-mode-container {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    animation: slideInUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.exit-edit-mode-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
    transition: all var(--transition-smooth);
    border: 2px dashed rgba(220, 53, 69, 0.4);
    background: rgba(220, 53, 69, 0.08);
    cursor: pointer;
    min-width: 140px;
    box-shadow: var(--shadow-soft);
}

.exit-edit-mode-card:hover {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.15);
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(220, 53, 69, 0.25);
}

.exit-edit-mode-card:active {
    transform: translateY(-2px);
}

.exit-edit-mode-text {
    font-size: 16px;
    font-weight: 600;
    color: #dc3545;
    white-space: nowrap;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .exit-edit-mode-container {
        bottom: 20px;
    }

    .exit-edit-mode-card {
        padding: 12px 20px;
        min-width: 100px;
    }

    .exit-edit-mode-text {
        font-size: 14px;
    }
}