:root {
  --primary: #007AFF;
  --primary-light: #4DA3FF;
  --primary-dark: #0056CC;
  --primary-gradient: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);
  --accent: #5AC8FA;
  --accent-warm: #FF9500;
  --success: #34C759;
  --warning: #FF9500;
  --danger: #FF3B30;
  --background: #FBFBFD;
  --card: #FFFFFF;
  --text-primary: #1D1D1F;
  --text-secondary: #6B7280;
  --text-tertiary: #9CA3AF;
  --border: #E5E7EB;
  --border-light: #F2F2F5;
  --shadow: rgba(0, 0, 0, 0.03);
  --shadow-md: rgba(0, 0, 0, 0.06);
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --header-height: 56px;
  --tabbar-height: 56px;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: 100%;
  margin: 0 auto;
  background: var(--background);
  position: relative;
  overflow: hidden;
}
@media (min-width: 768px) {
  .app-container { max-width: 480px; box-shadow: 0 0 40px var(--shadow-md); }
}
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100vw;
  height: calc(var(--header-height) + var(--safe-area-top));
  padding-top: var(--safe-area-top);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (min-width: 768px) {
  .app-header { left: 50%; transform: translateX(-50%); max-width: 480px; }
}
.app-header-content {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
}
.app-header-logo { width: 34px; height: 34px; border-radius: 50%; vertical-align: middle; object-fit: cover; display: block; }
.pipi-avatar-ring {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--primary-gradient);
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.22);
  flex-shrink: 0;
}
.pipi-avatar-ring--header { width: 40px; height: 40px; }
.pipi-avatar-ring--sidebar { width: 44px; height: 44px; }
.pipi-avatar-ring--sidebar img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; display: block; }
.pipi-avatar-ring--chat-head { width: 40px; height: 40px; }
.pipi-avatar-ring--chat-head img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; display: block; }
.app-header-back {
  position: absolute;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 16px;
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 0;
}
.app-header-back:active { opacity: 0.6; }
.app-header-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
}
.app-header-action {
  position: absolute;
  right: 16px;
  font-size: 14px;
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 0;
}
.sub-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0 16px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 16px;
}
.sub-header-back {
  font-size: 20px;
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-weight: 500;
}
.sub-header-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
}
.app-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-top: calc(var(--header-height) + var(--safe-area-top));
  padding-bottom: calc(var(--tabbar-height) + var(--safe-area-bottom) + 24px);
}
.app-content::-webkit-scrollbar { display: none; }
.tab-content { display: none; min-height: 100%; padding: 20px 16px; }
.tab-content.active { display: block; }
.app-tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--tabbar-height) + var(--safe-area-bottom));
  padding: 0 8px;
  padding-bottom: var(--safe-area-bottom);
  background: rgba(251, 251, 253, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  z-index: 100;
}
@media (min-width: 768px) {
  .app-tabbar { left: 50%; transform: translateX(-50%); max-width: 480px; }
}
.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  color: var(--text-tertiary);
  transition: all 0.15s ease;
  -webkit-user-select: none;
  user-select: none;
  position: relative;
  padding: 6px 0;
}
.tab-item:active { transform: scale(0.96); }
.tab-item.active { color: var(--primary); }
.tab-icon { 
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease, filter 0.2s ease;
  filter: grayscale(0.3);
  opacity: 0.55;
}
.tab-icon svg {
  width: 100%;
  height: 100%;
}
.tab-item.active .tab-icon { 
  transform: scale(1.12);
  filter: grayscale(0);
  opacity: 1;
}
.tab-label { font-size: 10px; font-weight: 600; letter-spacing: 0.2px; }
.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px var(--shadow);
  border: 1px solid var(--border-light);
}
.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
  margin-bottom: 14px;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.template-square-banner {
  margin-top: 12px;
  margin-bottom: 16px;
  padding: 16px 18px;
  border-radius: var(--radius-xl);
  background: var(--primary-gradient);
  border: none;
  box-shadow: 0 8px 22px rgba(0, 122, 255, 0.24);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.template-square-banner:active {
  transform: scale(0.985);
  box-shadow: 0 4px 14px rgba(0, 122, 255, 0.2);
}
.template-square-banner-inner {
  display: flex;
  align-items: center;
  gap: 14px;
}
.template-square-banner-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}
.template-square-banner-icon svg { width: 26px; height: 26px; }
.template-square-banner-body { flex: 1; min-width: 0; }
.template-square-banner-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  line-height: 1.3;
}
.template-square-banner-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
  letter-spacing: 0.2px;
}
.template-square-banner-desc {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 5px;
  line-height: 1.4;
}
.template-square-banner-arrow {
  color: rgba(255, 255, 255, 0.92);
  font-size: 24px;
  font-weight: 300;
  flex-shrink: 0;
  line-height: 1;
}
.template-ref-section-label {
  font-size: 13px;
  font-weight: 700;
  color: #5856D6;
  margin: 14px 0 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.template-ref-section-label::before {
  content: '';
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(180deg, #5856D6, #007AFF);
}
.template-ref-card {
  padding: 12px;
  margin-bottom: 8px;
  border-radius: var(--radius-md);
  border: 1.5px solid rgba(88, 86, 214, 0.35);
  background: linear-gradient(135deg, rgba(88, 86, 214, 0.08) 0%, rgba(0, 122, 255, 0.05) 100%);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.template-ref-card:active { transform: scale(0.99); }
.template-ref-card.is-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(0, 122, 255, 0.15);
}
.template-ref-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: linear-gradient(135deg, #5856D6, #007AFF);
  color: #fff;
  letter-spacing: 0.3px;
}
.template-ref-tag-owner {
  background: rgba(88, 86, 214, 0.18);
  color: #5856D6;
}
.template-ref-tag-muted {
  background: var(--border-light);
  color: var(--text-tertiary);
  font-weight: 600;
}
.template-ref-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.template-ref-stat {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text-secondary);
  box-shadow: 0 0 0 0.5px var(--border-light);
}
.template-ref-stat strong {
  color: #5856D6;
  font-weight: 700;
}
.square-template-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px 0 8px;
}
.square-empty {
  text-align: center;
  padding: 36px 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.5;
}
.square-empty span {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-tertiary);
}
.square-card {
  position: relative;
  padding: 12px 12px 11px 14px;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 0.5px solid var(--border-light);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.028);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.square-card::before {
  content: '';
  position: absolute;
  inset: 12px auto 12px 0;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: rgba(0, 122, 255, 0.28);
}
.square-card:active {
  transform: scale(0.985);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
.square-card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 2px;
}
.square-grade-chip {
  max-width: 96px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 122, 255, 0.08);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}
