:root { color-scheme: light; font-family: Arial, "Microsoft YaHei", sans-serif; }
body { margin: 0; background: #eef3f8; color: #1f2937; }
a { color: #2563eb; text-decoration: none; }
button, input, select, textarea { font: inherit; }

input { border: 1px solid #d1d5db; border-radius: 7px; box-sizing: border-box; padding: 11px 12px; }
textarea { border: 1px solid #d1d5db; border-radius: 7px; box-sizing: border-box; padding: 11px 12px; resize: vertical; }
button { border: 1px solid #d1d5db; border-radius: 7px; background: #fff; cursor: pointer; padding: 11px 14px; }
h1 { font-size: 27px; line-height: 1.25; margin: 0 0 18px; }
h2 { font-size: 19px; margin: 0 0 14px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

.page { max-width: 1000px; margin: 0 auto; padding: 32px; }
.page.narrow { max-width: 460px; }
.panel { background: #fff; border: 1px solid #e0e7ef; border-radius: 8px; padding: 22px; margin-bottom: 22px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.inline-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #374151;
  font-size: 14px;
  font-weight: 700;
}
.inline-field input { min-width: 130px; }
.stack { display: grid; gap: 16px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 20px; }
.table { width: 100%; border-collapse: collapse; background: #fff; }
.table th, .table td { border-bottom: 1px solid #e5e7eb; padding: 14px 12px; text-align: left; vertical-align: top; line-height: 1.55; }
.inline-form { display: inline-flex; margin: 0 10px 10px 0; }
.danger { color: #b91c1c; }
.success { color: #047857; }
.danger-button { color: #b91c1c; border-color: #fecaca; }
.secondary-button { display: inline-block; border: 1px solid #cfd8e3; border-radius: 7px; background: #fff; color: #111827; font-weight: 700; padding: 11px 14px; }
.hint { color: #6b7280; font-size: 14px; line-height: 1.65; margin-top: 6px; }
.primary.compact { width: auto; display: inline-block; padding: 11px 16px; }
.empty-admin-state { min-height: 160px; display: grid; align-content: center; }
.selected-group-pill {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  box-sizing: border-box;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 800;
  padding: 0 14px;
}
.admin-choice-disabled {
  opacity: 0.48;
  background: #f8fafc;
}
.admin-choice-disabled input,
.admin-choice-disabled button {
  cursor: not-allowed;
}
.subsection-title {
  color: #111827;
  font-size: 16px;
  margin: 20px 0 10px;
}
.admin-directory-list {
  display: grid;
  gap: 10px;
}
.admin-directory-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid #e0e7ef;
  border-radius: 8px;
  background: #fbfcfe;
  padding: 12px 14px;
}
.delete-confirm-form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #e5e7eb;
}

.admin-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; min-height: 100vh; padding: 24px 32px; box-sizing: border-box; }
.admin-sidebar { align-self: start; position: sticky; top: 24px; }
.admin-content { min-width: 0; padding: 8px 0 40px; }
.admin-page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.admin-page-head h1 { margin-bottom: 0; }
.admin-preview-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.tree-card { background: #fff; border: 1px solid #d8dee8; border-radius: 8px; padding: 18px 10px 18px 12px; min-height: 260px; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); }
.tree-title { color: #111827; font-size: 16px; font-weight: 700; margin: 0 0 16px; }
.tree-list { display: grid; gap: 10px; }
.tree-group {
  border: 1px solid #e0e7ef;
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
}
.tree-group[open] { background: #fff; }
.tree-group.has-active { border-color: #fed7aa; }
.tree-group-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  box-sizing: border-box;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}
.tree-group-summary::-webkit-details-marker { display: none; }
.tree-group-summary::after {
  content: '›';
  flex: 0 0 auto;
  color: #9ca3af;
  font-size: 21px;
  line-height: 1;
  transition: transform 160ms ease;
}
.tree-group[open] .tree-group-summary::after { transform: rotate(90deg); }
.tree-group-title { color: #111827; font-size: 15px; font-weight: 800; line-height: 1.4; }
.tree-group-summary .tree-group-title { color: #111827; }
.tree-group-count {
  margin-left: auto;
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.tree-group-body {
  display: grid;
  gap: 8px;
  padding: 0 8px 12px;
}
.tree-subject { display: grid; gap: 4px; }
.tree-subject-link, .tree-category-link { color: #111827; display: flex; align-items: center; gap: 4px; min-height: 24px; border-radius: 6px; line-height: 1.4; }
.tree-subject-link { font-size: 14px; font-weight: 700; padding: 2px 4px 2px 0; }
.tree-subject-pending { color: #6b7280; min-width: 0; }
.tree-category-link { color: #374151; font-size: 14px; padding: 2px 6px 2px 18px; }
.tree-subject-link.active, .tree-category-link.active { background: #fff7ed; color: #ea580c; }
.tree-subject-link.has-children .tree-icon, .tree-category-link.has-children .tree-dot { color: #9ca3af; }
.tree-node-arrow {
  margin-left: auto;
  cursor: pointer;
  padding: 2px 6px;
  color: #9ca3af;
  font-size: 18px;
  line-height: 1;
  transition: transform 160ms ease;
}
.tree-subject-link.has-children[aria-expanded="true"] .tree-node-arrow,
.tree-category-link.has-children[aria-expanded="true"] .tree-node-arrow {
  transform: rotate(90deg);
}
.tree-icon { color: #4b5563; font-size: 13px; width: 14px; }
.tree-dot { color: #4b5563; font-size: 14px; width: 8px; }
.tree-children, .tree-branch { display: grid; gap: 2px; }
.tree-children[hidden], .tree-branch[hidden] { display: none; }
.tree-create-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px; }
.tree-create-form button { border-color: #fed7aa; color: #ea580c; background: #fff7ed; font-size: 12px; font-weight: 700; padding: 5px 8px; }
.tree-empty { color: #6b7280; font-size: 14px; padding: 8px 0; }
.tree-add-group {
  margin-top: 14px;
  border-top: 1px dashed #d8dee8;
  padding-top: 12px;
}
.tree-add-group summary {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  color: #ea580c;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  list-style: none;
}
.tree-add-group summary::-webkit-details-marker { display: none; }
.tree-add-group-form {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.tree-add-group-form input,
.tree-add-group-form button {
  width: 100%;
}
.tree-add-group-form button {
  border-color: #ea580c;
  background: #ea580c;
  color: #fff;
  font-weight: 800;
}
.tree-admin-rule-link {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  margin-top: 10px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 14px;
  font-weight: 800;
}
.tree-admin-rule-link.active { border-color: #2563eb; background: #dbeafe; color: #1e40af; }
.tree-word-rescue-button {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  box-sizing: border-box;
  margin: 10px auto 0;
  padding: 6px 11px;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  background: linear-gradient(135deg, #ecfdf5, #eff6ff);
  color: #047857;
  cursor: default;
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(16, 185, 129, 0.14);
}
.tree-word-rescue-icon {
  display: inline-flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #10b981;
  color: #fff;
  line-height: 1;
}
.tree-word-rescue-label {
  color: #065f46;
  font-size: 13px;
  font-weight: 900;
}
.admin-rule-page { border-color: #bfdbfe; }
.admin-rule-template-head {
  border-color: #bfdbfe;
  background: #f8fbff;
}
.admin-rule-demo-form {
  pointer-events: none;
}
.admin-rule-demo-form input,
.admin-rule-demo-form select,
.admin-rule-demo-form button {
  opacity: 1;
}
.admin-rule-preview {
  border-color: #dbeafe;
  margin-bottom: 22px;
}
.admin-rule-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}
.admin-rule-step {
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
  padding: 18px;
}
.admin-rule-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-weight: 800;
}
.admin-rule-step strong { display: block; color: #111827; font-size: 18px; margin-bottom: 8px; }
.admin-rule-step p,
.admin-rule-lock-grid p { color: #6b7280; line-height: 1.7; margin: 0; }
.admin-rule-arrow { display: grid; place-items: center; color: #2563eb; font-size: 26px; font-weight: 800; }
.admin-rule-lock-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.admin-rule-lock-grid > div {
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  padding: 18px;
}
.admin-rule-lock-grid strong { display: block; color: #9a3412; font-size: 17px; margin-bottom: 8px; }
.breadcrumb { color: #6b7280; font-size: 14px; line-height: 1.5; margin: 0 0 8px; }
.upload-panel { border-color: #fed7aa; }
.upload-form { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto; gap: 14px; align-items: end; margin: 18px 0 16px; }
.file-picker { display: grid; gap: 8px; border: 1px solid #d8dee8; border-radius: 8px; background: #f8fafc; padding: 14px; }
.file-picker-title { color: #111827; font-size: 15px; font-weight: 700; }
.file-picker-hint { color: #6b7280; font-size: 13px; }
.file-picker input { width: 100%; background: #fff; }
.import-batches { border-top: 1px dashed #d8dee8; margin-top: 18px; padding-top: 16px; }
.import-batch-list { display: grid; gap: 10px; margin-top: 10px; }
.import-batch-item {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(120px, 1fr) auto auto auto;
  gap: 12px;
  align-items: center;
  border: 1px solid #e0e7ef;
  border-radius: 8px;
  background: #fbfcfe;
  color: #475569;
  padding: 12px 14px;
}
.import-batch-item strong { color: #111827; }
.import-batch-delete-form { margin: 0; justify-self: end; }
.preview-panel { background: #fff; border: 1px solid #e0e7ef; border-radius: 8px; overflow: hidden; }
.preview-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 18px 22px; border-bottom: 1px solid #e5e7eb; }
.preview-toolbar h2 { margin-bottom: 4px; }
.preview-search { display: flex; align-items: center; gap: 8px; min-width: 220px; border: 1px solid #d8dee8; border-radius: 8px; background: #fff; color: #9ca3af; padding: 0 12px; }
.preview-search input { width: 100%; border: 0; padding: 10px 0; outline: 0; }
.table-scroll { overflow-x: auto; }
.preview-table { min-width: 1080px; }
.preview-table th { color: #111827; font-size: 14px; font-weight: 700; background: #fbfcfe; white-space: nowrap; }
.preview-table td { font-size: 14px; }
.number-cell { color: #2563eb; font-weight: 700; white-space: nowrap; }
.text-cell { min-width: 220px; max-width: 320px; }
.preview-body { color: #4b5563; margin-top: 8px; white-space: pre-wrap; }
.media-cell { width: 96px; }
.preview-thumb { display: block; width: 72px; height: 54px; object-fit: contain; border: 1px solid #dbe3ee; border-radius: 6px; background: #f8fafc; }
.option-cell { min-width: 180px; color: #374151; line-height: 1.7; }
.answer-pill { display: inline-flex; align-items: center; min-height: 28px; border-radius: 999px; background: #ecfdf5; color: #047857; font-weight: 700; padding: 4px 10px; white-space: nowrap; }
.empty-cell { color: #6b7280; padding: 34px 12px; text-align: center; }
.actions-cell { min-width: 148px; white-space: nowrap; }
.actions-cell .inline-form {
  display: inline-flex;
  margin: 0;
  vertical-align: middle;
}
.action-link,
.link-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  box-sizing: border-box;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}
.action-link {
  border: 1px solid #fed7aa;
  background: #fff7ed;
  color: #ea580c;
  margin-right: 8px;
}
.link-danger {
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: #dc2626;
}
.edit-form { display: grid; gap: 18px; max-width: 760px; }
.edit-form label { display: grid; gap: 8px; font-weight: 700; }
.edit-form input, .edit-form textarea { width: 100%; font-weight: 400; }
.password-form {
  display: grid;
  gap: 16px;
  max-width: 420px;
  margin-top: 18px;
}
.password-form label {
  display: grid;
  gap: 8px;
  color: #111827;
  font-weight: 700;
}
.password-form input {
  width: 100%;
  font-weight: 400;
}
.form-label { display: block; font-weight: 700; margin-bottom: 8px; }
.template-download { margin: 16px 0 18px; }
.template-download .hint { margin-bottom: 0; }
.edit-thumb { display: block; width: 180px; max-height: 130px; object-fit: contain; border: 1px solid #dbe3ee; border-radius: 8px; background: #f8fafc; }
.category-edit-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.category-edit-form input[type="text"],
.category-edit-form input:not([type]),
.category-edit-form select { min-width: 150px; }
.inline-category-form { margin: 0 0 10px; }
.check-label,
.file-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #374151;
  font-size: 14px;
  font-weight: 700;
}
.file-inline input { max-width: 180px; padding: 8px; }
.admin-category-sections { display: grid; gap: 22px; }
.admin-category-group h2 {
  color: #111827;
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 10px;
}

@media (max-width: 760px) {
  .admin-layout { grid-template-columns: 1fr; padding: 18px; }
  .admin-sidebar { position: static; }
  .admin-page-head { align-items: flex-start; flex-direction: column; }
  .admin-rule-flow,
  .admin-rule-lock-grid { grid-template-columns: 1fr; }
  .admin-rule-arrow { transform: rotate(90deg); }
  .upload-form { grid-template-columns: 1fr; }
  .import-batch-item { grid-template-columns: 1fr; }
  .preview-toolbar { align-items: stretch; flex-direction: column; }
  .preview-search { min-width: 0; }
}

.mobile-h5-page {
  background: linear-gradient(180deg, #edf3f8 0%, #f7fafc 100%);
  color: #101827;
}
.mobile-h5-page button,
.mobile-h5-page a { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.phone-shell {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  background: #f6f8fb;
  box-sizing: border-box;
}
.mini-home {
  background: #f6f8fb;
  padding: calc(14px + env(safe-area-inset-top)) 16px calc(22px + env(safe-area-inset-bottom));
}
.mini-list-page {
  padding: calc(16px + env(safe-area-inset-top)) 18px calc(22px + env(safe-area-inset-bottom));
}
.mini-hero {
  margin: 0 0 22px;
  padding: 13px 18px 15px;
  border-radius: 8px;
  background: linear-gradient(135deg, #eaf4ff 0%, #f0fbf5 100%);
  box-shadow: 0 10px 28px rgba(38, 79, 118, 0.08);
}
.mini-eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid rgba(40, 118, 207, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: #25658e;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  padding: 0 12px;
  box-shadow: none;
}
.mini-hero h1 {
  color: #0f172a;
  font-size: 31px;
  font-weight: 800;
  line-height: 1.18;
  margin: 15px 0 0;
}
.mini-hero .mini-brand-title {
  display: inline-block;
  background: linear-gradient(135deg, #ef4444 0%, #f59e0b 48%, #2563eb 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 38px;
  font-weight: 900;
  line-height: 1.08;
  text-shadow: 0 10px 24px rgba(239, 68, 68, 0.12);
}
.mini-section { margin-top: 0; }
.mini-section + .mini-section { margin-top: 22px; }
.adult-section,
.mini-catalog { display: grid; gap: 0; }
.mini-tab-input { position: absolute; opacity: 0; pointer-events: none; }
.mini-category-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 0;
  margin-bottom: -1px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(135deg, #4d46df, #5f8cff);
  padding: 8px 0 0;
  box-shadow: 0 10px 26px rgba(63, 86, 183, 0.12);
}
.mini-category-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 62px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-bottom-color: transparent;
  border-radius: 14px 14px 0 0;
  background: rgba(255, 255, 255, 0.42);
  color: #59627f;
  cursor: pointer;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.18;
  text-align: center;
  transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease, min-height 140ms ease;
}
.mini-tab-title-line {
  display: block;
  white-space: nowrap;
}
.mini-category-tab:active { background: rgba(255, 255, 255, 0.64); }
.mini-tab-panels {
  border: 1px solid #e2e8f0;
  border-radius: 0 0 8px 8px;
  background: #fff;
  padding: 14px 8px 12px;
  box-shadow: 0 14px 30px rgba(31, 65, 102, 0.075);
}
.mini-tab-panel { display: none; }
#mini-tab-social:checked ~ .mini-category-tabs label[for="mini-tab-social"],
#mini-tab-adult:checked ~ .mini-category-tabs label[for="mini-tab-adult"],
#mini-tab-college:checked ~ .mini-category-tabs label[for="mini-tab-college"] {
  min-height: 70px;
  border-color: #e2e8f0;
  border-bottom-color: #fff;
  background: #fff;
  color: #182230;
  box-shadow: 0 -8px 20px rgba(15, 23, 42, 0.06);
}
#mini-tab-social:checked ~ .mini-tab-panels .mini-tab-panel-social,
#mini-tab-adult:checked ~ .mini-tab-panels .mini-tab-panel-adult,
#mini-tab-college:checked ~ .mini-tab-panels .mini-tab-panel-college {
  display: block;
}
.mini-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 0 2px 10px;
}
.mini-tab-panel .mini-section-head { margin: 0 6px 8px; }
.mini-section-head h1,
.mini-section-head h2,
.mini-section-head h3 {
  color: #0f172a;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
  margin: 0;
}
.mini-section-head span {
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
  padding-bottom: 3px;
  white-space: nowrap;
}
.dev-template-section {
  border-top: 1px dashed #cbd5e1;
  padding-top: 18px;
}
.mistake-entry-link {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  min-height: 78px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: linear-gradient(135deg, #fff1f2 0%, #fff7ed 100%);
  color: #7f1d1d;
  padding: 14px 16px;
  text-decoration: none;
  box-shadow: 0 12px 24px rgba(127, 29, 29, 0.07);
}
.favorite-entry-link {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  min-height: 78px;
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: linear-gradient(135deg, #fffbeb 0%, #fefce8 100%);
  color: #713f12;
  padding: 14px 16px;
  text-decoration: none;
  box-shadow: 0 12px 24px rgba(113, 63, 18, 0.07);
}
.mistake-entry-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, #ef4444, #fb7185);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 10px 18px rgba(239, 68, 68, 0.24);
}
.favorite-entry-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, #f59e0b, #facc15);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 10px 18px rgba(245, 158, 11, 0.24);
}
.entry-icon-svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}
.mistake-entry-link strong,
.mistake-entry-link small,
.favorite-entry-link strong,
.favorite-entry-link small { display: block; }
.mistake-entry-link strong,
.favorite-entry-link strong { font-size: 17px; }
.mistake-entry-link small {
  color: #9f1239;
  font-size: 13px;
  margin-top: 5px;
}
.favorite-entry-link small {
  color: #92400e;
  font-size: 13px;
  margin-top: 5px;
}
.favorite-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
  border: 1px solid #fbbf24;
  border-radius: 999px;
  background: #fffbeb;
  color: #92400e;
  font-size: 13px;
  font-weight: 800;
  padding: 7px 13px;
  text-align: center;
}
.favorite-button.is-favorite {
  background: #f59e0b;
  color: #fff;
}
.dev-template-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  padding: 12px 16px;
  text-decoration: none;
}
.dev-template-link strong,
.dev-template-link small { display: block; }
.dev-template-link strong { font-size: 16px; }
.dev-template-link small {
  color: #64748b;
  font-size: 13px;
  margin-top: 5px;
}
.dev-template-arrow {
  color: #2563eb;
  font-size: 30px;
  line-height: 1;
}
.mini-list {
  display: grid;
  gap: 10px;
}
.mini-category-sections {
  display: grid;
  gap: 18px;
}
.mini-category-group {
  display: grid;
  gap: 10px;
}
.mini-category-group-title {
  display: flex;
  align-items: center;
  min-height: 32px;
  border-left: 4px solid #2563eb;
  border-radius: 6px;
  background: #eef6ff;
  color: #0f3f8f;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.3;
  padding: 7px 10px;
}
.mini-icon-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 6px;
  border: 1px solid rgba(226, 232, 240, 0.88);
  border-radius: 8px;
  background: #fff;
  padding: 12px 8px;
  box-shadow: 0 10px 28px rgba(31, 65, 102, 0.055);
}
.mini-tab-panel .mini-icon-grid {
  border: 0;
  background: transparent;
  padding: 4px 0 0;
  box-shadow: none;
}
.mini-icon-card {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  min-width: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #111827;
  min-height: 86px;
  padding: 9px 4px 8px;
  box-sizing: border-box;
  box-shadow: none;
  transition: transform 140ms ease, background 140ms ease;
}
.mini-icon-card:active {
  background: #f4f8fb;
  transform: scale(0.97);
}
.mini-icon-card.is-coming {
  cursor: default;
}
.mini-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  color: #1473d1;
  line-height: 1;
  background: #edf6ff;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.8);
}
.mini-icon-svg {
  display: block;
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mini-icon-label {
  max-width: 100%;
  overflow: hidden;
  color: #182230;
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tone-blue { background: #eaf4ff; color: #1473d1; }
.tone-green { background: #eaf8f1; color: #15956a; }
.tone-amber { background: #fff6df; color: #d27a00; }
.tone-red { background: #fff0f0; color: #df4b4b; }
.tone-indigo { background: #eef1ff; color: #5364d9; }
.mini-list-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  border: 1px solid rgba(207, 216, 227, 0.82);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: #111827;
  padding: 13px 14px;
  box-sizing: border-box;
  box-shadow: 0 8px 24px rgba(31, 65, 102, 0.06);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}
.mini-module-card {
  grid-template-columns: 44px minmax(0, 1fr) auto 24px;
}
.mini-list-card:active {
  border-color: #9fc3ef;
  box-shadow: 0 5px 16px rgba(31, 65, 102, 0.08);
  transform: scale(0.985);
}
.mini-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: linear-gradient(135deg, #e9f3ff, #edf9f3);
  color: #1167d8;
  font-size: 18px;
  font-weight: 800;
}
.mini-card-image-icon {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}
.mini-card-text {
  min-width: 0;
  color: #111827;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mini-card-count {
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.mini-card-arrow {
  color: #8aa1b5;
  font-size: 24px;
  line-height: 1;
  text-align: right;
}
.learn-phone {
  display: flex;
  flex-direction: column;
  padding: calc(12px + env(safe-area-inset-top)) 18px calc(18px + env(safe-area-inset-bottom));
}
.learn-topbar {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 48px;
  margin-bottom: 12px;
}
.learn-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid #d7e0ea;
  border-radius: 999px;
  background: #fff;
  color: #111827;
  font-size: 30px;
  line-height: 1;
  box-shadow: 0 8px 22px rgba(31, 65, 102, 0.08);
}
.learn-title-group { min-width: 0; }
.learn-breadcrumb-title {
  display: flex;
  align-items: baseline;
  min-width: 0;
  gap: 7px;
  line-height: 1.2;
}
.learn-breadcrumb-subject {
  flex: 0 1 auto;
  min-width: 0;
  color: #64748b;
  font-size: 20px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.learn-breadcrumb-arrow {
  flex: 0 0 auto;
  color: #94a3b8;
  font-size: 17px;
  font-weight: 900;
}
.learn-breadcrumb-category {
  flex: 0 1 auto;
  min-width: 0;
  color: #111827;
  font-size: 20px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.learn-subtitle { color: #64748b; font-size: 13px; line-height: 1.35; margin-bottom: 2px; }
.learn-page-title {
  color: #111827;
  font-size: 20px;
  line-height: 1.25;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mobile-loading { color: #64748b; padding: 42px 0; text-align: center; }
.network-required {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: calc(100svh - 110px);
  color: #334155;
  padding: 32px 24px;
  text-align: center;
}
.network-required strong {
  color: #0f172a;
  font-size: 22px;
}
.network-required p {
  max-width: 300px;
  line-height: 1.7;
  margin: 12px 0 24px;
}
.choice-list { display: grid; gap: 16px; margin-top: 26px; }
.choice-link, .primary, .option {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(207, 216, 227, 0.92);
  border-radius: 8px;
  padding: 17px 18px;
  background: #fff;
  color: #111827;
  text-align: left;
  line-height: 1.45;
  box-shadow: 0 8px 22px rgba(31, 65, 102, 0.05);
}
.choice-link { font-size: 18px; }
.primary {
  background: linear-gradient(135deg, #1167d8, #0c8fbd);
  color: #fff;
  border-color: #1167d8;
  text-align: center;
  font-weight: 700;
}
.primary-large {
  min-height: 56px;
  border-radius: 999px;
  font-size: 18px;
  box-shadow: 0 12px 28px rgba(17, 103, 216, 0.24);
  transform: scale(1);
  transition: transform 160ms ease, box-shadow 160ms ease;
  will-change: transform;
}
.primary-large:active,
.primary-large.is-pressing {
  box-shadow: 0 6px 16px rgba(17, 103, 216, 0.18);
  transform: scale(0.96);
}
.learn-card {
  display: flex;
  flex: 1;
  flex-direction: column;
  height: calc(100svh - 96px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  min-height: 0;
}
.lesson-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  margin: 8px 0 10px;
}
.lesson-meta {
  align-self: flex-start;
  border: 1px solid rgba(207, 216, 227, 0.82);
  border-radius: 999px;
  color: #375f7f;
  background: #fff;
  font-size: 14px;
  line-height: 1;
  padding: 8px 12px;
  margin: 8px 0 10px;
  box-shadow: 0 8px 22px rgba(31, 65, 102, 0.06);
}
.lesson-status-row .lesson-meta {
  margin: 0;
}
.lesson-status-row .favorite-button {
  flex: 0 0 auto;
}
.study-progress { font-weight: 700; }
.learn-progress-track {
  width: 100%;
  height: 7px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 999px;
  background: #e4edf6;
  margin: 0 0 18px;
}
.learn-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1167d8, #1aa982);
  transition: width 220ms ease;
}
.study-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: flex-start;
  gap: 22px;
  min-height: 0;
  max-height: calc(100svh - 250px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px 2px 156px 0;
  scroll-padding-bottom: 156px;
  -webkit-overflow-scrolling: touch;
}
.lesson-content {
  color: #0f172a;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.62;
  margin: 0;
  white-space: pre-wrap;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
}
.important-highlight {
  display: inline;
  padding: 0 3px;
  border-radius: 5px;
  background: rgba(230, 244, 255, 0.92);
  color: #1450b8;
  font-weight: 900;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.learn-card.without-image .study-body,
.learn-card.with-image .study-body { justify-content: flex-start; }
.image-panel {
  margin: 0;
  padding: 10px;
  border: 1px solid rgba(220, 230, 240, 0.95);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(31, 65, 102, 0.06);
}
.learn-image {
  display: block;
  width: 100%;
  max-height: 240px;
  height: auto;
  border-radius: 6px;
  object-fit: contain;
  cursor: zoom-in;
  background: #fff;
}
.preview-open { overflow: hidden; }
.image-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(20px + env(safe-area-inset-top)) 18px calc(20px + env(safe-area-inset-bottom));
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.82);
}
.image-preview-large {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 86svh;
  object-fit: contain;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}
.image-preview-close {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top));
  right: 16px;
  z-index: 301;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.68);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  padding: 0;
}
.lesson-actions {
  position: fixed;
  z-index: 100;
  top: 83.333svh;
  left: 50%;
  width: min(calc(100vw - 36px), 394px);
  transform: translate(-50%, -50%);
  margin-top: auto;
  padding: 14px 0 8px;
  background: linear-gradient(180deg, rgba(247, 250, 252, 0), rgba(247, 250, 252, 0.96) 30%);
}
.lesson-actions .primary-large {
  width: 100%;
}
.learn-card h1 {
  color: #0f172a;
  font-size: 23px;
  font-weight: 800;
  line-height: 1.5;
  margin: 0 0 22px;
}
.quiz-card {
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 2px 96px 0;
  scroll-padding-bottom: 96px;
  -webkit-overflow-scrolling: touch;
}
.quiz-card .image-panel { margin-bottom: 24px; }
.muted { color: #6b7280; font-size: 14px; }
.options-list { display: grid; gap: 12px; margin-top: 18px; }
.option {
  min-height: 60px;
  border-radius: 8px;
  font-size: 17px;
  font-weight: 700;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}
.option:active {
  border-color: #9fc3ef;
  transform: scale(0.985);
}
.option.correct { border-color: #16a34a; background: #dcfce7; }
.option.flash-correct { animation: correctFlash 260ms ease-in-out 1; }
@keyframes correctFlash {
  0%, 100% { background: #dcfce7; border-color: #16a34a; transform: scale(1); }
  50% { background: #bbf7d0; border-color: #15803d; transform: scale(1.025); }
}
.empty {
  color: #6b7280;
  padding: 54px 0;
  text-align: center;
  line-height: 1.6;
}
.mobile-empty {
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  background: #fff;
  margin-top: 30px;
}
.sound-audition { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 22px; padding-top: 18px; border-top: 1px solid #eef2f7; }
.sound-audition-label { color: #64748b; font-size: 13px; margin-right: 2px; }
.sound-audition button { min-height: 32px; border-color: #dbe3ee; border-radius: 999px; color: #334155; background: #f8fafc; font-size: 13px; padding: 6px 12px; }

@media (min-width: 520px) {
  .mobile-h5-page {
    padding: 22px 0;
  }
  .phone-shell {
    min-height: calc(100vh - 44px);
    min-height: calc(100svh - 44px);
    border: 1px solid #cfd8e3;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.16);
  }
}

@media (max-width: 360px) {
  .learn-phone { padding-left: 14px; padding-right: 14px; }
  .lesson-content { font-size: 23px; }
  .learn-card h1 { font-size: 22px; }
  .option { font-size: 16px; }
}
