.qg-shell {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 0 48px;
  color: #2A2421;
  box-sizing: border-box;
  --faq-accent: #A62C2B;
  --faq-badge-bg: #F6EFE4;
  --faq-badge-color: #7E5A28;
  --faq-card-bg: #FFFDF9;
}

.qg-shell *,
.qg-shell *::before,
.qg-shell *::after {
  box-sizing: border-box;
}

.qg-hero {
  text-align: center;
  padding: 20px 16px 18px;
  border-bottom: 1px solid #E8DFD1;
  margin-bottom: 22px;
}

.qg-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: 999px;
  background: #F4EBDD;
  color: #7D5B2B;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.qg-hero-title {
  margin: 0 0 8px;
  font-size: 30px;
  line-height: 1.3;
  font-weight: 800;
  color: #2A2421;
  letter-spacing: 1px;
}

.qg-hero-note {
  margin: 0 auto;
  max-width: 680px;
  font-size: 14px;
  line-height: 1.65;
  color: #6B5E53;
}

.qg-workspace {
  display: grid;
  grid-template-columns: 400px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.qg-panel {
  background: #FFFDF9;
  border: 1px solid #E5DAC8;
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 4px 18px rgba(42, 36, 33, 0.04);
}

.qg-mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  padding: 4px;
  background: #F3ECE0;
  border-radius: 10px;
}

.qg-mode-tab {
  flex: 1 1 140px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #5C4F44;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.qg-mode-tab:hover {
  color: #A62C2B;
}

.qg-mode-tab.is-active {
  background: #A62C2B;
  color: #FFFDF9;
  box-shadow: 0 2px 8px rgba(166, 44, 43, 0.24);
}

.qg-form-group {
  margin-bottom: 16px;
}

.qg-label-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.qg-label {
  font-size: 14px;
  font-weight: 700;
  color: #2A2421;
}

.qg-pill-switch {
  display: inline-flex;
  background: #F3ECE0;
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}

.qg-pill-btn {
  border: none;
  background: transparent;
  color: #6B5E53;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.qg-pill-btn.is-active {
  background: #A62C2B;
  color: #FFFDF9;
}

.qg-date-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 8px;
}

.qg-select {
  width: 100%;
  height: 40px;
  padding: 0 10px;
  border: 1px solid #D9CCB8;
  border-radius: 8px;
  background: #FAF7F2;
  color: #2A2421;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.qg-select:focus {
  outline: none;
  border-color: #A62C2B;
  background: #FFFDF9;
}

.qg-lunar-preview {
  margin-top: 6px;
  font-size: 13px;
  color: #7D5B2B;
  min-height: 20px;
}

.qg-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.qg-subtab {
  flex: 1 1 95px;
  padding: 7px 8px;
  border: 1px solid #D9CCB8;
  border-radius: 8px;
  background: #FAF7F2;
  color: #5C4F44;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.qg-subtab.is-active {
  border-color: #A62C2B;
  background: #FCEFEB;
  color: #A62C2B;
}

.qg-age-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.qg-age-btn {
  padding: 9px 10px;
  border: 1px solid #D9CCB8;
  border-radius: 8px;
  background: #FAF7F2;
  color: #5C4F44;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.qg-age-btn.is-active {
  border-color: #A62C2B;
  background: #A62C2B;
  color: #FFFDF9;
}

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

.qg-pref-btn {
  padding: 9px 6px;
  border: 1px solid #D9CCB8;
  border-radius: 8px;
  background: #FAF7F2;
  color: #5C4F44;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.qg-pref-btn.is-active {
  border-color: #A62C2B;
  background: #A62C2B;
  color: #FFFDF9;
}

.qg-submit-btn {
  width: 100%;
  height: 46px;
  border: none;
  border-radius: 10px;
  background: #A62C2B;
  color: #FFFDF9;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background-color 0.2s ease, opacity 0.2s ease;
  margin-top: 4px;
}

.qg-submit-btn:hover {
  background: #8E2322;
}

.qg-submit-btn:disabled {
  background: #C8BCB0;
  color: #F6F2EC;
  cursor: not-allowed;
  opacity: 0.78;
}

.qg-presets {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed #E4D8C7;
}

