/* 三端（教师/家长）共用移动外壳样式：p- 前缀组件类。
   设计 token（:root 颜色/圆角）已拆到 tokens.css，由各端 base 在本文件之前引入；
   端内主题差异（教师端绿色主色等）由本端增量 CSS 覆盖同名变量。 */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
    margin: 0; padding: 0;
    background: var(--p-bg);
    color: var(--p-text);
    font-size: 15px;
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
}

[v-cloak] { display: none; }

a { color: inherit; text-decoration: none; }

/* ---------- 布局 ---------- */
/* 底部 76px 是给固定底栏（见 static/common/css/tabbar.css）留的避让区 */
.p-page { max-width: 640px; margin: 0 auto; padding: 12px 12px 76px; }
/* 带顶栏的子页把顶距交给顶栏：否则 sticky 顶栏上方会露出一条灰色滚动缝 */
.p-page:has(> .p-topbar) { padding-top: 0; }

.p-header { padding: 16px 4px 10px; display: flex; align-items: baseline; gap: 8px; }
.p-header-title { margin: 0; font-size: 19px; font-weight: 700; }
.p-header-sub { font-size: 12px; color: var(--p-text-sub); }
.p-header-right { margin-left: auto; font-size: 13px; color: var(--p-text-sub); }

/* ---------- 卡片 ---------- */
.p-card {
    background: var(--p-card);
    border-radius: var(--p-radius);
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(34, 41, 58, .05);
}
.p-card-title { margin: 0 0 10px; font-size: 15px; font-weight: 700; display: flex; align-items: center; }
.p-card-title .more { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--p-primary); }
.p-empty { text-align: center; color: var(--p-text-sub); font-size: 13px; padding: 22px 0; }
.p-center { text-align: center; }

/* ---------- 待办卡样式已迁至 common/css/todo.css（三端共用，管理端不加载本文件） ---------- */

