/* ═══════════════════════════════════════════════════════════
   CampusNotifier - 样式表
   ═══════════════════════════════════════════════════════════ */

:root {
    --primary: #1976D2;
    --primary-dark: #1565C0;
    --primary-light: #BBDEFB;
    --accent: #FF6D00;
    --success: #43A047;
    --error: #E53935;
    --bg: #f5f6fa;
    --card-bg: #ffffff;
    --text: #333333;
    --text-light: #888888;
    --border: #e0e0e0;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ── 页面切换 ─────────────────────── */
.page { display: none; }
.page.active { display: flex; flex-direction: column; min-height: 100vh; }

.hidden { display: none !important; }

/* ── 登录 / 注册卡片 ─────────────── */
#login-page, #register-page {
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1565C0 0%, #42A5F5 100%);
}

.login-card {
    background: white;
    border-radius: 12px;
    padding: 40px 36px;
    width: 400px;
    max-width: 92vw;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}
.login-header .logo { font-size: 48px; margin-bottom: 8px; }
.login-header h1 { font-size: 22px; color: var(--primary); }
.login-header p { font-size: 13px; color: var(--text-light); margin-top: 4px; }

.login-footer {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-light);
}
.login-footer a { color: var(--primary); text-decoration: none; }
.login-footer a:hover { text-decoration: underline; }

.legal-links-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    font-size: 12px;
    color: #888;
}

.legal-links-row a {
    color: var(--primary);
    text-decoration: none;
}

.legal-links-row a:hover {
    text-decoration: underline;
}

.legal-link-sep {
    display: none;
}

.legal-link-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid #c6d8eb;
    background: #f7fbff;
    color: #1d5e8b !important;
    font-size: 12px;
    line-height: 1.2;
    text-decoration: none !important;
    transition: all 0.18s ease;
}

.legal-link-chip:hover {
    border-color: #2c7da0;
    background: #eaf5ff;
    color: #114d79 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(44, 125, 160, 0.18);
}

.legal-link-chip:focus-visible {
    outline: 2px solid #2c7da0;
    outline-offset: 2px;
}

.login-legal-links {
    justify-content: center;
    margin-top: 10px;
}

.legal-consent-list {
    margin: 0 0 6px 16px;
    padding: 0;
    line-height: 1.9;
}

.legal-consent-list a {
    color: var(--primary);
    text-decoration: none;
}

.legal-consent-list a:hover {
    text-decoration: underline;
}

/* ── iOS PWA 安装引导 ────────────── */
.pwa-install-banner {
    margin-top: 20px;
    border-radius: 10px;
    background: #FFF8E1;
    border: 1px solid #FFD54F;
    overflow: hidden;
}

.pwa-install-banner > div {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
}

.pwa-banner-icon {
    font-size: 28px;
    flex-shrink: 0;
    line-height: 1;
    margin-top: 2px;
}

.pwa-banner-text {
    font-size: 13px;
    color: #5D4037;
    line-height: 1.55;
}

.pwa-banner-text strong {
    display: block;
    font-size: 14px;
    color: #3E2723;
    margin-bottom: 4px;
}

.pwa-banner-text p {
    margin: 0;
}

.pwa-banner-text p strong {
    display: inline;
    font-size: inherit;
    color: inherit;
    margin-bottom: 0;
}

