/* ===================================================
   common.css — 网站样式
   从 index.html <style> 块分离生成
=================================================== */
:root {
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);

  --space-1:  0.25rem;  --space-2:  0.5rem;   --space-3:  0.75rem;
  --space-4:  1rem;     --space-5:  1.25rem;  --space-6:  1.5rem;
  --space-8:  2rem;     --space-10: 2.5rem;   --space-12: 3rem;
  --space-16: 4rem;

  --radius-sm: 0.25rem; --radius-md: 0.5rem;
  --radius-lg: 0.75rem; --radius-full: 9999px;
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --content-default: 1360px;
  --font-display: 'Noto Serif SC', 'SimSun', serif;
  --font-body:    'Noto Sans SC', 'SimHei', sans-serif;

  /* Color palette */
  --color-bg:            #2c2a2a;
  --color-surface:        #131009;
  --color-surface-2:      #1a1610;
  --color-surface-offset: #201c14;
  --color-surface-card:   #17130c;
  --color-border:         rgba(180,140,60,0.18);
  --color-border-accent:  rgba(200,160,60,0.45);
  --color-divider:        rgba(180,140,60,0.12);
  --color-text:           #e8dfc8;
  --color-text-muted:     #b2b2b2;
  --color-text-faint:     #5a5040;
  --color-text-inverse:   #2c2a2a;
  --color-gold:          #c8a830;
  --color-gold-light:     #eaa008;
  --color-gold-dark:      #8a6c18;
  --color-gold-glow:      rgba(200,168,48,0.15);
  --color-crimson:        #b83020;
  --color-crimson-light:  #d84030;
  --color-crimson-glow:   rgba(184,48,32,0.2);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.5);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.6);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.7);
  --shadow-gold: 0 0 20px rgba(200,168,48,0.2);
}

/* ===================================================
   BASE
=================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
body {
  min-height: 100dvh; line-height: 1.7;
  font-family: var(--font-body); font-size: var(--text-base);
  color: var(--color-text); background-color: var(--color-bg);
  background-image: radial-gradient(ellipse 80% 40% at 50% -5%, rgba(200,168,48,0.05) 0%, transparent 70%);
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--color-gold); text-decoration: none; transition: color var(--transition-interactive); }
a:hover { color: var(--color-gold-light); }
button { cursor: pointer; background: none; border: none; font: inherit; color: inherit; }
ul { list-style: none; }
table { border-collapse: collapse; width: 100%; }
:focus-visible { outline: 2px solid var(--color-gold); outline-offset: 3px; border-radius: var(--radius-sm); }
.skip-link { position: absolute; top: -100%; left: var(--space-4); background: var(--color-gold); color: var(--color-text-inverse); padding: var(--space-2) var(--space-4); border-radius: var(--radius-md); font-size: var(--text-sm); font-weight: 700; z-index: 1000; }
.skip-link:focus { top: var(--space-4); }

/* ===================================================
   DECORATIVE
=================================================== */
.section-title {
  font-family: var(--font-display); font-size: var(--text-base); font-weight: 900;
  color: #eaa008; letter-spacing: 0.1em;
  display: flex; align-items: center; gap: var(--space-3);
  height: 48px; padding: 0 var(--space-5);
  border-bottom: 1px solid rgba(200,168,48,0.25);
  background: linear-gradient(90deg, rgba(200,168,48,0.13) 0%, rgba(200,168,48,0.05) 45%, transparent 100%);
  text-shadow:
    0 1px 0 rgba(0,0,0,0.9),
    0 0 14px rgba(200,168,48,0.45),
    0 2px 6px rgba(0,0,0,0.95);
  position: relative;
}
/* 底部金线点缀 */
.section-title::after {
  content: '';
  position: absolute; bottom: 0; left: 0; width: 35%;
  height: 1px;
  background: linear-gradient(90deg, var(--color-gold), transparent);
}

/* ===================================================
   PANEL
=================================================== */
.panel {
  background: var(--color-surface-card); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-md);
  transition: box-shadow var(--transition-interactive), border-color var(--transition-interactive);
}
.panel:hover { border-color: var(--color-border-accent); box-shadow: var(--shadow-gold); }

