/* 墨韵教育视觉 · 语文教学工作台 - 新中式纸墨配色 */
* {
  box-sizing: border-box;
}

:root {
  /* 纸墨色系 */
  --ink-deep: #2C3E50;      /* 黛蓝 · 主色/标题 */
  --ink-accent: #C53D43;    /* 朱砂 · 强调/按钮 */
  --ink-accent-soft: #d85a5f;
  --ink-green: #5B8C5A;     /* 竹青 · 链接/成功 */
  --ink-lotus: #E4D7D0;     /* 藕荷 · 弱强调/标签 */
  --paper: #F5F0E8;         /* 宣纸 · 主背景 */
  --paper-light: #FAF7F2;   /* 淡米 · 卡片背景 */
  --ink: #2D2D2D;           /* 墨黑 · 正文 */
  --ink-muted: #6B6B6B;     /* 灰墨 · 次要 */
  --line: #d4cdc4;          /* 分隔线 */
  --soft: #ebe6df;          /* 柔和底 */
  --success: #5B8C5A;
  --danger: #C53D43;
  --radius: 12px;
  --radius-btn: 8px;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  font-family: "Noto Serif SC", "Source Han Serif SC", "思源宋体", "STSong", "SimSun", "PingFang SC", "Microsoft YaHei", serif;
  background: var(--paper);
  background-image: 
    linear-gradient(rgba(44, 62, 80, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(44, 62, 80, 0.015) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--ink);
  overflow-x: hidden;
}

.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(155deg, var(--ink-deep) 0%, #2d3d4e 35%, #3d5266 70%, #4a6478 100%);
  color: #fff;
  padding: 28px 20px 32px;
  box-shadow: 0 4px 28px rgba(44, 62, 80, 0.3);
}

.hero::before {
  content: "";
  position: absolute;
  left: -60px;
  bottom: -80px;
  width: 200px;
  height: 200px;
  background: rgba(91, 140, 90, 0.08);
  border-radius: 50%;
}

.hero::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -120px;
  width: 280px;
  height: 280px;
  background: rgba(229, 215, 208, 0.12);
  border-radius: 50%;
}

.hero-inner {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(24px, 3.6vw, 32px);
  letter-spacing: 0.15em;
  font-weight: 600;
}

.hero p {
  margin: 0 0 8px;
  opacity: 0.92;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
}

.hero-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 14px;
}

.hero-tags span {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 12px;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

#status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  min-height: 36px;
  padding: 8px 16px;
  border-radius: var(--radius-btn);
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  margin-top: 8px;
  transition: opacity 0.2s ease;
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 18px 16px 24px;
}

.tabs {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.transcribe-lock-banner {
  margin-bottom: 12px;
  padding: 10px 16px;
  background: linear-gradient(90deg, rgba(197, 61, 67, 0.12) 0%, rgba(91, 140, 90, 0.12) 100%);
  border: 1px solid rgba(197, 61, 67, 0.3);
  border-radius: var(--radius-btn);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-deep);
  text-align: center;
}
.transcribe-lock-banner[hidden] {
  display: none !important;
}

.tab-btn-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.tab-nav {
  display: flex;
  gap: 4px;
  padding: 0 0 16px;
  border-bottom: 2px solid var(--line);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-btn) var(--radius-btn) 0 0;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.tab-icon {
  font-size: 16px;
  opacity: 0.85;
}

.tab-btn:hover {
  color: var(--ink-deep);
  background: rgba(44, 62, 80, 0.08);
}

.tab-btn.active {
  color: var(--ink-deep);
  background: var(--paper-light);
  box-shadow: 0 -2px 0 0 var(--paper-light), 0 -4px 12px rgba(44, 62, 80, 0.08);
}

.tab-group-sep {
  margin-left: 4px;
  padding-left: 12px;
  border-left: 1px solid rgba(44, 62, 80, 0.12);
}

.tab-panel {
  display: none;
  padding-top: 18px;
}

.tab-panel.active {
  display: block;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 16px;
}

.card {
  background: var(--paper-light);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 20px;
  box-shadow: 0 2px 16px rgba(44, 62, 80, 0.06);
  transition: box-shadow 0.25s ease;
}
.card:hover {
  box-shadow: 0 4px 24px rgba(44, 62, 80, 0.08);
}

