/* ========== 基础重置 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #f5f5f7;
    color: #333;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }

/* ========== 颜色变量 ========== */
:root {
    --primary: #c41e2a;
    --primary-dark: #a01822;
    --primary-light: #fde8ea;
    --secondary: #b8860b;
    --text: #333;
    --text-light: #666;
    --text-lighter: #999;
    --bg: #f5f5f7;
    --card: #fff;
    --border: #eee;
    --shadow: 0 2px 12px rgba(0,0,0,0.06);
    --radius: 12px;
}

/* ========== 导航栏 ========== */
.navbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}
.logo img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-light);
}
.logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.5px;
}
.logo-sub {
    color: var(--secondary);
    font-weight: 600;
}
.nav-menu {
    display: flex;
    gap: 4px;
    align-items: center;
}
.nav-menu a {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 15px;
    color: var(--text-light);
    transition: all 0.2s;
    white-space: nowrap;
}
.nav-menu a:hover {
    color: var(--primary);
    background: var(--primary-light);
}
.nav-menu a.active {
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 600;
}
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 5px;
}
.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: 0.3s;
}

/* ========== 主内容区 ========== */
.main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px;
}

/* ========== 小实说 ========== */
.xiaoshi-say {
    display: flex;
    align-items: stretch;
    gap: 16px;
    margin-bottom: 24px;
}
.xiaoshi-avatar {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--primary);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}
.xiaoshi-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.xiaoshi-bubble {
    flex: 1;
    background: linear-gradient(135deg, #fff 0%, #fef6f7 100%);
    border-radius: var(--radius);
    padding: 16px 20px;
    position: relative;
    box-shadow: var(--shadow);
    border: 1px solid var(--primary-light);
}
.xiaoshi-bubble::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 28px;
    border: 8px solid transparent;
    border-right-color: var(--primary-light);
}
.bubble-title {
    font-size: 14px;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.bubble-title::before { content: '💬'; font-size: 14px; }
.bubble-text {
    font-size: 15px;
    color: var(--text);
    line-height: 1.7;
}
.bubble-text strong {
    color: var(--primary);
    font-size: 18px;
    margin: 0 2px;
}

/* ========== 搜索区（双栏：左精准 + 右AI） ========== */
.search-section {
    margin-bottom: 28px;
}
.search-dual {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
    align-items: stretch;
}
.search-left {
    background: #fff;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}
.search-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}
.label-icon { font-size: 18px; }
.label-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}
.label-desc {
    font-size: 12px;
    color: var(--text-lighter);
    margin-left: 4px;
}
.search-box {
    display: flex;
    background: #fafafa;
    border-radius: 50px;
    overflow: hidden;
    border: 2px solid var(--primary-light);
    transition: border-color 0.2s;
}
.search-box:focus-within {
    border-color: var(--primary);
    background: #fff;
}
.search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 14px 22px;
    font-size: 15px;
    background: transparent;
}
.search-input::placeholder { color: var(--text-lighter); }
.search-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0 24px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
    font-weight: 500;
}
.search-btn:hover { background: var(--primary-dark); }
.search-tags {
    margin-top: 12px;
    padding: 0 4px;
    font-size: 13px;
    color: var(--text-lighter);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.search-tags span { flex-shrink: 0; }
.hot-tag {
    padding: 3px 12px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 12px;
    font-size: 12px;
    transition: all 0.2s;
}
.hot-tag:hover {
    background: var(--primary);
    color: #fff;
}

/* 右侧 AI 搜索卡片 */
.search-right { display: flex; }
.ai-search-card {
    flex: 1;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #2563eb 100%);
    border-radius: var(--radius);
    padding: 20px;
    color: #fff;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}
.ai-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.ai-icon { font-size: 20px; }
.ai-title {
    font-size: 16px;
    font-weight: 600;
}
.ai-desc {
    font-size: 12px;
    opacity: 0.85;
    margin-bottom: 14px;
    line-height: 1.5;
}
.ai-input-wrap {
    display: flex;
    background: rgba(255,255,255,0.2);
    border-radius: 50px;
    padding: 4px;
    margin-bottom: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
}
.ai-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 8px 14px;
    font-size: 13px;
    color: #fff;
}
.ai-input::placeholder { color: rgba(255,255,255,0.6); }
.ai-btn {
    background: #fff;
    color: var(--primary);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s;
}
.ai-btn:hover { transform: scale(1.1); }
/* AI搜索入口大按钮 */
.ai-entry-card {
    cursor: pointer;
    transition: all 0.3s;
}
.ai-entry-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.3);
}
.ai-entry-btn {
    margin-top: auto;
    background: #fff;
    color: #4f46e5;
    border-radius: 50px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}
.ai-entry-card:hover .ai-entry-btn {
    background: #eef2ff;
}

.ai-suggest {
    margin-top: auto;
}
.suggest-title {
    font-size: 11px;
    opacity: 0.7;
    display: block;
    margin-bottom: 6px;
}
.suggest-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.suggest-tag {
    font-size: 12px;
    padding: 5px 10px;
    background: rgba(255,255,255,0.15);
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.2s;
    display: inline-block;
}
.suggest-tag:hover {
    background: rgba(255,255,255,0.3);
}

