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

body {
    font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
    color: #fff;
    overflow: hidden; /* Hide scrollbars, we handle scrolling via JS/Wheel */
    height: 100vh;
    display: flex;
    flex-direction: row; /* Changed to row for sidebar layout */
}

a {
    text-decoration: none;
    color: inherit;
}

/* Background */
.bg-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(0px);
    transition: all 0.5s ease;
}

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

/* Layout Wrapper */
.layout-wrapper {
    display: flex;
    width: 100%;
    height: 100%;
}

/* Sidebar */
.sidebar {
    width: 80px; /* Narrow sidebar */
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 20vh; /* Center vertically relative to content approx */
    z-index: 100;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.sidebar-item {
    width: 100%;
    height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.3s ease;
    color: #fff;
    font-size: 12px;
    text-align: center;
    position: relative;
}

.sidebar-item:hover {
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-item.active {
    opacity: 1;
    font-weight: bold;
}

.sidebar-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: #fff;
    border-radius: 0 2px 2px 0;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden; /* Prevent native scroll */
    position: relative;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Clock Section */
.clock-section {
    margin-top: 8vh;
    text-align: center;
    margin-bottom: 40px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    flex-shrink: 0; /* Prevent shrinking */
}

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

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

/* Search Section */
.search-section {
    width: 100%;
    max-width: 600px;
    margin-bottom: 50px;
    position: relative;
    z-index: 10;
    flex-shrink: 0;
}

.clock-section, .search-section { transition: margin 0.3s ease, transform 0.3s ease, opacity 0.3s ease, max-width 0.3s ease; }

.search-box {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 5px 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    height: 50px;
}

.search-box:hover, .search-box:focus-within {
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.search-engine-logo {
    width: 24px;
    height: 24px;
    margin-right: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-engine-logo img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.search-engine-logo svg,
.search-engine-logo .icon {
    width: 100%;
    height: 100%;
}

.search-icon {
    color: rgba(255,255,255,0.7);
    margin-right: 10px;
    display: none; 
}

#search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 16px;
    padding: 0 10px;
}

#search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

#search-btn {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 18px;
    opacity: 0.7;
    transition: opacity 0.2s;
    padding: 0 10px;
}

#search-btn:hover {
    opacity: 1;
}

.engine-panel {
    position: absolute;
    left: 0;
    right: 0;
    top: 65px;
    margin: 0 auto;
    width: 100%;
    max-width: 600px;
    display: none;
    padding: 12px 16px;
    background: rgba(255,255,255,0.18);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.2);
    overflow: hidden;
}

.engine-panel.show { display: flex; }

.engine-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    width: 80px;
    cursor: pointer;
    color: #fff;
    opacity: 0.85;
    transition: transform .2s ease, opacity .2s ease;
}

.engine-item:last-child { margin-right: 0; }

.engine-item:hover { opacity: 1; transform: translateY(-2px); }

.engine-icon { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; }
.engine-name { font-size: 12px; margin-top: 6px; color: rgba(255,255,255,0.9); }
.engine-icon img,
.engine-icon svg,
.engine-icon .icon { width: 100%; height: 100%; object-fit: contain; }

/* Apps Grid */
.apps-container {
    width: 100%;
    max-width: 1100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}

.inline-search-results {
    position: absolute;
    display: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    z-index: 999;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.inline-search-results.show { display: block; }

.inline-search-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    text-decoration: none;
}

.inline-search-item:hover, .inline-search-item.selected {
    background: rgba(255,255,255,0.08);
}

.inline-search-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    margin-right: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
}

.inline-search-index {
    width: 18px;
    margin-right: 8px;
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    text-align: center;
}

