/* MVP H5 入口：移动优先、独立视觉，不与桌面 worksheets 页混用 */

:root {
  --bg0: #0b1220;
  --bg1: #111c33;
  --card: rgba(255, 255, 255, 0.94);
  --card-border: rgba(255, 255, 255, 0.55);
  --text: #0f172a;
  --muted: #64748b;
  --accent: #4f46e5;
  --accent2: #0ea5e9;
  --ok: #059669;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(2, 6, 23, 0.35);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: radial-gradient(1200px 600px at 20% -10%, #312e81 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 20%, #0e7490 0%, transparent 50%),
    linear-gradient(165deg, var(--bg0), var(--bg1));
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

#app {
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: calc(12px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right))
    calc(16px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
  max-width: 480px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

/* 门户首页：标题行 + 学程条收进同一顶栏，减少纵向占位 */
.mvp-portal-topbar {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  margin-bottom: 10px;
}

.mvp-portal-topbar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mvp-top-context-row--portal {
  margin: 6px 0 0;
  padding: 6px 10px;
  border-radius: 11px;
}

.mvp-top-context-row--portal .mvp-top-context {
  font-size: 12px;
  line-height: 1.35;
}

.mvp-top-context-row--portal .mvp-top-context-chevron {
  border-top-width: 3px;
  border-bottom-width: 3px;
  border-left-width: 5px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 8px 22px rgba(79, 70, 229, 0.45);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-text strong {
  font-size: 15px;
  letter-spacing: 0.02em;
  color: #f8fafc;
}

.brand-text span {
  font-size: 11px;
  color: #94a3b8;
}

.steps {
  display: flex;
  gap: 6px;
  align-items: center;
}

.steps .dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.35);
}

.steps .dot.on {
  background: #e0e7ff;
  box-shadow: 0 0 0 3px rgba(224, 231, 255, 0.25);
}

