:root {
  color-scheme: light;
  --bg: #f3f6f8;
  --paper: #fff;
  --ink: #18252d;
  --muted: #53636d;
  --line: #dce4e9;
  --accent: #096851;
  --accent-hover: #075440;
  --accent-soft: #e7f5ef;
  --error: #9b2639;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.55; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.55rem, 3.5vw, 2.1rem); line-height: 1.25; overflow-wrap: anywhere; }
h2 { font-size: 1.08rem; }
small, .muted { color: var(--muted); }
a { color: var(--accent); }
input, button { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
:focus-visible { outline: 3px solid #248874; outline-offset: 3px; }
.container { width: min(1100px, 100% - 40px); margin-inline: auto; }
.topbar { background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar-inner { min-height: 64px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; }
.brand-icon { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--accent); color: white; font-size: 20px; line-height: 1; }
.brand-icon.big { width: 50px; height: 50px; font-size: 32px; border-radius: 15px; }
.page { padding-block: 32px 48px; display: grid; gap: 20px; }
.page-heading { padding-block: 4px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 6px 20px #213a4c08; }
.section { padding: 22px; min-width: 0; }
.stack { display: grid; align-content: start; gap: 12px; min-width: 0; }
.overview { display: grid; grid-template-columns: 1fr 1.14fr; gap: 20px; }
.overview > .stack { gap: 20px; }
.row-form, .actions, .share { display: flex; align-items: center; gap: 10px; }
.row-form > input:not([type=hidden]) { flex: 1; min-width: 0; }
.actions { flex-wrap: wrap; gap: 12px; }
.share-controls { flex: 1; }
.qr { display: block; flex: none; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.centered-qr { margin-inline: auto; }
.platform-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.platform-card { min-width: 0; padding: 12px; display: grid; gap: 2px; background: #f6f9fa; border: 1px solid var(--line); border-radius: 10px; overflow-wrap: anywhere; }
.platform-card strong { font-size: 1.1rem; }
input:not([type=hidden]) { width: 100%; border: 1px solid #c5d1d8; border-radius: 8px; padding: 10px 12px; color: var(--ink); background: var(--paper); }
input[readonly] { background: #f6f9fa; color: var(--muted); }
input[type=file] { padding: 12px; border-style: dashed; }
input[type=file]::file-selector-button { border: 0; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font: inherit; padding: 6px 10px; margin-right: 8px; cursor: pointer; }
.button { display: inline-flex; justify-content: center; align-items: center; border: 1px solid transparent; border-radius: 8px; min-height: 40px; padding: 8px 14px; text-decoration: none; font-weight: 650; white-space: nowrap; }
.primary { color: white; background: var(--accent); }
.primary:hover { background: var(--accent-hover); }
.secondary { background: var(--accent-soft); color: var(--accent); }
.secondary:hover { background: #d7eee5; }
.fit { justify-self: start; }
.quiet { padding: 2px; border: 0; background: transparent; color: var(--muted); }
.text-link { color: var(--accent); text-underline-offset: 3px; text-decoration: underline; font-weight: 600; }
.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 11px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-size: .83rem; font-weight: 650; background: #f6f9fa; }
tbody tr:last-child td { border-bottom: 0; }
.strong { font-weight: 650; }
.package-id { font-size: .83rem; }
.status { display: inline-block; padding: 3px 8px; border-radius: 8px; color: var(--muted); background: var(--bg); font-size: .8rem; }
.status.live { color: var(--accent); background: var(--accent-soft); }
.notice, .empty { border-radius: 9px; background: var(--bg); color: var(--muted); padding: 11px 13px; }
.notice.error { background: #fceef0; color: var(--error); }
.notice.success { background: var(--accent-soft); color: var(--accent); }
.centered { display: grid; min-height: 100vh; min-height: 100svh; place-items: center; padding: 22px; }
.compact { width: min(100%, 420px); padding: 28px; gap: 16px; }
.landing { text-align: center; }
.landing .brand-icon { justify-self: center; }
.landing form, .landing details { text-align: left; }
.landing .button { min-height: 48px; }
details { color: var(--muted); font-size: .9rem; }
details p { padding-top: 8px; }
summary { cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 850px) { .overview { grid-template-columns: 1fr; } }
@media (max-width: 460px) {
  .container { width: calc(100% - 24px); }
  .page { padding-top: 20px; }
  .section, .compact { padding: 16px; }
  .share { align-items: flex-start; flex-direction: column; }
  .share-controls { width: 100%; }
}

/* Admin refinements */
.admin-session { display: flex; gap: 20px; align-items: center; }
.page-description { margin-top: 10px; }
.platform-preview { font-size: .82rem; margin-top: 7px; }
.upload-feedback { display: grid; gap: 7px; }
.upload-feedback[hidden] { display: none; }
progress { width: 100%; height: 9px; accent-color: var(--accent); }
.package-id { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.share-controls .actions { gap: 12px 16px; }

/* Chat download page */
.download-body, .poster-body { background: #eff5f0; }
.download-shell { max-width: 1180px; margin: 0 auto; padding: 34px 44px 58px; }
.download-brand { display: flex; align-items: center; gap: 12px; font-size: 20px; color: #173b32; }
.download-brand strong { overflow-wrap: anywhere; }
.chat-mark { display: flex; flex: 0 0 auto; align-items: center; justify-content: center; gap: 4px; height: 40px; width: 40px; border-radius: 14px 14px 14px 4px; background: #116f57; }
.chat-mark i { display: block; height: 4px; width: 4px; border-radius: 50%; background: #fff; }
.download-layout { display: grid; grid-template-columns: 1.1fr 1fr; gap: 66px; align-items: center; margin-top: 72px; }
.download-copy h1, .share-poster h1 { font-size: clamp(34px, 4.8vw, 57px); line-height: 1.33; letter-spacing: -.045em; font-weight: 750; color: #193c32; }
.download-copy h1 em, .share-poster h1 em { font-style: normal; color: #137457; }
.download-description { margin-top: 23px; color: #50665b; font-size: 17px; line-height: 1.85; }
.chat-features { display: flex; flex-wrap: wrap; list-style: none; padding: 0; margin: 26px 0; gap: 10px 20px; font-size: 13px; color: #3c6354; }
.chat-features li { display: flex; align-items: center; gap: 7px; }
.chat-features li::before { content: ''; width: 5px; height: 5px; background: #5a9e7c; border-radius: 50%; }
.download-panel { border: 1px solid #d9e5db; padding: 20px; border-radius: 18px; background: #fff; max-width: 440px; }
.desktop-download { display: flex; gap: 18px; align-items: center; }
.desktop-download .qr { width: 116px; height: 116px; }
.desktop-download .muted { font-size: 13px; }
.release-meta { color: #5c6f63; font-size: 13px; }
.download-action { width: 100%; min-height: 49px; justify-content: space-between; padding-inline: 19px; border-radius: 11px; font-size: 16px; }
.download-action span { font-size: 22px; }
.download-hint { font-size: 12px; }
.platform-switch { display: flex; gap: 9px; padding-top: 13px; border-top: 1px solid #e9eee9; }
.platform-switch a { flex: 1; border-radius: 8px; padding: 8px 11px; color: #53695f; text-align: center; text-decoration: none; font-size: 13px; }
.platform-switch a:hover { background: #f1f6f2; }
.platform-switch a[aria-current=page] { background: #eaf5ee; color: #096851; font-weight: 650; }
.platform-switch span { margin-left: 7px; font-size: 11px; }
.chat-visual { position: relative; min-width: 0; display: flex; justify-content: center; padding: 23px 0 40px; }
.chat-orbit { position: absolute; width: 440px; height: 440px; max-width: 115%; top: 60px; border-radius: 50%; background: #d9eadd; }
.floating-note { position: absolute; z-index: 2; right: -5px; top: -5px; background: #f7e5ba; color: #69583e; padding: 13px 21px; border-radius: 18px 18px 18px 4px; transform: rotate(5deg); font-size: 14px; box-shadow: 0 10px 25px #2848390c; }
.chat-phone { position: relative; z-index: 1; width: 360px; max-width: 100%; flex-shrink: 0; border: 7px solid #161616; border-radius: 17% / 8%; overflow: hidden; background: #ededed; box-shadow: 0 32px 65px #24422d20, 0 0 0 1px #777; }
.actual-chat-screen { position: relative; width: 100%; aspect-ratio: 696 / 1516; overflow: hidden; border-radius: 16.6% / 7.6%; background: #ededed; }
.actual-chat-image { position: absolute; display: block; width: 118.1034482759%; height: auto; max-width: none; left: -8.4770114943%; top: -8.5751978892%; }
.points-note { margin-top: 8px; color: #6f7d72; font-size: 12px; line-height: 1.6; }
.visual-caption { position: absolute; bottom: -4px; font-size: 13px; color: #5e7866; letter-spacing: .12em; }

/* Download poster */
.poster-body { padding: 26px; }
.poster-toolbar { max-width: 600px; margin: 0 auto 20px; display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 14px; }
.poster-toolbar [data-poster-status] { width: 100%; font-size: 13px; }
.poster-toolbar [data-poster-status]:empty { display: none; }
.share-poster { position: relative; width: min(100%, 600px); margin-inline: auto; background: #f1f5ec; border: 1px solid #dce5d8; border-radius: 24px; padding: 38px 38px 26px; overflow: hidden; box-shadow: 0 20px 60px #2a453315; }
.share-poster .download-brand { font-size: 20px; margin-bottom: 30px; }
.share-poster h1 { font-size: clamp(28px, 5vw, 45px); }
.poster-description { color: #607466; margin-top: 17px; font-size: 15px; line-height: 1.8; }
.poster-chat { display: flex; justify-content: center; margin: 22px 0 25px; position: relative; }
.poster-chat::before { content: ''; position: absolute; inset: 30px 0 0; border-radius: 50%; background: #dbe9d4; }
.poster-chat .chat-phone { width: 380px; transform: none; }
.poster-footer { position: relative; display: flex; gap: 20px; align-items: center; justify-content: space-between; border-top: 1px solid #cddfcf; padding-top: 22px; }
.poster-footer strong { font-size: 13px; font-weight: 600; color: #496450; }
.poster-footer p { font-size: 20px; color: #244d38; margin: 10px 0 4px; overflow-wrap: anywhere; }
.poster-footer small { font-size: 11px; }
.poster-footer > div { min-width: 0; }
.poster-footer .qr { width: 120px; height: 120px; }
@media (max-width: 900px) {
  .download-shell { padding-inline: 28px; }
  .download-layout { gap: 25px; margin-top: 46px; }
  .download-copy h1 { font-size: 37px; }
  .chat-phone { width: 330px; }
  .floating-note { right: 0; font-size: 12px; }
}
@media (max-width: 680px) {
  .download-shell { padding: 22px 22px 42px; }
  .download-brand { font-size: 18px; }
  .download-layout { grid-template-columns: 1fr; gap: 36px; margin-top: 35px; }
  .download-copy h1 { font-size: clamp(32px, 8.8vw, 44px); }
  .download-description { font-size: 15px; margin-top: 18px; }
  .chat-features { margin: 21px 0; }
  .download-panel { max-width: none; padding: 18px; }
  .chat-visual { padding-top: 25px; }
  .chat-orbit { max-width: 100%; height: 350px; }
  .floating-note { right: 6px; }
  .poster-body { padding: 16px; }
  .share-poster { padding: 24px 22px; }
  .share-poster .download-brand { margin-bottom: 24px; font-size: 17px; }
  .poster-footer { gap: 12px; }
  .poster-footer p { font-size: 16px; }
  .poster-footer strong { font-size: 11px; }
  .poster-footer .qr { width: 96px; height: 96px; }
  .row-form { flex-wrap: wrap; }
  .row-form input { flex-basis: 200px; }
}
@media print {
  @page { size: A4; margin: 10mm; }
  .poster-body { padding: 0; background: #fff; }
  .poster-toolbar { display: none; }
  .share-poster { box-shadow: none; break-inside: avoid; width: 165mm; max-width: none; margin: auto; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .poster-chat .chat-phone { width: 270px; transform: none; }
}

.poster-footer strong { display: block; line-height: 1.8; }
@media print { .share-poster { width: 155mm; } }

/* Project and release management */
.heading-actions { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px 20px; }
.heading-actions .danger-link { flex: none; font-size: 14px; }
.danger-link { color: var(--error); }
.danger-link:hover { color: #78182b; }
.button.danger { background: #a22c3d; color: #fff; }
.button.danger:hover { background: #862032; }
.button.danger:disabled { cursor: not-allowed; }
.status.expired { background: #fceef0; color: var(--error); }
.platform-card .status { justify-self: start; margin-top: 4px; }
.platform-unpublish { font-size: .82rem; margin-top: 6px; }
.version-actions { flex-wrap: nowrap; gap: 15px; }
.delete-project-card { border-color: #e9c9cf; }
.delete-project-card h2, .confirm-project-name { overflow-wrap: anywhere; }
.delete-summary { display: grid; gap: 12px; margin: 4px 0; }
.delete-summary > div { display: grid; gap: 3px; }
.delete-summary dt { color: var(--muted); font-size: 13px; }
.delete-summary dd { margin: 0; overflow-wrap: anywhere; }
.delete-summary code { font-size: 13px; }
.delete-project-form { max-width: 720px; margin-top: 5px; }
.delete-project-form .actions { margin-top: 5px; }
@media (max-width: 460px) {
  .delete-project-form .button { width: 100%; white-space: normal; }
  .admin-session { gap: 10px; font-size: 13px; }
}