.inline-search-content { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.inline-search-url { font-size: 12px; color: rgba(255,255,255,0.7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.inline-search-icon img, .inline-search-icon svg { width: 100%; height: 100%; object-fit: cover; }

.inline-search-name { font-size: 16px; color: #fff; }

.app-group {
    width: 100%;
    /* margin-bottom: 30px;  Removed margin to keep clean view */
    display: none; /* Hidden by default */
    animation: fadeIn 0.4s ease-out;
}

.app-group.active {
    display: flex;
    justify-content: center;
}

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

.group-title {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 15px;
    padding-left: 15px;
    display: none; /* Keep hidden as requested "only content" */
}

.app-grid {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 25px;
    padding-bottom: 50px;
}

.app-item {
    width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.2s ease;
}

.app-item:hover {
    transform: translateY(-5px);
}

.app-item a {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.app-icon {
    width: 60px;
    height: 60px;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    box-shadow: none;
    transition: transform 0.2s ease;
    overflow: visible;
}

.app-item:hover .app-icon {
    transform: translateY(-3px);
}

.app-icon img,
.app-icon svg,
.app-icon .icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
}
.app-icon { border-radius: 16px; overflow: hidden; }

.app-icon i {
    font-size: 24px;
    color: #fff;
}

.app-name {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.add-item .app-icon {
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.3);
}

/* Footer */
.footer {
    padding: 20px;
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    position: absolute;
    bottom: 0;
    width: 100%;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        flex-direction: column;
        overflow: hidden;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 60px;
        height: 100vh;
        flex-direction: column;
        padding-top: 12px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        background: rgba(255, 255, 255, 0.15);
        border: 1px solid rgba(255, 255, 255, 0.1);
        z-index: 200;
    }
    
    .sidebar-item {
        height: auto;
        min-height: 50px;
        padding: 15px 0;
        justify-content: center;
    }
    
    .sidebar-item.active::before {
        width: 3px;
        height: 20px;
        bottom: auto;
        top: 50%;
        left: 0;
        transform: translateY(-50%);
        border-radius: 0 2px 2px 0;
    }

    .time {
        font-size: 50px;
    }
    
    .clock-section {
        margin-top: 6vh;
        margin-bottom: 16px;
    }

    .search-section {
        max-width: 100%;
        padding: 0 12px;
        margin-bottom: 16px;
    }

    .engine-panel {
        position: static;
        max-width: 100%;
        width: 100%;
        margin-top: 8px;
        overflow: hidden;
    }

    .main-content {
        margin-left: 60px;
        height: 100vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        z-index: 100;
        transition: margin-left 0.3s ease;
    }

    .minimal-mode .main-content { margin-left: 0; }

    .app-group.active {
        display: flex;
        justify-content: center;
    }

    .apps-container {
        width: 100%;
        max-width: 1100px;
        display: flex;
        flex-direction: column;
        align-items: center;
        flex: 1;
        position: relative;
    }

    .app-grid {
        display: inline-flex;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 25px;
        padding-bottom: 50px;
    }

    .container {
        padding: 12px 0;
    }

    .app-item { width: 72px; }
    .app-icon { width: 52px; height: 52px; }

    .shortcut-toggle { display: none; }
    .shortcut-panel { display: none; }
}
    
    .app-item {
        width: 70px;
    }
    
    .app-icon {
        width: 50px;
        height: 50px;
    }


.view-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
}

.view-toggle:hover { background: rgba(255, 255, 255, 0.25); }

.shortcut-toggle {
    position: fixed;
    top: 16px;
    right: 60px;
    width: 36px;
    height: 36px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
}

.shortcut-toggle:hover { background: rgba(255, 255, 255, 0.25); }

.shortcut-panel {
    position: fixed;
    top: 60px;
    right: 16px;
    width: 320px;
    max-width: 90%;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    z-index: 1000;
    display: none;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.shortcut-panel.show { display: block; }

.shortcut-title {
    padding: 12px 16px;
    font-size: 14px;
    color: rgba(255,255,255,0.85);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.shortcut-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 12px; }
.shortcut-desc { font-size: 12px; color: rgba(255,255,255,0.85); }
.shortcut-key { font-size: 12px; color: #fff; }

.sidebar { transition: transform 0.3s ease, opacity 0.3s ease; }
.minimal-mode .sidebar { position: absolute; left: 0; top: 0; transform: translateX(-100%); opacity: 0; pointer-events: none; }
.minimal-mode .apps-container { display: none; }
.minimal-mode .clock-section { margin-top: 16vh; }
.minimal-mode .search-section { margin-top: 4vh; margin-bottom: 0; }
.minimal-mode .search-section { max-width: 900px; }
.minimal-mode .clock-section { transform: translateY(20px); }
.minimal-mode .search-section { transform: translateY(20px); }
.inline-search-hints { padding: 8px 12px; font-size: 12px; color: rgba(255,255,255,0.7); text-align: right; border-top: 1px solid rgba(255,255,255,0.08); }