.card-accent {
  background: linear-gradient(175deg, #fdfbf8 0%, var(--paper-light) 40%, #f8f4ef 100%);
  border: 1px solid var(--line);
  box-shadow: 0 2px 16px rgba(44, 62, 80, 0.06);
  padding: 24px;
}

h2 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 600;
  color: var(--ink-deep);
  letter-spacing: 0.08em;
}

h3 {
  margin: 16px 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-deep);
}
h3:first-child {
  margin-top: 0;
}

.section-tip {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--ink-muted);
}
.mobile-url-hint {
  margin: 0 0 12px;
  padding: 8px 12px;
  background: rgba(91, 140, 90, 0.08);
  border-radius: var(--radius-btn);
  font-size: 13px;
  border: 1px solid rgba(91, 140, 90, 0.2);
}
.mobile-url-hint .mobile-url-label { color: var(--ink-muted); }
.mobile-url-hint a {
  color: var(--ink-green);
  font-weight: 500;
  word-break: break-all;
}
.mobile-url-hint .copy-url-btn {
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 12px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--paper-light);
  color: var(--ink-green);
  cursor: pointer;
}
.mobile-url-hint .copy-url-btn:hover { background: var(--soft); }

.dropdown-checkbox {
  position: relative;
}
.dropdown-checkbox-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-btn);
  background: var(--paper-light);
  cursor: pointer;
  font-size: 14px;
  text-align: left;
}
.dropdown-checkbox-trigger:hover { border-color: var(--ink-deep); }
.dropdown-checkbox-label { color: var(--ink-muted); flex: 1; }
.dropdown-checkbox-label.has-selection { color: var(--ink); }
.dropdown-checkbox-arrow {
  font-size: 10px;
  opacity: 0.6;
  transition: transform 0.2s;
}
.dropdown-checkbox.open .dropdown-checkbox-arrow { transform: rotate(180deg); }
.dropdown-checkbox-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-btn);
  background: var(--paper-light);
  box-shadow: 0 8px 24px rgba(44, 62, 80, 0.15);
  z-index: 100;
}
.dropdown-checkbox-list {
  padding: 6px;
}
.dropdown-checkbox-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin: 0;
  cursor: pointer;
  border-radius: 6px;
  font-weight: normal;
}
.dropdown-checkbox-list label:hover { background: var(--ink-lotus); }
.dropdown-checkbox-list input[type="checkbox"] {
  min-width: 18px;
  min-height: 18px;
  flex-shrink: 0;
}
.dropdown-checkbox-empty {
  padding: 12px;
  color: var(--ink-muted);
  font-size: 13px;
}

form {
  display: grid;
  gap: 12px;
}
.transcribe-intro { margin-bottom: 16px; }
.transcribe-intro h2 { margin-bottom: 4px; }
.transcribe-form { display: flex; flex-direction: column; gap: 16px; }
.transcribe-form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  align-items: end;
}
.transcribe-field { display: grid; gap: 6px; }
.transcribe-field .field-label { font-size: 13px; font-weight: 600; color: var(--ink); }
.transcribe-field-full { grid-column: 1 / -1; }
.transcribe-submit-wrap { margin-top: 4px; }
.transcribe-submit-wrap button { padding: 12px 24px; font-size: 15px; }

#transcribeForm {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
#transcribeForm .transcribe-form-row .transcribe-field { margin: 0; }
#transcribeForm button[type="submit"] {
  align-self: flex-start;
  padding: 12px 24px;
  font-size: 15px;
}