/* ========== 卡片区域通用 ========== */
.card-section {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.section-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-header .icon { font-size: 20px; }
.more-link {
    font-size: 14px;
    color: var(--primary);
    transition: opacity 0.2s;
}
.more-link:hover { opacity: 0.7; }

/* ========== 今日课表 ========== */
.today-schedule {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.schedule-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background: #fafafa;
    border-radius: 10px;
    border-left: 4px solid var(--primary);
    transition: transform 0.2s;
}
.schedule-item:hover {
    transform: translateX(4px);
    background: var(--primary-light);
}
.schedule-item .time {
    flex-shrink: 0;
    width: 110px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}
.course-info { flex: 1; min-width: 0; }
.course-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.course-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.meta-tag {
    font-size: 12px;
    color: var(--text-light);
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 4px;
}
.status {
    flex-shrink: 0;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    background: #f0f0f0;
    color: var(--text-light);
}
.status.ongoing {
    background: #e6f7ea;
    color: #1a8a3d;
    animation: pulse 2s infinite;
}
.status.upcoming {
    background: #fff4e5;
    color: #d48806;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ========== 进行中班次 ========== */
.ongoing-classes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.class-card {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.class-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}
.class-banner {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.banner-red { background: linear-gradient(135deg, #c41e2a, #e74c3c); }
.banner-blue { background: linear-gradient(135deg, #2c5aa0, #3498db); }
.banner-green { background: linear-gradient(135deg, #1a8a3d, #27ae60); }
.class-day {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    background: rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 20px;
}
.class-body {
    padding: 14px;
}
.class-body h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.class-date {
    font-size: 13px;
    color: var(--text-lighter);
    margin-bottom: 8px;
}
.class-tags { display: flex; gap: 6px; }
.class-tags .tag {
    font-size: 11px;
    padding: 2px 8px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 4px;
}

/* ========== 快捷入口 ========== */
.quick-entry {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}
.entry-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 12px;
    border-radius: 10px;
    background: #fafafa;
    transition: all 0.2s;
    text-align: center;
}
.entry-item:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
}
.entry-icon {
    font-size: 32px;
    margin-bottom: 10px;
}
.entry-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}
.entry-desc {
    font-size: 12px;
    color: var(--text-lighter);
}

/* ========== 数据概览 ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.stat-card {
    text-align: center;
    padding: 20px 12px;
    background: linear-gradient(135deg, #fef6f7, #fff);
    border-radius: 10px;
    border: 1px solid var(--primary-light);
}
.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
    font-variant-numeric: tabular-nums;
}
.stat-label {
    font-size: 13px;
    color: var(--text-light);
}

/* ========== 底部 ========== */
.footer {
    text-align: center;
    padding: 24px 20px;
    color: var(--text-lighter);
    font-size: 13px;
    margin-top: 20px;
}

/* ========== 通用分页 ========== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.page-btn:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}
.page-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.page-ellipsis {
    color: var(--text-lighter);
    padding: 0 4px;
}

/* ========== 响应式 ========== */
@media (max-width: 900px) {
    .search-dual {
        grid-template-columns: 1fr;
    }
    .nav-menu {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        padding: 12px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        gap: 4px;
    }
    .nav-menu.open { display: flex; }
    .nav-menu a { padding: 12px 16px; }
    .nav-toggle { display: flex; }

    .xiaoshi-say { gap: 12px; }
    .xiaoshi-avatar { width: 60px; height: 60px; }

    .ongoing-classes { grid-template-columns: 1fr; }
    .quick-entry { grid-template-columns: repeat(3, 1fr); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }

    .search-btn { padding: 0 16px; }
    .search-btn span { display: none; }
}

@media (max-width: 480px) {
    .logo-text { font-size: 15px; }
    .logo-sub { display: none; }
    .bubble-text { font-size: 14px; }
    .schedule-item { flex-wrap: wrap; }
    .schedule-item .time { width: auto; }
}


/* ========== 两列布局 ========== */
.two-col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}
.two-col-grid .card-section { margin-bottom: 0; }

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-lighter);
    font-size: 14px;
}

/* ========== 橙色班次标签 ========== */
.banner-orange { background: linear-gradient(135deg, #d48806, #faad14); }

/* 小实说 - 数字高亮 */
.bubble-text .num-highlight {
    display: inline-block;
    font-style: normal;
    font-weight: 700;
    color: var(--primary, #c62828);
    font-size: 18px;
    margin: 0 2px;
    padding: 0 4px;
    position: relative;
}

/* ========== 骨架屏 ========== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 6px;
}
@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-text { height: 14px; margin-bottom: 10px; }
.skeleton-text.short { width: 60%; }
.skeleton-title { height: 18px; margin-bottom: 12px; width: 40%; }
.skeleton-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    min-height: 120px;
}

/* ========== 空状态美化 ========== */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-lighter);
    font-size: 14px;
    background: #fff;
    border-radius: 10px;
}
.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.4;
}
.empty-state .empty-title {
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 6px;
}
.empty-state .empty-desc {
    font-size: 13px;
    color: #bbb;
}
