
* { box-sizing: border-box; }

:root {
  color-scheme: dark;
  font-family: Inter, "Noto Sans SC", "Noto Sans TC", "Noto Sans JP", "Noto Sans KR",
    "Microsoft YaHei", system-ui, sans-serif;
  --bg: #0b0815;
  --panel: rgba(27, 18, 48, .78);
  --panel-strong: rgba(38, 25, 67, .94);
  --line: rgba(233, 211, 255, .18);
  --line-strong: rgba(233, 211, 255, .48);
  --text: #fffaff;
  --muted: #c6b9d7;
  --accent: #ddb4ff;
  --accent2: #92caff;
  --shadow: 0 24px 70px rgba(0,0,0,.28);
}

html { min-height: 100%; background: var(--bg); scroll-behavior: smooth; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 4%, rgba(132, 73, 192, .22), transparent 31%),
    radial-gradient(circle at 94% 8%, rgba(66, 112, 205, .19), transparent 30%),
    linear-gradient(145deg, #0b0715 0%, #130b23 44%, #090812 100%);
}

a, button, select { font: inherit; }

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .13;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, transparent, black 16%, black 78%, transparent);
}

.topbar {
  position: relative;
  z-index: 5;
  display: flex;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand, .nav-link { color: var(--text); text-decoration: none; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 800;
  letter-spacing: .04em;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: #170b24;
  background: linear-gradient(145deg, #f3dfff, #9fcfff);
}

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

.nav-link, select, .back-link {
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(18, 12, 32, .68);
}

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

select {
  min-width: 128px;
  color: var(--text);
  outline: none;
  appearance: none;
  cursor: pointer;
  padding-right: 34px;
  background:
    linear-gradient(45deg, transparent 50%, #dfc8ff 50%) calc(100% - 16px) 52% / 5px 5px no-repeat,
    linear-gradient(135deg, #dfc8ff 50%, transparent 50%) calc(100% - 11px) 52% / 5px 5px no-repeat,
    rgba(18, 12, 32, .78);
}

select option { color: #15101c; background: #fff; }

.shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 72px;
}

.hero-list { max-width: 720px; margin-bottom: 34px; }
.eyebrow {
  margin: 0 0 10px;
  color: var(--accent2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .22em;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 12px; font-size: clamp(42px, 7vw, 76px); line-height: 1.05; }
h2 { margin-bottom: 10px; font-size: clamp(34px, 5vw, 58px); line-height: 1.08; }
h3 { margin-bottom: 8px; }
.lead { color: var(--muted); font-size: clamp(15px, 2vw, 18px); }

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

.character-card {
  position: relative;
  display: flex;
  min-height: 190px;
  padding: 22px;
  align-items: flex-end;
  gap: 14px;
  overflow: hidden;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(circle at 88% 15%, rgba(153, 111, 245, .18), transparent 36%),
    var(--panel);
  box-shadow: 0 16px 46px rgba(0,0,0,.20);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.character-card:hover, .character-card:focus-visible,
.thumb:hover, .thumb:focus-visible,
.artwork-card:hover, .artwork-card:focus-visible {
  transform: translateY(-5px);
  border-color: var(--line-strong);
  outline: none;
}

.character-mark {
  display: grid;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 18px;
  color: #21102d;
  font-size: 22px;
  font-weight: 900;
  background: linear-gradient(145deg, #f3dcff, #9bcfff);
}

.character-name { display: block; font-size: 20px; font-weight: 800; line-height: 1.25; }
.character-roman { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }

.back-link {
  display: inline-flex;
  margin-bottom: 18px;
  color: var(--muted);
  text-decoration: none;
}

.character-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, .95fr);
  gap: 22px;
  margin-bottom: 44px;
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.intro-column {
  display: flex;
  min-height: 420px;
  flex-direction: column;
}

.name-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.big-mark {
  display: grid;
  width: 76px;
  height: 76px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 22px;
  color: #21102d;
  font-size: 30px;
  font-weight: 900;
  background: linear-gradient(145deg, #f3dcff, #9bcfff);
}

.roman { color: var(--muted); font-size: 14px; }

.intro-box, .details-box {
  padding: 19px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(10,7,18,.28);
}

.intro-box { margin-top: 8px; }
.details-box { margin-top: 14px; }
.box-label {
  display: block;
  margin-bottom: 9px;
  color: var(--accent2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .17em;
}

.portrait-box {
  position: relative;
  min-height: 420px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 23px;
  background:
    radial-gradient(circle at 50% 38%, rgba(180, 130, 255, .32), transparent 33%),
    radial-gradient(circle at 60% 75%, rgba(91, 157, 255, .22), transparent 32%),
    linear-gradient(145deg, rgba(58,38,95,.75), rgba(20,17,45,.82));
}

.portrait-silhouette {
  position: absolute;
  left: 50%;
  bottom: -22px;
  width: 58%;
  aspect-ratio: .62;
  transform: translateX(-50%);
  border-radius: 48% 48% 16% 16% / 26% 26% 12% 12%;
  background:
    radial-gradient(circle at 50% 15%, rgba(255,255,255,.72) 0 12%, transparent 12.5%),
    linear-gradient(160deg, rgba(241,220,255,.84), rgba(124,169,255,.66));
  filter: drop-shadow(0 24px 40px rgba(0,0,0,.28));
  opacity: .88;
}

.portrait-label {
  position: absolute;
  right: 16px;
  bottom: 14px;
  left: 16px;
  padding: 10px 12px;
  text-align: center;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(12,9,23,.68);
}

.gallery-head {
  display: flex;
  margin-bottom: 20px;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.gallery-head p { margin-bottom: 0; color: var(--muted); }
.page-badge {
  padding: 9px 12px;
  white-space: nowrap;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(18,12,32,.65);
}

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

.thumb {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(circle at 32% 28%, rgba(255,255,255,.20), transparent 17%),
    linear-gradient(145deg, hsl(var(--hue) 58% 42%), hsl(calc(var(--hue) + 52) 60% 22%));
  transition: transform .18s ease, border-color .18s ease;
}

.thumb::before {
  position: absolute;
  inset: 16% 22%;
  content: "";
  border-radius: 42% 42% 18% 18% / 24% 24% 14% 14%;
  background: linear-gradient(160deg, rgba(255,255,255,.64), rgba(255,255,255,.08));
  opacity: .72;
}

.thumb-number {
  position: absolute;
  right: 10px;
  bottom: 9px;
  padding: 5px 8px;
  border-radius: 9px;
  background: rgba(8,6,16,.62);
  font-size: 11px;
  font-weight: 800;
}

.pagination {
  display: flex;
  margin-top: 28px;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.page-link {
  min-width: 42px;
  padding: 10px 13px;
  text-align: center;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(18,12,32,.68);
}

.page-link.current {
  color: #170b24;
  border-color: transparent;
  background: linear-gradient(145deg, #f0d8ff, #9ecfff);
  font-weight: 800;
}

.page-link.disabled { opacity: .35; pointer-events: none; }

.artwork-layout {
  display: grid;
  grid-template-columns: minmax(0,1.25fr) minmax(290px,.75fr);
  gap: 22px;
  align-items: start;
}

.artwork-card, .info-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.artwork-card {
  padding: 20px;
  transition: transform .18s ease, border-color .18s ease;
}

.display-image {
  display: grid;
  width: 100%;
  min-height: 600px;
  place-items: center;
  overflow: hidden;
  border-radius: 17px;
  background:
    radial-gradient(circle at 35% 25%, rgba(255,255,255,.20), transparent 18%),
    linear-gradient(145deg, hsl(var(--hue) 57% 39%), hsl(calc(var(--hue) + 48) 58% 18%));
}

.display-image::before {
  width: 42%;
  aspect-ratio: .62;
  content: "";
  border-radius: 45% 45% 17% 17% / 24% 24% 13% 13%;
  background: linear-gradient(160deg, rgba(255,255,255,.78), rgba(255,255,255,.12));
}

.image-caption {
  margin: 14px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.info-card { padding: 24px; }
.info-list { display: grid; gap: 0; margin: 22px 0; }
.info-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.info-row span:first-child { color: var(--muted); }

.original-button {
  width: 100%;
  padding: 13px 16px;
  color: #170b24;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(145deg, #f0d8ff, #9ecfff);
  font-weight: 900;
  cursor: pointer;
}

.modal {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: none;
  padding: 24px;
  place-items: center;
  background: rgba(3,2,8,.88);
}

.modal.open { display: grid; }
.modal-panel {
  width: min(1100px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: #0e0a18;
}

.modal-top {
  display: flex;
  margin-bottom: 12px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.close-button {
  padding: 9px 13px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255,255,255,.06);
  cursor: pointer;
}

.original-image {
  display: grid;
  width: 100%;
  min-height: 900px;
  place-items: center;
  border-radius: 16px;
  background:
    radial-gradient(circle at 35% 25%, rgba(255,255,255,.22), transparent 18%),
    linear-gradient(145deg, hsl(var(--hue) 57% 40%), hsl(calc(var(--hue) + 48) 58% 16%));
}

.original-image::before {
  width: 38%;
  aspect-ratio: .62;
  content: "";
  border-radius: 45% 45% 17% 17% / 24% 24% 13% 13%;
  background: linear-gradient(160deg, rgba(255,255,255,.82), rgba(255,255,255,.12));
}

footer {
  padding: 28px 0;
  color: rgba(207,192,224,.52);
  text-align: center;
  font-size: 12px;
}

@media (max-width: 980px) {
  .character-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .gallery-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .character-hero { grid-template-columns: 1fr; }
  .portrait-box { min-height: 360px; }
  .artwork-layout { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .brand > span:last-child, .nav-link:first-child { display: none; }
  .shell { padding-top: 25px; }
  .character-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .character-hero { padding: 20px; }
  .intro-column { min-height: auto; }
  .name-row { align-items: flex-start; }
  .gallery-head { align-items: flex-start; flex-direction: column; }
  .display-image { min-height: 430px; }
  .original-image { min-height: 620px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .character-card, .thumb, .artwork-card { transition: none; }
}


.profile-link-card {
  display: flex;
  margin-top: 14px;
  padding: 18px 20px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(circle at 92% 18%, rgba(145, 193, 255, .18), transparent 30%),
    rgba(10, 7, 18, .32);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.profile-link-card:hover,
.profile-link-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  background:
    radial-gradient(circle at 92% 18%, rgba(145, 193, 255, .28), transparent 34%),
    rgba(20, 13, 36, .58);
  outline: none;
}

.profile-link-copy {
  display: grid;
  gap: 6px;
}

.profile-link-title {
  font-weight: 850;
}

.profile-link-subtitle {
  color: var(--muted);
  font-size: 13px;
}

.profile-link-arrow {
  color: var(--accent);
  font-size: 22px;
}

.origin-legend {
  display: flex;
  margin-top: 10px;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.origin-legend-title {
  color: var(--text);
  font-weight: 800;
}

.origin-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.origin-dot,
.thumb-origin {
  display: inline-block;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(8, 6, 16, .42);
}

.origin-dot {
  width: 10px;
  height: 10px;
}

.thumb-origin {
  position: absolute;
  z-index: 3;
  top: 10px;
  right: 10px;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255,255,255,.92);
}

.origin-self {
  background: #35c56f;
}

.origin-authorized {
  background: #4d9cff;
}

.profile-page-head {
  display: flex;
  margin-bottom: 22px;
  align-items: center;
  gap: 18px;
}

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

.profile-section {
  min-height: 210px;
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: 21px;
  background:
    radial-gradient(circle at 90% 12%, rgba(155, 117, 247, .14), transparent 30%),
    var(--panel);
  box-shadow: 0 16px 46px rgba(0,0,0,.17);
}

.profile-section h3 {
  margin-bottom: 14px;
  color: var(--accent2);
}

.profile-section p {
  color: var(--muted);
  line-height: 1.8;
}

@media (max-width: 720px) {
  .profile-sections {
    grid-template-columns: 1fr;
  }
}


.profile-visuals {
  margin-top: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.profile-visuals-head {
  display: flex;
  margin-bottom: 18px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.profile-visuals-head p {
  margin: 0;
  color: var(--muted);
}

.view-only-badge {
  display: inline-flex;
  padding: 7px 10px;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(104, 204, 255, .35);
  border-radius: 999px;
  color: #bfe7ff;
  background: rgba(52, 137, 191, .13);
  font-size: 12px;
  font-weight: 800;
}

.visual-grid {
  display: grid;
  grid-template-columns: minmax(280px, .8fr) minmax(360px, 1.2fr);
  gap: 16px;
}

.visual-card {
  position: relative;
  min-height: 480px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 34%, rgba(186, 137, 255, .30), transparent 32%),
    radial-gradient(circle at 62% 78%, rgba(88, 158, 255, .20), transparent 30%),
    linear-gradient(145deg, rgba(60, 39, 96, .78), rgba(19, 17, 43, .88));
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.visual-card.key-visual {
  min-height: 480px;
}

.visual-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.visual-placeholder::before {
  width: 44%;
  aspect-ratio: .62;
  content: "";
  border-radius: 46% 46% 16% 16% / 25% 25% 12% 12%;
  background: linear-gradient(160deg, rgba(244,226,255,.86), rgba(122,170,255,.58));
  filter: drop-shadow(0 28px 48px rgba(0,0,0,.30));
}

.key-visual .visual-placeholder::before {
  width: 70%;
  aspect-ratio: 1.5;
  border-radius: 28px;
  transform: rotate(-4deg);
}

.visual-label {
  position: absolute;
  z-index: 3;
  right: 14px;
  bottom: 14px;
  left: 14px;
  display: flex;
  padding: 10px 12px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(10, 7, 19, .72);
  pointer-events: none;
}

.visual-protection-overlay {
  position: absolute;
  z-index: 2;
  inset: 0;
  background: transparent;
}

.view-only-notice {
  margin-top: 16px;
  padding: 14px 16px;
  color: var(--muted);
  border: 1px dashed rgba(233,211,255,.22);
  border-radius: 15px;
  background: rgba(8,6,15,.25);
  line-height: 1.7;
}

@media (max-width: 900px) {
  .visual-grid {
    grid-template-columns: 1fr;
  }
  .visual-card,
  .visual-card.key-visual {
    min-height: 390px;
  }
}


/* v4：真实图片与空画廊 */
.portrait-silhouette,
.visual-placeholder,
.display-image::before,
.original-image::before {
  display: none !important;
  content: none !important;
}

.thumb {
  background: #110c1e;
}

.thumb::before {
  display: none;
  content: none;
}

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

.real-display-image {
  display: block;
  width: 100%;
  max-height: min(78vh, 980px);
  object-fit: contain;
  border-radius: 17px;
  background: rgba(5, 4, 10, .48);
}

.empty-gallery {
  display: grid;
  min-height: 260px;
  place-items: center;
  padding: 30px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 20px;
  background: rgba(10, 7, 18, .24);
}

.original-link {
  display: block;
  width: 100%;
  padding: 13px 16px;
  color: #170b24;
  text-align: center;
  text-decoration: none;
  border-radius: 13px;
  background: linear-gradient(145deg, #f0d8ff, #9ecfff);
  font-weight: 900;
}

.artwork-file-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.profile-visuals {
  display: none !important;
}
