:root {
  color-scheme: dark;
  --bg: #05060a;
  --line: rgba(218, 229, 255, 0.23);
  --line-bright: rgba(238, 244, 255, 0.54);
  --text: #f6f7fb;
  --soft: #d7daea;
  --muted: #969db4;
  --blue: #58b9ff;
  --green: #4bd6ae;
  --violet: #8d72ff;
  --panel: rgba(7, 9, 18, 0.82);
  --glow: 0 18px 70px rgba(56, 92, 255, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  background: var(--bg) url("/xingtan/assets/metal-aurora-bg.png") center top / 100% auto fixed no-repeat;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background: rgba(3, 4, 9, 0.58);
  pointer-events: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button[hidden] {
  display: none !important;
}

.jiyi-page {
  flex: 1 0 auto;
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 10px 0 52px;
}

.jiyi-hero {
  position: relative;
  min-height: 220px;
  display: grid;
  align-items: center;
  margin-top: 0;
  padding: 34px 58px;
  isolation: isolate;
}

.jiyi-hero::before {
  position: absolute;
  inset: 0;
  z-index: -2;
  border: 1px solid var(--line-bright);
  border-radius: 28px;
  content: "";
  background:
    linear-gradient(90deg, rgba(4, 6, 12, 0.97) 0%, rgba(4, 6, 12, 0.76) 48%, rgba(4, 6, 12, 0.16) 100%),
    url("/xingtan/assets/hero-bg.jpg") center right / cover no-repeat;
  box-shadow: inset 0 0 90px rgba(37, 72, 158, 0.22), var(--glow);
}

.jiyi-hero::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 28px;
  content: "";
  background: url("/xingtan/assets/metal-aurora-bg.png") center / cover no-repeat;
  mix-blend-mode: screen;
  opacity: 0.32;
  pointer-events: none;
}

.hero-copy {
  width: min(760px, 72vw);
}

.brand-row {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.brand-home {
  display: inline-flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: clamp(82px, 10vw, 132px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(43, 116, 255, 0.3));
}

.eyebrow {
  margin: 0;
  color: var(--soft);
  font-size: 14px;
  letter-spacing: 0;
  white-space: nowrap;
}

.jiyi-hero h1 {
  margin: 0;
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
  font-size: clamp(56px, 7vw, 92px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: 0;
  color: var(--text);
  text-shadow: 0 0 28px rgba(108, 136, 255, 0.28);
}

.hero-title-row {
  display: block;
}

.hero-jue {
  position: absolute;
  right: max(42px, 8%);
  top: 50%;
  z-index: 3;
  width: clamp(88px, 9vw, 118px);
  height: clamp(88px, 9vw, 118px);
  transform: translateY(-47%);
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.hero-jue img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  transform: scale(1.7);
  transform-origin: center;
  filter: drop-shadow(0 18px 32px rgba(74, 154, 255, 0.38));
}

.gallery-section {
  margin-top: 10px;
}

.business-section {
  margin-top: 30px;
}

.skill-card-section {
  margin-top: 30px;
}

.skill-style-gallery {
  position: relative;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-heading h2 {
  margin: 5px 0 0;
  font-size: 28px;
  line-height: 1.2;
}

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

.guide-card-grid {
  grid-template-rows: minmax(0, auto);
}

.gallery-item,
.gallery-empty-card,
.setup-panel,
.storyboard-area,
.result-card,
.comic-card {
  border: 1px solid var(--line-bright);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--glow);
}

.gallery-item {
  overflow: hidden;
  min-width: 0;
}

.gallery-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.gallery-card-link:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

.gallery-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 0;
  background: rgba(255, 255, 255, 0.03);
}

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

.stacked-thumb {
  display: grid;
  place-items: center;
  padding: 7%;
}

.stacked-images {
  position: relative;
  width: 82%;
  height: 74%;
  display: block;
}

.stacked-images img {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(238, 244, 255, 0.78);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.34);
  object-fit: cover;
}

.stacked-images img:nth-child(1) {
  z-index: 7;
  transform: translate(0, 0) rotate(-1deg);
}

.stacked-images img:nth-child(2) {
  z-index: 6;
  transform: translate(8px, 6px) rotate(2deg);
}

.stacked-images img:nth-child(3) {
  z-index: 5;
  transform: translate(16px, 12px) rotate(-2deg);
}

.stacked-images img:nth-child(4) {
  z-index: 4;
  transform: translate(24px, 18px) rotate(3deg);
}

.stacked-images img:nth-child(5) {
  z-index: 3;
  transform: translate(32px, 24px) rotate(-3deg);
}

.stacked-images img:nth-child(6) {
  z-index: 2;
  transform: translate(40px, 30px) rotate(2deg);
}

.stacked-images img:nth-child(7) {
  z-index: 1;
  transform: translate(48px, 36px) rotate(-2deg);
}

.stack-count {
  position: absolute;
  right: 10px;
  bottom: 10px;
  border: 1px solid rgba(238, 244, 255, 0.7);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--text);
  background: rgba(7, 9, 18, 0.78);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.ai-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.empty-slot {
  opacity: 0.42;
}

.empty-slot .gallery-thumb {
  display: grid;
  place-items: center;
}

.empty-slot .gallery-thumb::before {
  content: "";
  width: 26px;
  height: 26px;
  border: 1px solid var(--line-bright);
  border-radius: 50%;
}

.gallery-meta {
  display: grid;
  min-height: 50px;
  align-items: center;
  padding: 10px 12px 12px;
}

.gallery-meta h3,
.gallery-empty-card h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.2;
}