/* ===================================================
   HERO
=================================================== */
#hero { width: 100%; position: relative; background: var(--color-bg); overflow: hidden; }
.hero-banner { width: 100%; max-height: 550px; object-fit: cover; object-position: center top; display: block; filter: brightness(0.85); }
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 35%, var(--color-bg) 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding-bottom: calc(var(--space-10) + 10px); text-align: center;
}
/* Logo slot — replace ./static/picture/logo.png with your real logo */
.hero-logo-wrap {
  position: absolute; top: 15px;
  left: 50%; transform: translateX(-50%);
  z-index: 2; pointer-events: none; text-align: center;
}
.hero-logo-img {
  width: clamp(450px, 60vw, 750px); max-height: 600px; height: auto; object-fit: contain;
  filter: drop-shadow(0 4px 24px rgba(0,0,0,0.7)); display: block;
}
.hero-main-title {
  font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 900;
  color: var(--color-gold-light);
  text-shadow: 0 0 30px rgba(200,168,48,0.6), 0 2px 8px rgba(0,0,0,0.9);
  line-height: 1.2; letter-spacing: 0.04em; margin-bottom: var(--space-3);
}
.hero-subtitle {
  font-size: var(--text-sm); color: var(--color-text-muted);
  letter-spacing: 0.15em; text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

/* ===================================================
   MAIN LAYOUT
=================================================== */
#main-content {
  max-width: var(--content-default); margin-inline: auto;
  padding: var(--space-6) var(--space-4) var(--space-12);
  display: flex; flex-direction: column; gap: var(--space-5);
}

/* ===================================================
   ROW 1 — Download(wider) | Gallery | Schedule
=================================================== */
.row-top {
  display: grid;
  grid-template-columns: 280px 1fr 270px;
  gap: var(--space-4);
  align-items: stretch;
}

