* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background-color: #4b0082; /* Windows 8 紫色背景 */
    color: white;
    padding: 0;
    min-height: 100vh;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: none;
}

.app-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: rgba(0, 0, 0, 0.3);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    backdrop-filter: blur(5px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-grow: 1;
}

.site-title {
    font-size: 28px;
    font-weight: bold;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

.search-container {
    display: flex;
    flex-grow: 1;
    max-width: 400px;
}

.search-box {
    width: 100%;
    padding: 10px 15px;
    font-size: 16px;
    border: none;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 0;
}

.search-box::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-box:focus {
    outline: 2px solid #2d89ef;
    background-color: rgba(255, 255, 255, 0.2);
}

.search-button {
    padding: 0 15px;
    background-color: #2d89ef;
    color: white;
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-button:hover {
    background-color: #1e6fc9;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.time {
    font-size: 18px;
    font-weight: lighter;
    white-space: nowrap;
}

.category-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-button {
    padding: 10px 15px;
    background-color: #2b5797;
    color: white;
    border: none;
    border-radius: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: space-between;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.dropdown-button:hover {
    background-color: #1e4a7e;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: #2b5797;
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 0;
    overflow: hidden;
}

.dropdown-content.show {
    display: block;
}

.dropdown-content a {
    color: white;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: background-color 0.2s;
}

.dropdown-content a:hover {
    background-color: #1e4a7e;
}

.back-button {
    width: 40px;
    height: 40px;
    background-color: #2d89ef;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.back-button.round {
    border-radius: 50%;
}

.back-button:hover {
    background-color: #1e6fc9;
}

/* Metro Hub 样式 */
.metro-hub {
    margin-top: 80px;
    padding: 20px 20px 20px 40px;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: scroll; /* 改为scroll确保始终可滚动 */
    overflow-y: hidden;
    height: calc(100vh - 80px);
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    gap: 0;
    align-items: flex-start;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch; /* 添加iOS平滑滚动支持 */
    overscroll-behavior-x: contain;
}

.metro-hub::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Opera */
}

.category-section {
    scroll-snap-align: start;
    flex: 0 0 100vw; /* 固定为视口宽度 */
    height: calc(100vh - 120px);
    padding: 0 20px;
    box-sizing: border-box;
    margin-right: 40px; /* 分类间距 */
}

.category-title {
    font-size: 28px;
    margin-bottom: 20px;
    font-weight: lighter;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-left: 10px;
}

.tiles-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    overflow-y: auto;
    height: calc(100% - 50px);
    padding-bottom: 20px;
    align-content: flex-start;
}

.tiles-container::-webkit-scrollbar {
    width: 8px;
}

.tiles-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.tiles-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
}

.tiles-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.tile {
    width: 150px;
    height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    color: white;
    transition: transform 0.2s;
    position: relative;
    overflow: hidden;
    border-radius: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.tile:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

.tile-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.tile-text {
    font-size: 16px;
    text-align: center;
    padding: 0 10px;
}

.tile-wide {
    width: 315px;  /* 2倍宽 + 15px间隙 */
}

.tile-tall {
    height: 315px;  /* 2倍高 + 15px间隙 */
}

/* 不同颜色的磁贴 */
.tile-color-1 { background-color: #2d89ef; }
.tile-color-2 { background-color: #2b5797; }
.tile-color-3 { background-color: #e51400; }
.tile-color-4 { background-color: #da532c; }
.tile-color-5 { background-color: #603cba; }
.tile-color-6 { background-color: #00aba9; }
.tile-color-7 { background-color: #647687; }
.tile-color-8 { background-color: #7e3878; }
.tile-color-9 { background-color: #00a300; }
.tile-color-10 { background-color: #1e7145; }
.tile-color-11 { background-color: #514e50; }
.tile-color-12 { background-color: #ff0097; }

.no-results {
    width: 100%;
    text-align: center;
    padding: 40px;
    font-size: 20px;
}

@media (max-width: 1024px) {
    .tile {
        width: 120px;
        height: 120px;
    }
    .tile-wide {
        width: 255px;  /* 2倍宽 + 15px间隙 */
    }
    .tile-tall {
        height: 255px;  /* 2倍高 + 15px间隙 */
    }
}

@media (max-width: 768px) {
    .tile {
        width: calc(33vw - 20px);  /* 每行3个磁贴 */
        height: calc(33vw - 20px);
    }
    .tile-wide {
        width: calc(66vw - 15px);  /* 2倍宽 */
    }
    .tile-tall {
        height: calc(66vw - 15px);  /* 2倍高 */
    }
    .tile-icon {
        font-size: 30px;  /* 缩小图标 */
    }
    .tile-text {
        font-size: 14px;  /* 缩小文字 */
    }
    .app-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 10px;
    }
    .header-left, .header-right {
        flex-direction: row;
        gap: 10px;
        width: 100%;
    }
    .site-title {
        font-size: 22px;
    }
    .search-container {
        max-width: none;
    }
    .metro-hub {
        margin-top: 120px;
        height: calc(100vh - 120px);
    }
    .category-section {
        width: 100vw;
        padding: 0 10px;
    }
}

@media (max-width: 480px) {
    .tile {
        width: calc(50vw - 20px);  /* 每行2个磁贴 */
        height: calc(50vw - 20px);
    }
    .tile-wide {
        width: calc(100vw - 20px);  /* 全宽 */
    }
    .tile-tall {
        height: calc(100vw - 20px);  /* 全高 */
    }
    .tile-icon {
        font-size: 24px;  /* 进一步缩小图标 */
    }
    .tile-text {
        font-size: 12px;  /* 进一步缩小文字 */
    }
}