:root {
  color-scheme: light;
  --ink: #1f2a2e;
  --muted: #697579;
  --line: #dde4e1;
  --paper: #f7f5ef;
  --panel: #ffffff;
  --soft: #edf4f0;
  --accent: #2f7768;
  --accent-strong: #1f6659;
  --gold: #b08b48;
  --danger: #a33f35;
  --shadow: 0 20px 80px rgba(37, 47, 43, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 12%, rgba(47, 119, 104, 0.16), transparent 34%),
    linear-gradient(145deg, #f0f4ef 0%, #f8f5ed 50%, #e7efee 100%);
  font-family:
    "PingFang SC",
    "Microsoft YaHei",
    "Noto Sans CJK SC",
    system-ui,
    sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.phone {
  width: min(100%, 430px);
  min-height: min(860px, calc(100vh - 48px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid rgba(31, 42, 46, 0.08);
  border-radius: 28px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 22px 16px;
  background: rgba(247, 245, 239, 0.92);
  border-bottom: 1px solid rgba(221, 228, 225, 0.8);
  backdrop-filter: blur(16px);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 26px;
  line-height: 1.16;
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
}

h3 {
  margin-bottom: 8px;
  font-size: 17px;
}

.icon-button,
.ghost-button,
.small-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
}

.icon-button {
  min-width: 58px;
  height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

.tabbar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 14px 18px 6px;
}

.tab {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.tab.is-active {
  border-color: rgba(47, 119, 104, 0.24);
  background: #ffffff;
  color: var(--accent-strong);
  box-shadow: 0 8px 24px rgba(31, 102, 89, 0.1);
}

.view {
  display: none;
  padding: 16px 18px 24px;
}

.view.is-active {
  display: block;
}

.stack {
  display: grid;
  gap: 14px;
}

.section {
  padding: 18px;
  border: 1px solid rgba(221, 228, 225, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.section.unframed {
  padding: 6px 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.muted {
  color: var(--muted);
}

.date-line {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.city-card,
.framework-active-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
}

.city-actions {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.city-title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 800;
}

.city-meta,
.weather-line,
.copy-preview {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.weather-pill,
.audience-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(47, 119, 104, 0.18);
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.page-footer {
  padding: 12px 18px 20px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.page-footer a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  background: var(--accent-strong);
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 14px 32px rgba(31, 102, 89, 0.22);
}

.ghost-button {
  min-height: 38px;
  padding: 0 13px;
  font-size: 13px;
  font-weight: 700;
}

.small-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
}

.framework-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scrollbar-width: none;
}

.framework-strip::-webkit-scrollbar {
  display: none;
}

.mode-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px 72px;
  align-items: stretch;
  gap: 8px;
  overflow: visible;
  padding: 0;
}

.audience-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: visible;
  padding: 0;
}

.audience-strip .framework-chip {
  min-width: 0;
}

.audience-strip .framework-chip:first-child {
  grid-column: 1 / -1;
}

.audience-strip .common-pack-chip {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #ffffff 0%, #f2f8f5 100%);
}

.framework-chip {
  min-width: 124px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  text-align: left;
}

.content-mode-chip.is-primary {
  min-width: 0;
}

.content-mode-chip.is-backup {
  min-width: 0;
  padding: 8px 9px;
  opacity: 0.72;
  background: rgba(255, 255, 255, 0.74);
}

.content-mode-chip.is-backup strong {
  font-size: 13px;
  margin-bottom: 2px;
}

.content-mode-chip.is-backup span {
  font-size: 11px;
}

.content-mode-chip.is-backup.is-active {
  opacity: 1;
}

.framework-chip.is-active {
  border-color: rgba(31, 102, 89, 0.6);
  box-shadow: inset 0 0 0 1px rgba(31, 102, 89, 0.2);
}

.framework-chip strong {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
}

.framework-chip span {
  color: var(--muted);
  font-size: 12px;
}

.framework-groups {
  display: grid;
  gap: 14px;
}

.framework-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.framework-preview-list {
  display: grid;
  gap: 14px;
}

.framework-preview-list.compact-list {
  gap: 8px;
  margin: 10px 0;
}

.framework-preview-list.compact-list .framework-preview-head {
  min-height: auto;
  padding: 10px 12px;
}

.framework-preview-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
}

.framework-preview-card.is-active {
  border-color: rgba(31, 102, 89, 0.58);
  box-shadow: inset 0 0 0 1px rgba(31, 102, 89, 0.18);
}

.framework-card {
  min-height: 118px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  text-align: left;
}

.framework-preview-head {
  width: 100%;
  min-height: 96px;
  border: 0;
  border-radius: 0;
  background: #ffffff;
}

.framework-card.is-active {
  border-color: rgba(31, 102, 89, 0.6);
  box-shadow: inset 0 0 0 1px rgba(31, 102, 89, 0.22);
}

.framework-card strong {
  font-size: 16px;
}

.framework-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.framework-preview-images {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.preview-thumb {
  overflow: hidden;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #eef2ef;
}

.preview-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.result-grid {
  display: grid;
  gap: 14px;
}

.weather-insight-line {
  margin-top: 6px;
  color: #1f6659;
  font-weight: 700;
}

.daily-pack-page {
  padding-bottom: 8px;
}

.daily-pack-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.daily-pack-page-head h2 {
  margin: 4px 0 4px;
  font-size: 24px;
}

.daily-pack-page-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.daily-pack-large-list {
  display: grid;
  gap: 18px;
}

.daily-pack-city-block {
  display: grid;
  gap: 12px;
}

.daily-pack-city-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px;
}

.daily-pack-city-title strong {
  display: block;
  font-size: 20px;
}

.daily-pack-city-title span {
  color: var(--muted);
  font-size: 12px;
}

.daily-pack-section {
  display: grid;
  gap: 12px;
}

.daily-pack-list {
  display: grid;
  gap: 10px;
}

.daily-pack-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
}

.daily-pack-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.daily-pack-head strong {
  display: block;
  margin-bottom: 3px;
  font-size: 17px;
}

.daily-pack-head span,
.daily-pack-head em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.daily-pack-thumbs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.daily-pack-thumb {
  overflow: hidden;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: #eef2ef;
}

.daily-pack-thumb img,
.daily-pack-thumb-skeleton {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.daily-pack-thumb-skeleton {
  border-radius: 10px;
  background: linear-gradient(135deg, #edf2ef, #f8f2e8 52%, #e7eee8);
}

.image-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
}

.image-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #eef2ef;
}

.image-card-loading {
  border-style: dashed;
  background: rgba(255, 255, 255, 0.82);
}

.image-skeleton {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, #edf2ef, #f8f2e8 52%, #e7eee8);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.image-card-body {
  padding: 13px;
}

.image-card-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(176, 139, 72, 0.12);
  color: #7f612c;
  font-size: 12px;
  font-weight: 800;
}

.empty {
  display: grid;
  gap: 14px;
  padding: 28px 18px;
  text-align: center;
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  place-items: end center;
  padding: 18px;
  background: rgba(21, 29, 31, 0.4);
}

.sheet.is-open {
  display: grid;
}

.sheet-panel {
  width: min(100%, 430px);
  max-height: min(86vh, 780px);
  overflow: auto;
  padding: 20px;
  border-radius: 24px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 14px;
  font-weight: 800;
}

.field small {
  color: var(--muted);
  font-size: 12px;
}

input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 13px;
  outline: none;
}

