:root {
  --ma-safe-top: env(safe-area-inset-top, 0px);
  --ma-safe-bottom: env(safe-area-inset-bottom, 0px);
  --ma-bg: #f4f7fb;
  --ma-text: #1a3a5c;
  --ma-muted: #5b6b80;
  --ma-line: #e3e9f1;
  --ma-blue-soft: #e7f0fa;
  --ma-green-soft: #e9f8ef;
  --ma-red-soft: #fff0f0;
  --ma-control-height: 44px;
  --ma-page-title-font-size: 18px;
  --ma-section-font-size: 16px;
  --ma-body-font-size: 14px;
  --ma-meta-font-size: 12px;
  --ma-button-font-size: 14px;
  --ma-input-font-size: 16px;
  --ma-title-line-height: 1.35;
  --ma-body-line-height: 1.65;
  --ma-card-radius: 14px;
}

html {
  min-height: 100%;
  background: var(--ma-bg);
  touch-action: pan-y;
}

body.ma-body {
  width: 100%;
  min-width: 0;
  min-height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background: var(--ma-bg);
  color: var(--ma-text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: var(--ma-body-font-size);
  line-height: var(--ma-body-line-height);
  touch-action: pan-y;
  -webkit-text-size-adjust: 100%;
}

button,
input,
select,
textarea,
a {
  -webkit-tap-highlight-color: transparent;
}

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

.ma-app {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(56px + var(--ma-safe-top)) 0 calc(56px + var(--ma-safe-bottom));
  box-sizing: border-box;
}

.ma-app.ma-compact-chrome {
  padding-top: var(--ma-safe-top);
}

.ma-app.ma-compact-chrome .ma-header {
  display: none;
}

.ma-app.ma-compact-chrome .ma-main {
  padding-top: calc(10px + var(--ma-safe-top));
}

.ma-header {
  position: fixed;
  z-index: 80;
  top: 0;
  left: 0;
  right: 0;
  min-height: calc(56px + var(--ma-safe-top));
  padding: var(--ma-safe-top) 14px 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #fff;
  background: var(--brand-900);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .08), 0 3px 12px rgba(16, 42, 67, .1);
}

.ma-brand {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.ma-brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 11px;
  display: block;
  object-fit: contain;
  background: transparent;
  box-shadow: 0 2px 8px rgba(16, 42, 67, .22);
}

.ma-brand-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.ma-brand-copy strong {
  overflow: hidden;
  font-size: var(--ma-body-font-size);
  line-height: 1.25;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ma-brand-copy small {
  overflow: hidden;
  margin-top: 2px;
  color: rgba(255, 255, 255, .72);
  font-size: var(--ma-meta-font-size);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ma-icon-btn {
  flex: 0 0 auto;
  min-width: 52px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, .26);
  border-radius: 12px;
  color: #fff;
  background: rgba(255, 255, 255, .1);
  font-size: var(--ma-body-font-size);
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.ma-main {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 16px 16px 24px;
  box-sizing: border-box;
}

.ma-nav {
  position: fixed;
  z-index: 80;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: calc(54px + var(--ma-safe-bottom));
  padding: 2px 8px var(--ma-safe-bottom);
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, .97);
  border-top: 1px solid var(--ma-line);
  box-shadow: 0 -2px 12px rgba(16, 42, 67, .06);
  backdrop-filter: blur(10px);
}

.ma-nav-item {
  position: relative;
  width: auto;
  max-width: 180px;
  flex: 1 1 0;
  min-height: 50px;
  border-radius: 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  color: #6a7b8f;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}

.ma-nav-item > span:nth-child(2) {
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ma-nav-item.active {
  color: var(--brand-900);
  background: transparent;
}

.ma-nav-item.active::before {
  position: absolute;
  top: 2px;
  left: 50%;
  width: 20px;
  height: 3px;
  border-radius: 999px;
  content: "";
  background: var(--brand-700);
  transform: translateX(-50%);
}

.ma-nav-icon {
  font-size: 20px;
  line-height: 1;
}

.ma-nav-badge {
  position: absolute;
  top: 1px;
  left: calc(50% + 9px);
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #dc2626;
  font-size: 12px;
  line-height: 1;
}

.ma-app.ma-reading {
  padding: 0 0 calc(64px + var(--ma-safe-bottom));
}

.ma-app.ma-reading .ma-header,
.ma-app.ma-reading .ma-nav {
  display: none !important;
}

.ma-app.ma-reading .ma-main {
  padding-top: 0;
}

.ma-stack {
  display: grid;
  gap: 12px;
}

.ma-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--ma-line);
  border-radius: var(--ma-card-radius);
  background: #fff;
  box-shadow: none;
}

.ma-card.compact {
  padding: 14px;
}

.ma-hero {
  color: #fff;
  border: 0;
  background:
    radial-gradient(circle at 88% 16%, rgba(255, 255, 255, .2), transparent 30%),
    linear-gradient(130deg, var(--brand-800), var(--brand-600));
  box-shadow: 0 10px 24px rgba(16, 42, 67, .18);
}

.ma-hero-compact {
  padding: 12px 14px;
  box-shadow: 0 8px 22px rgba(16, 42, 67, .18);
}

.ma-hero-line {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.ma-hero-line > div {
  min-width: 0;
}

.ma-hero-line small {
  display: block;
  color: rgba(255, 255, 255, .7);
  font-size: 13px;
  line-height: 1.3;
}

.ma-hero-line h1 {
  margin: 2px 0 0;
  overflow: hidden;
  font-size: var(--ma-page-title-font-size);
  line-height: var(--ma-title-line-height);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ma-online {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.4;
  background: rgba(255, 255, 255, .14);
}

.ma-hero-summary {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 12px;
  color: rgba(255, 255, 255, .76);
  font-size: 13px;
  line-height: 1.5;
}

.ma-hero-summary b {
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.ma-eyebrow {
  margin: 0 0 6px;
  color: var(--brand-600);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
}

.ma-hero .ma-eyebrow {
  color: rgba(255, 255, 255, .72);
}

.ma-hero h1 {
  margin: 0;
  font-size: var(--ma-page-title-font-size);
  line-height: var(--ma-title-line-height);
}

.ma-hero p {
  margin: 7px 0 0;
  color: rgba(255, 255, 255, .76);
  font-size: var(--ma-body-font-size);
  line-height: var(--ma-body-line-height);
}

.ma-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 13px;
}

.ma-chip {
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--brand-700);
  background: var(--ma-blue-soft);
  font-size: 12px;
  font-weight: 700;
}

.ma-hero .ma-chip {
  color: #fff;
  background: rgba(255, 255, 255, .14);
}

.ma-chip.warn {
  color: #8a5a05;
  background: #fff5dd;
}

.ma-chip.danger {
  color: #a42525;
  background: var(--ma-red-soft);
}

.ma-chip.good {
  color: #087443;
  background: var(--ma-green-soft);
}

.ma-section-head {
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ma-section-head > * {
  min-width: 0;
}

.ma-section-head h2 {
  margin: 0;
  color: var(--ma-text);
  font-size: var(--ma-section-font-size);
  line-height: var(--ma-title-line-height);
}

.ma-link {
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  display: inline-flex;
  align-items: center;
  color: var(--brand-600);
  background: transparent;
  font-size: var(--ma-body-font-size);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.ma-todo {
  min-width: 0;
  width: 100%;
  min-height: 68px;
  padding: 13px 14px;
  border: 1px solid var(--ma-line);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: inherit;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.ma-todo:hover,
.ma-todo:active {
  border-color: #b8cde2;
  background: #f9fcff;
}

.ma-todo-copy strong {
  display: block;
  margin-bottom: 4px;
  font-size: var(--ma-body-font-size);
}

.ma-todo-copy small {
  color: var(--ma-muted);
  font-size: var(--ma-meta-font-size);
  line-height: var(--ma-body-line-height);
}

.ma-todo-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.ma-todo-count {
  min-width: 0;
  max-width: 38%;
  flex: 0 0 auto;
  color: var(--brand-600);
  font-size: clamp(20px, 7.4vw, 28px);
  font-weight: 900;
  line-height: 1.1;
  text-align: right;
  overflow-wrap: anywhere;
}

.ma-future-note {
  color: var(--ma-muted);
  font-size: var(--ma-meta-font-size);
  line-height: 1.7;
}

.ma-home-todos {
  display: grid;
  gap: 0;
}

.ma-home-todos .ma-todo {
  min-width: 0;
  width: 100%;
  min-height: 60px;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--ma-line);
  border-radius: 0;
  background: transparent;
}

.ma-home-todos .ma-todo:last-child {
  border-bottom: 0;
}

.ma-home-todos .ma-todo:active {
  background: transparent;
}

.ma-home-todos .ma-todo-copy strong {
  font-weight: 650;
}

.ma-home-todos .ma-todo-count {
  min-width: 44px;
  color: var(--brand-700);
  font-size: 24px;
  font-weight: 750;
}

.ma-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 9px;
}

.ma-field {
  display: grid;
  gap: 5px;
}

.ma-field label,
.ma-label {
  color: var(--ma-muted);
  font-size: var(--ma-meta-font-size);
  font-weight: 700;
}

.ma-input,
.ma-select,
.ma-textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 11px;
  box-sizing: border-box;
  border: 1px solid #cfdbe7;
  border-radius: 11px;
  color: var(--ma-text);
  background: #fff;
  font-size: var(--ma-input-font-size);
  outline: none;
}

.ma-textarea {
  min-height: 104px;
  resize: vertical;
  line-height: 1.65;
}

.ma-input:focus,
.ma-select:focus,
.ma-textarea:focus {
  border-color: var(--brand-600);
  box-shadow: 0 0 0 3px rgba(43, 108, 176, .12);
}

.ma-btn {
  min-height: var(--ma-control-height);
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: var(--ma-button-font-size);
  font-weight: 800;
  cursor: pointer;
}

.ma-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.ma-btn.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--brand-800), var(--brand-600));
}