.file-upload-label input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.file-upload-zone {
  position: relative;
  min-height: 120px;
  padding: 24px 20px;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(250, 247, 242, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, background 0.2s;
}
.file-upload-zone:hover,
.file-upload-zone.drag-over {
  border-color: var(--ink-green);
  background: rgba(91, 140, 90, 0.06);
}
.file-upload-placeholder {
  font-size: 14px;
  color: var(--ink-muted);
}
.file-upload-zone.has-file .file-upload-placeholder {
  display: none;
}
.file-upload-selected {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-green);
}
.file-upload-hint {
  display: block;
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: normal;
  margin-top: 4px;
}
.audio-duration {
  display: block;
  font-size: 12px;
  color: var(--ink-green);
  font-weight: 500;
  margin-top: 4px;
}
.progress-wrap {
  grid-column: 1 / -1;
  margin: 8px 0;
}
.progress-bar {
  height: 8px;
  background: var(--line);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--ink-green), var(--ink-deep));
  border-radius: 4px;
  width: 0%;
  transition: width 0.2s ease;
}
.progress-wrap.indeterminate .progress-fill {
  width: 30%;
  animation: progressIndeterminate 1.2s ease-in-out infinite;
}
@keyframes progressIndeterminate {
  0%, 100% { transform: translateX(-100%); }
  50% { transform: translateX(350%); }
}
.progress-meta { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.progress-text { font-size: 13px; color: var(--ink-muted); }
.progress-elapsed { font-size: 12px; color: var(--ink-muted); }

.result-empty-hint {
  margin: 0 0 12px;
  padding: 16px;
  font-size: 14px;
  color: var(--ink-muted);
  text-align: center;
  background: rgba(228, 215, 208, 0.2);
  border-radius: var(--radius-btn);
}
.result-block.has-content .result-empty-hint { display: none; }

.result-block {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.context-input-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 0;
  list-style: none;
}
.context-input-summary::-webkit-details-marker { display: none; }
.context-input-block[open] .context-input-summary { margin-bottom: 8px; }

/* 转写上下文输入块 - 专业 UI 设计 */
.context-input-block {
  grid-column: 1 / -1;
  padding: 16px;
  background: linear-gradient(135deg, rgba(91, 140, 90, 0.04) 0%, rgba(44, 62, 80, 0.03) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  border-left: 3px solid var(--ink-green);
}
.context-input-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.context-input-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-deep);
}
.context-input-optional {
  font-size: 11px;
  color: var(--ink-muted);
  padding: 2px 8px;
  background: var(--soft);
  border-radius: 999px;
  font-weight: normal;
}
.context-input-hint {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.5;
}
.context-input-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.context-chip {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-deep);
  background: var(--paper-light);
  border: 1px solid var(--line);
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: all 0.2s ease;
}
.context-chip:hover {
  background: var(--ink-lotus);
  border-color: var(--ink-green);
  color: var(--ink-green);
}
.context-chip:active {
  transform: scale(0.98);
}
.context-input-field {
  margin-top: 0;
}
.context-input-field textarea {
  min-height: 72px;
  max-height: 160px;
  resize: vertical;
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.6;
  background: var(--paper-light);
  border: 1px solid var(--line);
  border-radius: var(--radius-btn);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.context-input-field textarea:focus {
  border-color: var(--ink-green);
  box-shadow: 0 0 0 2px rgba(91, 140, 90, 0.15);
}
.context-input-field textarea::placeholder {
  color: var(--ink-muted);
  opacity: 0.8;
}

/* 转写结果区标题栏 */
.result-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.result-section-head h3 {
  margin: 0;
  padding: 0;
  border: none;
}
.result-copy-btn {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-btn);
  background: var(--ink-deep);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}
.result-copy-btn:hover {
  background: #3d5266;
}
.result-prompt-tip {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--ink-muted);
}

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--ink);
  font-weight: 600;
}

input,
textarea,
select,
button {
  font: inherit;
  border: 1px solid var(--line);
  border-radius: var(--radius-btn);
  padding: 10px 11px;
  transition: all 0.2s ease;
}

input,
textarea,
select {
  background: var(--paper-light);
}

input:focus,
textarea:focus,
select:focus,
button:focus-visible,
.tab-btn:focus-visible {
  outline: none;
  border-color: var(--ink-deep);
  box-shadow: 0 0 0 2px rgba(44, 62, 80, 0.2);
}