.square-grade-chip.is-muted {
  background: var(--border-light);
  color: var(--text-secondary);
}
.square-card-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--text-primary);
  line-height: 1.3;
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.square-card-owner {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.square-metrics {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}
.square-metric {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  min-width: 0;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--background);
  color: var(--text-secondary);
  box-shadow: inset 0 0 0 0.5px var(--border-light);
}
.square-metric-value {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.1px;
  line-height: 1;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.square-metric-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  line-height: 1;
}
.square-card-desc {
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-secondary);
  margin: 0 0 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.square-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.square-ref-btn {
  min-height: 32px;
  padding: 6px 12px;
  border: none;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  box-shadow: 0 2px 7px rgba(0, 122, 255, 0.16);
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease;
  flex-shrink: 0;
}
.square-ref-btn:active {
  transform: scale(0.98);
  opacity: 0.92;
}
.square-ref-done {
  min-height: 32px;
  padding: 6px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--border-light);
  border-radius: 999px;
  flex-shrink: 0;
}
.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--background);
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--primary);
  background: rgba(0, 122, 255, 0.04);
}
.upload-zone-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.8; }
.upload-zone-text { font-size: 15px; color: var(--text-secondary); margin-bottom: 4px; }
.upload-zone-hint { font-size: 12px; color: var(--text-tertiary); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  -webkit-user-select: none;
  user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--primary-gradient); color: white; box-shadow: 0 4px 12px rgba(0, 122, 255, 0.25); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0, 122, 255, 0.3); }
