/* =============================================================
   学生端样式：登录、座位图、交换、通知、个人中心
   ============================================================= */

/* -------------------------------------------------------------
   登录页
   ---------------------------------------------------------- */
.auth-body {
    background: var(--bg);
    min-height: 100vh;
}

.auth-shell {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    min-height: 100vh;
}

.auth-visual {
    position: relative;
    overflow: hidden;
    background: radial-gradient(120% 100% at 10% 0%, #26345c 0%, #151c2f 46%, #0d1220 100%);
    color: #fff;
    display: flex;
    align-items: center;
    padding: 64px 56px;
}
.auth-visual::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(80% 70% at 30% 30%, #000 30%, transparent 100%);
}
.auth-visual::after {
    content: "";
    position: absolute;
    width: 420px;
    height: 420px;
    right: -140px;
    bottom: -160px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(78, 106, 255, .55), transparent 65%);
    filter: blur(6px);
}
.auth-visual-inner { position: relative; z-index: 1; max-width: 460px; }

.eyebrow {
    display: inline-block;
    font-size: 11px;
    letter-spacing: .28em;
    color: rgba(255, 255, 255, .55);
    margin-bottom: 22px;
}
.auth-visual h1 {
    font-size: clamp(30px, 3.4vw, 44px);
    line-height: 1.28;
    font-weight: 700;
    letter-spacing: -.02em;
}
.auth-visual h1 span { color: #9db0ff; }
.auth-lead {
    margin-top: 20px;
    font-size: 14.5px;
    line-height: 1.9;
    color: rgba(255, 255, 255, .66);
}

.auth-mini-map {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin: 34px 0 30px;
    max-width: 300px;
}
.mini-seat {
    height: 26px;
    border-radius: 6px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .12);
    animation: seatPulse 4.4s ease-in-out infinite;
    animation-delay: var(--d, 0ms);
}
.mini-seat.is-filled {
    background: linear-gradient(135deg, #4d68ff, #3448d6);
    border-color: transparent;
    box-shadow: 0 6px 16px -8px rgba(77, 104, 255, .9);
}
@keyframes seatPulse {
    0%, 100% { opacity: .55; }
    50% { opacity: 1; }
}

.auth-points { display: flex; flex-direction: column; gap: 12px; font-size: 13.5px; color: rgba(255, 255, 255, .72); }
.auth-points li { display: flex; align-items: center; gap: 10px; }
.auth-points .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: #6c85ff;
    box-shadow: 0 0 0 4px rgba(108, 133, 255, .18);
}

.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 32px;
    background: var(--bg);
}
.auth-card {
    position: relative;
    width: min(100%, 420px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 30px 28px 22px;
    box-shadow: var(--shadow);
    animation: cardIn .5s cubic-bezier(.2, .8, .3, 1) both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.auth-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, #4c66ff, #3348d8);
    color: #fff;
    flex: 0 0 auto;
}
.brand-mark-lg { width: 44px; height: 44px; border-radius: 13px; }
.auth-card-head h2 { font-size: 17px; letter-spacing: -.01em; }
.auth-card-head p { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

.auth-form { margin-top: 4px; }
.auth-block { animation: blockIn .28s ease both; }
@keyframes blockIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.status-hint {
    font-size: 12.5px;
    padding: 9px 12px;
    border-radius: 9px;
    background: var(--bg-soft);
    color: var(--text-soft);
    margin-bottom: 14px;
    animation: blockIn .24s ease both;
}
.status-hint.is-warn { background: var(--warn-soft); color: #8a5c00; }

.register-note {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 12.5px;
    line-height: 1.7;
    background: var(--primary-soft);
    color: #2c3fa8;
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 16px;
}
.register-note .icon { margin-top: 2px; }

.auth-error {
    margin-top: 12px;
    font-size: 13px;
    color: var(--danger);
    background: var(--danger-soft);
    border-radius: 9px;
    padding: 9px 12px;
    animation: shake .3s ease;
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.auth-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
}
.auth-card-foot a { font-weight: 600; }

/* 管理入口：极低对比度的角落小点，不干扰主视觉 */
.admin-dot {
    position: absolute;
    top: 14px;
    right: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    color: var(--text-muted);
    opacity: .16;
    transition: opacity .2s ease;
}
.admin-dot:hover, .admin-dot:focus-visible { opacity: .55; }

/* 线下录入入口：右下角低对比度文字 */
.offline-entry {
    position: fixed;
    right: 18px;
    bottom: 16px;
    z-index: 40;
    font-size: 12px;
    color: var(--text-muted);
    opacity: .42;
    padding: 4px 6px;
    transition: opacity .2s ease;
}
.offline-entry:hover, .offline-entry:focus-visible { opacity: .9; }

/* 线下录入页 */
.offline-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}
.offline-head h1 { font-size: 20px; letter-spacing: -.01em; }
.offline-head p { font-size: 13px; margin-top: 4px; }
.offline-auth {
    width: min(100%, 420px);
    margin: 48px auto;
    padding: 26px 24px 22px;
}
.offline-auth h2 { font-size: 16px; margin-bottom: 16px; }

/* -------------------------------------------------------------
   顶部导航
   ---------------------------------------------------------- */
.app-body { background: var(--bg); min-height: 100vh; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, .86);
    backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid var(--border);
}
.topbar-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); min-width: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-text strong { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.topnav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.topnav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-soft);
    transition: background .16s ease, color .16s ease;
}
.topnav-link:hover { background: var(--bg-soft); color: var(--text); }
.topnav-link.is-active { background: var(--primary-soft); color: var(--primary-dark); }
.topnav-link .badge { position: absolute; top: 2px; right: 2px; }

