:root {
  --bg-paper: #FAF6F0;
  --bg-card: #FFFFFF;
  --bg-warm: #F4EDE2;
  --ink-black: #1E1C1A;
  --ink-gray: #5C564F;
  --ink-light: #8C847A;
  --cinnabar: #B8332A;
  --cinnabar-dark: #8F221B;
  --cinnabar-soft: #FDF2F0;
  --gold: #C59B5F;
  --gold-soft: #FBF6EC;
  --jade: #2E6B5E;
  --wechat-green: #07C160;
  --wechat-blue: #576B95;
  --border-warm: #E6DDD0;
  --shadow-soft: 0 8px 24px rgba(30, 28, 26, 0.06);
  --radius-lg: 18px;
  --radius-md: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-paper);
  background-image: radial-gradient(rgba(197, 155, 95, 0.08) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--ink-black);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Serif SC", sans-serif;
  line-height: 1.6;
  padding-bottom: calc(90px + env(safe-area-inset-bottom));
}

.serif-font {
  font-family: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
}

.app-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 14px 40px;
}

/* Top Brand Header */
.brand-header {
  background: linear-gradient(135deg, #231F1C 0%, #382F29 100%);
  color: #FAF6F0;
  border-radius: var(--radius-lg);
  padding: 18px 18px 16px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(30, 28, 26, 0.16);
  border: 1px solid rgba(197, 155, 95, 0.35);
  margin-bottom: 16px;
}

.brand-header::after {
  content: "知人论世";
  position: absolute;
  right: -10px;
  bottom: -18px;
  font-size: 74px;
  font-family: "Songti SC", "STSong", serif;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.04);
  pointer-events: none;
  user-select: none;
}

.brand-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.brand-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.seal-logo {
  width: 48px;
  height: 48px;
  background: var(--cinnabar);
  border: 2px solid #F3D5B5;
  border-radius: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  place-items: center;
  padding: 4px;
  font-family: "Songti SC", "STSong", serif;
  font-weight: 900;
  font-size: 15px;
  line-height: 1.1;
  color: #FFFDF9;
  box-shadow: 0 4px 12px rgba(184, 51, 42, 0.45);
  flex-shrink: 0;
}

.brand-titles h1 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #FFFDF9;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.brand-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(197, 155, 95, 0.25);
  border: 1px solid rgba(197, 155, 95, 0.6);
  color: #F5DCA8;
  font-weight: 600;
}

.brand-slogan-bar {
  margin-top: 12px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.07);
  border-left: 3px solid var(--gold);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: #F3E8D6;
}

.btn-ghost-gold {
  background: rgba(197, 155, 95, 0.2);
  border: 1px solid rgba(197, 155, 95, 0.5);
  color: #F7E1B5;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.btn-ghost-gold:active {
  transform: scale(0.96);
}

/* Weekly KPI Progress Card */
.kpi-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-md);
  padding: 12px 15px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.kpi-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 240px;
}

.kpi-ring {
  background: var(--cinnabar-soft);
  color: var(--cinnabar);
  border: 1.5px solid rgba(184, 51, 42, 0.25);
  font-weight: 800;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 10px;
  white-space: nowrap;
}

.kpi-ring.done {
  background: #E8F7EF;
  color: var(--jade);
  border-color: rgba(46, 107, 94, 0.3);
}

.kpi-text-wrap {
  font-size: 13px;
}

.kpi-text-wrap strong {
  color: var(--ink-black);
  display: block;
}

.kpi-text-wrap span {
  color: var(--ink-gray);
  font-size: 12px;
}

/* 4 Category Cards Grid */
.section-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-gray);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

@media (min-width: 768px) {
  .category-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }
}

.cat-card {
  background: var(--bg-card);
  border: 2px solid var(--border-warm);
  border-radius: var(--radius-md);
  padding: 13px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 112px;
}

