/* ============================================================
   异元库资源分享平台 - 样式文件
   ============================================================ */

/* CSS Variables */
:root {
  --primary: #2488F5;
  --primary-dark: #1a6fd4;
  --primary-light: #e8f3fe;
  --bg: #f5f7fa;
  --card-bg: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border: #e5e7eb;
  --shadow: 0 2px 12px rgba(0,0,0,.06);
  --shadow-hover: 0 8px 24px rgba(36,136,245,.15);
  --radius: 12px;
  --radius-sm: 8px;
  --cyan: #06b6d4;
  --green: #10b981;
  --purple: #8b5cf6;
  --orange: #f59e0b;
  --pink: #ec4899;
  --red: #ef4444;
}

[data-theme="dark"] {
  --primary: #3b9eff;
  --primary-dark: #2488F5;
  --primary-light: #1a2a3a;
  --bg: #0f172a;
  --card-bg: #1e293b;
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #334155;
  --shadow: 0 2px 12px rgba(0,0,0,.3);
  --shadow-hover: 0 8px 24px rgba(59,158,255,.2);
}

/* Reset */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background .3s, color .3s;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; outline: none; color: var(--text); }
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* Header */
.header {
  background: var(--card-bg);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background .3s;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 800; color: var(--primary); cursor: pointer; }
.logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: bold; font-size: 18px;
}
.nav { display: flex; align-items: center; gap: 4px; }
.nav-item { position: relative; }
.nav-link {
  padding: 8px 14px; border-radius: var(--radius-sm);
  color: var(--text-secondary); font-size: 14px; font-weight: 500;
  transition: all .2s; display: flex; align-items: center; gap: 4px; cursor: pointer;
}
.nav-link:hover, .nav-link.active { color: var(--primary); background: var(--primary-light); }

/* Mega Menu */
.mega-menu {
  position: absolute; top: 100%; left: 0;
  background: var(--card-bg);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-hover);
  padding: 20px; min-width: 600px;
  display: none; z-index: 200;
  border-top: 2px solid var(--primary);
}
.nav-item:hover .mega-menu { display: block; }
.mega-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.mega-col h4 { font-size: 13px; color: var(--primary); margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.mega-col a { display: block; padding: 5px 0; font-size: 13px; color: var(--text-secondary); transition: color .15s; cursor: pointer; }
.mega-col a:hover { color: var(--primary); padding-left: 4px; }
.mega-col .mega-empty { display: block; padding: 4px 0; font-size: 12px; color: var(--text-muted); }
.mega-footer {
  margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-muted);
}

.header-right { display: flex; align-items: center; gap: 10px; }
.theme-toggle {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); transition: all .2s;
}
.theme-toggle:hover { background: var(--bg); color: var(--primary); }
.user-menu { position: relative; }
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-size: 14px; cursor: pointer;
}
.user-dropdown {
  position: absolute; top: 100%; right: 0;
  background: var(--card-bg); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-hover); min-width: 180px;
  display: none; z-index: 200; overflow: hidden;
  padding-top: 6px;
}
.user-menu:hover .user-dropdown { display: block; }
.user-dropdown a { display: block; padding: 10px 16px; font-size: 14px; color: var(--text-secondary); transition: all .15s; cursor: pointer; }
.user-dropdown a:hover { background: var(--primary-light); color: var(--primary); }
.user-dropdown .divider { height: 1px; background: var(--border); }

/* Buttons */
.btn {
  padding: 8px 20px; border-radius: 20px; font-size: 14px; font-weight: 500;
  transition: all .2s; display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-outline { border: 1px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-ghost { color: var(--text-secondary); }
.btn-ghost:hover { color: var(--primary); background: var(--bg); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }

/* Hero */
.hero-section { padding: 32px 0 20px; text-align: center; }
.hero-title {
  font-size: 30px; font-weight: 800; margin-bottom: 6px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero-subtitle { color: var(--text-secondary); font-size: 14px; margin-bottom: 24px; }
.search-box { max-width: 560px; margin: 0 auto; position: relative; }
.search-input {
  width: 100%; padding: 12px 20px 12px 44px;
  border: 2px solid var(--border); border-radius: 30px;
  font-size: 14px; background: var(--card-bg); transition: all .2s;
}
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); }
.search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }

