/* ==========================================================================
   WitherMC · 下载中心专属样式
   依赖：static/css/site.css
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 页首说明
   .page-hero / .page-title / .page-lede 已移到 site.css 共用
   -------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
   2. 文件卡片
   -------------------------------------------------------------------------- */
.panel {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 26px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.015);
}

.panel-title {
  font-size: 1.1rem;
  font-weight: 650;
}

/* 文件列表 */
.file-list {
  display: grid;
  gap: 1px;
  background: var(--border);
}

.file-item {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 26px;
  background: var(--bg-elev);
  transition: background-color var(--dur) var(--ease);
}

.file-item:hover {
  background: #12141b;
}

.file-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 13px;
  color: var(--text);
  background: var(--surface-hover);
}

.file-icon svg {
  width: 22px;
  height: 22px;
}

/* 图标配色（低饱和，保持整体简洁） */
.file-icon--modpack {
  border-color: rgba(167, 139, 250, 0.3);
  background: rgba(167, 139, 250, 0.12);
  color: #c4b5fd;
}

.file-icon--android {
  border-color: rgba(61, 220, 132, 0.3);
  background: rgba(61, 220, 132, 0.12);
  color: var(--accent);
}

.file-icon--windows {
  border-color: rgba(96, 165, 250, 0.3);
  background: rgba(96, 165, 250, 0.12);
  color: #93c5fd;
}

.file-info {
  flex: 1;
  min-width: 0;
}

.file-name {
  font-size: 1.02rem;
  font-weight: 650;
}

.file-desc {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.file-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.file-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.file-meta svg {
  width: 14px;
  height: 14px;
  opacity: 0.75;
}

.file-action {
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   3. 返回链接
   -------------------------------------------------------------------------- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 26px;
  color: var(--text-muted);
  font-size: 0.93rem;
  transition: color var(--dur) var(--ease), gap var(--dur) var(--ease);
}

.back-link:hover {
  gap: 12px;
  color: var(--accent);
}

.back-link svg {
  width: 16px;
  height: 16px;
}

/* --------------------------------------------------------------------------
   4. 下载提示（Toast）
   -------------------------------------------------------------------------- */
.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 90;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 40px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: rgba(16, 18, 24, 0.96);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: auto;
  animation: toast-in 0.3s var(--ease) both;
}

.toast[data-state="closing"] {
  animation: toast-out 0.24s var(--ease) both;
}

.toast-icon {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--accent);
}

.toast-icon svg {
  width: 18px;
  height: 18px;
}

.toast--warn .toast-icon {
  color: var(--warn);
}

.toast--error .toast-icon {
  color: var(--danger);
}

.toast-body {
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
}

.toast-title {
  font-weight: 650;
}

.toast-text {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 0.84rem;
  word-break: break-all;
}

.toast-close {
  flex-shrink: 0;
  padding: 2px;
  border-radius: 6px;
  color: var(--text-muted);
  line-height: 1;
  transition: color var(--dur) var(--ease);
}

.toast-close:hover {
  color: var(--text);
}

.toast-close svg {
  width: 16px;
  height: 16px;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

/* --------------------------------------------------------------------------
   5. 响应式
   -------------------------------------------------------------------------- */
@media (max-width: 680px) {
  .panel {
    border-radius: var(--radius);
  }

  .panel-head {
    padding: 16px 18px;
  }

  /* 窄屏改成网格：图标与文字同一行，按钮独占下一行铺满，
     避免原来 flex-wrap 把图标单独挤到第一行 */
  .file-item {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    grid-template-areas:
      "icon info"
      "action action";
    align-items: start;
    gap: 14px;
    padding: 18px;
  }

  .file-icon {
    grid-area: icon;
    width: 44px;
    height: 44px;
  }

  .file-info {
    grid-area: info;
    min-width: 0;
  }

  .file-action {
    grid-area: action;
  }

  .file-action .btn {
    width: 100%;
  }

  .file-meta {
    gap: 4px 14px;
  }

  .file-name {
    font-size: 0.98rem;
  }
}