.btn-secondary { background: var(--border-light); color: var(--text-primary); }
.btn-secondary:hover { background: var(--border); }
.btn-outline { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: rgba(0, 122, 255, 0.08); }
.btn-danger { background: var(--border-light); color: var(--text-secondary); }
.btn-danger:hover { background: var(--border); color: var(--text-primary); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-lg { padding: 14px 24px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
  font-size: 18px;
}
.list-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: var(--card);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid var(--border-light);
}
.list-item:active { background: var(--border-light); transform: scale(0.99); }
.list-item-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-right: 12px;
  flex-shrink: 0;
}
.list-item-content { flex: 1; min-width: 0; }
.list-item-title { font-size: 16px; font-weight: 500; color: var(--text-primary); }
.list-item-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.list-item-arrow { color: var(--text-tertiary); font-size: 14px; margin-left: 8px; }
.list-item-badge {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  margin-left: 8px;
}
.badge-success { background: rgba(52, 199, 89, 0.15); color: var(--success); }
.badge-warning { background: rgba(255, 149, 0, 0.15); color: var(--warning); }
.badge-danger { background: rgba(255, 59, 48, 0.15); color: var(--danger); }
.badge-default { background: var(--border-light); color: var(--text-secondary); }
.class-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid var(--border-light);
}
.class-card:active { transform: scale(0.98); border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.08); }
.class-card-name { font-size: 17px; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
.class-card-stats { display: flex; gap: 16px; font-size: 13px; color: var(--text-secondary); }
.class-card-stat { display: flex; align-items: center; gap: 4px; }
.student-row {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  background: var(--card);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid var(--border-light);
}
.student-row:active { background: var(--border-light); }
.student-id { width: 32px; font-size: 14px; color: var(--text-secondary); font-weight: 500; }
.student-name { flex: 1; font-size: 15px; font-weight: 500; }
.student-level {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
}
.level-good { background: var(--success); }
.level-medium { background: var(--warning); }
.level-poor { background: var(--danger); }
.student-count { font-size: 13px; color: var(--text-tertiary); margin-right: 8px; }
.tabs {
  display: flex;
  background: var(--border-light);
  border-radius: var(--radius-sm);
  padding: 2px;
  margin-bottom: 16px;
}
.tab-btn {
  flex: 1;
  padding: 8px 16px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}
.tab-btn.active { background: var(--card); color: var(--text-primary); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
.search-box {
  display: flex;
  align-items: center;
  background: var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 12px;
}
.search-box-icon { font-size: 16px; color: var(--text-tertiary); margin-right: 8px; }
.search-box input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 15px;
  outline: none;
  color: var(--text-primary);
}
.search-box input::placeholder { color: var(--text-tertiary); }
.input-group { margin-bottom: 16px; }
.input-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.input-field {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 15px;
  background: var(--card);
  color: var(--text-primary);
  transition: border-color 0.2s ease;
}
.input-field:focus { outline: none; border-color: var(--primary); }
.input-field::placeholder { color: var(--text-tertiary); }
textarea.input-field { min-height: 100px; resize: vertical; font-family: inherit; }
select.input-field { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238E8E93' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.content-box {
  background: var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 15px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 400px;
  overflow-y: auto;
}
.content-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.content-box-title { font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 200;
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal-content {
  background: var(--card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px 16px calc(24px + var(--safe-area-bottom));
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.modal-title { font-size: 18px; font-weight: 600; }
.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
}
.modal-close:active { background: var(--border); }
.confirm-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.confirm-overlay.active { display: flex; }
.confirm-dialog {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 300px;
  text-align: center;
  animation: scaleIn 0.2s ease;
}
@keyframes scaleIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.confirm-icon { font-size: 48px; margin-bottom: 12px; }
.confirm-title { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.confirm-message { font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; line-height: 1.5; }
.confirm-actions { display: flex; gap: 12px; }
.confirm-actions .btn { flex: 1; }
.float-btn {
  position: fixed;
  right: 16px;
  bottom: calc(var(--tabbar-height) + var(--safe-area-bottom) + 20px);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: white;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 122, 255, 0.2);
  cursor: pointer;
  border: none;
  z-index: 90;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
@media (min-width: 768px) {
  .float-btn { right: calc(50% - 240px + 16px); }
}
.float-btn:active { transform: scale(0.92); }
.float-btn:hover { transform: scale(1.05); box-shadow: 0 6px 20px rgba(0, 122, 255, 0.3); }
.float-btn-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; transition: transform 0.3s; }
.float-btn:hover .float-btn-avatar { transform: scale(1.05); }
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}
.empty-icon { font-size: 64px; margin-bottom: 16px; opacity: 0.6; }
.empty-text { font-size: 15px; margin-bottom: 20px; }
.loading-spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid rgba(0, 122, 255, 0.12);
  border-top-color: var(--primary);
  border-right-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 32px auto;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.loading-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  z-index: 250;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.loading-overlay.active { display: flex; }
.loading-text { margin-top: 16px; font-size: 14px; color: var(--text-secondary); }
.toast {
  position: fixed;
  top: calc(var(--header-height) + var(--safe-area-top) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: white;
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 13px;
  z-index: 400;
  opacity: 0;
  transition: all 0.3s ease;
  max-width: calc(100% - 40px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.action-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.action-row .btn { flex: 1; min-width: 100px; }
.preview-image {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: var(--radius-md);
  margin-top: 12px;
}
.preview-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.preview-item { width: 88px; height: 88px; border-radius: var(--radius-md); overflow: hidden; background: var(--border-light); position: relative; }
.preview-item img { width: 100%; height: 100%; object-fit: cover; }
.preview-item.add { display: flex; align-items: center; justify-content: center; color: var(--primary); background: rgba(0, 122, 255, 0.06); font-size: 26px; cursor: pointer; }
.preview-item.add:active { transform: scale(0.96); }
.preview-remove { position: absolute; top: 4px; right: 4px; width: 18px; height: 18px; border-radius: 50%; background: rgba(0,0,0,0.6); color: #fff; font-size: 12px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.preview-zoom { position: absolute; left: 4px; bottom: 4px; padding: 2px 6px; border-radius: 10px; background: rgba(0,0,0,0.5); color: #fff; font-size: 10px; }
.image-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: none; align-items: center; justify-content: center; z-index: 260; }
.image-modal.active { display: flex; }
.image-modal img { max-width: 92vw; max-height: 86vh; border-radius: var(--radius-md); background: #000; }
.image-modal-close { position: fixed; top: calc(var(--header-height) + 12px); right: 16px; width: 34px; height: 34px; border-radius: 50%; background: rgba(0,0,0,0.6); color: #fff; font-size: 18px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.preview-count { margin-top: 8px; font-size: 12px; color: var(--text-secondary); }
.file-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--background);
  border-radius: var(--radius-sm);
  margin-top: 12px;
}
.progress-card { background: var(--background); border-radius: var(--radius-sm); padding: 12px; margin-top: 12px; }
.progress-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; }
.progress-track { background: var(--border); border-radius: 6px; height: 6px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: var(--primary-gradient); transition: width 0.3s; }
.progress-detail { margin-top: 6px; font-size: 12px; color: var(--text-tertiary); }
.upload-card { overflow: hidden; max-height: 560px; opacity: 1; transform: translateY(0); transition: max-height 0.32s ease, opacity 0.24s ease, transform 0.32s ease, padding 0.32s ease, margin 0.32s ease, border-width 0.32s ease; }
.upload-card.upload-card-hidden { max-height: 0; opacity: 0; transform: translateY(-8px); padding-top: 0; padding-bottom: 0; margin-bottom: 0; border-width: 0; pointer-events: none; }
.file-icon { font-size: 32px; }
.file-name { font-size: 14px; color: var(--text-secondary); flex: 1; word-break: break-all; }
.history-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 0;
  margin: 0 -16px;
  padding: 0 16px;
  -webkit-overflow-scrolling: touch;
}
.history-scroll::-webkit-scrollbar { display: none; }
.history-item {
  flex-shrink: 0;
  width: 158px;
  padding: 12px;
  background: var(--background);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}
.history-item:active { transform: scale(0.97); background: var(--border); }
.history-item-title { font-size: 13px; font-weight: 500; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-item-time { font-size: 11px; color: var(--text-tertiary); white-space: nowrap; }
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.page-title { font-size: 22px; font-weight: 700; color: var(--text-primary); }
.assignment-card {
  background: var(--card);
  border-radius: var(--radius-xl);
  padding: 18px 18px 14px;
  margin-bottom: 10px;
  border: 1px solid var(--border-light);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.assignment-card:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,0.06); border-color: var(--border); }
.assignment-card-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.assignment-card-mark { width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: rgba(0,122,255,0.1); color: var(--primary); flex-shrink: 0; }
.assignment-card-mark .ui-icon { width: 20px; height: 20px; }
.assignment-card-info { flex: 1; min-width: 0; }
.assignment-title { font-size: 16px; font-weight: 600; line-height: 1.3; color: var(--text-primary); margin-bottom: 4px; word-break: break-word; }
.assignment-stats { font-size: 13px; color: var(--text-secondary); display: inline-flex; align-items: center; gap: 6px; }
.assignment-stats .stats-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; background: var(--border-light); border-radius: 999px; font-size: 12px; color: var(--text-secondary); }
.assignment-actions { display: flex; gap: 7px; flex-wrap: nowrap; padding-top: 10px; border-top: 0.5px solid var(--border-light); }
.action-chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  flex: 1 1 0; min-width: 0; white-space: nowrap;
  padding: 7px 8px; min-height: 32px;
  border-radius: 10px; border: none;
  background: var(--border-light); color: var(--text-primary);
  font-size: 12px; font-weight: 500; font-family: inherit;
  cursor: pointer; transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
  -webkit-user-select: none; user-select: none;
}
.action-chip:hover { background: var(--border); }
.action-chip:active { transform: scale(0.96); }
.action-chip .ui-icon { width: 14px; height: 14px; opacity: 0.85; }
.action-chip-primary { background: rgba(0,122,255,0.1); color: var(--primary); }
.action-chip-primary:hover { background: rgba(0,122,255,0.16); }
.action-chip-primary .ui-icon { opacity: 1; }
.action-chip-danger { color: var(--text-secondary); background: var(--border-light); }
.action-chip-danger:hover { color: var(--danger); background: rgba(255,59,48,0.08); }
.action-chip-danger:active { background: rgba(255,59,48,0.14); }
.action-chip-icon { flex: 0 0 36px; padding: 7px; color: var(--text-tertiary); }
.grade-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}
.grade-good { background: rgba(52, 199, 89, 0.15); color: var(--success); }
.grade-medium { background: rgba(255, 149, 0, 0.15); color: var(--warning); }
.grade-poor { background: rgba(255, 59, 48, 0.15); color: var(--danger); }
.setting-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: var(--card);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  cursor: pointer;
  border: 1px solid var(--border-light);
}
.setting-item:active { background: var(--border-light); }
.setting-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-right: 12px;
}
.setting-icon.green { background: rgba(52, 199, 89, 0.15); }
.setting-icon.blue { background: rgba(0, 122, 255, 0.12); }
.setting-icon.purple { background: rgba(0, 122, 255, 0.12); }
.setting-icon.pink { background: rgba(90, 200, 250, 0.15); }
.setting-icon.orange { background: rgba(255, 152, 0, 0.15); }
.setting-icon.gray { background: var(--border-light); }
.setting-content { flex: 1; }
.setting-title { font-size: 16px; font-weight: 500; }
.setting-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.setting-arrow { color: var(--text-tertiary); }
.detail-header {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  margin-bottom: 16px;
  text-align: center;
}
.detail-title { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.detail-subtitle { font-size: 14px; color: var(--text-secondary); }
.detail-badges { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }
.info-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}
.info-row:last-child { border-bottom: none; }
.info-label { font-size: 14px; color: var(--text-secondary); }
.info-value { font-size: 14px; font-weight: 500; }
.sub-page { display: none; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: var(--background); z-index: 50; overflow-y: auto; }
.sub-page.active { display: block; }
.sub-page-content { padding: 16px; padding-top: calc(var(--header-height) + var(--safe-area-top) + 12px); padding-bottom: calc(var(--tabbar-height) + var(--safe-area-bottom) + 16px); }

