:root {
  --bg: #eef5ff;
  --panel: #ffffff;
  --ink: #1e2a36;
  --muted: #667386;
  --line: #1b1f24;
  --blue: #c7d9f1;
  --blue-deep: #3478c7;
  --blue-soft: #e8f1ff;
  --danger: #b42318;
  --shadow: 0 18px 50px rgba(30, 42, 54, 0.12);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, #e7f1ff 0%, #f8fbff 52%, #edf6ff 100%);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 12px;
  background: var(--blue-deep);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  padding: 12px 16px;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

button:hover {
  box-shadow: 0 10px 24px rgba(52, 120, 199, 0.22);
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

button.secondary {
  background: #e8f1ff;
  color: #225d9f;
}

button.ghost {
  background: transparent;
  color: var(--muted);
  padding: 6px 0;
}

button.danger {
  color: var(--danger);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #d3deec;
  border-radius: 12px;
  background: #fbfdff;
  color: var(--ink);
  outline: none;
  padding: 12px 14px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue-deep);
  box-shadow: 0 0 0 4px rgba(52, 120, 199, 0.12);
}

textarea {
  line-height: 1.7;
  min-height: 190px;
  resize: vertical;
}

.hero {
  align-items: center;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1440px;
  padding: 34px 28px 22px;
}

.hero h1 {
  font-size: clamp(34px, 4vw, 54px);
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 4px 0 12px;
}

.hero-copy {
  color: var(--muted);
  font-size: 18px;
  margin: 0;
}

.hero-format-hint {
  color: #475467;
  font-size: 15px;
  line-height: 1.6;
  margin: 10px 0 0;
}

.hero-format-hint strong {
  color: #1d4f8c;
  font-weight: 800;
}

.feature-banner--compact {
  background: linear-gradient(135deg, #e8f1ff 0%, #f4f9ff 100%);
  border: 1px solid rgba(52, 120, 199, 0.24);
  border-left: 4px solid #3478c7;
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(52, 120, 199, 0.1);
  color: #18324f;
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  overflow: hidden;
  padding: 14px 16px 12px;
}

.feature-banner--compact .feature-banner__head strong {
  color: #18324f;
  display: block;
  font-size: 16px;
  margin: 6px 0 0;
}

.feature-banner__badge {
  background: #3478c7;
  border-radius: 999px;
  color: #fff;
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 4px 10px;
}

.feature-marquee {
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  overflow: hidden;
  width: 100%;
}

.feature-marquee__track {
  animation: feature-marquee-scroll 26s linear infinite;
  display: flex;
  gap: 12px;
  width: max-content;
}

.feature-marquee__item {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(199, 217, 241, 0.95);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(52, 120, 199, 0.08);
  color: #225d9f;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  white-space: nowrap;
}

.feature-marquee--compact .feature-marquee__item {
  font-size: 12px;
  padding: 7px 12px;
}

@keyframes feature-marquee-scroll {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .feature-marquee__track {
    animation: none;
    flex-wrap: wrap;
    width: auto;
  }
}

.guide-link {
  align-items: center;
  background: #e8f1ff;
  border: 1px solid rgba(52, 120, 199, 0.18);
  border-radius: 12px;
  color: #225d9f;
  display: inline-flex;
  font-size: 14px;
  font-weight: 700;
  gap: 6px;
  margin-top: 16px;
  padding: 10px 16px;
  text-decoration: none;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.guide-link:hover {
  background: #dceaff;
  box-shadow: 0 10px 24px rgba(52, 120, 199, 0.18);
  transform: translateY(-1px);
}

.guide-link--compact {
  font-size: 13px;
  margin-top: 0;
  padding: 8px 12px;
}

.hero-card {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(199, 217, 241, 0.9);
  border-radius: 18px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 6px;
  min-width: 280px;
  padding: 18px 20px;
}

.hero-card span {
  color: var(--muted);
}

.page-footer {
  margin: 0 auto 28px;
  max-width: 1440px;
  padding: 0 28px;
}

.visit-stats-bar {
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(199, 217, 241, 0.9);
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 14px 18px;
}

.visit-stats-title {
  color: #18324f;
  font-size: 14px;
}

.visit-stats-grid {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  min-width: 280px;
}

.visit-stat {
  align-items: center;
  background: rgba(240, 247, 255, 0.9);
  border: 1px solid rgba(199, 217, 241, 0.85);
  border-radius: 12px;
  display: inline-flex;
  gap: 10px;
  min-width: 108px;
  padding: 8px 12px;
}

.visit-stat-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.visit-stat strong {
  color: var(--blue-deep);
  font-size: 18px;
  line-height: 1;
}

.visit-stats-hint {
  color: var(--muted);
  font-size: 12px;
  width: 100%;
}

#visitStatsCard.is-offline .visit-stat strong {
  color: var(--muted);
  font-size: 14px;
}

.eyebrow {
  color: var(--blue-deep);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  margin: 0;
  text-transform: uppercase;
}

.app-shell {
  display: grid;
  gap: 18px;
  grid-template-columns: 320px minmax(360px, 0.9fr) minmax(520px, 1.35fr);
  margin: 0 auto;
  max-width: 1440px;
  padding: 0 28px 32px;
}

.panel {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(199, 217, 241, 0.85);
  border-radius: 24px;
  box-shadow: var(--shadow);
  min-height: 640px;
  padding: 22px;
}

.section-heading,
.editor-header {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.editor-header-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.section-heading h2,
.editor-header h2 {
  font-size: 24px;
  margin: 4px 0 0;
}

.section-heading h3 {
  margin: 0;
}

.section-heading.compact {
  align-items: center;
  margin: 24px 0 12px;
}

.field-label {
  color: #344054;
  display: block;
  font-size: 13px;
  font-weight: 800;
  margin: 0 0 8px;
}

.search-row {
  display: grid;
  gap: 10px;
}

.hint,
.muted {
  color: var(--muted);
  font-size: 13px;
}

.hint {
  line-height: 1.6;
  margin-top: 10px;
}

.data-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
  margin-top: 14px;
}

.student-list {
  display: grid;
  gap: 10px;
}

.student-card-wrap {
  align-items: stretch;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.student-delete-btn {
  align-self: center;
  background: #fff1f0;
  border-radius: 12px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
  padding: 10px 12px;
}

.student-delete-btn:hover {
  background: #ffe4e1;
  box-shadow: none;
  transform: none;
}

.student-card {
  background: #f8fbff;
  border: 1px solid #dbe7f6;
  border-radius: 16px;
  color: var(--ink) !important;
  cursor: pointer;
  display: grid;
  font-weight: 400;
  gap: 8px;
  padding: 14px;
  text-align: left;
}

.student-card.active {
  border-color: var(--blue-deep);
  box-shadow: 0 0 0 4px rgba(52, 120, 199, 0.12);
}

.student-card strong {
  color: var(--ink) !important;
  display: block;
  font-size: 17px;
  font-weight: 900;
}

.student-card .student-meta {
  align-items: center;
  color: var(--muted) !important;
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  gap: 8px;
}

.student-card .badge {
  background: var(--blue-soft);
  border-radius: 999px;
  color: #225d9f !important;
  display: inline-flex;
  font-weight: 800;
  padding: 4px 8px;
}

.empty-state {
  align-content: center;
  display: grid;
  gap: 12px;
  min-height: 560px;
  place-items: center;
  text-align: center;
}

.empty-state p {
  color: var(--muted);
  line-height: 1.7;
  max-width: 360px;
}

.empty-state .guide-link {
  margin-top: 0;
}

.hidden {
  display: none !important;
}

.status-pill {
  align-items: center;
  background: var(--blue-soft);
  border-radius: 999px;
  display: flex;
  gap: 8px;
  padding: 6px 8px 6px 12px;
  white-space: nowrap;
}

.status-pill span {
  color: #225d9f;
  font-size: 12px;
  font-weight: 800;
}

.status-pill select {
  background: #fff;
  border-radius: 999px;
  padding: 8px 30px 8px 10px;
}

.quick-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  margin-bottom: 16px;
}

.export-settings {
  margin-top: 20px;
}

.export-settings summary {
  align-items: center;
  background: linear-gradient(180deg, #f4f8ff 0%, #eef4ff 100%);
  border: 1px solid #c9daf0;
  border-radius: 14px;
  color: #1d4f8c;
  cursor: pointer;
  display: flex;
  font-size: 15px;
  font-weight: 800;
  gap: 10px;
  list-style: none;
  padding: 12px 14px;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}

.export-settings summary:hover {
  background: #e8f1ff;
  border-color: #9ebce0;
  box-shadow: 0 4px 14px rgba(52, 120, 199, 0.12);
}

.export-settings[open] summary {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-color: #e3ebf5;
}

.export-settings summary::-webkit-details-marker {
  display: none;
}

.export-settings summary::before {
  align-items: center;
  background: #fff;
  border: 1px solid #b8cfe8;
  border-radius: 8px;
  color: #225d9f;
  content: "▸";
  display: inline-flex;
  flex-shrink: 0;
  font-size: 14px;
  height: 28px;
  justify-content: center;
  line-height: 1;
  transition: transform 0.15s ease, background 0.15s ease;
  width: 28px;
}

.export-settings summary:hover::before {
  background: #fff;
  border-color: #3478c7;
}

.export-settings[open] summary::before {
  background: #3478c7;
  border-color: #3478c7;
  color: #fff;
  transform: rotate(90deg);
}

.export-settings-label {
  flex-shrink: 0;
}

.export-settings-hint {
  color: #667386;
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  min-width: 0;
}

.export-settings-action {
  background: #fff;
  border: 1px solid #b8cfe8;
  border-radius: 999px;
  color: #225d9f;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
}

.export-settings[open] .when-closed,
.export-settings:not([open]) .when-open {
  display: none;
}

.export-settings-grid {
  background: #fbfdff;
  border: 1px solid #c9daf0;
  border-radius: 0 0 14px 14px;
  border-top: 0;
  margin-bottom: 0;
  padding: 14px 14px 10px;
}

.export-settings-grid .checkbox-field {
  padding-top: 24px;
}

.checkbox-field {
  align-items: center;
  display: flex;
  gap: 10px;
  min-height: 46px;
  padding-top: 24px;
}

.checkbox-field input {
  width: auto;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.message {
  color: #225d9f;
  font-size: 13px;
  font-weight: 700;
  min-height: 20px;
  padding-top: 10px;
}

.message.error {
  color: var(--danger);
}

.message.warning {
  color: #9a5b00;
}

.conflict-alert {
  background: #fff7ed;
  border: 1px solid #f3cf98;
  border-radius: 14px;
  color: #8a4b00;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
  margin-top: 10px;
  padding: 12px 14px;
}

.lesson-row-wrap {
  display: grid;
  gap: 6px;
}

.lesson-row-wrap--conflict .lesson-row {
  border-color: rgba(212, 76, 71, 0.35);
}

.lesson-row-conflict {
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  padding: 0 2px 2px;
}

.student-card .badge-conflict {
  background: #fff1f0;
  color: var(--danger);
}

.student-card.has-conflict {
  border-color: rgba(212, 76, 71, 0.45);
}

.lesson-rows {
  display: grid;
  gap: 8px;
}

.lesson-row {
  align-items: center;
  background: #f8fbff;
  border: 1px solid #dbe7f6;
  border-radius: 14px;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr auto;
  padding: 10px;
}

.lesson-row button {
  background: #fff1f0;
  color: var(--danger);
  padding: 10px 12px;
}

.preview-panel {
  overflow: hidden;
}

.preview-mode-bar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-bottom: 14px;
}

.preview-mode-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.preview-mode-toggle {
  background: #eef3f9;
  border-radius: 12px;
  display: inline-flex;
  gap: 4px;
  padding: 4px;
}

.preview-mode-toggle button {
  background: transparent;
  border: none;
  border-radius: 9px;
  color: #4a627d;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.preview-mode-toggle button:hover {
  color: #18324f;
}

.preview-mode-toggle button.is-active {
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 45, 90, 0.1);
  color: #18324f;
}

.summary-stats {
  background: #f5f9ff;
  border: 1px solid #d8e6f5;
  border-radius: 12px;
  color: #315a99;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 14px;
  padding: 10px 14px;
}

.summary-stats strong {
  color: #18324f;
}

.summary-stats .summary-stats-conflict {
  color: #c0392b;
  font-weight: 700;
}

.preview-theme-bar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-bottom: 16px;
}

.preview-theme-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.theme-chips {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 240px;
}

.theme-chip {
  align-items: center;
  background: #fff;
  border: 1.5px solid #d8e3f0;
  border-radius: 14px;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  gap: 10px;
  min-width: 168px;
  padding: 10px 12px;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.theme-chip:hover {
  border-color: var(--chip-accent);
  box-shadow: 0 8px 20px rgba(15, 45, 90, 0.08);
  transform: translateY(-1px);
}

.theme-chip.is-active {
  border-color: var(--chip-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--chip-accent) 18%, transparent);
}

.theme-chip-swatch {
  background:
    linear-gradient(180deg, var(--chip-date) 0 50%, var(--chip-weekday) 50% 100%);
  border: 1px solid color-mix(in srgb, var(--chip-accent) 35%, #fff);
  border-radius: 8px;
  flex: 0 0 34px;
  height: 34px;
}

.theme-chip-copy {
  display: grid;
  gap: 2px;
}

.theme-chip-copy strong {
  color: #18324f;
  font-size: 14px;
}

.theme-chip-copy span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.preview-actions {
  margin-top: 0;
}

.calendar-preview {
  background: linear-gradient(180deg, #edf4fb 0%, #f8fbff 48%, #edf4fb 100%);
  border: 1px solid #d8e3f0;
  border-radius: 22px;
  overflow: auto;
  padding: 22px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.svg-preview {
  margin: 0 auto;
  min-width: 1500px;
}

.schedule-svg {
  display: block;
  height: auto;
  width: 100%;
}

.preview-card {
  background:
    radial-gradient(circle at 0% 0%, rgba(213, 236, 255, 0.72), transparent 20%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(253, 254, 255, 0.96));
  border: 1px solid rgba(77, 132, 190, 0.32);
  border-radius: 28px;
  box-shadow: 0 18px 44px rgba(30, 84, 138, 0.24);
  color: #071a43;
  margin: 0 auto;
  min-width: 1500px;
  overflow: hidden;
  padding: 28px 42px 40px;
  position: relative;
}

.preview-card::before,
.preview-card::after {
  content: "";
  left: 0;
  pointer-events: none;
  position: absolute;
  right: 0;
  z-index: 0;
}

.preview-card::before {
  background:
    repeating-radial-gradient(ellipse at 24px 30px, transparent 0 20px, rgba(120, 184, 235, 0.3) 21px 23px, transparent 24px 50px);
  height: 86px;
  opacity: 0.5;
  top: 8px;
  transform: scaleX(1.1);
}

.preview-card::after {
  background:
    radial-gradient(ellipse at 15% 100%, rgba(126, 184, 231, 0.34), transparent 52%),
    radial-gradient(ellipse at 38% 100%, rgba(59, 132, 199, 0.2), transparent 46%),
    radial-gradient(ellipse at 84% 100%, rgba(126, 184, 231, 0.3), transparent 48%),
    repeating-radial-gradient(ellipse at 22px 58px, transparent 0 18px, rgba(120, 184, 235, 0.5) 19px 21px, transparent 22px 44px);
  bottom: -12px;
  height: 100px;
}

.preview-title {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
  min-height: 82px;
  position: relative;
  text-align: center;
  z-index: 1;
}

.preview-title h3 {
  color: #071a43;
  font-family: "Times New Roman", "STSong", "Songti SC", "SimSun", serif;
  font-size: 52px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1;
  margin: 0;
}

.preview-title span {
  color: #1f315d;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.title-divider::before,
.title-divider::after {
  color: #c8952d;
  content: "⌁";
  margin: 0 14px;
}

.preview-decor {
  color: #2a69ad;
  opacity: 0.72;
  position: absolute;
  z-index: 0;
}

.preview-decor-left {
  height: 64px;
  left: 34px;
  top: 24px;
  width: 88px;
}

.preview-decor-left svg {
  display: block;
  height: 100%;
  overflow: visible;
  width: 100%;
}

.preview-decor-left path {
  fill: rgba(226, 242, 255, 0.82);
  stroke: #2a69ad;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.preview-decor-right {
  color: #c8952d;
  font-size: 24px;
  right: 42px;
  top: 36px;
}

.preview-wave {
  background: repeating-radial-gradient(ellipse at 24px 36px, transparent 0 18px, rgba(120, 184, 235, 0.5) 19px 21px, transparent 22px 48px);
  bottom: 10px;
  height: 54px;
  left: 0;
  opacity: 0.48;
  pointer-events: none;
  position: absolute;
  right: 0;
  z-index: 0;
}

.calendar-grid {
  border-left: 1.5px solid #315a99;
  border-radius: 10px;
  border-top: 1.5px solid #315a99;
  box-shadow: 0 8px 18px rgba(49, 90, 153, 0.08);
  display: grid;
  grid-template-columns: repeat(7, minmax(100px, 1fr));
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.calendar-day {
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1.5px solid #315a99;
  border-right: 1.5px solid #315a99;
  min-height: 88px;
}

.calendar-date,
.calendar-weekday {
  align-items: center;
  background: linear-gradient(180deg, #dcefff 0%, #bdddf6 100%);
  border-bottom: 1.5px solid #315a99;
  color: #071a43;
  display: flex;
  font-size: 15px;
  font-weight: 800;
  height: 24px;
  justify-content: center;
}

.calendar-weekday {
  background: linear-gradient(180deg, #cfe7fb 0%, #a9d0ef 100%);
  font-size: 14px;
  height: 22px;
}

.calendar-body {
  align-items: center;
  display: flex;
  flex-direction: column;
  font-size: 14px;
  gap: 4px;
  justify-content: center;
  line-height: 1.45;
  min-height: 42px;
  padding: 4px;
  text-align: center;
}

.lesson-pill {
  background: linear-gradient(180deg, #e4f4ff 0%, #cfeaff 100%);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  color: #071a43;
  line-height: 1.15;
  min-width: 88px;
  padding: 4px 9px;
}

.lesson-name {
  font-weight: 800;
}

.lesson-time {
  font-weight: 800;
}

.preview-note {
  color: #1f315d;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.18em;
  margin: 16px 0 0;
  position: relative;
  text-align: center;
  z-index: 1;
}

.app-footer {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  padding: 0;
}

.admin-link {
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.feedback-image-preview {
  border: 1px solid #d3deec;
  border-radius: 12px;
  overflow: hidden;
}

.feedback-image-preview.hidden {
  display: none;
}

.feedback-image-preview img,
.my-feedback-attachment,
.feedback-attachment-image {
  display: block;
  max-height: 180px;
  max-width: 100%;
  object-fit: contain;
}

.feedback-image-clear.hidden {
  display: none;
}

.feedback-image-clear {
  justify-self: start;
}

.feedback-panel {
  border-top: 1px solid #e3ebf5;
  display: grid;
  gap: 10px;
  margin-top: 8px;
  padding-top: 4px;
}

.feedback-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
}

.feedback-tab {
  align-items: center;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid #d3deec;
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  gap: 6px;
  padding: 7px 12px;
}

.feedback-tab.is-active {
  background: #e8f2ff;
  border-color: #9ec5ef;
  color: #1d4f8c;
}

.feedback-unread-badge {
  background: #e5484d;
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
  line-height: 1;
  min-width: 18px;
  padding: 3px 6px;
  text-align: center;
}

.feedback-unread-badge.hidden {
  display: none;
}

.feedback-tab-panel.hidden {
  display: none;
}

.my-feedback-list {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.my-feedback-item {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #d3deec;
  border-radius: 14px;
  display: grid;
  gap: 6px;
  padding: 12px 14px;
}

.my-feedback-item.is-unread {
  border-color: #9ec5ef;
  box-shadow: 0 0 0 1px rgba(30, 100, 180, 0.08);
}

.my-feedback-item-head {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  justify-content: space-between;
}

.my-feedback-item-head strong {
  font-size: 13px;
}

.my-feedback-status {
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
}

.my-feedback-status.status-new,
.my-feedback-status.status-triaged {
  background: #eef4ff;
  color: #2b5ea8;
}

.my-feedback-status.status-needs_reply,
.my-feedback-status.status-in_progress {
  background: #fff4e5;
  color: #9a5b00;
}

.my-feedback-status.status-resolved {
  background: #e8f8ee;
  color: #1f7a45;
}

.my-feedback-status.status-closed {
  background: #f1f3f5;
  color: #667085;
}

.my-feedback-preview {
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
}

.my-feedback-replies {
  display: grid;
  gap: 8px;
}

.my-feedback-reply {
  background: #f4f8ff;
  border-radius: 12px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
  padding: 10px 12px;
}

.my-feedback-reply time {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
}

.my-feedback-meta {
  color: var(--muted);
  font-size: 12px;
}

.changelog-list {
  border-top: 1px solid #e3ebf5;
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
}

.changelog-list:empty {
  display: none;
}

.changelog-heading {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0;
  text-transform: uppercase;
}

.changelog-item {
  font-size: 13px;
  line-height: 1.5;
}

.changelog-title {
  font-weight: 700;
  line-height: 1.45;
}

.changelog-body {
  color: #475467;
  font-size: 12px;
  line-height: 1.5;
  margin-top: 4px;
}

.changelog-ref {
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
}

.changelog-item time {
  color: var(--muted);
  font-size: 12px;
}

.feedback-toast {
  background: #fff;
  border: 1px solid #c9daf0;
  border-radius: 16px;
  bottom: 24px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.14);
  display: grid;
  gap: 10px;
  max-width: 360px;
  padding: 14px 16px;
  position: fixed;
  right: 24px;
  z-index: 40;
}

.feedback-toast.hidden {
  display: none;
}

.feedback-toast-text {
  font-size: 14px;
  line-height: 1.55;
  margin: 0;
}

.feedback-toast-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.feature-hint-banner {
  background: #edf6ff;
  border: 1px solid #b9d6f5;
  border-radius: 12px;
  color: #1d4f8c;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 10px;
  padding: 10px 12px;
}

.feature-hint-banner button {
  background: none;
  border: none;
  color: #1d4f8c;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  margin-left: 8px;
  padding: 0;
  text-decoration: underline;
}

.feedback-panel button[type="submit"] {
  justify-self: start;
  margin-top: 4px;
}

.feedback-dialog {
  border: 1px solid #d3deec;
  border-radius: 20px;
  max-width: 520px;
  padding: 22px;
  width: calc(100% - 32px);
}

.feedback-dialog::backdrop {
  background: rgba(15, 23, 42, 0.35);
}

.feedback-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
}

.feedback-header h2 {
  font-size: 22px;
  margin: 0;
}

.feedback-dialog textarea {
  margin-bottom: 12px;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 300px 1fr;
  }

  .preview-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .hero {
    align-items: stretch;
    flex-direction: column;
    padding: 24px 16px 16px;
  }

  .app-shell {
    grid-template-columns: 1fr;
    padding: 0 16px 24px;
  }

  .panel {
    min-height: auto;
    padding: 18px;
  }

  .quick-grid,
  .lesson-row {
    grid-template-columns: 1fr;
  }

  .editor-header {
    flex-direction: column;
  }

  .preview-card {
    min-width: 1500px;
  }

  .svg-preview {
    min-width: 1500px;
  }
}
