/* ===== 资源站前台样式（还原 game.cocok.cn 风格） ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Microsoft YaHei', sans-serif;
  background: #f5f5f5; color: #333; line-height: 1.6; font-size: 14px;
}
a { color: #2c3e50; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }
.main-content { min-height: 60vh; padding-top: 18px; padding-bottom: 30px; }
.muted { color: #999; font-size: 12px; }
.ok { color: #155724; }
.bad { color: #721c24; }
.price { color: #ff5722; font-weight: bold; font-size: 18px; }
.price.free { color: #4caf50; }
.price-login { color: #999; font-size: 13px; }

/* ---- 顶部通栏（磨砂玻璃风） ---- */
.topbar {
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #475569;
  font-size: 13px;
  box-shadow: 0 1px 10px rgba(102,126,234,.10);
}
.topbar-inner { display: flex; justify-content: space-between; align-items: center; height: 34px; }
.topbar-welcome { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.topbar-links a { color: #475569; margin-left: 14px; }
.topbar-links a:hover { color: #3b82f6; }
.topbar-user { font-weight: bold; }
.vip-chip { background: #f1c40f; color: #7a5c00; font-size: 11px; border-radius: 4px; padding: 0 6px; margin-left: 6px; }
.normal-chip { background: #bdc3c7; color: #2c3e50; font-size: 11px; border-radius: 4px; padding: 0 6px; margin-left: 6px; }

/* ---- 头部导航 ---- */
.site-header { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.header-inner { display: flex; align-items: center; gap: 40px; height: 60px; }
.logo { font-size: 24px; font-weight: bold; color: #3b82f6; letter-spacing: 1px; }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .logo {
    background: linear-gradient(135deg, #3b82f6 0%, #667eea 50%, #764ba2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}
.nav { display: flex; gap: 28px; font-size: 15px; }
.nav a { color: #333; padding: 4px 2px; border-bottom: 2px solid transparent; }
.nav a.active, .nav a:hover { color: #2c3e50; border-bottom-color: #2c3e50; font-weight: bold; }

/* ---- 搜索区（磨砂玻璃风） ---- */
.search-section {
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 22px 0;
  box-shadow: 0 1px 10px rgba(102,126,234,.10);
}
.search-form { display: flex; max-width: 640px; margin: 0 auto; }
.search-form input {
  flex: 1; border: 1px solid #e2e8f0; border-radius: 25px 0 0 25px; padding: 11px 20px; font-size: 14px; outline: none;
  background: #fff; box-shadow: 0 2px 10px rgba(102,126,234,.10);
}
.search-btn {
  border: none; background: #3b82f6; color: #fff; padding: 11px 28px;
  border-radius: 0 25px 25px 0; font-size: 14px; cursor: pointer;
}
.search-btn:hover { background: #2563eb; }
.hot-words { text-align: center; margin-top: 10px; font-size: 13px; color: #64748b; }
.hot-words a { color: #475569; margin: 0 8px; }
.hot-words a:hover { color: #3b82f6; }

/* ---- 滚动动态 ---- */
.ticker {
  display: flex; align-items: center; background: #fff; border-radius: 8px;
  margin-top: 14px; padding: 8px 16px; box-shadow: 0 2px 10px rgba(0,0,0,.08); font-size: 13px;
}
.ticker-icon { margin-right: 10px; }
.ticker-view { overflow: hidden; flex: 1; height: 22px; position: relative; }
#tickerText { display: inline-block; white-space: nowrap; color: #666; transition: opacity .4s; }

/* ---- 区块标题 & 标签页 ---- */
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 12px; }
.section-head h2 { font-size: 20px; color: #3b82f6; }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .section-head h2 {
    background: linear-gradient(135deg, #3b82f6 0%, #667eea 50%, #764ba2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}
.tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.tabs a {
  background: #fff; border-radius: 20px; padding: 5px 16px; font-size: 13px; color: #555;
  box-shadow: 0 1px 3px rgba(0,0,0,.06); transition: all .2s;
}
.tabs a:hover { color: #1976d2; }
.tabs a.active { background: #1976d2; color: #fff; }

/* ---- 商品卡片 ---- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 15px; }
.card {
  background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.08);
  transition: all .3s; display: flex; flex-direction: column;
}
.card:hover { box-shadow: 0 5px 20px rgba(0,0,0,.15); transform: translateY(-3px); }
.card-img { position: relative; aspect-ratio: 16/10; background: #f5f5f5; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.badge {
  position: absolute; top: 8px; font-size: 11px; color: #fff; border-radius: 4px; padding: 1px 7px; z-index: 2;
}
.badge-welfare { left: 8px; background: #ff5722; }
.badge-vip { left: 8px; top: 30px; background: #f1c40f; color: #7a5c00; }
.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; flex: 1; }
.card-title {
  font-size: 14px; font-weight: 600; color: #333; height: 44px; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.card-tags { margin: 6px 0 4px; }
.card-tags span {
  background: #e3f2fd; color: #1976d2; font-size: 11px; border-radius: 4px; padding: 1px 7px; margin-right: 6px;
}
.card-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; }
.sales { color: #999; font-size: 12px; }
.load-more-wrap { text-align: center; margin-top: 24px; }
.empty-tip { grid-column: 1/-1; text-align: center; color: #999; padding: 60px 0; font-size: 14px; }
.empty-tip a { color: #1976d2; }

/* ---- 按钮 ---- */
.btn {
  display: inline-block; border: none; border-radius: 6px; padding: 9px 20px; font-size: 14px;
  cursor: pointer; text-align: center; transition: all .2s; color: #fff; background: #2c3e50;
}
.btn:hover { opacity: .9; }
.btn-primary { background: #3b82f6; } .btn-primary:hover { background: #2563eb; }
.btn-success { background: #4caf50; } .btn-success:hover { background: #45a049; }
.btn-warning { background: #ff9800; } .btn-warning:hover { background: #e68a00; }
.btn-danger { background: #f44336; } .btn-danger:hover { background: #da190b; }
.btn-outline { background: #fff; color: #666; border: 1px solid #ddd; }
.btn-outline:hover { border-color: #667eea; color: #667eea; }
.btn-lg { padding: 12px 26px; font-size: 15px; }
.btn-sm { padding: 4px 12px; font-size: 12px; }
.btn-block { width: 100%; margin-top: 16px; }
.btn.disabled, .btn[disabled] { background: #eee !important; color: #999 !important; cursor: not-allowed; }

/* ---- 详情页 ---- */
.detail { display: flex; gap: 24px; background: #fff; border-radius: 12px; padding: 22px; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.detail-img { width: 400px; flex-shrink: 0; border-radius: 8px; overflow: hidden; background: #f5f5f5; }
.detail-info { flex: 1; }
.detail-title { font-size: 20px; color: #2c3e50; line-height: 1.4; }
.detail-title .badge { position: static; margin-left: 8px; vertical-align: middle; }
.detail-tags { margin: 10px 0; }
.detail-tags span { background: #e3f2fd; color: #1976d2; border-radius: 4px; padding: 2px 10px; font-size: 12px; margin-right: 8px; }
.detail-price { display: flex; align-items: center; gap: 16px; margin: 14px 0; padding: 14px; background: #f8f9fa; border-radius: 8px; }
.detail-stock { list-style: none; margin: 0 0 16px; color: #666; font-size: 13px; }
.detail-stock li { padding: 3px 0; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.detail-block { background: #fff; border-radius: 12px; padding: 20px 22px; margin-top: 18px; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.detail-block h3 { font-size: 16px; color: #2c3e50; margin-bottom: 10px; border-left: 4px solid #3b82f6; padding-left: 10px; }
.download-links { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 8px; }
.btn-dl { min-width: 130px; }
.detail-desc { color: #555; font-size: 14px; }

/* ---- 登录注册 ---- */
.auth-box { max-width: 420px; margin: 30px auto; background: #fff; border-radius: 12px; padding: 30px; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.auth-box h2 { text-align: center; color: #2c3e50; margin-bottom: 18px; }
.auth-box label { display: block; margin: 12px 0 4px; font-size: 13px; color: #666; }
.auth-box input { width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; }
.auth-box input:focus { outline: none; border-color: #667eea; }
.auth-tip { text-align: center; margin-top: 16px; font-size: 13px; color: #999; }
.auth-tip a { color: #3b82f6; }

/* ---- 用户中心 ---- */
.user-info { display: flex; align-items: center; gap: 18px; background: #fff; border-radius: 12px; padding: 22px; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.user-avatar {
  width: 64px; height: 64px; border-radius: 50%; background: #2c3e50; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: bold;
}
.user-name { font-size: 18px; font-weight: bold; color: #2c3e50; }
.vip-panel { font-size: 14px; color: #555; }
.vip-panel p { margin: 6px 0; }
.vip-price { margin-top: 8px; }

/* ---- 表格 ---- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #eee; }
.table th { background: #f8f9fa; color: #666; font-weight: 600; white-space: nowrap; }
.table tr:hover td { background: #f8f9fa; }
.t-title { max-width: 320px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.t-code { font-family: Consolas, monospace; color: #c0392b; font-weight: 600; }
.level-chip { border-radius: 4px; padding: 1px 8px; font-size: 12px; color: #fff; }
.level-1 { background: #4caf50; }
.level-2 { background: #ff9800; }

/* ---- 提示 ---- */
.alert { border-radius: 8px; padding: 10px 14px; margin: 12px 0; font-size: 13px; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-info { background: #e3f2fd; color: #0d47a1; border: 1px solid #bbdefb; }

/* ---- 弹窗 ---- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 999;
  display: flex; align-items: center; justify-content: center; padding: 15px;
}
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 440px; max-height: 80vh; display: flex; flex-direction: column; }
.modal-head {
  padding: 14px 18px; font-size: 16px; font-weight: bold; color: #2c3e50;
  border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center;
}
.modal-close { cursor: pointer; color: #999; font-size: 22px; line-height: 1; }
.modal-close:hover { color: #333; }
.modal-body { padding: 18px; overflow-y: auto; font-size: 14px; color: #555; white-space: pre-wrap; }
.modal-foot { padding: 12px 18px; border-top: 1px solid #eee; text-align: right; }
.code-show {
  background: #f8f9fa; border: 1px dashed #667eea; border-radius: 8px; padding: 14px;
  text-align: center; font-family: Consolas, monospace; font-size: 17px; color: #c0392b;
  font-weight: bold; word-break: break-all; margin: 10px 0;
}

/* ---- 页脚（磨砂玻璃风） ---- */
.site-footer {
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #64748b;
  text-align: center; padding: 22px 0; font-size: 13px; margin-top: 20px;
}

/* ---- 响应式 ---- */
@media (max-width: 768px) {
  .detail { flex-direction: column; }
  .detail-img { width: 100%; }
  .header-inner { gap: 20px; }
  .logo { font-size: 20px; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .topbar-welcome { display: none; }
  .topbar-inner { justify-content: center; }
}
@media (max-width: 480px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-actions .btn { width: 100%; }
}
