.line-editor-dialog .preview-host.miniapp-preview-synced {
  position: relative;
  min-height: 0;
  overflow: hidden !important;
}

.line-editor-dialog .preview-host.miniapp-preview-synced .miniapp-preview-source {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  overflow: hidden !important;
}

.miniapp-live-preview,
.miniapp-live-preview * {
  box-sizing: border-box;
}

.miniapp-live-preview {
  width: 100%;
  height: 100%;
  min-height: 0;
  color: #303733;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

.mp-sync-frame {
  width: 100%;
  height: 100%;
  padding: 14px;
  overflow-x: hidden;
  overflow-y: auto;
  background: radial-gradient(circle at 78% 0, rgba(178, 139, 82, 0.18), transparent 260px), #e9e1d4;
  scrollbar-width: thin;
  scrollbar-color: rgba(36, 75, 61, 0.28) transparent;
}

.mp-sync-phone {
  --mp-bg: #f4f1ea;
  --mp-soft: #efebe3;
  --mp-muted: #e8e4da;
  --mp-card: #fcfaf6;
  --mp-fg: #303733;
  --mp-subtle: #7d817c;
  --mp-faint: #aba497;
  --mp-line: rgba(80, 80, 77, 0.1);
  --mp-line-light: rgba(80, 80, 77, 0.07);
  --mp-gold: #a1855b;
  --mp-gold-deep: #745c38;
  --mp-accent: #657d6d;
  width: min(375px, 100%);
  min-height: 100%;
  margin: 0 auto;
  overflow: hidden;
  color: var(--mp-fg);
  background: var(--mp-bg);
  border: 1px solid rgba(36, 75, 61, 0.1);
  border-radius: 18px;
  box-shadow: 0 22px 52px rgba(45, 46, 39, 0.18);
}

.mp-sync-phone.theme-blackgold {
  --mp-bg: #151311;
  --mp-soft: #25211c;
  --mp-muted: #29241e;
  --mp-card: #1f1b17;
  --mp-fg: #f1e8d6;
  --mp-subtle: #b8ac95;
  --mp-faint: #7f7362;
  --mp-line: rgba(202, 165, 108, 0.16);
  --mp-line-light: rgba(202, 165, 108, 0.1);
  --mp-gold: #caa56c;
  --mp-gold-deep: #c6a875;
  --mp-accent: #d0b47a;
}

.mp-sync-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  min-height: 48px;
  align-items: center;
  padding: 0 12px;
  background: color-mix(in srgb, var(--mp-bg) 94%, transparent);
  border-bottom: 1px solid var(--mp-line-light);
  backdrop-filter: blur(14px);
}

.mp-sync-topbar > span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  background: var(--mp-card);
  box-shadow: 0 3px 10px rgba(30, 42, 36, 0.06);
  color: var(--mp-fg);
  font-family: Georgia, serif;
  font-size: 20px;
}

.mp-sync-topbar div { min-width: 0; text-align: center; }
.mp-sync-topbar small { display: block; color: var(--mp-gold-deep); font-family: Georgia, serif; font-size: 7px; font-weight: 700; letter-spacing: 0.28em; }
.mp-sync-topbar b { display: block; margin-top: 2px; overflow: hidden; color: var(--mp-fg); font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }

