:root {
  --ink: #252723;
  --muted: #77776f;
  --paper: #f3eddf;
  --paper-light: #fbf8f0;
  --red: #a53b2b;
  --line: rgba(55, 57, 51, .15);
  --shadow: 0 22px 60px rgba(54, 47, 34, .13);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "Microsoft YaHei", "PingFang SC", sans-serif; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.paper-noise { position: fixed; inset: 0; pointer-events: none; opacity: .35; z-index: 20; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.055'/%3E%3C/svg%3E"); }

.site-header { height: 76px; display: flex; align-items: center; justify-content: space-between; max-width: 1380px; margin: auto; padding: 0 44px; border-bottom: 1px solid var(--line); }
.brand { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 13px; }
.brand-seal { width: 42px; height: 42px; display: grid; place-items: center; color: #f5e8d0; background: var(--red); font: 25px "STKaiti", "KaiTi", serif; box-shadow: inset 0 0 0 3px rgba(255,255,255,.17); transform: rotate(-2deg); }
.brand b { display: block; font: 19px "STKaiti", "KaiTi", serif; letter-spacing: 2px; }
.brand small { display: block; color: var(--muted); font-size: 8px; letter-spacing: 2.5px; margin-top: 2px; }
nav { display: flex; gap: 28px; }
.nav-link { border: 0; padding: 12px 2px; background: none; color: var(--muted); cursor: pointer; position: relative; }
.nav-link.active { color: var(--ink); }
.nav-link.active::after { content: ""; position: absolute; left: 20%; right: 20%; bottom: 2px; height: 2px; background: var(--red); }
.guide-link { padding: 12px 2px; color: var(--muted); text-decoration: none; }
.guide-link:hover { color: var(--ink); }

main { max-width: 1380px; margin: auto; padding: 0 44px 64px; }
.hero { min-height: 238px; display: flex; justify-content: space-between; align-items: center; padding: 24px 5% 20px; position: relative; overflow: hidden; }
.hero::before { content: "写"; position: absolute; right: 27%; top: -58px; font: 260px "STKaiti", "KaiTi", serif; color: rgba(67, 66, 58, .035); transform: rotate(8deg); }
.eyebrow { color: var(--red); letter-spacing: 5px; font-size: 12px; margin: 0 0 8px; }
.hero h1 { font: 44px/1.2 "STKaiti", "KaiTi", serif; letter-spacing: 5px; margin: 0; }
.hero h1 small { display: block; margin-top: 4px; font: inherit; font-size: .61em; letter-spacing: 4px; }
.hero h1 em { color: var(--red); font-style: normal; position: relative; }
.hero h1 em::after { content: ""; position: absolute; left: -9px; right: -9px; bottom: 0; height: 5px; background: rgba(165,59,43,.2); transform: rotate(-3deg); }
.hero-desc { color: var(--muted); margin-top: 12px; font-size: 13px; line-height: 1.65; }
.hero-note { width: 160px; height: 190px; margin-right: 8%; background: #f7f2e7; padding: 24px; box-shadow: 8px 11px 24px rgba(46,42,34,.12); transform: rotate(3deg); position: relative; border: 1px solid rgba(70,64,50,.08); }
.hero-note::after { content: ""; position: absolute; width: 68px; height: 18px; top: -10px; left: 45px; background: rgba(214,196,158,.5); transform: rotate(-4deg); }
.hero-note span { color: var(--red); font: 34px serif; }
.hero-note p { font: 19px/1.55 "STKaiti", "KaiTi", serif; margin: -12px 0 13px; }
.hero-note i { font-style: normal; font-size: 9px; color: #999589; letter-spacing: 2px; }

.view { display: none; }
.view.active { display: grid; animation: rise .5s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.workspace { grid-template-columns: minmax(0, 1.08fr) minmax(390px, .92fr); align-items: start; background: #e9e2d3; border: 1px solid var(--line); box-shadow: var(--shadow); min-height: 790px; }
.editor-panel { min-height: 100%; padding: 48px 54px; border-right: 1px solid var(--line); background: rgba(251,248,240,.72); }
.section-heading { display: flex; align-items: flex-start; gap: 16px; }
.section-heading h2 { font: 27px "STKaiti", "KaiTi", serif; margin: 0 0 5px; letter-spacing: 2px; }
.section-heading p { color: var(--muted); font-size: 13px; margin: 0; }
.step { display: grid; place-items: center; min-width: 37px; height: 37px; border: 1px solid var(--red); border-radius: 50%; color: var(--red); font: 14px Georgia, serif; }
.input-tabs { display: flex; gap: 4px; margin: 30px 0 0; border-bottom: 1px solid var(--line); }
.input-tab { border: 0; background: transparent; padding: 10px 18px; color: var(--muted); cursor: pointer; }
.input-tab.active { color: var(--ink); border-bottom: 2px solid var(--red); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
textarea { width: 100%; height: 230px; border: 0; resize: vertical; outline: none; padding: 11px 3px 22px; color: var(--ink); background: repeating-linear-gradient(transparent, transparent 34px, rgba(90,100,95,.11) 35px); font: 18px/35px "STKaiti", "KaiTi", serif; }
.text-meta { display: flex; justify-content: space-between; color: #929187; font-size: 11px; padding-top: 8px; }
.text-meta > span:last-child { display: flex; align-items: center; gap: 5px; }
.text-meta b { color: var(--ink); }
.text-action { margin-right: 8px; padding: 0; border: 0; background: none; color: var(--red); cursor: pointer; font-size: 11px; }
.drop-zone { height: 230px; margin-top: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 1px dashed #aaa79c; background: rgba(255,255,255,.24); cursor: pointer; transition: .2s; }
.drop-zone.drag, .drop-zone:hover { border-color: var(--red); background: rgba(165,59,43,.035); }
.drop-zone input { display: none; }
.upload-mark { font-size: 34px; color: var(--red); }
.drop-zone strong { font: 18px "STKaiti", "KaiTi", serif; }
.drop-zone small { color: var(--muted); }
.file-status { margin-top: 10px; padding: 10px 13px; background: #e7eee3; color: #506047; font-size: 12px; }
.settings-heading { margin-top: 38px; }
.preset-bar { margin: 25px 0 14px 53px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.preset-bar > span { color: var(--muted); font-size: 11px; margin-right: 4px; }
.preset { min-width: 0; border: 1px solid #c9c5b8; background: transparent; color: #6e6d65; padding: 6px; font-size: 11px; cursor: pointer; text-align: left; }
.preset b { display: block; padding: 7px 2px 2px; font-weight: 500; text-align: center; }
.preset.active { border-color: var(--red); background: rgba(165,59,43,.07); color: var(--red); }
.preset-preview { display: block; position: relative; height: 58px; overflow: hidden; border: 1px solid rgba(75,70,59,.12); background-color: #fbfaf5; }
.preset-preview::before { content: ""; position: absolute; inset: 0; opacity: .7; }
.preset-preview img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: fill; }
.preset-preview.homework::before { background: repeating-linear-gradient(to bottom, transparent 0 15px, #cdd4dc 16px); }
.preset-preview.notes::before { background: repeating-linear-gradient(to bottom, transparent 0 15px, #bfcbe0 16px); }
.preset-preview.notes { border-left: 5px solid #d8cdbc; }
.preset-preview.composition::before { background-image: linear-gradient(#e3a8a2 1px, transparent 1px), linear-gradient(90deg, #e3a8a2 1px, transparent 1px); background-size: 10% 33.333%; }
.preset-preview.student::before { background: repeating-linear-gradient(to bottom, transparent 0 17px, #d7d2c7 18px); }
.customize-settings { margin: 24px 0 0 53px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.customize-settings > summary { cursor: pointer; list-style: none; padding: 17px 2px; display: flex; align-items: center; color: var(--ink); font-size: 13px; }
.customize-settings > summary::-webkit-details-marker { display: none; }
.customize-settings > summary::after { content: "+"; margin-left: 13px; color: var(--red); font-size: 18px; }
.customize-settings[open] > summary::after { content: "−"; }
.customize-settings > summary small { margin-left: auto; color: var(--muted); font-size: 10px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 28px; margin: 26px 0 34px 53px; }
.settings-grid label, fieldset { min-width: 0; color: #66675f; font-size: 12px; border: 0; padding: 0; margin: 0; }
.settings-grid select { display: block; width: 100%; border: 0; border-bottom: 1px solid #aaa99e; background: transparent; padding: 9px 1px; color: var(--ink); outline: 0; }
.settings-grid output { float: right; color: var(--ink); }
input[type="range"] { display: block; width: 100%; accent-color: var(--red); margin-top: 11px; }
fieldset legend { margin-bottom: 10px; }
.swatches { display: flex; gap: 9px; }
.swatch { width: 28px; height: 28px; border: 6px solid var(--swatch); background: var(--swatch); border-radius: 50%; cursor: pointer; box-shadow: 0 0 0 1px transparent; }
.swatch.active { box-shadow: 0 0 0 2px var(--paper-light), 0 0 0 3px var(--ink); }
.paper-swatch { border: 1px solid #d5d0c3; background: var(--swatch); padding: 6px 10px; color: #6d695e; cursor: pointer; font-size: 11px; }
.paper-swatch.active { border-color: var(--red); color: var(--red); }
.advanced-settings { margin: -8px 0 25px 53px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.customize-settings .settings-grid { margin-left: 0; }
.customize-settings .advanced-settings { margin-left: 0; }
.advanced-settings summary { cursor: pointer; list-style: none; padding: 15px 2px; display: flex; justify-content: space-between; color: var(--ink); font-size: 13px; }
.advanced-settings summary::-webkit-details-marker { display: none; }
.advanced-settings summary::after { content: "+"; color: var(--red); font-size: 18px; }
.advanced-settings[open] summary::after { content: "−"; }
.advanced-settings summary small { color: var(--muted); margin-left: auto; margin-right: 13px; font-size: 10px; }
.advanced-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 28px; padding: 5px 2px 20px; }
.advanced-grid label { min-width: 0; color: #66675f; font-size: 11px; }
.advanced-grid output { float: right; color: var(--ink); }
.text-input, .seed-control input { width: 100%; border: 0; border-bottom: 1px solid #aaa99e; background: transparent; color: var(--ink); padding: 9px 1px; outline: 0; }
.seed-control { display: flex; gap: 6px; }.seed-control button { border: 1px solid #aaa99e; background: transparent; color: var(--red); white-space: nowrap; font-size: 10px; }
.advanced-grid .check-label { display: flex; align-items: center; gap: 8px; }.check-label input { accent-color: var(--red); }
.estimate-row { margin: 0 0 14px 53px; display: flex; justify-content: space-between; color: #8c8a81; font-size: 10px; }.estimate-row span:first-child { color: var(--red); }
.generate-button { width: calc(100% - 53px); margin-left: 53px; height: 59px; border: 0; background: var(--ink); color: #f6f0e3; display: flex; justify-content: center; align-items: center; gap: 26px; letter-spacing: 2px; cursor: pointer; transition: .2s; }
.generate-button:hover { background: var(--red); transform: translateY(-2px); }
.generate-button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.generate-button i { font-size: 23px; font-style: normal; }
.security-note { width: calc(100% - 53px); margin: 12px 0 0 53px; padding: 11px 14px; display: flex; align-items: flex-start; gap: 10px; border: 1px solid rgba(81,103,77,.2); background: rgba(232,238,225,.58); color: #667060; font-size: 10px; line-height: 1.65; }
.security-note p { margin: 0; }
.security-note strong { display: inline-block; margin-right: 7px; color: #475744; font-size: 11px; }
.security-note a { margin-left: 6px; color: var(--red); }
.security-icon { width: 18px; height: 18px; flex: 0 0 18px; display: grid; place-items: center; border-radius: 50%; background: #5f765a; color: #fff; font-size: 11px; line-height: 1; }
.error-message { margin: 12px 0 0 53px; color: #a83228; font-size: 12px; }

.preview-panel { min-width: 0; align-self: start; position: sticky; top: 20px; background: #e9e2d3; padding: 28px 36px 36px; display: flex; flex-direction: column; }
.preview-top { display: flex; justify-content: space-between; color: #6f7068; font-size: 12px; letter-spacing: 1px; margin-bottom: 20px; }
.empty-preview, .loading-preview, .result-preview { flex: 1; min-height: 590px; display: grid; place-items: center; position: relative; }
.empty-preview p { position: absolute; text-align: center; font: 20px/1.8 "STKaiti", "KaiTi", serif; color: #858278; }
.ink-circle { width: 190px; height: 190px; border: 1px solid rgba(74,72,65,.14); border-radius: 48% 52% 44% 56%; box-shadow: inset 10px 0 35px rgba(90,85,70,.04); }
.loading-preview { align-content: center; gap: 14px; color: #6c6b62; }
.loading-preview p { font: 20px "STKaiti", "KaiTi", serif; margin: 0; }
.loading-preview small { color: #99968d; }
.brush-loader { width: 65px; height: 4px; background: var(--red); animation: brush 1.2s ease-in-out infinite alternate; transform-origin: left; }
@keyframes brush { from { transform: scaleX(.12) rotate(-2deg); opacity: .3; } to { transform: scaleX(1) rotate(1deg); opacity: 1; } }
.result-preview img { display: block; max-width: 100%; max-height: 650px; box-shadow: 0 15px 38px rgba(53,47,35,.2); }
.page-arrow { position: absolute; top: 50%; width: 38px; height: 38px; border: 0; border-radius: 50%; background: rgba(34,35,31,.8); color: white; font-size: 27px; cursor: pointer; z-index: 2; }
.page-arrow.prev { left: -19px; }.page-arrow.next { right: -19px; }
.page-arrow:disabled { opacity: .2; cursor: default; }
.result-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 20px; }
.result-actions.compact { grid-template-columns: 1fr 1fr; }
.secondary-button, .primary-button { height: 46px; display: grid; place-items: center; text-decoration: none; font-size: 13px; cursor: pointer; }
.secondary-button { border: 1px solid var(--ink); background: transparent; color: var(--ink); }.primary-button { background: var(--red); color: white; }

.history-view { min-height: 500px; padding: 45px 5%; background: rgba(251,248,240,.7); border: 1px solid var(--line); }
.history-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-top: 35px; }
.history-card { background: #ece4d5; padding: 12px; transition: .2s; position: relative; }
.history-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.history-thumb { aspect-ratio: 1/1.18; overflow: hidden; background: #ddd4c2; cursor: pointer; }
.history-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.history-card h3 { font: 17px "STKaiti", "KaiTi", serif; margin: 14px 2px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-card p { color: var(--muted); margin: 0 2px; font-size: 10px; }
.delete-task { position: absolute; right: 17px; bottom: 14px; border: 0; background: none; color: #9b4e42; cursor: pointer; }
.empty-history { margin: 80px auto; color: var(--muted); font: 20px "STKaiti", "KaiTi", serif; text-align: center; }

.seo-guide { margin-top: 72px; padding: 68px 5%; background: rgba(251,248,240,.62); border: 1px solid var(--line); }
.guide-intro { max-width: 850px; }
.seo-guide h2 { margin: 0; font: 35px/1.35 "STKaiti", "KaiTi", serif; letter-spacing: 3px; }
.guide-intro > p:last-child { max-width: 780px; margin: 20px 0 0; color: var(--muted); font-size: 15px; line-height: 2; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 42px; }
.feature-grid article { min-height: 210px; padding: 30px; background: rgba(243,237,223,.78); border-top: 2px solid var(--red); }
.feature-grid article > span { color: var(--red); font: 12px Georgia, serif; letter-spacing: 2px; }
.feature-grid h3 { margin: 20px 0 12px; font: 21px "STKaiti", "KaiTi", serif; letter-spacing: 1px; }
.feature-grid p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.9; }
.how-to { display: grid; grid-template-columns: .75fr 1.25fr; gap: 60px; margin-top: 70px; padding-top: 55px; border-top: 1px solid var(--line); }
.how-to ol { margin: 0; padding: 0; list-style: none; counter-reset: guide-step; }
.how-to li { counter-increment: guide-step; display: grid; grid-template-columns: 34px 120px 1fr; gap: 14px; align-items: start; padding: 17px 0; border-bottom: 1px solid var(--line); }
.how-to li::before { content: "0" counter(guide-step); color: var(--red); font: 13px Georgia, serif; }
.how-to li b { font: 17px "STKaiti", "KaiTi", serif; }
.how-to li span { color: var(--muted); font-size: 13px; line-height: 1.8; }
.faq { max-width: 900px; margin-top: 70px; padding-top: 55px; border-top: 1px solid var(--line); }
.faq h2 { margin-bottom: 24px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 19px 4px; font: 17px "STKaiti", "KaiTi", serif; letter-spacing: 1px; }
.faq details p { margin: -2px 4px 20px; color: var(--muted); font-size: 13px; line-height: 1.9; }
footer { max-width: 1380px; margin: auto; border-top: 1px solid var(--line); padding: 28px 44px 36px; display: flex; justify-content: space-between; color: #89877d; font-size: 11px; letter-spacing: 1px; }
footer a { color: inherit; text-decoration: none; transition: color .2s; }
footer a:hover { color: var(--red); }
.footer-links { display: flex; gap: 16px; }
.toast { position: fixed; left: 50%; bottom: 35px; z-index: 30; transform: translate(-50%, 30px); padding: 11px 18px; background: #292a27; color: white; opacity: 0; pointer-events: none; transition: .25s; font-size: 12px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.hidden { display: none !important; }

@media (max-width: 980px) {
  .workspace { grid-template-columns: 1fr; }
  .editor-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .preview-panel { position: static; min-height: 720px; }
  .history-grid { grid-template-columns: repeat(3, 1fr); }
  .feature-grid { grid-template-columns: 1fr; }
  .feature-grid article { min-height: 0; }
  .how-to { grid-template-columns: 1fr; gap: 30px; }
}
@media (max-width: 680px) {
  .site-header { height: 72px; padding: 0 18px; }
  .brand-seal { width: 39px; height: 39px; font-size: 23px; }.brand b { font-size: 15px; letter-spacing: 1px; }.brand small { display: none; }
  nav { gap: 13px; }.nav-link, .guide-link { font-size: 12px; }.guide-link { display: none; }
  main { padding: 0 12px 112px; }
  .hero { min-height: 215px; padding: 25px 16px; }.hero h1 { font-size: 32px; letter-spacing: 3px; }.hero h1 small { font-size: .58em; letter-spacing: 2px; }.hero-desc { margin-top: 14px; font-size: 12px; line-height: 1.6; }.hero-note { display: none; }
  .editor-panel { padding: 31px 22px; }.preset-bar, .settings-grid, .advanced-settings, .estimate-row, .customize-settings { margin-left: 0; }.preset-bar { grid-template-columns: 1fr 1fr; }.settings-grid, .advanced-grid { grid-template-columns: 1fr; }.generate-button { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 25; width: auto; margin: 0; box-shadow: 0 10px 35px rgba(37,39,35,.28); }.security-note { width: 100%; margin-left: 0; }.error-message { margin-left: 0; }
  .customize-settings > summary small { display: none; }
  .preview-panel { padding: 25px 22px; min-height: 590px; }.empty-preview, .loading-preview, .result-preview { min-height: 450px; }
  .result-actions { grid-template-columns: 1fr; }
  .history-view { padding: 32px 20px; }.history-grid { grid-template-columns: repeat(2, 1fr); gap: 13px; }
  .seo-guide { margin-top: 36px; padding: 42px 22px; }.seo-guide h2 { font-size: 28px; }.feature-grid { margin-top: 30px; }.feature-grid article { padding: 25px; }.how-to, .faq { margin-top: 48px; padding-top: 38px; }.how-to li { grid-template-columns: 30px 1fr; }.how-to li span { grid-column: 2; }
  footer { padding: 24px 18px; flex-direction: column; gap: 7px; }
}

/* MINI PROGRAM PROMOTION */
:root { --wechat-green: #07c160; --wechat-green-dark: #059a4d; }
body.mini-program-dialog-open { overflow: hidden; }
.mini-program-ribbon { position: relative; display: grid; grid-template-columns: minmax(250px, .82fr) minmax(390px, 1.18fr) auto; align-items: center; gap: 22px; min-height: 118px; margin: 0 0 28px; padding: 22px 62px 22px 28px; overflow: hidden; color: #fff; background: #17352a; border: 1px solid rgba(7,193,96,.2); box-shadow: 0 14px 36px rgba(30,54,44,.12); }
.mini-program-ribbon::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 8% 0%, rgba(7,193,96,.22), transparent 34%), linear-gradient(115deg, transparent 52%, rgba(255,255,255,.04)); }
.mini-program-ribbon > * { position: relative; z-index: 1; }
.mini-program-ribbon-copy { display: flex; align-items: center; gap: 14px; }
.mini-program-ribbon-copy > div { min-width: 0; }
.mini-program-ribbon-code { flex: 0 0 74px; width: 74px; height: 74px; padding: 4px; object-fit: contain; background: #fff; border-radius: 10px; box-shadow: 0 6px 18px rgba(0,0,0,.16); }
.mini-program-ribbon-copy .mini-program-badge { margin-bottom: 8px; }
.mini-program-ribbon h2 { margin: 0 0 5px; font: 22px "STKaiti", "KaiTi", serif; letter-spacing: 1px; }
.mini-program-ribbon p { margin: 0; color: rgba(255,255,255,.68); font-size: 12px; line-height: 1.6; }
.mini-program-badge { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 25px; padding: 0 10px; color: #075c31; background: #dcf8e8; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: 1px; }
.wechat-search-strip { width: 100%; min-width: 0; min-height: 52px; display: flex; align-items: center; gap: 12px; padding: 8px 13px; border: 0; border-radius: 10px; color: #fff; background: var(--wechat-green); cursor: pointer; box-shadow: inset 0 -2px 0 rgba(0,0,0,.06); transition: transform .2s, background .2s, box-shadow .2s; }
.wechat-search-strip:hover { transform: translateY(-1px); background: #08b95d; box-shadow: 0 8px 20px rgba(7,193,96,.19), inset 0 -2px 0 rgba(0,0,0,.06); }
.wechat-search-strip:focus-visible, .mini-program-primary-action:focus-visible, .mini-program-ribbon-more:focus-visible, .mini-program-launcher:focus-visible, .mini-program-dialog-close:focus-visible, .mini-program-secondary-action:focus-visible { outline: 3px solid rgba(7,193,96,.34); outline-offset: 3px; }
.wechat-search-strip img { flex: 0 0 auto; width: 118px; height: auto; object-fit: contain; }
.wechat-search-query { min-width: 0; display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 11px; color: #25322d; background: #fff; border-radius: 7px; }
.wechat-search-query i { position: relative; flex: 0 0 auto; width: 12px; height: 12px; border: 2px solid #6f7b76; border-radius: 50%; }
.wechat-search-query i::after { content: ""; position: absolute; width: 6px; height: 2px; right: -5px; bottom: -2px; background: #6f7b76; transform: rotate(45deg); transform-origin: left center; border-radius: 2px; }
.wechat-search-query b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.wechat-search-benefit { flex: 0 0 auto; font-size: 12px; white-space: nowrap; }
.mini-program-ribbon-more { display: inline-flex; align-items: center; gap: 8px; padding: 11px 0; border: 0; color: #fff; background: transparent; cursor: pointer; white-space: nowrap; font-size: 12px; }
.mini-program-ribbon-more span { transition: transform .2s; }
.mini-program-ribbon-more:hover span { transform: translateX(4px); }
.mini-program-ribbon-close { position: absolute; top: 9px; right: 11px; z-index: 2; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; color: rgba(255,255,255,.62); background: transparent; cursor: pointer; font-size: 22px; line-height: 1; }
.mini-program-ribbon-close:hover { color: #fff; background: rgba(255,255,255,.08); }
.mini-program-launcher { position: fixed; right: 24px; bottom: 24px; z-index: 32; display: flex; align-items: center; gap: 11px; min-width: 172px; min-height: 58px; padding: 9px 16px 9px 11px; border: 1px solid rgba(255,255,255,.14); border-radius: 30px; color: #fff; background: #17352a; box-shadow: 0 16px 36px rgba(24,49,39,.28); cursor: pointer; transition: transform .2s, box-shadow .2s; }
.mini-program-launcher:hover { transform: translateY(-3px); box-shadow: 0 20px 42px rgba(24,49,39,.33); }
.mini-program-launcher > span:last-child { text-align: left; }
.mini-program-launcher b, .mini-program-launcher small { display: block; }
.mini-program-launcher b { font-size: 13px; letter-spacing: .5px; }
.mini-program-launcher small { margin-top: 3px; color: rgba(255,255,255,.62); font-size: 10px; }
.mini-program-launcher-icon { position: relative; width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; background: var(--wechat-green); }
.mini-program-launcher-icon i { position: absolute; display: block; background: #fff; border-radius: 50%; }
.mini-program-launcher-icon i:first-child { width: 18px; height: 15px; left: 7px; top: 8px; }
.mini-program-launcher-icon i:last-child { width: 15px; height: 13px; right: 6px; bottom: 7px; box-shadow: 0 0 0 2px var(--wechat-green); }
.mini-program-launcher-icon i::after { content: ""; position: absolute; left: 3px; bottom: -3px; border-width: 3px 3px 0 0; border-style: solid; border-color: #fff transparent transparent transparent; transform: rotate(18deg); }
.mini-program-modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px; }
.mini-program-modal-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: rgba(19,31,26,.58); backdrop-filter: blur(5px); cursor: default; }
.mini-program-dialog { position: relative; z-index: 1; width: min(700px, 100%); max-height: calc(100vh - 48px); overflow: auto; padding: 38px 38px 30px; background: #fffdf7; border: 1px solid rgba(55,57,51,.13); box-shadow: 0 30px 90px rgba(15,29,23,.32); animation: miniProgramDialogIn .26s ease both; }
@keyframes miniProgramDialogIn { from { opacity: 0; transform: translateY(15px) scale(.985); } }
.mini-program-dialog-handle { display: none; }
.mini-program-dialog-close { position: absolute; top: 15px; right: 16px; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; color: #64716c; background: #f1eee5; cursor: pointer; font-size: 23px; line-height: 1; }
.mini-program-dialog-heading { display: grid; grid-template-columns: 68px 1fr; gap: 18px; align-items: center; padding-right: 28px; }
.mini-program-dialog-icon { width: 68px; height: 68px; display: grid; place-items: center; color: #f6ead7; background: #a53b2b; font: 36px "STKaiti", "KaiTi", serif; box-shadow: inset 0 0 0 4px rgba(255,255,255,.16); transform: rotate(-2deg); }
.mini-program-dialog-heading .mini-program-badge { margin-bottom: 10px; }
.mini-program-dialog h2 { margin: 0 0 5px; font: 29px "STKaiti", "KaiTi", serif; letter-spacing: 1px; }
.mini-program-dialog-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.mini-program-benefits { display: grid; gap: 13px; margin: 28px 0; padding: 22px 24px; list-style: none; background: #f6f2e8; border: 1px solid rgba(55,57,51,.09); }
.mini-program-benefits li { display: flex; align-items: flex-start; gap: 10px; color: #4d514c; font-size: 13px; line-height: 1.55; }
.mini-program-benefits li span { flex: 0 0 20px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--wechat-green); font-size: 11px; }
.mini-program-entry-options { display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: 22px; align-items: stretch; }
.mini-program-code-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; padding: 13px; background: #f6f2e8; border: 1px solid rgba(55,57,51,.09); }
.mini-program-code-card > span, .mini-program-search-instruction > span { display: block; margin: 0 0 9px; color: #77776f; font-size: 11px; }
.mini-program-code-card > span { align-self: flex-start; margin-bottom: 0; }
.mini-program-code-card img { display: block; width: 166px; height: 166px; max-width: 100%; object-fit: contain; background: #fff; }
.mini-program-code-card b { color: #38423d; font-size: 12px; font-weight: 700; }
.mini-program-search-instruction { display: flex; min-width: 0; flex-direction: column; justify-content: center; }
.mini-program-search-instruction > p { margin: 10px 0 0; color: #8d918a; font-size: 11px; line-height: 1.6; }
.wechat-search-strip.large { min-height: 62px; padding: 10px 14px; }
.wechat-search-strip.large img { width: 130px; }
.wechat-search-strip.large .wechat-search-query { height: 38px; }
.mini-program-primary-action, .mini-program-secondary-action { width: 100%; min-height: 50px; border-radius: 0; cursor: pointer; font-weight: 700; }
.mini-program-primary-action { margin-top: 18px; border: 0; color: #fff; background: #17352a; }
.mini-program-primary-action:hover { background: #214b3b; }
.mini-program-secondary-action { margin-top: 8px; border: 0; color: #6d756f; background: transparent; font-weight: 400; }
.mini-program-secondary-action:hover { color: var(--ink); }
.mini-program-dialog-note { margin: 4px 0 0; color: #969991; text-align: center; font-size: 10px; line-height: 1.6; }

@media (max-width: 1100px) {
  .mini-program-ribbon { grid-template-columns: minmax(225px, .7fr) minmax(350px, 1.3fr); }
  .mini-program-ribbon-more { grid-column: 1 / -1; justify-self: end; margin-top: -12px; }
}
@media (max-width: 760px) {
  .mini-program-ribbon { grid-template-columns: 1fr; gap: 14px; min-height: 0; margin-bottom: 18px; padding: 21px 42px 21px 20px; }
  .mini-program-ribbon-copy { align-items: flex-start; }
  .mini-program-ribbon-code { display: none; }
  .mini-program-ribbon h2 { font-size: 20px; }
  .mini-program-ribbon-more { grid-column: auto; justify-self: start; margin: -4px 0 0; }
  .wechat-search-strip { gap: 9px; }
  .wechat-search-strip img { width: 104px; }
  .wechat-search-benefit { display: none; }
  .mini-program-launcher { right: 14px; bottom: 78px; min-width: 0; width: 52px; height: 52px; padding: 7px; border-radius: 50%; }
  .mini-program-launcher > span:last-child { display: none; }
  .mini-program-launcher-icon { width: 38px; height: 38px; }
  .mini-program-modal { align-items: end; padding: 0; }
  .mini-program-dialog { width: 100%; max-height: min(86vh, 720px); padding: 33px 22px 24px; border-radius: 24px 24px 0 0; animation-name: miniProgramSheetIn; }
  @keyframes miniProgramSheetIn { from { opacity: 0; transform: translateY(32px); } }
  .mini-program-dialog-handle { display: block; width: 58px; height: 5px; margin: -20px auto 22px; border-radius: 3px; background: #d6d6cf; }
  .mini-program-dialog-close { top: 17px; right: 17px; }
  .mini-program-dialog-heading { grid-template-columns: 54px 1fr; gap: 14px; padding-right: 22px; }
  .mini-program-dialog-icon { width: 54px; height: 54px; font-size: 29px; }
  .mini-program-dialog h2 { font-size: 24px; }
  .mini-program-benefits { margin: 22px 0; padding: 18px; }
  .mini-program-entry-options { grid-template-columns: 1fr; }
  .mini-program-code-card { display: none; }
  .wechat-search-strip.large { min-height: 56px; padding: 9px 10px; }
  .wechat-search-strip.large img { width: 104px; }
  .wechat-search-strip.large .wechat-search-query { height: 34px; padding: 0 9px; }
  .wechat-search-strip.large .wechat-search-query b { max-width: 132px; }
}
@media (max-width: 420px) {
  .mini-program-ribbon-copy { display: block; }
  .mini-program-ribbon-copy .mini-program-badge { margin-bottom: 10px; }
  .wechat-search-strip img, .wechat-search-strip.large img { width: 92px; }
  .wechat-search-query { padding: 0 8px; }
  .wechat-search-query b { max-width: 128px; }
  .wechat-search-strip.large .wechat-search-query b { max-width: 112px; }
}
@media (prefers-reduced-motion: reduce) {
  .mini-program-dialog, .mini-program-launcher, .wechat-search-strip { animation: none; transition: none; }
}