/* ==========================================
   连拍开关 (iOS 风格 toggle)
   ========================================== */
.burst-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  margin: 8px 0;
  background: var(--card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}
.burst-toggle-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.burst-toggle-label .burst-icon {
  font-size: 16px;
  line-height: 1;
}
.burst-toggle-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 400;
}
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 51px;
  height: 31px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #E9E9EB;
  transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 31px;
}
.toggle-slider:before {
  position: absolute;
  content: "";
  height: 27px;
  width: 27px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15), 0 1px 1px rgba(0, 0, 0, 0.06);
}
.toggle-switch input:checked + .toggle-slider {
  background-color: var(--success);
}
.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
}
.toggle-switch input:focus-visible + .toggle-slider {
  box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.3);
}
.sheet { padding: 0 0 calc(8px + var(--safe-area-bottom)); max-height: 92vh; display: flex; flex-direction: column; }
.sheet-header { padding: 16px 20px 8px; display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.sheet-title { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; color: var(--text-primary); }
.sheet-close { width: 30px; height: 30px; border-radius: 50%; background: var(--border-light); border: none; cursor: pointer; font-size: 16px; color: var(--text-secondary); display: flex; align-items: center; justify-content: center; transition: background 0.15s; }
.sheet-close:active { background: var(--border); }
.sheet-body { flex: 1; overflow-y: auto; padding: 8px 16px 16px; -webkit-overflow-scrolling: touch; }
.sheet-section { background: var(--card); border-radius: var(--radius-xl); margin-bottom: 16px; overflow: hidden; box-shadow: 0 0 0 1px var(--border-light); }
.sheet-section-tip { font-size: 12px; color: var(--text-tertiary); padding: 6px 4px 0; line-height: 1.5; }
.sheet-section-header { padding: 14px 16px 6px; }
.sheet-section-header .title { font-size: 14px; font-weight: 600; color: var(--text-primary); letter-spacing: -0.005em; }
.sheet-section-header .subtitle { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
.sheet-row { padding: 12px 16px; border-top: 0.5px solid var(--border-light); display: flex; align-items: center; gap: 12px; min-height: 44px; }
.sheet-row:first-child { border-top: none; }
.sheet-row.column { flex-direction: column; align-items: stretch; gap: 8px; }
.sheet-row .label { font-size: 14px; color: var(--text-primary); flex-shrink: 0; min-width: 64px; font-weight: 500; }
.sheet-row .label-block { font-size: 13px; color: var(--text-secondary); font-weight: 600; letter-spacing: -0.005em; }
.sheet-row .value { flex: 1; text-align: right; color: var(--text-secondary); font-size: 14px; }
.sheet-row input.sheet-input, .sheet-row textarea.sheet-input, .sheet-row select.sheet-input { flex: 1; border: none; background: transparent; padding: 0; font-size: 15px; color: var(--text-primary); outline: none; font-family: inherit; }
.sheet-row textarea.sheet-input { min-height: 60px; resize: vertical; line-height: 1.5; }
.sheet-row input.sheet-input::placeholder, .sheet-row textarea.sheet-input::placeholder { color: var(--text-tertiary); }
.sheet-row select.sheet-input { appearance: none; text-align: right; cursor: pointer; }
.sheet-row .chev { color: var(--text-tertiary); font-size: 14px; }
.sheet-input-block { width: 100%; border: none; background: var(--border-light); padding: 10px 12px; border-radius: var(--radius-md); font-size: 14px; color: var(--text-primary); outline: none; font-family: inherit; transition: background 0.15s; }
.sheet-input-block:focus { background: #EEF1F5; }
textarea.sheet-input-block { min-height: 60px; resize: vertical; line-height: 1.5; }
.sheet-input-block::placeholder { color: var(--text-tertiary); }
.sheet-actions { padding: 12px 16px calc(12px + var(--safe-area-bottom)); background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-top: 0.5px solid var(--border-light); flex-shrink: 0; }
.sheet-actions .btn { width: 100%; padding: 12px 18px; border-radius: var(--radius-md); font-size: 15px; font-weight: 600; }
.sheet-actions-split { display: flex; flex-direction: row; gap: 10px; }
.sheet-actions-split .btn { flex: 1; width: auto; }
.segmented { display: flex; background: var(--border-light); border-radius: 9px; padding: 2px; gap: 2px; flex: 1; }
.segmented .seg { flex: 1; padding: 7px 8px; text-align: center; font-size: 13px; color: var(--text-secondary); border-radius: 7px; cursor: pointer; transition: background 0.18s, color 0.18s, transform 0.18s; user-select: none; white-space: nowrap; font-weight: 500; }
.segmented .seg:active { transform: scale(0.97); }
.segmented .seg.active { background: var(--card); color: var(--text-primary); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.06); }
.segmented.compact .seg { padding: 6px 6px; font-size: 12px; }
.toggle-switch.small { width: 40px; height: 24px; }
.toggle-switch.small .toggle-slider:before { height: 20px; width: 20px; }
.toggle-switch.small input:checked + .toggle-slider:before { transform: translateX(16px); }
.memory-card { background: linear-gradient(135deg, rgba(103, 80, 164, 0.06), rgba(0, 122, 255, 0.04)); border-radius: var(--radius-xl); padding: 16px; box-shadow: 0 0 0 1px rgba(103, 80, 164, 0.12); margin-bottom: 16px; }
.memory-card .head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.memory-card .head .t { font-size: 14px; font-weight: 600; color: #6750A4; letter-spacing: -0.005em; }
.memory-card .head .s { font-size: 11px; color: var(--text-tertiary); }
.memory-card textarea { width: 100%; border: none; background: rgba(255, 255, 255, 0.6); border-radius: var(--radius-md); padding: 10px 12px; font-size: 14px; color: var(--text-secondary); resize: none; min-height: 76px; line-height: 1.6; outline: none; cursor: not-allowed; font-family: inherit; }
.memory-card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; gap: 8px; }
.memory-card .foot p { font-size: 12px; color: var(--text-secondary); margin: 0; line-height: 1.5; flex: 1; }
.memory-card .foot button { font-size: 13px; padding: 6px 10px; background: rgba(255, 255, 255, 0.6); border: none; border-radius: 8px; color: #6750A4; font-weight: 500; cursor: pointer; transition: background 0.15s; }
.memory-card .foot button:active { background: rgba(255, 255, 255, 0.9); }
.section-card { background: var(--card); border-radius: var(--radius-lg); padding: 12px 14px; margin-bottom: 10px; box-shadow: 0 0 0 1px var(--border-light); transition: box-shadow 0.2s; }
.section-card:focus-within { box-shadow: 0 0 0 1.5px var(--primary); }
.section-card .row1 { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.section-card .row1 input { flex: 1; border: none; background: transparent; padding: 4px 0; font-size: 15px; font-weight: 600; color: var(--text-primary); outline: none; letter-spacing: -0.005em; }
.section-card .row1 input::placeholder { color: var(--text-tertiary); font-weight: 400; }
.section-card .row1 button { width: 28px; height: 28px; border: none; background: var(--border-light); border-radius: 50%; cursor: pointer; font-size: 12px; color: var(--text-secondary); display: flex; align-items: center; justify-content: center; transition: background 0.15s; }
.section-card .row1 button:active:not(:disabled) { background: var(--border); }
.section-card .row1 button:disabled { opacity: 0.35; cursor: not-allowed; }
.section-card .row1 button.danger { background: transparent; color: var(--danger); font-weight: 500; width: auto; padding: 0 8px; height: 28px; }
.section-card textarea { width: 100%; border: none; background: var(--border-light); border-radius: 8px; padding: 8px 10px; font-size: 13px; color: var(--text-primary); resize: vertical; min-height: 50px; outline: none; line-height: 1.5; font-family: inherit; transition: background 0.15s; }
.section-card textarea:focus { background: #EEF1F5; }
.section-card textarea::placeholder { color: var(--text-tertiary); }
.section-card .row3 { display: flex; align-items: center; gap: 14px; margin-top: 8px; font-size: 12px; color: var(--text-secondary); }
.section-card .row3 .grp { display: flex; align-items: center; gap: 6px; }
.section-card .row3 input[type=number] { width: 56px; padding: 3px 6px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; text-align: center; outline: none; background: var(--card); }
.section-card .row3 input[type=number]:focus { border-color: var(--primary); }
.preview-card { background: var(--background); border-radius: var(--radius-xl); padding: 14px 16px; box-shadow: 0 0 0 1px var(--border-light); }
.preview-card .h { font-size: 12px; color: var(--text-tertiary); font-weight: 600; margin-bottom: 8px; letter-spacing: 0.02em; text-transform: none; }
.preview-card pre { white-space: pre-wrap; font-size: 13px; color: var(--text-secondary); margin: 0; font-family: inherit; line-height: 1.6; max-height: 220px; overflow: auto; }
.preview-card pre.empty { color: var(--text-tertiary); font-style: italic; }
.add-section-btn { width: 100%; background: transparent; border: 1.5px dashed var(--border); border-radius: var(--radius-lg); padding: 12px; font-size: 14px; color: var(--primary); cursor: pointer; font-weight: 500; transition: background 0.15s, border-color 0.15s; margin-top: 4px; }
.add-section-btn:active { background: rgba(0, 122, 255, 0.06); border-color: var(--primary); }
@keyframes slideUpSheet { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-overlay.active .modal-content.sheet { animation: slideUpSheet 0.32s cubic-bezier(0.32, 0.72, 0, 1); }
.modal-content.sheet { padding: 0; }
.ui-icon { width: 1.1em; height: 1.1em; display: inline-block; vertical-align: -0.16em; flex-shrink: 0; }
.icon-mark { width: 44px; height: 44px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; background: rgba(0,122,255,0.1); color: var(--primary); }
.icon-mark .ui-icon { width: 24px; height: 24px; }
.page-kicker { font-size: 14px; color: var(--text-secondary); margin-top: 4px; line-height: 1.45; }
.app-sidebar-brand { display: none; }
.nav-chat-item { display: none; }
.setting-icon { color: var(--primary); }
.setting-icon .ui-icon { width: 20px; height: 20px; }
.search-box-icon .ui-icon { width: 16px; height: 16px; }
.upload-zone-icon { width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 18px; display: flex; align-items: center; justify-content: center; color: var(--primary); background: rgba(0,122,255,0.1); font-size: 0; }
.upload-zone-icon .ui-icon { width: 30px; height: 30px; }
.content-box-title { display: inline-flex; align-items: center; gap: 6px; }
.content-box-title .ui-icon { width: 16px; height: 16px; color: var(--primary); }
.empty-state { background: linear-gradient(180deg, rgba(255,255,255,0.68), rgba(255,255,255,0)); border: 1px solid var(--border-light); }
.empty-icon { width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 20px; display: flex; align-items: center; justify-content: center; color: var(--primary); background: rgba(0,122,255,0.1); font-size: 0; }
.empty-icon .ui-icon { width: 30px; height: 30px; }
.empty-subtitle { font-size: 13px; color: var(--text-tertiary); line-height: 1.5; max-width: 280px; margin: -10px auto 18px; }
.list-meta-icon { display: inline-flex; align-items: center; gap: 4px; }
.list-meta-icon .ui-icon { width: 14px; height: 14px; }
button, input, select, textarea { font: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 3px solid rgba(0,122,255,0.32); outline-offset: 2px; }
.btn { min-height: 44px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn-sm { min-height: 36px; padding: 8px 14px; }
.btn-danger { background: rgba(255,59,48,0.1); color: var(--danger); }
.btn-danger:hover { background: rgba(255,59,48,0.16); color: var(--danger); }
.btn-danger:active { background: rgba(255,59,48,0.22); }
.btn-quiet-danger { background: var(--border-light); color: var(--text-secondary); border: none; }
.btn-quiet-danger:hover { background: rgba(255,59,48,0.08); color: var(--danger); }
.btn-quiet-danger .ui-icon { width: 14px; height: 14px; }
.export-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 4px 4px 12px; }
.export-toolbar .input-field { height: 36px; padding: 6px 12px; font-size: 13px; flex: 1; min-width: 140px; }
.export-summary { font-size: 13px; color: var(--text-secondary); padding: 0 4px 8px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.export-summary strong { color: var(--text-primary); font-weight: 600; }
.export-section-title { font-size: 12px; font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.04em; padding: 14px 4px 6px; }
.export-section-title:first-child { padding-top: 4px; }
.export-student-list { background: var(--card); border-radius: var(--radius-lg); border: 1px solid var(--border-light); overflow: hidden; }
.export-student-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 0.5px solid var(--border-light); cursor: pointer; transition: background 0.12s; min-height: 56px; }
.export-student-row:last-child { border-bottom: none; }
.export-student-row:hover { background: var(--border-light); }
.export-student-row.disabled { opacity: 0.55; }
.export-checkbox { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--border); background: var(--card); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all 0.15s; }
.export-student-row.checked .export-checkbox { background: var(--primary); border-color: var(--primary); }
.export-checkbox .ui-icon { width: 14px; height: 14px; color: white; opacity: 0; transition: opacity 0.1s; }
.export-student-row.checked .export-checkbox .ui-icon { opacity: 1; }
.export-student-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.export-student-head { display: flex; align-items: center; gap: 8px; }
.export-student-id { font-size: 12px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.export-student-name { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.export-student-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.status-dot { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 500; }
.status-dot.success { background: rgba(52,199,89,0.12); color: var(--success); }
.status-dot.warn { background: rgba(255,149,0,0.12); color: var(--warning); }
.status-dot.muted { background: var(--border-light); color: var(--text-tertiary); }
.level-pill { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 500; }
.level-pill.good { background: rgba(52,199,89,0.12); color: var(--success); }
.level-pill.medium { background: rgba(0,122,255,0.1); color: var(--primary); }
.level-pill.poor { background: rgba(255,149,0,0.12); color: var(--warning); }
.export-empty { padding: 28px 16px; text-align: center; color: var(--text-tertiary); font-size: 13px; }
.template-preview-block { padding: 10px 12px; background: var(--background); border-radius: var(--radius-md); margin-top: 6px; border: 1px solid var(--border-light); }
.template-preview-block .h { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.template-preview-block .h .name { font-weight: 600; font-size: 13px; color: var(--text-primary); }
.template-preview-block .h .tag { font-size: 10px; padding: 1px 6px; border-radius: 4px; color: #fff; }
.template-preview-block .h .tag.system { background: var(--primary); }
.template-preview-block .h .tag.custom { background: var(--warning); }
.template-preview-block .body { font-size: 12px; color: var(--text-secondary); white-space: pre-wrap; line-height: 1.55; max-height: 200px; overflow-y: auto; }
.template-preview-block .body.empty { color: var(--text-tertiary); font-style: italic; }
.tab-label { font-size: 11px; }
.tab-item { min-height: 52px; border: none; background: transparent; font-family: inherit; }
.tab-item:focus-visible { outline: 3px solid rgba(0,122,255,0.28); outline-offset: -4px; border-radius: var(--radius-md); }
.card, .class-card, .assignment-card, .setting-item, .list-item, .student-row, .detail-header { box-shadow: 0 1px 2px var(--shadow); }
.upload-zone, .search-box, .input-field, .content-box, .progress-card { border-color: var(--border-light); }
.toast { border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.18); }
.toast.info { background: rgba(44,44,46,0.92); }
.modal-overlay, .confirm-overlay { backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.modal-content, .confirm-dialog { box-shadow: 0 -18px 48px rgba(0,0,0,0.16); }
.empty-state { border-radius: var(--radius-xl); }
.empty-text { line-height: 1.5; }
@media (prefers-color-scheme: dark) {
  :root {
    --primary: #0A84FF;
    --primary-light: #64D2FF;
    --primary-dark: #409CFF;
    --primary-gradient: linear-gradient(135deg, #0A84FF 0%, #5E5CE6 100%);
    --accent: #64D2FF;
    --accent-warm: #FF9F0A;
    --success: #30D158;
    --warning: #FF9F0A;
    --danger: #FF453A;
    --background: #000000;
    --card: #1C1C1E;
    --text-primary: #F5F5F7;
    --text-secondary: #AEAEB2;
    --text-tertiary: #636366;
    --border: #38383A;
    --border-light: #2C2C2E;
    --shadow: rgba(0,0,0,0.35);
    --shadow-md: rgba(0,0,0,0.48);
  }
  .app-header { background: rgba(28,28,30,0.78); }
  .app-tabbar { background: rgba(28,28,30,0.78); }
  .loading-overlay { background: rgba(0,0,0,0.82); }
  .modal-overlay { background: rgba(0,0,0,0.52); }
  .confirm-overlay { background: rgba(0,0,0,0.52); }
  .sheet-actions { background: rgba(28,28,30,0.86); }
  .chat-messages { background: var(--background); }
  .square-card { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35); }
  .square-metric { background: #2C2C2E; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
@media (min-width: 900px) {
  :root { --sidebar-width: 264px; --main-width: 1180px; --layout-width: calc(var(--sidebar-width) + var(--main-width)); --layout-left: max(0px, calc((100vw - var(--layout-width)) / 2)); --header-height: 64px; }
  .app-container:not(:has(.app-tabbar)) { max-width: none; box-shadow: none; }
  .app-container:not(:has(.app-tabbar)) .app-header { left: 0; right: 0; transform: none; max-width: none; }
  .app-container:not(:has(.app-tabbar)) .app-content { padding: calc(var(--header-height) + var(--safe-area-top) + 24px) 32px 56px; }
  .app-container:not(:has(.app-tabbar)) .app-content > * { max-width: 960px; margin-left: auto; margin-right: auto; }
  .app-container { max-width: none; box-shadow: none; }
  .app-container:has(.app-tabbar) .app-header { display: none; }
  .app-container:has(.app-tabbar) .app-content { margin-left: calc(var(--layout-left) + var(--sidebar-width)); width: var(--main-width); padding: calc(var(--safe-area-top) + 32px) 0 56px; }
  .app-container:has(.app-tabbar) .tab-content { max-width: var(--main-width); padding: 0 clamp(24px, 3vw, 48px); margin: 0; }
  .app-tabbar { top: 0; bottom: 0; left: var(--layout-left); right: auto; width: var(--sidebar-width); height: 100vh; padding: calc(var(--safe-area-top) + 22px) 18px 22px; flex-direction: column; gap: 8px; background: rgba(255,255,255,0.86); border-right: 1px solid var(--border-light); border-top: none; align-items: stretch; box-shadow: 12px 0 36px rgba(0,0,0,0.04); transform: none; max-width: none; z-index: 101; }
  .app-sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 8px 8px 20px; margin-bottom: 8px; }
  .app-sidebar-brand .pipi-avatar-ring { box-shadow: 0 6px 18px rgba(0,122,255,0.24); }
  .app-sidebar-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
  .app-sidebar-subtitle { font-size: 12px; color: var(--text-secondary); margin-top: 1px; }
  .tab-item { flex: none; min-height: 48px; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 10px 12px; border-radius: var(--radius-lg); color: var(--text-secondary); }
  .tab-item.active { background: rgba(0,122,255,0.1); color: var(--primary); box-shadow: inset 0 0 0 1px rgba(0,122,255,0.08); }
  .tab-icon { width: 24px; height: 24px; }
  .tab-label { font-size: 15px; }
  .nav-chat-item { display: flex; margin-top: auto; }
  .float-btn { display: none; }
  .page-title { font-size: 30px; letter-spacing: -0.02em; }
  .page-header { margin-bottom: 24px; }
  .card { border-radius: 22px; padding: 24px; }
  #tabCorrect.active { display: grid; grid-template-columns: minmax(520px, 1fr) 340px; gap: 24px; align-items: start; }
  #tabCorrect .page-header, #tabCorrect > .card, #tabCorrect #resultSection { grid-column: 1; }
  #tabCorrect #historySection { grid-column: 2; grid-row: 1 / span 3; position: sticky; top: calc(var(--header-height) + 24px); }
  .history-scroll { display: block; margin: 0; padding: 0; overflow: visible; }
  .history-item { width: 100%; margin-bottom: 8px; }
  #classListView, #classDetailView, #assignmentDetailView, #mineMainView, #accountView, #correctionTemplateView { max-width: 980px; margin: 0 auto; }
  #classList, #studentList, #assignmentList, #submissionList { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
  #studentList .empty-state, #assignmentList .empty-state, #submissionList .empty-state, #classList .empty-state { grid-column: 1 / -1; }
  .student-row, .list-item, .class-card, .assignment-card, .setting-item { margin-bottom: 0; }
  #mineMainView { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  #mineMainView .page-header, #mineMainView #userInfoCard { grid-column: 1 / -1; }
  .modal-content { max-width: 560px; border-radius: var(--radius-xl); margin-bottom: 32px; padding-bottom: 24px; }
  .modal-content.wide { max-width: 760px; }
  .modal-content.sheet.wide { max-width: 760px; }
  .modal-overlay { align-items: center; }
  .chat-modal.active { align-items: center; }
  .chat-modal .modal-content { height: min(760px, 88vh); border-radius: 24px; }
}
@media (min-width: 900px) and (prefers-color-scheme: dark) {
  .app-tabbar { background: rgba(28,28,30,0.88); }
  .app-container:has(.app-tabbar) .app-header { background: linear-gradient(180deg, rgba(0,0,0,0.92), rgba(0,0,0,0.62)); }
}

/* === ICP 备案号页脚 === */
.app-footer {
  text-align: center;
  padding: 16px 16px 24px;
  font-size: 12px;
  color: var(--text-tertiary, #999);
}
.app-footer a {
  color: var(--text-tertiary, #999);
  text-decoration: none;
}
.app-footer a:hover {
  color: var(--primary, #4f46e5);
}