.mp-sync-hero { position: relative; height: 300px; overflow: hidden; background: var(--mp-muted); }
.mp-sync-hero-image { display: block; width: 100%; height: 100%; object-fit: cover; }
.mp-sync-hero-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(17, 28, 24, 0.02), rgba(17, 28, 24, 0.2) 48%, rgba(17, 28, 24, 0.82)); pointer-events: none; }
.mp-sync-hero-empty { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; flex-direction: column; gap: 8px; color: var(--mp-subtle); background: linear-gradient(145deg, var(--mp-soft), var(--mp-muted)); }
.mp-sync-hero-empty b { font-family: Georgia, serif; font-size: 32px; color: var(--mp-gold-deep); }
.mp-sync-hero-empty span { font-size: 10px; }
.mp-sync-hero-content { position: absolute; right: 18px; bottom: 18px; left: 18px; color: #fff; }
.mp-sync-hero-content > small { display: block; font-family: Georgia, serif; font-size: 8px; font-weight: 700; letter-spacing: 0.28em; text-transform: uppercase; }
.mp-sync-hero-content h2 { margin: 6px 0 0; font-family: "Songti SC", STSong, serif; font-size: 22px; font-weight: 700; line-height: 1.22; letter-spacing: 0.03em; }
.mp-sync-hero-content > p { margin: 5px 0 0; font-size: 10px; line-height: 1.5; opacity: 0.86; }
.mp-sync-hero-content > div { display: flex; gap: 7px; margin-top: 12px; }
.mp-sync-hero-content > div > span { min-width: 70px; padding: 7px 10px; border: 1px solid rgba(255,255,255,0.2); border-radius: 9px; background: rgba(255,255,255,0.12); backdrop-filter: blur(8px); }
.mp-sync-hero-content span small { display: block; font-size: 8px; opacity: 0.72; }
.mp-sync-hero-content span b { display: block; margin-top: 2px; font-size: 12px; }

.mp-sync-price-card,
.mp-sync-route-card { margin: 12px; padding: 13px; border: 1px solid var(--mp-line); border-radius: 12px; background: var(--mp-card); box-shadow: 0 7px 20px rgba(39, 45, 40, 0.055); }
.mp-sync-price-head { display: flex; width: 100%; min-height: 38px; align-items: center; justify-content: space-between; gap: 10px; padding: 0; border: 0; color: inherit; background: transparent; cursor: pointer; text-align: left; }
.mp-sync-price-head small,
.mp-sync-route-card header small { display: block; color: var(--mp-gold-deep); font-family: Georgia, serif; font-size: 8px; font-weight: 700; letter-spacing: 0.27em; }
.mp-sync-price-head b,
.mp-sync-route-card header b { display: block; margin-top: 3px; color: var(--mp-fg); font-size: 13px; font-weight: 700; }
.mp-sync-price-summary { display: flex; align-items: center; gap: 8px; }
.mp-sync-price-summary em { padding: 4px 8px; border-radius: 999px; color: var(--mp-subtle); background: var(--mp-soft); font-size: 9px; font-style: normal; font-weight: 700; }
.mp-sync-price-summary i,
.mp-sync-collapsible em i { display: inline-block; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform 0.2s ease; }
.mp-sync-price-summary i.is-open { transform: rotate(225deg) translate(-1px, -1px); }
.mp-sync-price-list { margin-top: 9px; }
.mp-sync-price-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--mp-line-light); color: var(--mp-fg); font-size: 10px; }
.mp-sync-price-row strong { font-size: 11px; }

