/* ========== 基础重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #4A6CF7;
    --primary-light: #6B8AFF;
    --bg: #F5F6FA;
    --card-bg: #FFFFFF;
    --text: #333333;
    --text-light: #888888;
    --border: #EEEEEE;
    --radius: 12px;
    --shadow: 0 2px 12px rgba(0,0,0,0.06);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    max-width: 750px;
    margin: 0 auto;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 20px;
}

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

/* ========== 顶部导航 ========== */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--card-bg);
    box-shadow: 0 1px 6px rgba(0,0,0,0.05);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo {
    height: 40px;
    width: 40px;
    border-radius: 10px;
    object-fit: cover;
}

.header-logo-icon {
    height: 40px;
    width: 40px;
    border-radius: 10px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.header-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.header-welcome {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.header-domain {
    display: flex;
    align-items: center;
    gap: 4px;
}

.domain-text {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    animation: domainColor 3s ease-in-out infinite;
}

.domain-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #52C41A;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
}

@keyframes domainColor {
    0%, 100% { color: var(--primary); }
    33% { color: #52C41A; }
    66% { color: #FAAD14; }
}

.menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.menu-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: 0.3s;
}

/* ========== 侧边菜单 ========== */
.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

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

.side-menu {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100%;
    background: var(--card-bg);
    z-index: 300;
    transition: 0.3s ease;
    box-shadow: -4px 0 20px rgba(0,0,0,0.1);
}

.side-menu.open {
    right: 0;
}

.menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
}

.menu-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
    padding: 4px;
}

.menu-items {
    padding: 12px 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    font-size: 15px;
    color: var(--text);
    transition: background 0.2s;
}

.menu-item:hover {
    background: var(--bg);
}

.menu-icon {
    font-size: 20px;
}

/* ========== Banner轮播 ========== */
.banner-section {
    position: relative;
    margin: 12px;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 16/8;
    background: #e0e0e0;
}

.banner-wrapper {
    display: flex;
    transition: transform 0.5s ease;
    height: 100%;
}

.banner-slide {
    flex: 0 0 100%;
    height: 100%;
}

.banner-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.banner-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: 0.3s;
}

.dot.active {
    background: #fff;
    width: 20px;
    border-radius: 4px;
}

/* ========== 公告滚动 ========== */
.notice-section {
    display: flex;
    align-items: center;
    margin: 12px;
    padding: 10px 14px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.notice-label {
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    margin-right: 10px;
}

.notice-scroll {
    flex: 1;
    overflow: hidden;
    height: 20px;
}

.notice-content {
    display: flex;
    white-space: nowrap;
    animation: noticeScroll 6s linear infinite;
}

.notice-text {
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 600;
    padding-right: 50px;
    animation: noticeColor 3s ease-in-out infinite;
}

@keyframes noticeColor {
    0%, 100% { color: #FF6B6B; }
    33% { color: #4A6CF7; }
    66% { color: #52C41A; }
}

@keyframes noticeScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ========== 图标导航 ========== */
.icon-nav-section {
    margin: 12px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.icon-nav-tabs {
    display: flex;
    padding: 12px 16px 0;
    gap: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    justify-content: center;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.icon-nav-tabs::-webkit-scrollbar {
    display: none;
}

.icon-tab {
    flex: 1;
    padding: 12px 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    font-size: 15px;
    cursor: pointer;
    transition: 0.3s;
    white-space: nowrap;
    color: #999;
    font-weight: 600;
    text-align: center;
}

.icon-tab.active {
    background: #000;
    color: #fff;
}

.icon-nav-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 16px 12px;
}

.icon-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 4px;
    border-radius: 10px;
    transition: background 0.2s;
}

.icon-nav-item:active {
    background: var(--bg);
}

.icon-nav-icon {
    font-size: 28px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border-radius: 12px;
    overflow: hidden;
}

.icon-nav-icon img {
    border-radius: 12px;
}

.icon-nav-title {
    font-size: 13px;
    color: var(--text);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    font-weight: 700;
}

.empty-tip {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-light);
    font-size: 14px;
    padding: 20px;
}

/* ========== 卡片导航 ========== */
.card-nav-section {
    margin: 0 12px;
}

.card-nav-group {
    margin-bottom: 12px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-nav-title {
    font-size: 16px;
    font-weight: 700;
    padding: 14px 16px 8px;
    color: var(--text);
    position: relative;
    padding-left: 24px;
}

.card-nav-title::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 16px;
    bottom: 10px;
    width: 3px;
    background: var(--primary);
    border-radius: 2px;
}

.card-nav-grid {
    padding: 8px 12px 14px;
}

.card-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    transition: opacity 0.2s;
    background: #000;
}

.card-nav-item:active {
    opacity: 0.85;
}

.card-nav-item + .card-nav-item {
    margin-top: 8px;
}

.card-nav-icon {
    font-size: 24px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    flex-shrink: 0;
    overflow: hidden;
}

.card-nav-icon img {
    border-radius: 10px;
}

.card-nav-info {
    flex: 1;
    min-width: 0;
}

.card-nav-name {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

.card-nav-desc {
    font-size: 12px;
    color: #fff;
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-nav-arrow {
    color: #fff;
    font-size: 18px;
    flex-shrink: 0;
    margin-left: 4px;
}

/* ========== 大卡片 ========== */
.big-card-section {
    margin: 0 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.big-card {
    display: block;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s;
}

.big-card:active {
    transform: scale(0.98);
}

.big-card-img {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.big-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.big-card-info {
    padding: 14px 16px;
}

.big-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.big-card-desc {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========== 底部 ========== */
.footer {
    text-align: center;
    padding: 24px 16px;
    color: var(--text-light);
    font-size: 12px;
}

/* ========== 弹窗 ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

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

.modal-content {
    background: var(--card-bg);
    border-radius: var(--radius);
    width: 85%;
    max-width: 360px;
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 16px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-light);
}

.modal-body {
    padding: 20px;
}

.modal-body p {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
}

.share-actions {
    margin-top: 16px;
    text-align: center;
}

.share-btn {
    padding: 10px 32px;
    border: none;
    border-radius: 20px;
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

.share-btn:active {
    background: var(--primary-light);
}

/* ========== Toast ========== */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0,0,0,0.75);
    color: #fff;
    padding: 10px 24px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ========== 响应式 ========== */
@media (min-width: 768px) {
    body {
        max-width: 500px;
    }

    .icon-nav-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}