/* ── 表单 ─────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #555;
}

input[type="text"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="time"],
textarea,
select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
    background: #fff;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(25,118,210,0.12);
}

textarea { resize: vertical; }

.room-code-display {
    appearance: none;
    width: 100%;
    min-height: 48px;
    border: 1px solid #d6e0ea;
    border-radius: 8px;
    background: #f8fafc;
    color: #111827;
    font: inherit;
    font-family: Consolas, "Microsoft YaHei", sans-serif;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 2px;
    line-height: 1;
    text-align: center;
    cursor: default;
}

.room-code-display:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.room-code-keypad {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 8px 0 10px;
}

.room-code-keypad button {
    appearance: none;
    min-height: 40px;
    border: 1px solid #d6e0ea;
    border-radius: 8px;
    background: #fff;
    color: #24364a;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.16s, border-color 0.16s, color 0.16s;
}

.room-code-keypad button:hover,
.room-code-keypad button:focus-visible {
    border-color: var(--primary);
    background: #edf5ff;
    color: var(--primary-dark);
}

.room-code-keypad-wide {
    grid-column: span 2;
}

.login-link-button {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--text-light);
    font: inherit;
    font-size: 13px;
    padding: 2px 0;
    cursor: pointer;
}
.login-link-button:hover,
.login-link-button:focus-visible {
    color: var(--primary);
    text-decoration: underline;
}

.login-secondary-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.hidden-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.notify-image-picker {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.notify-image-name {
    display: inline-block;
    min-width: 0;
    max-width: min(62vw, 420px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    color: var(--text-light);
}

.notify-image-preview-card {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
}

.notify-image-preview-card img {
    max-width: 220px;
    max-height: 130px;
    border-radius: 6px;
    border: 1px solid #ddd;
    object-fit: contain;
    background: #fff;
}

.notify-image-preview-meta {
    font-size: 12px;
    color: #666;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.notify-advanced {
    margin: 4px 0 16px;
    border-top: 1px solid #eef1f5;
    padding-top: 10px;
}

.notify-advanced-toggle {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.notify-advanced-toggle:hover,
.notify-advanced-toggle:focus-visible {
    color: var(--primary-dark);
    text-decoration: underline;
}

.notify-advanced-toggle-note {
    color: var(--text-light);
    font-size: 12px;
    font-weight: 500;
}

.notify-advanced-panel {
    margin-top: 8px;
    padding: 10px 12px;
    border: 1px solid #e7ebf0;
    border-radius: 8px;
    background: #fbfcfe;
}

.notify-advanced-option {
    margin-bottom: 0;
}

.notify-schedule-fields {
    margin-top: 10px;
    max-width: 420px;
}

.notify-schedule-fields .form-group {
    margin-bottom: 10px;
}

.notify-date-options {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.notify-date-chip {
    appearance: none;
    border: 1px solid #dce4ee;
    border-radius: 8px;
    background: #fff;
    color: #324255;
    min-width: 0;
    padding: 7px 4px;
    font: inherit;
    font-size: 12px;
    line-height: 1.2;
    cursor: pointer;
    transition: border-color 0.16s, background 0.16s, color 0.16s;
}

.notify-date-chip.active {
    border-color: var(--primary);
    background: rgba(25,118,210,0.09);
    color: var(--primary-dark);
    font-weight: 700;
}

.notify-time-picker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
}

.notify-time-unit {
    display: grid;
    grid-template-columns: 34px 48px 34px;
    align-items: center;
    border: 1px solid #dce4ee;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.notify-time-step {
    appearance: none;
    border: 0;
    background: #f5f8fb;
    color: var(--primary);
    height: 38px;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.notify-time-step:hover,
.notify-time-step:focus-visible {
    background: #eaf2fb;
}

.notify-time-input {
    width: 48px !important;
    height: 38px;
    border: 0 !important;
    border-left: 1px solid #edf1f6 !important;
    border-right: 1px solid #edf1f6 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.notify-time-separator {
    color: #607080;
    font-size: 18px;
    font-weight: 700;
}

.notify-advanced-hint {
    font-size: 12px;
    color: var(--text-light);
}

.form-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

/* ── 按钮 ─────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}
.btn:active { transform: scale(0.97); }

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}
.btn-outline:hover { background: rgba(25,118,210,0.06); }

.btn-danger { background: var(--error); color: white; }
.btn-danger:hover { background: #C62828; }

.btn-warning { background: #FF9800; color: white; border: none; border-radius: 6px; cursor: pointer; }
.btn-warning:hover { background: #F57C00; }

.mute-badge {
    display: inline-block;
    background: #FFF3E0;
    color: #E65100;
    border: 1px solid #FFB74D;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 12px;
    margin-left: 8px;
    font-weight: 600;
}

.btn-block { width: 100%; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 12px 32px; font-size: 15px; }

.classroom-manage-switch {
    display: flex;
    align-items: flex-end;
    gap: 22px;
    padding: 0;
    margin-bottom: 16px;
    border-bottom: 1px solid #d9e3ee;
    background: transparent;
}

.manage-switch-btn {
    appearance: none;
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    background: transparent;
    color: #526173;
    padding: 0 2px 10px;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.18s, color 0.18s;
}

.manage-switch-btn span {
    display: block;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
}

.manage-switch-btn small {
    display: block;
    margin-top: 3px;
    color: #7b8a9b;
    font-size: 12px;
    line-height: 1.25;
}

.manage-switch-btn:hover {
    color: #263445;
}

.manage-switch-btn.active {
    color: var(--primary-dark);
    border-bottom-color: var(--primary);
}

.manage-switch-btn.active small {
    color: #4f6f91;
}

@media (max-width: 560px) {
    .classroom-manage-switch {
        gap: 14px;
        overflow-x: auto;
    }
}

.physical-room-picker-hint {
    margin: -2px 0 12px;
    color: #6b7280;
    font-size: 12px;
    line-height: 1.5;
}

/* ── 顶部导航 ─────────────────────── */
.top-nav {
    display: flex;
    align-items: center;
    background: var(--primary);
    color: white;
    padding: 0 20px;
    height: 52px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 100;
    flex-wrap: wrap;
}

.teacher-warning-banner {
    background: #FFF4E5;
    border-bottom: 1px solid #FFD7A8;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.teacher-warning-banner-inner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    color: #8A4B00;
    font-size: 14px;
    line-height: 1.45;
    font-weight: 600;
}

.teacher-warning-icon {
    flex: 0 0 auto;
    margin-top: 1px;
}

