* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --gold: #D4A84B;
  --gold-light: #F0D080;
  --gold-dark: #8B6914;
  --bg-dark: #050508;
  --bg-mid: #0d0d15;
  --info-width: 38%;
  --portrait-width: 62%;

  /* 稀有度色系 */
  --rarity-legendary: #FF6B00;
  --rarity-epic: #B04AE0;
  --rarity-rare: #3D7EFF;
  --rarity-common: #888;
}

html, body {
  font-family: "Noto Serif SC", -apple-system, "PingFang SC", "Microsoft YaHei", serif;
  background: #000;
  color: #e8e6e3;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

#app {
  width: 100%;
  height: 100vh;
  overflow: hidden;
  position: fixed;
  inset: 0;
}

#landscape {
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

/* ===== 角色展示容器 ===== */
#card-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: row;
}

/* ===== 左侧：立绘区 ===== */
.portrait-area {
  width: var(--portrait-width);
  height: 100%;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-dark);
}

.hero-fullscreen {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  z-index: 1;
  animation: heroReveal 1.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes heroReveal {
  0%   { opacity: 0; transform: scale(1.2); filter: brightness(3) blur(20px) contrast(1.5); }
  40%  { opacity: 0.7; filter: brightness(1.8) blur(6px) contrast(1.2); }
  100% { opacity: 1; transform: scale(1); filter: brightness(0.9) contrast(1.05); }
}

/* 暗角效果 */
.portrait-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 90% at 40% 50%, transparent 30%, rgba(0,0,0,0.5) 80%, rgba(0,0,0,0.85) 100%),
    linear-gradient(180deg, rgba(0,0,0,0.4) 0%, transparent 20%, transparent 70%, rgba(0,0,0,0.6) 100%);
}

/* 立绘右侧渐变过渡 */
.portrait-edge-fade {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 180px;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, rgba(5,5,8,0.6) 60%, rgba(5,5,8,1) 100%);
}

/* 稀有度氛围光晕 */
.rarity-aura {
  position: absolute;
  top: 50%;
  left: 45%;
  transform: translate(-50%, -50%);
  width: 60%;
  height: 70%;
  border-radius: 50%;
  filter: blur(120px);
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  animation: auraPulse 4s ease-in-out infinite;
}

@keyframes auraPulse {
  0%, 100% { opacity: 0.15; transform: translate(-50%, -50%) scale(0.85); }
  50%      { opacity: 0.35; transform: translate(-50%, -50%) scale(1.1); }
}

/* 粒子光尘 */
.particles {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  overflow: hidden;
}

.particles span {
  position: absolute;
  bottom: -10px;
  width: 3px;
  height: 3px;
  background: rgba(255, 220, 150, 0.6);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(255, 220, 150, 0.5);
  animation: floatUp linear infinite;
}

.particles span:nth-child(1) { left: 10%; animation-duration: 8s; animation-delay: 0s; }
.particles span:nth-child(2) { left: 25%; animation-duration: 12s; animation-delay: 2s; width: 2px; height: 2px; }
.particles span:nth-child(3) { left: 40%; animation-duration: 10s; animation-delay: 4s; }
.particles span:nth-child(4) { left: 55%; animation-duration: 14s; animation-delay: 1s; width: 2px; height: 2px; }
.particles span:nth-child(5) { left: 70%; animation-duration: 9s; animation-delay: 3s; }
.particles span:nth-child(6) { left: 82%; animation-duration: 13s; animation-delay: 5s; width: 4px; height: 4px; }
.particles span:nth-child(7) { left: 15%; animation-duration: 11s; animation-delay: 6s; width: 2px; height: 2px; }
.particles span:nth-child(8) { left: 65%; animation-duration: 15s; animation-delay: 2.5s; }

@keyframes floatUp {
  0%   { transform: translateY(0) translateX(0); opacity: 0; }
  10%  { opacity: 0.8; }
  90%  { opacity: 0.4; }
  100% { transform: translateY(-100vh) translateX(20px); opacity: 0; }
}