.topbar-user { display: flex; align-items: center; gap: 8px; padding-left: 10px; border-left: 1px solid var(--border); }
.topbar-name { font-size: 13.5px; font-weight: 600; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); }
.status-live { background: var(--success); box-shadow: 0 0 0 3px rgba(18, 166, 117, .16); }
.status-warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(217, 139, 0, .16); }
.status-idle { background: var(--border-strong); }

/* -------------------------------------------------------------
   页面主体
   ---------------------------------------------------------- */
.page-main {
    max-width: 1180px;
    margin: 0 auto;
    padding: 22px 20px 40px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    animation: pageIn .4s ease both;
}
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.overview-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.card-seat {
    background: linear-gradient(135deg, #2438c9, #3d5afe 55%, #5c74ff);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 18px 34px -22px rgba(61, 90, 254, .95);
}
.card-seat .card-head,
.card-seat .card-sub { color: rgba(255, 255, 255, .72); }
.seat-code-lg {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.2;
    margin: 2px 0 2px;
}
.seat-code-lg.is-empty { font-size: 22px; font-weight: 600; opacity: .92; }

/* -------------------------------------------------------------
   座位图
   ---------------------------------------------------------- */
.seat-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 20px 24px;
    box-shadow: var(--shadow-sm);
}
.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.section-head h2 { font-size: 17px; letter-spacing: -.01em; }
.section-head p { font-size: 12.5px; margin-top: 3px; }