/* --- Download Panel (扁平化: 2列按钮 + 说明横排) --- */
.download-body { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); }
.download-btns { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.download-btn {
  display: flex; align-items: center; justify-content: center; gap: var(--space-2);
  background: var(--color-surface-offset); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: var(--space-2) var(--space-3);
  color: var(--color-text); font-size: var(--text-xs);
  cursor: pointer; text-align: center; text-decoration: none;
  transition: all var(--transition-interactive); line-height: 1.4;
}
.download-btn:hover { background: var(--color-gold-glow); border-color: var(--color-gold); color: var(--color-gold-light); }
.download-btn-primary {
  grid-column: span 2;
  background: linear-gradient(135deg, var(--color-crimson), #8b1a10);
  border-color: var(--color-crimson); color: #fff;
  font-weight: 600; font-size: var(--text-sm); padding: var(--space-3);
}
.download-btn-primary:hover { background: linear-gradient(135deg, var(--color-crimson-light), var(--color-crimson)); color: #fff; box-shadow: 0 0 14px var(--color-crimson-glow); }
.download-btn-register {
  grid-column: span 2;
  background: linear-gradient(135deg, #eaa008, #c98400);
  border-color: #eaa008; color: #fff;
  font-weight: 600; font-size: var(--text-sm); padding: var(--space-3);
}
.download-btn-register:hover { background: linear-gradient(135deg, #f5b21a, #eaa008); color: #fff; box-shadow: 0 0 14px rgba(234, 160, 8, 0.45); }
.download-note {
  background: var(--color-surface-offset); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs); color: var(--color-text-muted);
}
.download-note strong { color: var(--color-gold); display: block; margin-bottom: 2px; }

/* --- QR popup --- */
.qr-popup {
  position: fixed; left: 0; top: 0; z-index: 9999;
  display: none; padding: var(--space-2);
  background: var(--color-surface); border: 1px solid var(--color-gold);
  border-radius: var(--radius-md); box-shadow: 0 6px 24px rgba(0,0,0,.55);
  pointer-events: none; transform: translateX(-50%);
}
.qr-popup.show { display: block; }
.qr-popup img { display: block; border-radius: var(--radius-sm); }

/* --- Gallery --- */
.gallery-panel {
  background: var(--color-surface-card); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-md);
  transition: box-shadow var(--transition-interactive), border-color var(--transition-interactive);
}
.gallery-panel:hover { border-color: var(--color-border-accent); box-shadow: var(--shadow-gold); }

/* ===================================================
   PANEL FRAME — 图片边框(九宫格式拼装,所有面板通用)
   四角原始尺寸贴角,四边拉伸补齐缺口,替代 CSS 边框
=================================================== */
.panel,
.gallery-panel {
  border: none;
  background:
    url("../image/silder-0.png") left top no-repeat,
    url("../image/silder-1.png") right top no-repeat,
    url("../image/silder-3.png") left bottom no-repeat,
    url("../image/silder-4.png") right bottom no-repeat,
    url("https://pic1.imgdb.cn/i/034dfdC6woIPQxhj7y97NU.png") 22px top / calc(100% - 44px) 48px no-repeat,
    url("../image/silder-5.png") left bottom / 100% auto no-repeat,
    url("../image/silder-6.png") left top / auto 100% no-repeat,
    url("../image/silder-7.png") right top / auto 100% no-repeat,
    var(--color-surface-card);
}
/* 窄面板(客户端下载/开区时间/联系方式)顶条换用专用窄幅纹理,避免 957px 原图压扁后纹理过密 */
#download-section,
#schedule-section,
#contact-section {
  background:
    url("../image/silder-0.png") left top no-repeat,
    url("../image/silder-1.png") right top no-repeat,
    url("../image/silder-3.png") left bottom no-repeat,
    url("../image/silder-4.png") right bottom no-repeat,
    url("../image/silder-2a.png") 22px top / calc(100% - 44px) 48px no-repeat,
    url("../image/silder-5.png") left bottom / 100% auto no-repeat,
    url("../image/silder-6.png") left top / auto 100% no-repeat,
    url("../image/silder-7.png") right top / auto 100% no-repeat,
    var(--color-surface-card);
}
/* 顶部 48px 花纹带即标题栏背景,去掉标题自身的渐变与边线避免叠线 */
.panel .section-title,
.gallery-panel .section-title { background: none; border-bottom: 0; }
.panel .section-title::after,
.gallery-panel .section-title::after { content: none; }
.gallery-track { position: relative; overflow: hidden; }
.gallery-slides { display: flex; transition: transform 0.5s cubic-bezier(0.16,1,0.3,1); }
.gallery-slide { min-width: 100%; }
.gallery-slide img { width: 100%; height: 340px; object-fit: cover; display: block; }

/* --- Gallery paging buttons (hover on panel to reveal) --- */
.gallery-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 30px; height: 61px; padding: 0; border: none; background: none;
  cursor: pointer; z-index: 2;
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition-interactive);
}
#galleryPrev { left: 16px; }
#galleryNext { right: 16px; }
.gallery-panel:hover .gallery-btn { opacity: 1; pointer-events: auto; }
.gallery-btn img { display: block; width: 100%; height: 100%; }

/* --- Schedule Table --- */
.schedule-table th, .schedule-table td {
  padding: var(--space-3) var(--space-4); text-align: center;
  font-size: var(--text-xs); border-bottom: 1px solid var(--color-divider);
}
.schedule-table th {
  font-family: var(--font-display); color: var(--color-gold); font-weight: 600;
  background: rgba(200,168,48,0.06); letter-spacing: 0.05em;
}
.schedule-table td { color: var(--color-text-muted); }
.schedule-table tr:last-child td { border-bottom: none; }
.schedule-table tr:hover td { background: rgba(200,168,48,0.04); color: var(--color-text); }
.time-badge { font-family: 'Courier New', monospace; color: var(--color-gold); font-size: var(--text-xs); font-weight: 600; }
.status-online { display: inline-flex; align-items: center; gap: 4px; color: #6daa45; font-size: var(--text-xs); }
.status-dot { width: 5px; height: 5px; border-radius: 50%; background: #6daa45; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1}50%{opacity:0.4} }

/* ===================================================
   ROW 2 — Intro(2-col grid) | Contact
=================================================== */
.row-middle {
  display: grid;
  grid-template-columns: 1fr 270px;
  gap: var(--space-3); align-items: stretch;
}

/* Game Intro — 2列网格，更扁平 */
.intro-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  padding: 0;
}
.intro-item {
  display: flex; gap: var(--space-3); align-items: flex-start;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-divider);
  transition: background var(--transition-interactive);
}
.intro-item:hover { background: rgba(200,168,48,0.03); }
/* 奇数列右边给内分隔 */
.intro-item:nth-child(odd) { border-right: 1px solid var(--color-divider); }
/* 最后两个不需要底边框 */
.intro-item:nth-last-child(-n+2) { border-bottom: none; }
.item-num {
  width: 22px; height: 22px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--color-crimson), var(--color-gold-dark));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 11px; font-weight: 700; color: #fff;
  margin-top: 2px;
}
.intro-text { font-size: var(--text-xs); color: var(--color-text-muted); line-height: 1.6; }
.intro-text strong { color: var(--color-gold-light); font-weight: 600; display: block; margin-bottom: 2px; font-size: var(--text-sm); }