button {
  background: linear-gradient(160deg, var(--ink-accent) 0%, var(--ink-accent-soft) 100%);
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.05em;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(197, 61, 67, 0.35);
  background: linear-gradient(160deg, #b8363c 0%, var(--ink-accent) 100%);
}
button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

button.is-loading {
  position: relative;
}
button.is-loading::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 8px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn-secondary {
  background: var(--soft) !important;
  color: var(--ink) !important;
  border: 1px solid var(--line) !important;
  box-shadow: none !important;
}
.btn-secondary:hover {
  background: var(--line) !important;
  transform: none;
  box-shadow: none !important;
}

.btn-outline {
  background: transparent !important;
  color: var(--ink-deep) !important;
  border: 1px solid var(--ink-deep) !important;
  box-shadow: none !important;
}
.btn-outline:hover {
  background: rgba(44, 62, 80, 0.06) !important;
  transform: none;
}

ul {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

li {
  background: var(--paper-light);
  border-radius: var(--radius-btn);
  border: 1px solid var(--line);
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.55;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
li:hover {
  border-color: var(--ink-lotus);
  box-shadow: 0 2px 12px rgba(44, 62, 80, 0.06);
}

li strong {
  color: var(--ink-deep);
}

.student-item {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.student-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(44, 62, 80, 0.08);
}
.student-item-body { flex: 1; min-width: 0; }
.student-item-actions {
  display: flex;
  gap: 8px;
}
.student-item-actions button {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 6px;
}
.student-item-actions .btn-delete {
  background: var(--danger);
  color: #fff;
  border: none;
}
.student-item-actions .btn-delete:hover {
  background: #a83237;
}

/* 学生档案优化 */
.student-list-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.student-list-title { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink-deep); }
.btn-add-student { padding: 8px 16px !important; font-size: 14px !important; }
.student-item-goal { font-size: 12px; color: var(--ink-muted); margin-top: 4px; line-height: 1.4; }
.modal-student .modal-content { max-width: 420px; }
.modal-field { display: grid; gap: 6px; margin-bottom: 12px; }
.modal-field .field-label { font-size: 13px; font-weight: 600; color: var(--ink); }
.modal-student select { width: 100%; }

/* 学生详情弹窗 */
.modal-student-detail .modal-content { max-width: 480px; }
.student-detail-info { margin: 12px 0; padding: 12px; background: rgba(228, 215, 208, 0.2); border-radius: var(--radius-btn); }
.student-detail-row { font-size: 14px; line-height: 1.6; margin-bottom: 8px; display: flex; gap: 8px; }
.student-detail-row:last-child { margin-bottom: 0; }
.student-detail-label { color: var(--ink-muted); flex-shrink: 0; width: 100px; }
.student-detail-value { flex: 1; word-break: break-word; }
.student-detail-empty-val { color: var(--ink-muted); font-style: italic; }
.student-detail-schedules { margin: 16px 0; }
.student-detail-schedules h4,
.student-detail-plans h4 { margin: 0 0 8px; font-size: 14px; color: var(--ink-deep); }
.student-detail-plans { margin-top: 12px; }
.student-detail-plans ul { margin: 0; padding: 0; list-style: none; max-height: 120px; overflow-y: auto; }
.student-detail-schedules ul { margin: 0; padding: 0; list-style: none; max-height: 180px; overflow-y: auto; }
.student-detail-schedule-item { padding: 8px 12px; font-size: 13px; border-radius: var(--radius-btn); background: var(--paper-light); border: 1px solid var(--line); margin-bottom: 6px; }
.student-detail-empty { margin: 0; padding: 12px; font-size: 13px; color: var(--ink-muted); }
.modal-actions-detail { flex-wrap: wrap; gap: 8px; }
.cal-item-clickable { cursor: pointer; }
.cal-item-clickable:hover { opacity: 0.9; }
.student-item { align-items: center; gap: 12px; }
.student-item-avatar {
  width: 40px; height: 40px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--ink-lotus); border-radius: 50%; font-size: 18px;
}
.student-item-body { flex: 1; min-width: 0; }
.student-item-name { font-size: 15px; font-weight: 600; color: var(--ink-deep); margin-bottom: 4px; }
.student-item-grade { font-size: 12px; font-weight: normal; color: var(--ink-muted); }
.student-item-meta { font-size: 13px; color: var(--ink-muted); }
.student-item-notes { font-size: 12px; color: var(--ink-muted); margin-top: 4px; line-height: 1.4; }

/* 课表管理优化 */
.schedule-form { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.schedule-form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; align-items: end; }
.schedule-field { display: grid; gap: 6px; }
.schedule-field .field-label { font-size: 13px; font-weight: 600; color: var(--ink); }
.schedule-field-student { min-width: 160px; }
.schedule-field-flex { flex: 1; min-width: 120px; }
.schedule-form-actions { display: flex; align-items: flex-end; }
.schedule-date-wrap { display: flex; gap: 6px; align-items: center; }
.schedule-date-wrap input { flex: 1; }
.btn-today {
  padding: 8px 12px !important;
  min-height: 40px !important;
  font-size: 13px !important;
  background: var(--soft) !important;
  color: var(--ink-deep) !important;
  border: 1px solid var(--line) !important;
  flex-shrink: 0;
}
.btn-today:hover { background: var(--line) !important; }
.cal-nav-btn { padding: 8px 12px; font-size: 13px; }
.cal-this-week { margin-left: 8px; }

@media (max-width: 640px) {
  .student-form-row { grid-template-columns: 1fr; }
  .schedule-form-row { grid-template-columns: 1fr; }
  .schedule-form-actions { margin-top: 8px; }
}

.record-item {
  display: block !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.record-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(44, 62, 80, 0.08);
}
.record-item .record-header {
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.record-item .record-time {
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: normal;
}
.record-item .record-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.record-item .record-field {
  font-size: 13px;
  line-height: 1.5;
}
.record-item .record-label {
  display: inline-block;
  min-width: 72px;
  color: var(--ink-muted);
  font-weight: 600;
}

.record-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: rgba(228, 215, 208, 0.3);
  border-radius: var(--radius-btn);
  border: 1px solid var(--line);
}
.record-filters label {
  margin: 0;
}
.record-filters select,
.record-filters input[type="date"] {
  min-width: 120px;
}
.record-filters button {
  padding: 8px 14px;
  font-size: 13px;
}
.record-filters #recordFilterBtn {
  background: linear-gradient(160deg, var(--ink-deep) 0%, #3d5266 100%);
  color: #fff;
}
.record-filters #recordFilterReset {
  background: var(--soft);
  color: var(--ink);
  border: 1px solid var(--line);
}
.record-filters #recordFilterReset:hover {
  background: var(--line);
}
.record-pagination {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.pagination-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.pagination-btn {
  padding: 6px 12px;
  font-size: 13px;
}
.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.pagination-info {
  font-size: 13px;
  color: var(--ink-muted);
}

.record-item-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}
.record-item-actions button {
  padding: 4px 10px;
  font-size: 12px;
}
.record-item-actions .btn-delete {
  background: var(--danger);
}
.record-item-actions .btn-delete:hover {
  background: #a83237;
}