.mp-sync-route-card header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.mp-sync-route-card header em { color: var(--mp-subtle); font-size: 9px; font-style: normal; }
.mp-sync-route-image { display: block; width: 100%; max-height: 250px; object-fit: contain; border-radius: 9px; background: var(--mp-muted); }
.mp-sync-route-scroll { width: 100%; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.mp-sync-route-scroll::-webkit-scrollbar { display: none; }
.mp-sync-route-list { display: inline-flex; min-width: 100%; padding: 2px 1px 5px; }
.mp-sync-route-item { position: relative; flex: 0 0 103px; padding-right: 10px; }
.mp-sync-route-node { position: relative; z-index: 2; display: grid; width: 29px; height: 29px; place-items: center; border-radius: 50%; color: var(--mp-card); background: var(--mp-accent); font-size: 9px; font-weight: 800; }
.mp-sync-route-item > i { position: absolute; top: 14px; left: 29px; width: 74px; border-top: 2px solid var(--mp-gold); }
.mp-sync-route-item > small { display: block; margin-top: 6px; color: var(--mp-gold-deep); font-size: 7px; font-weight: 800; letter-spacing: 0.12em; }
.mp-sync-route-item > b { display: block; margin-top: 3px; padding-right: 4px; color: var(--mp-fg); font-size: 9px; line-height: 1.4; }

.mp-sync-tabs { position: sticky; top: 54px; z-index: 25; display: flex; margin: 0 12px 12px; padding: 4px; border: 1px solid var(--mp-line); border-radius: 999px; background: var(--mp-card); box-shadow: 0 6px 16px rgba(24, 45, 38, 0.08); }
.mp-sync-tabs button { flex: 1; padding: 7px 0; border: 0; border-radius: 999px; color: var(--mp-subtle); background: transparent; font-size: 10px; cursor: pointer; }
.mp-sync-tabs button.is-active { color: var(--mp-card); background: var(--mp-accent); font-weight: 700; box-shadow: 0 4px 12px rgba(24, 45, 38, 0.15); }

.mp-sync-section { padding: 0 12px 12px; scroll-margin-top: 105px; }
.mp-sync-title-head { display: flex; margin-bottom: 9px; flex-direction: column; gap: 3px; }
.mp-sync-title-head > b,
.mp-sync-section-head > span > b { color: var(--mp-fg); font-size: 14px; font-weight: 700; }
.mp-sync-title-head > small,
.mp-sync-section-head > span > small { color: var(--mp-subtle); font-size: 9px; line-height: 1.5; }
.mp-sync-section-head { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; padding: 3px 0; border: 0; color: inherit; background: transparent; text-align: left; }
.mp-sync-section-head > span { display: flex; flex-direction: column; gap: 3px; }
.mp-sync-collapsible { cursor: pointer; }
.mp-sync-collapsible em { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 999px; color: var(--mp-accent); background: color-mix(in srgb, var(--mp-accent) 13%, transparent); font-size: 9px; font-style: normal; font-weight: 700; }
.mp-sync-collapsible em i { width: 6px; height: 6px; border: 0; border-top: 1.5px solid currentColor; border-left: 1.5px solid currentColor; transform: rotate(45deg) translateY(1px); }
.mp-sync-collapsible em i.is-closed { transform: rotate(225deg) translate(1px, 1px); }

.mp-sync-highlight-scroll { width: 100%; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.mp-sync-highlight-scroll::-webkit-scrollbar { display: none; }
.mp-sync-highlight-list { display: inline-flex; min-width: 100%; align-items: stretch; gap: 8px; padding: 2px 12px 8px 0; }
.mp-sync-highlight-image { display: block; width: 260px; height: 164px; flex: 0 0 260px; object-fit: cover; border: 1px solid var(--mp-line-light); border-radius: 11px; background: var(--mp-muted); box-shadow: 0 6px 14px rgba(34, 29, 24, 0.09); }

.mp-sync-day-list { display: flex; flex-direction: column; gap: 7px; }
.mp-sync-day-card { overflow: hidden; border: 1px solid var(--mp-line); border-radius: 12px; background: var(--mp-card); box-shadow: 0 7px 20px rgba(39, 45, 40, 0.055); }
.mp-sync-day-head { display: flex; width: 100%; align-items: center; gap: 10px; padding: 11px 12px; border: 0; color: inherit; background: transparent; text-align: left; cursor: pointer; }
.mp-sync-day-badge { display: flex; width: 48px; min-height: 48px; flex: 0 0 48px; align-items: center; justify-content: center; flex-direction: column; border-radius: 10px; background: var(--mp-soft); }
.mp-sync-day-badge small { color: var(--mp-faint); font-size: 7px; letter-spacing: 0.18em; }
.mp-sync-day-badge b { margin-top: 3px; color: var(--mp-fg); font-family: Georgia, serif; font-size: 14px; }
.mp-sync-day-title { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 3px; }
.mp-sync-day-title b { color: var(--mp-fg); font-size: 11px; font-weight: 650; line-height: 1.45; }
.mp-sync-day-title small { color: var(--mp-subtle); font-size: 9px; line-height: 1.4; }
.mp-sync-day-head > em { flex-shrink: 0; color: var(--mp-faint); font-size: 9px; font-style: normal; }
.mp-sync-day-body { padding: 0 12px 12px; border-top: 1px solid var(--mp-line-light); }
.mp-sync-day-copy { margin: 0; padding: 8px 0 2px; color: var(--mp-fg); font-size: 10px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }

.mp-sync-period { position: relative; margin-top: 9px; padding: 10px; overflow: hidden; border: 1px solid var(--mp-line-light); border-radius: 10px; box-shadow: 0 6px 16px rgba(43, 53, 46, 0.045); }
.mp-sync-period::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--mp-gold); }
.mp-sync-period.is-morning { background: linear-gradient(135deg, rgba(255, 249, 232, 0.96), var(--mp-card)); }
.mp-sync-period.is-afternoon { background: linear-gradient(135deg, rgba(235, 244, 237, 0.96), var(--mp-card)); }
.theme-blackgold .mp-sync-period.is-morning,
.theme-blackgold .mp-sync-period.is-afternoon { background: var(--mp-soft); }
.mp-sync-period header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mp-sync-period header > span { display: flex; align-items: center; gap: 6px; }
.mp-sync-period header span b { display: grid; min-width: 30px; height: 20px; place-items: center; border-radius: 999px; color: var(--mp-card); background: var(--mp-accent); font-family: Georgia, serif; font-size: 8px; letter-spacing: 0.08em; }
.mp-sync-period header strong { color: var(--mp-gold-deep); font-size: 10px; letter-spacing: 0.1em; }
.mp-sync-period header small { color: var(--mp-faint); font-family: Georgia, serif; font-size: 6px; font-weight: 600; letter-spacing: 0.08em; }
.mp-sync-period > p { margin: 7px 0 0; color: var(--mp-fg); font-size: 10px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.mp-sync-period-images,
.mp-sync-day-images { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.mp-sync-period-image { display: block; width: 100%; height: 92px; object-fit: cover; border-radius: 9px; background: var(--mp-muted); }
.mp-sync-day-image { display: block; width: 100%; height: 108px; object-fit: cover; border-radius: 9px; background: var(--mp-muted); }
.mp-sync-video { background: #111; }
.mp-sync-meals { display: flex; flex-wrap: wrap; gap: 5px; padding-top: 10px; }
.mp-sync-meal { padding: 4px 7px; border-radius: 999px; color: var(--mp-subtle); background: var(--mp-soft); font-size: 8px; }
.mp-sync-meal.is-included { color: var(--mp-accent); background: color-mix(in srgb, var(--mp-accent) 14%, transparent); }

.mp-sync-panel { margin-bottom: 8px; padding: 12px; border: 1px solid var(--mp-line); border-radius: 10px; background: var(--mp-card); }
.mp-sync-panel h3 { margin: 0 0 7px; color: var(--mp-fg); font-size: 11px; font-weight: 700; }
.mp-sync-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.mp-sync-panel-head span { color: var(--mp-faint); font-size: 8px; }
.mp-sync-cost-row { display: flex; align-items: flex-start; gap: 7px; padding: 7px 0; border-top: 1px solid var(--mp-line-light); }
.mp-sync-cost-row > i { width: 4px; height: 4px; flex: 0 0 4px; margin-top: 5px; border-radius: 50%; background: var(--mp-accent); }
.mp-sync-cost-row > i.excluded { background: var(--mp-faint); }
.mp-sync-cost-row > i.gifted { background: var(--mp-gold); }
.mp-sync-cost-row > div { min-width: 0; flex: 1; }
.mp-sync-cost-row b { display: block; color: var(--mp-fg); font-size: 10px; line-height: 1.45; }
.mp-sync-cost-row p,
.mp-sync-panel-copy { margin: 2px 0 0; color: var(--mp-subtle); font-size: 9px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.mp-sync-notice-row { display: flex; gap: 8px; padding: 7px 0; border-top: 1px solid var(--mp-line-light); }
.mp-sync-notice-row b { width: 78px; flex: 0 0 78px; color: var(--mp-fg); font-size: 9px; line-height: 1.5; }
.mp-sync-notice-row span { min-width: 0; flex: 1; color: var(--mp-subtle); font-size: 9px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }

.mp-sync-doc { display: flex; align-items: center; gap: 9px; margin-top: 6px; padding: 10px; border: 1px solid var(--mp-line-light); border-radius: 9px; background: var(--mp-soft); }
.mp-sync-doc > span { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border: 1px solid var(--mp-line); border-radius: 8px; color: var(--mp-gold-deep); background: var(--mp-card); font-size: 7px; font-weight: 800; }
.mp-sync-doc > div { min-width: 0; flex: 1; }
.mp-sync-doc b { display: block; overflow: hidden; color: var(--mp-fg); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.mp-sync-doc small { display: block; margin-top: 3px; color: var(--mp-faint); font-size: 8px; }
.mp-sync-doc em { color: var(--mp-gold-deep); font-family: Georgia, serif; font-size: 18px; font-style: normal; }

.mp-sync-footer { padding: 22px 20px 28px; text-align: center; color: var(--mp-subtle); }
.mp-sync-footer i { display: block; width: 28px; height: 1px; margin: 0 auto 12px; background: var(--mp-gold); }
.mp-sync-footer p { margin: 0; font-family: "Songti SC", STSong, serif; font-size: 10px; line-height: 1.8; }
.mp-sync-footer small { display: block; margin-top: 10px; color: var(--mp-gold-deep); font-size: 7px; font-weight: 700; letter-spacing: 0.18em; }

@media (max-width: 820px) {
  .mp-sync-frame { padding: 10px; }
  .mp-sync-phone { width: min(390px, 100%); }
}
