:root {
  --bg: #f4f7f1;
  --panel: #ffffff;
  --text: #1f2a1f;
  --muted: #687366;
  --line: #dfe6dc;
  --green: #3f8554;
  --green-dark: #245e38;
  --green-soft: #edf6e8;
  --cream: #fffaf0;
  --yellow: #f3c766;
  --coral: #e98b72;
  --blue: #6a91b8;
  --shadow: 0 14px 34px rgba(42, 70, 44, 0.1);
  --shadow-soft: 0 8px 22px rgba(42, 70, 44, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(232, 241, 226, 0.92), rgba(244, 247, 241, 0.72) 220px),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

.hidden {
  display: none !important;
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(245, 247, 244, 0.96);
}

.auth-screen.hidden {
  display: none;
}

.auth-panel {
  width: min(100%, 390px);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(40, 70, 44, 0.12);
}

.auth-panel h1 {
  margin-bottom: 10px;
}

.auth-help,
.auth-tip {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.auth-tip {
  margin: 12px 0 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 22px 14px 34px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 2px 2px;
}

.top-actions {
  display: flex;
  gap: 8px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.sync-status {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.sync-status.online {
  color: var(--green-dark);
}

.sync-status.offline {
  color: #9a513f;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1.15;
}

h2 {
  font-size: 18px;
}

.icon-button,
.primary-button,
.card-actions button,
.tab {
  border: 0;
  cursor: pointer;
}

.icon-button {
  min-width: 56px;
  height: 38px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--green-dark);
  font-weight: 700;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, var(--shadow-soft);
}

.summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 10px;
  margin: 18px 0 14px;
}

.summary-card {
  min-height: 82px;
  padding: 15px 14px;
  border: 1px solid rgba(223, 230, 220, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-soft);
}

.summary-card span {
  display: block;
  min-height: 28px;
  color: var(--green-dark);
  font-size: 24px;
  font-weight: 800;
}

.summary-card .summary-time {
  min-height: 22px;
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.summary-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.tab {
  min-height: 42px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted);
  font-weight: 700;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.65) inset;
}

.tab.active {
  background: linear-gradient(180deg, #4a9661, var(--green));
  color: #fff;
  box-shadow: 0 8px 18px rgba(63, 133, 84, 0.22);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: var(--shadow);
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.field span {
  color: #3e493d;
  font-size: 14px;
  font-weight: 700;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf9;
  color: var(--text);
  outline: none;
  padding: 12px 13px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #95bf83;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(63, 133, 84, 0.12);
}

textarea {
  resize: vertical;
}

.photo-preview {
  display: grid;
  place-items: center;
  min-height: 170px;
  margin: -4px 0 14px;
  border: 1px dashed #adc3a5;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f8fbf5);
  color: var(--muted);
  overflow: hidden;
}

.photo-source-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.hidden-file-input {
  display: none;
}

.photo-preview img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
}

.photo-preview.compact {
  min-height: 120px;
  margin: 10px 0 14px;
}

.photo-preview.compact img {
  max-height: 220px;
}

.photo-tools {
  display: none;
  margin: -4px 0 14px;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
}

.photo-tools.visible {
  display: grid;
}

.ocr-review-field {
  padding: 12px;
  border: 1px solid #d7e7ce;
  border-radius: 8px;
  background: var(--green-soft);
}

.ocr-review-field textarea {
  min-height: 108px;
  background: #fff;
}

.secondary-button {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--green-dark);
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.tag-picker,
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-option {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #3e493d;
  padding: 0 12px;
}

.tag-option.selected {
  border-color: var(--green);
  background: #e1eddc;
  color: var(--green-dark);
  font-weight: 700;
}

.primary-button {
  width: 100%;
  min-height: 48px;
  border-radius: 8px;
  background: linear-gradient(180deg, #4f9a65, var(--green));
  color: #fff;
  font-weight: 800;
  box-shadow: 0 10px 20px rgba(63, 133, 84, 0.22);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.crop-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 12px;
  background: rgba(26, 32, 25, 0.72);
}

.crop-screen.hidden {
  display: none;
}

.crop-panel {
  width: min(100%, 760px);
  max-height: 96vh;
  overflow: auto;
  padding: 14px;
  border-radius: 8px;
  background: var(--panel);
}

.crop-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.crop-help {
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

#cropCanvas {
  width: 100%;
  max-height: 68vh;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f8f6;
  touch-action: none;
}

.crop-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.print-toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.mistake-list {
  display: grid;
  gap: 12px;
}

.review-plan-panel {
  margin-bottom: 12px;
  padding: 14px;
  background: rgba(255, 253, 248, 0.96);
}

.review-plan-panel h2 {
  margin: 0 0 6px;
  color: var(--green-dark);
  font-size: 18px;
}

.review-plan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.review-plan-grid div {
  padding: 10px 8px;
  border: 1px solid #e4eadf;
  border-radius: 8px;
  background: #fbfdf8;
}

.review-plan-grid strong {
  display: block;
  color: var(--green);
  font-size: 22px;
  line-height: 1;
}

.review-plan-grid span {
  display: block;
  margin-top: 5px;
  color: #667064;
  font-size: 12px;
}

@media (max-width: 560px) {
  .review-plan-grid {
    grid-template-columns: 1fr;
  }
}

.mistake-card {
  position: relative;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.mistake-card:hover {
  border-color: #b7c9ae;
  box-shadow: 0 12px 26px rgba(42, 70, 44, 0.11);
  transform: translateY(-1px);
}

.print-check {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 1px 6px rgba(35, 45, 30, 0.12);
  cursor: pointer;
}

.print-check input {
  width: 15px;
  height: 15px;
  padding: 0;
}

.mistake-image {
  width: 120px;
  height: 150px;
  border-radius: 6px;
  background: #eef1ec;
  object-fit: cover;
}

.mistake-body {
  min-width: 0;
  padding-right: 76px;
}

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

.subject {
  display: block;
}

.source,
.status,
.muted {
  color: var(--muted);
  font-size: 13px;
}

.status {
  white-space: nowrap;
}

.tags span {
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-dark);
  padding: 4px 8px;
  font-size: 12px;
}

.tags {
  margin-top: 8px;
}

.note,
.knowledge,
.question,
.ocr-text,
.solution,
.remediation,
.reflection {
  margin: 8px 0 0;
  color: #3f473e;
  font-size: 14px;
  line-height: 1.45;
}

.question {
  color: #284b62;
  font-size: 15px;
  font-weight: 700;
  white-space: pre-wrap;
}

.ocr-text {
  color: var(--muted);
  font-size: 13px;
}

.knowledge {
  color: var(--green-dark);
  font-weight: 700;
}

.solution {
  color: #5d4c25;
}

.remediation {
  color: #72532f;
}

.ai-suggestion {
  margin: -4px 0 12px;
  padding: 10px 12px;
  border: 1px solid #d7e7ce;
  border-radius: 8px;
  background: #f6fbf2;
  color: var(--green-dark);
  font-size: 13px;
  line-height: 1.5;
}

.reflection {
  color: var(--blue);
}

.card-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.card-actions button {
  min-height: 34px;
  border-radius: 6px;
  background: #f3f6f0;
  color: #3e493d;
  font-size: 12px;
}

.detail-screen {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(18, 28, 18, 0.5);
  backdrop-filter: blur(4px);
}

.detail-panel {
  width: min(760px, 100%);
  max-height: 88vh;
  overflow: auto;
  border-radius: 8px;
  background: #fffdf9;
  padding: 20px;
  box-shadow: 0 20px 50px rgba(20, 30, 20, 0.24);
}

.detail-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.detail-head h2 {
  margin: 2px 0 0;
  font-size: 20px;
}

.detail-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.detail-actions .secondary-button {
  width: auto;
  min-width: 112px;
  padding: 0 14px;
}

.detail-review-section {
  background: #fbf8ef;
}

.detail-review-section p {
  margin: 8px 0 12px;
  color: #486243;
  font-weight: 700;
}

.detail-review-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.detail-review-actions .secondary-button {
  min-height: 38px;
  border-color: #dfe8d8;
  background: #fffdf8;
  color: var(--green-dark);
}

.detail-review-actions .danger-button {
  border-color: #ead8d2;
  background: #fff5f1;
  color: #8c3d31;
}

/* iOS WeChat renders native selects differently; reserve icon space so SVGs never overlap text. */
.wb-entry-card .select-field,
.wb-entry-card .time-field,
.wb-entry-card .wb-knowledge-field {
  overflow: visible !important;
}

.wb-entry-card .select-field > svg,
.wb-entry-card .time-field > svg,
.wb-entry-card .wb-knowledge-field > svg {
  top: auto !important;
  bottom: 13px !important;
  left: 13px !important;
  width: 18px !important;
  height: 18px !important;
  transform: none !important;
  z-index: 3 !important;
}

.wb-entry-card .select-field select,
.wb-entry-card .wb-knowledge-field select,
.wb-entry-card .time-field input {
  width: 100% !important;
  padding-left: 48px !important;
  text-indent: 0 !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

@media (max-width: 560px) {
  .wb-entry-card .field-row {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .wb-entry-card .select-field,
  .wb-entry-card .time-field,
  .wb-entry-card .wb-knowledge-field {
    grid-column: 1 / -1 !important;
  }

  .wb-entry-card .select-field > svg,
  .wb-entry-card .time-field > svg,
  .wb-entry-card .wb-knowledge-field > svg {
    left: 18px !important;
    bottom: 16px !important;
    width: 20px !important;
    height: 20px !important;
  }

  .wb-entry-card .select-field select,
  .wb-entry-card .wb-knowledge-field select,
  .wb-entry-card .time-field input {
    min-height: 56px !important;
    padding: 13px 44px 13px 56px !important;
    font-size: 18px !important;
    line-height: 1.2 !important;
  }
}

/* iOS font fix: use stable system Chinese fonts instead of desktop-only calligraphy fonts. */
body,
button,
input,
select,
textarea {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif !important;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.topbar h1,
.header-time,
.tab,
.mini-stat-card p,
.mini-stat-card span,
.wb-entry-card h2,
.panel > .field:first-child::before,
.wb-step-process::before,
.ocr-review-field::before,
.field-row:first-of-type::before,
.field:has(#tagPicker)::before,
.field:has(#noteInput)::before,
.field:has(#solutionInput)::before,
.field:has(#reflectionInput)::before {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif !important;
  letter-spacing: 0 !important;
}

.topbar h1 {
  font-weight: 900 !important;
  color: #1f6b3c !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9), 0 4px 12px rgba(45, 99, 57, 0.12) !important;
}

.quote-card p {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif !important;
  color: #1f6b3c !important;
  font-weight: 950 !important;
  letter-spacing: 1px !important;
  line-height: 1.45 !important;
  -webkit-text-stroke: 0 !important;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95),
    0 3px 8px rgba(39, 99, 54, 0.12) !important;
}

@media (max-width: 560px) {
  .topbar h1 {
    font-size: 30px !important;
    line-height: 1.15 !important;
  }

  .header-time {
    font-size: 15px !important;
    font-weight: 800 !important;
  }

  .quote-card p {
    font-size: 28px !important;
    line-height: 1.5 !important;
  }

  .field > span,
  .select-field > span,
  .time-field > span,
  .wb-knowledge-field > span {
    font-weight: 800 !important;
  }
}

#printOutput {
  display: none;
}

@media print {
  body.printing-pdf > :not(#printOutput) {
    display: none !important;
  }

  body.printing-pdf {
    margin: 0 !important;
    background: #fff !important;
  }

  body.printing-pdf #printOutput {
    display: block !important;
  }
}

.print-preview-screen {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(24, 31, 24, 0.58);
  backdrop-filter: blur(3px);
}

.print-preview-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 10px;
  width: min(900px, 100%);
  height: min(92vh, 820px);
  padding: 14px;
  border-radius: 10px;
  background: #fffdf8;
  box-shadow: 0 18px 50px rgba(20, 30, 20, 0.28);
}

.print-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.print-preview-head strong {
  display: block;
  color: var(--green-dark);
  font-size: 18px;
}

.print-preview-head span {
  display: block;
  margin-top: 2px;
  color: #6b7468;
  font-size: 13px;
}

.print-preview-head .secondary-button {
  width: auto;
  min-width: 76px;
  min-height: 38px;
}

.print-preview-frame {
  width: 100%;
  height: 100%;
  border: 1px solid #e3dfd5;
  border-radius: 8px;
  background: #ffffff;
}

.print-mode-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.print-mode-picker label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #dfe8d8;
  border-radius: 8px;
  background: #fffdf8;
  color: #2a3a28;
  font-weight: 800;
  cursor: pointer;
}

.print-mode-picker label:has(input:checked) {
  border-color: #3f8554;
  background: #edf7e9;
  color: var(--green-dark);
}

.print-mode-picker input {
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
  accent-color: #3f8554;
}

.print-extra-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px dashed #d7e7ce;
  border-radius: 8px;
  background: #fbfdf8;
  color: #2d442d;
  font-size: 14px;
  font-weight: 750;
}

.print-extra-option input {
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
  accent-color: #3f8554;
}

.print-preview-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.print-preview-actions .primary-button,
.print-preview-actions .secondary-button {
  margin: 0;
  min-height: 44px;
}

.print-preview-tip {
  margin: 0;
  color: #6d756a;
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 560px) {
  .print-preview-screen {
    padding: 10px;
  }

  .print-preview-panel {
    height: 88vh;
    padding: 10px;
    border-radius: 8px;
  }

  .print-preview-actions {
    grid-template-columns: 1fr;
  }

  .print-mode-picker {
    grid-template-columns: 1fr;
  }
}

.detail-image {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf6;
}

.detail-image-bottom {
  margin-top: 8px;
}

.detail-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.detail-section strong {
  color: var(--green-dark);
}

.detail-section p {
  margin: 5px 0 0;
  white-space: pre-wrap;
  line-height: 1.6;
}

.detail-edit-form {
  display: grid;
  gap: 2px;
}

.detail-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.edit-tag-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 0 11px;
  color: #3e493d;
  font-size: 13px;
}

.edit-tag-option input {
  width: auto;
  margin: 0;
}

.detail-edit-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.card-actions button[data-action="wrong"] {
  background: #fae4dd;
  color: #8a3e2f;
}

.card-actions button[data-action="mastered"] {
  background: #e3f0e1;
  color: var(--green-dark);
}

.card-actions button[data-action="delete"] {
  background: #f0eeee;
  color: #7b4a4a;
}

.material-panel {
  margin-top: 16px;
}

.material-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.material-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid #e6dfd2;
  border-radius: 10px;
  background: #fffaf1;
}

.material-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.material-actions {
  display: grid;
  gap: 8px;
  align-content: start;
  min-width: 72px;
}

.material-actions a,
.material-actions button {
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  background: #e6f1df;
  color: var(--green-dark);
  text-align: center;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}

.material-actions button {
  background: #f9e7e1;
  color: #9f3a25;
}

.related-materials {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}

.material-links-title {
  color: var(--green-dark);
  font-weight: 700;
  font-size: 13px;
}

.material-link {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid #d7e7ce;
  border-radius: 8px;
  background: #f6fbf2;
  color: var(--text);
  text-decoration: none;
}

.material-link span {
  color: var(--muted);
  font-size: 13px;
}

.weekly-analysis {
  margin: 12px 0 16px;
}

.weekly-card {
  display: grid;
  gap: 12px;
  padding: 15px;
  border: 1px solid #d7e7ce;
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fcf5, #ffffff);
  box-shadow: var(--shadow-soft);
}

.weekly-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.weekly-head strong {
  color: var(--green-dark);
  font-size: 16px;
}

.weekly-head span,
.weekly-card p,
.weekly-actions {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.weekly-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.weekly-grid div {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 8px;
  background: var(--cream);
}

.weekly-grid span {
  color: var(--muted);
  font-size: 12px;
}

.weekly-grid strong {
  color: var(--green-dark);
}

.weekly-actions {
  padding-left: 18px;
}

.ai-analysis-panel {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.ai-analysis-panel textarea {
  min-height: 92px;
}

.ai-analysis-answer {
  display: none;
  padding: 12px;
  border: 1px solid #d7e7ce;
  border-radius: 8px;
  background: #fffdf9;
  line-height: 1.65;
}

.ai-analysis-answer:not(:empty) {
  display: block;
}

.chart-list {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  gap: 5px;
}

.bar-head {
  display: flex;
  justify-content: space-between;
  color: #3f473e;
  font-size: 14px;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: #e6ebe3;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--yellow), var(--coral));
}

.empty {
  padding: 24px 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  text-align: center;
}

@media (max-width: 560px) {
  .app-shell {
    padding: 18px 12px 28px;
  }

  .topbar {
    align-items: flex-start;
  }

  .top-actions {
    flex-shrink: 0;
  }

  h1 {
    font-size: 28px;
  }

  .summary-grid {
    grid-template-columns: minmax(0, 1fr) 112px;
    gap: 8px;
  }

  .summary-card {
    min-height: 76px;
    padding: 12px 10px;
  }

  .summary-card span {
    font-size: 22px;
  }

  .summary-card .summary-time {
    font-size: 13px;
  }

  .tabs {
    gap: 7px;
  }

  .tab {
    min-height: 40px;
    font-size: 14px;
  }

  .panel {
    padding: 14px;
  }

  .mistake-body {
    padding-right: 0;
    padding-top: 34px;
  }

  .field-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

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

  .material-card {
    display: grid;
  }

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

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

  .detail-screen {
    padding: 10px;
  }

  .detail-panel {
    max-height: 92vh;
    padding: 14px;
  }

  .detail-edit-grid,
  .detail-edit-actions {
    grid-template-columns: 1fr;
  }

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

  .weekly-head {
    display: grid;
  }
}

/* Top area match pass */
.header-time {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding-top: 2px;
  color: #245e38;
  font-size: 17px;
}

.header-time svg {
  width: 18px;
  height: 18px;
  color: #245e38;
}

.profile-pill {
  padding: 4px 9px 4px 4px;
  background: rgba(246, 249, 241, 0.96);
}

.profile-pill > svg {
  width: 16px;
  height: 16px;
  color: #263126;
}

.quote-card {
  min-height: 166px;
  padding: 20px 138px 18px 28px;
  background: url("assets/quote-hydrangea-banner.jpg") center / cover no-repeat;
}

.quote-card p {
  max-width: 248px;
  font-size: 34px;
  line-height: 1.62;
  letter-spacing: 1.5px;
}

.mini-stats {
  gap: 10px;
}

.mini-stat-card {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 78px;
  padding: 10px 10px;
  background:
    url("assets/journal-decor.jpg") right -34px bottom -46px / 96px 96px no-repeat,
    rgba(255, 255, 255, 0.96);
}

.mini-stat-card > svg {
  width: 30px;
  height: 30px;
  padding: 6px;
  border-radius: 50%;
  background: #edf7e9;
  color: #5f9a5f;
}

.mini-stat-card div {
  min-width: 0;
}

.mini-stat-card p {
  margin: 0 0 3px;
  text-align: left;
  color: #263126;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.mini-stat-card span {
  display: inline;
  color: #3f8554;
  font-size: 29px;
  font-weight: 900;
  line-height: 1;
}

.mini-stat-card em {
  margin-left: 3px;
  color: #263126;
  font-style: normal;
  font-weight: 700;
}

.preview-album-button {
  color: rgba(36, 94, 56, 0.68);
  font-weight: 650;
}

.preview-album-button svg {
  color: rgba(91, 153, 96, 0.62);
}

@media (max-width: 560px) {
  .header-time {
    gap: 5px;
    font-size: 14px;
  }

  .header-time svg {
    width: 16px;
    height: 16px;
  }

  .profile-pill > svg {
    width: 14px;
    height: 14px;
  }

  .quote-card {
    padding: 18px 80px 15px 20px;
  }

  .quote-card p {
    max-width: 205px;
    font-size: 29px;
    line-height: 1.58;
  }

  .mini-stat-card {
    grid-template-columns: 1fr;
    gap: 4px;
    min-height: 72px;
    padding: 9px 9px;
  }

  .mini-stat-card > svg {
    width: 26px;
    height: 26px;
    padding: 5px;
  }

  .mini-stat-card p {
    font-size: 12px;
  }

  .mini-stat-card span {
    font-size: 25px;
  }
}

/* Final upload area refinement */
.photo-source-actions.hidden-actions {
  display: none;
}

.photo-preview {
  position: relative;
  min-height: 150px;
  margin: 0 0 18px;
  cursor: pointer;
}

.photo-preview.compact {
  min-height: 118px;
}

.preview-album-button {
  position: absolute;
  top: 13px;
  right: 13px;
  display: inline-grid;
  place-items: center;
  gap: 4px;
  min-width: 66px;
  min-height: 48px;
  border: 0;
  background: transparent;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.preview-album-button svg {
  width: 23px;
  height: 23px;
  color: #5b9960;
}

.photo-preview:hover {
  background: #fcfff9;
}

/* Rebuilt first-screen layout: closer to the selected mockup */
body {
  background: #fffdf8;
}

.app-shell {
  width: min(100%, 430px) !important;
  padding: 18px 15px 28px !important;
}

.app-shell::before {
  width: 170px !important;
  height: 170px !important;
  top: 98px !important;
  right: max(-82px, calc((100vw - 430px) / 2 - 92px)) !important;
  opacity: 0.9 !important;
}

.app-shell::after {
  width: 144px !important;
  height: 144px !important;
  right: max(-72px, calc((100vw - 430px) / 2 - 80px)) !important;
  bottom: -34px !important;
  opacity: 0.62 !important;
}

.wb-topbar {
  display: grid !important;
  grid-template-columns: 1fr auto;
  align-items: start !important;
  gap: 12px !important;
  margin-bottom: 10px !important;
  padding: 0 !important;
}

.wb-topbar h1 {
  font-size: 32px !important;
  line-height: 1.08 !important;
  color: #236033 !important;
  font-family: "KaiTi", "STKaiti", "Microsoft YaHei", sans-serif !important;
  font-weight: 900 !important;
}

.title-flower {
  width: 28px !important;
  height: 28px !important;
}

.wb-topbar .sync-status {
  margin-top: 18px !important;
  font-size: 14px !important;
  color: #236033 !important;
}

.top-actions {
  display: grid !important;
  justify-items: end !important;
  gap: 10px !important;
  padding-top: 2px;
}

.header-time {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  color: #236033 !important;
  font-family: "KaiTi", "STKaiti", "Microsoft YaHei", sans-serif !important;
  font-size: 16px !important;
  font-weight: 900 !important;
  white-space: nowrap !important;
  text-decoration: underline !important;
  text-decoration-color: #edc95f !important;
  text-decoration-thickness: 3px !important;
  text-underline-offset: 7px !important;
}

.header-time svg {
  width: 17px !important;
  height: 17px !important;
  color: #236033 !important;
}

.profile-pill {
  min-height: 38px !important;
  padding: 4px 9px 4px 4px !important;
  gap: 6px !important;
  border-radius: 999px !important;
  background: rgba(246, 249, 241, 0.96) !important;
  box-shadow: 0 8px 22px rgba(38, 80, 45, 0.1) !important;
  cursor: pointer;
}

.profile-pill img {
  width: 30px !important;
  height: 30px !important;
}

.profile-pill span {
  font-size: 14px;
  font-weight: 850;
}

.profile-pill > svg {
  width: 14px !important;
  height: 14px !important;
}

.wb-hero {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 112px !important;
  gap: 10px !important;
  margin: 10px 0 12px !important;
}

.quote-card {
  min-height: 162px !important;
  display: flex !important;
  align-items: center !important;
  padding: 18px 76px 16px 23px !important;
  border: 1px solid #ebdfc9 !important;
  border-radius: 8px !important;
  background: url("assets/quote-hydrangea-banner.jpg") center / cover no-repeat !important;
  box-shadow: none !important;
}

.quote-card p {
  max-width: 208px !important;
  margin: 0 !important;
  color: #246636 !important;
  font-family: "KaiTi", "STKaiti", "FangSong", "Microsoft YaHei", sans-serif !important;
  font-size: 29px !important;
  font-weight: 900 !important;
  line-height: 1.62 !important;
  letter-spacing: 1.2px !important;
}

.quote-card p::after {
  content: "" !important;
  display: block !important;
  width: 112px !important;
  height: 9px !important;
  margin: 0 0 0 18px !important;
  border-bottom: 3px solid #edc95f !important;
  border-radius: 50% !important;
}

.mini-stats {
  display: grid !important;
  gap: 10px !important;
}

.mini-stat-card {
  min-height: 76px !important;
  display: grid !important;
  grid-template-columns: 34px 1fr !important;
  align-items: center !important;
  gap: 7px !important;
  padding: 9px 9px !important;
  border: 1px solid #e6dfd2 !important;
  border-radius: 8px !important;
  background:
    url("assets/journal-decor.jpg") right -32px bottom -44px / 94px 94px no-repeat,
    rgba(255, 255, 255, 0.96) !important;
  box-shadow: none !important;
}

.mini-stat-card > svg {
  width: 30px !important;
  height: 30px !important;
  padding: 6px !important;
  border-radius: 50% !important;
  background: #edf7e9 !important;
  color: #639a5f !important;
}

.mini-stat-card p {
  margin: 0 0 2px !important;
  color: #20251f !important;
  font-size: 12px !important;
  font-weight: 850 !important;
  text-align: left !important;
  white-space: nowrap;
}

.mini-stat-card span {
  display: inline !important;
  color: #3f8554 !important;
  font-size: 28px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
}

.mini-stat-card em {
  margin-left: 2px;
  color: #20251f;
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.wb-tabs {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 8px !important;
  margin: 0 0 10px !important;
}

.wb-tabs .tab {
  min-height: 48px !important;
  padding: 0 6px !important;
  gap: 5px !important;
  border: 1px solid #e6dfd2 !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.92) !important;
  color: #2e3b2d !important;
  font-family: "KaiTi", "STKaiti", "Microsoft YaHei", sans-serif !important;
  font-size: 18px !important;
  font-weight: 900 !important;
  box-shadow: none !important;
}

.wb-tabs .tab.active {
  border-color: transparent !important;
  background: linear-gradient(180deg, #4b9860, #2f7a47) !important;
  color: #fff !important;
}

.wb-tabs .tab svg {
  width: 20px !important;
  height: 20px !important;
  color: currentColor !important;
}

.wb-entry-card {
  padding: 14px 12px !important;
  border: 1px solid #eadfcd !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: none !important;
}

.wb-entry-card .field {
  margin-bottom: 12px !important;
}

.wb-upload-box {
  min-height: 126px !important;
  margin: 0 0 16px !important;
  border: 1.5px dashed #3f8554 !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.72) !important;
}

.wb-upload-box-compact {
  min-height: 104px !important;
}

.upload-placeholder {
  gap: 6px !important;
}

.upload-placeholder svg {
  width: 42px !important;
  height: 42px !important;
  padding: 10px !important;
  background: #edf7e9 !important;
  color: #3f8554 !important;
}

.upload-placeholder strong {
  color: #20251f !important;
  font-size: 18px !important;
  font-weight: 900 !important;
}

.upload-placeholder span {
  color: #7a8278 !important;
  font-size: 13px !important;
}

.preview-album-button {
  top: 12px !important;
  right: 12px !important;
  color: rgba(36, 94, 56, 0.48) !important;
  font-size: 12px !important;
  font-weight: 650 !important;
}

.preview-album-button svg {
  color: rgba(91, 153, 96, 0.46) !important;
  width: 22px !important;
  height: 22px !important;
}

.ocr-review-field,
.wb-step {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.panel > .field:first-child::before,
.wb-step-process::before,
.wb-step-ocr::before,
.wb-step-basic::before,
.wb-step-reason::before,
.wb-step-note::before,
.wb-step-solution::before {
  margin: 0 0 12px !important;
  color: #1f2723 !important;
  font-size: 19px !important;
  font-weight: 900 !important;
}

.wb-step-process::before {
  content: "1.5 做错过程照片（可选）" !important;
}

.wb-step-process > span {
  display: none !important;
}

.field-row {
  grid-template-columns: 1fr 1fr !important;
  gap: 9px !important;
}

.select-field select {
  min-height: 48px !important;
}

/* Header time and quote typography refinement */
.top-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.header-time {
  color: var(--green-dark);
  font-family: "KaiTi", "STKaiti", "Microsoft YaHei", sans-serif;
  font-size: 18px;
  font-weight: 850;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: underline;
  text-decoration-color: #efc85f;
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
}

.quote-card {
  display: flex;
  align-items: center;
  padding: 22px 150px 18px 28px;
}

.quote-card p {
  max-width: 260px;
  margin: 0;
  color: #286437;
  font-family: "KaiTi", "STKaiti", "FangSong", "Microsoft YaHei", sans-serif;
  font-size: 36px;
  font-weight: 900;
  line-height: 1.58;
  letter-spacing: 1px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
}

.quote-card p::after {
  width: 132px;
  margin-left: 26px;
  border-bottom-width: 4px;
}

.quote-card .summary-time {
  display: none;
}

@media (max-width: 560px) {
  .top-actions {
    gap: 7px;
  }

  .header-time {
    font-size: 15px;
  }

  .quote-card {
    padding: 18px 84px 15px 20px;
  }

  .quote-card p {
    max-width: 205px;
    font-size: 30px;
    line-height: 1.55;
  }
}

/* Layout and icon fixes after visual review */
.app-shell {
  width: min(100%, 560px);
}

.app-shell::before {
  top: 72px;
  right: max(-72px, calc((100vw - 560px) / 2 - 94px));
}

.app-shell::after {
  right: max(-70px, calc((100vw - 560px) / 2 - 88px));
}

.home-hero {
  grid-template-columns: minmax(0, 1fr) 126px;
  gap: 12px;
}

.quote-card {
  min-height: 168px;
  padding: 22px 154px 18px 24px;
  background: url("assets/quote-hydrangea-banner.jpg") center / cover no-repeat;
}

.quote-card::after {
  display: none;
}

.quote-card p {
  max-width: 260px;
  font-size: 32px;
}

.quote-card .summary-time {
  top: -66px;
  right: -138px;
  width: 230px;
}

.mini-stat-card {
  min-height: 78px;
  background: rgba(255, 255, 255, 0.94);
}

.tabs {
  gap: 10px;
}

.tab {
  white-space: nowrap;
  padding-inline: 8px;
}

.tab span {
  white-space: nowrap;
}

.photo-preview {
  min-height: 148px;
}

.upload-placeholder {
  display: grid;
  place-items: center;
  gap: 6px;
  color: #536052;
  text-align: center;
}

.upload-placeholder svg {
  width: 44px;
  height: 44px;
  padding: 10px;
  border-radius: 50%;
  background: #edf7e9;
  color: var(--green);
}

.upload-placeholder strong {
  color: #273027;
  font-size: 18px;
}

.upload-placeholder span {
  color: #7a8278;
  font-size: 14px;
  font-weight: 500;
}

.upload-placeholder.small svg {
  width: 38px;
  height: 38px;
  padding: 9px;
}

.select-field {
  position: relative;
}

.select-field > svg {
  position: absolute;
  left: 13px;
  bottom: 13px;
  z-index: 1;
  width: 20px;
  height: 20px;
  color: #6a9e62;
  pointer-events: none;
}

.select-field select {
  padding-left: 42px;
}

.source-field > svg {
  color: #e69346;
}

.grade-field > svg,
.module-field > svg,
.knowledge-field > svg {
  color: #7398d4;
}

.field-row {
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.tag-option {
  min-width: 0;
  flex: 1 1 calc((100% - 16px) / 3);
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100%, 430px);
  }

  .home-hero {
    grid-template-columns: minmax(0, 1fr) 112px;
    gap: 8px;
  }

  .quote-card {
    min-height: 150px;
    padding: 18px 88px 15px 18px;
  }

  .quote-card p {
    max-width: 205px;
    font-size: 27px;
  }

  .quote-card .summary-time {
    right: -116px;
    width: 198px;
  }

  .field-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .select-field > svg {
    left: 10px;
  }

  .select-field select {
    padding-left: 35px;
  }

  .tag-option {
    flex-basis: calc((100% - 8px) / 2);
  }
}

/* Hydrangea journal UI */
.app-shell {
  position: relative;
  overflow: hidden;
}

.app-shell::before,
.app-shell::after {
  content: "";
  position: fixed;
  z-index: -1;
  width: 210px;
  height: 210px;
  background: url("assets/hydrangea-corner.jpg") center / contain no-repeat;
  pointer-events: none;
  opacity: 0.72;
}

.app-shell::before {
  top: 56px;
  right: max(-78px, calc((100vw - 720px) / 2 - 92px));
}

.app-shell::after {
  right: max(-88px, calc((100vw - 720px) / 2 - 110px));
  bottom: -44px;
  transform: rotate(180deg);
  opacity: 0.5;
}

.topbar {
  position: relative;
  margin-bottom: 10px;
}

.topbar h1 {
  color: var(--green-dark);
  font-family: "KaiTi", "STKaiti", "Microsoft YaHei", sans-serif;
  font-size: 34px;
  font-weight: 800;
}

.sync-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  color: var(--green-dark);
  font-size: 14px;
}

.sync-status::before {
  content: "☁";
  font-size: 18px;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 126px;
  gap: 10px;
  margin: 16px 0 14px;
}

.quote-card {
  position: relative;
  min-height: 142px;
  padding: 18px 128px 18px 18px;
  border: 1px solid rgba(233, 221, 194, 0.92);
  border-radius: 8px;
  background: linear-gradient(105deg, #fffdf5 0%, #fff8dc 54%, rgba(255, 253, 245, 0.9) 100%);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.quote-card::after {
  content: "";
  position: absolute;
  right: -38px;
  bottom: -56px;
  width: 190px;
  height: 190px;
  background: url("assets/hydrangea-corner.jpg") center / contain no-repeat;
  opacity: 0.9;
}

.quote-card .summary-time {
  position: relative;
  z-index: 1;
  display: inline-block;
  min-height: 0;
  color: var(--green-dark);
  font-family: "KaiTi", "STKaiti", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: underline;
  text-decoration-color: #f0c767;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.quote-card p {
  position: relative;
  z-index: 1;
  max-width: 250px;
  margin: 22px 0 0;
  color: var(--green-dark);
  font-family: "KaiTi", "STKaiti", "Microsoft YaHei", sans-serif;
  font-size: 27px;
  font-weight: 800;
  line-height: 1.55;
}

.mini-stats {
  display: grid;
  gap: 10px;
}

.mini-stat-card {
  min-height: 66px;
  padding: 11px 10px;
  border: 1px solid rgba(223, 230, 220, 0.95);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
}

.mini-stat-card span {
  display: block;
  color: var(--green);
  font-size: 25px;
  font-weight: 850;
  line-height: 1;
}

.mini-stat-card p {
  margin: 7px 0 0;
  color: #4e5b4b;
  font-size: 13px;
  font-weight: 700;
}

.tabs {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 50px;
  border: 1px solid rgba(223, 230, 220, 0.95);
  background: rgba(255, 255, 255, 0.86);
  color: #3e493d;
  font-family: "KaiTi", "STKaiti", "Microsoft YaHei", sans-serif;
  font-size: 18px;
  box-shadow: var(--shadow-soft);
}

.tab svg {
  width: 21px;
  height: 21px;
  color: #73a56a;
}

.tab.active {
  border-color: transparent;
  background: linear-gradient(180deg, #4d9862, #2f7a47);
  color: #fff;
}

.tab.active svg {
  color: #eef8e9;
}

.panel {
  border-color: #ece3d3;
  background: rgba(255, 255, 255, 0.96);
}

.field > span {
  color: #273027;
  font-size: 15px;
}

.photo-preview {
  min-height: 190px;
  border-color: #3f8554;
  border-style: dashed;
  background: linear-gradient(180deg, #fffefa, #fbfdf8);
}

.tag-option {
  min-height: 38px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.94);
}

.tag-option.selected {
  background: #eef8ea;
  box-shadow: inset 0 0 0 1px rgba(63, 133, 84, 0.18);
}

.primary-button {
  min-height: 52px;
  font-size: 18px;
}

@media (max-width: 560px) {
  .app-shell {
    padding-top: 18px;
  }

  .app-shell::before {
    width: 164px;
    height: 164px;
    top: 92px;
    right: -88px;
  }

  .app-shell::after {
    width: 150px;
    height: 150px;
    right: -74px;
    bottom: -38px;
  }

  .topbar h1 {
    font-size: 32px;
  }

  .home-hero {
    grid-template-columns: minmax(0, 1fr) 112px;
    gap: 8px;
  }

  .quote-card {
    min-height: 132px;
    padding: 15px 74px 14px 14px;
  }

  .quote-card::after {
    right: -64px;
    bottom: -48px;
    width: 152px;
    height: 152px;
  }

  .quote-card .summary-time {
    font-size: 15px;
  }

  .quote-card p {
    margin-top: 18px;
    font-size: 23px;
    line-height: 1.5;
  }

  .mini-stat-card {
    min-height: 62px;
    padding: 10px 9px;
  }

  .mini-stat-card span {
    font-size: 23px;
  }

  .mini-stat-card p {
    font-size: 12px;
  }

  .tab {
    min-height: 46px;
    gap: 4px;
    font-size: 16px;
  }

  .tab svg {
    width: 18px;
    height: 18px;
  }
}

/* Closer recreation of selected UI mock */
body {
  background:
    radial-gradient(circle at 82% 4%, rgba(245, 233, 167, 0.18), transparent 170px),
    linear-gradient(180deg, #fffdf7 0%, #fffdf9 54%, #ffffff 100%);
}

.app-shell {
  width: min(100%, 430px);
  padding: 20px 15px 28px;
}

.app-shell::before {
  width: 190px;
  height: 190px;
  top: 78px;
  right: max(-96px, calc((100vw - 430px) / 2 - 104px));
  opacity: 0.86;
}

.app-shell::after {
  width: 158px;
  height: 158px;
  right: max(-78px, calc((100vw - 430px) / 2 - 84px));
  bottom: -36px;
  opacity: 0.72;
}

.topbar {
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
}

.topbar .eyebrow {
  display: none;
}

.topbar h1 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 33px;
  line-height: 1.05;
  letter-spacing: 0;
  white-space: nowrap;
}

.title-flower {
  width: 31px;
  height: 31px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 23% 18%;
  mix-blend-mode: multiply;
}

.sync-status {
  margin-top: 18px;
  font-size: 15px;
  font-weight: 700;
}

.top-actions {
  align-items: center;
  gap: 5px;
}

.profile-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 5px 9px 5px 5px;
  border-radius: 999px;
  background: rgba(246, 249, 241, 0.92);
  color: #263126;
  font-weight: 800;
  box-shadow: var(--shadow-soft);
}

.profile-pill img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid #76a866;
  object-fit: cover;
}

.icon-button {
  display: none;
}

.home-hero {
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 10px;
  margin: 10px 0 13px;
}

.quote-card {
  min-height: 156px;
  padding: 22px 88px 18px 24px;
  border-color: rgba(238, 226, 196, 0.95);
  background:
    url("assets/journal-decor.jpg") -106px -82px / 198px 198px no-repeat,
    linear-gradient(105deg, #fffdf5 0%, #fff8df 60%, #fffdf7 100%);
}

.quote-card::after {
  right: -74px;
  bottom: -32px;
  width: 186px;
  height: 186px;
  opacity: 0.96;
}

.quote-card .summary-time {
  position: absolute;
  top: -68px;
  right: -124px;
  z-index: 4;
  width: 210px;
  color: var(--green-dark);
  font-size: 17px;
  text-align: left;
  white-space: nowrap;
  text-decoration-thickness: 3px;
}

.quote-card p {
  max-width: 205px;
  margin: 10px 0 0;
  font-size: 31px;
  line-height: 1.62;
}

.quote-card p::after {
  content: "";
  display: block;
  width: 118px;
  height: 10px;
  margin: 2px 0 0 20px;
  border-bottom: 3px solid #f1c95d;
  border-radius: 50%;
  transform: rotate(-2deg);
}

.mini-stats {
  gap: 8px;
}

.mini-stat-card {
  min-height: 74px;
  padding: 10px 10px 9px;
  background:
    url("assets/journal-decor.jpg") right -44px bottom -58px / 112px 112px no-repeat,
    rgba(255, 255, 255, 0.94);
}

.mini-stat-card span {
  margin-top: 2px;
  font-size: 29px;
}

.mini-stat-card p {
  margin-top: 2px;
  color: #283128;
  font-size: 14px;
  text-align: right;
}

.tabs {
  gap: 9px;
  margin-bottom: 10px;
}

.tab {
  min-height: 49px;
  gap: 6px;
  border-color: #e8dfcf;
  font-size: 20px;
}

.tab svg {
  width: 22px;
  height: 22px;
}

.panel {
  padding: 12px 11px 14px;
  border-color: #ede4d4;
  box-shadow: none;
}

.panel > .field:first-child > span,
.ocr-review-field > span {
  display: none;
}

.panel > .field:first-child::before,
.ocr-review-field::before,
.field-row:first-of-type::before {
  display: block;
  margin: 2px 0 12px;
  color: #1f2723;
  font-size: 18px;
  font-weight: 850;
}

.panel > .field:first-child::before {
  content: "1. 拍照录入错题";
}

.ocr-review-field::before {
  content: "2. OCR 原文（可修改）";
}

.field-row:first-of-type::before {
  content: "3. 基本信息";
  grid-column: 1 / -1;
}

.photo-source-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-bottom: 10px;
}

.photo-preview {
  min-height: 118px;
  margin: -6px 0 16px;
  border: 1.5px dashed #3f8554;
  background: rgba(255, 255, 255, 0.74);
  font-size: 17px;
  font-weight: 750;
}

.photo-tools {
  margin-top: -8px;
}

.ocr-review-field {
  margin-bottom: 18px;
  padding: 0;
  border: 0;
  background: transparent;
}

.ocr-review-field textarea {
  min-height: 112px;
  border-color: #e1ded6;
  background: rgba(255, 255, 255, 0.92);
}

.field-row {
  gap: 9px;
}

.field-row .field {
  margin-bottom: 10px;
}

select,
input,
textarea {
  min-height: 46px;
  border-color: #e1ded6;
  background: rgba(255, 255, 255, 0.94);
  font-size: 16px;
}

.tag-picker {
  gap: 8px;
}

.field:has(#tagPicker)::before {
  content: "4. 错因（可多选）";
  display: block;
  margin: 2px 0 10px;
  color: #1f2723;
  font-size: 18px;
  font-weight: 850;
}

.field:has(#tagPicker) > span {
  display: none;
}

.tag-option {
  min-width: calc((100% - 16px) / 3);
  min-height: 40px;
  border-color: #e1ded6;
  border-radius: 8px;
  font-size: 15px;
}

.field:has(#noteInput)::before {
  content: "5. 家长备注（可选）";
  display: block;
  margin: 2px 0 10px;
  color: #1f2723;
  font-size: 18px;
  font-weight: 850;
}

.field:has(#noteInput) > span {
  display: none;
}

.field:has(#solutionInput)::before {
  content: "6. 答案与解析（可选）";
  display: block;
  margin: 2px 0 10px;
  color: #1f2723;
  font-size: 18px;
  font-weight: 850;
}

.field:has(#solutionInput) > span {
  display: none;
}

.photo-preview.compact {
  min-height: 86px;
}

.primary-button {
  margin-top: 2px;
  border-radius: 8px;
  font-size: 20px;
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100%, 430px);
    padding: 18px 14px 26px;
  }

  .topbar h1 {
    font-size: 31px;
  }

  .profile-pill {
    min-height: 40px;
    padding-right: 7px;
  }

  .profile-pill img {
    width: 32px;
    height: 32px;
  }

  .home-hero {
    grid-template-columns: minmax(0, 1fr) 106px;
  }

  .quote-card {
    min-height: 150px;
    padding: 18px 68px 15px 20px;
  }

  .quote-card .summary-time {
    top: -66px;
    right: -116px;
    width: 194px;
    font-size: 15px;
  }

  .quote-card p {
    max-width: 184px;
    font-size: 28px;
  }

  .mini-stat-card {
    min-height: 71px;
  }

  .tab {
    min-height: 48px;
    font-size: 18px;
  }

  .tab svg {
    width: 20px;
    height: 20px;
  }
}

/* Final mobile form repair: keep field icons inside selects without overlap */
.wb-step-basic {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 12px !important;
  margin: 0 0 12px !important;
}

.wb-step-basic::before {
  content: "3. 基本信息" !important;
  grid-column: 1 / -1 !important;
  display: block !important;
  margin: 0 0 2px !important;
  color: #1f2723 !important;
  font-size: 19px !important;
  font-weight: 900 !important;
}

.select-field,
.wb-knowledge-field {
  position: relative !important;
  display: grid !important;
  gap: 7px !important;
  margin: 0 0 12px !important;
}

.select-field > span,
.wb-knowledge-field > span {
  display: block !important;
  color: #263126 !important;
  font-size: 15px !important;
  font-weight: 850 !important;
  line-height: 1.2 !important;
}

.select-field > svg,
.wb-knowledge-field > svg {
  position: absolute !important;
  left: 14px !important;
  bottom: 13px !important;
  z-index: 2 !important;
  width: 20px !important;
  height: 20px !important;
  pointer-events: none !important;
  opacity: 0.82 !important;
}

.select-field select,
.wb-knowledge-field select {
  min-height: 50px !important;
  padding: 11px 42px 11px 44px !important;
  border: 1px solid #e1ded6 !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.96) !important;
  color: #20251f !important;
  font-size: 17px !important;
  line-height: 1.3 !important;
}

.time-field {
  position: relative !important;
  display: grid !important;
  gap: 7px !important;
  margin: 0 0 12px !important;
}

.time-field > span {
  color: #263126 !important;
  font-size: 15px !important;
  font-weight: 850 !important;
}

.time-field > svg {
  position: absolute !important;
  left: 14px !important;
  bottom: 14px !important;
  z-index: 2 !important;
  width: 20px !important;
  height: 20px !important;
  color: #6a9e62 !important;
  pointer-events: none !important;
  opacity: 0.82 !important;
}

.time-field input {
  min-height: 50px !important;
  padding: 11px 13px 11px 44px !important;
  border: 1px solid #e1ded6 !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.96) !important;
  color: #20251f !important;
  font-size: 17px !important;
}

.knowledge-field,
.wb-knowledge-field {
  grid-column: 1 / -1 !important;
}

.knowledge-field > svg,
.wb-knowledge-field > svg {
  bottom: 15px !important;
}

@media (max-width: 430px) {
  .wb-step-basic {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  .select-field > svg,
  .wb-knowledge-field > svg {
    left: 12px !important;
    width: 18px !important;
    height: 18px !important;
  }

  .select-field select,
  .wb-knowledge-field select,
  .time-field input {
    min-height: 48px !important;
    padding-left: 38px !important;
    padding-right: 34px !important;
    font-size: 16px !important;
  }

  .time-field > svg {
    left: 12px !important;
    width: 18px !important;
    height: 18px !important;
  }
}

/* Make daily quote more like decorative hand lettering */
.quote-card {
  padding-left: 25px !important;
  padding-right: 112px !important;
}

.quote-card p {
  max-width: 240px !important;
  color: #1f6536 !important;
  font-family: "STXingkai", "KaiTi", "STKaiti", "FangSong", "Microsoft YaHei", sans-serif !important;
  font-size: 33px !important;
  font-weight: 900 !important;
  line-height: 1.5 !important;
  letter-spacing: 2px !important;
  -webkit-text-stroke: 0.25px rgba(31, 101, 54, 0.35);
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95),
    1px 1px 0 rgba(31, 101, 54, 0.08),
    0 4px 10px rgba(64, 112, 61, 0.1) !important;
}

.quote-card p::after {
  width: 126px !important;
  margin-top: 2px !important;
  margin-left: 28px !important;
  border-bottom-color: #edc95f !important;
  border-bottom-width: 4px !important;
}

@media (max-width: 430px) {
  .quote-card {
    padding-left: 21px !important;
    padding-right: 84px !important;
  }

  .quote-card p {
    max-width: 215px !important;
    font-size: 31px !important;
    line-height: 1.48 !important;
    letter-spacing: 1.5px !important;
  }
}

/* Softer hero stat cards */
.mini-stats {
  gap: 10px !important;
  align-self: stretch !important;
}

.mini-stat-card {
  position: relative !important;
  grid-template-columns: 42px minmax(0, 1fr) !important;
  align-items: center !important;
  overflow: hidden !important;
  min-height: 78px !important;
  padding: 10px 12px !important;
  border: 1px solid rgba(230, 223, 210, 0.95) !important;
  border-radius: 8px !important;
  background: linear-gradient(105deg, rgba(255,255,255,0.97) 0%, rgba(255,253,247,0.96) 62%, rgba(255,248,223,0.8) 100%) !important;
  box-shadow: 0 8px 18px rgba(59, 95, 54, 0.06) !important;
}

.mini-stat-card::after {
  content: "";
  position: absolute;
  right: -22px;
  bottom: -30px;
  width: 92px;
  height: 92px;
  background: url("assets/journal-decor.jpg") 20% 18% / 150px 150px no-repeat;
  opacity: 0.78;
  pointer-events: none;
}

.mini-stat-card > svg {
  position: relative !important;
  z-index: 1 !important;
  width: 34px !important;
  height: 34px !important;
  padding: 7px !important;
  border-radius: 50% !important;
  background: #edf7e9 !important;
  color: #5f9a5f !important;
}

.mini-stat-card div {
  position: relative !important;
  z-index: 1 !important;
}

.mini-stat-card p {
  margin: 0 0 4px !important;
  color: #20251f !important;
  font-size: 14px !important;
  font-weight: 900 !important;
  line-height: 1.1 !important;
}

.mini-stat-card span {
  color: #3f8554 !important;
  font-size: 34px !important;
  font-weight: 950 !important;
  letter-spacing: 0 !important;
}

.mini-stat-card em {
  color: #20251f !important;
  font-size: 14px !important;
  font-weight: 900 !important;
}

@media (max-width: 430px) {
  .mini-stat-card {
    grid-template-columns: 34px minmax(0, 1fr) !important;
    min-height: 74px !important;
    padding: 9px 9px !important;
  }

  .mini-stat-card > svg {
    width: 30px !important;
    height: 30px !important;
    padding: 6px !important;
  }

  .mini-stat-card p {
    font-size: 13px !important;
  }

  .mini-stat-card span {
    font-size: 30px !important;
  }
}

/* iOS final override: prevent select icons from floating over text */
.wb-entry-card .select-field,
.wb-entry-card .time-field,
.wb-entry-card .wb-knowledge-field {
  overflow: visible !important;
}

.wb-entry-card .select-field > svg,
.wb-entry-card .time-field > svg,
.wb-entry-card .wb-knowledge-field > svg {
  position: absolute !important;
  top: auto !important;
  bottom: 13px !important;
  left: 14px !important;
  z-index: 3 !important;
  width: 18px !important;
  height: 18px !important;
  transform: none !important;
  pointer-events: none !important;
}

.wb-entry-card .select-field select,
.wb-entry-card .wb-knowledge-field select,
.wb-entry-card .time-field input {
  width: 100% !important;
  padding-left: 48px !important;
  text-indent: 0 !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

@media (max-width: 560px) {
  .wb-entry-card .field-row {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .wb-entry-card .select-field,
  .wb-entry-card .time-field,
  .wb-entry-card .wb-knowledge-field {
    grid-column: 1 / -1 !important;
  }

  .wb-entry-card .select-field > svg,
  .wb-entry-card .time-field > svg,
  .wb-entry-card .wb-knowledge-field > svg {
    left: 18px !important;
    bottom: 17px !important;
    width: 20px !important;
    height: 20px !important;
  }

  .wb-entry-card .select-field select,
  .wb-entry-card .wb-knowledge-field select,
  .wb-entry-card .time-field input {
    min-height: 56px !important;
    padding: 13px 44px 13px 56px !important;
    font-size: 18px !important;
    line-height: 1.2 !important;
  }
}
