:root {
  color-scheme: light;
  --ink: #17201d;
  --muted: #748078;
  --line: #e6ebe7;
  --panel: #ffffff;
  --soft: #f4f7f4;
  --green: #1aad19;
  --green-dark: #11880f;
  --wechat-blue: #576b95;
  --shadow: 0 28px 80px rgba(22, 43, 31, 0.09);
}

* { box-sizing: border-box; }

html { min-width: 320px; background: #edf3ee; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(circle at 8% 3%, rgba(150, 222, 167, .26), transparent 28rem),
    radial-gradient(circle at 94% 100%, rgba(197, 226, 201, .36), transparent 32rem),
    #f4f7f4;
}

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

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 12px clamp(20px, 4vw, 64px);
  border-bottom: 1px solid rgba(218, 227, 220, .82);
  background: rgba(250, 252, 250, .82);
  backdrop-filter: blur(18px);
}

.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); font-weight: 760; text-decoration: none; }
.brand-mark { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; color: white; background: linear-gradient(145deg, #38c837, #0b9e13); box-shadow: 0 9px 24px rgba(26, 173, 25, .26); }
.top-actions { display: flex; gap: 10px; }

.btn {
  border: 0;
  border-radius: 12px;
  padding: 11px 17px;
  color: var(--ink);
  font-weight: 700;
  background: white;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { color: white; background: var(--green); box-shadow: 0 10px 24px rgba(26, 173, 25, .2); }
.btn-primary:hover { background: var(--green-dark); }
.btn-dark { color: white; background: #1d2823; }
.btn-ghost { border: 1px solid var(--line); background: rgba(255,255,255,.8); }
.btn-large { min-height: 49px; padding-inline: 22px; }

.app-shell {
  display: grid;
  grid-template-columns: minmax(420px, .9fr) minmax(540px, 1.1fr);
  gap: 24px;
  width: min(1480px, calc(100% - 40px));
  margin: 32px auto 54px;
}

.editor-panel, .preview-panel { border: 1px solid rgba(223, 230, 224, .9); border-radius: 26px; background: rgba(255,255,255,.92); box-shadow: var(--shadow); }
.editor-panel { padding: clamp(24px, 3vw, 38px); }
.preview-panel { padding: clamp(20px, 2.5vw, 32px); overflow: hidden; }

.panel-heading, .preview-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.eyebrow { margin: 0 0 7px; color: var(--green-dark); font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1, h2 { margin: 0; letter-spacing: -.035em; }
h1 { font-size: clamp(25px, 3vw, 37px); line-height: 1.15; }
h2 { font-size: 25px; }
.subcopy { max-width: 520px; margin: 12px 0 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
.status-pill { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 8px 10px; border-radius: 999px; color: #58705e; font-size: 11px; background: var(--soft); }
.status-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(26,173,25,.1); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 30px; }
.field { display: grid; gap: 8px; }
.field-wide { grid-column: 1 / -1; }
.field > span { display: flex; justify-content: space-between; color: #4f5e55; font-size: 13px; font-weight: 760; }
.field b { color: #9ca59f; font-size: 11px; font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  color: var(--ink);
  background: #fbfcfb;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.field input, .field select { height: 47px; padding: 0 14px; }
.field textarea { min-height: 126px; resize: vertical; padding: 13px 14px; line-height: 1.7; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: rgba(26,173,25,.62); box-shadow: 0 0 0 4px rgba(26,173,25,.08); }

.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.upload-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 78px; padding: 14px; border: 1px dashed #d2dcd4; border-radius: 15px; background: #fafcf9; }
.upload-card strong, .upload-card small { display: block; }
.upload-card strong { margin-bottom: 5px; font-size: 13px; }
.upload-card small { color: var(--muted); font-size: 11px; }
.upload-button { flex: none; padding: 9px 11px; border-radius: 9px; color: var(--green-dark); font-size: 12px; font-weight: 800; background: #eaf7eb; cursor: pointer; }

.editor-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.notice { display: flex; gap: 10px; margin-top: 22px; padding: 14px 15px; border-radius: 14px; color: #677269; background: #f5f7f5; }
.notice > span { display: grid; flex: none; width: 19px; height: 19px; place-items: center; border: 1px solid #aab5ad; border-radius: 50%; font-size: 11px; font-weight: 800; }
.notice p { margin: 0; font-size: 11px; line-height: 1.7; }

.size-switch { display: flex; padding: 3px; border-radius: 10px; background: #edf2ee; }
.size-switch button { border: 0; border-radius: 8px; padding: 7px 11px; color: #718078; font-size: 11px; font-weight: 760; background: transparent; }
.size-switch button.active { color: #314238; background: white; box-shadow: 0 2px 10px rgba(38, 52, 44, .08); }

.phone-stage { display: grid; min-height: 570px; margin-top: 24px; padding: clamp(15px, 3vw, 34px); place-items: start center; border-radius: 22px; background: linear-gradient(145deg, #e8ede8, #f2f4f1); overflow: auto; }
.moment-card { position: relative; display: grid; grid-template-columns: 54px 1fr; gap: 14px; width: min(100%, 720px); min-height: 390px; padding: 34px 31px 44px; color: #151515; background: #fff; box-shadow: 0 18px 55px rgba(20, 34, 26, .11); transform-origin: top center; transition: width .25s ease; }
.phone-stage.mobile .moment-card { width: 390px; max-width: 100%; }
.moment-avatar { width: 54px; height: 54px; border-radius: 7px; object-fit: cover; background: #e7ebe7; }
.moment-main { min-width: 0; }
.moment-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.moment-name { color: var(--wechat-blue); font-size: 18px; font-weight: 680; line-height: 1.4; }
.moment-time { flex: none; color: #a4a6a4; font-size: 13px; }
.moment-copy { margin: 8px 0 13px; white-space: pre-wrap; word-break: break-word; font-size: 18px; line-height: 1.58; }
.moment-images { display: grid; gap: 4px; width: min(100%, 486px); }
.moment-images.count-1 { grid-template-columns: minmax(0, 330px); }
.moment-images.count-2, .moment-images.count-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.moment-images:not(.count-1):not(.count-2):not(.count-4) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.moment-images img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: #edf0ed; }
.moment-images.count-1 img { aspect-ratio: 4 / 5; }
.moment-footer { display: flex; align-items: center; justify-content: space-between; width: min(100%, 486px); margin-top: 12px; color: #a0a3a0; font-size: 12px; }
.moment-footer button { display: grid; width: 34px; height: 23px; place-items: center; border: 0; border-radius: 3px; color: #53688e; font-weight: 900; letter-spacing: 1px; background: #f1f3f5; }
.watermark { position: absolute; right: 14px; bottom: 12px; color: #b6bcb8; font-size: 10px; letter-spacing: .05em; }
.network-tip { margin: 13px 4px 0; color: #8b9690; font-size: 11px; text-align: center; }

.toast { position: fixed; z-index: 50; left: 50%; bottom: 30px; padding: 11px 16px; border-radius: 999px; color: white; font-size: 13px; font-weight: 700; background: rgba(25, 33, 29, .92); box-shadow: 0 10px 30px rgba(0,0,0,.18); opacity: 0; pointer-events: none; transform: translate(-50%, 14px); transition: opacity .2s ease, transform .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1030px) {
  .app-shell { grid-template-columns: 1fr; width: min(820px, calc(100% - 28px)); }
  .preview-panel { min-height: auto; }
}

@media (max-width: 640px) {
  .topbar { min-height: 62px; padding: 10px 14px; }
  .brand span:last-child { display: none; }
  .top-actions .btn-ghost { display: none; }
  .top-actions .btn { padding: 10px 12px; font-size: 12px; }
  .app-shell { width: calc(100% - 20px); margin-top: 14px; }
  .editor-panel, .preview-panel { border-radius: 20px; }
  .panel-heading { display: block; }
  .status-pill { margin-top: 14px; }
  .form-grid, .upload-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .phone-stage { min-height: 480px; padding: 10px; }
  .moment-card { grid-template-columns: 43px 1fr; gap: 11px; padding: 22px 17px 38px; }
  .moment-avatar { width: 43px; height: 43px; }
  .moment-name, .moment-copy { font-size: 15px; }
  .moment-time { font-size: 11px; }
}