.teacher-warning-text {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.teacher-warning-text a {
    color: #c46b00;
    text-decoration: none;
    font-weight: 700;
    padding: 1px 6px;
    margin: 0 1px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(196, 107, 0, 0.18);
    transition: all 0.18s ease;
    white-space: nowrap;
}

.teacher-warning-text a:hover {
    color: #8f4d00;
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(196, 107, 0, 0.32);
    box-shadow: 0 2px 6px rgba(196, 107, 0, 0.12);
}

.teacher-warning-text a:focus-visible {
    outline: 2px solid rgba(196, 107, 0, 0.45);
    outline-offset: 2px;
}

.teacher-warning-close {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #8A4B00;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    margin-left: 6px;
}

.teacher-warning-close:hover {
    background: rgba(138, 75, 0, 0.1);
}

.teacher-warning-close:focus-visible {
    outline: 2px solid rgba(138, 75, 0, 0.4);
    outline-offset: 1px;
}

.teacher-info-banner {
    background: #EAF4FF;
    border-bottom: 1px solid #C8E0FF;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.teacher-info-banner-inner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    color: #145A9E;
    font-size: 14px;
    line-height: 1.45;
    font-weight: 600;
}

.teacher-info-icon {
    flex: 0 0 auto;
    margin-top: 1px;
}

.teacher-info-text {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.teacher-info-text a {
    color: #0D47A1;
    text-decoration: none;
    font-weight: 700;
    padding: 1px 6px;
    margin: 0 1px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(13, 71, 161, 0.18);
    transition: all 0.18s ease;
    white-space: nowrap;
}

.teacher-info-text a:hover {
    color: #0A3B8A;
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(13, 71, 161, 0.32);
    box-shadow: 0 2px 6px rgba(13, 71, 161, 0.12);
}

.teacher-info-text a:focus-visible {
    outline: 2px solid rgba(13, 71, 161, 0.45);
    outline-offset: 2px;
}

.teacher-info-close {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #145A9E;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    margin-left: 6px;
}

.teacher-info-close:hover {
    background: rgba(20, 90, 158, 0.12);
}

.teacher-info-close:focus-visible {
    outline: 2px solid rgba(20, 90, 158, 0.4);
    outline-offset: 1px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.nav-logo { font-size: 22px; }
.nav-title { font-size: 16px; font-weight: 700; white-space: nowrap; }

.nav-tabs {
    display: flex;
    gap: 2px;
    flex: 1;
    min-width: 0;
    margin: 0 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.nav-tabs::-webkit-scrollbar { display: none; }

.tab-btn {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.75);
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}
.tab-btn:hover { color: white; background: rgba(255,255,255,0.08); }
.tab-btn.active {
    color: white;
    border-bottom-color: white;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.user-info {
    font-size: 13px;
    opacity: 0.9;
}
.nav-right .btn-outline {
    color: white;
    border-color: rgba(255,255,255,0.5);
    padding: 4px 12px;
    font-size: 12px;
}
.nav-right .btn-outline:hover {
    background: rgba(255,255,255,0.12);
    border-color: white;
}

.classroom-install-nav-btn {
    padding: 3px 10px;
    font-size: 12px;
    line-height: 1.35;
    white-space: nowrap;
}

.classroom-installer-url-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.classroom-installer-page-url {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    border-radius: 5px;
    background: #f3f6fb;
    color: #1b2b44;
    font-size: 12px;
    line-height: 1.35;
    word-break: break-all;
}

.classroom-installer-dialog-card {
    max-width: 460px;
    width: min(92vw, 460px);
    padding: 24px;
}

.classroom-installer-dialog-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.classroom-installer-dialog-header h3 {
    flex: 1;
    margin: 0;
}

.classroom-installer-dialog-close {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #667085;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.classroom-installer-dialog-close:hover {
    background: #f0f3f8;
    color: #1f2937;
}

.classroom-installer-dialog-text {
    margin: 0 0 12px;
    color: var(--text);
    font-size: 14px;
    line-height: 1.55;
}

.classroom-installer-dialog-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

/* ── Tab 内容区 ───────────────────── */
.tab-content { display: none; flex: 1; padding: 24px 0; }
.tab-content.active { display: block; }

.container { max-width: 800px; margin: 0 auto; padding: 0 20px; }

/* ── 卡片 ─────────────────────────── */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.card h2 { font-size: 18px; margin-bottom: 16px; color: var(--primary-dark); }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.card-header h2 { margin-bottom: 0; }

/* ── 消息提示 ─────────────────────── */
.error-msg {
    background: #FFEBEE;
    color: var(--error);
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-top: 12px;
}
.success-msg {
    background: #E8F5E9;
    color: var(--success);
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-top: 12px;
}
.info-msg {
    background: #E3F2FD;
    color: var(--primary);
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
}

.hint-text {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 16px;
    line-height: 1.5;
}

.weekday-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    color: var(--text-dark);
    font-size: 14px;
}

.weekday-checks label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.weekday-checks input {
    width: 16px;
    height: 16px;
}

/* ── 通知记录列表 ─────────────────── */
.history-list { max-height: 70vh; overflow-y: auto; }

.history-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid #f0f0f0;
}
.history-item:last-child { border-bottom: none; }

.history-icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.history-icon.normal { background: #E3F2FD; }
.history-icon.urgent { background: #FFF3E0; }

.history-body { flex: 1; min-width: 0; }
.history-content { font-size: 14px; line-height: 1.5; word-break: break-all; }
.history-content-line { min-height: 1.5em; }
.history-meta {
    display: flex;
    gap: 16px;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-light);
    flex-wrap: wrap;
    align-items: center;
}

.btn-delete-notif,
.btn-text-delete {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 12px;
    cursor: pointer;
    padding: 2px 6px;
    margin-left: auto;
    font-family: inherit;
    transition: color 0.15s;
    opacity: 0;
}
.btn-text-delete:hover {
    color: var(--error);
    text-decoration: underline;
}
.history-item:hover .btn-text-delete {
    opacity: 1;
}

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.status-scheduled { background: #E0F2F1; color: #00796B; }
.status-pending { background: #FFF9C4; color: #F9A825; }
.status-delivered { background: #E3F2FD; color: #1976D2; }
.status-played { background: #E8F5E9; color: #43A047; }
.status-confirmed { background: #C8E6C9; color: #2E7D32; }
.status-confirm-required { background: #FFF3E0; color: #E65100; }

.history-image-note {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 11px;
    background: #E8EAF6;
    color: #3949AB;
    vertical-align: middle;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.history-reaction-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.history-reaction-title {
    font-size: 11px;
    color: #78909C;
}

.history-reaction-chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    background: #F3E5F5;
    color: #6A1B9A;
    border: 1px solid #E1BEE7;
}

.emoji-inline {
    width: 1.05em;
    height: 1.05em;
    vertical-align: -0.18em;
    object-fit: contain;
}

.empty-text {
    text-align: center;
    color: var(--text-light);
    padding: 32px 0;
    font-size: 14px;
}

/* ── 教室列表 ─────────────────────── */
.classroom-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}
.classroom-item:last-child { border-bottom: none; }

.classroom-info { flex: 1; }
.classroom-name { font-weight: 600; font-size: 15px; }
.classroom-token {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
    font-family: "Consolas", monospace;
    word-break: break-all;
}

.classroom-actions { display: flex; gap: 8px; }

.subject-assign-table {
    width: 100%;
    border-collapse: collapse;
}

.subject-assign-table th,
.subject-assign-table td {
    border-bottom: 1px solid #eee;
    padding: 8px 12px;
    text-align: left;
    vertical-align: middle;
}

.subject-assign-table th {
    background: #f8fafc;
    font-size: 13px;
    color: #444;
    position: sticky;
    top: 0;
    z-index: 1;
}

.subject-col {
    width: 110px;
    white-space: nowrap;
}

.subject-name-btn {
    background: none;
    border: none;
    padding: 4px 8px;
    font-weight: 700;
    font-size: 14px;
    color: var(--primary);
    cursor: pointer;
    border-radius: 4px;
    white-space: nowrap;
    text-align: left;
    text-decoration: underline dotted;
}

.subject-name-btn:hover {
    background: var(--primary-light);
}

.subject-teachers-preview {
    vertical-align: middle;
}

.teacher-tag {
    display: inline-block;
    background: #e3f2fd;
    color: var(--primary-dark);
    border-radius: 12px;
    padding: 2px 9px;
    font-size: 12px;
    margin: 2px 3px 2px 0;
    white-space: nowrap;
}

.no-teacher-hint {
    color: var(--text-light);
    font-size: 12px;
}

.subject-teacher-option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    padding: 6px 4px;
    cursor: pointer;
    border-radius: 4px;
}

.subject-teacher-option:hover {
    background: #f5f5f5;
}

.subject-teacher-option em {
    color: var(--text-light);
    font-style: normal;
    font-size: 13px;
}

/* ── 时间表 ───────────────────────── */
.schedule-period {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
}
.schedule-period:last-child { border-bottom: none; }

.schedule-period input[type="text"] { width: 120px; }
.schedule-period input[type="time"] { width: 130px; }
.schedule-period .btn-sm { padding: 4px 10px; }

/* ── 汉堡按钮 ─────────────────────── */
.hamburger {
    display: none;
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

/* ── 侧边栏抽屉 ──────────────────── */
.sidebar-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45);
    z-index: 199;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}
.sidebar-overlay.open {
    opacity: 1;
    visibility: visible;
}

.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: 280px;
    max-width: 82vw;
    height: 100%;
    background: #fff;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(.4,0,.2,1);
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 24px rgba(0,0,0,0.12);
    overflow-y: auto;
}
.sidebar.open {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 20px 12px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}
.sidebar-logo { font-size: 28px; }
.sidebar-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary-dark);
    flex: 1;
}
.sidebar-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s;
}
.sidebar-close:hover { background: #f0f0f0; color: #333; }

.sidebar-user {
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}
.sidebar-user-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}
.sidebar-user-role {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    padding: 8px 0;
    overflow-y: auto;
}
.sidebar-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 13px 20px;
    border: none;
    background: none;
    font-size: 15px;
    font-family: inherit;
    color: #444;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    text-align: left;
    gap: 12px;
    border-left: 3px solid transparent;
}
.sidebar-item:hover {
    background: #f5f7fa;
    color: var(--primary);
}
.sidebar-item.active {
    background: #E3F2FD;
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}
.sidebar-icon { font-size: 18px; width: 24px; text-align: center; flex-shrink: 0; }

.classroom-install-sidebar-btn {
    display: none;
}

.classroom-install-divider {
    display: none;
}

.sidebar-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 8px 16px;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
}
.sidebar-footer .btn {
    width: 100%;
    justify-content: center;
}

