:root {
  color: #1d2d28;
  background: #f4f0e8;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }
body { min-width: 320px; margin: 0; background: #f4f0e8; }
button, summary { font: inherit; }
button:focus-visible,
a:focus-visible,
summary:focus-visible { outline: 3px solid #bd8a37; outline-offset: 3px; }

#app {
  width: min(100%, 440px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 16px 142px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  gap: 16px;
}
.app-header--assigned { margin-bottom: 14px; }
.brand-title { margin: 0; color: #123f35; font-size: 20px; font-weight: 650; letter-spacing: -.02em; }
.header-action {
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: #52615c;
  font-size: 14px;
  font-weight: 600;
}
.header-action:disabled { color: #9a9f9c; }
.assignment-lock { margin: -8px 0 12px; color: #7a6b55; font-size: 11px; line-height: 1.45; text-align: right; }

.eyebrow { margin: 0; color: #8d6726; font-size: 12px; font-weight: 750; letter-spacing: .06em; }
h1 { margin: 5px 0 0; color: #123f35; font-size: clamp(28px, 8vw, 36px); line-height: 1.15; letter-spacing: -.04em; }
p { line-height: 1.65; }
.entry-lock {
  width: fit-content;
  margin: 12px 0 16px;
  color: #796039;
  font-size: 12px;
  font-weight: 650;
}

.empty-state,
.content-card {
  padding: 24px 20px;
  border: 1px solid rgb(18 63 53 / 10%);
  border-radius: 20px;
  background: #fffdf9;
}

.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.section-heading > div { display: flex; align-items: center; gap: 7px; }
.section-heading h3,
.section-heading--quiet h3 { margin: 0; font-size: 15px; font-weight: 650; }
.section-heading div > span { color: #a57628; font-size: 11px; font-weight: 750; }
.section-heading small { color: #6f7b76; font-size: 11px; line-height: 1.4; text-align: right; }
.section-heading--quiet { margin-bottom: 10px; color: #53625d; }

.package-list {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(250px, 88%);
  gap: 10px;
  max-width: 100%;
  margin-top: 14px;
  padding-bottom: 5px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline mandatory;
}
.package-option {
  min-height: 112px;
  padding: 15px;
  border: 1px solid #d9d2c6;
  border-radius: 16px;
  background: #fff;
  color: #17231f;
  text-align: left;
  scroll-snap-align: start;
}
.package-option.is-selected { border-color: #17614f; background: #f1f6f3; }
.package-option__label { display: block; margin-bottom: 8px; color: #946820; font-size: 12px; font-weight: 700; }
.package-option strong { display: block; line-height: 1.5; }

.content-sheet { min-width: 0; }
.cover-workbench { margin: 0; padding-bottom: 18px; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.cover-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cover-grid--selector { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cover-card {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgb(18 63 53 / 12%);
  border-radius: 16px;
  background: #fffdf9;
  scroll-snap-align: start;
}
.cover-card.is-selected { grid-column: 1 / -1; }
.cover-select {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}
.cover-card canvas { display: block; width: 100%; aspect-ratio: 3 / 4; background: #d9ddd9; }
.cover-card figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  gap: 8px;
  padding: 8px 10px;
}
.cover-card figcaption > span { min-width: 0; }
.cover-card strong,
.cover-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cover-card strong { color: #263a33; font-size: 12px; font-weight: 650; }
.cover-card small { margin-top: 2px; color: #776d60; font-size: 10px; }
.cover-grid--selector .cover-card:not(.is-selected) figcaption { display: block; min-height: 88px; padding: 8px 9px 6px; }
.cover-grid--selector .cover-card:not(.is-selected) strong { min-height: 31px; white-space: normal; line-height: 1.35; }
.cover-grid--selector .cover-card:not(.is-selected) small { display: none; }
.cover-grid--selector .cover-card:not(.is-selected) .text-button { display: block; width: 100%; min-height: 34px; padding: 2px 0 0; text-align: right; }
.cover-card.is-selected canvas { aspect-ratio: 3 / 4; }
.cover-card.is-recommended { border-color: rgb(181 133 50 / 50%); box-shadow: 0 5px 14px rgb(77 57 24 / 9%); }
.cover-recommendation {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin-bottom: 5px;
  padding: 0 7px;
  border-radius: 999px;
  background: #ead7ad;
  color: #76501d;
  font-size: 9px;
  font-style: normal;
  font-weight: 750;
}

.text-button {
  min-height: 40px;
  flex: 0 0 auto;
  padding: 0 6px;
  border: 0;
  background: transparent;
  color: #17614f;
  font-size: 12px;
  font-weight: 700;
}

.post-copy { padding: 18px 2px 18px; }
.content-meta { display: flex; flex-wrap: wrap; gap: 10px; color: #8a6a35; font-size: 11px; font-weight: 650; }
.selected-title {
  margin: 10px 0 0;
  color: #123f35;
  font-size: clamp(22px, 6.1vw, 25px);
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: -.035em;
}
.body-preview {
  display: -webkit-box;
  margin: 18px 0 0;
  overflow: hidden;
  color: #394943;
  font-size: 15px;
  line-height: 1.72;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.body-disclosure { margin-top: 6px; }
.body-disclosure > summary {
  width: fit-content;
  min-height: 40px;
  margin-left: auto;
  padding: 9px 0;
  color: #9b6c20;
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
  list-style: none;
}
.body-disclosure > summary::-webkit-details-marker,
.more-actions > summary::-webkit-details-marker { display: none; }
.body-copy { margin-top: 6px; color: #34453f; font-size: 15px; }
.body-copy p { margin: 0 0 12px; line-height: 1.72; }
.tag-list {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  padding-bottom: 4px;
  overflow-x: auto;
  color: #7c6642;
  font-size: 12px;
  white-space: nowrap;
}

.image-section { padding: 18px 2px 0; border-top: 1px solid #ddd5c8; }
.image-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 12px; }
.image-card { min-width: 0; margin: 0; overflow: hidden; border-radius: 14px; background: #fff; }
.image-card img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: #e7e3da; }
.image-card figcaption { display: flex; align-items: center; justify-content: space-between; min-height: 48px; gap: 4px; padding: 4px 7px 4px 9px; font-size: 11px; }

.publishing-panel {
  margin-top: 24px;
  padding: 20px 16px;
  border: 1px solid rgb(18 63 53 / 13%);
  border-radius: 20px;
  background: linear-gradient(155deg, #fffdf9 0%, #f1f5f1 100%);
  box-shadow: 0 12px 30px rgb(18 63 53 / 7%);
}
.field-label { display: block; margin: 13px 0 6px; color: #5f6d68; font-size: 11px; font-weight: 700; }
.field-control {
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid #d7d2c7;
  border-radius: 13px;
  background: rgb(255 255 255 / 88%);
  color: #1e302a;
  font: inherit;
  font-size: 14px;
}
.field-control:focus { border-color: #98702f; outline: 3px solid rgb(189 138 55 / 14%); }
.button--full { width: 100%; margin-top: 14px; }
.account-empty > strong { display: block; margin-top: 14px; color: #183d34; font-size: 16px; }
.account-empty > p { margin: 4px 0 12px; color: #6a7672; font-size: 12px; }
.account-review {
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 11px;
  background: #f4ead7;
  color: #7a581f;
  font-size: 12px;
}
.publication-state { display: grid; gap: 3px; margin-top: 14px; padding: 12px; border-radius: 12px; background: #edf2ef; color: #345047; font-size: 12px; }
.publication-state strong { color: #123f35; font-size: 14px; }
.publication-state--success { background: #e5f2e9; }
.submit-link-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.submit-link-row .button { min-height: 48px; border-radius: 13px; }

.status-message { min-height: 28px; padding: 7px 4px; color: #17614f; font-size: 12px; text-align: center; }
.app-launch-attempt { display: block; margin: 8px auto 96px; color: #17614f; font-size: 12px; text-align: center; text-underline-offset: 3px; }
.sticky-actions {
  position: fixed;
  z-index: 10;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  gap: 8px;
  width: min(100%, 440px);
  margin: 0 auto;
  padding: 12px 16px max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid rgb(18 63 53 / 10%);
  background: rgb(255 253 249 / 97%);
}
.button { display: flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 14px; border: 1px solid transparent; border-radius: 16px; font-weight: 700; text-decoration: none; }
.button--primary { background: #123f35; color: #fff; }
.button--publish { background: #ff2442; color: #fff; }
.button--secondary { border-color: #123f35; background: #fffdf9; color: #123f35; }
.button--quiet { background: #ebe5da; color: #40514b; }
.button:disabled,
.button.is-disabled { cursor: not-allowed; opacity: .46; }
.more-actions { position: relative; }
.more-actions > summary {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 50px;
  border: 1px solid #e2ddd4;
  border-radius: 16px;
  background: #fff;
  color: #5f6b67;
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  list-style: none;
}
.more-actions__menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  width: 196px;
  overflow: hidden;
  border: 1px solid #ded7ca;
  border-radius: 14px;
  background: #fffdf9;
  box-shadow: 0 14px 32px rgb(18 63 53 / 14%);
}
.more-actions__menu button,
.more-actions__menu a {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: #33423d;
  font-size: 13px;
  text-align: left;
  text-decoration: none;
}
.more-actions__menu > * + * { border-top: 1px solid #eee9df; }
.loading { padding: 48px 0; color: #52625c; text-align: center; }

@media (max-width: 390px) {
  #app { padding-inline: 12px; }
  .cover-grid--selector { gap: 8px; }
  .cover-card.is-selected { grid-column: 1 / -1; }
  .cover-grid--selector .cover-card:not(.is-selected) strong { font-size: 11px; }
  .sticky-actions { grid-template-columns: 1.1fr .9fr auto; padding-inline: 12px; }
  .button { padding-inline: 10px; font-size: 13px; }
}
