/* ============================================================
   components.css — 站点布局与业务组件（导航、卡片、栅格、后台）
   ============================================================ */

/* ---------------- 顶部导航栏 ---------------- */
.mc-navbar {
  position: sticky; top: 0; z-index: 500;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px;
  background: var(--mc-dirt);
  background-image: linear-gradient(45deg, var(--mc-dirt-dark) 25%, transparent 25%, transparent 75%, var(--mc-dirt-dark) 75%);
  background-size: 12px 12px;
  border-bottom: 6px solid var(--mc-grass);
  box-shadow: 0 6px 0 var(--mc-grass-dk), 0 4px 12px rgba(0,0,0,0.5);
}
.mc-logo {
  font-size: 22px; font-weight: bold; color: #fff;
  text-shadow: 3px 3px 0 var(--mc-grass-dk); display:flex; align-items:center; gap:8px;
}
.mc-nav-links { display: flex; gap: 10px; align-items: center; }

/* ---------------- 主容器 ---------------- */
.mc-container { max-width: 1200px; margin: 0 auto; padding: 24px 16px; }

/* ---------------- 热门资源轮播图 ---------------- */
.mc-carousel-mount { margin-bottom: 22px; }
.mc-carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 4px solid var(--border-dark);
  box-shadow: inset 3px 3px 0 var(--mc-panel-lt), inset -3px -3px 0 var(--mc-panel-dk), 0 6px 14px rgba(0,0,0,.45);
  background: #2a2a2a;
  image-rendering: pixelated;
}
.mc-carousel__track {
  display: flex;
  transition: transform .45s steps(6);
  will-change: transform;
}
.mc-carousel__slide {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  height: 340px;
  cursor: pointer;
  overflow: hidden;
}
.mc-carousel__img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.mc-carousel__img--placeholder {
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.5);
  background: #555 repeating-linear-gradient(45deg,#4a4a4a 0,#4a4a4a 14px,#565656 14px,#565656 28px);
}
.mc-carousel__caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  background: linear-gradient(to top, rgba(0,0,0,.78), rgba(0,0,0,0));
}
.mc-carousel__title {
  color: #fff; font-weight: bold; font-size: 18px;
  text-shadow: 2px 2px 0 #000;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mc-carousel__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.45);
  border: 3px solid var(--border-dark);
  color: #fff; cursor: pointer;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.2);
}
.mc-carousel__nav:hover { background: rgba(0,0,0,.7); }
.mc-carousel__nav--prev { left: 10px; }
.mc-carousel__nav--next { right: 10px; }
.mc-carousel__dots {
  position: absolute; left: 0; right: 0; bottom: 8px;
  display: flex; gap: 8px; justify-content: center;
}
.mc-carousel__dot {
  width: 12px; height: 12px;
  background: rgba(255,255,255,.45);
  border: 2px solid var(--border-dark);
  cursor: pointer;
  transition: background .15s;
}
.mc-carousel__dot.active { background: var(--mc-grass); }

@media (max-width: 768px) {
  .mc-carousel__slide { height: 200px; }
  .mc-carousel__title { font-size: 15px; }
  .mc-carousel__nav { width: 32px; height: 44px; }
  .mc-carousel__caption { padding: 10px 12px; }
}
@media (max-width: 480px) {
  .mc-carousel__slide { height: 160px; }
  .mc-carousel__nav { display: none; }
}

/* ---------------- 分类筛选条 ---------------- */
.mc-filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.mc-tab {
  padding: 8px 16px; cursor: pointer; font-weight: bold; color: #fff;
  background: var(--mc-stone); border: 3px solid var(--border-dark);
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.3), inset -2px -2px 0 rgba(0,0,0,.3);
  text-shadow: 1px 1px 0 #000;
}
.mc-tab--active { background: var(--mc-grass); }