.cat-card.active {
  border-color: var(--cinnabar);
  background: linear-gradient(180deg, #FFFDFB 0%, #FDF4F2 100%);
  box-shadow: 0 6px 18px rgba(184, 51, 42, 0.14);
}

.cat-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
}

.cat-icon {
  font-size: 24px;
  line-height: 1;
}

.cat-std-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--bg-warm);
  color: var(--ink-gray);
  font-weight: 600;
}

.cat-card.active .cat-std-badge {
  background: var(--cinnabar);
  color: #FFF;
}

.cat-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink-black);
  margin-bottom: 3px;
}

.cat-desc {
  font-size: 11.5px;
  color: var(--ink-gray);
  line-height: 1.35;
}

/* Main Workspace Two Columns on Desktop, Stacked on Mobile */
.workspace-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

@media (min-width: 920px) {
  .workspace-grid {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: start;
  }
}

.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-soft);
}

/* Photo Rule Alert Banner */
.photo-rule-banner {
  background: #FFF9EB;
  border: 1px solid #F0D999;
  border-left: 4px solid #D99B26;
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 13px;
  color: #5C4308;
  margin-bottom: 16px;
  line-height: 1.5;
}

/* Form Blocks & Thumb-friendly Pills */
.field-group {
  margin-bottom: 15px;
}

.field-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-black);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.field-hint {
  font-size: 11.5px;
  font-weight: 400;
  color: var(--ink-light);
}

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

.pill-btn {
  border: 1.5px solid var(--border-warm);
  background: #FAF8F5;
  color: var(--ink-black);
  padding: 8px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pill-btn.active {
  background: var(--cinnabar);
  border-color: var(--cinnabar);
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: 0 3px 10px rgba(184, 51, 42, 0.25);
}

.pill-btn.gold-active.active {
  background: #2C2622;
  border-color: var(--gold);
  color: #F7E1B5;
}

/* Mobile Photo Camera/Upload Grid */
.upload-zone {
  border: 2px dashed #D5C7B4;
  background: #FCF9F4;
  border-radius: 12px;
  padding: 12px;
}

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

.upload-thumb, .upload-trigger {
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}

.upload-trigger {
  border: 1.5px dashed var(--cinnabar);
  background: var(--cinnabar-soft);
  color: var(--cinnabar);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 700;
  text-align: center;
  padding: 4px;
}

.upload-trigger span.cam-icon {
  font-size: 22px;
  margin-bottom: 2px;
}

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

.upload-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  border: none;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-text {
  width: 100%;
  border: 1.5px solid var(--border-warm);
  background: #FCFBF9;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--ink-black);
  outline: none;
}

.input-text:focus {
  border-color: var(--cinnabar);
  background: #FFF;
}

.holiday-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

/* Primary Action Button */
.btn-generate-main {
  width: 100%;
  background: linear-gradient(135deg, var(--cinnabar) 0%, #96231B 100%);
  color: #FFF;
  border: none;
  border-radius: 14px;
  padding: 15px 20px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(184, 51, 42, 0.32);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s;
}

.btn-generate-main:active {
  transform: scale(0.98);
}

.btn-generate-main:disabled {
  opacity: 0.65;
  cursor: wait;
}

/* 1:1 Authentic WeChat Moments Preview Card */
.version-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 12px;
  background: var(--bg-warm);
  padding: 5px;
  border-radius: 12px;
}

.ver-tab {
  border: none;
  background: transparent;
  padding: 9px 6px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-gray);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}

