:root {
  --aikc-footer-height: 36px;
}

html {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

html:hover,
html:focus-within {
  scrollbar-color: rgba(38, 51, 46, .42) transparent;
}

body {
  padding-bottom: 0;
}

#root {
  min-height: 100vh;
}

html.portal-public body {
  padding-bottom: 0;
}

html.portal-public #root {
  min-height: 100vh;
}

[class*="grid"],
[class*="list"],
[class*="panel"],
[class*="content"] {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

[class*="grid"]:hover,
[class*="list"]:hover,
[class*="panel"]:hover,
[class*="content"]:hover {
  scrollbar-color: rgba(38, 51, 46, .42) transparent;
}

[class*="grid"]::-webkit-scrollbar,
[class*="list"]::-webkit-scrollbar,
[class*="panel"]::-webkit-scrollbar,
[class*="content"]::-webkit-scrollbar,
html::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

[class*="grid"]::-webkit-scrollbar-thumb,
[class*="list"]::-webkit-scrollbar-thumb,
[class*="panel"]::-webkit-scrollbar-thumb,
[class*="content"]::-webkit-scrollbar-thumb,
html::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 999px;
}

[class*="grid"]:hover::-webkit-scrollbar-thumb,
[class*="list"]:hover::-webkit-scrollbar-thumb,
[class*="panel"]:hover::-webkit-scrollbar-thumb,
[class*="content"]:hover::-webkit-scrollbar-thumb,
html:hover::-webkit-scrollbar-thumb {
  background: rgba(38, 51, 46, .42);
}

.aikc-registration-footer {
  position: static;
  width: 100%;
  min-height: 28px;
  margin-top: 18px;
  display: grid;
  place-items: center;
  padding: 7px 12px;
  background: transparent;
  border-top: 1px solid rgba(175, 196, 184, .55);
  color: #7b8881;
  font: 12px/1.2 'Microsoft YaHei', sans-serif;
  backdrop-filter: blur(12px);
}

.aikc-registration-footer[hidden] { display: none !important; }

.aikc-registration-footer a {
  color: inherit;
  text-decoration: none;
}

[class*="mall"] img,
[class*="product"] img,
[class*="shop"] img,
.reward-image img {
    display: block;
    width: 100%;
    height: 180px;
    object-fit: contain;
    object-position: center;
    background: #f7f8f5;
    border-radius: 14px;
}

.reward-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  align-items: stretch;
}

.reward-grid > article {
  display: grid;
  grid-template-rows: 190px auto;
  min-width: 0;
  overflow: hidden;
}

.reward-grid .reward-image {
  display: grid;
  place-items: center;
  min-height: 190px;
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(135deg, #fff4c9, #edf6ef);
}

.reward-grid .reward-image img {
  height: 100%;
  min-height: 190px;
  border-radius: 0;
}

@media (max-width: 640px) {
    [class*="mall"] img,
    [class*="product"] img,
    [class*="shop"] img { height: 150px; }
}

.aikc-registration-footer a:hover {
  color: #23764e;
  text-decoration: underline;
}

.lesson-challenge-grid > button > strong {
  font-size: 21px;
  line-height: 1.45;
  white-space: normal;
}

[class*="challenge"] button strong,
[class*="challenge"] article strong,
[class*="challenge"] h3,
[class*="challenge"] p {
  font-size: 20px;
  line-height: 1.65;
}

[class*="challenge"] button small,
[class*="challenge"] button em {
  font-size: 15px;
  line-height: 1.6;
}

.lesson-challenge-grid > button > small,
.lesson-challenge-grid > button > em {
  font-size: 16px;
  line-height: 1.55;
}

/* Every programming challenge uses the same readable brief scale. */
.coding-task-brief,
.coding-task-brief p,
.coding-task-brief li,
.coding-task-brief label,
.coding-task-brief strong {
  font-size: 20px;
  line-height: 1.75;
}

/* The management entry is a regular sidebar item, not a floating control. */
.teacher-management-nav {
  position: static !important;
  width: 100% !important;
  min-height: 56px;
  margin: 0 !important;
  border-radius: 14px !important;
  box-shadow: none !important;
}
#aikc-teacher-management-host {
  position: static !important;
  inset: auto !important;
  pointer-events: auto !important;
}

.assessment-sheet .assessment-question-code {
  font-size: 16px;
  line-height: 1.75;
}

.coding-active-panel > header > div > h2 {
  font-size: clamp(25px, 2.2vw, 32px);
  line-height: 1.45;
}