/* ── 响应式表单行 ─────────────────── */
.form-row-responsive {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.btn-group-inline {
    display: flex;
    gap: 8px;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 0;
}
.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
/* ── 远程执行 ─────────────────────── */
.remote-output-box {
    background: #1e1e1e;
    color: #d4d4d4;
    font-family: "Consolas", "Courier New", monospace;
    font-size: 13px;
    line-height: 1.5;
    padding: 16px;
    border-radius: 8px;
    max-height: 400px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
    margin-top: 8px;
}
.cmd-history { max-height: 50vh; overflow-y: auto; }
.cmd-history-item {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.15s;
}
.cmd-history-item:hover { background: #f5f5f5; border-radius: 4px; padding-left: 8px; }
.cmd-history-item:last-child { border-bottom: none; }
.cmd-history-header {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-light);
    align-items: center;
    flex-wrap: wrap;
}
.cmd-history-time { font-family: "Consolas", monospace; }
.cmd-history-classroom {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.cmd-history-cmd {
    font-family: "Consolas", monospace;
    font-size: 13px;
    color: var(--text);
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── 我的账户 ─────────────────────── */
.account-info {
    background: #FAFAFA;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 8px;
}
.account-row {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}
.account-row.account-row-top { align-items: flex-start; }
.account-row:last-child { border-bottom: none; }
.account-label {
    width: 100px;
    flex-shrink: 0;
    font-size: 13px;
    color: var(--text-light);
    font-weight: 600;
}
.account-value {
    font-size: 14px;
    color: var(--text);
}
.account-value.account-value-multiline {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.5;
}

.account-icp-record {
    margin: 10px 0 2px;
    text-align: center;
    font-size: 12px;
    color: #9aa0a6;
}

.snapshot-access-page-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 12px;
    border: 1px solid #e0e8f2;
    border-radius: 8px;
    background: #f8fbff;
    font-size: 13px;
    color: #5f758d;
}

.snapshot-access-page-row a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.snapshot-access-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.snapshot-access-item:last-child {
    border-bottom: none;
}

.snapshot-access-info {
    min-width: 0;
    flex: 1;
}

.snapshot-access-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.snapshot-access-expiry-options {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px;
    border: 1px solid #dbe6f2;
    border-radius: 6px;
    background: #f8fbff;
}

.snapshot-access-expiry-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    font-size: 12px;
    font-weight: 600;
    color: #5f758d;
    cursor: pointer;
    white-space: nowrap;
}

.snapshot-access-expiry-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.snapshot-access-expiry-option span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 28px;
    padding: 4px 8px;
    border-radius: 4px;
}

.snapshot-access-expiry-option input:checked + span {
    background: #e8f2ff;
    color: var(--primary);
}

