/* ============================================================
   西科大教务助手 · 设计系统
   设计语言：浅色中性底 + 靛蓝渐变主色 + 玻璃拟态
   字体：Sora（展示/数字）+ Manrope（正文拉丁）+ Noto Sans SC（中文）
   ============================================================ */

/* ---------- 设计令牌 ---------- */
:root {
    /* 色彩：70% 中性底 / 20% 靛蓝主色 / 10% 点缀 */
    --bg: #f3f4f9;
    --surface: #ffffff;
    --surface-soft: #f7f8fc;
    --ink: #161a2e;
    --ink-2: #3d4361;
    --muted: #6b7194;
    --line: #e4e7f2;

    --primary: #4f46e5;
    --primary-2: #7c3aed;
    --primary-ink: #4338ca;
    --primary-soft: #eef0ff;

    --teal: #0d9488;
    --teal-soft: #e5f6f3;
    --amber: #b45309;
    --amber-soft: #fdf3e3;
    --red: #dc2626;
    --red-soft: #fdecec;
    --slate-soft: #eef0f6;

    /* 字体 */
    --font-display: "Sora", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    --font-body: "Manrope", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;

    /* 圆角 */
    --r-lg: 20px;
    --r-md: 14px;
    --r-sm: 10px;

    /* 阴影：双层柔和投影 */
    --shadow-1: 0 1px 2px rgb(22 26 46 / .04), 0 10px 28px -14px rgb(22 26 46 / .14);
    --shadow-2: 0 2px 6px rgb(22 26 46 / .05), 0 22px 48px -18px rgb(79 70 229 / .28);

    /* 动效 */
    --ease-out: cubic-bezier(.22, .61, .36, 1);
    --t-fast: .16s;
    --t-med: .32s;
}

/* ---------- 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100dvh;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    color: var(--ink);
    background-color: var(--bg);
    /* 氛围光：左上靛蓝光晕 + 右下青绿光晕，避免平铺纯色 */
    background-image:
        radial-gradient(900px 520px at 12% -8%, rgb(99 102 241 / .12), transparent 60%),
        radial-gradient(820px 520px at 108% 8%, rgb(13 148 136 / .08), transparent 55%),
        radial-gradient(720px 600px at 50% 118%, rgb(124 58 237 / .07), transparent 60%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

/* 细腻噪点，增加纵深 */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: .028;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    line-height: 1.25;
    margin: 0 0 .5em;
    letter-spacing: -.01em;
}

p { margin: 0 0 1em; }

a {
    color: var(--primary-ink);
    text-decoration: none;
    transition: color var(--t-fast) var(--ease-out);
}
a:hover { color: var(--primary); }

/* 可见焦点态：无障碍底线 */
:focus-visible {
    outline: 3px solid rgb(79 70 229 / .45);
    outline-offset: 2px;
    border-radius: var(--r-sm);
}

::selection { background: rgb(79 70 229 / .18); }

.container {
    width: 100%;
    max-width: 1120px;
    margin-inline: auto;
    padding-inline: clamp(18px, 4vw, 40px);
}

/* ---------- 导航栏：玻璃拟态 ---------- */
.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid rgb(228 231 242 / .8);
    background: rgb(243 244 249 / .72);
    backdrop-filter: blur(14px) saturate(1.4);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 66px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    min-height: 44px;
}

.brand-logo {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    box-shadow: 0 6px 16px -6px rgb(79 70 229 / .55);
    transition: transform var(--t-med) var(--ease-out);
}
.brand:hover .brand-logo { transform: rotate(-6deg) scale(1.06); }

.brand-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 17px;
    letter-spacing: .01em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 16px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 14.5px;
    color: var(--ink-2);
    transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.nav-links a:hover { background: rgb(79 70 229 / .08); color: var(--primary-ink); }