.ma-btn.success {
  color: #fff;
  background: linear-gradient(135deg, var(--brand-800), var(--brand-600));
}

.ma-btn.danger-outline {
  color: #b42323;
  border-color: #efb7b7;
  background: #fff;
}

.ma-btn.ghost {
  color: var(--brand-600);
  border-color: var(--ma-line);
  background: #fff;
}

.ma-btn.block {
  width: 100%;
}

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

.ma-clinic-card {
  width: 100%;
  padding: 15px;
  border: 1px solid var(--ma-line);
  border-radius: 15px;
  display: block;
  color: inherit;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.ma-clinic-card:hover,
.ma-clinic-card:active {
  border-color: #b8cde2;
  box-shadow: none;
}

.ma-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.ma-card-top h3 {
  margin: 0;
  font-size: var(--ma-section-font-size);
  line-height: var(--ma-title-line-height);
}

.ma-card-sub {
  margin: 5px 0 0;
  color: var(--ma-muted);
  font-size: 13px;
  line-height: 1.6;
}

.ma-card-grid {
  margin-top: 11px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ma-card-grid span {
  min-width: 0;
  color: #40566d;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.ma-card-grid b {
  color: var(--ma-text);
}

.ma-progress {
  height: 6px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 3px;
  background: #edf2f7;
}

.ma-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-600), #62a6df);
}

.ma-risk-row {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.ma-loading,
.ma-empty,
.ma-error {
  min-height: 210px;
  padding: 26px 18px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  text-align: center;
}

.ma-loading::before {
  width: 30px;
  height: 30px;
  content: "";
  border: 3px solid #d7e2ed;
  border-top-color: var(--brand-600);
  border-radius: 50%;
  animation: ma-spin .8s linear infinite;
}

.ma-empty-icon {
  font-size: 34px;
}

.ma-empty strong,
.ma-error strong {
  font-size: 16px;
}

.ma-empty p,
.ma-error p {
  max-width: 330px;
  margin: 0;
  color: var(--ma-muted);
  font-size: 13px;
  line-height: 1.7;
}

.ma-detail-title {
  margin: 0;
  font-size: var(--ma-page-title-font-size);
  line-height: var(--ma-title-line-height);
}

.ma-detail-sub {
  margin: 7px 0 0;
  color: var(--ma-muted);
  font-size: 13px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

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

.ma-info-item {
  min-width: 0;
  padding: 10px 11px;
  border-radius: 11px;
  background: #f7fafc;
}

.ma-info-item.full {
  grid-column: 1 / -1;
}

.ma-info-item dt {
  margin: 0 0 4px;
  color: var(--ma-muted);
  font-size: var(--ma-meta-font-size);
}

.ma-info-item dd {
  margin: 0;
  color: var(--ma-text);
  font-size: var(--ma-body-font-size);
  font-weight: 700;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.ma-contact {
  padding: 10px 0;
  border-bottom: 1px solid #edf2f7;
}

.ma-contact:last-child {
  border-bottom: 0;
}

.ma-contact strong {
  display: block;
  font-size: var(--ma-body-font-size);
}

.ma-contact small {
  display: block;
  margin-top: 3px;
  color: var(--ma-muted);
  font-size: var(--ma-meta-font-size);
  line-height: var(--ma-body-line-height);
  overflow-wrap: anywhere;
}

.ma-timeline {
  position: relative;
  display: grid;
  gap: 14px;
}

.ma-timeline-item {
  position: relative;
  padding-left: 22px;
}

.ma-timeline-item::before {
  position: absolute;
  left: 0;
  top: 4px;
  width: 9px;
  height: 9px;
  content: "";
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--brand-600);
  box-shadow: 0 0 0 2px #bdd3e7;
}

.ma-timeline-item strong {
  display: block;
  font-size: var(--ma-body-font-size);
}

.ma-timeline-item small {
  display: block;
  margin-top: 3px;
  color: var(--ma-muted);
  font-size: 12px;
}

.ma-action-bar {
  position: static;
  margin: 16px -2px 0;
  padding: 10px;
  border: 1px solid var(--ma-line);
  border-radius: 16px;
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 9px;
  background: #fff;
  box-shadow: none;
}

.ma-detail-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.ma-back {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--ma-line);
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--brand-600);
  background: #fff;
  font-size: 20px;
  text-decoration: none;
}