.snapshot-access-result {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.snapshot-access-code {
    display: inline-block;
    margin: 2px 0;
    padding: 4px 8px;
    border-radius: 6px;
    background: #eef6ff;
    color: #0d47a1;
    font-family: "Consolas", "Courier New", monospace;
    font-weight: 700;
    letter-spacing: 0;
}

.snapshot-access-result a {
    color: inherit;
    font-weight: 700;
}

/* ── 抓拍只读访问页 ───────────────── */
.snapshot-public-body {
    min-height: 100vh;
    background: #f4f7fb;
}

.snapshot-public-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, #1565C0 0%, #42A5F5 100%);
}

.snapshot-public-view {
    min-height: 100vh;
}

.snapshot-public-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 24px;
    background: #fff;
    border-bottom: 1px solid #dce7f3;
    box-shadow: 0 1px 8px rgba(20, 47, 76, 0.06);
}

.snapshot-public-title {
    font-size: 20px;
    color: #17324d;
    margin: 0;
}

.snapshot-public-subtitle {
    margin-top: 4px;
    color: #6b7f93;
    font-size: 13px;
}

.snapshot-public-container {
    max-width: 980px;
    padding-top: 24px;
    padding-bottom: 32px;
}

.snapshot-public-record-card {
    border: 1px solid #e1eaf4;
    border-radius: 8px;
    padding: 10px;
    background: #fbfdff;
}

.snapshot-public-record-title {
    font-weight: 700;
    color: #20354a;
    margin-bottom: 6px;
}

.snapshot-public-record-meta {
    font-size: 12px;
    color: #5f758d;
    line-height: 1.6;
}

.snapshot-public-viewer-meta {
    font-size: 12px;
    color: #5c7288;
}

/* ── Toast 通知 ───────────────────── */
#toast-container {
    position: fixed;
    top: 60px;
    right: 16px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 420px;
    pointer-events: none;
}
.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 18px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 6px 24px rgba(0,0,0,0.14);
    font-size: 13px;
    line-height: 1.5;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(.4,0,.2,1), opacity 0.35s;
    pointer-events: auto;
    border-left: 4px solid #999;
}
.toast-show { transform: translateX(0); opacity: 1; }
.toast-hide { transform: translateX(120%); opacity: 0; }
.toast-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.toast-body { flex: 1; min-width: 0; word-break: break-word; }
.toast-success { border-left-color: var(--success); background: #f6fef6; }
.toast-error { border-left-color: var(--error); background: #fef6f6; }
.toast-warning { border-left-color: #FF9800; background: #fffcf5; }
.toast-info { border-left-color: var(--primary); background: #f6faff; }

/* ── 自定义确认弹窗 ──────────────── */
.confirm-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 2100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.2s;
}
.confirm-overlay.confirm-show {
    opacity: 1;
}
.confirm-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    max-width: 380px;
    width: 100%;
    box-shadow: 0 12px 48px rgba(0,0,0,0.18);
    transform: scale(0.92);
    transition: transform 0.2s;
}
.confirm-overlay.confirm-show .confirm-card {
    transform: scale(1);
}
.confirm-body {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text);
    margin-bottom: 20px;
}
.confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}
.confirm-actions .btn {
    min-width: 72px;
}

/* ── 弹窗遮罩 ─────────────────────── */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.modal-overlay.hidden { display: none !important; }

/* 重置密码弹窗置于其他弹窗之上 */
#modal-overlay { z-index: 1100; }

.modal-card {
    background: white;
    border-radius: 12px;
    padding: 28px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 12px 48px rgba(0,0,0,0.2);
    animation: modalIn 0.2s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}
.modal-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--primary-dark);
}

/* ── 实时画面 ───────────────────── */
.live-layout-card {
    padding-bottom: 18px;
}

#tab-live .container {
    max-width: 1180px;
}

.live-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 14px;
}

.live-room-panel {
    border: 1px solid #e8edf5;
    border-radius: 10px;
    background: #fbfdff;
    min-height: 340px;
    display: flex;
    flex-direction: column;
}

.live-room-panel-title {
    padding: 10px 10px 6px;
    font-size: 12px;
    color: #506176;
    font-weight: 600;
}

.live-classroom-list {
    padding: 0 6px 8px;
    overflow-y: auto;
}

.live-room-item {
    border: 1px solid #e4ebf4;
    border-radius: 8px;
    background: #fff;
    padding: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.live-room-item:hover {
    border-color: #b8cde6;
    transform: translateY(-1px);
}

.live-room-item.active {
    border-color: #1976d2;
    box-shadow: 0 6px 14px rgba(25, 118, 210, 0.14);
}

.live-room-name {
    font-size: 13px;
    font-weight: 600;
    color: #203447;
}

.live-room-meta {
    margin-top: 3px;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    font-size: 12px;
}

.live-chip {
    padding: 2px 7px;
    border-radius: 999px;
    border: 1px solid #dce4ef;
    color: #58708a;
    background: #f6f9fc;
}

.live-chip.ok {
    background: #eaf7ee;
    border-color: #c7ebd1;
    color: #237d3c;
}

.live-chip.warn {
    background: #fff5e9;
    border-color: #ffd7af;
    color: #b66312;
}

.live-chip.off {
    background: #fdecec;
    border-color: #f3c2c2;
    color: #b63b3b;
}

.live-player-panel {
    border: 1px solid #e8edf5;
    border-radius: 10px;
    background: #fff;
    padding: 12px;
}

.live-player-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.live-player-title {
    font-size: 16px;
    font-weight: 700;
    color: #1d2f42;
}

.live-player-subtitle {
    font-size: 12px;
    color: #6f8092;
    margin-top: 3px;
}

.live-video-wrap {
    position: relative;
    width: 100%;
    background: #0e1a25;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

body.pseudo-fullscreen-open {
    overflow: hidden;
}

.live-video-wrap.live-video-pseudo-fullscreen {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    aspect-ratio: auto;
    border-radius: 0;
    background: #000;
    z-index: 2600;
}

.live-video-wrap.live-video-pseudo-fullscreen #live-video {
    object-fit: contain;
    background: #000;
}

.live-video-wrap.live-video-pseudo-fullscreen .live-video-watermark-item {
    font-size: 15px;
}

.live-pseudo-fullscreen-exit {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 5;
    display: none;
    background: rgba(8, 18, 30, 0.62);
    color: #eef4fb;
    border-color: rgba(196, 213, 231, 0.85);
}

.live-video-wrap.live-video-pseudo-fullscreen .live-pseudo-fullscreen-exit {
    display: inline-flex;
}

.live-video-wrap:fullscreen,
.live-video-wrap:-webkit-full-screen,
.live-video-wrap:-ms-fullscreen {
    border-radius: 0;
    background: #000;
}

.live-video-wrap:fullscreen #live-video,
.live-video-wrap:-webkit-full-screen #live-video,
.live-video-wrap:-ms-fullscreen #live-video {
    object-fit: contain;
    background: #000;
}