input:focus {
  border-color: rgba(31, 102, 89, 0.6);
  box-shadow: 0 0 0 3px rgba(31, 102, 89, 0.1);
}

.quick-city-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-city {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  font-size: 13px;
  font-weight: 700;
}

.preview-image {
  width: 100%;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 16px 44px rgba(31, 42, 46, 0.18);
  -webkit-touch-callout: default;
  user-select: auto;
}

.save-hint {
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid rgba(47, 119, 104, 0.16);
  border-radius: 12px;
  background: var(--soft);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.preview-copy {
  margin: 16px 0 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.7;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.gallery-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
}

.gallery-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #eef2ef;
}

.gallery-card-body {
  display: grid;
  gap: 4px;
  padding: 9px;
}

.gallery-card-body strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-card-body span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-more {
  margin-top: 14px;
}

.material-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.material-stat-card {
  display: grid;
  gap: 3px;
  min-height: 72px;
  padding: 12px 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  text-align: center;
}

.material-stat-card strong {
  font-size: 20px;
  line-height: 1.1;
}

.material-stat-card span {
  color: var(--muted);
  font-size: 12px;
}

.material-rule-list,
.material-direction-list {
  display: grid;
  gap: 10px;
}

.material-rule-list p {
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(221, 228, 225, 0.9);
  border-radius: 12px;
  background: #ffffff;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.material-direction-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
}

.material-direction-card .framework-preview-head {
  min-height: auto;
  padding: 0;
}

.material-task-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.material-task-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
}

.material-task-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.material-task-head strong {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
}

.material-task-head span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.material-prompt {
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(31, 102, 89, 0.14);
  border-radius: 12px;
  background: #f8fbf8;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.65;
}

.material-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.material-weather-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
}

.material-weather-cell {
  display: grid;
  gap: 2px;
  padding: 9px 6px;
  background: #f8fbf8;
  text-align: center;
}

.material-weather-cell strong {
  font-size: 12px;
}

.material-weather-cell small {
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 700;
}

.material-weather-cell.is-short {
  background: #fff8ef;
}

.material-weather-cell.is-short small {
  color: #9a5c19;
}

.material-notice {
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid rgba(176, 139, 72, 0.24);
  border-radius: 12px;
  background: rgba(176, 139, 72, 0.08);
}

.toast {
  position: sticky;
  top: 86px;
  z-index: 20;
  display: none;
  width: calc(100% - 36px);
  margin: 0 auto;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(31, 42, 46, 0.92);
  color: #ffffff;
  text-align: center;
  font-size: 13px;
}

.toast.is-open {
  display: block;
}

@media (max-width: 520px) {
  .app-shell {
    padding: 0;
  }

  .phone {
    width: 100%;
    min-height: 100vh;
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  .sheet {
    padding: 0;
  }

  .sheet-panel {
    border-radius: 24px 24px 0 0;
  }
}