.ver-tab.active {
  background: #FFF;
  color: var(--cinnabar);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.wechat-preview-box {
  background: #FFFFFF;
  border: 1px solid #EBEBEB;
  border-radius: 14px;
  padding: 15px 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.wx-header {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.wx-avatar {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  background: var(--cinnabar);
  color: #FFF;
  font-family: "Songti SC", serif;
  font-weight: 900;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid #E5C39C;
}

.wx-main {
  flex: 1;
  min-width: 0;
}

.wx-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.wx-nickname {
  color: var(--wechat-blue);
  font-weight: 700;
  font-size: 15px;
}

.fold-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 99px;
  background: #E8F8EE;
  color: #069448;
  font-weight: 600;
}

.wx-copy-editable {
  width: 100%;
  border: 1px dashed transparent;
  background: transparent;
  font-size: 15px;
  line-height: 1.65;
  color: #191919;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 4px 6px;
  margin: -4px -6px 10px;
  border-radius: 8px;
  resize: vertical;
  min-height: 145px;
  font-family: inherit;
}

.wx-copy-editable:focus {
  border-color: var(--gold);
  background: #FFFEFA;
  outline: none;
}

.wx-media-grid {
  display: grid;
  grid-template-columns: repeat(2, 110px);
  gap: 5px;
  margin-bottom: 10px;
}

.wx-media-item {
  width: 110px;
  height: 110px;
  border-radius: 4px;
  background: #F5F2EC;
  border: 1px solid #EAE3D5;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--ink-gray);
  text-align: center;
  padding: 6px;
}

.wx-media-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wx-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #B2B2B2;
  margin-bottom: 10px;
}

.wx-comment-box {
  background: #F7F7F7;
  border-radius: 6px;
  padding: 9px 11px;
  font-size: 13.5px;
  line-height: 1.5;
  color: #191919;
}

.wx-comment-tag {
  display: inline-block;
  font-size: 11px;
  background: #FCEAE8;
  color: var(--cinnabar);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
  margin-right: 4px;
}

/* Action Buttons Under WeChat Preview */
.wx-action-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 9px;
  margin-top: 13px;
}

.btn-copy-primary {
  background: var(--wechat-green);
  color: #FFF;
  border: none;
  border-radius: 11px;
  padding: 13px 14px;
  font-size: 14.5px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 6px 16px rgba(7, 193, 96, 0.26);
}

.btn-copy-comment {
  background: #2C2622;
  color: #F7E1B5;
  border: none;
  border-radius: 11px;
  padding: 13px 12px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

/* Poster Studio Section */
.poster-studio {
  margin-top: 18px;
}

.poster-preview-wrap {
  background: #221E1B;
  border-radius: 14px;
  padding: 14px;
  text-align: center;
  margin: 12px 0;
}

.long-press-tip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(197, 155, 95, 0.22);
  color: #F7DFB2;
  border: 1px solid rgba(197, 155, 95, 0.5);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 10px;
}

.poster-img-output {
  width: 100%;
  max-width: 360px;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  display: block;
  margin: 0 auto;
  -webkit-touch-callout: default;
}

/* Examples Benchmark Grid */
.examples-section {
  margin-top: 22px;
}

.examples-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 768px) {
  .examples-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.example-card {
  background: var(--bg-card);
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.example-text {
  font-size: 13.5px;
  color: var(--ink-black);
  white-space: pre-wrap;
  background: #FAF8F4;
  padding: 10px 12px;
  border-radius: 9px;
  border-left: 3px solid var(--cinnabar);
}

/* Floating Mobile Bottom Quick Bar after Copying */
.mobile-float-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  background: rgba(28, 25, 23, 0.96);
  backdrop-filter: blur(10px);
  color: #FFF;
  border: 1px solid rgba(197, 155, 95, 0.5);
  border-radius: 16px;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  z-index: 999;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  transform: translateY(150%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.mobile-float-bar.visible {
  transform: translateY(0);
}

.float-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-float-comment {
  background: var(--gold);
  color: #1E1C1A;
  border: none;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.btn-float-wx {
  background: var(--wechat-green);
  color: #FFF;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 800;
  white-space: nowrap;
}

/* Toast Notification */
.toast-msg {
  position: fixed;
  top: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: rgba(25, 23, 21, 0.94);
  color: #FFF;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  z-index: 2000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transition: transform 0.25s ease;
  white-space: nowrap;
}

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

/* Modal for Brand Settings */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1500;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  padding: 20px;
  max-height: 90vh;
  overflow-y: auto;
}