#btn-live-fullscreen {
    min-width: 78px;
}

#btn-live-mirror {
    min-width: 92px;
}

#live-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #0e1a25;
    transform-origin: center center;
    -webkit-transform-origin: center center;
    will-change: transform;
}

#live-video:fullscreen,
#live-video:-webkit-full-screen,
#live-video:-ms-fullscreen {
    object-fit: contain;
    background: #000;
}

#live-video.live-video-mirrored,
#live-video.live-video-mirrored:fullscreen,
#live-video.live-video-mirrored:-webkit-full-screen,
#live-video.live-video-mirrored:-ms-fullscreen {
    transform: scaleX(-1) !important;
    -webkit-transform: scaleX(-1) !important;
}

.live-video-wrap.live-video-mirrored #live-video,
.live-video-wrap.live-video-mirrored:fullscreen #live-video,
.live-video-wrap.live-video-mirrored:-webkit-full-screen #live-video,
.live-video-wrap.live-video-mirrored:-ms-fullscreen #live-video {
    transform: scaleX(-1) !important;
    -webkit-transform: scaleX(-1) !important;
}

.live-video-watermark-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    align-items: center;
    justify-items: center;
    padding: 10px;
    z-index: 2;
}

.live-video-watermark-item {
    opacity: 0.22;
    color: #f7fbff;
    font-size: 12px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
    white-space: nowrap;
    transform: rotate(-18deg);
    user-select: none;
}

.live-video-wrap:fullscreen .live-video-watermark-item,
.live-video-wrap:-webkit-full-screen .live-video-watermark-item,
.live-video-wrap:-ms-fullscreen .live-video-watermark-item {
    font-size: 15px;
}

.live-video-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #d7e1ea;
    font-size: 14px;
    padding: 0 20px;
    z-index: 3;
}

.live-video-actions {
    margin-top: 8px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.live-quick-notify {
    margin-top: 10px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 8px;
    border: 1px solid #e3ebf5;
    border-radius: 8px;
    background: #f8fbff;
}

.live-quick-notify input {
    height: 36px;
    min-width: 0;
    border-radius: 6px;
    background: #fff;
}

.live-quick-notify-result {
    grid-column: 1 / -1;
    font-size: 12px;
    line-height: 1.5;
}

.live-quick-notify-result.success {
    color: #237d3c;
}

.live-quick-notify-result.error {
    color: var(--error);
}

.live-settings-wrap {
    position: relative;
    display: inline-flex;
}

#btn-live-settings.active {
    background: rgba(25,118,210,0.08);
}

.live-settings-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 30;
    width: 320px;
    padding: 12px;
    border: 1px solid #d9e5f2;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(24, 55, 87, 0.16);
}

.live-settings-row {
    display: grid;
    gap: 6px;
    margin-bottom: 12px;
    min-width: 0;
}

.live-settings-row:last-child {
    margin-bottom: 0;
}

.live-settings-row label {
    font-size: 12px;
    font-weight: 700;
    color: #52697f;
}

.live-settings-row select {
    width: 100%;
    min-width: 0;
}

.live-settings-toggle {
    appearance: none;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 12px 0;
    padding: 9px 10px;
    border: 1px solid #dbe6f2;
    border-radius: 8px;
    background: #f7fbff;
    color: #24435f;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.live-settings-toggle:hover {
    border-color: #b9d2eb;
    background: #eef7ff;
}

.live-settings-toggle:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

.live-settings-toggle.active {
    border-color: #93c5fd;
    background: #eaf4ff;
}

.live-settings-toggle-state {
    flex-shrink: 0;
    color: #1976D2;
    font-size: 12px;
}

.live-mode-hint {
    margin-top: 4px;
    font-size: 12px;
    color: #6f8092;
}

.live-snapshot-panel {
    margin-top: 14px;
    border-top: 1px solid #edf2f8;
    padding-top: 12px;
}

.live-snapshot-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
}

.live-snapshot-title {
    font-size: 14px;
    font-weight: 700;
    color: #1f3347;
}

.live-snapshot-subtitle {
    margin-top: 2px;
    font-size: 12px;
    color: #6d7f91;
}

.live-snapshot-disabled-note {
    margin-top: 10px;
    padding: 8px 10px;
    border: 1px solid #f3d08a;
    border-radius: 6px;
    background: #fff8e7;
    color: #7a4f00;
    font-size: 13px;
    line-height: 1.5;
}

.live-snapshot-config-row {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

#live-snapshot-time-input {
    width: 124px;
}

.live-snapshot-times {
    margin-top: 10px;
    min-height: 34px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.live-snapshot-time-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid #d5e2f0;
    background: #f5f9ff;
    color: #28435e;
    font-size: 12px;
}