.gallery-meta p,
.gallery-empty-card p {
  margin: 5px 0 0;
  color: var(--soft);
  font-size: 12px;
}

.gallery-empty-card {
  min-height: 190px;
  grid-column: 1 / -1;
  display: grid;
  align-content: center;
  padding: 34px;
}

.workbench {
  margin-top: 18px;
}

.setup-panel,
.storyboard-area {
  padding: 22px;
}

.setup-panel h2 {
  margin: 8px 0 0;
  font-size: 26px;
  line-height: 1.25;
}

.retired-note {
  margin: 12px 0 0;
  color: var(--soft);
  line-height: 1.7;
}

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.segmented button {
  min-width: 96px;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--soft);
  background: transparent;
}

.segmented button.active {
  color: #04100d;
  background: linear-gradient(135deg, var(--green), var(--blue));
  font-weight: 700;
}

.field,
.file-drop {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.field span,
.file-drop span,
.comic-card label span {
  color: var(--soft);
  font-size: 14px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  outline: none;
}

input {
  min-height: 46px;
  padding: 0 14px;
}

textarea {
  min-height: 86px;
  resize: vertical;
  padding: 12px 14px;
  line-height: 1.58;
}

input::placeholder,
textarea::placeholder {
  color: rgba(215, 218, 234, 0.54);
}

input:focus,
textarea:focus {
  border-color: rgba(88, 185, 255, 0.72);
  box-shadow: 0 0 0 3px rgba(88, 185, 255, 0.14);
}

.file-drop {
  min-height: 104px;
  align-content: center;
  border: 1px dashed var(--line-bright);
  border-radius: 14px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.04);
}

.file-drop input {
  display: none;
}

.file-drop strong {
  color: var(--text);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.actions.compact {
  margin-top: 0;
  justify-content: flex-end;
}

.primary-button,
.ghost-button {
  min-height: 44px;
  border-radius: 14px;
  padding: 0 18px;
  border: 1px solid transparent;
  font-weight: 700;
}

.primary-button {
  color: #06110f;
  background: linear-gradient(135deg, var(--green), var(--blue));
}

.ghost-button {
  color: var(--text);
  border-color: var(--line-bright);
  background: rgba(255, 255, 255, 0.06);
}

.primary-button:disabled,
.ghost-button:disabled {
  cursor: wait;
  opacity: 0.64;
}

.status-text {
  color: var(--green);
  font-size: 14px;
}

.error-text {
  min-height: 20px;
  margin: 12px 0 0;
  color: #ff9a90;
}

.hidden,
[hidden] {
  display: none !important;
}

.storyboard-area {
  margin-top: 18px;
}

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

.section-bar .eyebrow {
  color: var(--green);
}

.section-bar h2 {
  margin: 0;
  font-size: 26px;
  letter-spacing: 0;
}

.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.comic-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}

