/* =====================================================
   磁力素材网 - 前台完整样式
   ===================================================== */

/* ---------- Reset & Base ---------- */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { font-size:14px; scroll-behavior:smooth; }
body { font-family:-apple-system,"Microsoft YaHei","PingFang SC","Helvetica Neue",sans-serif; background:#f5f5f7; color:#333; line-height:1.6; }
a { color:#6c5ce7; text-decoration:none; transition:.2s; }
a:hover { color:#5a4bd1; }
img { max-width:100%; display:block; }
input,button,select,textarea { font:inherit; }

/* ---------- Container ---------- */
.container { max-width:1200px; margin:0 auto; padding:0 16px; }

/* ---------- Top Bar ---------- */
.topbar { background:#1a1a2e; color:rgba(255,255,255,.8); font-size:12px; padding:6px 0; }
.topbar-inner { display:flex; justify-content:space-between; align-items:center; }
.topbar-right { display:flex; align-items:center; gap:12px; }
.top-link { color:rgba(255,255,255,.7); font-size:12px; }
.top-link:hover { color:#fff; }
.user-info { display:flex; align-items:center; gap:6px; color:#fff; }
.avatar-sm { width:22px; height:22px; border-radius:50%; object-fit:cover; display:inline; }

/* ---------- Badges ---------- */
.badge { display:inline-block; padding:2px 8px; border-radius:10px; font-size:11px; font-weight:600; white-space:nowrap; }
.badge-0 { background:#dfe6e9; color:#636e72; }
.badge-1 { background:#ffeaa7; color:#856404; }
.badge-2 { background:#a29bfe; color:#2d1f8e; }

/* ---------- Header ---------- */
.header { background:#fff; border-bottom:1px solid #eee; padding:12px 0; position:sticky; top:0; z-index:100; box-shadow:0 1px 4px rgba(0,0,0,.04); }
.header-inner { display:flex; align-items:center; gap:24px; }
.logo { display:flex; align-items:center; color:#1a1a2e; }
.logo h1 { font-size:22px; font-weight:700; }
.logo img { height:40px; }
.main-nav { display:flex; gap:12px; flex:1; overflow-x:auto; }
.nav-item { padding:10px 20px; border-radius:6px; font-size:15px; color:#555; white-space:nowrap; }
.nav-item:hover { background:#f0f0f5; color:#1a1a2e; }
.nav-item.active { background:#6c5ce7; color:#fff; }
.search-box { display:flex; border:1px solid #ddd; border-radius:20px; overflow:hidden; flex-shrink:0; }
.search-box input { border:none; padding:8px 14px; width:200px; outline:none; font-size:13px; }
.search-box button { background:#6c5ce7; border:none; color:#fff; padding:8px 14px; cursor:pointer; }

/* ---------- Tag Bar ---------- */
.tagbar { background:#fff; border-bottom:1px solid #eee; padding:8px 0; }
.tagbar .container { display:flex; gap:6px; overflow-x:auto; }
.tag-item { padding:4px 14px; border-radius:14px; font-size:12px; background:#f0f0f5; color:#555; white-space:nowrap; }
.tag-item:hover { background:#e0e0ea; }
.tag-item.active { background:#6c5ce7; color:#fff; }

/* ---------- Main Content ---------- */
.main-content { padding:24px 0; min-height:60vh; }
.filter-tip { padding:10px 16px; background:#fff; border-radius:6px; margin-bottom:16px; font-size:13px; }
.filter-tip a { margin-left:8px; color:#e17055; }

/* ---------- Material Grid ---------- */
.material-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); gap:16px; }
.material-card { background:#fff; border-radius:10px; overflow:hidden; transition:.25s; border:1px solid #f0f0f5; }
.material-card:hover { transform:translateY(-4px); box-shadow:0 8px 24px rgba(0,0,0,.08); }
.card-img { position:relative; aspect-ratio:4/3; background:#f0f0f5; overflow:hidden; }
.card-img img { width:100%; height:100%; object-fit:cover; }
.card-badge { position:absolute; top:6px; padding:2px 8px; border-radius:10px; font-size:11px; font-weight:600; }
.card-badge.featured { left:6px; background:#e17055; color:#fff; }
.card-badge.level { right:6px; }
.level-0 { background:rgba(255,255,255,.9); color:#636e72; }
.level-1 { background:#ffeaa7; color:#856404; }
.level-2 { background:#a29bfe; color:#fff; }
.card-body { padding:12px; }
.card-title { font-size:14px; font-weight:500; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin-bottom:4px; }
.card-meta { display:flex; justify-content:space-between; font-size:11px; color:#888; margin-bottom:6px; }
.card-tags { display:flex; flex-wrap:wrap; gap:4px; margin-bottom:6px; }
.mini-tag { padding:1px 6px; border-radius:8px; font-size:10px; background:#f0f0f5; color:#666; }
.card-stats { font-size:11px; color:#aaa; }

/* ---------- Pagination ---------- */
.pagination { display:flex; gap:6px; justify-content:center; margin-top:24px; }
.pg-btn { padding:6px 14px; border:1px solid #ddd; border-radius:4px; font-size:13px; color:#555; background:#fff; }
.pg-btn:hover { border-color:#6c5ce7; color:#6c5ce7; }
.pg-btn.active { background:#6c5ce7; color:#fff; border-color:#6c5ce7; }

/* ---------- Empty ---------- */
.empty-state { text-align:center; padding:60px 0; color:#aaa; font-size:16px; }

/* ---------- Detail Page ---------- */
.detail-wrap { display:grid; grid-template-columns:1fr 1fr; gap:32px; background:#fff; border-radius:10px; padding:24px; }
.preview-main { border-radius:8px; overflow:hidden; background:#f0f0f5; aspect-ratio:4/3; margin-bottom:12px; }
.preview-main img { width:100%; height:100%; object-fit:contain; }
.preview-thumbs { display:flex; gap:8px; overflow-x:auto; }
.preview-thumbs .thumb { width:64px; height:48px; object-fit:cover; border-radius:4px; cursor:pointer; border:2px solid transparent; opacity:.6; transition:.2s; }
.preview-thumbs .thumb:hover, .preview-thumbs .thumb.active { opacity:1; border-color:#6c5ce7; }
.detail-title { font-size:22px; font-weight:600; margin-bottom:10px; }
.detail-tags { display:flex; gap:6px; margin-bottom:16px; }
.detail-table { width:100%; border-collapse:collapse; margin-bottom:16px; }
.detail-table td { padding:8px 0; font-size:13px; border-bottom:1px solid #f5f5f5; }
.detail-table td:first-child { color:#888; width:100px; }
.detail-desc { font-size:13px; color:#666; line-height:1.8; margin-bottom:20px; background:#f8f9fa; padding:12px; border-radius:6px; }
.detail-actions { display:flex; gap:12px; align-items:center; }

/* ---------- Buttons ---------- */
.btn { display:inline-block; padding:8px 20px; border-radius:6px; border:none; cursor:pointer; font-size:14px; text-align:center; transition:.2s; text-decoration:none; }
.btn-primary { background:#6c5ce7; color:#fff; }
.btn-primary:hover { background:#5a4bd1; }
.btn-outline { background:#fff; border:1px solid #ddd; color:#555; }
.btn-outline:hover { border-color:#6c5ce7; color:#6c5ce7; }
.btn-outline.faved { background:#ffeef0; border-color:#fd79a8; color:#e84393; }
.btn-vip { background:linear-gradient(135deg,#f093fb,#f5576c); color:#fff; }
.btn-vip:hover { opacity:.9; }
.btn-svip { background:linear-gradient(135deg,#a29bfe,#6c5ce7); color:#fff; }
.btn-svip:hover { opacity:.9; }
.btn-disabled { background:#dfe6e9; color:#888; cursor:not-allowed; }
.btn-lg { padding:12px 32px; font-size:16px; }
.btn-block { display:block; width:100%; }

/* ---------- Auth Pages ---------- */
.auth-page { background:linear-gradient(135deg,#667eea,#764ba2); min-height:100vh; display:flex; align-items:center; justify-content:center; }
.auth-container { width:100%; max-width:420px; padding:20px; }
.auth-card { background:#fff; border-radius:12px; padding:36px; box-shadow:0 20px 60px rgba(0,0,0,.15); }
.auth-logo { display:block; text-align:center; font-size:20px; font-weight:700; color:#1a1a2e; margin-bottom:20px; }
.auth-card h2 { text-align:center; margin-bottom:20px; font-size:20px; }
.auth-hint { text-align:center; color:#e17055; font-size:13px; margin-bottom:16px; }
.auth-form .form-group { margin-bottom:14px; }
.auth-form label { display:block; margin-bottom:4px; font-size:13px; font-weight:500; }
.auth-form input[type="text"],.auth-form input[type="password"],.auth-form input[type="email"] { width:100%; padding:10px 14px; border:1px solid #ddd; border-radius:6px; font-size:14px; }
.auth-form input:focus { outline:none; border-color:#6c5ce7; box-shadow:0 0 0 3px rgba(108,92,231,.1); }
.required { color:#e17055; }
.auth-footer { text-align:center; margin-top:16px; font-size:13px; color:#888; }

/* ---------- Alerts ---------- */
.alert { padding:10px 14px; border-radius:6px; margin-bottom:14px; font-size:13px; }
.alert-error { background:#f8d7da; color:#721c24; }
.alert-success { background:#d4edda; color:#155724; }

/* ---------- User Panel ---------- */
.user-panel { display:grid; grid-template-columns:240px 1fr; gap:24px; }
.user-sidebar { background:#fff; border-radius:10px; padding:20px; position:sticky; top:80px; align-self:start; }
.user-card { text-align:center; margin-bottom:20px; padding-bottom:20px; border-bottom:1px solid #eee; }
.user-avatar { width:80px; height:80px; border-radius:50%; object-fit:cover; margin:0 auto 10px; }
.user-card h3 { font-size:16px; margin-bottom:4px; }
.vip-expire { font-size:11px; color:#888; }
.user-nav a { display:block; padding:10px 14px; border-radius:6px; font-size:14px; color:#555; margin-bottom:2px; }
.user-nav a:hover { background:#f0f0f5; }
.user-nav a.active { background:#6c5ce7; color:#fff; }
.user-main { background:#fff; border-radius:10px; padding:24px; min-height:400px; }
.user-main h2 { font-size:18px; margin-bottom:16px; padding-bottom:10px; border-bottom:1px solid #eee; }

/* ---------- Upgrade Cards ---------- */
.upgrade-cards { display:grid; grid-template-columns:repeat(3,1fr); gap:16px; }
.upgrade-card { border:2px solid #eee; border-radius:10px; padding:24px; text-align:center; transition:.2s; }
.upgrade-card:hover { border-color:#6c5ce7; }
.upgrade-card.vip { border-color:#ffeaa7; }
.upgrade-card.svip { border-color:#a29bfe; }
.upgrade-card h3 { font-size:18px; margin-bottom:8px; }
.upgrade-card .price { font-size:24px; font-weight:700; color:#e17055; margin-bottom:12px; }
.upgrade-card ul { list-style:none; margin-bottom:16px; font-size:13px; color:#666; }
.upgrade-card li { padding:4px 0; }
.upgrade-card li::before { content:'✓ '; color:#00b894; }

/* ---------- Data Table ---------- */
.data-table { width:100%; border-collapse:collapse; }
.data-table th, .data-table td { padding:10px 12px; text-align:left; border-bottom:1px solid #eee; font-size:13px; }
.data-table th { background:#f8f9fa; font-weight:600; }

/* ---------- Footer ---------- */
.footer { background:#1a1a2e; color:rgba(255,255,255,.6); text-align:center; padding:24px 0; margin-top:40px; font-size:12px; }
.footer-links { margin-top:8px; }
.footer-links a { color:rgba(255,255,255,.5); margin:0 8px; }

/* ---------- Responsive ---------- */
@media (max-width:768px) {
  .detail-wrap { grid-template-columns:1fr; }
  .user-panel { grid-template-columns:1fr; }
  .upgrade-cards { grid-template-columns:1fr; }
  .material-grid { grid-template-columns:repeat(auto-fill, minmax(160px, 1fr)); }
  .header-inner { flex-wrap:wrap; }
  .main-nav { order:3; width:100%; padding-top:8px; }
  .search-box { order:2; }
}