.live-snapshot-time-chip button {
    border: none;
    background: transparent;
    cursor: pointer;
    color: #8c4a4a;
    font-size: 12px;
    padding: 0;
}

.live-snapshot-empty {
    font-size: 12px;
    color: #8093a8;
}

.live-snapshot-email-box {
    margin-top: 10px;
    display: grid;
    gap: 8px;
    max-width: 560px;
}

.live-snapshot-email-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #314a63;
    font-weight: 600;
}

#live-snapshot-email-recipients {
    width: 100%;
    min-height: 74px;
    resize: vertical;
    border: 1px solid #d6e2ee;
    border-radius: 8px;
    padding: 8px 10px;
    font: inherit;
    font-size: 13px;
    color: #263d53;
    background: #fbfdff;
}

#live-snapshot-email-recipients:disabled {
    background: #f2f5f8;
    color: #8a9aab;
}

.live-snapshot-email-hint {
    font-size: 12px;
    color: #6d7f91;
    line-height: 1.45;
}

.live-snapshot-records-wrap {
    margin-top: 12px;
}

.live-snapshot-records-title {
    font-size: 13px;
    color: #334b63;
    font-weight: 600;
    margin-bottom: 8px;
}

.live-snapshot-records {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.live-snapshot-record-item {
    border: 1px solid #e1eaf4;
    border-radius: 8px;
    padding: 8px;
    background: #fbfdff;
}

.live-snapshot-record-thumb {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 6px;
    object-fit: cover;
    background: #0f1a24;
    display: block;
}

.live-snapshot-record-meta {
    margin-top: 6px;
    font-size: 11px;
    color: #5f758d;
    line-height: 1.4;
}

.live-snapshot-record-actions {
    margin-top: 6px;
    display: flex;
    justify-content: flex-end;
}

#live-snapshot-viewer-overlay {
    z-index: 2200;
}

#snapshot-viewer-overlay {
    z-index: 2200;
}