.nav-links a.active {
    background: var(--primary-soft);
    color: var(--primary-ink);
}
.nav-links a.nav-logout { color: var(--muted); }
.nav-links a.nav-logout:hover { background: var(--red-soft); color: var(--red); }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 12px 24px;
    border: 0;
    border-radius: var(--r-md);
    font-family: var(--font-body);
    font-size: 15.5px;
    font-weight: 700;
    cursor: pointer;
    transition:
        transform var(--t-fast) var(--ease-out),
        box-shadow var(--t-fast) var(--ease-out),
        background var(--t-fast) var(--ease-out),
        filter var(--t-fast) var(--ease-out);
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    box-shadow: 0 10px 24px -10px rgb(79 70 229 / .55);
}
.btn-primary:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
    box-shadow: 0 16px 32px -12px rgb(79 70 229 / .6);
}
.btn-primary:active { transform: translateY(0) scale(.97); }

.btn-ghost {
    color: var(--ink-2);
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-1);
}
.btn-ghost:hover {
    transform: translateY(-2px);
    color: var(--primary-ink);
    border-color: rgb(79 70 229 / .4);
}
.btn-ghost:active { transform: translateY(0) scale(.97); }

.btn-block { width: 100%; }

.btn .arrow { transition: transform var(--t-fast) var(--ease-out); }
.btn:hover .arrow { transform: translateX(4px); }

/* ---------- 卡片 ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-1);
}

.card-pad { padding: clamp(20px, 3.5vw, 32px); }

.card-hover {
    transition: transform var(--t-med) var(--ease-out), box-shadow var(--t-med) var(--ease-out);
}
.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-2);
}

/* ---------- 徽章 / 成绩 pill ---------- */
.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    padding: 4px 12px;
    border-radius: 999px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    line-height: 1.5;
}
.pill-great { color: #065f46; background: #dff5ec; }
.pill-good  { color: var(--primary-ink); background: var(--primary-soft); }
.pill-mid   { color: #1d4ed8; background: #e3edfd; }
.pill-pass  { color: var(--amber); background: var(--amber-soft); }
.pill-fail  { color: var(--red); background: var(--red-soft); }
.pill-na    { color: var(--muted); background: var(--slate-soft); }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 999px;
    font-size: 13.5px;
    font-weight: 600;
}
.badge-amber { color: var(--amber); background: var(--amber-soft); }
.badge-teal  { color: var(--teal); background: var(--teal-soft); }
.badge-soft  { color: var(--muted); background: var(--slate-soft); }

/* ---------- 表单 ---------- */
.field { margin-bottom: 20px; }

.field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14.5px;
    color: var(--ink-2);
}

.input-wrap { position: relative; }

.input-wrap .icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
    display: inline-flex;
}

