/* 基礎變數與主題設定 */
:root {
  --bg-color: #0b0c10;
  --card-bg: rgba(31, 33, 40, 0.5);
  --card-border: rgba(255, 255, 255, 0.08);
  --text-primary: #f2f2f2;
  --text-second: #b8b8b8;
  --accent: #66fcf1;
  --accent-glow: rgba(102, 252, 241, 0.4);
}

/* 重置預設樣式 */
* { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
}

/* 整體背景與字型 */
body {
  font-family: 'Noto Sans TC', 'Outfit', sans-serif;
  background-color: var(--bg-color);
  background-image: linear-gradient(rgba(0,0,0,0.65), rgba(0,0,0,0.65)), url('assets/bg.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header { 
  text-align: center; 
  padding: 4rem 1rem 2.5rem; 
}

header h1 { 
  font-size: 2.8rem; 
  font-weight: 700; 
  margin-bottom: 0.8rem; 
  letter-spacing: 2px;
  background: linear-gradient(90deg, #fff, #66fcf1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

header p {
  color: var(--text-second);
  font-size: 1.1rem;
}

.closed-badge {
  display: inline-block;
  margin-top: 1.2rem;
  padding: 0.5rem 1.5rem;
  background: rgba(255, 80, 80, 0.15);
  border: 1px solid rgba(255, 80, 80, 0.5);
  border-radius: 50px;
  color: #ff6b6b;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 1px;
}

main { 
  flex: 1; 
  padding: 2rem; 
  max-width: 1200px; 
  margin: 0 auto; 
  width: 100%; 
}

/* 角色展覽網格 */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 2.5rem;
}

/* --- 卡片設計 (Glassmorphism 毛玻璃效果) --- */
.role-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
  position: relative;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  color: inherit;
  cursor: pointer;
  aspect-ratio: 2 / 3;
}

/* 懸停效果 (Hover) */
.role-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 20px var(--accent-glow);
  border-color: rgba(255, 255, 255, 0.25);
}

/* 圖片容器：填滿整張卡片 */
.img-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.img-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.role-card:hover .img-container img { 
  transform: scale(1.08); 
}


/* 卡片文字區塊：半透明覆蓋在圖片底部 */
.card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1;
  padding: 1.5rem;
  background: linear-gradient(to top, rgba(11, 12, 16, 0.92) 60%, transparent 100%);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
}

.role-name { 
  font-size: 1.5rem; 
  font-weight: 700; 
  margin-bottom: 0.4rem; 
  color: #ffffff;
}

.designer {
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 1.2rem;
  font-family: 'Outfit', sans-serif;
  letter-spacing: 1px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 設計者前方的螢光點 */
.designer::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent);
}

/* 標籤群組：圖片左上角 */
.tag-group {
  position: absolute;
  top: 0.7rem;
  left: 0.7rem;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 4px;
}

.tag {
  font-size: 0.7rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 6px;
  padding: 2px 8px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  letter-spacing: 0.5px;
}

.tag-sep {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Modal 遮罩 */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 100;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
}

.modal-overlay.active {
  display: flex;
}

/* Modal 內容框 */
.modal {
  background: rgba(20, 22, 30, 0.95);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  overflow: hidden;
  max-width: 480px;
  width: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1rem;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s;
}

.modal-close:hover {
  background: rgba(255,255,255,0.15);
}

.modal-image {
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
}

.modal-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.modal-body {
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.modal-body h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
}

.modal-body p {
  font-size: 0.95rem;
  color: var(--text-second);
  line-height: 1.8;
}

/* 進入 GEM 按鈕 */
.gem-btn {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.9rem 2rem;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  color: #0b0c10;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  letter-spacing: 1px;
  border-radius: 50px;
  text-decoration: none;
  text-align: center;
  transition: opacity 0.2s, transform 0.2s;
}

.gem-btn:hover {
  opacity: 0.85;
  transform: scale(1.03);
}

footer { 
  text-align: center; 
  padding: 2rem; 
  color: var(--text-second); 
  font-size: 0.9rem; 
}