.lesson-plan-content {
  margin: 6px 0 0;
  padding: 8px;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 120px;
  overflow: hidden;
  background: rgba(44, 62, 80, 0.04);
  border-radius: var(--radius-btn);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(44, 62, 80, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal[hidden] {
  display: none;
}
.modal-content {
  background: var(--paper-light);
  border-radius: var(--radius);
  padding: 20px;
  max-width: 480px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(44, 62, 80, 0.2);
  border: 1px solid var(--line);
}
.modal-content h3 {
  margin: 0 0 16px;
}
.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}
.modal-actions button {
  flex: 1;
}
.modal-actions button[type="button"] {
  background: var(--soft);
  color: var(--ink);
}
.modal-actions button[type="button"]:hover {
  background: var(--line);
}
.result-section {
  margin-bottom: 20px;
}
.result-section:last-child {
  margin-bottom: 0;
}
.result-section h3 {
  margin-top: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.result-prompt {
  margin-top: 10px;
}
.prompt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.prompt-title-tools {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.prompt-tools {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.prompt-collapse-btn {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 12px;
  border-radius: var(--radius-btn);
  background: var(--ink-deep);
  color: #fff;
  max-width: none;
}
.prompt-collapse-btn:hover {
  background: #3d5266;
}
.prompt-speech-btn {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 12px;
  border-radius: var(--radius-btn);
  background: var(--ink-green);
  color: #fff;
  max-width: none;
}
.prompt-speech-btn.listening {
  background: var(--ink-accent);
}
.prompt-icon-btn {
  min-height: 28px;
  width: 28px;
  padding: 0;
  border-radius: var(--radius-btn);
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ink-deep);
  color: #fff;
}
.prompt-speech-tip {
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 500;
  white-space: nowrap;
}
.result-prompt textarea {
  min-height: 68px;
  background: var(--paper-light);
}

.prompt-popup-btn {
  padding: 4px 10px;
  font-size: 12px;
  background: var(--soft) !important;
  color: var(--ink-deep) !important;
  border: 1px solid var(--line) !important;
  box-shadow: none !important;
}
.prompt-popup-btn:hover {
  background: var(--ink-lotus) !important;
}

.prompt-popup-trigger .prompt-preview {
  margin: 0;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--ink-muted);
  background: rgba(228, 215, 208, 0.2);
  border: 1px dashed var(--line);
  border-radius: var(--radius-btn);
  cursor: pointer;
  min-height: 44px;
  line-height: 1.5;
}
.prompt-popup-trigger .prompt-preview:hover {
  border-color: var(--ink-green);
  color: var(--ink);
}
.prompt-popup-trigger textarea[hidden] {
  display: none !important;
}

.modal-content.modal-prompt {
  min-width: 360px;
}
.modal-content.modal-prompt textarea {
  width: 100%;
  min-height: 120px;
  margin: 12px 0;
  padding: 12px 14px;
  resize: vertical;
}
.result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 0 10px;
}
.result-actions button {
  min-height: 38px;
  padding: 8px 14px;
  font-size: 13px;
}
.editable-hint {
  font-size: 11px;
  font-weight: normal;
  color: var(--ink-muted);
  opacity: 0.8;
}
.source-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  color: var(--ink-deep);
  background: rgba(91, 140, 90, 0.12);
  border: 1px solid rgba(91, 140, 90, 0.25);
  vertical-align: middle;
}
.source-tag[hidden] {
  display: none !important;
}
.editable-pre {
  border-left: 3px solid var(--ink-accent) !important;
}
.scrollable-text {
  max-height: 260px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-btn);
  border: 1px solid var(--line);
  background: var(--paper-light);
}
.scrollable-text::-webkit-scrollbar {
  width: 8px;
}
.scrollable-text::-webkit-scrollbar-track {
  background: rgba(44, 62, 80, 0.06);
  border-radius: 4px;
}
.scrollable-text::-webkit-scrollbar-thumb {
  background: rgba(44, 62, 80, 0.2);
  border-radius: 4px;
}
.scrollable-text::-webkit-scrollbar-thumb:hover {
  background: rgba(44, 62, 80, 0.3);
}
.result-block .scrollable-text pre {
  margin: 0;
  padding: 12px 14px;
  border: none;
  background: transparent;
  border-radius: 0;
  border-left: 3px solid var(--ink-accent) !important;
  min-height: 60px;
  white-space: pre-wrap;
  line-height: 1.8;
  color: var(--ink);
  font-size: 14px;
}
.result-block pre {
  min-height: 60px;
  margin: 0;
  padding: 12px 14px;
  background: var(--paper-light);
  border: 1px solid var(--line);
  border-radius: var(--radius-btn);
  white-space: pre-wrap;
  line-height: 1.8;
  color: var(--ink);
  font-size: 14px;
}
.result-block pre:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(44, 62, 80, 0.2);
}

