/* 在线版课堂积分 · P0 基础样式
   浅色主题；大屏触屏优先，所有可点元素热区不低于 44px。
   P1 接气泡/榜单时在此扩展，不要引入外部 CDN（全站 CSP 只允许 'self'）。 */

:root {
    --bg: #f4f6fb;
    --surface: #ffffff;
    --line: #e5eaf2;
    --text: #1f2733;
    --muted: #6b7688;
    --primary: #3b7cff;
    --primary-soft: #eef4ff;
    --primary-line: #cddfff;
    --danger: #c0392b;
    --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
}

.container {
    max-width: 860px;
    margin: 0 auto;
    padding: 20px 16px 48px;
}

.login-container {
    max-width: 420px;
    padding-top: 8vh;
}

/* ---------- 品牌区（登录页） ---------- */
.brand { text-align: center; margin-bottom: 24px; }

.brand-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 12px;
    border-radius: 18px;
    background: linear-gradient(135deg, #3b7cff, #6f5bff);
    color: #fff;
    font-size: 30px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(59, 124, 255, .28);
}

.brand h1 { margin: 0; font-size: 24px; letter-spacing: .5px; }
.brand-sub { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

/* ---------- 卡片 ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 12px rgba(31, 39, 51, .04);
}

.card h2 { margin: 0 0 14px; font-size: 18px; }

.alert {
    background: var(--primary-soft);
    border: 1px solid var(--primary-line);
    color: #24509b;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 14px;
}

/* ---------- 表单 ---------- */
.field-label {
    display: block;
    font-size: 14px;
    color: #5a6577;
    margin: 8px 0 6px;
}

.input {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    margin-bottom: 12px;
    border: 1px solid #d6deea;
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    font-size: 16px;          /* iOS 聚焦时不缩放 */
    font-family: inherit;
}

.input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 124, 255, .15);
}

.btn {
    min-height: 48px;
    padding: 10px 18px;
    border: 1px solid #d6deea;
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    font-size: 16px;
    font-family: inherit;
    cursor: pointer;
}

.btn:hover { background: #f7f9fd; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
}

.btn-primary:hover { background: #2f6bff; }
.btn-block { width: 100%; }

.hint { color: var(--muted); font-size: 13px; margin: 8px 0; }
.center { text-align: center; }
.form-msg { min-height: 20px; color: var(--danger); font-size: 14px; margin: 8px 0 0; }

/* ---------- 顶栏 ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    height: 56px;
    padding: 0 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.topbar-spacer { width: 72px; flex: none; }

.topbar-title {
    flex: 1;
    text-align: center;
    font-size: 17px;
    font-weight: 600;
}

.topbar-back, .topbar-action {
    min-height: 44px;
    min-width: 72px;
    border: none;
    background: transparent;
    color: var(--primary);
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
}

.topbar-back { text-align: left; }
.topbar-action { text-align: right; }

/* ---------- 键值行 ---------- */
.kv {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f3f8;
    font-size: 15px;
}

.kv:last-child { border-bottom: none; }
.kv span { color: var(--muted); flex: none; }
.kv b { font-weight: 600; word-break: break-all; text-align: right; }

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    left: 50%;
    bottom: 32px;
    transform: translate(-50%, 16px);
    min-width: 180px;
    max-width: 80vw;
    padding: 12px 20px;
    border-radius: 10px;
    background: #1f2733;
    color: #fff;
    text-align: center;
    font-size: 15px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
    z-index: 100;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 页脚提示（仅主壳使用） ---------- */
.privacy-notice {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    padding: 5px 12px;
    text-align: center;
    font-size: 12px;
    line-height: 1.5;
    color: var(--muted);
    background: rgba(255, 255, 255, .9);
    border-top: 1px solid var(--line);
    pointer-events: none;
}

/* ---------- P1：班级管理与大屏 ---------- */
.container.wide { max-width: 1180px; }

.row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; align-items: center; }
.row .btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }

.card h3 { margin: 18px 0 8px; font-size: 15px; color: var(--muted); }

.btn.mini {
    min-height: 36px;
    padding: 4px 10px;
    margin-left: 8px;
    font-size: 13px;
}

.ok { color: #1a7f45; }
.bad { color: var(--danger); }
.alert.danger {
    background: #fff1f0;
    border-color: #ffcdc7;
    color: #a8322a;
}

.class-entry {
    width: 100%;
    border: none;
    border-bottom: 1px solid #f0f3f8;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
    min-height: 52px;
}
.class-entry:hover { background: #f7f9fd; }
.class-entry b { color: var(--primary); }

.lesson-state {
    font-size: 20px;
    font-weight: 600;
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 14px;
}
.lesson-state.live { background: #e8f7ee; color: #1a7f45; }
.lesson-state.off  { background: #f1f3f7; color: var(--muted); }

.task-bar { display: flex; flex-wrap: wrap; gap: 10px; }
.task-chip {
    min-height: 48px;
    padding: 8px 16px;
    border: 1px solid #d6deea;
    border-radius: 24px;
    background: #fff;
    color: var(--text);
    font: inherit;
    cursor: pointer;
}
.task-chip b { color: var(--primary); }
.task-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.task-chip.active b { color: #fff; }

.bubble-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.bubble {
    min-height: 96px;              /* 触屏热区远大于 44px */
    border: 1px solid var(--primary-line);
    border-radius: 18px;
    background: linear-gradient(160deg, #ffffff, var(--primary-soft));
    color: var(--text);
    font: inherit;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    box-shadow: 0 3px 10px rgba(59, 124, 255, .10);
    transition: transform .12s ease, box-shadow .12s ease;
}
.bubble:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(59, 124, 255, .20); }
.bubble:active { transform: scale(.96); }
.bubble:disabled { opacity: .55; cursor: wait; }
.bubble-name { font-size: 19px; font-weight: 600; word-break: break-all; }
.bubble-group { font-size: 12px; color: var(--muted); }

@media (min-width: 900px) {
    .container { padding-top: 28px; }
    .bubble-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .bubble { min-height: 112px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
