/* 托管看板 —— 苹果 App 质感 · 绿色玻璃 */
:root {
    --brand: #2f8f63;
    --brand-deep: #1f6b49;
    --brand-soft: #e3f4ea;
    --ink: #22303a;
    --ink-soft: #5c6f7a;
    --card: rgba(255, 255, 255, 0.78);
    --line: rgba(47, 143, 99, 0.16);
    --radius: 22px;
    --shadow: 0 12px 30px rgba(31, 107, 73, 0.12);
    --danger: #c0392b;
    --danger-soft: #fdeceb;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: "Noto Sans SC", -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(1100px 640px at 8% -10%, #f7fcf9 0%, rgba(247, 252, 249, 0) 60%),
        radial-gradient(760px 520px at 102% 6%, #dcf2e4 0%, rgba(220, 242, 228, 0) 55%),
        linear-gradient(160deg, #eef8f1, #d9f0e2 55%, #c9ead6 100%);
    background-attachment: fixed;
    min-height: 100vh;
}
a { text-decoration: none; color: inherit; }
.inline { display: inline; }
.tg-app { max-width: 1120px; margin: 0 auto; padding: 16px 16px 90px; }

/* ---------- 顶栏 ---------- */
.tg-header {
    position: sticky; top: 10px; z-index: 50;
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 12px 18px;
    border-radius: 24px;
    background: var(--card);
    backdrop-filter: blur(16px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow: var(--shadow);
}
.tg-title { display: flex; align-items: center; gap: 12px; }
.tg-seal {
    width: 46px; height: 46px; border-radius: 15px; flex: 0 0 46px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; font-weight: 900; color: #fff;
    background: linear-gradient(150deg, #57c48c, #2f8f63);
    box-shadow: 0 6px 14px rgba(47, 143, 99, 0.32);
}
.tg-title h1 { margin: 0; font-size: 19px; font-weight: 900; color: var(--brand-deep); letter-spacing: .4px; }
.tg-title p { margin: 2px 0 0; font-size: 12px; color: var(--ink-soft); }
.tg-user { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tg-chip {
    padding: 5px 13px; border-radius: 999px; font-size: 13px; font-weight: 700;
    background: var(--brand-soft); color: var(--brand-deep);
}

/* ---------- 按钮 ---------- */
.tg-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 8px 15px; border: 1px solid var(--line); border-radius: 13px;
    background: rgba(255, 255, 255, 0.9); color: var(--ink);
    font-size: 13px; font-weight: 700; cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.tg-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(47, 143, 99, 0.18); }
.tg-btn:active { transform: scale(.97); }
.tg-btn.primary {
    background: linear-gradient(150deg, #57c48c, #2f8f63); border-color: transparent; color: #fff;
    box-shadow: 0 6px 14px rgba(47, 143, 99, 0.28);
}
.tg-btn.ghost { background: transparent; border-color: rgba(47, 143, 99, 0.25); color: var(--brand-deep); }
.tg-btn.danger { background: var(--danger-soft); border-color: rgba(192, 57, 43, 0.25); color: var(--danger); }
.tg-btn.small { padding: 4px 10px; font-size: 12px; border-radius: 10px; }

/* ---------- 提示 ---------- */
.tg-msg, .tg-err {
    margin: 14px 0 0; padding: 11px 16px; border-radius: 14px; font-size: 13.5px; font-weight: 600;
    backdrop-filter: blur(10px);
}
.tg-msg { background: rgba(227, 244, 234, 0.95); color: var(--brand-deep); border: 1px solid rgba(47, 143, 99, 0.2); }
.tg-err { background: var(--danger-soft); color: var(--danger); border: 1px solid rgba(192, 57, 43, 0.2); }
.tg-toast {
    position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 3000;
    padding: 10px 18px; border-radius: 999px; font-size: 13.5px; font-weight: 700;
    background: rgba(255, 255, 255, 0.95); box-shadow: 0 10px 24px rgba(31, 107, 73, 0.25);
}
.tg-toast.on { color: var(--brand-deep); }
.tg-toast.error { color: var(--danger); }

/* ---------- 日期栏 ---------- */
.tg-datebar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 20px 0 6px; }
.tg-datepick { display: flex; align-items: baseline; gap: 8px; padding: 0 6px; }
.tg-date { font-size: 20px; font-weight: 900; color: var(--brand-deep); }
.tg-week { font-size: 13.5px; color: var(--ink-soft); font-weight: 600; }
.tg-tag { padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.tg-tag.warn { background: rgba(255, 193, 7, 0.18); color: #8a6d00; }
.tg-tag.off { background: rgba(120, 130, 138, 0.14); color: var(--ink-soft); }
.tg-tag.ok { background: rgba(47, 143, 99, 0.14); color: var(--brand-deep); }
.tg-tag.neutral { background: rgba(120, 130, 138, 0.14); color: var(--ink-soft); }
.tg-table tr.off td { opacity: 0.55; }

/* ---------- 分组 ---------- */
.tg-note {
    margin: 18px 0 0; padding: 16px 20px; border-radius: var(--radius);
    background: var(--card); backdrop-filter: blur(14px); border: 1px solid var(--line);
    font-size: 14px; color: var(--ink-soft);
}
.tg-group {
    margin: 16px 0 0; padding: 14px 16px; border-radius: var(--radius);
    background: var(--card); backdrop-filter: blur(14px); border: 1px solid var(--line);
    box-shadow: var(--shadow);
}
.tg-group.off { opacity: .72; }
.tg-group-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.tg-badge { padding: 5px 13px; border-radius: 999px; font-size: 13px; font-weight: 800; background: var(--brand-soft); color: var(--brand-deep); }
.tg-badge.picked { background: var(--danger-soft); color: var(--danger); }
.tg-badge.none { background: rgba(120, 130, 138, 0.12); color: var(--ink-soft); }
.tg-badge.notstarted { background: rgba(255, 193, 7, 0.16); color: #8a6d00; }
.tg-count { font-size: 12.5px; color: var(--ink-soft); font-weight: 600; }
.tg-class { font-size: 12px; color: var(--ink-soft); font-weight: 600; }

/* ---------- 学生卡片 ---------- */
.tg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; }
.tg-card {
    position: relative; display: flex; flex-direction: column; gap: 10px;
    padding: 13px 13px 11px; border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(47, 143, 99, 0.14);
    box-shadow: 0 6px 16px rgba(31, 107, 73, 0.08);
}
.tg-card.none { background: rgba(245, 247, 248, 0.92); }
.tg-card.notstarted { background: rgba(255, 250, 235, 0.95); border-color: rgba(255, 193, 7, 0.3); }
.tg-card.picked {
    background: linear-gradient(160deg, rgba(255, 235, 232, 0.98), rgba(255, 244, 242, 0.96));
    border-color: rgba(192, 57, 43, 0.35);
    box-shadow: 0 8px 18px rgba(192, 57, 43, 0.14);
}
.tg-card-main { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.tg-name { font-size: 15.5px; font-weight: 900; color: var(--ink); }
.tg-card.picked .tg-name { color: var(--danger); }
.tg-label { font-size: 12.5px; font-weight: 700; color: var(--brand-deep); }
.tg-card.none .tg-label { color: var(--ink-soft); }
.tg-actions { display: flex; gap: 7px; }
.tg-actions .tg-btn { flex: 1; padding: 7px 6px; font-size: 12.5px; }
.tg-picked { display: flex; flex-direction: column; gap: 2px; }
.tg-picked-line { font-size: 13px; font-weight: 800; color: var(--danger); }
.tg-picked-sub { font-size: 11.5px; color: var(--ink-soft); }

/* ---------- 弹层 ---------- */
.tg-sheet {
    position: fixed; inset: 0; z-index: 200; display: none;
    align-items: center; justify-content: center; padding: 18px;
    background: rgba(20, 45, 34, 0.38);
    backdrop-filter: blur(4px);
}
.tg-sheet.open { display: flex; }
.tg-sheet-box {
    width: 100%; max-width: 380px; max-height: 88vh; overflow-y: auto;
    padding: 20px; border-radius: 24px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 24px 60px rgba(10, 40, 28, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.8);
}
.tg-sheet-title { font-size: 17px; font-weight: 900; color: var(--brand-deep); margin-bottom: 14px; }
.tg-field { margin-bottom: 13px; }
.tg-field > span { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }
.tg-range { display: flex; align-items: center; gap: 8px; }
.tg-range input { flex: 1; }
.tg-range em { color: var(--ink-soft); font-style: normal; }
.tg-radio { display: flex; flex-wrap: wrap; gap: 8px; }
.tg-radio label {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 13px; border-radius: 12px; font-size: 13.5px; font-weight: 600;
    background: var(--brand-soft); color: var(--brand-deep); cursor: pointer;
}
.tg-radio input { accent-color: var(--brand); }
.tg-time, .tg-sheet-box input[type="time"] {
    width: 100%; padding: 10px 12px; border-radius: 13px; border: 1px solid var(--line);
    font-size: 15px; font-weight: 700; color: var(--ink); background: #fff;
}
.tg-sheet-ops { display: flex; gap: 9px; margin-top: 16px; }
.tg-sheet-ops .tg-btn { flex: 1; }

/* ---------- 表格（接学记录） ---------- */
.tg-table-wrap { overflow-x: auto; }
.tg-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tg-table th {
    text-align: left; padding: 9px 10px; font-size: 12px; font-weight: 800; color: var(--ink-soft);
    background: rgba(47, 143, 99, 0.07); border-radius: 8px;
}
.tg-table td { padding: 9px 10px; border-bottom: 1px solid rgba(47, 143, 99, 0.08); }
.tg-table tr:last-child td { border-bottom: none; }
.tg-name-cell { font-weight: 800; color: var(--danger); }
.tg-muted { color: var(--ink-soft); font-size: 12.5px; }
.tg-empty { padding: 16px 4px; font-size: 13.5px; color: var(--ink-soft); }

/* ---------- 名单管理 ---------- */
.tg-page-head { margin: 18px 0 2px; }
.tg-page-head h2 { margin: 0; font-size: 21px; font-weight: 900; color: var(--brand-deep); }
.tg-page-head p { margin: 4px 0 0; font-size: 13px; color: var(--ink-soft); }
.tg-back { margin: 4px 0 14px; }
.tg-form { display: flex; flex-direction: column; gap: 12px; }
.tg-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.tg-fields label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.tg-fields input {
    padding: 9px 11px; border-radius: 12px; border: 1px solid var(--line);
    font-size: 14px; font-weight: 600; color: var(--ink); background: rgba(255, 255, 255, 0.92);
}
.tg-fields em { font-size: 11px; font-weight: 500; color: var(--ink-soft); font-style: normal; }
.tg-times { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.tg-sched { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.tg-chip { padding: 4px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: var(--brand-soft); color: var(--brand-deep); }
.tg-chip.none { background: rgba(120, 130, 138, 0.12); color: var(--ink-soft); font-weight: 600; }
.tg-note-text { font-size: 12px; color: var(--ink-soft); }

/* ---------- 日历跳转 ---------- */
.tg-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.tg-cal-title { font-size: 16px; font-weight: 900; color: var(--brand-deep); }
.tg-cal-week { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 11.5px; color: var(--ink-soft); font-weight: 700; margin-bottom: 6px; }
.tg-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.tg-cal-grid .cal-empty { min-height: 40px; }
.cal-day {
    display: flex; align-items: center; justify-content: center;
    min-height: 40px; border-radius: 12px;
    font-size: 13.5px; font-weight: 700; color: var(--ink);
    background: rgba(47, 143, 99, 0.08);
    transition: transform .1s ease, background .1s ease;
}
.cal-day:hover { background: rgba(47, 143, 99, 0.18); transform: translateY(-1px); }
.cal-day.off { color: rgba(120, 130, 138, 0.45); background: rgba(120, 130, 138, 0.06); }
.cal-day.is-today {
    background: linear-gradient(150deg, #57c48c, #2f8f63); color: #fff;
    box-shadow: 0 4px 10px rgba(47, 143, 99, 0.3);
}
.cal-day.is-sel { box-shadow: inset 0 0 0 2px var(--brand); color: var(--brand-deep); }
.cal-day.is-sel.is-today { box-shadow: inset 0 0 0 2px #fff; color: #fff; }
.tg-cal-note { margin-top: 12px; font-size: 11.5px; color: var(--ink-soft); text-align: center; }

/* ---------- 已接学快捷确认 ---------- */
.tg-quick { text-align: center; padding: 6px 0 2px; }
.tg-btn.big { padding: 13px 34px; font-size: 15.5px; border-radius: 999px; width: 100%; }
.tg-quick p { margin: 8px 0 0; font-size: 12px; color: var(--ink-soft); }
.tg-more { margin-top: 10px; border-top: 1px dashed rgba(47,143,99,0.25); padding-top: 10px; }
.tg-more summary { cursor: pointer; font-size: 12.5px; color: var(--ink-soft); text-align: center; list-style: none; }
.tg-more summary::-webkit-details-marker { display: none; }
.tg-more summary::after { content: " ▾"; }

/* ---------- 窄屏 ---------- */
@media (max-width: 720px) {
    .tg-app { padding: 12px 10px 90px; }
    .tg-header { padding: 10px 14px; border-radius: 20px; }
    .tg-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 9px; }
    .tg-date { font-size: 17px; }
}