/* ---------- 表单 ---------- */
.p-field { margin-bottom: 14px; }
.p-field label { display: block; font-size: 13px; color: var(--p-text-sub); margin-bottom: 6px; }
.p-input, .p-select, .p-textarea {
    width: 100%;
    border: 1px solid var(--p-border);
    border-radius: 10px;
    padding: 11px 12px;
    font-size: 15px;
    background: #fbfcfe;
    color: var(--p-text);
    outline: none;
}
.p-input:focus, .p-select:focus, .p-textarea:focus { border-color: var(--p-primary); background: #fff; }
.p-textarea { min-height: 88px; resize: vertical; }

.p-btn {
    display: inline-block;
    border: none;
    border-radius: 10px;
    padding: 11px 18px;
    font-size: 15px;
    background: #eef1f7;
    color: var(--p-text);
    cursor: pointer;
}
.p-btn:disabled { opacity: .55; cursor: not-allowed; }
.p-btn-primary { background: var(--p-primary); color: #fff; }
.p-btn-danger { background: rgba(255, 77, 79, .1); color: var(--p-danger); }
.p-btn-block { display: block; width: 100%; text-align: center; }
.p-btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }

/* 底部标签栏见 static/common/css/tabbar.css（三端共用一份，不在本文件里） */

/* ---------- 孩子切换 ---------- */
.p-children { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.p-child-pill {
    border: 1px solid var(--p-border);
    background: #fff;
    color: var(--p-text-sub);
    border-radius: 999px;
    padding: 6px 16px;
    font-size: 14px;
    cursor: pointer;
}
.p-child-pill.active { background: var(--p-primary); border-color: var(--p-primary); color: #fff; font-weight: 600; }

/* ---------- 状态标签 ---------- */
.p-tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; }
.p-tag-green { background: rgba(52, 168, 83, .12); color: var(--p-success); }
.p-tag-yellow { background: rgba(232, 145, 45, .14); color: var(--p-warning); }
.p-tag-red { background: rgba(255, 77, 79, .1); color: var(--p-danger); }
.p-tag-gray { background: #eef1f7; color: var(--p-text-sub); }
.p-tag-blue { background: var(--p-primary-light); color: var(--p-primary); }

/* ---------- 登录/注册 ---------- */
.p-auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.p-auth-card { width: 100%; max-width: 380px; background: #fff; border-radius: 16px; padding: 26px 22px; box-shadow: 0 2px 12px rgba(34,41,58,.08); }
.p-auth-title { text-align: center; font-size: 20px; font-weight: 700; margin: 0 0 4px; }
.p-auth-sub { text-align: center; font-size: 13px; color: var(--p-text-sub); margin: 0 0 22px; }
.p-auth-links { display: flex; justify-content: space-between; font-size: 13px; margin-top: 14px; color: var(--p-text-sub); }
.p-auth-links a { color: var(--p-primary); }
/* 紧跟密码框的一行：负上边距压掉 .p-field 自身那 14px，视觉上贴着密码输入框 */
.p-auth-remember { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--p-text-sub); margin: -6px 0 14px; }
.p-auth-remember input { width: 15px; height: 15px; flex: none; }

/* 「忘记密码」弹层：遮罩压过 tabbar(50)、留在 toast(999) 之下，登录提示仍能盖在弹层上。
   不写 inset 简写：本文件通篇用四边定位，旧 WebView 也不认 inset。 */
.p-modal-mask { position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: rgba(16,24,40,.55); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 200; }
.p-modal { width: 100%; max-width: 320px; max-height: calc(100vh - 40px); overflow-y: auto; background: #fff; border-radius: 14px; padding: 20px; text-align: center; }
.p-modal-title { font-size: 16px; font-weight: 600; margin: 0 0 14px; }
.p-modal-img { width: 100%; max-width: 260px; border-radius: 8px; }
.p-modal-tip { font-size: 12px; color: var(--p-text-sub); line-height: 1.5; margin: 10px 0 16px; }

/* ---------- 课表 ---------- */
.p-daytabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; padding-bottom: 2px; }
.p-daytab {
    flex: 0 0 auto;
    border: 1px solid var(--p-border);
    background: #fff;
    color: var(--p-text-sub);
    border-radius: 10px;
    padding: 7px 13px;
    font-size: 13px;
    cursor: pointer;
}
.p-daytab.active { background: var(--p-primary); border-color: var(--p-primary); color: #fff; font-weight: 600; }
.p-course { display: flex; align-items: center; padding: 11px 2px; border-bottom: 1px solid var(--p-border); }
.p-course:last-child { border-bottom: none; }
.p-course-time { flex: 0 0 82px; font-size: 12px; color: var(--p-text-sub); line-height: 1.4; }
.p-course-name { flex: 1; font-weight: 600; }
.p-course-meta { font-size: 12px; color: var(--p-text-sub); margin-top: 2px; }

/* ---------- 考勤 ---------- */
.p-stat-row { display: flex; gap: 10px; margin-bottom: 12px; }
.p-stat {
    flex: 1;
    background: #fff;
    border-radius: var(--p-radius);
    padding: 12px 6px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(34,41,58,.05);
}
.p-stat-value { font-size: 20px; font-weight: 700; }
.p-stat-label { font-size: 12px; color: var(--p-text-sub); margin-top: 2px; }
.p-stat-value.green { color: var(--p-success); }
.p-stat-value.yellow { color: var(--p-warning); }
.p-stat-value.red { color: var(--p-danger); }

.p-month-nav { display: flex; align-items: center; justify-content: center; gap: 18px; margin-bottom: 10px; }
.p-month-nav button { border: none; background: #fff; border-radius: 8px; padding: 6px 14px; font-size: 15px; box-shadow: 0 1px 4px rgba(34,41,58,.05); cursor: pointer; }
.p-month-nav .month { font-size: 16px; font-weight: 700; }

.p-att-day { display: flex; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--p-border); }
.p-att-day:last-child { border-bottom: none; }
.p-att-date { flex: 0 0 92px; font-size: 13px; }
.p-att-date .week { color: var(--p-text-sub); font-size: 12px; margin-left: 4px; }
.p-att-slots { flex: 1; display: flex; gap: 6px; flex-wrap: wrap; }
.p-slot { font-size: 12px; border-radius: 8px; padding: 4px 9px; line-height: 1.4; }
.p-slot.normal { background: rgba(52,168,83,.1); color: var(--p-success); }
.p-slot.late { background: rgba(232,145,45,.12); color: var(--p-warning); }
.p-slot.absent { background: rgba(255,77,79,.1); color: var(--p-danger); }

/* ---------- 留言 ---------- */
.p-msg { padding: 10px 0; border-bottom: 1px solid var(--p-border); }
.p-msg:last-child { border-bottom: none; }
.p-msg-top { display: flex; font-size: 12px; color: var(--p-text-sub); margin-bottom: 4px; }
.p-msg-top .read { margin-left: auto; }
.p-msg-content { font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-break: break-all; }

/* ---------- 通知/考试 ---------- */
.p-notice { padding: 12px 0; border-bottom: 1px solid var(--p-border); }
.p-notice:last-child { border-bottom: none; }
.p-notice-title { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.p-notice-title .p-tag { flex: 0 0 auto; }
.p-notice-body { font-size: 13px; color: var(--p-text); line-height: 1.65; margin-top: 6px; white-space: pre-wrap; word-break: break-all; }
.p-notice-time { font-size: 12px; color: var(--p-text-sub); margin-top: 6px; }
.p-card-emergency { border-left: 4px solid var(--p-danger); }

/* ---------- 我的 ---------- */
.p-mine-user { display: flex; align-items: center; gap: 12px; }
.p-mine-avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--p-primary-light); color: var(--p-primary); display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; }
.p-mine-name { font-size: 16px; font-weight: 700; }
.p-mine-phone { font-size: 12px; color: var(--p-text-sub); margin-top: 2px; }
.p-child { display: flex; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--p-border); }
.p-child:last-child { border-bottom: none; }
.p-child-main { flex: 1; }
.p-child-name { font-weight: 600; }
.p-child-meta { font-size: 12px; color: var(--p-text-sub); margin-top: 2px; }
.p-entry { display: flex; align-items: center; padding: 13px 2px; border-bottom: 1px solid var(--p-border); font-size: 15px; }
.p-entry:last-child { border-bottom: none; }
.p-entry .arrow { margin-left: auto; color: var(--p-text-sub); }
.p-entry-icon { width: 26px; height: 26px; border-radius: 8px; background: var(--p-primary-light); color: var(--p-primary); display: inline-flex; align-items: center; justify-content: center; font-size: 14px; margin-right: 10px; }
.p-entry-icon svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- toast ---------- */
.p-toast {
    position: fixed;
    left: 50%;
    bottom: 90px;
    transform: translateX(-50%);
    background: rgba(34, 41, 58, .88);
    color: #fff;
    font-size: 14px;
    padding: 10px 18px;
    border-radius: 10px;
    z-index: 999;
    max-width: 82vw;
    text-align: center;
}

/* ---------- 首页概览 ---------- */
.p-home-hello { font-size: 13px; color: var(--p-text-sub); }
.p-home-big { font-size: 20px; font-weight: 700; margin: 2px 0 10px; }
.p-today-course { display: flex; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--p-border); font-size: 14px; }
.p-today-course:last-child { border-bottom: none; }
.p-today-course .time { flex: 0 0 100px; color: var(--p-text-sub); font-size: 12px; }
.p-today-course .name { flex: 1; font-weight: 600; }
.p-home-grid { display: flex; gap: 10px; }
.p-home-entry {
    flex: 1;
    background: #fff;
    border-radius: var(--p-radius);
    text-align: center;
    padding: 14px 4px 12px;
    box-shadow: 0 1px 4px rgba(34,41,58,.05);
    font-size: 13px;
    color: var(--p-text);
}
.p-home-entry .ico { display: block; font-size: 22px; margin-bottom: 4px; }
/* SVG 图标（替代 emoji）：图标池由 static/common/js/icons.js 注入，<use href="#i-名"> 引用 */
.p-ico, .p-home-entry .ico svg {
    display: inline-block;
    width: 22px; height: 22px;
    fill: none; stroke: currentColor;
    stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
    vertical-align: -5px;
}
.p-home-entry .ico svg { display: block; margin: 0 auto 5px; vertical-align: 0; width: 24px; height: 24px; }

/* ---------- 统一页顶栏（子页返回导航） ---------- */
.p-topbar {
    position: sticky; top: 0; z-index: 40;
    display: flex; align-items: center; gap: 4px;
    padding: 10px 12px;
    padding-top: calc(10px + env(safe-area-inset-top, 0));
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--p-border);
}
.p-topbar-back {
    flex: 0 0 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    margin-left: -6px;
    border-radius: 10px;
    color: var(--p-text);
}
.p-topbar-back:active { background: var(--p-primary-light); }
.p-topbar-back svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.p-topbar-title { font-size: 16px; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-topbar-right { margin-left: auto; font-size: 13px; color: var(--p-text-sub); display: flex; align-items: center; gap: 8px; }
.p-topbar-right a, .p-topbar-right button { color: var(--p-primary); }
/* 顶栏与 p-page 的 12px 顶距衔接：带顶栏的页面请把 p-page 顶距交给顶栏（见 _pageheader.html 说明） */

/* ---------- 骨架屏（加载态） ---------- */
/* .p-skel 是独立色块；.p-skel-line/-stat/-avatar 是尺寸条目，自身也带底色+扫光，
   方便直接散放在卡片里（不必包一层 .p-skel） */
.p-skel, .p-skel-line, .p-skel-stat, .p-skel-avatar {
    position: relative;
    overflow: hidden;
    background: #eceff5;
    border-radius: 8px;
}
.p-skel::after, .p-skel-line::after, .p-skel-stat::after, .p-skel-avatar::after {
    content: '';
    position: absolute; top: 0; right: 0; bottom: 0; left: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .65), transparent);
    animation: p-skel-sweep 1.2s infinite;
}
@keyframes p-skel-sweep { to { transform: translateX(100%); } }
.p-skel-line { height: 14px; margin-bottom: 10px; }
.p-skel-line.w40 { width: 40%; }
.p-skel-line.w60 { width: 60%; }
.p-skel-line.w80 { width: 80%; }
.p-skel-stat { flex: 1; height: 64px; border-radius: var(--p-radius); }
.p-skel-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.p-skel-avatar { flex: 0 0 40px; height: 40px; border-radius: 50%; }
/* 尊重系统减弱动态效果设置 */
@media (prefers-reduced-motion: reduce) {
    .p-skel::after, .p-skel-line::after, .p-skel-stat::after, .p-skel-avatar::after { animation: none; }
}

/* ---------- 空态（图标 + 主文案 + 引导） ---------- */
.p-emptybox { text-align: center; padding: 34px 16px 30px; }
.p-emptybox-ico {
    width: 52px; height: 52px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: var(--p-primary-light);
    color: var(--p-primary);
    display: flex; align-items: center; justify-content: center;
}
.p-emptybox-ico svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.p-emptybox-main { font-size: 14px; color: var(--p-text); font-weight: 600; }
.p-emptybox-sub { font-size: 12px; color: var(--p-text-sub); margin-top: 4px; }
.p-emptybox .p-btn-sm { margin-top: 14px; }

/* ---------- toast 分型 ---------- */
.p-toast.p-toast-success { background: rgba(52, 168, 83, .92); }
.p-toast.p-toast-error { background: rgba(255, 77, 79, .92); }