/* ---------------- 资源卡片栅格 ---------------- */
.mc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}
.mc-card {
  background: var(--mc-panel); border: 4px solid var(--border-dark);
  box-shadow: inset 3px 3px 0 var(--mc-panel-lt), inset -3px -3px 0 var(--mc-panel-dk);
  overflow: hidden; cursor: pointer; transition: transform 0.08s;
  display: flex; flex-direction: column;
}
.mc-card:hover { transform: translateY(-3px); }
.mc-card__cover {
  width: 100%; height: 150px; object-fit: cover;
  background: #555 repeating-linear-gradient(45deg,#4a4a4a 0,#4a4a4a 10px,#565656 10px,#565656 20px);
  border-bottom: 4px solid var(--border-dark);
}
.mc-card__body { padding: 10px 12px; color: var(--mc-text-dark); flex: 1; display:flex; flex-direction:column; }
.mc-card__title { font-size: 15px; font-weight: bold; margin-bottom: 4px; line-height: 1.3;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.mc-card__summary { font-size: 12px; color: #555; flex:1;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.mc-card__meta { display:flex; justify-content:space-between; align-items:center; margin-top:8px; font-size:11px; color:#666; }

/* ---------------- 认证页居中卡片 ---------------- */
.mc-auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.mc-auth-card { width: 100%; max-width: 420px; }
.mc-auth-card .mc-modal__body { padding: 26px; }
.mc-code-row { display: flex; gap: 10px; }
.mc-code-row .mc-input { flex: 1; }

/* ---------------- 上传区 ---------------- */
.mc-upload-zone {
  border: 4px dashed var(--mc-stone-dk); background: #9a9a9a;
  padding: 30px; text-align: center; color: #333; cursor: pointer;
}
.mc-upload-zone:hover { background: #a8a8a8; }
.mc-file-preview { display:flex; gap:10px; flex-wrap:wrap; margin-top:12px; }
.mc-file-preview img { width:72px; height:72px; object-fit:cover; border:3px solid var(--border-dark); }

/* ---------------- 后台布局 ---------------- */
.mc-admin { display: flex; min-height: 100vh; }
.mc-sidebar {
  width: 210px; flex-shrink: 0; padding: 16px 0;
  background: var(--mc-stone-dk); border-right: 5px solid var(--border-dark);
}
.mc-sidebar__item {
  display: block; padding: 14px 20px; color: #ddd; font-weight: bold; cursor: pointer;
  border-left: 5px solid transparent; text-shadow: 1px 1px 0 #000;
}
.mc-sidebar__item:hover { background: rgba(0,0,0,0.2); color:#fff; text-decoration:none; }
.mc-sidebar__item--active { background: var(--mc-grass-dk); border-left-color: var(--mc-exp); color: #fff; }
.mc-admin-main { flex: 1; padding: 24px; overflow-x: auto; }

/* 数据看板卡片 */
.mc-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 16px; margin-bottom: 24px; }
.mc-stat-card { padding: 18px; text-align: center; }
.mc-stat-card .num { font-size: 32px; font-weight: bold; color: var(--mc-grass-dk); text-shadow: 1px 1px 0 #fff; }
.mc-stat-card .lbl { font-size: 13px; color: #444; margin-top: 6px; }

/* 后台表格 */
.mc-table { width: 100%; border-collapse: collapse; background: var(--mc-panel); color: var(--mc-text-dark); }
.mc-table th, .mc-table td { padding: 10px 12px; border: 2px solid var(--mc-panel-dk); text-align: left; font-size: 13px; }
.mc-table th { background: var(--mc-stone); color: #fff; text-shadow: 1px 1px 0 #000; }
.mc-table tr:nth-child(even) td { background: #d8d8d8; }
.mc-table td .mc-btn { margin-right: 4px; }

/* 分页 */
.mc-pager { display:flex; gap:8px; justify-content:center; align-items:center; margin-top:20px; }

/* 空状态 */
.mc-empty { text-align:center; padding:50px 20px; color:#999; }

/* 加载 */
.mc-loading { text-align:center; padding:30px; color:#ccc; }
.mc-spinner {
  display:inline-block; width:24px; height:24px; background: var(--mc-grass);
  animation: spin 1s steps(8) infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 详情页 */
.mc-detail { display: grid; grid-template-columns: 1fr; gap: 20px; }
.mc-detail__cover { width:100%; max-height:360px; object-fit:cover; border:4px solid var(--border-dark); }
.mc-detail__shots { display:flex; gap:10px; flex-wrap:wrap; }
.mc-detail__shots img { width:120px; height:80px; object-fit:cover; border:3px solid var(--border-dark); }

@media (max-width: 640px) {
  .mc-sidebar { width: 64px; }
  .mc-sidebar__item { padding: 14px 8px; font-size: 11px; text-align:center; }
  .mc-nav-links { gap: 6px; }
  .mc-nav-links .mc-btn { padding: 8px 10px; font-size: 12px; }
}

/* ---------------- 移动端汉堡菜单 ---------------- */
.mc-nav-toggle {
  display: none;
  background: var(--mc-stone);
  border: 3px solid var(--border-dark);
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.3), inset -2px -2px 0 rgba(0,0,0,.3);
  cursor: pointer;
  padding: 8px 12px;
  color: #fff;
  line-height: 1;
}
.mc-nav-toggle .mc-bar {
  display: block; width: 22px; height: 3px;
  background: #fff; margin: 4px 0;
  box-shadow: 1px 1px 0 rgba(0,0,0,.5);
}

@media (max-width: 768px) {
  .mc-nav-toggle { display: block; }
  .mc-nav-links {
    position: fixed;
    top: 56px; right: 0; left: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 12px;
    background: var(--mc-dirt);
    background-image: linear-gradient(45deg, var(--mc-dirt-dark) 25%, transparent 25%, transparent 75%, var(--mc-dirt-dark) 75%);
    background-size: 12px 12px;
    border-bottom: 6px solid var(--mc-grass);
    box-shadow: 0 8px 16px rgba(0,0,0,0.5);
    display: none;
    z-index: 499;
  }
  .mc-nav-links.mc-nav-open { display: flex; }
  .mc-nav-links .mc-btn { width: 100%; justify-content: flex-start; }
}

/* ---------------- 站内信未读红点 ---------------- */
.mc-nav-badge {
  position: absolute;
  top: -6px; right: -8px;
  min-width: 18px; height: 18px;
  padding: 0 4px;
  background: var(--mc-red);
  color: #fff;
  font-size: 11px; font-weight: bold;
  line-height: 18px;
  text-align: center;
  border: 2px solid var(--border-dark);
  border-radius: 0;
  box-shadow: 1px 1px 0 rgba(0,0,0,.4);
}
.mc-btn { position: relative; }

/* ---------------- 移动端悬浮加号按钮 (MC 风格) ---------------- */
.mc-fab {
  position: fixed;
  right: 18px; bottom: 24px;
  width: 58px; height: 58px;
  z-index: 900;
  display: flex; align-items: center; justify-content: center;
  background: var(--mc-grass-lt);
  color: #fff;
  border: 4px solid var(--border-dark);
  box-shadow:
    inset 3px 3px 0 rgba(255,255,255,.4),
    inset -3px -3px 0 var(--mc-grass-dk),
    0 6px 0 var(--mc-grass-dk),
    0 8px 16px rgba(0,0,0,.45);
  cursor: pointer;
  image-rendering: pixelated;
  transition: transform .05s;
}
.mc-fab:hover { filter: brightness(1.1); }
.mc-fab:active {
  transform: translateY(3px);
  box-shadow:
    inset -3px -3px 0 rgba(255,255,255,.35),
    inset 3px 3px 0 var(--mc-grass-dk),
    0 3px 0 var(--mc-grass-dk);
}
.mc-fab .mc-icon { filter: drop-shadow(2px 2px 0 rgba(0,0,0,.5)); }

@media (min-width: 769px) {
  .mc-fab { display: none !important; }
}