.ma-pager {
  margin-top: 14px;
}

.ma-pager .pager-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
}

.ma-pager .page-btn {
  min-width: 0;
  min-height: 44px;
  padding: 0 8px;
  border: 1px solid var(--ma-line);
  border-radius: 11px;
  color: var(--brand-700);
  background: #fff;
  font-size: var(--ma-body-font-size);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ma-pager .page-btn:disabled {
  color: #9aa8b6;
  background: #f3f6f9;
}

.ma-pager .pager-prev {
  grid-column: 1;
  justify-self: start;
}

.ma-pager .pager-info {
  grid-column: 2;
  max-width: min(42vw, 150px);
  overflow: hidden;
  color: var(--ma-muted);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ma-pager .pager-next {
  grid-column: 3;
  justify-self: end;
}

.ma-pager .pager-first,
.ma-pager .pager-last,
.ma-pager .pager-jump {
  display: none;
}

.ma-learning-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.ma-learning-stat {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--ma-line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.ma-learning-stat small {
  display: block;
  color: var(--ma-muted);
  font-size: 12px;
  line-height: 1.5;
  white-space: normal;
}

.ma-learning-stat strong {
  display: block;
  margin-top: 5px;
  color: var(--brand-700);
  font-size: clamp(17px, 5.3vw, 22px);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.ma-learning-stat.is-pending strong {
  color: #a35b00;
}

.ma-learning-stat.is-approved strong {
  color: #087443;
}

.ma-learning-stat.is-published strong {
  color: var(--brand-600);
}

.ma-learning-status-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--ma-line);
  border-radius: 12px;
  background: #edf3f8;
}

.ma-learning-status-tabs button {
  min-width: 0;
  min-height: 48px;
  padding: 4px 2px;
  border: 0;
  border-radius: 9px;
  color: var(--ma-muted);
  background: transparent;
  font-size: clamp(12px, 3.7vw, 13px);
  font-weight: 700;
  cursor: pointer;
  line-height: 1.25;
  overflow-wrap: anywhere;
  white-space: normal;
}

.ma-learning-status-tabs button.active {
  color: #fff;
  background: var(--brand-600);
  box-shadow: 0 2px 8px rgba(43, 108, 176, .18);
}

.ma-learning-filter-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.ma-filter-more {
  margin-top: 10px;
  border-top: 1px solid #edf2f7;
}

.ma-filter-more > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--brand-700);
  font-size: var(--ma-body-font-size);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.ma-filter-more > summary::-webkit-details-marker {
  display: none;
}

.ma-filter-more > summary::after {
  content: "展开";
  color: var(--ma-muted);
  font-size: 12px;
  font-weight: 600;
}

.ma-filter-more[open] > summary::after {
  content: "收起";
}

.ma-card.compact.ma-learning-alert {
  padding: 0;
  overflow: hidden;
}

.ma-learning-alert-toggle {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--brand-700);
  background: #fff;
  font-size: var(--ma-body-font-size);
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.ma-learning-alert-toggle b {
  margin-left: auto;
  color: #a35b00;
  font-size: 12px;
  font-weight: 700;
}

.ma-learning-alert-toggle em {
  color: var(--ma-muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 600;
}

.ma-learning-alert-body {
  padding: 0 12px 12px;
}

.ma-learning-book-picker {
  width: 100%;
  min-height: 58px;
  margin-top: 10px;
  padding: 9px 11px;
  border: 1px solid #d7e3f1;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ma-text);
  background: #f7fafc;
  text-align: left;
  cursor: pointer;
}

.ma-learning-book-picker > span:first-child {
  min-width: 0;
  flex: 1;
}

.ma-learning-book-picker small,
.ma-learning-book-picker strong {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ma-learning-book-picker small {
  color: var(--ma-muted);
  font-size: 12px;
}

.ma-learning-book-picker strong {
  margin-top: 2px;
  font-size: var(--ma-body-font-size);
  line-height: var(--ma-body-line-height);
}

.ma-learning-book-picker-action {
  flex: 0 0 auto;
  color: var(--brand-600);
  font-size: 13px;
  font-weight: 700;
}

.ma-learning-view-head {
  min-width: 0;
  margin-bottom: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.ma-learning-view-head > div {
  min-width: 0;
}

.ma-learning-view-head h2 {
  margin: 0;
  color: var(--ma-text);
  font-size: var(--ma-section-font-size);
  line-height: var(--ma-title-line-height);
}

.ma-learning-view-head .ma-future-note {
  display: block;
  margin-top: 1px;
}

.ma-learning-view-head .ma-link {
  flex: 0 0 auto;
}

.ma-learning-filter-grid .ma-btn {
  align-self: end;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ma-learning-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--ma-line);
  border-radius: 15px;
  background: #fff;
  box-shadow: none;
}

.ma-learning-book-group {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.ma-learning-book-head {
  min-width: 0;
  padding: 8px 10px 7px;
  border-left: 4px solid #c8a96a;
  border-radius: 0 10px 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #f7fafc;
}

.ma-learning-book-head > div {
  min-width: 0;
}

.ma-learning-book-head small,
.ma-learning-book-head strong,
.ma-learning-book-head span {
  display: block;
}

.ma-learning-book-head small {
  color: #8a6a2f;
  font-size: 12px;
  font-weight: 700;
}

.ma-learning-book-head strong {
  margin-top: 1px;
  color: var(--ma-text);
  font-size: var(--ma-body-font-size);
  line-height: var(--ma-body-line-height);
  overflow-wrap: anywhere;
}

.ma-learning-book-head span {
  margin-top: 2px;
  color: var(--ma-muted);
  font-size: 12px;
}

.ma-learning-book-head b {
  flex: 0 0 auto;
  color: var(--ma-muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.ma-learning-book-list {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.ma-learning-card-head {
  min-height: 44px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid #edf2f7;
}

.ma-learning-check {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ma-muted);
  font-size: 12px;
  font-weight: 700;
}

.ma-learning-check input {
  width: 20px;
  height: 20px;
}

.ma-learning-open {
  width: 100%;
  min-height: 110px;
  padding: 12px;
  border: 0;
  display: block;
  color: inherit;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.ma-learning-open:active {
  background: #f8fbfe;
}

.ma-learning-type {
  display: inline-block;
  margin-bottom: 5px;
  color: var(--brand-600);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
}

.ma-learning-open > strong {
  display: block;
  font-size: var(--ma-body-font-size);
  line-height: var(--ma-title-line-height);
  overflow-wrap: anywhere;
}

.ma-learning-open > p {
  margin: 6px 0;
  display: -webkit-box;
  overflow: hidden;
  color: #40566d;
  font-size: var(--ma-body-font-size);
  line-height: var(--ma-body-line-height);
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.ma-learning-batch {
  position: static;
  padding: 9px;
  border: 1px solid var(--ma-line);
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #f8fbff;
  box-shadow: none;
}

.ma-learning-batch > strong {
  min-width: 70px;
  font-size: 12px;
}

.ma-learning-batch > div {
  min-width: 0;
  display: flex;
  gap: 6px;
}

.ma-learning-batch .ma-btn {
  min-height: 44px;
  padding: 0 11px;
  font-size: 12px;
}

.ma-source-picker {
  max-height: 52vh;
  display: grid;
  gap: 7px;
  overflow-y: auto;
}

.ma-source-option {
  min-height: 58px;
  padding: 9px 11px;
  border: 1px solid var(--ma-line);
  border-radius: 11px;
  color: inherit;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.ma-source-option strong {
  display: block;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.ma-source-option small {
  display: block;
  margin-top: 3px;
  color: var(--ma-muted);
  font-size: 12px;
}

.ma-learning-body {
  margin-top: 13px;
  color: #263b51;
  font-size: var(--ma-body-font-size);
  line-height: var(--ma-body-line-height);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ma-learning-hint,
.ma-learning-evidence {
  margin-top: 12px;
  padding: 11px 12px;
  border-radius: 11px;
  color: #68501c;
  background: #fff8e8;
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ma-learning-evidence {
  margin-top: 10px;
  color: #40566d;
  background: #f7fafc;
}

.ma-learning-matches {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.ma-learning-matches h3 {
  margin: 0;
  font-size: var(--ma-body-font-size);
}

.ma-learning-matches > div {
  padding: 9px 10px;
  border-radius: 10px;
  background: #fff7ef;
}

.ma-learning-matches strong,
.ma-learning-matches small {
  display: block;
  overflow-wrap: anywhere;
}

.ma-learning-matches strong {
  font-size: 13px;
}

.ma-learning-matches small {
  margin-top: 3px;
  color: var(--ma-muted);
  font-size: 12px;
}

.ma-learning-original summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  color: var(--brand-600);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.ma-learning-original > div {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #edf2f7;
  color: var(--ma-muted);
  font-size: 12px;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ma-learning-actions {
  position: static;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--ma-line);
  border-radius: var(--ma-card-radius);
  display: grid;
  gap: 10px;
  background: #fff;
  box-shadow: none;
}

.ma-learning-actions .ma-btn {
  min-width: 0;
  min-height: var(--ma-control-height);
  padding: 0 12px;
  font-size: var(--ma-button-font-size);
}

.ma-learning-actions-secondary,
.ma-learning-actions-primary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ma-learning-actions-primary {
  grid-template-columns: 1fr;
}

.ma-learning-actions-primary .ma-btn.is-wide {
  grid-column: 1 / -1;
}

.ma-learning-reading-nav {
  position: fixed;
  z-index: 82;
  right: 0;
  bottom: 0;
  left: 0;
  min-height: calc(68px + var(--ma-safe-bottom));
  padding: 7px 8px calc(7px + var(--ma-safe-bottom));
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, .98);
  border-top: 1px solid var(--ma-line);
  box-shadow: 0 -8px 24px rgba(16, 42, 67, .08);
  backdrop-filter: blur(12px);
}

.ma-learning-reading-nav button {
  min-width: 0;
  min-height: 54px;
  padding: 4px 8px;
  border: 1px solid #d7e3f1;
  border-radius: 11px;
  color: var(--brand-800);
  background: #eef4fb;
  display: grid;
  align-content: center;
  gap: 1px;
  text-align: left;
}

.ma-learning-reading-nav button:disabled {
  color: #aab5c3;
  background: #f3f5f8;
  border-color: #e5eaf0;
}

.ma-learning-reading-position {
  min-width: 62px;
  padding: 0 5px;
  color: var(--brand-700);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.ma-learning-reading-kicker,
.ma-learning-reading-title {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ma-learning-reading-kicker {
  color: var(--ma-muted);
  font-size: 12px;
  font-weight: 600;
}

.ma-learning-reading-title {
  font-size: 12px;
  font-weight: 700;
}

.ma-learning-reading-nav button:disabled .ma-learning-reading-kicker,
.ma-learning-reading-nav button:disabled .ma-learning-reading-title {
  color: #aab5c3;
}

.ma-reader-top {
  min-width: 0;
  padding: 10px 0 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ma-reader-top .ma-back {
  flex: 0 0 44px;
}

.ma-reader-heading {
  min-width: 0;
  flex: 1;
}

.ma-reader-heading small,
.ma-reader-heading strong {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ma-reader-heading small {
  color: var(--ma-muted);
  font-size: 12px;
}

.ma-reader-heading strong {
  margin-top: 1px;
  color: var(--ma-text);
  font-size: var(--ma-body-font-size);
  line-height: var(--ma-title-line-height);
}

.ma-learning-reader {
  min-width: 0;
  padding: 16px 15px;
  border: 1px solid var(--ma-line);
  border-radius: var(--ma-card-radius);
  background: #fff;
  box-shadow: none;
}

.ma-learning-reader-title {
  margin: 8px 0 0;
  color: var(--ma-text);
  font-size: var(--ma-page-title-font-size);
  line-height: var(--ma-title-line-height);
  overflow-wrap: anywhere;
}

.ma-learning-reader-meta {
  margin: 10px 0 0;
  color: var(--ma-muted);
  font-size: var(--ma-meta-font-size);
  line-height: var(--ma-body-line-height);
  overflow-wrap: anywhere;
}

.ma-learning-reader .ma-learning-body {
  margin-top: 18px;
  font-size: var(--ma-body-font-size);
  line-height: var(--ma-body-line-height);
}

/* 内容发布：先看队列和状态，正文优先，操作放在正文之后。 */
.ma-publish-launch {
  display: grid;
  gap: 12px;
}

.ma-publish-launch-group > p {
  margin: 0 0 7px;
  color: var(--ma-muted);
  font-size: 13px;
  font-weight: 800;
}

.ma-publish-launch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ma-publish-launch-grid button {
  min-width: 0;
  min-height: 64px;
  padding: 10px 11px;
  border: 1px solid var(--ma-line);
  border-radius: 12px;
  color: var(--ma-text);
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.ma-publish-launch-grid button:disabled {
  color: #8a99aa;
  background: #f4f7fa;
  cursor: not-allowed;
}

.ma-template-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.ma-template-picker .ma-btn {
  min-height: 44px;
}

.ma-publish-launch-grid strong,
.ma-publish-launch-grid small {
  display: block;
  overflow-wrap: anywhere;
}

.ma-publish-launch-grid strong {
  font-size: var(--ma-body-font-size);
}

.ma-publish-launch-grid small {
  margin-top: 3px;
  color: var(--ma-muted);
  font-size: 12px;
  line-height: 1.45;
}

.ma-publish-tabs {
  padding: 4px;
  border: 1px solid var(--ma-line);
  border-radius: 13px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  background: #eaf1f7;
}

.ma-publish-tabs button {
  min-width: 0;
  min-height: 44px;
  padding: 8px 6px;
  border: 0;
  border-radius: 10px;
  color: var(--ma-muted);
  background: transparent;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
  white-space: normal;
  cursor: pointer;
}

.ma-publish-library {
  padding: 12px;
}

.ma-publish-library .ma-publish-overview {
  margin-top: 10px;
}

.ma-publish-section-head,
.ma-publish-list-head {
  margin: 0 2px 9px;
}

.ma-publish-section-head h2,
.ma-publish-list-head h2 {
  font-size: var(--ma-section-font-size);
  font-weight: 800;
}

.ma-publish-section-head .ma-future-note,
.ma-publish-list-head .ma-future-note {
  font-size: 12px;
  text-align: right;
}

.ma-publish-list-head {
  margin-top: 4px;
}

.ma-compose-card {
  display: grid;
  gap: 11px;
}

.ma-compose-body {
  min-height: 180px;
  line-height: 1.7;
}

.ma-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 11px;
}

.ma-social-copy {
  padding: 12px;
  border: 1px solid var(--ma-line);
  border-radius: var(--ma-card-radius);
  background: #fff;
}

.ma-social-copy .ma-textarea {
  min-height: 108px;
}

.ma-social-copy-actions,
.ma-compose-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ma-social-copy-actions .ma-btn,
.ma-compose-actions .ma-btn {
  min-width: 0;
}

.ma-compose-preview h2 {
  margin: 0;
  font-size: var(--ma-page-title-font-size);
  line-height: var(--ma-title-line-height);
}

.ma-preview-body {
  margin-top: 14px;
  color: var(--ma-text);
  font-size: var(--ma-body-font-size);
  line-height: var(--ma-body-line-height);
  overflow-wrap: anywhere;
}

.ma-share-actions .ma-btn + .ma-btn {
  margin-top: 8px;
}

.ma-publish-tabs button.active {
  color: var(--brand-700);
  background: #fff;
  box-shadow: 0 2px 9px rgba(16, 42, 67, .1);
}

.ma-publish-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 8px;
}

.ma-publish-overview > div {
  min-width: 0;
  min-height: 68px;
  padding: 10px 11px;
  border: 1px solid var(--ma-line);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #fff;
}

.ma-publish-overview small,
.ma-publish-overview strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ma-publish-overview small {
  color: var(--ma-muted);
  font-size: 12px;
  line-height: 1.35;
}

.ma-publish-overview strong {
  margin-top: 2px;
  color: var(--brand-700);
  font-size: 20px;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

.ma-publish-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--ma-line);
  border-radius: var(--ma-card-radius);
  background: #fff;
  box-shadow: none;
}

.ma-publish-open {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 13px;
  border: 0;
  display: block;
  color: var(--ma-text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.ma-publish-open:focus-visible,
.ma-publish-tabs button:focus-visible,
.ma-publish-status-tabs button:focus-visible {
  outline: 3px solid rgba(43, 108, 176, .28);
  outline-offset: 2px;
}

.ma-publish-cover {
  display: block;
  width: calc(100% + 26px);
  margin: -13px -13px 12px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #dce8f2;
}

.ma-publish-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ma-publish-card-head {
  min-width: 0;
  margin-bottom: 7px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ma-publish-open > strong {
  display: block;
  min-width: 0;
  color: var(--ma-text);
  font-size: var(--ma-section-font-size);
  line-height: var(--ma-title-line-height);
  overflow-wrap: anywhere;
}

.ma-publish-card-summary {
  margin: 5px 0 0;
  display: -webkit-box;
  overflow: hidden;
  color: var(--ma-muted);
  font-size: 13px;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ma-publish-card-time {
  display: block;
  margin-top: 7px;
  color: #8797aa;
  font-size: 12px;
  line-height: 1.45;
}

.ma-video-upload {
  border-color: #c5dcec;
  background:
    radial-gradient(circle at 100% 0%, rgba(43, 108, 176, .1), transparent 42%),
    #fff;
}

.ma-video-source-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 10px;
}

.ma-video-source-grid .ma-btn {
  width: 100%;
}

.ma-poster-course-card {
  width: 100%;
  min-height: 82px;
  padding: 10px;
  border: 1px solid var(--ma-line);
  border-radius: var(--ma-card-radius);
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 12px;
  color: var(--ma-text);
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.ma-poster-course-card > img,
.ma-poster-course-cover {
  width: 58px;
  height: 58px;
  border-radius: 10px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--brand-800), var(--brand-600));
}

.ma-poster-course-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.ma-poster-course-copy strong {
  min-width: 0;
  overflow: hidden;
  font-size: var(--ma-body-font-size);
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ma-poster-course-copy small {
  overflow: hidden;
  color: var(--ma-muted);
  font-size: 13px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ma-poster-course-arrow {
  color: var(--brand-600);
  font-size: 22px;
  text-align: center;
}

.ma-poster-preview-card {
  padding: 12px;
}

.ma-poster-preview {
  width: 100%;
  max-width: 420px;
  max-height: 560px;
  margin: 0 auto;
  border-radius: 14px;
  display: block;
  object-fit: contain;
  background: var(--ma-bg);
}

.ma-poster-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.ma-poster-save img {
  width: 100%;
  max-height: 68vh;
  display: block;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 10px;
}

.ma-poster-save p {
  margin: 10px 0 0;
  color: var(--ma-muted);
  font-size: 13px;
  text-align: center;
}

.ma-video-upload .ma-section-head {
  align-items: flex-start;
}

.ma-video-upload .ma-section-head h2 {
  font-size: var(--ma-section-font-size);
}

.ma-video-upload .ma-future-note {
  text-align: right;
}

.ma-upload-note {
  margin-top: 9px;
  color: var(--ma-muted);
  font-size: 12px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.ma-button-row {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ma-button-row .ma-btn {
  min-width: 0;
  padding-left: 8px;
  padding-right: 8px;
}

.ma-upload-progress {
  margin-top: 11px;
  padding: 11px 12px;
  border-radius: 11px;
  background: #f3f8fc;
}

.ma-upload-progress > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ma-muted);
  font-size: 12px;
}

.ma-upload-progress b {
  flex: 0 0 auto;
  color: var(--brand-700);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.ma-upload-progress progress {
  width: 100%;
  height: 9px;
  margin-top: 8px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #d9e6f1;
  accent-color: var(--brand-600);
}

.ma-upload-progress progress::-webkit-progress-bar {
  border-radius: 999px;
  background: #d9e6f1;
}

.ma-upload-progress progress::-webkit-progress-value {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-600), #3f8ac4);
}

.ma-upload-progress progress::-moz-progress-bar {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-600), #3f8ac4);
}

.ma-publish-status-tabs {
  margin-top: 11px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.ma-publish-status-tabs.is-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ma-publish-status-tabs button {
  min-width: 0;
  min-height: 48px;
  padding: 6px 3px;
  border: 1px solid var(--ma-line);
  border-radius: 10px;
  color: var(--ma-muted);
  background: #f8fbfd;
  font-size: clamp(12px, 3.7vw, 13px);
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
  white-space: normal;
  cursor: pointer;
}

.ma-publish-status-tabs button.active {
  border-color: var(--brand-600);
  color: #fff;
  background: var(--brand-600);
}

.ma-publish-detail {
  padding: 0;
  overflow: hidden;
}

.ma-publish-detail-cover {
  width: 100%;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #dce8f2;
}

.ma-publish-detail-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ma-publish-detail > .ma-risk-row {
  padding: 13px 16px 0;
}

.ma-publish-summary {
  margin: 11px 16px 0;
  color: var(--ma-muted);
  font-size: var(--ma-body-font-size);
  line-height: var(--ma-body-line-height);
  overflow-wrap: anywhere;
}

.ma-publish-body {
  padding: 15px 16px 20px;
  color: #243b53;
  font-size: var(--ma-body-font-size);
  line-height: var(--ma-body-line-height);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ma-publish-body > :first-child {
  margin-top: 0;
}

.ma-publish-body > :last-child {
  margin-bottom: 0;
}

.ma-publish-body h1,
.ma-publish-body h2,
.ma-publish-body h3,
.ma-publish-body h4,
.ma-publish-body h5,
.ma-publish-body h6 {
  margin: 1.25em 0 .55em;
  color: var(--ma-text);
  line-height: var(--ma-title-line-height);
}

.ma-publish-body h1,
.ma-publish-body h2 {
  font-size: var(--ma-page-title-font-size);
}

.ma-publish-body h3,
.ma-publish-body h4,
.ma-publish-body h5,
.ma-publish-body h6 {
  font-size: var(--ma-section-font-size);
}

.ma-publish-body p,
.ma-publish-body ul,
.ma-publish-body ol,
.ma-publish-body blockquote {
  margin: 0 0 1em;
}

.ma-publish-body ul,
.ma-publish-body ol {
  padding-left: 1.4em;
}

.ma-publish-body a {
  color: var(--brand-600);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ma-publish-body img,
.ma-publish-body video {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 12px auto;
  border-radius: 10px;
}

.ma-publish-body .zqr-imgrow {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: flex-start;
}

.ma-publish-body .zqr-imgrow > div {
  min-width: 0;
}

.ma-publish-body .zqr-imgrow img {
  width: 100%;
  margin: 0;
}

.ma-publish-body .ma-figcap {
  margin: 4px 0 0;
  color: var(--ma-muted);
  font-size: var(--ma-meta-font-size);
  line-height: var(--ma-body-line-height);
  text-align: center;
}

.ma-publish-body blockquote {
  padding: 10px 12px;
  border-left: 3px solid var(--brand-600);
  color: var(--ma-muted);
  background: #f5f9fc;
}

.ma-publish-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.ma-publish-actions .ma-btn {
  min-width: 0;
  padding-left: 8px;
  padding-right: 8px;
}

.ma-publish-actions .ma-btn:only-child {
  grid-column: 1 / -1;
}

.ma-publish-warning {
  margin: 13px 16px;
  padding: 11px 12px;
  border: 1px solid #f0c9c9;
  border-radius: 10px;
  color: #922b2b;
  background: var(--ma-red-soft);
  font-size: 13px;
  line-height: 1.65;
}

.ma-publish-issues {
  color: var(--ma-text);
  font-size: var(--ma-body-font-size);
  line-height: 1.75;
}

.ma-publish-issues p {
  margin: 0 0 10px;
}

.ma-publish-issues ul {
  margin: 0;
  padding-left: 1.35em;
}

.ma-video-wait {
  margin: 14px 16px 18px;
  padding: 14px 12px;
  border-radius: 12px;
  color: var(--ma-muted);
  background: #f3f8fc;
  text-align: center;
}

.ma-video-wait strong {
  display: block;
  margin-top: 7px;
  color: var(--ma-text);
  font-size: var(--ma-body-font-size);
}

.ma-video-wait p {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.6;
}

.ma-spin {
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 3px solid #d5e4ef;
  border-top-color: var(--brand-600);
  border-radius: 50%;
  animation: ma-spin .8s linear infinite;
}

.ma-hidden {
  display: none !important;
}

.ma-login {
  width: min(100%, 400px);
  margin: 8vh auto 0;
}

.ma-login-logo {
  margin-bottom: 16px;
  text-align: center;
}

.ma-login-logo img {
  width: 64px;
  height: 64px;
  display: block;
  margin: 0 auto;
}

.ma-login h1 {
  margin: 0;
  text-align: center;
  font-size: var(--ma-page-title-font-size);
}

.ma-login > p {
  margin: 8px 0 22px;
  color: var(--ma-muted);
  text-align: center;
  font-size: 13px;
  line-height: 1.7;
}

.ma-login-form {
  display: grid;
  gap: 12px;
}

.ma-form-error {
  min-height: 20px;
  color: #b42323;
  font-size: 12px;
  line-height: 1.6;
}

.ma-device-list {
  display: grid;
  gap: 8px;
}

.ma-device-row {
  padding: 11px 12px;
  border-radius: 11px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  background: #f7fafc;
  font-size: 12px;
}

.ma-device-row span {
  color: var(--ma-muted);
}

.ma-device-row strong {
  max-width: 64%;
  text-align: right;
  overflow-wrap: anywhere;
}

.ma-qr-wrap {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.ma-qr-wrap canvas {
  width: min(270px, 74vw);
  height: auto;
  padding: 10px;
  border: 1px solid var(--ma-line);
  border-radius: 14px;
  background: #fff;
  image-rendering: pixelated;
}

.ma-qr-url {
  max-width: 100%;
  margin: 0;
  color: var(--ma-muted);
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  word-break: break-all;
  text-align: center;
}

.ma-toast {
  z-index: 100000;
}

.ma-publish-launch-grid.one {
  grid-template-columns: 1fr;
}

.ma-media-upload-actions,
.ma-media-compose-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ma-media-upload-actions .ma-btn:first-child {
  grid-column: auto;
}

.ma-media-upload-group {
  display: grid;
  gap: 7px;
}

.ma-media-upload-group + .ma-media-upload-group {
  margin-top: 13px;
}

.ma-media-upload-group > strong {
  color: var(--ma-muted);
  font-size: 12px;
  letter-spacing: .04em;
}

.ma-media-status-tabs {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--ma-line);
  border-radius: 11px;
  background: #edf3f8;
}

.ma-media-status-tabs button {
  min-width: 0;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  color: var(--ma-muted);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
}

.ma-media-status-tabs button.active {
  color: #fff;
  background: var(--brand-600);
}

.ma-media-grid,
.ma-media-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ma-media-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--ma-line);
  border-radius: 14px;
  background: #fff;
}

.ma-media-card-preview {
  width: 100%;
  aspect-ratio: 4 / 3;
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #eef4f9;
}

.ma-media-card-preview img,
.ma-media-pick-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ma-media-video-mark {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--brand-700);
  font-size: 20px;
}

.ma-media-card-body {
  min-width: 0;
  padding: 10px;
  display: grid;
  gap: 6px;
}

.ma-media-card-body > strong {
  overflow-wrap: anywhere;
}

.ma-media-card-body > small {
  color: var(--ma-muted);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.ma-media-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ma-media-card-actions .ma-btn {
  min-width: 0;
}

.ma-media-picker-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 10px;
}

.ma-media-picker-grid {
  max-height: 56vh;
  margin-top: 10px;
  overflow-y: auto;
}

.ma-media-pick-card {
  min-width: 0;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 12px;
  overflow: hidden;
  background: #f4f7fa;
  text-align: left;
}

.ma-media-pick-card img {
  display: block;
  aspect-ratio: 4 / 3;
}

.ma-media-pick-card span,
.ma-media-pick-card small {
  display: block;
  padding: 0 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ma-media-pick-card span {
  margin-top: 7px;
  color: var(--ma-text);
  font-size: 13px;
  font-weight: 700;
}

.ma-media-pick-card small {
  padding-bottom: 8px;
  color: var(--ma-muted);
  font-size: 12px;
}

.ma-media-pick-card.is-selected {
  border-color: var(--brand-600);
  background: var(--ma-blue-soft);
}

.ma-media-compose-preview {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.ma-media-compose-item {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--ma-line);
  border-radius: 11px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  background: #f8fbfd;
}

.ma-media-compose-item img {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  object-fit: cover;
}

.ma-media-compose-item span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.ma-media-compose-item button {
  min-height: 44px;
  padding: 0 9px;
  border: 1px solid #e7cbc7;
  border-radius: 8px;
  color: #a33b31;
  background: #fff;
}

.ma-compose-preview-cover,
.ma-compose-preview-image,
.ma-media-preview-image,
.ma-media-preview-player {
  display: block;
  width: 100%;
  max-height: 62vh;
  margin: 12px 0;
  border-radius: 12px;
  object-fit: contain;
  background: #f2f6fa;
}

.ma-empty-inline {
  grid-column: 1 / -1;
  padding: 24px 12px;
  color: var(--ma-muted);
  text-align: center;
}

.ma-skeleton {
  display: grid;
  gap: 12px;
}

.ma-sk-card {
  height: 112px;
  border: 1px solid #e0e9f2;
  border-radius: 16px;
  background: linear-gradient(90deg, #f2f6fa 25%, #fff 50%, #f2f6fa 75%);
  background-size: 200% 100%;
  animation: ma-shimmer 1.2s infinite;
}

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

@keyframes ma-shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

@media (max-width: 359px) {
  .ma-main {
    padding-left: 10px;
    padding-right: 10px;
  }

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

  .ma-info-grid,
  .ma-card-grid,
  .ma-learning-filter-grid {
    grid-template-columns: 1fr;
  }

  .ma-action-bar {
    grid-template-columns: 1fr;
  }

  .ma-learning-batch {
    align-items: stretch;
    flex-direction: column;
  }

  .ma-learning-batch > div,
  .ma-learning-batch .ma-btn {
    width: 100%;
  }

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

  .ma-publish-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ma-publish-actions,
  .ma-button-row {
    grid-template-columns: 1fr;
  }

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

  .ma-nav {
    gap: 3px;
    padding-left: 4px;
    padding-right: 4px;
  }

  .ma-nav-item {
    font-size: 12px;
  }
}

@media (min-width: 760px) {
  .ma-main {
    padding-top: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* P1-499D 手机线索工作台 */
.manage-entry {
  width: 100%;
  min-height: 92px;
  padding: 16px;
  border: 1px solid var(--ma-line);
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  text-align: left;
  color: var(--ma-text);
  background: #fff;
  box-shadow: none;
  cursor: pointer;
}

.manage-entry-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--ma-blue-soft);
  color: var(--brand-700, #245682);
  font-size: 20px;
  font-weight: 700;
}

.manage-entry span:nth-child(2) {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.manage-entry strong {
  font-size: var(--ma-section-font-size);
}

.manage-entry small {
  color: var(--ma-muted);
  font-size: 13px;
  line-height: 1.45;
}

.manage-entry b {
  min-width: 36px;
  min-height: 36px;
  padding: 0 9px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--ma-blue-soft);
  color: var(--brand-700, #245682);
  font-size: var(--ma-body-font-size);
}

.lead-queue-shell {
  position: sticky;
  z-index: 3;
  top: calc(56px + var(--ma-safe-top));
  padding: 8px;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(8px);
}

.lead-queue-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}

.lead-queue-tab {
  min-width: 0;
  min-height: 48px;
  padding: 5px 2px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ma-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 12px;
  line-height: 1.25;
}

.lead-queue-tab span {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.15;
}

.lead-queue-tab b {
  min-height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(98, 116, 138, .12);
  font-size: 12px;
}

.lead-queue-tab.active {
  color: #fff;
  background: var(--brand-700, #245682);
}

.lead-queue-tab.active b {
  background: rgba(255, 255, 255, .2);
}

.lead-filter-actions,
.lead-contact-actions,
.lead-action-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.lead-filter-actions .ma-btn,
.lead-contact-actions .ma-btn,
.lead-action-bar .ma-btn {
  min-height: 44px;
  width: 100%;
}

.lead-list {
  gap: 10px;
}

.lead-card {
  width: 100%;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--ma-line);
  border-radius: var(--ma-card-radius);
  display: flex;
  flex-direction: column;
  gap: 7px;
  text-align: left;
  color: var(--ma-text);
  background: #fff;
  box-shadow: none;
}

.lead-card-head,
.lead-card-foot {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.lead-card-head strong {
  min-width: 0;
  font-size: var(--ma-section-font-size);
  overflow-wrap: anywhere;
}

.lead-card-phone {
  flex: 0 0 auto;
  color: var(--ma-muted);
  font-size: var(--ma-meta-font-size);
}

.lead-card-org,
.lead-card-intent,
.lead-card-detail,
.lead-card-source {
  min-width: 0;
  overflow-wrap: anywhere;
}

.lead-card-org {
  color: var(--ma-muted);
  font-size: var(--ma-meta-font-size);
}

.lead-card-intent {
  font-weight: 600;
}

.lead-card-detail {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #40556d;
}

.lead-card-source {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--ma-muted);
  font-size: var(--ma-meta-font-size);
}

.lead-card-tags,
.lead-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lead-card-foot {
  padding-top: 8px;
  border-top: 1px solid #eef3f7;
  color: var(--ma-muted);
  font-size: 12px;
}

.lead-card-foot span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.lead-detail-copy,
.lead-source-box,
.lead-wecom {
  display: grid;
  gap: 7px;
}

.lead-detail {
  padding-bottom: 180px;
}

.lead-detail-copy p,
.lead-wecom p {
  margin: 0;
  overflow-wrap: anywhere;
}

.lead-source-box {
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  background: #f6f9fc;
}

.lead-source-box span,
.lead-source-box small {
  color: var(--ma-muted);
  font-size: var(--ma-meta-font-size);
}

.lead-source-box .ma-btn {
  width: 100%;
}

.lead-wecom {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--ma-line);
}

.lead-contact-row {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.lead-contact-row strong {
  min-width: 0;
  font-size: var(--ma-page-title-font-size);
  letter-spacing: .04em;
  overflow-wrap: anywhere;
}

.lead-contact-row .ma-btn {
  flex: 0 0 auto;
}

.lead-action-bar {
  position: sticky;
  z-index: 4;
  bottom: calc(64px + var(--ma-safe-bottom));
  padding: 10px;
  border: 1px solid var(--ma-line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 8px 26px rgba(16, 42, 67, .14);
  backdrop-filter: blur(10px);
}

.lead-action-bar .ma-btn.primary {
  grid-column: 1 / -1;
  min-height: 48px;
  order: -1;
}

.lead-action-bar .ma-btn {
  min-height: 46px;
}

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

.lead-activity {
  padding: 11px 12px;
  border: 1px solid #e5edf5;
  border-radius: 12px;
  background: #fbfdff;
}

.lead-activity > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.lead-activity time {
  margin-left: auto;
  color: var(--ma-muted);
  font-size: 12px;
}

.lead-activity p {
  margin: 7px 0;
  overflow-wrap: anywhere;
}

.lead-activity small {
  color: var(--ma-muted);
}

@media (max-width: 360px) {
  .lead-queue-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .lead-detail {
    padding-bottom: 200px;
  }

  .lead-card-head,
  .lead-card-foot,
  .lead-contact-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* P1-510：移动端表单弹窗跟随实际可视窗口，防止软键盘把输入区压窄。 */
@media (max-width: 640px) {
  .zmodal-layer {
    --zmodal-vv-height: 100dvh;
  }

  .zmodal-layer .zmodal-mask {
    top: 0;
    right: 0;
    bottom: auto;
    left: 0;
    height: var(--zmodal-vv-height);
    padding: 8px;
    align-items: flex-end;
    box-sizing: border-box;
  }

  .zmodal-layer .zmodal-card {
    width: 100%;
    max-width: none;
    height: min(92dvh, var(--zmodal-vv-height));
    max-height: none;
    padding: 10px 12px calc(8px + var(--ma-safe-bottom));
    border-radius: 18px 18px 0 0;
    box-sizing: border-box;
  }

  .zmodal-layer.zmodal-keyboard .zmodal-card {
    height: var(--zmodal-vv-height);
    max-height: var(--zmodal-vv-height);
    padding: calc(8px + env(safe-area-inset-top, 0px)) 12px calc(8px + var(--ma-safe-bottom));
    border-radius: 0;
  }

  .zmodal-layer.zmodal-keyboard .zmodal-mask {
    padding: 0;
  }

  .zmodal-layer .zmodal-title {
    margin-bottom: 6px;
    font-size: var(--ma-section-font-size);
    line-height: var(--ma-title-line-height);
  }

  .zmodal-layer .zmodal-content {
    min-height: 0;
    padding-bottom: 6px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .zmodal-layer.zmodal-keyboard .zmodal-content {
    padding-top: 4px;
  }

  .zmodal-layer .zmodal-actions {
    position: sticky;
    bottom: 0;
    margin-top: 8px;
    padding-top: 8px;
    background: #fff;
  }

  .zmodal-layer .ma-textarea {
    min-height: 132px;
  }
}

body.zmodal-open .ma-header,
body.zmodal-open .ma-nav,
body.zmodal-open .lead-queue-shell,
body.zmodal-open .lead-action-bar {
  visibility: hidden !important;
}

/* P1-510：线索搜索聚焦时只保留筛选表单，给软键盘留出完整输入空间。 */
body.lead-keyboard-mode .ma-app {
  min-height: var(--ma-keyboard-height, 100dvh);
  padding: 0;
}

body.lead-keyboard-mode .ma-header,
body.lead-keyboard-mode .ma-nav,
body.lead-keyboard-mode .lead-workbench > .ma-detail-top,
body.lead-keyboard-mode .lead-queue-shell,
body.lead-keyboard-mode .lead-workbench > #mobileLeadSummary,
body.lead-keyboard-mode .lead-workbench > #mobileLeadList,
body.lead-keyboard-mode .lead-workbench > #mobileLeadPager {
  display: none !important;
}

body.lead-keyboard-mode .ma-main {
  position: fixed;
  z-index: 90;
  top: 0;
  right: 0;
  left: 0;
  height: var(--ma-keyboard-height, 100dvh);
  padding: calc(8px + env(safe-area-inset-top, 0px)) 12px calc(8px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--ma-bg);
}

body.lead-keyboard-mode #mobileLeadFilter {
  margin: 0;
}

body.lead-keyboard-mode #mobileLeadFilter .ma-toolbar {
  grid-template-columns: 1fr;
}

body.lead-keyboard-mode #mobileLeadFilter .ma-field {
  display: none;
}

body.lead-keyboard-mode #mobileLeadFilter .ma-field:focus-within {
  display: grid;
}
