:root {
  --page: #f3f5f5;
  --surface: #ffffff;
  --surface-2: #edf2f1;
  --ink: #162128;
  --muted: #68777d;
  --faint: #9eacae;
  --line: #e2e8e7;
  --brand: #0d5a61;
  --brand-deep: #0a3f45;
  --brand-soft: #dcecea;
  --accent: #e25e69;
  --accent-soft: #fbe8e8;
  --warm: #d99a4e;
  --warm-soft: #faeeda;
  --green: #27846b;
  --green-soft: #dff0e8;
  --blue: #3978a8;
  --blue-soft: #e2eef7;
  --purple: #7a5c9e;
  --purple-soft: #efe8f6;
  --shadow: 0 10px 24px rgba(24, 48, 52, 0.08);
  --radius: 8px;
  --nav-height: 58px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: #dfe7e7;
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

input,
select,
textarea {
  font-size: 16px;
}

button,
a,
.chip,
.segment,
.quick,
.tab {
  touch-action: manipulation;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
}

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

img {
  max-width: 100%;
  display: block;
}

.app {
  max-width: 500px;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--page);
  position: relative;
  box-shadow: 0 0 0 1px rgba(24, 48, 52, 0.06);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: calc(56px + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  gap: 10px;
  padding: env(safe-area-inset-top, 0px) 14px 0;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(20, 46, 51, 0.02), 0 5px 18px rgba(20, 46, 51, 0.04);
}

.topbar .title {
  min-width: 0;
  flex: 1;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar .store-kicker {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.2;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background: transparent;
  flex: 0 0 auto;
}

.icon-btn:active {
  background: var(--surface-2);
}

.icon-btn svg,
.btn svg,
.chip svg,
.quick svg,
.tab svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.8;
}

.main {
  padding: 12px 12px calc(var(--nav-height) + 34px);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(24, 48, 52, 0.03), 0 6px 16px rgba(24, 48, 52, 0.035);
}

.section {
  margin-top: 14px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 2px 9px;
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
}

.section-title svg {
  width: 15px;
  height: 15px;
  vertical-align: -2px;
  color: var(--accent);
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 2px;
}

.link-btn svg {
  width: 15px;
  height: 15px;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.grow {
  flex: 1;
  min-width: 0;
}

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

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

.grid-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}

.quick {
  min-height: 78px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(218, 229, 227, 0.92);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 2px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(30, 60, 64, 0.035);
}

.quick .q-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quick:active,
.list-row:active,
.copy-card:active {
  opacity: 0.82;
}

.hero-band {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand-deep), #155d62 62%, #236f68);
  color: #fff;
  padding: 15px;
  min-height: 116px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hero-title {
  position: relative;
  z-index: 1;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.35;
  max-width: 82%;
}

.hero-sub {
  position: relative;
  z-index: 1;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.76);
  margin-top: 3px;
  line-height: 1.5;
}

.hero-action {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  margin-top: 11px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--brand-deep);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.hero-action svg {
  width: 15px;
  height: 15px;
}

.welcome-panel {
  position: relative;
  overflow: hidden;
  padding: 15px;
  background: linear-gradient(145deg, #ffffff 0%, #f0f8f5 72%, #f6f0e9 130%);
}

.welcome-panel::before {
  content: "";
  position: absolute;
  right: -34px;
  top: -74px;
  width: 180px;
  height: 180px;
  transform: rotate(28deg);
  background: rgba(225, 238, 233, 0.82);
}

.welcome-top,
.welcome-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-entry {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
  color: var(--ink);
  padding: 0;
}

.profile-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.72), 0 2px 8px rgba(30, 50, 55, 0.14);
}

.profile-avatar-lg {
  width: 46px;
  height: 46px;
  font-size: 18px;
}