.qg-presets-title {
  font-size: 13px;
  font-weight: 700;
  color: #7D5B2B;
  margin-bottom: 8px;
}

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

.qg-preset-pill {
  padding: 6px 11px;
  border: 1px solid #DFD2BE;
  border-radius: 999px;
  background: #FAF7F2;
  color: #4A3E35;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.qg-preset-pill:hover {
  border-color: #A62C2B;
  color: #A62C2B;
  background: #FCEFEB;
}

.qg-stage {
  scroll-margin-top: 90px;
}

.qg-stage-empty {
  padding: 36px 20px;
  text-align: center;
  color: #6B5E53;
}

.qg-stage-empty-title {
  font-size: 18px;
  font-weight: 700;
  color: #2A2421;
  margin-bottom: 8px;
}

.qg-stage-empty-desc {
  font-size: 14px;
  line-height: 1.7;
  max-width: 460px;
  margin: 0 auto 18px;
}

.qg-stage-error {
  padding: 16px 18px;
  border-radius: 10px;
  background: #FDF2F2;
  border: 1px solid #EBC5C5;
  color: #962626;
  font-size: 14px;
  font-weight: 600;
}

.qg-yujian-card {
  position: relative;
  background: linear-gradient(180deg, #FFFDF9 0%, #FAF5EB 100%);
  border: 2px solid #D5B885;
  border-radius: 14px;
  padding: 24px 22px 20px;
  box-shadow: 0 8px 24px rgba(125, 91, 43, 0.08);
  overflow: hidden;
}

.qg-yujian-card::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(179, 143, 77, 0.36);
  border-radius: 10px;
  pointer-events: none;
}

.qg-yujian-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  color: #8A6B39;
  font-weight: 600;
  letter-spacing: 0.8px;
  padding-bottom: 12px;
  border-bottom: 1px dashed rgba(179, 143, 77, 0.45);
  margin-bottom: 18px;
}

.qg-yujian-main {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
}

.qg-seal {
  flex: 0 0 82px;
  width: 82px;
  height: 82px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #FFFDF9;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(42, 36, 33, 0.14);
}

.qg-seal.is-boy {
  background: linear-gradient(135deg, #3E6B89 0%, #2D526B 100%);
  border: 2px solid #6E9AB6;
}

.qg-seal.is-girl {
  background: linear-gradient(135deg, #B85D6E 0%, #964555 100%);
  border: 2px solid #D98E9C;
}

.qg-seal-char {
  font-size: 32px;
  line-height: 1.05;
}

.qg-seal-sub {
  font-size: 12px;
  letter-spacing: 1px;
  margin-top: 2px;
  opacity: 0.92;
}

.qg-yujian-copy {
  flex: 1;
  min-width: 0;
}

.qg-yujian-title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 800;
  color: #2A2421;
  line-height: 1.3;
}

.qg-yujian-quote {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: #7D5B2B;
  line-height: 1.55;
}

.qg-yujian-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: #5C4F44;
}

.qg-yujian-meta span {
  background: rgba(179, 143, 77, 0.12);
  padding: 3px 9px;
  border-radius: 6px;
}

.qg-yujian-dignity {
  margin: 0 0 16px;
  padding: 10px 14px;
  background: rgba(255, 253, 249, 0.85);
  border-left: 3px solid #B38F4D;
  border-radius: 0 8px 8px 0;
  font-size: 13.5px;
  line-height: 1.65;
  color: #4A3E35;
}

.qg-yujian-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(179, 143, 77, 0.4);
}

.qg-yujian-brand {
  font-size: 12px;
  color: #8A7E72;
  line-height: 1.55;
}

.qg-yujian-brand strong {
  display: block;
  color: #5C4F44;
  font-size: 13px;
}

.qg-yujian-qr {
  width: 60px;
  height: 60px;
  padding: 4px;
  background: #FFFFFF;
  border: 1px solid #E5DAC8;
  border-radius: 6px;
  flex: 0 0 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qg-yujian-qr img,
.qg-yujian-qr canvas {
  width: 52px !important;
  height: 52px !important;
  display: block;
}

.qg-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 18px;
}

.qg-action-primary {
  flex: 1 1 180px;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: #A62C2B;
  color: #FFFDF9;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.qg-action-primary:hover {
  background: #8E2322;
}