.homework-block {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 2px dashed rgba(44, 62, 80, 0.15);
  background: linear-gradient(180deg, rgba(250, 247, 242, 0.9) 0%, rgba(228, 215, 208, 0.2) 100%);
  border-radius: var(--radius);
  padding: 20px;
  margin-left: -4px;
  margin-right: -4px;
  margin-bottom: -4px;
}
.homework-title {
  margin-top: 0 !important;
  margin-bottom: 12px !important;
  color: var(--ink-deep);
}
.homework-form {
  margin-bottom: 12px;
}
.homework-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.homework-actions button {
  padding: 10px 20px;
}
.save-main-btn {
  padding: 10px 24px;
  font-size: 15px;
  box-shadow: 0 2px 12px rgba(197, 61, 67, 0.25);
}
.empty-state {
  color: var(--ink-muted) !important;
  font-style: normal;
  text-align: center;
  padding: 32px 24px !important;
  font-size: 14px;
  opacity: 0.95;
  border: 2px dashed var(--line);
  background: rgba(228, 215, 208, 0.15);
  border-radius: var(--radius);
}
.empty-state::before {
  content: "📭";
  display: block;
  font-size: 32px;
  margin-bottom: 12px;
  opacity: 0.7;
}

@media (max-width: 900px) {
  .tab-btn {
    padding: 10px 16px;
    font-size: 14px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 22px 16px;
  }
  .hero h1 {
    font-size: 22px;
  }
  .hero p {
    font-size: 13px;
  }

  .container {
    padding: 14px 12px 24px;
  }

  .card {
    padding: 16px;
  }

  .card-accent {
    padding: 18px;
  }

  #transcribeForm {
    grid-template-columns: 1fr;
  }

  .homework-actions {
    flex-direction: column;
  }
  .homework-actions button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .file-upload-zone {
    min-height: 100px;
    padding: 20px 16px;
  }
  .tab-icon {
    display: none;
  }

  input, textarea, select {
    font-size: 16px;
  }

  .hero {
    padding: 18px 12px;
  }
  .hero h1 {
    font-size: 20px;
  }
  .hero-tags span {
    padding: 6px 10px;
    font-size: 11px;
  }

  .container {
    padding: 12px 10px 20px;
  }

  .card, .card-accent {
    padding: 14px;
    border-radius: 12px;
  }

  h2 {
    font-size: 18px;
  }
  h3 {
    font-size: 14px;
  }

  .record-filters {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
  }
  .record-filters select,
  .record-filters input[type="date"] {
    min-width: 0;
  }
  .record-filters button {
    min-height: 44px;
  }

  .pagination-inner {
    flex-direction: column;
    gap: 8px;
  }
  .pagination-btn {
    width: 100%;
    min-height: 44px;
  }

  .modal-content {
    width: 95%;
    max-height: 85vh;
    padding: 16px;
    margin: 10px;
  }
  .modal-actions {
    flex-direction: column;
  }
  .modal-actions button {
    min-height: 44px;
  }

  .homework-block {
    margin-left: 0;
    margin-right: 0;
    padding: 16px;
  }

  .scrollable-text {
    max-height: 200px;
  }

  .record-item-actions button,
  .student-item-actions button {
    min-height: 40px;
    padding: 8px 14px;
  }
}