.profile-text {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-text strong {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.profile-text small {
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.date-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.date-chip svg {
  color: var(--brand);
}

.welcome-greeting {
  position: relative;
  z-index: 1;
  margin-top: 16px;
}

.welcome-greeting h1 {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.35;
  color: var(--brand-deep);
}

.welcome-greeting p {
  margin: 7px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

.welcome-foot {
  margin-top: 14px;
}

.welcome-panel .hero-action {
  margin-top: 0;
}

.welcome-summary {
  flex: 1;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  text-align: right;
}

.metric-tile {
  padding: 11px 12px;
}

.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}

.metric-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.metric-tile.tone-teal .metric-icon { background: var(--brand-soft); color: var(--brand-deep); }
.metric-tile.tone-green .metric-icon { background: var(--green-soft); color: var(--green); }
.metric-tile.tone-rose .metric-icon { background: var(--accent-soft); color: var(--accent); }
.metric-tile.tone-amber .metric-icon { background: var(--warm-soft); color: #a56b1d; }

.metric-tile .metric-num {
  font-size: 20px;
}

.metric-tile .metric-label {
  margin-top: 8px;
  font-size: 11px;
}

.metric-card {
  padding: 12px;
}

.metric-num {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0;
}

.metric-label {
  margin-top: 5px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
}

.metric-delta {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-top: 7px;
  color: var(--green);
  font-size: 11px;
  font-weight: 600;
}

.list-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 8px;
  text-align: left;
}

.list-row:last-child {
  margin-bottom: 0;
}

.thumb-image {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  overflow: hidden;
  flex: 0 0 auto;
  border: 1px solid rgba(220, 229, 227, 0.9);
  background: var(--surface-2);
}

.thumb-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-cover {
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  margin-bottom: 11px;
  max-height: 230px;
  box-shadow: var(--shadow);
}

.detail-cover img {
  width: 100%;
  max-height: 230px;
  object-fit: cover;
  display: block;
}

.copy-visual {
  overflow: hidden;
  border-radius: 7px;
  margin-bottom: 11px;
  max-height: 170px;
  background: var(--surface-2);
}

.copy-visual img {
  width: 100%;
  max-height: 170px;
  object-fit: cover;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.row-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.row-sub {
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chevron {
  color: var(--faint);
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.tag.brand { background: var(--brand-soft); color: var(--brand-deep); }
.tag.accent { background: var(--accent-soft); color: #b43f4a; }
.tag.warm { background: var(--warm-soft); color: #9a5f15; }
.tag.green { background: var(--green-soft); color: var(--green); }
.tag.blue { background: var(--blue-soft); color: var(--blue); }
.tag.purple { background: var(--purple-soft); color: var(--purple); }

.chips {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 1px 1px 7px;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.chip svg {
  width: 15px;
  height: 15px;
}

.chip.active {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
  color: #fff;
}

.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 4px;
  background: #e7edec;
  border-radius: 10px;
}

.segment {
  height: 34px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.segment svg {
  width: 16px;
  height: 16px;
}

.segment.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(22, 33, 40, 0.1);
}

.searchbar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.searchbar svg {
  width: 17px;
  height: 17px;
  color: var(--faint);
}

.searchbar input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  font-size: 13px;
}

.searchbar input::placeholder,
.field input::placeholder,
.field textarea::placeholder {
  color: var(--faint);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 15px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.btn.primary {
  background: var(--brand-deep);
  color: #fff;
}

.btn.accent {
  background: var(--accent);
  color: #fff;
}

.btn.soft {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.btn.ghost {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
}

.btn.danger-soft {
  background: var(--accent-soft);
  color: #b43f4a;
}

.btn.wide {
  width: 100%;
}

.btn.small {
  height: 30px;
  padding: 0 9px;
  font-size: 11px;
  border-radius: 6px;
}

.btn svg {
  width: 17px;
  height: 17px;
}

.fab {
  position: fixed;
  right: max(12px, calc(50vw - 238px));
  bottom: calc(var(--nav-height) + 20px);
  z-index: 40;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 20px rgba(190, 55, 69, 0.3);
}

.fab svg {
  width: 22px;
  height: 22px;
}

.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 500px);
  height: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  z-index: 50;
  backdrop-filter: blur(12px);
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 600;
}

.tab svg {
  width: 21px;
  height: 21px;
}

.tab-emoji {
  font-size: 18px;
  line-height: 1;
}

.tab.active {
  color: var(--brand-deep);
}

.tab.active svg {
  stroke-width: 2.2;
}

.copy-card {
  width: 100%;
  text-align: left;
  display: block;
  padding: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 9px;
}

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

.copy-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.copy-body {
  margin-top: 9px;
  font-size: 12px;
  line-height: 1.7;
  color: #435158;
  white-space: pre-line;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.copy-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.campaign-card {
  padding: 13px;
  position: relative;
  overflow: hidden;
}

.campaign-date {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
}

.campaign-date svg {
  width: 14px;
  height: 14px;
}

.campaign-title {
  font-size: 15px;
  font-weight: 800;
  margin-top: 7px;
  letter-spacing: 0;
}

.campaign-desc {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.offer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.field {
  margin-bottom: 12px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 10px 11px;
  font-size: 13px;
  outline: none;
}

.field textarea {
  resize: vertical;
  min-height: 88px;
  line-height: 1.6;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(13, 90, 97, 0.12);
}

.image-slot {
  position: relative;
  overflow: hidden;
  border: 1.5px dashed #c6d8d4;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(240, 247, 245, 0.62), rgba(250, 246, 242, 0.78));
  aspect-ratio: 4 / 3;
}

.image-slot.is-filled {
  border-style: solid;
  border-color: #cfe0dc;
}

.image-slot-btn {
  width: 100%;
  height: 100%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  cursor: pointer;
  position: relative;
}

[data-form-name="case"] .field-row-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

[data-form-name="case"] .field-row-3 .image-slot {
  aspect-ratio: 1 / 1;
}

.image-slot-content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-slot-content img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.image-slot-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #75938f;
  font-weight: 600;
}

.image-slot-placeholder small {
  font-size: 11px;
  color: var(--muted);
}

.image-slot-clear {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(28, 43, 48, 0.66);
  color: #fff;
  backdrop-filter: blur(5px);
}

.image-slot-clear svg {
  width: 14px;
  height: 14px;
}

.case-shots {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  width: 100%;
}

.case-shots.single {
  grid-template-columns: 1fr;
}

.case-shot {
  margin: 0;
  overflow: hidden;
  border-radius: 7px;
  background: var(--surface-2);
  position: relative;
}

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

.case-shot figcaption {
  position: absolute;
  left: 8px;
  top: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(15, 36, 40, 0.74);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  backdrop-filter: blur(5px);
}

.case-shot-empty {
  width: 100%;
  aspect-ratio: 16 / 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--faint);
}

.case-card {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(24, 48, 52, 0.03), 0 7px 20px rgba(24, 48, 52, 0.04);
}

.case-card:active {
  opacity: 0.85;
}

.case-hero {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px;
  border: 1px solid #efd9d3;
  border-radius: var(--radius);
  background: linear-gradient(145deg, #fff5f1 0%, #f0f7f5 72%, #faf4eb 130%);
  box-shadow: 0 7px 22px rgba(120, 70, 65, 0.07);
  position: relative;
  overflow: hidden;
}

.case-hero-gem {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(145deg, #ef7d88, #c9475c);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  box-shadow: 0 7px 16px rgba(201, 71, 92, 0.25);
}

.case-hero-gem svg {
  width: 24px;
  height: 24px;
}

.case-spark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  color: var(--warm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  box-shadow: 0 4px 12px rgba(163, 91, 23, 0.12);
}

.collection-list {
  padding-top: 4px;
}

.collection-group {
  margin-top: 15px;
}

.collection-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 2px 9px;
}

.collection-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
}

.collection-head small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.collection-gem {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: #b64051;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.collection-gem svg {
  width: 18px;
  height: 18px;
}

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

.case-tile {
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: left;
  box-shadow: 0 2px 8px rgba(24, 48, 52, 0.035);
}

.case-tile:active {
  transform: scale(0.98);
}

.case-tile-media {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background:
    linear-gradient(150deg, #f7e9e6, #eef5f1);
}

.case-tile-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.case-tile-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(218, 124, 134, 0.7);
}

.case-tile-body {
  padding: 9px 10px 10px;
}

.case-tile-body strong {
  display: block;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.case-tile-body small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.case-detail-cover {
  margin-bottom: 12px;
}

.extra-case-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.extra-case-grid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
}

.check-row input {
  width: 17px;
  height: 17px;
  accent-color: var(--brand);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field-row-3 {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 10px;
}

.form-card {
  padding: 14px;
}

.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 5px;
}

.form-actions .btn {
  flex: 1;
}

.empty {
  padding: 26px 14px;
  text-align: center;
  color: var(--muted);
}

.empty-icon {
  width: 46px;
  height: 46px;
  margin: 0 auto 9px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  color: var(--faint);
}

.empty-icon svg {
  width: 22px;
  height: 22px;
}

.empty h3 {
  margin: 0 0 5px;
  font-size: 14px;
}

.empty p {
  margin: 0 auto;
  max-width: 220px;
  font-size: 12px;
  line-height: 1.6;
}

.detail-hero {
  padding: 17px 15px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.detail-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.3;
}

.detail-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.price {
  color: var(--accent);
  font-weight: 800;
  font-size: 17px;
}

.detail-actions {
  display: flex;
  gap: 8px;
  padding: 0 13px 13px;
}

.detail-actions .btn {
  flex: 1;
}

.bullet-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.bullet-list li {
  position: relative;
  padding-left: 16px;
  font-size: 13px;
  line-height: 1.6;
  color: #3d4b52;
  margin-bottom: 6px;
}

.bullet-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand);
}

.content-text {
  font-size: 13px;
  line-height: 1.75;
  color: #3d4b52;
  white-space: pre-line;
  margin: 0;
}

.chat-shell {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 56px - var(--nav-height) - 38px);
}

.chat-main {
  flex: 1;
  padding: 12px;
}

.suggestion {
  margin-bottom: 9px;
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
}

.suggestion svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--brand);
}

.bubble-row {
  display: flex;
  margin-bottom: 12px;
}

.bubble-row.bot {
  justify-content: flex-start;
}

.bubble-row.user {
  justify-content: flex-end;
}

.bot-avatar {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--brand-deep);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 7px;
  flex: 0 0 auto;
}

.bot-avatar svg {
  width: 17px;
  height: 17px;
}

.bubble {
  max-width: 82%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: break-word;
  white-space: pre-line;
}

.bubble-row.bot .bubble {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top-left-radius: 4px;
}

.bubble-row.user .bubble {
  background: var(--brand-deep);
  color: #fff;
  border-top-right-radius: 4px;
}

.kb-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.composer {
  position: sticky;
  bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
  z-index: 20;
  padding: 8px 12px 9px;
  background: rgba(243, 245, 245, 0.94);
  backdrop-filter: blur(10px);
}

.composer-box {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 5px 5px 5px 13px;
}

.composer textarea {
  flex: 1;
  border: 0;
  outline: 0;
  background: none;
  resize: none;
  height: 34px;
  max-height: 90px;
  line-height: 22px;
  font-size: 13px;
  padding: 6px 0;
}

.send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brand-deep);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.send-btn svg {
  width: 18px;
  height: 18px;
}