.qg-action-secondary {
  flex: 0 1 auto;
  padding: 10px 14px;
  border: 1px solid #D9CCB8;
  border-radius: 8px;
  background: #FAF7F2;
  color: #4A3E35;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

.qg-action-secondary:hover {
  border-color: #A62C2B;
  color: #A62C2B;
}

.qg-poster-preview {
  display: none;
  margin-bottom: 18px;
  padding: 14px;
  background: #FAF7F2;
  border: 1px dashed #D5B885;
  border-radius: 10px;
  text-align: center;
}

.qg-poster-preview.is-visible {
  display: block;
}

.qg-poster-preview img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(42, 36, 33, 0.1);
}

.qg-poster-hint {
  margin: 8px 0 0;
  font-size: 12.5px;
  color: #7D5B2B;
}

.qg-capsules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.qg-capsule {
  padding: 12px 14px;
  background: #FAF7F2;
  border: 1px solid #E8DFD1;
  border-radius: 10px;
}

.qg-capsule-label {
  font-size: 12px;
  font-weight: 700;
  color: #8A6B39;
  margin-bottom: 4px;
}

.qg-capsule-value {
  font-size: 14px;
  font-weight: 700;
  color: #2A2421;
  line-height: 1.45;
}

.qg-detail-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.qg-detail-block {
  padding: 14px 16px;
  background: #FAF7F2;
  border-radius: 10px;
  border: 1px solid #EAE1D3;
}

.qg-detail-heading {
  font-size: 14px;
  font-weight: 700;
  color: #2A2421;
  margin: 0 0 6px;
}

.qg-detail-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: #4A3E35;
}

.qg-leap-badge {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #FDF5E6;
  border: 1px solid #E6C78A;
  color: #8A5A12;
  font-size: 13px;
  font-weight: 600;
}

.qg-alt-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #DFD3C2;
  font-size: 13px;
  color: #5C4F44;
}

.qg-alt-switch-btn {
  padding: 4px 10px;
  border: 1px solid #D5B885;
  border-radius: 999px;
  background: #FFFDF9;
  color: #7D5B2B;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.qg-alt-switch-btn:hover {
  border-color: #A62C2B;
  color: #A62C2B;
}

.qg-out-range-card {
  padding: 24px 20px;
  background: #FAF7F2;
  border: 1px solid #E5DAC8;
  border-radius: 12px;
  text-align: center;
}

.qg-out-range-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 800;
  color: #2A2421;
}

.qg-out-range-text {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.7;
  color: #5C4F44;
}

.qg-plan-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.qg-plan-stat {
  padding: 12px;
  border-radius: 10px;
  background: #FAF7F2;
  border: 1px solid #E8DFD1;
  text-align: center;
}

.qg-plan-stat-num {
  font-size: 22px;
  font-weight: 800;
  color: #2A2421;
}

.qg-plan-stat-num.is-boy {
  color: #3E6B89;
}

.qg-plan-stat-num.is-girl {
  color: #B85D6E;
}

.qg-plan-stat-label {
  font-size: 12px;
  color: #6B5E53;
  margin-top: 2px;
}

.qg-plan-timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qg-plan-transition {
  padding: 9px 14px;
  border-radius: 8px;
  background: #FDF5E6;
  border: 1px solid #E6C78A;
  color: #8A5A12;
  font-size: 13px;
  font-weight: 700;
}

.qg-plan-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #FAF7F2;
  border: 1px solid #E8DFD1;
}

.qg-plan-item-main {
  min-width: 0;
  flex: 1;
}

.qg-plan-dates {
  font-size: 14.5px;
  font-weight: 800;
  color: #2A2421;
}

.qg-plan-sub {
  font-size: 12.5px;
  color: #6B5E53;
  margin-top: 3px;
  line-height: 1.5;
}

.qg-plan-tag {
  flex: 0 0 auto;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: #FFFDF9;
}

.qg-plan-tag.is-boy {
  background: #3E6B89;
}

.qg-plan-tag.is-girl {
  background: #B85D6E;
}

.qg-plan-tag.is-out {
  background: #9E9385;
}