/* Contact */
.contact-body { padding: var(--space-3) var(--space-4); }
.contact-item { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--color-divider); }
.contact-item:last-child { border-bottom: none; }
.contact-icon {
  width: 30px; height: 30px; border-radius: var(--radius-md);
  background: var(--color-surface-offset); border: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--color-gold);
}
.contact-label { font-size: var(--text-xs);  font-weight: 600; color: var(--color-gold); display: block; margin-bottom: 2px; }
.contact-value { font-size: var(--text-sm); color: var(--color-text); font-weight: 500; }
.contact-value.copyable { cursor: pointer; transition: color var(--transition-interactive); display: inline-flex; align-items: center; gap: var(--space-1); }
.contact-value.copyable:hover { color: var(--color-gold); }
.copy-hint { font-size: var(--text-xs); color: var(--color-text-faint); opacity: 0; transition: opacity var(--transition-interactive); }
.contact-value.copyable:hover .copy-hint { opacity: 1; }

/* ===================================================
   ROW 3 — FAQ 双列网格
=================================================== */
.faq-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
}
.faq-item { border-bottom: 1px solid var(--color-divider); }
.faq-item:nth-child(odd)  { border-right: 1px solid var(--color-divider); }
/* 最后一行不要底线（最多2个） */
.faq-item:last-child,
.faq-item:nth-last-child(2):nth-child(odd) { border-bottom: none; }
.faq-question {
  width: 100%; text-align: left; padding: var(--space-3) var(--space-4);
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-3);
  font-size: var(--text-xs); color: var(--color-text);
  font-family: var(--font-body); cursor: pointer; background: none; border: none;
  transition: color var(--transition-interactive), background var(--transition-interactive);
}
.faq-question:hover { color: var(--color-gold-light); background: rgba(200,168,48,0.03); }
.faq-question .q-num {
  flex-shrink: 0; font-size: 10px; background: var(--color-surface-offset);
  border: 1px solid var(--color-border); color: var(--color-gold);
  width: 20px; height: 20px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-family: var(--font-display);
}
.faq-question .q-text { flex: 1; text-align: left; }
.faq-chevron {
  flex-shrink: 0; width: 14px; height: 14px; color: var(--color-text-faint);
  transition: transform var(--transition-interactive), color var(--transition-interactive);
}
.faq-item.open .faq-chevron { transform: rotate(180deg); color: var(--color-gold); }
.faq-item.open .faq-question { color: var(--color-gold-light); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.35s cubic-bezier(0.16,1,0.3,1); background: rgba(200,168,48,0.03); }
.faq-item.open .faq-answer { max-height: 240px; }
.faq-answer-inner {
  padding: var(--space-2) var(--space-4) var(--space-4) calc(var(--space-4) + 30px);
  font-size: var(--text-xs); color: var(--color-text-muted); line-height: 1.8;
  border-top: 1px solid var(--color-divider);
}

/* ===================================================
   FOOTER
=================================================== */
#site-footer { border-top: 1px solid var(--color-border); background: var(--color-surface); }
.footer-inner {
  max-width: var(--content-default); margin-inline: auto;
  padding: var(--space-6) var(--space-4);
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: var(--space-4);
}
.footer-note { font-size: var(--text-xs); color: var(--color-text-faint); line-height: 1.8; text-align: center; }

/* ===================================================
   TOAST
=================================================== */
.toast {
  position: fixed; bottom: var(--space-6); left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--color-surface-2); border: 1px solid var(--color-gold); color: var(--color-gold-light);
  padding: var(--space-3) var(--space-6); border-radius: var(--radius-full);
  font-size: var(--text-sm); font-weight: 500; box-shadow: var(--shadow-lg), var(--shadow-gold);
  opacity: 0; pointer-events: none; transition: all 0.3s cubic-bezier(0.16,1,0.3,1);
  z-index: 200; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===================================================
   RESPONSIVE
=================================================== */
@media (max-width: 960px) {
  .row-top { grid-template-columns: 1fr; }
  .row-middle { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .hero-main-title { font-size: clamp(1.4rem, 5vw, 2rem); }
  #main-content { padding-inline: var(--space-3); }
  .intro-grid { grid-template-columns: 1fr; }
  .intro-item:nth-child(odd) { border-right: none; }
  .intro-item:nth-last-child(-n+2) { border-bottom: 1px solid var(--color-divider); }
  .intro-item:last-child { border-bottom: none; }
  .faq-grid { grid-template-columns: 1fr; }
  .faq-item:nth-child(odd) { border-right: none; }
}