.input-wrap input {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px 12px 44px;
    border: 1.5px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface-soft);
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--ink);
    transition: border-color var(--t-fast) var(--ease-out),
                box-shadow var(--t-fast) var(--ease-out),
                background var(--t-fast) var(--ease-out);
}
.input-wrap input::placeholder { color: #9aa0bd; }
.input-wrap input:hover { border-color: #c9cede; }
.input-wrap input:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgb(79 70 229 / .14);
}

.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 12px 16px;
    border-radius: var(--r-md);
    border: 1px solid rgb(220 38 38 / .25);
    background: var(--red-soft);
    color: var(--red);
    font-weight: 600;
    font-size: 14.5px;
    animation: shake .4s var(--ease-out);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ---------- 登录页 ---------- */
.page-login .container { padding-inline: 18px; }

.auth-wrap {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 100dvh;
    padding: 40px 0;
    overflow: hidden;
}

/* 极光光斑：登录页的记忆点 */
.aurora { position: absolute; inset: 0; z-index: -1; }
.aurora span {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .5;
    animation: drift 16s ease-in-out infinite alternate;
}
.aurora span:nth-child(1) {
    width: 46vw; height: 46vw; min-width: 340px; min-height: 340px;
    left: -8%; top: -12%;
    background: radial-gradient(circle at 30% 30%, #818cf8, transparent 65%);
}
.aurora span:nth-child(2) {
    width: 40vw; height: 40vw; min-width: 300px; min-height: 300px;
    right: -6%; bottom: -14%;
    background: radial-gradient(circle at 60% 60%, #5eead4, transparent 65%);
    animation-delay: -6s;
}
.aurora span:nth-child(3) {
    width: 30vw; height: 30vw; min-width: 240px; min-height: 240px;
    right: 14%; top: 6%;
    background: radial-gradient(circle at 50% 50%, #c4b5fd, transparent 65%);
    animation-delay: -11s;
}

@keyframes drift {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(4%, 6%) scale(1.12); }
}

.auth-card {
    width: min(420px, 100%);
    padding: clamp(28px, 5vw, 40px);
    border-radius: 24px;
    background: rgb(255 255 255 / .82);
    border: 1px solid rgb(255 255 255 / .9);
    box-shadow: 0 24px 64px -24px rgb(22 26 46 / .28);
    backdrop-filter: blur(18px) saturate(1.5);
    -webkit-backdrop-filter: blur(18px) saturate(1.5);
}

.auth-logo {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin-bottom: 20px;
    border-radius: 16px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    box-shadow: 0 12px 24px -8px rgb(79 70 229 / .5);
}

.auth-title { font-size: clamp(24px, 3vw, 28px); margin-bottom: 6px; }
.auth-sub { color: var(--muted); font-size: 15px; margin-bottom: 26px; }

.auth-foot {
    margin: 22px 0 0;
    text-align: center;
    font-size: 13.5px;
    color: var(--muted);
}

/* ---------- 首页 Hero ---------- */
.hero {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    align-items: center;
    gap: clamp(28px, 5vw, 64px);
    padding: clamp(40px, 7vh, 80px) 0 clamp(32px, 5vh, 56px);
}

.hero-overline { margin-bottom: 18px; }

.hero-title {
    font-size: clamp(34px, 5.2vw, 56px);
    font-weight: 800;
    letter-spacing: -.02em;
    margin-bottom: 18px;
}

.hero-title .grad {
    background: linear-gradient(120deg, var(--primary), var(--primary-2) 60%, #0d9488);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-sub {
    max-width: 46ch;
    font-size: clamp(16px, 1.6vw, 18px);
    color: var(--muted);
    margin-bottom: 30px;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* Hero 右侧预览卡：玻璃拟态 + 漂浮 */
.hero-visual { display: grid; place-items: center; }

.preview-card {
    width: min(360px, 100%);
    padding: 24px;
    border-radius: 22px;
    background: rgb(255 255 255 / .78);
    border: 1px solid rgb(255 255 255 / .95);
    box-shadow: 0 28px 60px -24px rgb(22 26 46 / .3);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.preview-title { font-family: var(--font-display); font-weight: 700; font-size: 15px; }

.preview-row { margin-bottom: 14px; }
.preview-row:last-child { margin-bottom: 0; }
.preview-row .meta {
    display: flex;
    justify-content: space-between;
    font-size: 13.5px;
    color: var(--muted);
    margin-bottom: 6px;
}
.bar {
    height: 8px;
    border-radius: 999px;
    background: var(--slate-soft);
    overflow: hidden;
}
.bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), var(--primary-2));
    transform-origin: left;
    animation: grow 1.1s var(--ease-out) both;
}
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- 功能区 ---------- */
.section { padding: clamp(24px, 4vh, 44px) 0; }

.section-title { font-size: clamp(22px, 2.6vw, 28px); margin-bottom: 6px; }
.section-sub { color: var(--muted); margin-bottom: 26px; }

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.feature {
    padding: 26px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feature-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    color: var(--primary-ink);
    background: var(--primary-soft);
    transition: transform var(--t-med) var(--ease-out);
}
.feature:hover .feature-icon { transform: scale(1.08) rotate(-4deg); }
.feature:nth-child(2) .feature-icon { color: var(--teal); background: var(--teal-soft); }
.feature:nth-child(3) .feature-icon { color: var(--amber); background: var(--amber-soft); }

.feature h3 { font-size: 18px; margin: 0; }
.feature p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* ---------- 成绩页 ---------- */
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    padding: clamp(30px, 5vh, 52px) 0 8px;
}

.page-title { font-size: clamp(28px, 3.4vw, 38px); font-weight: 800; margin-bottom: 4px; }
.page-sub { color: var(--muted); margin: 0; font-size: 15px; }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    font-weight: 600;
    font-size: 14.5px;
    color: var(--muted);
}
.back-link:hover { color: var(--primary-ink); }

/* 统计卡 */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin: 22px 0 34px;
}