.qg-buffer-card {
  min-height: 280px;
  height: 280px;
  margin: 28px 0;
  padding: 24px 20px;
  background: #FAF7F2;
  border: 1px solid #E5DAC8;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.qg-buffer-tag {
  font-size: 12px;
  font-weight: 700;
  color: #8A6B39;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.qg-buffer-title {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 700;
  color: #2A2421;
}

.qg-buffer-desc {
  margin: 0;
  max-width: 600px;
  font-size: 13.5px;
  line-height: 1.7;
  color: #6B5E53;
}

.qg-section {
  margin-top: 32px;
  scroll-margin-top: 90px;
}

.qg-section-head {
  margin-bottom: 14px;
}

.qg-section-title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 800;
  color: #2A2421;
}

.qg-section-desc {
  margin: 0;
  font-size: 14px;
  color: #6B5E53;
  line-height: 1.65;
}

.qg-cell-inspector {
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #F4EBDD;
  color: #4A3E35;
  font-size: 14px;
  font-weight: 600;
}

.qg-matrix-scroll {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #E5DAC8;
  border-radius: 12px;
  background: #FFFDF9;
  -webkit-overflow-scrolling: touch;
}

.qg-matrix-table {
  width: 100%;
  min-width: 660px;
  border-collapse: collapse;
  font-size: 13.5px;
  text-align: center;
}

.qg-matrix-table th,
.qg-matrix-table td {
  padding: 9px 6px;
  border-bottom: 1px solid #EFE7DA;
  border-right: 1px solid #EFE7DA;
}

.qg-matrix-table thead th {
  background: #F4EBDD;
  color: #4A3E35;
  font-weight: 700;
}

.qg-matrix-table th.is-sticky,
.qg-matrix-table td.is-sticky {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #F4EBDD;
  color: #2A2421;
  font-weight: 700;
  min-width: 72px;
  border-right: 1px solid #DFD2BE;
}

.qg-matrix-table thead th.is-sticky {
  z-index: 3;
}

.qg-cell-btn {
  width: 100%;
  min-width: 34px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.qg-cell-btn.is-boy {
  background: rgba(62, 107, 137, 0.12);
  color: #2D526B;
}

.qg-cell-btn.is-girl {
  background: rgba(184, 93, 110, 0.13);
  color: #8F3E4E;
}

.qg-cell-btn:hover {
  transform: scale(1.06);
  border-color: #B38F4D;
}

.qg-cell-btn.is-matched {
  background: #A62C2B !important;
  color: #FFFDF9 !important;
  box-shadow: 0 0 0 3px rgba(166, 44, 43, 0.25);
}

.qg-encyclopedia {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid #E5DAC8;
}

.qg-ency-block {
  padding: 18px 0;
  border-bottom: 1px solid #EDE5D8;
}

.qg-ency-block:last-child {
  border-bottom: none;
}

.qg-ency-block h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 800;
  color: #2A2421;
}

.qg-ency-block p {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.85;
  color: #4A3E35;
}

.qg-ency-block p:last-child {
  margin-bottom: 0;
}

.qg-ency-link {
  color: #A62C2B;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.qg-referral-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.qg-referral-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  border-radius: 12px;
  background: #FFFDF9;
  border: 1px solid #E5DAC8;
  text-decoration: none;
  color: #2A2421;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.qg-referral-card:hover {
  border-color: #A62C2B;
  transform: translateY(-2px);
}

.qg-referral-title {
  font-size: 15px;
  font-weight: 800;
  color: #2A2421;
  margin-bottom: 6px;
}

.qg-referral-desc {
  font-size: 13px;
  line-height: 1.6;
  color: #6B5E53;
  margin-bottom: 10px;
}

.qg-referral-cta {
  font-size: 13px;
  font-weight: 700;
  color: #A62C2B;
}

@media (max-width: 960px) {
  .qg-workspace {
    grid-template-columns: 1fr;
  }

  .qg-referral-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .qg-hero-title {
    font-size: 24px;
  }

  .qg-panel {
    padding: 16px;
  }

  .qg-yujian-main {
    flex-direction: column;
    text-align: center;
  }

  .qg-yujian-meta {
    justify-content: center;
  }

  .qg-capsules,
  .qg-plan-summary {
    grid-template-columns: 1fr;
  }

  .qg-referral-grid {
    grid-template-columns: 1fr;
  }
}