.poster-stage {
  width: 100%;
  max-width: 330px;
  margin: 0 auto;
  aspect-ratio: 4 / 5;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.poster-stage canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.poster-style {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.style-option {
  flex: 1;
  height: 54px;
  border-radius: 7px;
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
}

.style-option.active {
  border-color: var(--brand-deep);
}

.style-option::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 4px;
}

.style-option.rose::after { background: linear-gradient(145deg, #f5c3c5, #7d3d4d); }
.style-option.teal::after { background: linear-gradient(145deg, #9bd5d0, #0c4b52); }
.style-option.warm::after { background: linear-gradient(145deg, #f4cf9c, #a8542a); }
.style-option.ink::after { background: linear-gradient(145deg, #5a6571, #182128); }

.style-option span {
  position: absolute;
  z-index: 2;
  inset: 5px;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 3px;
}

.divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 14px 0;
}

.stat-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.timeline {
  position: relative;
  padding-left: 18px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 7px;
  bottom: 7px;
  width: 2px;
  background: #dbe5e3;
}

.timeline-item {
  position: relative;
  padding-bottom: 12px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -17px;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--brand);
}

.timeline-time {
  font-size: 10px;
  color: var(--faint);
  margin-bottom: 2px;
}

.timeline-text {
  font-size: 13px;
  color: #3d4b52;
  line-height: 1.5;
  white-space: pre-line;
}

.notes-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.notes-list li {
  border-bottom: 1px dashed var(--line);
  padding: 8px 0;
  font-size: 12px;
  line-height: 1.55;
}

.notes-list li:last-child {
  border-bottom: 0;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px;
}

.setting-row + .setting-row {
  border-top: 1px solid var(--line);
}

.setting-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: var(--brand-deep);
}

.setting-icon svg {
  width: 18px;
  height: 18px;
}

.switch {
  position: relative;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: #d5dddc;
  flex: 0 0 auto;
  transition: background 0.18s ease;
}

.switch::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  top: 3px;
  left: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: left 0.18s ease;
}

.switch.on {
  background: var(--brand);
}

.switch.on::after {
  left: 21px;
}

.help-note {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.55;
  margin-top: 5px;
}

.toast {
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  z-index: 99;
  max-width: min(88vw, 420px);
  padding: 10px 15px;
  border-radius: 9px;
  background: #1d2d33;
  color: #fff;
  font-size: 13px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.hidden {
  display: none !important;
}

@media (min-width: 520px) {
  .app {
    min-height: calc(100dvh - 28px);
    margin-top: 14px;
    border-radius: 18px;
    overflow: clip;
  }

  .tabbar {
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
  }
}

/* ===== 案例大框架（合集入口）===== */
.framework-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  margin-top: 12px;
}

.framework-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(24, 48, 52, 0.035);
}

.framework-card:active {
  transform: scale(0.98);
}

.framework-cover {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: linear-gradient(150deg, #f7e9e6, #eef5f1);
}

.framework-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.framework-cover-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
}

.framework-count {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(13, 42, 46, 0.62);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  backdrop-filter: blur(4px);
}

.framework-body {
  display: block;
  padding: 10px 11px 12px;
}

.framework-body strong {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}

.framework-body small {
  display: block;
  margin-top: 4px;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--muted);
}

/* 案例详情图片墙 */
.case-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.case-gallery img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  border-radius: 14px;
  border: 1px solid var(--line);
}

@media (min-width: 480px) {
  .case-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* 视频案例 */
.case-video-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #0d2a2e;
}

.case-detail-video {
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 480px;
  object-fit: contain;
  display: block;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #0d2a2e;
}