.comic-card label {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.comic-card label:has(.prompt-box),
.comic-card label:has([data-field="imageText"]) {
  grid-column: 1 / -1;
}

.prompt-box {
  min-height: 170px;
}

.result-grid {
  margin-top: 16px;
}

.result-card {
  padding: 18px;
}

.result-card strong {
  display: block;
  margin-bottom: 12px;
  font-size: 20px;
}

.image-preview {
  width: min(920px, 100%);
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0;
  background: rgba(255, 255, 255, 0.04);
}

.image-preview img {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  object-fit: contain;
}

.result-card p {
  margin: 12px 0 0;
  color: var(--soft);
}

.result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.image-dialog {
  width: min(1120px, calc(100% - 32px));
  border: 1px solid var(--line-bright);
  border-radius: 18px;
  padding: 18px;
  background: rgba(7, 9, 18, 0.96);
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.44);
}

.image-dialog::backdrop {
  background: rgba(3, 4, 9, 0.76);
}

.image-dialog img {
  width: 100%;
  max-height: 76vh;
  display: block;
  object-fit: contain;
  border-radius: 12px;
}

.image-dialog p {
  margin: 12px 4px 0;
  font-weight: 700;
  text-align: center;
}

.dialog-count {
  min-height: 18px;
  margin-top: 6px;
  color: var(--soft);
  font-size: 13px;
  text-align: center;
}

.dialog-close {
  width: 36px;
  height: 36px;
  position: absolute;
  top: 10px;
  right: 10px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, 0.56);
  font-size: 24px;
  line-height: 1;
}

.dialog-nav {
  width: 42px;
  height: 56px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid var(--line-bright);
  border-radius: 12px;
  color: #fff;
  background: rgba(0, 0, 0, 0.48);
  font-size: 42px;
  line-height: 1;
}

.dialog-prev {
  left: 14px;
}

.dialog-next {
  right: 14px;
}

.site-footer {
  width: 100%;
  margin: 0;
  border-top: 1px solid var(--line);
  padding: 28px max(24px, calc((100vw - 1180px) / 2));
  color: var(--muted);
  background: rgba(3, 4, 9, 0.82);
  backdrop-filter: blur(18px);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.footer-legal {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 32px;
  font-size: 16px;
}

.footer-legal a {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  text-decoration: none;
}

.footer-legal span {
  color: var(--text);
  font-weight: 700;
}

.footer-qrcode {
  display: grid;
  justify-items: center;
  gap: 7px;
  color: var(--soft);
  font-size: 12px;
}

.footer-qrcode img {
  width: 82px;
  height: 82px;
  display: block;
  border-radius: 10px;
  padding: 5px;
  background: #fff;
  object-fit: contain;
}

@media (max-width: 900px) {
  .jiyi-page {
    width: min(100% - 28px, 1180px);
  }

  .jiyi-hero {
    min-height: 260px;
    padding: 28px;
    align-items: start;
  }

  .hero-copy {
    width: 100%;
  }

  .hero-jue {
    right: 22px;
    bottom: 14px;
    top: auto;
    width: 92px;
    height: 92px;
    transform: none;
  }

  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .section-bar,
  .comic-card {
    grid-template-columns: 1fr;
  }

  .section-bar {
    align-items: stretch;
  }

  .actions.compact {
    justify-content: flex-start;
  }

  .footer-legal {
    gap: 20px;
  }
}

@media (max-width: 560px) {
  .jiyi-hero h1 {
    font-size: 26px;
    line-height: 1;
  }

  .brand-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .hero-title-row {
    display: inline-flex;
    align-items: center;
    gap: 12px;
  }

  .hero-jue {
    position: static;
    width: 52px;
    height: 52px;
    transform: none;
  }

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

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .site-footer {
    padding: 24px 18px;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-legal {
    gap: 14px;
  }
}