/* Category Bar */
.category-bar { display: flex; align-items: center; gap: 6px; margin: 20px 0; flex-wrap: wrap; justify-content: center; }
.cat-chip {
  padding: 7px 16px; border-radius: 18px; font-size: 13px; font-weight: 500;
  border: 1px solid var(--border); background: var(--card-bg); color: var(--text-secondary);
  transition: all .2s; cursor: pointer;
}
.cat-chip:hover { border-color: var(--primary); color: var(--primary); }
.cat-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Tabs */
.tabs { display: flex; justify-content: center; gap: 6px; margin-bottom: 24px; }
.tab {
  padding: 9px 20px; border-radius: 22px; font-size: 13px; font-weight: 600;
  color: var(--text-secondary); transition: all .2s; cursor: pointer;
  display: flex; align-items: center; gap: 6px;
}
.tab:hover { color: var(--primary); }
.tab.active {
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  color: #fff; box-shadow: 0 4px 12px rgba(36,136,245,.3);
}

/* App Grid */
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; margin-bottom: 36px; }
.app-card {
  background: var(--card-bg); border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow); cursor: pointer; transition: all .3s;
  position: relative; overflow: hidden; border-left: 4px solid var(--cyan);
}
.app-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.app-card.cat-windows { border-left-color: var(--primary); }
.app-card.cat-android { border-left-color: var(--green); }
.app-card.cat-tv { border-left-color: var(--purple); }
.app-card.cat-tool { border-left-color: var(--orange); }
.app-icon {
  width: 60px; height: 60px; border-radius: 14px; margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: bold; color: #fff; overflow: hidden;
}
.app-icon img { width: 100%; height: 100%; object-fit: cover; }
.app-name { font-size: 15px; font-weight: 700; text-align: center; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-desc { font-size: 12px; color: var(--text-secondary); text-align: center; margin-bottom: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-meta { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--text-muted); margin-bottom: 12px; }
.app-rating { color: var(--orange); }
.app-download-btn {
  width: 100%; padding: 9px; background: var(--primary); color: #fff;
  border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  transition: all .2s; position: relative;
}
.app-download-btn:hover { background: var(--primary-dark); }

/* Dropdown Menu */
.dropdown-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--card-bg); border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,.15); overflow: hidden; z-index: 50;
  opacity: 0; visibility: hidden; transform: translateY(-6px); transition: all .2s;
}
.dropdown-menu.show { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-item {
  padding: 10px 14px; display: flex; align-items: center; gap: 8px;
  font-size: 13px; transition: background .15s; cursor: pointer; border-bottom: 1px solid var(--border);
}
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item:hover { background: var(--primary-light); color: var(--primary); }
.di-icon { width: 26px; height: 26px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #fff; flex-shrink: 0; }
.di-name { flex: 1; font-weight: 500; }

/* Detail Page */
.detail-page { padding: 28px 0; }
.back-btn { display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary); font-size: 14px; margin-bottom: 20px; cursor: pointer; transition: color .2s; }
.back-btn:hover { color: var(--primary); }
.detail-header {
  background: var(--card-bg); border-radius: var(--radius); padding: 28px;
  box-shadow: var(--shadow); margin-bottom: 20px; display: flex; gap: 24px; align-items: flex-start;
}
.detail-icon {
  width: 88px; height: 88px; border-radius: 22px;
  display: flex; align-items: center; justify-content: center;
  font-size: 38px; font-weight: bold; color: #fff; flex-shrink: 0; overflow: hidden;
}
.detail-icon img { width: 100%; height: 100%; object-fit: cover; }
.detail-info { flex: 1; }
.detail-title { font-size: 24px; font-weight: 800; margin-bottom: 4px; }
.detail-desc { color: var(--text-secondary); font-size: 14px; margin-bottom: 14px; }
.detail-stats { display: flex; gap: 24px; flex-wrap: wrap; }
.stat-item { display: flex; flex-direction: column; }
.stat-value { font-size: 17px; font-weight: 700; }
.stat-label { font-size: 11px; color: var(--text-muted); }
.detail-actions { display: flex; gap: 10px; margin-top: 16px; }
.detail-section { background: var(--card-bg); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 20px; }
.section-title { font-size: 17px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.section-title::before { content: ''; width: 4px; height: 18px; background: var(--primary); border-radius: 2px; }

/* 应用详细介绍中的插图 */
.app-content .content-img {
  max-width: 100%; height: auto; border-radius: 8px; margin: 12px 0;
  display: block; box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.app-content p { margin: 8px 0; }

/* Download Channels */
.download-channels { display: flex; flex-direction: column; gap: 10px; }
.channel-btn {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: all .2s; cursor: pointer;
}
.channel-btn:hover { border-color: var(--primary); background: var(--primary-light); transform: translateX(4px); }
.channel-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; color: #fff; font-weight: bold; flex-shrink: 0; }
.channel-info { flex: 1; }
.channel-name { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.channel-url { font-size: 11px; color: var(--text-muted); word-break: break-all; }
.channel-action { color: var(--primary); font-size: 13px; font-weight: 600; }

/* Comments */
.comment-input-area { margin-bottom: 20px; padding: 16px; background: var(--bg); border-radius: var(--radius-sm); }
.comment-input-area textarea {
  width: 100%; min-height: 80px; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; background: var(--card-bg); resize: vertical; transition: border-color .2s;
}
.comment-input-area textarea:focus { border-color: var(--primary); }
.comment-input-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.comment-login-hint { font-size: 13px; color: var(--text-secondary); }
.comment-login-hint a { color: var(--primary); font-weight: 600; cursor: pointer; }
.comment-list { display: flex; flex-direction: column; gap: 16px; }
.comment-item { display: flex; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.comment-item:last-child { border-bottom: none; padding-bottom: 0; }
.comment-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-size: 14px; flex-shrink: 0;
}
.comment-body { flex: 1; min-width: 0; }
.comment-header { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.comment-username { font-size: 14px; font-weight: 600; }
.comment-time { font-size: 12px; color: var(--text-muted); }
.comment-content { font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 6px; word-break: break-word; }
.comment-actions { display: flex; gap: 16px; font-size: 12px; color: var(--text-muted); }
.comment-actions span { cursor: pointer; transition: color .15s; display: flex; align-items: center; gap: 4px; }
.comment-actions span:hover { color: var(--primary); }
.comment-actions span.liked { color: var(--red); }
.reply-list { margin-top: 12px; padding-left: 16px; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.reply-item { display: flex; gap: 10px; }
.reply-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-size: 12px; flex-shrink: 0;
}
.reply-body { flex: 1; }
.reply-header { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.reply-username { font-size: 13px; font-weight: 600; }
.reply-to { font-size: 12px; color: var(--text-muted); }
.reply-content { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.reply-input { margin-top: 10px; display: none; gap: 8px; }
.reply-input.show { display: flex; }
.reply-input input { flex: 1; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; background: var(--card-bg); }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; opacity: 0; visibility: hidden; transition: all .2s; padding: 20px;
}
.modal-overlay.show { opacity: 1; visibility: visible; }
.modal {
  background: var(--card-bg); border-radius: var(--radius); width: 100%; max-width: 420px;
  transform: scale(.95) translateY(10px); transition: transform .2s; overflow: hidden;
}
.modal-overlay.show .modal { transform: scale(1) translateY(0); }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-title { font-size: 18px; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 20px; transition: all .2s;
}
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: 24px; }
.auth-tabs { display: flex; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.auth-tab {
  flex: 1; padding: 10px; text-align: center; font-size: 14px; font-weight: 600;
  color: var(--text-muted); cursor: pointer; transition: all .2s; border-bottom: 2px solid transparent;
}
.auth-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Form */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.form-input {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; background: var(--card-bg); transition: border-color .2s;
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.form-row { display: flex; gap: 10px; }
.form-row .form-group { flex: 1; }
.captcha-row { display: flex; gap: 10px; align-items: flex-end; }
.captcha-row .form-group { flex: 1; }
.captcha-img {
  width: 110px; height: 42px; border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid var(--border); display: flex; align-items: center; justify-content: center;
  background: var(--bg); flex-shrink: 0; overflow: hidden;
}
.captcha-img canvas { width: 100%; height: 100%; }
.form-error { color: var(--red); font-size: 12px; margin-top: 4px; min-height: 16px; }
.form-tip { font-size: 12px; color: var(--text-muted); text-align: center; margin-top: 12px; }
.form-tip a { color: var(--primary); cursor: pointer; }

/* Disclaimer */
.disclaimer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; padding: 20px; opacity: 0; visibility: hidden; transition: all .3s;
}
.disclaimer-overlay.show { opacity: 1; visibility: visible; }
.disclaimer-box {
  background: var(--card-bg); border-radius: var(--radius); max-width: 560px; width: 100%;
  max-height: 80vh; overflow: hidden; display: flex; flex-direction: column;
  transform: scale(.95) translateY(10px); transition: transform .3s;
}
.disclaimer-overlay.show .disclaimer-box { transform: scale(1) translateY(0); }
.disclaimer-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.disclaimer-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, var(--orange), var(--red));
  display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0;
}
.disclaimer-header h2 { font-size: 18px; font-weight: 700; }
.disclaimer-body { padding: 20px 24px; overflow-y: auto; flex: 1; font-size: 13px; color: var(--text-secondary); line-height: 1.8; }
.disclaimer-body h3 { font-size: 14px; color: var(--text); margin: 12px 0 6px; font-weight: 600; }
.disclaimer-body p { margin-bottom: 8px; }
.disclaimer-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* Admin Layout */
.admin-layout { display: flex; min-height: calc(100vh - 64px); }
.admin-sidebar {
  width: 220px; background: var(--card-bg); border-right: 1px solid var(--border);
  padding: 16px 0; flex-shrink: 0;
}
.admin-sidebar-title { padding: 0 20px 12px; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.admin-nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 20px;
  font-size: 14px; color: var(--text-secondary); cursor: pointer;
  transition: all .15s; border-left: 3px solid transparent;
}
.admin-nav-item:hover { background: var(--bg); color: var(--primary); }
.admin-nav-item.active { background: var(--primary-light); color: var(--primary); border-left-color: var(--primary); }
.admin-nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.admin-content { flex: 1; padding: 24px; overflow-x: auto; }
.admin-page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.admin-page-title { font-size: 22px; font-weight: 800; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--card-bg); border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 14px;
}
.stat-card-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; }
.stat-card-info h3 { font-size: 24px; font-weight: 800; margin-bottom: 2px; }
.stat-card-info p { font-size: 12px; color: var(--text-muted); }

/* Admin Table */
.admin-table { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; width: 100%; }
.admin-table table { width: 100%; border-collapse: collapse; min-width: 600px; }
.admin-table th {
  background: var(--bg); padding: 12px 14px; text-align: left;
  font-size: 12px; font-weight: 600; color: var(--text-secondary); border-bottom: 1px solid var(--border);
}
.admin-table td { padding: 12px 14px; font-size: 13px; border-bottom: 1px solid var(--border); }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover { background: var(--bg); }
.admin-actions { display: flex; gap: 6px; }

/* Badge */
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.badge-green { background: #dcfce7; color: #16a34a; }
.badge-red { background: #fee2e2; color: #dc2626; }
.badge-orange { background: #fef3c7; color: #d97706; }
.badge-blue { background: #dbeafe; color: #2563eb; }
.badge-gray { background: #f3f4f6; color: #6b7280; }

/* Category Tree */
.cat-tree { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.cat-tree-item { padding: 8px 0; border-bottom: 1px solid var(--border); }
.cat-tree-item:last-child { border-bottom: none; }
.cat-tree-row { display: flex; align-items: center; gap: 8px; }
.cat-tree-toggle {
  width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-muted); transition: transform .2s;
}
.cat-tree-toggle.expanded { transform: rotate(90deg); }
.cat-tree-name { flex: 1; font-size: 14px; font-weight: 500; }
.cat-tree-level { font-size: 11px; color: var(--text-muted); }
.cat-tree-children { padding-left: 28px; display: none; }
.cat-tree-children.expanded { display: block; }

/* User Center */
.user-center { padding: 28px 0; }
.user-profile-header {
  background: var(--card-bg); border-radius: var(--radius); padding: 28px;
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 20px; margin-bottom: 20px;
}
.user-profile-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 32px; font-weight: bold;
}
.user-profile-info h2 { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.user-profile-info p { font-size: 13px; color: var(--text-secondary); }
.user-profile-stats { display: flex; gap: 24px; margin-top: 8px; }
.user-tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.user-tab {
  padding: 10px 20px; font-size: 14px; font-weight: 600; color: var(--text-muted);
  cursor: pointer; border-bottom: 2px solid transparent; transition: all .2s;
}
.user-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Toast */
.toast {
  position: fixed; top: 80px; left: 50%; transform: translateX(-50%) translateY(-20px);
  background: var(--text); color: var(--card-bg); padding: 12px 24px;
  border-radius: var(--radius-sm); font-size: 14px; font-weight: 500;
  z-index: 3000; opacity: 0; visibility: hidden; transition: all .3s;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
.toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

/* Empty State */
.empty-state { text-align: center; padding: 50px 20px; color: var(--text-muted); }
.empty-state-icon { font-size: 42px; margin-bottom: 12px; opacity: .4; }
.empty-state-text { font-size: 14px; }

/* Footer */
.footer {
  background: var(--card-bg); border-top: 1px solid var(--border);
  padding: 28px 0; text-align: center; color: var(--text-muted); font-size: 13px; margin-top: 36px;
}
.footer-links { display: flex; justify-content: center; gap: 20px; margin-bottom: 10px; }
.footer-links a { color: var(--text-secondary); transition: color .2s; cursor: pointer; }
.footer-links a:hover { color: var(--primary); }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 4px; margin-top: 20px; }
.page-btn {
  width: 32px; height: 32px; border-radius: 6px; display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--text-secondary); background: var(--card-bg);
  border: 1px solid var(--border); cursor: pointer; transition: all .15s;
}
.page-btn:hover, .page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Responsive */
@media (max-width: 768px) {
  .container { padding: 0 16px; }
  .header-inner { height: 56px; }
  .nav { display: none; }
  .hero-title { font-size: 22px; }
  .app-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .app-card { padding: 14px; }
  .app-icon { width: 48px; height: 48px; font-size: 20px; }
  .detail-header { flex-direction: column; padding: 20px; }
  .detail-icon { width: 64px; height: 64px; font-size: 28px; }
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; display: flex; overflow-x: auto; padding: 8px; }
  .admin-sidebar-title { display: none; }
  .admin-nav-item { white-space: nowrap; border-left: none; border-bottom: 3px solid transparent; }
  .admin-nav-item.active { border-bottom-color: var(--primary); border-left-color: transparent; }
  .mega-menu { display: none !important; }
  .form-row { flex-direction: column; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* 分类筛选栏（移动端横向滚动） */
.cat-filter {
  margin-bottom: 16px;
  -webkit-overflow-scrolling: touch;
}
.cat-filter-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.cat-filter-scroll::-webkit-scrollbar {
  display: none;
}
.cat-filter-item {
  flex-shrink: 0;
  padding: 8px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s;
  cursor: pointer;
}
.cat-filter-item:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.cat-filter-item.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* PC端隐藏分类筛选栏（用顶部导航即可），移动端显示 */
@media (min-width: 769px) {
  .cat-filter { display: none; }
}