.coding-active-panel > header > div > p {
  font-size: clamp(20px, 1.65vw, 24px);
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.coding-task-brief code,
.coding-task-brief b {
  font-size: 20px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.coding-editor-shell > textarea,
.assessment-code-editor textarea,
.assessment-code-output pre {
  font-size: 16px;
  line-height: 1.75;
}

@media (max-width: 600px) {
  #root {
    overflow-x: hidden;
  }

  #root > * {
    box-sizing: border-box;
    max-width: 100vw;
  }

  #root button {
    white-space: normal;
  }

  #root h1,
  #root h2,
  #root h3 {
    overflow-wrap: anywhere;
  }

  #root header {
    gap: 12px;
    flex-wrap: wrap;
  }

  #root header > button:first-child {
    position: static;
    flex: 0 0 auto;
  }

  #root header h1,
  #root header h2 {
    min-width: 0;
    flex: 1 1 180px;
  }

  .login-page,
  .parent-login-page {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 100dvh;
    padding: 76px 12px 42px;
    overflow-x: hidden;
  }

  .login-page > .back-link {
    left: 18px;
    top: 20px;
    z-index: 5;
    max-width: calc(100vw - 36px);
  }

  .login-card,
  .parent-login-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0 auto;
  }

  .login-visual,
  .parent-login-welcome {
    min-width: 0;
    padding: 28px 22px;
  }

  .login-visual h1,
  .parent-login-welcome h1 {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .parent-login-welcome > p {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .login-form-wrap,
  .parent-login-form {
    min-width: 0;
    padding: 28px 20px;
  }

  .aikc-registration-footer {
    height: 26px;
    font-size: 11px;
  }
}
.ability-panel {padding:16px; font-size:14px;}
.ability-panel p {line-height:1.7; color:#64748b;}
.ability-panel select {width:100%;padding:10px;margin-bottom:12px;}
.ability-panel summary {cursor:pointer;padding:12px 0;font-weight:700;}
.ability-panel input[type=checkbox] {width:18px;height:18px;}
.ability-students {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:12px 0;}
.ability-student {display:flex;flex-direction:column;align-items:center;gap:7px;padding:12px 6px;border:1px solid #e2e8f0;border-radius:12px;}
.ability-student img,.ability-avatar {width:48px;height:48px;border-radius:50%;object-fit:cover;background:#e0e7ff;display:grid;place-items:center;}
.ability-student small {text-align:center;line-height:1.7;}
.ability-actions {display:flex;flex-wrap:wrap;gap:8px;margin-top:12px;}
.ability-panel button {padding:9px;border:1px solid #cbd5e1;border-radius:8px;cursor:pointer;}
.ability-panel button:disabled {opacity:.45;cursor:default;}
.ability-panel form {display:grid;gap:10px;margin-top:12px;}
.ability-panel form label {display:flex;justify-content:space-between;}
.ability-panel form input[type=number] {width:64px;}


/* ===== r7 追加：家长端成长手记翻页导航 ===== */
.lesson-replay-nav { display: flex; gap: 8px; flex-shrink: 0; }
.lesson-replay-nav button { padding: 8px 14px; border: 1px solid #d6d3ca; border-radius: 999px; background: #fff; color: #26332e; font-size: 13px; cursor: pointer; white-space: nowrap; }
.lesson-replay-nav button:disabled { opacity: .4; cursor: default; }
.lesson-replay-nav button:not(:disabled):hover { background: #f6ad2f; border-color: #f6ad2f; }

/* ===== r7 追加：AI 三版文案编辑与保存 ===== */
.aikc-variant-local { margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: #eef2ff; color: #4f46e5; font-size: 12px; }
.aikc-feature-results article { display: flex; flex-direction: column; gap: 10px; }
.aikc-feature-results article textarea { width: 100%; min-height: 120px; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 10px; font-size: 14px; line-height: 1.7; resize: vertical; }
.aikc-feature-results article footer { display: flex; gap: 8px; justify-content: flex-end; }

/* ===== r7 追加：团队照片多选 ===== */
.aikc-feature-photo-row { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-bottom: 1px dashed #e2e8f0; }
.aikc-feature-photo-row select[multiple] { width: 100%; max-width: 420px; padding: 8px; border: 1px solid #cbd5e1; border-radius: 8px; }
.aikc-feature-photo-row small { color: #64748b; }

/* ===== r7 追加：批量导入学生照片 ===== */
.aikc-import-photo-picker { margin-top: 14px; padding: 12px 14px; border: 1px dashed #cbd5e1; border-radius: 10px; background: #f8fafc; display: grid; gap: 6px; }
.aikc-import-photo-picker p { margin: 0; color: #64748b; font-size: 12px; }
.aikc-import-photo-panel { position: fixed; right: 18px; bottom: 18px; z-index: 60; width: min(360px, calc(100vw - 36px)); max-height: 70vh; overflow: auto; padding: 14px; border-radius: 14px; background: #fff; box-shadow: 0 12px 32px rgba(15, 23, 42, .18); display: grid; gap: 10px; }
.aikc-import-photo-panel header { display: flex; justify-content: space-between; align-items: center; }
.aikc-import-photo-panel header button { border: 0; background: none; font-size: 18px; cursor: pointer; }
.aikc-import-photo-panel p { margin: 0; color: #64748b; font-size: 12px; }
.aikc-import-photo-list { display: grid; gap: 6px; }
.aikc-import-photo-list label { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.aikc-import-photo-list select { max-width: 170px; padding: 6px; border: 1px solid #cbd5e1; border-radius: 8px; }
.aikc-import-photo-panel footer { display: flex; justify-content: flex-end; }
