/* assets/css/core/ui.css */
/* --- a11y utilities --- */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- typography helpers --- */
.text-gradient{
  background: linear-gradient(135deg, #fff 0%, var(--accent) 100%);
  background-clip: text;          /* 标准属性（有些浏览器不支持 text 值，但写了无害） */
  -webkit-background-clip: text;  /* WebKit 兼容 */
  color: transparent;             /* 标准写法 */
  -webkit-text-fill-color: transparent; /* Safari/Chrome 常用 */
}

.prose {
  color: rgba(255,255,255,0.85);
  line-height: 1.8;
  font-size: 15px;
}
.prose p { margin: 0 0 12px 0; }
.prose p:last-child { margin-bottom: 0; }

/* --- section --- */
.section {
  margin: 0 0 50px 0;
}
.section--split-top {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}
.section__head { text-align: center; margin-bottom: 20px; }
.section__title {
  font-size: 20px;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 10px 0;
}
.section__subtitle {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

/* --- grid --- */
.grid { display: grid; gap: 20px; }
.grid--cards {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

/* --- card --- */
.ui-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}
.ui-card__icon { font-size: 24px; margin-bottom: 12px; display: block; }
.ui-card__title { font-size: 18px; font-weight: 600; color: #fff; margin: 0 0 8px 0; }
.ui-card__desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
  text-align: justify;
}

/* hover only on hover-capable devices */
@media (hover: hover) {
  .ui-card--hoverlift {
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  }
  .ui-card--hoverlift:hover {
    transform: translateY(-4px);
    background: var(--panel-2);
    border-color: rgba(120,190,255,0.3);
  }
}

/* touch feedback */
@media (hover: none) {
  .ui-card--hoverlift:active {
    transform: translateY(-2px);
  }
}

/* --- panel --- */
.panel {
  background: rgba(0,0,0,0.2);
  border-radius: 20px;
  padding: 30px;
  border: 1px solid var(--border);
}
.panel--dashed { border-style: dashed; }

/* --- dual boxes --- */
.dual {
  display: flex;
  gap: 30px;
  justify-content: center;
  flex-wrap: wrap;
}
.box {
  flex: 1;
  min-width: 260px;
  background: rgba(255,255,255,0.03);
  padding: 20px;
  border-radius: 12px;
}
.box__label {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 8px 0;
}
.box__label--up { color: #8cbfff; }
.box__label--rev { color: #ff8c8c; }
.box__text {
  margin: 0;
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  line-height: 1.6;
}

/* --- badge --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
}
.badge--accent {
  background: rgba(120,190,255,0.1);
  color: var(--accent);
  margin-bottom: 16px;
}

/* --- note --- */
.note {
  font-size: 13px;
  color: var(--muted-2);
  background: rgba(0,0,0,0.3);
  padding: 15px;
  border-radius: 8px;
  border-left: 3px solid var(--border);
}
.note--accent { border-left-color: var(--accent); }

/* --- CTA --- */
.cta { margin-top: 40px; text-align: center; }
.cta__hint { color: var(--muted); font-size: 13px; margin: 0 0 16px 0; }
.cta__actions { display: inline-flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* --- Buttons extension (reuse your .btn base) --- */
.btn-primary {
  display: inline-block;
  padding: 12px 32px;
  background: var(--accent);
  color: #0e0f12;
  border-radius: 30px;
  font-family: "HanSerif", "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", serif;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 4px 20px rgba(120,190,255,0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  text-decoration: none;
}
@media (hover: hover) {
  .btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(120,190,255,0.5);
    background: #fff;
  }
}

.btn-ghost {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 30px;
  font-family: "HanSerif", "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", serif;
  font-weight: 700;
  font-size: 15px;
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
@media (hover: hover) {
  .btn-ghost:hover {
    transform: translateY(-1px);
    background: rgba(255,255,255,0.08);
    border-color: rgba(120,190,255,0.25);
  }
}

/* --- motion --- */
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.motion-fade-up { animation: fade-in-up 0.8s ease-out; }

/* reduce motion */
@media (prefers-reduced-motion: reduce) {
  .motion-fade-up { animation: none !important; }
  .ui-card--hoverlift,
  .btn-primary,
  .btn-ghost {
    transition: none !important;
  }
}

/* === 1. 统一的 Topbar (提取自 single.css [cite: 159] & decks.html [cite: 538]) === */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 6000;
  background: var(--gx-topbar-bg, rgba(10,11,15,0.85));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

/* 统一按钮样式 */
.btn-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text);
  font-family: "HanSerif", "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", serif;
  font-weight: 700;
  font-size: 18px;
  transition: all 0.2s;
  cursor: pointer;
}
.btn-icon:hover { background: rgba(255,255,255,0.15); transform: scale(1.05); }
.btn-icon:active { transform: scale(0.95); }

/* === 2. 统一弹窗容器 (提取自 single.css [cite: 197]) === */
#gx-zoom {
  position: fixed;
  inset: 0;
  z-index: 8000;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
#gx-zoom.gx-show { opacity: 1; pointer-events: auto; }
#gx-zoom.gx-hidden { display: none; }

/* === 3. 纯大图模式 (提取自 single.css [cite: 199]) === */
#gx-zoom img.zoom-mode {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 16px;
  box-shadow: 0 20px 80px rgba(0,0,0,0.8);
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}
#gx-zoom.gx-show img.zoom-mode { transform: scale(1); }

/* === 4. 详情卡片模式 (提取自 single.css [cite: 200-207]) === */
.detail-box {
  width: min(700px, 90vw);
  max-height: 85vh;
  background: #1a1b20;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 16px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
#gx-zoom.gx-show .detail-box { transform: scale(1) translateY(0); }

.detail-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.detail-title { font-size: 18px; font-weight: 600; color: #fff; }
.detail-close { 
  cursor: pointer; padding: 6px 12px; border-radius: 8px; 
  background: rgba(255,255,255,0.08); font-size: 13px; 
}
.detail-close:hover { background: rgba(255,255,255,0.15); }

.detail-body {
  flex: 1; overflow-y: auto; padding: 24px;
  display: flex; gap: 24px;
  -webkit-overflow-scrolling: touch;
}
.detail-img-wrapper { width: 180px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; }
.detail-img { width: 100%; border-radius: 10px; box-shadow: 0 5px 15px rgba(0,0,0,0.5); cursor: zoom-in; }
.detail-content { flex: 1; color: rgba(255,255,255,0.9); line-height: 1.6; }

.dt-keywords { color: #8cbfff; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px dashed rgba(255,255,255,0.1); }
.dt-section { margin-bottom: 18px; }
.dt-label { font-size: 15px; font-weight: 700; color: var(--accent, #78beff); margin-bottom: 6px; display: block; }
.dt-text { font-size: 14px; text-align: justify; }

/* 移动端适配 */
@media (max-width: 600px) {
  .detail-body { flex-direction: column; padding: 20px; }
  .detail-img-wrapper { width: 120px; margin: 0 auto 20px auto; }
}

html.gx-pseudo-fullscreen,
html.gx-pseudo-fullscreen body {
  min-height: 100dvh;
}

html.gx-pseudo-fullscreen .page {
  min-height: 100dvh;
}