@supports (padding: max(0px)) {
  body {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
  }
  .container {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
}

.schedule-calendar-wrap {
  margin-top: 16px;
}
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.cal-header h3 {
  margin: 0;
  flex: 1;
  text-align: center;
  font-size: 1rem;
}
.cal-header button {
  padding: 8px 14px;
  border-radius: var(--radius-btn);
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  transition: background 0.2s;
}
.cal-header button:hover {
  background: var(--line);
}
.schedule-calendar {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
  user-select: none;
}
.schedule-calendar:active {
  cursor: grabbing;
}
.cal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  min-width: 560px;
}
.cal-table th,
.cal-table td {
  border: 1px solid var(--line);
  padding: 6px 8px;
  vertical-align: top;
}
.cal-table th {
  background: var(--soft);
  color: var(--ink);
  font-weight: 600;
}
.cal-time-col {
  width: 52px;
  background: rgba(228, 215, 208, 0.3);
  color: var(--ink-muted);
  font-size: 11px;
}
.cal-cell {
  min-width: 90px;
  min-height: 32px;
}
.cal-item {
  background: rgba(91, 140, 90, 0.12);
  border-radius: 6px;
  padding: 4px 6px;
  margin-bottom: 4px;
  font-size: 11px;
  line-height: 1.3;
  border: 1px solid rgba(91, 140, 90, 0.3);
}
.cal-item:last-child {
  margin-bottom: 0;
}
.badge-ended {
  font-size: 10px;
  color: var(--ink-green);
  background: rgba(91, 140, 90, 0.15);
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 600;
}
.badge-legacy {
  font-size: 10px;
  color: var(--ink-muted);
  background: var(--soft);
  padding: 2px 6px;
  border-radius: 6px;
}
.cal-item-ended {
  border-color: var(--ink-green);
  background: rgba(91, 140, 90, 0.18);
}

.knowledge-search {
  margin-top: 16px;
}
.knowledge-search h3 {
  margin-bottom: 8px;
}
.search-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.search-row input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.knowledge-result-item {
  margin-bottom: 12px;
  padding: 10px;
  background: var(--soft);
  border-radius: 8px;
  border: 1px solid var(--line);
}
.knowledge-result-meta {
  font-size: 12px;
  color: var(--ink-muted);
  margin-bottom: 6px;
}
.knowledge-result-text {
  margin: 0;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
