﻿:root {
  --ink: #15131c;
  --muted: #6f6a7a;
  --accent: #3a5b6d;
  --accent-strong: #1f3f4c;
  --peach: #f6d7b0;
  --mint: #c6e6d1;
  --paper: #fefbf7;
  --shadow: 0 20px 40px rgba(20, 18, 25, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: #f8f5f1;
}

.bg-layer {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1200px 600px at 20% 0%, #fff2da 0%, transparent 60%),
    radial-gradient(1000px 700px at 90% 20%, #d7eff2 0%, transparent 55%),
    linear-gradient(120deg, #f7efe2, #f5f0ea 60%, #f0f4f6);
  z-index: -2;
}

.grain {
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='120' height='120' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  z-index: -1;
  pointer-events: none;
}

.app {
  max-width: 1100px;
  margin: 40px auto 80px;
  padding: 0 20px 60px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hero {
  padding: 30px 30px 20px;
  background: var(--paper);
  border-radius: 24px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  animation: fadeUp 0.7s ease both;
}

.hero h1 {
  margin: 12px 0 8px;
  font-family: "ZCOOL XiaoWei", "Noto Serif SC", serif;
  font-size: clamp(26px, 4vw, 38px);
}

.hero p {
  margin: 0;
  color: var(--muted);
}

.chip {
  display: inline-flex;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--accent-strong);
  font-weight: 600;
  letter-spacing: 0.06em;
}

.status {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 16px;
  background: #f3f1ea;
  color: var(--accent-strong);
  font-weight: 600;
}

.status-school {
  font-weight: 700;
  margin-bottom: 6px;
}

.status-text {
  color: var(--accent-strong);
}

.error-text {
  color: #b42318;
  font-size: 12px;
  margin-top: 4px;
}

.error-text:empty {
  display: none;
}

.panel {
  background: var(--paper);
  border-radius: 24px;
  padding: 22px 24px;
  box-shadow: var(--shadow);
  animation: fadeUp 0.7s ease both;
}

.panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel-header h2 {
  margin: 0;
  font-size: 20px;
}

.hint {
  color: var(--muted);
  font-size: 13px;
}

.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
}

.field label {
  font-weight: 600;
}

.field input,
.field select {
  border-radius: 12px;
  border: 1px solid #e2ddcf;
  padding: 10px 12px;
  font-size: 14px;
  background: #fff;
}

.inline {
  display: flex;
  gap: 10px;
}

.inline input {
  flex: 1;
}

.grade-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.grade-options button {
  border: 1px solid #d7d0c1;
  background: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.grade-options button.active {
  background: var(--peach);
  border-color: var(--peach);
}

.schedule-body {
  display: grid;
  gap: 14px;
}

.day-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px dashed #eadfce;
}

.day-row:last-child {
  border-bottom: none;
}

.day-label {
  font-weight: 700;
  color: var(--accent-strong);
}

.course-options {
  display: grid;
  gap: 10px;
}

.course-item {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #e2d9c8;
  background: #fff;
}

.course-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.course-item-head input[type="radio"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #1f3f4c;
}

.course-title {
  font-size: 15px;
  color: #24363f;
}

.course-item.selected {
  border-color: #1f3f4c;
  box-shadow: 0 0 0 1px rgba(31, 63, 76, 0.08);
}

.schedule-warning {
  margin: 12px 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #ecd5a5;
  background: #fff6e6;
  color: #8a5a00;
  font-size: 14px;
  line-height: 1.6;
}

.course-status-badge {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.course-status-badge.selectable {
  background: #eef8f1;
  color: #1f7a45;
}

.course-status-badge.cancelled {
  background: #eceff3;
  color: #6b7280;
}

.course-item.disabled {
  opacity: 0.76;
}

.course-item.disabled .course-item-head {
  cursor: not-allowed;
}

.course-item.cancelled {
  background: #f7f7f7;
  border-color: #d8d8d8;
}

.course-item.cancelled.selected {
  border-color: #9ea7af;
  box-shadow: 0 0 0 1px rgba(107, 114, 128, 0.12);
}

.course-status-note {
  margin-top: 8px;
  color: #7a7f87;
  font-size: 12px;
  line-height: 1.5;
}

.course-detail {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #eadfce;
}

.course-detail[hidden] {
  display: none;
}

.course-preview-image {
  display: block;
  width: min(420px, 100%);
  margin-top: 8px;
  border-radius: 10px;
  border: 1px solid #e2d8c8;
}

.course-preview-intro {
  margin-top: 2px;
  color: #534e5f;
  font-size: 13px;
  line-height: 1.55;
}

.course-empty {
  color: #8d858f;
  font-size: 13px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.field.full {
  grid-column: 1 / -1;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.primary {
  background: var(--accent-strong);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(31, 63, 76, 0.24);
}

.ghost {
  border: 1px solid #d7d0c1;
  background: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.action-left {
  color: var(--muted);
}

.result-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.result-card {
  padding: 12px 14px;
  border-radius: 16px;
  background: #f6f2ea;
  border: 1px solid #ede3d3;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1f3f4c;
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.toast.show {
  opacity: 1;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.modal-open {
  overflow: hidden;
}

.image-viewer {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(12, 12, 16, 0.7);
  padding: 24px;
  z-index: 999;
}

.image-viewer.open {
  display: flex;
}

.image-viewer-panel {
  position: relative;
  max-width: 92vw;
  max-height: 86vh;
}

.image-viewer-img {
  display: block;
  max-width: 92vw;
  max-height: 86vh;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.image-viewer-close {
  position: absolute;
  top: -44px;
  right: 0;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: #1f3f4c;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.image-viewer-close:focus-visible {
  outline: 2px solid #1f3f4c;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.85);
}

.image-viewer-error {
  display: none;
  color: #fff;
  font-size: 14px;
  text-align: center;
}

.image-viewer.show-error .image-viewer-img {
  display: none;
}

.image-viewer.show-error .image-viewer-error {
  display: block;
}

@media (max-width: 720px) {
  .image-viewer {
    padding: 16px;
  }
  .image-viewer-close {
    top: -40px;
  }
  .hero {
    padding: 24px;
  }
  .day-row {
    grid-template-columns: 1fr;
  }
  .actions {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* openclaw school schedule image fix start */
.school-schedule {
  overflow: hidden;
}

#schoolScheduleImg,
.school-schedule-img {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: min(70vh, 960px) !important;
  margin: 0 auto !important;
  object-fit: contain !important;
}

@media (max-width: 720px) {
  #schoolScheduleImg,
  .school-schedule-img {
    max-height: 56vh !important;
  }
}
/* openclaw school schedule image fix end */