.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-soft); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.dot-empty { background: #fff; border: 1.5px dashed var(--border-strong); }
.dot-mine { background: var(--primary); }
.dot-taken { background: #e2e7f3; border: 1px solid #d3dae9; }
.dot-locked { background: repeating-linear-gradient(45deg, #e9ebf0, #e9ebf0 3px, #f7f8fa 3px, #f7f8fa 6px); border: 1px solid #dfe2e8; }

.classroom {
    background: linear-gradient(180deg, #fbfcff, #f6f8fd);
    border: 1px solid #edf0f7;
    border-radius: 18px;
    padding: 16px 14px 14px;
}
.podium {
    margin: 0 auto 16px;
    width: min(300px, 70%);
    text-align: center;
    font-size: 12px;
    letter-spacing: .32em;
    color: var(--text-muted);
    padding: 7px 0;
    border-radius: 8px;
    background: linear-gradient(180deg, #eef2fb, #e6ebf7);
    border: 1px solid #e0e6f2;
}
.podium-back { margin: 16px auto 0; width: min(220px, 60%); letter-spacing: .28em; opacity: .7; }

.seat-scroll { overflow-x: auto; padding-bottom: 2px; }
.seat-grid {
    display: grid;
    grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr));
    gap: 10px;
    min-width: 320px;
}
.desk {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 7px 7px 8px;
    box-shadow: 0 1px 2px rgba(23, 33, 54, .04);
    transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
.desk:hover { box-shadow: 0 10px 24px -18px rgba(23, 33, 54, .5); }
.desk-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 3px 6px;
}
.desk-code { font-size: 11.5px; font-weight: 700; color: var(--text-soft); letter-spacing: .02em; }
.desk-row { font-size: 10px; color: #b3bacb; }
.desk-seats { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }

.seat {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    min-height: 52px;
    padding: 5px 3px;
    border-radius: 9px;
    border: 1.5px solid transparent;
    background: #fff;
    cursor: pointer;
    font-family: inherit;
    transition: transform .16s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease, color .18s ease;
    overflow: hidden;
}
.seat-side {
    font-size: 9.5px;
    line-height: 1;
    color: #aab2c5;
    letter-spacing: .04em;
}
.seat-name {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--text);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 2px;
}

.seat-empty {
    background: #fff;
    border: 1.5px dashed #d5dcec;
    color: var(--text-muted);
}
.seat-empty .seat-name { color: #9aa4b8; font-weight: 500; }
.seat-empty:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
    transform: translateY(-2px);
    box-shadow: 0 12px 20px -14px rgba(61, 90, 254, .8);
}
.seat-empty:hover .seat-name { color: var(--primary-dark); }

.seat-taken {
    background: #eef2fb;
    border-color: #e2e8f6;
    cursor: pointer;
}
.seat-taken .seat-name { color: #4a5670; }
.seat-taken:hover { background: #e6ecfa; border-color: #c9d5f0; transform: translateY(-1px); }

.seat-mine {
    background: linear-gradient(150deg, #4c66ff, #3550e8);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 10px 22px -14px rgba(61, 90, 254, .95);
}
.seat-mine .seat-name,
.seat-mine .seat-side { color: #fff; }
.seat-mine .seat-side { opacity: .75; }

.seat-locked {
    background: repeating-linear-gradient(45deg, #eff1f5, #eff1f5 4px, #f8f9fb 4px, #f8f9fb 8px);
    border-color: #e4e7ee;
    cursor: not-allowed;
}
.seat-locked .seat-name { color: #a8b0c0; }
.seat-locked .seat-side { color: #c3c9d6; }

.seat.is-busy { opacity: .6; pointer-events: none; }
.seat.is-flash { animation: seatFlash .55s ease; }
@keyframes seatFlash {
    0% { transform: scale(1); }
    35% { transform: scale(.94); }
    100% { transform: scale(1); }
}

/* -------------------------------------------------------------
   快捷入口
   ---------------------------------------------------------- */
.quick-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.quick-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    box-shadow: var(--shadow-sm);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.quick-card:hover { transform: translateY(-2px); border-color: #cdd6ea; box-shadow: var(--shadow); }
.quick-card > span:nth-child(2) { display: flex; flex-direction: column; min-width: 0; }
.quick-card strong { font-size: 13.5px; }
.quick-card small { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }
.quick-card > .icon:last-child { margin-left: auto; color: var(--text-muted); }
.quick-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: 11px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    flex: 0 0 auto;
}

/* -------------------------------------------------------------
   交换申请 / 通知 / 个人中心
   ---------------------------------------------------------- */
.card-form { padding-bottom: 22px; }

.request-list { display: flex; flex-direction: column; }
.request-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    animation: blockIn .28s ease both;
}
.request-item:last-child { border-bottom: none; padding-bottom: 2px; }
.request-main { flex: 1; min-width: 0; }
.request-title { font-size: 13.5px; }
.request-seats {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0 4px;
    color: var(--text-muted);
}
.seat-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 7px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-soft);
    font-variant-numeric: tabular-nums;
}
.request-message { font-size: 12.5px; color: var(--text-soft); background: var(--surface-2); padding: 6px 10px; border-radius: 8px; margin: 4px 0; }
.request-meta { display: flex; align-items: center; gap: 8px; font-size: 11.5px; margin-top: 4px; }
.request-actions { display: flex; gap: 8px; flex: 0 0 auto; }

.notify-list { display: flex; flex-direction: column; }
.notify-item {
    display: flex;
    gap: 12px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
    align-items: flex-start;
}
.notify-item:last-child { border-bottom: none; }
.notify-item.is-unread { position: relative; }
.notify-item.is-unread::before {
    content: "";
    position: absolute;
    left: -10px;
    top: 22px;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--primary);
}
.notify-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    border-radius: 10px;
    background: var(--bg-soft);
    color: var(--text-soft);
    flex: 0 0 auto;
}
.notify-item.is-unread .notify-icon { background: var(--primary-soft); color: var(--primary-dark); }
.notify-body { flex: 1; min-width: 0; }
.notify-title { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.notify-type { font-size: 11px; font-weight: 500; color: var(--text-muted); background: var(--bg-soft); padding: 1px 7px; border-radius: 6px; }
.notify-content { font-size: 13px; color: var(--text-soft); margin-top: 4px; line-height: 1.75; }
.notify-time { font-size: 11.5px; color: var(--text-muted); margin-top: 6px; }

.profile-head { display: flex; align-items: center; gap: 16px; }
.profile-avatar {
    width: 54px; height: 54px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #4c66ff, #2f47d6);
    flex: 0 0 auto;
}
.profile-info { flex: 1; min-width: 0; }
.profile-info h2 { font-size: 19px; letter-spacing: -.01em; }
.profile-info p { font-size: 12.5px; margin-top: 2px; }
.profile-seat { text-align: right; font-size: 12px; }
.profile-seat strong { display: block; font-size: 17px; margin-top: 2px; }

.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.info-value { font-size: 14px; margin: 2px 0 10px; }
.grade-result { display: flex; align-items: baseline; gap: 12px; margin: 6px 0 16px; }
.grade-number { font-size: 40px; font-weight: 700; letter-spacing: -.03em; color: var(--primary-dark); }
.grade-caption { font-size: 12.5px; color: var(--text-muted); }

.page-footer {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 20px 28px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 11.5px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

/* -------------------------------------------------------------
   响应式
   ---------------------------------------------------------- */
@media (max-width: 960px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-visual { display: none; }
    .auth-panel { min-height: 100vh; padding: 28px 18px; }
    .overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .overview-grid .card-seat { grid-column: span 2; }
    .info-grid { grid-template-columns: 1fr; }
    .quick-links { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .topbar-inner { padding: 8px 14px; gap: 10px; flex-wrap: wrap; }
    .brand-text small { display: none; }
    .topnav {
        order: 3;
        width: 100%;
        margin-left: 0;
        justify-content: space-between;
        border-top: 1px solid var(--border);
        padding-top: 6px;
        margin-top: 2px;
    }
    .topnav-link { flex: 1; justify-content: center; padding: 8px 6px; font-size: 12.5px; }
    .topnav-link .badge { position: static; margin-left: 2px; }
    .topbar-user { margin-left: auto; border-left: none; padding-left: 0; }

    .page-main { padding: 14px 12px 30px; gap: 14px; }
    .overview-grid { grid-template-columns: 1fr; gap: 10px; }
    .overview-grid .card-seat { grid-column: span 1; }
    .seat-code-lg { font-size: 26px; }
    .seat-section { padding: 14px 10px 16px; border-radius: 16px; }
    .classroom { padding: 12px 8px 10px; border-radius: 14px; }
    .seat-grid { gap: 6px; min-width: 300px; }
    .desk { padding: 5px 5px 6px; border-radius: 10px; }
    .desk-head { padding-bottom: 4px; }
    .desk-code { font-size: 10px; }
    .desk-row { display: none; }
    .desk-seats { gap: 4px; }
    .seat { min-height: 46px; border-radius: 8px; padding: 4px 2px; }
    .seat-name { font-size: 10.5px; letter-spacing: -.02em; }
    .seat-side { font-size: 8.5px; }
    .podium { width: 70%; font-size: 10.5px; padding: 5px 0; margin-bottom: 12px; }
    .podium-back { margin-top: 12px; font-size: 10px; }
    .legend { gap: 10px; font-size: 11px; }
    .section-head { align-items: flex-start; flex-direction: column; gap: 8px; }
    .request-item { flex-direction: column; align-items: flex-start; gap: 10px; }
    .request-actions { width: 100%; }
    .request-actions .btn { flex: 1; }
    .profile-head { flex-wrap: wrap; }
    .profile-seat { text-align: left; }
    .notify-item.is-unread::before { display: none; }
    .page-footer { padding: 0 14px 24px; }
}