/* ===== 右侧：信息面板 ===== */
.info-area {
  width: var(--info-width);
  height: 100%;
  background:
    linear-gradient(135deg, rgba(8,8,14,0.97) 0%, rgba(16,14,26,0.97) 50%, rgba(5,5,10,0.98) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 40px;
  flex-shrink: 0;
  animation: panelSlide 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both;
  border-left: 1px solid rgba(212, 168, 75, 0.15);
}

@keyframes panelSlide {
  0%   { transform: translateX(60px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

/* 信息面板装饰边框 */
.info-area::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8%;
  bottom: 8%;
  width: 3px;
  background: linear-gradient(180deg,
    transparent,
    rgba(212,168,75,0.6) 15%,
    rgba(212,168,75,0.3) 50%,
    rgba(212,168,75,0.6) 85%,
    transparent
  );
  box-shadow: 0 0 12px rgba(212,168,75,0.3);
}

/* ===== 稀有度标签 — 金属烫金质感 ===== */
.rarity-badge {
  position: absolute;
  top: 28px;
  right: 28px;
  padding: 6px 18px;
  border-radius: 2px;
  font-family: "Cinzel", serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 4px;
  z-index: 10;
  text-transform: uppercase;
  border: 1px solid rgba(255,255,255,0.1);
}

.rarity-badge.rarity-Legendary {
  background: linear-gradient(135deg, #8B2500 0%, #FF4500 30%, #FFD700 50%, #FF6B00 70%, #8B2500 100%);
  background-size: 200% 200%;
  color: #1a0500;
  text-shadow: 0 1px 2px rgba(255,200,100,0.5);
  box-shadow:
    0 0 20px rgba(255,107,0,0.5),
    inset 0 1px 2px rgba(255,255,200,0.4),
    inset 0 -1px 2px rgba(0,0,0,0.3);
  animation: metallicShine 3s ease-in-out infinite;
}

.rarity-badge.rarity-Epic {
  background: linear-gradient(135deg, #2D0A4E 0%, #6B00B0 30%, #D060FF 50%, #8B2DD0 70%, #2D0A4E 100%);
  background-size: 200% 200%;
  color: #f0e8ff;
  text-shadow: 0 1px 2px rgba(200,100,255,0.5);
  box-shadow:
    0 0 16px rgba(176,74,224,0.5),
    inset 0 1px 2px rgba(255,200,255,0.3),
    inset 0 -1px 2px rgba(0,0,0,0.3);
  animation: metallicShine 3s ease-in-out infinite;
}

.rarity-badge.rarity-Rare {
  background: linear-gradient(135deg, #0A1A3E 0%, #1A4BB0 30%, #5A9EFF 50%, #2D6BD0 70%, #0A1A3E 100%);
  background-size: 200% 200%;
  color: #e8f0ff;
  text-shadow: 0 1px 2px rgba(100,150,255,0.5);
  box-shadow:
    0 0 14px rgba(61,126,255,0.4),
    inset 0 1px 2px rgba(200,220,255,0.3),
    inset 0 -1px 2px rgba(0,0,0,0.3);
  animation: metallicShine 3s ease-in-out infinite;
}

.rarity-badge.rarity-Common {
  background: linear-gradient(135deg, #2a2a2a 0%, #666 30%, #bbb 50%, #777 70%, #2a2a2a 100%);
  background-size: 200% 200%;
  color: #e0e0e0;
  box-shadow:
    0 0 8px rgba(150,150,150,0.3),
    inset 0 1px 2px rgba(255,255,255,0.2),
    inset 0 -1px 2px rgba(0,0,0,0.3);
  animation: metallicShine 4s ease-in-out infinite;
}

@keyframes metallicShine {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

/* ===== 信息内容 ===== */
.info-content {
  position: relative;
  z-index: 2;
}

/* 名称区 */
.name-section {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.name-decoration {
  width: 4px;
  height: 44px;
  background: linear-gradient(180deg, var(--gold-light), var(--gold), var(--gold-dark));
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(212,168,75,0.4);
  flex-shrink: 0;
}

.hero-name {
  font-family: "Noto Serif SC", serif;
  font-size: 46px;
  font-weight: 900;
  background: linear-gradient(180deg, #F8E8B8 0%, #D4A84B 40%, #8B6914 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 8px;
  filter: drop-shadow(0 2px 8px rgba(212,168,75,0.3));
}

.hero-origin {
  display: inline-block;
  font-size: 12px;
  color: rgba(212,168,75,0.4);
  letter-spacing: 4px;
  margin-bottom: 24px;
  margin-left: 16px;
  font-family: "Cinzel", serif;
  text-transform: uppercase;
}

/* 必杀技 */
.ultimate-section {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  padding: 10px 16px;
  background: linear-gradient(90deg, rgba(212,168,75,0.08), transparent);
  border-left: 2px solid rgba(212,168,75,0.3);
  border-radius: 0 4px 4px 0;
}

.ultimate-icon {
  width: 22px;
  height: 22px;
  color: var(--gold);
  flex-shrink: 0;
  filter: drop-shadow(0 0 4px rgba(212,168,75,0.4));
}

.ultimate-icon svg {
  width: 100%;
  height: 100%;
}

.ultimate-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ultimate-label {
  font-size: 9px;
  color: rgba(255,255,255,0.3);
  letter-spacing: 3px;
  font-family: "Cinzel", serif;
  text-transform: uppercase;
}

.ultimate-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--gold-light);
  text-shadow: 0 0 10px rgba(212,168,75,0.3);
  letter-spacing: 2px;
}

/* 属性条 */
.stats-section {
  margin-bottom: 24px;
}

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

.stat-label {
  font-size: 13px;
  font-weight: 700;
  color: rgba(232,230,227,0.5);
  width: 30px;
  letter-spacing: 2px;
  text-align: center;
}

.stat-track {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.04);
  border-radius: 1px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255,255,255,0.06);
}

.stat-fill {
  height: 100%;
  border-radius: 1px;
  width: 0%;
  transition: width 1.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.stat-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6));
}

.stat-fill::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 40%, rgba(255,255,255,0.15) 50%, transparent 60%);
  animation: statShimmer 2.5s ease-in-out infinite;
}

@keyframes statShimmer {
  0%, 100% { transform: translateX(-100%); }
  50%      { transform: translateX(100%); }
}

.atk-fill {
  background: linear-gradient(90deg, #4A0A0A, #C41E1E, #FF6B35);
  box-shadow: 0 0 8px rgba(255,80,30,0.5);
}
.def-fill {
  background: linear-gradient(90deg, #0A1A3A, #2050B0, #4A9EFF);
  box-shadow: 0 0 8px rgba(74,158,255,0.5);
}
.hp-fill {
  background: linear-gradient(90deg, #0A3A1A, #2AAA2A, #5FFF5F);
  box-shadow: 0 0 8px rgba(95,255,95,0.4);
}

.stat-value {
  font-family: "Cinzel", serif;
  font-size: 18px;
  font-weight: 700;
  width: 40px;
  text-align: right;
  color: rgba(232,230,227,0.9);
}

/* 背景故事 */
.lore-text {
  font-size: 13px;
  line-height: 1.8;
  color: rgba(232,230,227,0.5);
  padding: 14px 16px;
  background: rgba(0,0,0,0.35);
  border-radius: 4px;
  border-left: 2px solid rgba(212,168,75,0.3);
  font-family: "Noto Serif SC", serif;
}

/* ===== 未找到 ===== */
.error-card {
  text-align: center;
  padding-top: 30vh;
}

.error-rune {
  font-size: 72px;
  font-family: "Cinzel", serif;
  font-weight: 700;
  color: rgba(212,168,75,0.25);
  margin-bottom: 16px;
  animation: errorFloat 3s ease-in-out infinite;
}

@keyframes errorFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

.error-title {
  font-size: 20px;
  color: rgba(232,230,227,0.6);
  margin-bottom: 6px;
}

.error-hint {
  font-size: 13px;
  color: rgba(232,230,227,0.25);
}

/* ===== 召唤加载 ===== */
#loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 35vh;
  z-index: 10;
}

.summon-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top: 2px solid var(--gold);
  border-right: 2px solid rgba(212,168,75,0.15);
  animation: spin 1s linear infinite;
  position: relative;
}

.summon-circle::after {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-bottom: 2px solid var(--gold-light);
  border-left: 2px solid rgba(240,208,128,0.15);
  animation: spin 0.7s linear infinite reverse;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  margin-top: 20px;
  font-size: 13px;
  color: rgba(212,168,75,0.5);
  letter-spacing: 6px;
  font-family: "Cinzel", serif;
}

/* ===== 工具类 ===== */
.hidden { display: none !important; }
