/**
 * 布局样式模块
 * 定义页面主要布局结构，包括头部、轮播图、快捷功能区等
 *
 * @version 1.0.0
 * @date 2026-05-09
 *
 * @module Styles
 * @submodule Layout
 */

/* ============================================
   顶部导航
   ============================================ */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: #1a1a1a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: bold;
    color: var(--primary-blue);
}

.logo i {
    font-size: 20px;
}

/* ============================================
   轮播图
   ============================================ */
.banner {
    margin: 20px;
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
    height: 200px;
}

.banner-slides {
    display: flex;
    transition: transform 0.5s ease;
    height: 100%;
}

.banner-slide {
    flex: 0 0 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
}

.banner-content {
    padding: 40px;
    text-align: left;
    color: white;
    flex: 1;
}

.banner h2 {
    font-size: 24px;
    margin-bottom: 8px;
    font-weight: bold;
}

.banner p {
    font-size: 14px;
    margin-bottom: 20px;
    opacity: 0.9;
}

.banner-btn {
    background-color: white;
    color: var(--primary-blue);
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.banner-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.banner-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 3;
}

.banner-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: var(--transition);
}

.banner-dot.active {
    background-color: white;
    transform: scale(1.2);
}

/* ============================================
   快捷功能区
   ============================================ */
.quick-functions {
    padding: 0 20px 20px;
}

.function-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.function-btn {
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 25px 15px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.function-btn i {
    font-size: 24px;
    color: white;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.function-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0.9;
}

.function-btn.active {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

/* ============================================
   应用列表区域
   ============================================ */
.app-section {
    padding: 0 20px 20px;
    position: relative;
}

.app-grid-wrapper {
    position: relative;
    min-height: 400px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.app-grid-wrapper.loading {
    opacity: 0.4;
    pointer-events: none;
}

.app-grid-wrapper.updating {
    opacity: 0.6;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background-color: rgba(18, 18, 18, 0.7);
    backdrop-filter: blur(4px);
    border-radius: var(--border-radius);
    z-index: 10;
}

.loading-overlay.active {
    display: flex;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-title {
    font-size: 18px;
    font-weight: bold;
}

.section-controls {
    display: flex;
    gap: 10px;
}

.control-btn {
    background: none;
    color: var(--label-color);
    border: none;
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: var(--transition);
}

.control-btn:hover {
    color: var(--text-color);
    background-color: rgba(255, 255, 255, 0.1);
}

.control-btn.active {
    color: var(--primary-blue);
}

/* ============================================
   搜索区域
   ============================================ */
.search-container {
    flex: 1;
    max-width: 500px;
    margin: 0 20px;
}

.search-box {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 8px 40px 8px 16px;
    background-color: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: var(--text-color);
    font-size: 14px;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--highlight-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

.search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    color: var(--label-color);
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 6px;
}

.search-history {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-top: 8px;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    z-index: 100;
}

.search-history.show {
    display: block;
}

.search-history-item {
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.search-history-item:hover {
    background-color: var(--card-hover);
}

.search-history-item span {
    font-size: 14px;
    color: var(--text-color);
}

.clear-history {
    color: var(--label-color);
    font-size: 12px;
    padding: 8px 15px;
    cursor: pointer;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.clear-history:hover {
    color: var(--highlight-color);
}

/* ============================================
   用户控制区
   ============================================ */
.user-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-btn {
    background: none;
    color: var(--text-color);
    border: none;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 16px;
    transition: var(--transition);
}

.user-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--primary-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}