.stat {
    padding: 20px 22px;
    position: relative;
    overflow: hidden;
}
.stat::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, var(--primary), var(--primary-2));
    border-radius: 4px 0 0 4px;
    opacity: .85;
}
.stat:nth-child(2)::before { background: linear-gradient(180deg, #0d9488, #2dd4bf); }
.stat:nth-child(3)::before { background: linear-gradient(180deg, #2563eb, #60a5fa); }
.stat:nth-child(4)::before { background: linear-gradient(180deg, #d97706, #fbbf24); }

.stat-label {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 6px;
}
.stat-value {
    font-family: var(--font-display);
    font-size: clamp(26px, 3vw, 34px);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.01em;
    line-height: 1.15;
}
.stat-hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* 新成绩横幅 */
.notice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
    border-radius: var(--r-md);
    font-weight: 600;
}
.notice-amber {
    color: var(--amber);
    background: linear-gradient(120deg, #fdf3e3, #fdebd0);
    border: 1px solid rgb(180 83 9 / .2);
}
.notice-teal {
    color: var(--teal);
    background: linear-gradient(120deg, #e5f6f3, #d9f0ec);
    border: 1px solid rgb(13 148 136 / .2);
}

/* 表格（桌面端） */
.table-card { overflow: hidden; }

.table-wrap {
    overflow-x: auto;
    border-radius: var(--r-lg);
}

table.score-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14.5px;
    min-width: 860px;
}

.score-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 14px 14px;
    text-align: left;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .03em;
    color: var(--muted);
    background: var(--surface-soft);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.score-table tbody td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--line);
    color: var(--ink-2);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.score-table tbody tr { transition: background var(--t-fast) var(--ease-out); }
.score-table tbody tr:hover { background: rgb(79 70 229 / .045); }
.score-table tbody tr:last-child td { border-bottom: 0; }

.score-table td.course-name {
    color: var(--ink);
    font-weight: 600;
    white-space: normal;
    min-width: 180px;
}

tr.row-new td { background: rgb(253 243 227 / .55); }
tr.row-new:hover td { background: rgb(253 243 227 / .85); }

.tag-new {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--amber);
    background: var(--amber-soft);
    vertical-align: 2px;
}

/* 课程卡片列表（移动端替代表格） */
.course-cards { display: none; }

.course-card { padding: 18px 20px; margin-bottom: 12px; }

.course-card .cc-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.course-card .cc-title { font-weight: 700; font-size: 16px; }
.course-card .cc-type { font-size: 13px; color: var(--muted); margin-top: 2px; }

.cc-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px 14px;
}
.cc-item .k { font-size: 12px; color: var(--muted); }
.cc-item .v { font-weight: 600; font-size: 14.5px; font-variant-numeric: tabular-nums; }

.cc-gpa { margin-top: 14px; }
.cc-gpa .meta {
    display: flex;
    justify-content: space-between;
    font-size: 12.5px;
    color: var(--muted);
    margin-bottom: 6px;
}

/* ---------- 页脚 ---------- */
.footer {
    padding: 36px 0 44px;
    text-align: center;
    color: var(--muted);
    font-size: 13.5px;
}

/* ---------- Toast ---------- */
.toast-root {
    position: fixed;
    left: 50%;
    bottom: 32px;
    transform: translateX(-50%);
    z-index: 100;
    display: grid;
    gap: 10px;
    justify-items: center;
    pointer-events: none;
}
.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 999px;
    background: rgb(22 26 46 / .92);
    color: #fff;
    font-size: 14.5px;
    font-weight: 600;
    box-shadow: 0 16px 40px -12px rgb(22 26 46 / .5);
    animation: toast-in .28s var(--ease-out);
}
.toast.hide { animation: toast-out .3s var(--ease-out) forwards; }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(14px) scale(.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-out {
    to { opacity: 0; transform: translateY(10px) scale(.96); }
}

/* ---------- 入场动画（交错上升） ---------- */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    animation: rise .65s var(--ease-out) forwards;
    animation-delay: var(--d, 0s);
}
@keyframes rise {
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
    .feature-grid { grid-template-columns: 1fr 1fr; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
    .hero { grid-template-columns: 1fr; }
    .hero-visual { order: -1; }
    .preview-card { animation: none; }

    /* 表格 → 卡片视图 */
    .table-wrap { display: none; }
    .course-cards { display: block; }
}

@media (max-width: 640px) {
    .feature-grid { grid-template-columns: 1fr; }
    .brand-name { display: none; }
    .hero-cta .btn { width: 100%; }
    .cc-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 420px) {
    .stat-grid { grid-template-columns: 1fr; }
}

/* ---------- 尊重减少动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    .reveal { opacity: 1; transform: none; }
    .aurora span, .preview-card { animation: none; }
}

/* ============================================================
   课表 / 进度模块扩展样式
   ============================================================ */

/* ---------- 首页预览卡：真实课程行 ---------- */
.pc-name { font-weight: 700; color: var(--ink); font-size: 14.5px; }
.pc-xf {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13px;
    color: var(--primary-ink);
    background: var(--primary-soft);
    padding: 2px 10px;
    border-radius: 999px;
    white-space: nowrap;
}
.pc-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.preview-row { padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px dashed var(--line); }
.preview-row:last-child { padding-bottom: 0; margin-bottom: 0; border-bottom: 0; }
.preview-empty { text-align: center; color: var(--muted); font-size: 14.5px; }
.preview-empty .btn { margin-top: 14px; }

/* ---------- 首页今日课程条 ---------- */
.today-strip {
    display: flex;
    align-items: center;
    gap: clamp(16px, 3vw, 32px);
    flex-wrap: wrap;
}
.ts-side { text-align: center; min-width: 72px; }
.ts-count {
    font-family: var(--font-display);
    font-size: clamp(30px, 4vw, 40px);
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(120deg, var(--primary), var(--primary-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.ts-label { font-size: 13px; color: var(--muted); margin-top: 4px; font-weight: 600; }
.ts-list { flex: 1; min-width: 220px; display: grid; gap: 8px; }
.ts-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14.5px;
    flex-wrap: wrap;
}
.ts-jc {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 12.5px;
    color: var(--primary-ink);
    background: var(--primary-soft);
    padding: 3px 10px;
    border-radius: 8px;
    white-space: nowrap;
}
.ts-name { font-weight: 600; color: var(--ink); }
.ts-loc { color: var(--muted); font-size: 13.5px; }
.ts-more { font-size: 13px; color: var(--muted); }
.ts-link { flex-shrink: 0; }

/* ---------- 链接卡片 ---------- */
.link-card { color: inherit; }
.link-card:hover { color: inherit; }
.link-more {
    margin-top: auto;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--primary-ink);
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
.link-card:hover .link-more { opacity: 1; transform: translateX(0); }

/* ---------- 今日课程：时间线卡 ---------- */
.slot-list { display: grid; gap: 14px; }

.slot-card {
    display: flex;
    gap: 18px;
    padding: 20px 22px;
    align-items: flex-start;
}

.slot-jc {
    display: grid;
    justify-items: center;
    gap: 6px;
    min-width: 74px;
    padding: 12px 10px;
    border-radius: var(--r-md);
    background: linear-gradient(160deg, var(--primary-soft), #f3eefe);
    text-align: center;
    flex-shrink: 0;
}
.slot-jc-num {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 16px;
    color: var(--primary-ink);
}
.slot-jc-week { font-size: 11.5px; color: var(--muted); line-height: 1.3; }

.slot-main h3 { font-size: 17px; margin: 0 0 4px; }
.slot-teacher { margin: 0 0 10px; font-size: 14px; color: var(--muted); }

.slot-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-2);
    background: var(--slate-soft);
}
.chip-soft { color: var(--muted); background: transparent; border: 1px dashed var(--line); }

/* ---------- 本周课表网格 ---------- */
.week-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(150px, 1fr));
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 6px;
}

.day-col {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 12px;
    min-height: 120px;
    transition: box-shadow var(--t-med) var(--ease-out), border-color var(--t-med) var(--ease-out);
}

.day-today {
    border-color: rgb(79 70 229 / .45);
    box-shadow: 0 0 0 3px rgb(79 70 229 / .1), var(--shadow-1);
}

.day-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.mini-course {
    padding: 9px 10px;
    margin-bottom: 8px;
    border-radius: var(--r-sm);
    background: var(--surface-soft);
    border-left: 3px solid var(--primary);
    cursor: pointer;
    transition: transform var(--t-fast) var(--ease-out),
                background var(--t-fast) var(--ease-out),
                box-shadow var(--t-fast) var(--ease-out),
                border-color var(--t-fast) var(--ease-out);
}
.mini-course:hover {
    transform: translateY(-2px);
    background: var(--primary-soft);
    border-left-color: var(--primary-2);
    box-shadow: 0 8px 18px -8px rgb(79 70 229 / .45);
}
.mini-course:active { transform: translateY(0) scale(.98); }
.mini-course:last-child { margin-bottom: 0; }

/* 今日课程卡片可点击 */
.slot-clickable { cursor: pointer; }

.mc-name { font-size: 13px; font-weight: 700; color: var(--ink); line-height: 1.4; }
.mc-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.day-empty {
    padding: 18px 0;
    text-align: center;
    font-size: 12.5px;
    color: #b6bad0;
}

/* ---------- 进度追踪 ---------- */
.progress-card { margin-bottom: 8px; }
.progress-meta {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 14.5px;
    color: var(--muted);
    margin-bottom: 12px;
}
.progress-meta b {
    font-family: var(--font-display);
    color: var(--primary-ink);
}
.progress-track { height: 14px; }

/* ---------- 课程详情弹窗 ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgb(22 26 46 / .45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--t-med) var(--ease-out);
}
.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.course-modal {
    width: min(440px, 100%);
    max-height: 85dvh;
    overflow-y: auto;
    background: var(--surface);
    border-radius: var(--r-lg);
    box-shadow: 0 28px 64px -20px rgb(22 26 46 / .45);
    transform: translateY(18px) scale(.96);
    opacity: 0;
    transition: transform var(--t-med) var(--ease-out),
                opacity var(--t-fast) var(--ease-out);
}
.modal-overlay.show .course-modal {
    transform: none;
    opacity: 1;
}

.cm-head {
    position: sticky;
    top: 0;
    padding: 20px 24px 14px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.cm-title {
    margin: 0;
    padding-right: 42px;
    font-size: 19px;
    line-height: 1.4;
}
.cm-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}
.cm-tags:empty { margin-top: 0; }

.cm-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: var(--slate-soft);
    color: var(--muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background var(--t-fast) var(--ease-out),
                color var(--t-fast) var(--ease-out),
                transform var(--t-fast) var(--ease-out);
}
.cm-close:hover {
    background: var(--red-soft);
    color: var(--red);
    transform: rotate(90deg);
}

.cm-body { padding: 12px 24px 22px; }
.cm-row {
    display: flex;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    font-size: 14.5px;
}
.cm-row:last-child { border-bottom: 0; }
.cm-label {
    flex: 0 0 74px;
    color: var(--muted);
    font-size: 13.5px;
    padding-top: 1px;
}
.cm-value {
    flex: 1;
    font-weight: 600;
    color: var(--ink);
    word-break: break-word;
    line-height: 1.55;
}
.cm-value.na { color: #a3a9c4; font-weight: 500; }
.cm-chip {
    display: inline-block;
    padding: 2px 10px;
    margin: 2px 6px 2px 0;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--primary-ink);
    background: var(--primary-soft);
}

@media (max-width: 640px) {
    .modal-overlay { padding: 14px; align-items: flex-end; }
    .course-modal {
        width: 100%;
        max-height: 80dvh;
        border-radius: var(--r-lg) var(--r-lg) var(--r-md) var(--r-md);
    }
}

/* ---------- 响应式补充 ---------- */
@media (max-width: 1000px) {
    .week-grid { grid-template-columns: repeat(7, minmax(132px, 1fr)); }
}

@media (max-width: 860px) {
    .week-grid { grid-template-columns: 1fr; overflow-x: visible; }
    .day-col { min-height: 0; }
    .day-empty { padding: 8px 0; }
}

@media (max-width: 640px) {
    .slot-card { flex-direction: column; gap: 12px; }
    .slot-jc { min-width: 0; width: 100%; grid-auto-flow: column; justify-content: center; }
    .today-strip { flex-direction: column; align-items: stretch; text-align: center; }
    .ts-list { text-align: left; }
    .ts-link { align-self: center; }
    .nav-links a { padding: 8px 10px; font-size: 13.5px; }
}