.sheet {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 20px;
  backdrop-filter: blur(10px);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel h2 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.lead {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
}

.flow-list {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.flow-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.55;
  color: #334155;
}

.flow-list li i {
  font-style: normal;
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background: #eef2ff;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}

label.field {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 6px;
}

input.text,
textarea.text {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input.text:focus,
textarea.text:focus {
  border-color: #a5b4fc;
  box-shadow: 0 0 0 3px rgba(165, 180, 252, 0.35);
}

textarea.text {
  min-height: 88px;
  resize: vertical;
}

.field-block + .field-block {
  margin-top: 14px;
}

.dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 14px;
  padding: 22px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.dropzone:hover,
.dropzone.drag {
  border-color: #818cf8;
  background: #f8fafc;
}

.dropzone strong {
  display: block;
  color: #334155;
  margin-bottom: 4px;
}

.hint {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 8px;
}

.actions {
  margin-top: auto;
  padding-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn {
  appearance: none;
  border: none;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: transform 0.08s ease, box-shadow 0.15s ease, opacity 0.15s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #6366f1);
  color: #fff;
  box-shadow: 0 14px 32px rgba(79, 70, 229, 0.38);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-ghost {
  background: #f1f5f9;
  color: #334155;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #4338ca;
  background: #eef2ff;
  padding: 5px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.status-card {
  border-radius: 14px;
  padding: 16px;
  background: linear-gradient(135deg, #f0fdf4, #ecfeff);
  border: 1px solid #bbf7d0;
  font-size: 13px;
  line-height: 1.55;
  color: #14532d;
}

.status-card code {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.75);
  padding: 2px 6px;
  border-radius: 6px;
  word-break: break-all;
}

.process {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 0 8px;
  gap: 14px;
  flex: 1;
}

.ring {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 4px solid #e2e8f0;
  border-top-color: var(--accent);
  animation: spin 0.85s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.hidden {
  display: none !important;
}

.footer-note {
  margin-top: 12px;
  font-size: 11px;
  color: #64748b;
  text-align: center;
  line-height: 1.45;
}

.stages-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 16px 0 6px;
}

.pill-inline {
  margin-bottom: 0;
}

.btn-mini {
  appearance: none;
  border: 1px solid #c7d2fe;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
}

.stage-row {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: #fafafa;
}

.stage-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.term-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: #fafafa;
}

.term-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.subjects-block {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed #e2e8f0;
}

.subject-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.subject-row .ts-subject {
  flex: 1;
}

.btn-remove-term {
  appearance: none;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 13px;
  cursor: pointer;
}

.btn-remove-subject {
  appearance: none;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
}

.st-default-wrap {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-remove-stage {
  appearance: none;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}

.btn-remove-stage:active {
  color: #ef4444;
}

/* —— H5 归档子页（/h5/mvp/archive）—— */
.archive-app-root {
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: calc(12px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right))
    calc(16px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
  max-width: 480px;
  margin: 0 auto;
}

.topbar-with-back {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.topbar-with-back .brand {
  min-width: 0;
}

.back-link {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
}

.back-link:active {
  opacity: 0.85;
}

.topbar-archive-wrap {
  margin-bottom: 12px;
}

.topbar-archive-actions,
.topbar-with-back-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.topbar-inline-link {
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.topbar-inline-link:active {
  opacity: 0.88;
}

.archive-panel code {
  font-size: 11px;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 6px;
}

.archive-subhint {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.chip {
  appearance: none;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.chip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.chip.on {
  border-color: #818cf8;
  background: #eef2ff;
  color: #3730a3;
}

.archive-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  margin: 0 -4px;
  padding: 0 4px 8px;
  -webkit-overflow-scrolling: touch;
}

.archive-group {
  margin-top: 18px;
}

.archive-group:first-of-type {
  margin-top: 4px;
}

.archive-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.archive-group-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.35;
}

.badge-count {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  padding: 4px 8px;
  border-radius: 999px;
}

.archive-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.archive-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.archive-card:active {
  border-color: #a5b4fc;
  box-shadow: 0 0 0 3px rgba(165, 180, 252, 0.25);
}

.archive-date {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.archive-title {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.45;
}

.empty-archive {
  padding: 24px 8px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.archive-empty-msg {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 13px;
  line-height: 1.5;
}

.archive-footer-actions a.btn {
  display: block;
  text-decoration: none;
}

/* —— H5 全屏查看壳 —— */
.viewer-body {
  margin: 0;
  min-height: 100dvh;
}

.viewer-app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 100%;
  margin: 0 auto;
  background: linear-gradient(165deg, var(--bg0), var(--bg1));
}

.viewer-topbar {
  padding: calc(10px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right)) 8px
    calc(12px + env(safe-area-inset-left));
}

.viewer-topbar .brand-text strong {
  font-size: 14px;
}

.viewer-banner {
  margin: 0 12px 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 12px;
  line-height: 1.5;
}

.viewer-frame {
  flex: 1;
  width: 100%;
  min-height: 0;
  height: calc(
    100dvh - 52px - env(safe-area-inset-top) - env(safe-area-inset-bottom)
  );
  border: 0;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

@media screen and (max-width: 900px) {
  .viewer-topbar .brand-text span {
    display: none;
  }

  .viewer-topbar .back-link {
    font-size: 14px;
    padding: 6px 0;
  }

  .viewer-frame {
    height: calc(
      100dvh - 48px - env(safe-area-inset-top) - env(safe-area-inset-bottom)
    );
  }
}

.viewer-empty-panel {
  margin: 12px;
}

.done-details {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

.done-details summary {
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  color: #475569;
}

.h5-new-form .h5-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 13px;
  color: #475569;
}

.h5-new-form .h5-check input {
  width: 16px;
  height: 16px;
}

/* 上传步：当前学程摘要 */
.upload-context-banner {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, #eef2ff 0%, #e0f2fe 100%);
  border: 1px solid #c7d2fe;
  font-size: 13px;
  line-height: 1.55;
  color: #1e293b;
}

/* 新建页：学程摘要 + 科目快捷标签 */
.h5-new-context {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 13px;
  line-height: 1.55;
  color: #334155;
}

.h5-new-context strong {
  color: #0f172a;
}

.subject-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.subject-chip {
  appearance: none;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.subject-chip:hover {
  border-color: #818cf8;
  color: #3730a3;
}

.subject-chip.on {
  border-color: #4f46e5;
  background: #eef2ff;
  color: #312e81;
}

.h5-term-details {
  margin-bottom: 14px;
  padding: 4px 0;
}

.h5-term-details summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  user-select: none;
}

.field-hint {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
}

.h5-new-panel.panel {
  padding: 16px 18px 20px;
}

.h5-new-title {
  margin: 0 0 14px;
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.02em;
}

.h5-new-field-tight {
  margin-bottom: 2px;
}

.h5-new-actions {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.h5-drop-field {
  margin-bottom: 4px;
}

.h5-dropzone {
  position: relative;
  min-height: 132px;
  border: 2px dashed #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  cursor: pointer;
}

.h5-dropzone:hover {
  border-color: #a5b4fc;
  background: #f1f5f9;
}

.h5-dropzone.is-dragover {
  border-color: #4f46e5;
  background: #eef2ff;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.22);
}

.h5-assets-input-native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}

.h5-dropzone-inner {
  padding: 18px 16px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  pointer-events: none;
}

.h5-dropzone-browse {
  pointer-events: auto;
  padding: 8px 16px;
  font-size: 14px;
}

.h5-dropzone-lead {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #64748b;
  font-weight: 500;
}

.h5-dropzone-filelist {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #475569;
  word-break: break-all;
  max-width: 100%;
}

.h5-source-hint {
  margin-top: 4px;
  margin-bottom: 8px;
}

.field-primary-subject .field {
  font-size: 15px;
  color: #0f172a;
}

/* —— 门户进度提示（演示向导）—— */
.mvp-flow-hint {
  margin: -6px 0 12px;
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
  letter-spacing: 0.02em;
  min-height: 1.25em;
}

/* —— 原底部 Tab（已移除）；保留样式块便于将来对照 —— */
.mvp-shell-nav {
  position: fixed;
  z-index: 40;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  max-width: 480px;
  margin: 0 auto;
  padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
  gap: 6px;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 -8px 28px rgba(2, 6, 23, 0.35);
}

.mvp-shell-nav__item {
  flex: 1;
  text-align: center;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
  padding: 10px 6px;
  border-radius: 12px;
  line-height: 1.2;
}

.mvp-shell-nav__item:active {
  opacity: 0.88;
}

.mvp-shell-nav__item.is-active {
  color: #eef2ff;
  background: rgba(79, 70, 229, 0.42);
}

body.mvp-body #app {
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

body.mvp-body .archive-app-root,
body.mvp-body #h5-new-app.archive-app-root {
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

body.mvp-body.viewer-body .viewer-app {
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

.actions-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

.actions-stack .btn {
  width: 100%;
}

.mvp-or-divider {
  margin: 12px 0 10px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

/* —— 引导弹窗 —— */
.mvp-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
  background: rgba(2, 6, 23, 0.58);
  backdrop-filter: blur(6px);
}

.mvp-modal-overlay.hidden {
  display: none;
}

.mvp-modal {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: var(--radius);
  padding: 22px 20px 20px;
  box-shadow: var(--shadow);
  color: var(--text);
}

.mvp-modal h2 {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 700;
}

.mvp-modal-lead {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.55;
  color: #475569;
}

.mvp-onboard-actions {
  display: flex;
  flex-direction: row;
  gap: 10px;
  margin-top: 18px;
}

.mvp-onboard-actions .btn {
  flex: 1;
  min-width: 0;
}

.mvp-onboard-actions #onboard-cancel.hidden {
  display: none;
}

/* —— 门户顶栏：当前空间 · 年级 · 学期 —— */
.mvp-top-context-row {
  margin: -4px 0 12px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.mvp-top-context-row.hidden {
  display: none;
}

.mvp-top-context-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-align: center;
  border-radius: 12px;
  -webkit-tap-highlight-color: transparent;
}

.mvp-top-context-btn:active {
  opacity: 0.88;
}

.mvp-top-context {
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  line-height: 1.45;
  text-align: center;
}

.mvp-top-context-chevron {
  flex-shrink: 0;
  width: 0;
  height: 0;
  margin-left: 1px;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid rgba(226, 232, 240, 0.9);
  opacity: 0.92;
}

.mvp-brand-sub.hidden {
  display: none;
}

.mvp-home-panel.panel {
  padding: 18px 16px 20px;
}

.mvp-home-hero {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
  text-align: left;
}

.mvp-home-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
}

.mvp-home-section-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), #f97316);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.mvp-home-section-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #0f172a;
}

.mvp-home-subline {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.mvp-home-entry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
  margin-bottom: 12px;
}

.mvp-home-entry-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 16px 10px 14px;
  min-height: 132px;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

.mvp-home-entry-card:hover {
  border-color: rgba(79, 70, 229, 0.35);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.12);
}

.mvp-home-entry-card:active {
  transform: scale(0.98);
}

.mvp-home-entry-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.mvp-home-entry-card--action {
  appearance: none;
  font: inherit;
  width: auto;
  margin: 0;
}

.mvp-home-entry-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.35);
}

.mvp-home-entry-title {
  font-size: 15px;
  font-weight: 800;
  color: #312e81;
  letter-spacing: 0.03em;
}

.mvp-home-entry-desc {
  font-size: 12px;
  line-height: 1.4;
  color: #64748b;
  font-weight: 500;
}

.mvp-home-demo-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed #cbd5e1;
  background: rgba(248, 250, 252, 0.9);
  color: #64748b;
  font: inherit;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.mvp-home-demo-tile:active {
  background: #f1f5f9;
}

.mvp-home-demo-tile:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.mvp-home-demo-label {
  font-size: 13px;
  font-weight: 700;
  color: #475569;
}

.mvp-home-demo-hint {
  font-size: 12px;
  font-weight: 500;
  color: #94a3b8;
}

@media (max-width: 340px) {
  .mvp-home-entry-grid {
    grid-template-columns: 1fr;
  }
}

.btn-text-link {
  appearance: none;
  border: none;
  background: none;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 8px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-text-muted {
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
}

.btn-text-muted:hover {
  color: #64748b;
}

/* —— 错题档案：学科 Tab + 列表 + 底部上传 —— */
.topbar-archive-head {
  margin-bottom: 8px;
}

.brand-archive .brand-text strong {
  font-size: 16px;
}

.archive-top-context {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  margin-top: 4px;
  line-height: 1.35;
}

.sheet-archive {
  padding-bottom: 8px;
}

.archive-panel-flat {
  padding-top: 14px;
}

.archive-subject-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}

.archive-subject-tab {
  flex: 1;
  min-width: 72px;
  appearance: none;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
}

.archive-subject-tab.is-active {
  border-color: #4f46e5;
  background: #eef2ff;
  color: #312e81;
}

.archive-subject-empty {
  margin: 20px 0;
  padding: 16px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
}

.archive-mvp-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.archive-mvp-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: #fff;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}

.archive-mvp-card:active {
  opacity: 0.92;
}

.archive-mvp-line {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.45;
}

.archive-mvp-meta {
  font-size: 12px;
  color: var(--muted);
}

.archive-mvp-path {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: #64748b;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
  line-height: 1.35;
}

.archive-mvp-path-mini {
  color: #94a3b8;
  font-size: 10px;
}

.archive-upload-dock {
  position: fixed;
  z-index: 35;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.btn-dock {
  flex: 1;
  appearance: none;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  padding: 14px 10px;
  cursor: pointer;
}

.btn-dock-camera {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  color: #fff;
}

.btn-dock-gallery {
  background: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

body.mvp-body.mvp-archive-body .archive-app-root {
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}