.live-snapshot-viewer-card {
    width: min(1100px, 96vw);
    max-height: 92vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 14px 52px rgba(0, 0, 0, 0.24);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.live-snapshot-viewer-card.snapshot-pseudo-fullscreen {
    position: fixed;
    inset: 0;
    width: 100vw;
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
    background: #000;
    z-index: 2305;
}

.live-snapshot-viewer-card.snapshot-pseudo-fullscreen .live-snapshot-viewer-title,
.live-snapshot-viewer-card.snapshot-pseudo-fullscreen .live-snapshot-viewer-meta {
    color: #e7eef6;
}

.live-snapshot-viewer-card.snapshot-pseudo-fullscreen .live-snapshot-viewer-stage {
    flex: 1;
    min-height: 0;
    border: none;
    border-radius: 0;
    background: #000;
}

.live-snapshot-viewer-card.snapshot-pseudo-fullscreen .live-snapshot-viewer-image {
    max-height: 100%;
}

.live-snapshot-viewer-card.snapshot-pseudo-fullscreen .live-snapshot-watermark-item {
    font-size: 15px;
}

.live-snapshot-viewer-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.live-snapshot-viewer-title {
    font-size: 16px;
    font-weight: 700;
    color: #20354a;
}

.live-snapshot-viewer-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.live-snapshot-viewer-meta {
    font-size: 12px;
    color: #5c7288;
    line-height: 1.5;
}

.live-snapshot-viewer-stage {
    position: relative;
    border: 1px solid #d6e3f0;
    border-radius: 8px;
    background: #08131d;
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.live-snapshot-viewer-image {
    width: 100%;
    max-height: 72vh;
    object-fit: contain;
    transition: transform 0.2s ease;
    transform-origin: center center;
    -webkit-transform-origin: center center;
    will-change: transform;
    -webkit-user-drag: none;
    user-select: none;
}

.live-snapshot-viewer-image.mirrored {
    transform: scaleX(-1);
}

.live-snapshot-watermark-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    align-items: center;
    justify-items: center;
    padding: 10px;
}

.live-snapshot-watermark-item {
    opacity: 0.22;
    color: #f7fbff;
    font-size: 12px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
    white-space: nowrap;
    transform: rotate(-18deg);
    user-select: none;
}

.live-snapshot-viewer-stage:fullscreen,
.live-snapshot-viewer-stage:-webkit-full-screen,
.live-snapshot-viewer-stage:-ms-fullscreen {
    border-radius: 0;
    border: none;
    background: #000;
}

.live-snapshot-viewer-stage:fullscreen .live-snapshot-viewer-image,
.live-snapshot-viewer-stage:-webkit-full-screen .live-snapshot-viewer-image,
.live-snapshot-viewer-stage:-ms-fullscreen .live-snapshot-viewer-image {
    max-height: 100vh;
}

.live-snapshot-viewer-stage:fullscreen .live-snapshot-watermark-item,
.live-snapshot-viewer-stage:-webkit-full-screen .live-snapshot-watermark-item,
.live-snapshot-viewer-stage:-ms-fullscreen .live-snapshot-watermark-item {
    font-size: 15px;
}

/* ── KaTeX 公式渲染 ─────────────────── */
.history-content .katex-display {
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
    padding: 4px 0;
}

.history-content .katex-display > .katex {
    max-width: 100%;
    white-space: normal;
}

.history-content .katex {
    font-size: 1.05em;
    word-break: normal;
    overflow-wrap: normal;
}

/* 移动端：block 公式可横向滚动，同时限制最大字号 */
@media (max-width: 768px) {
    .history-content .katex-display {
        padding: 2px 0;
        -webkit-overflow-scrolling: touch;
    }
    .history-content .katex-display > .katex {
        font-size: 0.95em;
    }
    .history-content {
        word-break: break-word;
    }
}

@media (max-width: 480px) {
    .history-content .katex-display > .katex {
        font-size: 0.88em;
    }
    .history-content .katex {
        font-size: 0.95em;
    }
}

/* ── 响应式 ───────────────────────── */

/* ====== 平板及以下 (<= 768px) ====== */
@media (max-width: 768px) {
    /* 汉堡菜单可见 */
    .hamburger { display: block; }

    /* 顶部导航：简洁的标题栏 */
    .top-nav {
        flex-wrap: nowrap;
        height: 48px;
        padding: 0 12px;
    }

    .teacher-warning-banner-inner {
        font-size: 13px;
        padding: 8px 0;
    }

    .teacher-info-banner-inner {
        font-size: 13px;
        padding: 8px 0;
    }

    .teacher-warning-close {
        width: 22px;
        height: 22px;
        font-size: 17px;
    }

    .teacher-info-close {
        width: 22px;
        height: 22px;
        font-size: 17px;
    }

    .nav-left {
        flex: 0 0 auto;
    }
    .nav-title { display: none; }

    /* 隐藏顶部水平 Tab，改用侧边栏 */
    .nav-tabs {
        display: none !important;
    }

    /* 右侧用户信息/退出按钮 */
    .nav-right {
        margin-left: auto;
        flex-shrink: 0;
    }
    .user-info { display: none; }
    .nav-right .btn-outline { display: none; }
    .classroom-install-nav-btn { display: none !important; }
    .classroom-install-sidebar-btn {
        display: flex;
    }
    .classroom-install-divider {
        display: block;
    }

    /* 内容区 */
    .container { padding: 0 12px; }
    .card { padding: 16px; }
    .card h2 { font-size: 16px; }
    .tab-content { padding: 16px 0; }

    /* 表单 */
    .form-row,
    .form-row-responsive {
        flex-direction: column;
    }
    .form-row-responsive > * {
        width: 100% !important;
        min-width: 0 !important;
        flex: 0 1 auto !important;
    }
    .label-hidden-mobile { display: none; }
    .btn-block-mobile { width: 100%; }

    .notify-image-name {
        max-width: calc(100vw - 170px);
    }

    .notify-schedule-fields {
        max-width: none;
    }

    .notify-date-options {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .notify-time-picker {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        width: 100%;
    }

    .notify-time-unit {
        grid-template-columns: 32px minmax(38px, 1fr) 32px;
    }

    .notify-time-input {
        width: 100% !important;
    }

    .login-card { padding: 28px 20px; }

    /* 教室/用户列表项 */
    .classroom-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .classroom-actions {
        width: 100%;
        justify-content: flex-end;
    }

    /* 通知历史元数据换行 */
    .history-meta {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* 课程时间表行 */
    .schedule-period {
        flex-wrap: wrap;
        gap: 8px;
    }
    .schedule-period input[type="text"] { flex: 1; min-width: 80px; width: auto; }
    .schedule-period input[type="time"] { flex: 0 0 auto; width: 110px; }

    /* 卡片头部按钮 */
    .card-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* 远程输出框 */
    .remote-output-box {
        font-size: 11px;
        padding: 12px;
        max-height: 300px;
    }

    .live-layout {
        grid-template-columns: 1fr;
    }

    .live-room-panel {
        min-height: 0;
        max-height: 220px;
    }

    .live-video-actions {
        justify-content: flex-start;
    }

    .live-quick-notify {
        grid-template-columns: 1fr;
    }

    .live-quick-notify .btn {
        width: 100%;
    }

    .live-settings-wrap {
        width: 100%;
    }

    #btn-live-settings {
        width: 100%;
    }

    .live-settings-menu {
        left: 0;
        right: auto;
        width: 100%;
    }

    .live-video-watermark-layer {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: repeat(2, minmax(0, 1fr));
    }

    .live-snapshot-records {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .live-snapshot-viewer-card {
        width: 96vw;
        max-height: 94vh;
        padding: 10px;
    }

    .live-snapshot-viewer-stage {
        min-height: 260px;
    }

    .live-snapshot-watermark-layer {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: repeat(2, minmax(0, 1fr));
    }

    /* 移动端删除按钮始终可见 */
    .btn-text-delete { opacity: 1; }

    /* Toast 移动端居中 */
    #toast-container {
        right: 8px;
        left: 8px;
        max-width: none;
    }
}

/* ====== 小屏手机 (<= 480px) ====== */
@media (max-width: 480px) {
    .login-card {
        padding: 24px 16px;
        border-radius: 8px;
    }
    .login-header .logo { font-size: 40px; }
    .login-header h1 { font-size: 18px; }

    .btn-lg { padding: 12px 24px; font-size: 14px; }

    .card { padding: 14px; margin-bottom: 14px; }

    /* 所有按钮增大触摸热区 */
    .btn-sm { min-height: 36px; padding: 8px 14px; }
    .btn { min-height: 44px; }

    .modal-card { padding: 20px 16px; }

    .account-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    .account-label { width: auto; }

    .snapshot-access-item {
        flex-direction: column;
        align-items: stretch;
    }

    .snapshot-access-actions {
        justify-content: flex-start;
    }

    .snapshot-access-expiry-options {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .snapshot-access-expiry-option {
        padding-left: 4px;
        padding-right: 4px;
    }

    .snapshot-access-expiry-option span {
        padding-left: 4px;
        padding-right: 4px;
    }

    .snapshot-access-result {
        flex-direction: column;
        align-items: stretch;
    }

    .snapshot-public-login {
        padding: 16px;
    }

    .snapshot-public-topbar {
        align-items: flex-start;
        flex-direction: column;
        padding: 14px 16px;
    }

    .live-snapshot-records {
        grid-template-columns: 1fr;
    }

    .live-snapshot-viewer-meta {
        font-size: 11px;
    }

    .live-snapshot-viewer-tools {
        width: 100%;
        justify-content: flex-start;
    }

    .live-snapshot-watermark-item {
        font-size: 10px;
    }

    .live-video-watermark-item {
        font-size: 10px;
    }
}
