/* ============================================================
   3丫丫 全局样式 (Razor Pages 版) — 全面优化
   ============================================================ */

:root {
  --primary: #4f46e5;
  --primary-light: #818cf8;
  --primary-dark: #3730a3;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-secondary: #64748b;
  --sidebar-width: 240px;
  --header-height: 60px;
  --radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'PingFang SC', 'Microsoft YaHei', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* 工具类 */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.text-sm { font-size: 13px; }
.text-secondary { color: var(--text-secondary); }

/* 卡片 */
.card {
  background: var(--card-bg); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.page-title { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 20px; }
.block-title { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 16px; }

/* 管理后台工具栏 */
.admin-toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 16px 20px; margin-bottom: 16px;
  background: var(--card-bg); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

/* 分页 */
.pagination-wrap { margin-top: 20px; display: flex; justify-content: center; gap: 4px; }
.pagination-right { margin-top: 16px; display: flex; justify-content: flex-end; }

/* page-btn 分页按钮 */
.page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 32px; padding: 0 8px;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; color: var(--text); text-decoration: none; transition: all .2s;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 空状态 */
.empty-wrap { display: flex; align-items: center; justify-content: center; min-height: 200px; color: var(--text-secondary); font-size: 14px; }

/* section */
.section { margin-bottom: 32px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-title { font-size: 18px; font-weight: 700; color: var(--text); }
.more-link { font-size: 14px; color: var(--primary); }
.more-link:hover { text-decoration: underline; }

/* 软件封面占位 */
.soft-cover-placeholder {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  color: #4f46e5; font-weight: 700; border-radius: 8px;
}

/* 标签 */
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; background: #e0e7ff; color: #4338ca; }
.tag.paid { background: #fef3c7; color: #d97706; }
.tag.free { background: #dcfce7; color: #16a34a; }
.tag.intranet { background: #fee2e2; color: #dc2626; }

/* info-tag 用于个人中心 */
.info-tag { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.info-tag.danger { background: #fee2e2; color: #dc2626; }
.info-tag.warning { background: #fef3c7; color: #d97706; }
.info-tag.info { background: #e0e7ff; color: #4338ca; }

/* ============================================================
   按钮样式
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px; font-family: inherit; cursor: pointer; transition: all .2s;
  background: #fff; color: var(--text); text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { opacity: .85; color: #fff; }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { opacity: .85; color: #fff; }
.btn-outline { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline:hover { background: #eef2ff; }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 4px; }
.btn-lg { padding: 12px 24px; font-size: 16px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { display: flex; width: 100%; justify-content: center; }

/* ============================================================
   表单样式
   ============================================================ */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.form-label .req { color: var(--danger); }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--text); transition: border-color .2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}
.form-textarea { min-height: 120px; resize: vertical; }
.form-hint { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }

/* ============================================================
   表格样式
   ============================================================ */
.data-table {
  width: 100%; border-collapse: collapse; background: #fff;
  border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.data-table th {
  padding: 12px 16px; text-align: left; font-size: 13px; font-weight: 600;
  color: var(--text-secondary); background: #f8fafc; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 12px 16px; font-size: 14px; color: var(--text);
  border-bottom: 1px solid var(--border);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f8fafc; }

/* table-card 包裹表格的卡片 */
.table-card { padding: 0; overflow: hidden; }
.table-card .data-table { box-shadow: none; }
.table-card .block-title { padding: 16px 20px; margin-bottom: 0; border-bottom: 1px solid var(--border); }

/* ============================================================
   弹窗/通知
   ============================================================ */
.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }
.alert-success { background: #dcfce7; color: #16a34a; border: 1px solid #86efac; }
.alert-danger { background: #fee2e2; color: #dc2626; border: 1px solid #fca5a5; }
.alert-warning { background: #fef3c7; color: #d97706; border: 1px solid #fcd34d; padding: 12px 16px; border-radius: 8px; }
.alert-info { background: #e0e7ff; color: #4338ca; border: 1px solid #a5b4fc; }

/* ============================================================
   分页控件 (pager)
   ============================================================ */
.pager { display: flex; gap: 4px; align-items: center; }
.pager a, .pager span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 32px; padding: 0 8px;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; color: var(--text); text-decoration: none; transition: all .2s;
}
.pager a:hover { border-color: var(--primary); color: var(--primary); }
.pager .active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pager .disabled { color: #cbd5e1; cursor: not-allowed; }

/* ============================================================
   软件卡片网格
   ============================================================ */
.soft-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.soft-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden;
  text-decoration: none; transition: all .2s; display: flex; flex-direction: column;
}
.soft-card:hover { border-color: #4f46e5; transform: translateY(-3px); box-shadow: 0 8px 24px rgba(79,70,229,.12); }
.soft-cover { position: relative; aspect-ratio: 16/9; overflow: hidden; background: #f8fafc; }
.soft-cover img { width: 100%; height: 100%; object-fit: cover; }
.soft-cover .placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 36px; font-weight: 800; background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%); color: #4f46e5; }
.badge { position: absolute; top: 8px; left: 8px; padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: 700; }
.badge.top-badge { background: #fbbf24; color: #fff; }
.soft-info { padding: 12px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.soft-name { font-weight: 600; font-size: 14px; color: #1e293b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.soft-meta { display: flex; align-items: center; gap: 6px; }
.soft-meta .version { font-size: 11px; color: #64748b; }
.soft-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.os-tags { display: flex; gap: 3px; flex-wrap: wrap; }
.os-tag { display: inline-block; padding: 1px 5px; background: #f1f5f9; border-radius: 3px; font-size: 10px; color: #64748b; }
.download-count { display: flex; align-items: center; gap: 3px; font-size: 11px; color: #94a3b8; }

/* ============================================================
   前台布局
   ============================================================ */
.user-layout { min-height: 100vh; display: flex; flex-direction: column; }
.header { position: sticky; top: 0; z-index: 100; background: #fff; border-bottom: 1px solid #e2e8f0; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.header-inner { display: flex; align-items: center; gap: 20px; max-width: 1280px; margin: 0 auto; padding: 12px 24px; }
.logo { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 800; color: #4f46e5; white-space: nowrap; }
.search-box { flex: 1; max-width: 480px; display: flex; gap: 0; }
.search-box input { flex: 1; padding: 8px 12px; border: 1px solid #e2e8f0; border-right: none; border-radius: 6px 0 0 6px; font-size: 14px; outline: none; }
.search-box input:focus { border-color: #4f46e5; }
.search-box button { padding: 8px 16px; background: #4f46e5; color: #fff; border: none; border-radius: 0 6px 6px 0; cursor: pointer; font-size: 14px; }
.search-box button:hover { background: #3730a3; }
.header-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.user-avatar { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 14px; position: relative; }
.avatar-circle { width: 32px; height: 32px; border-radius: 50%; background: #4f46e5; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; }
.dropdown-menu { position: absolute; top: 100%; right: 0; margin-top: 8px; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.1); min-width: 160px; z-index: 200; display: none; }
.dropdown-menu.show { display: block; }
.dropdown-item { display: flex; align-items: center; gap: 8px; padding: 10px 16px; font-size: 14px; color: var(--text); cursor: pointer; text-decoration: none; }
.dropdown-item:hover { background: #f1f5f9; color: #4f46e5; }
.dropdown-divider { height: 1px; background: #e2e8f0; margin: 4px 0; }
.category-nav { display: flex; align-items: center; gap: 4px; max-width: 1280px; margin: 0 auto; padding: 0 24px 8px; overflow-x: auto; scrollbar-width: none; }
.category-nav::-webkit-scrollbar { display: none; }
.nav-item { padding: 8px 14px; border-radius: 6px; font-size: 14px; white-space: nowrap; color: #475569; transition: all .2s; text-decoration: none; }
.nav-item:hover { background: #f1f5f9; color: #4f46e5; }
.nav-item.active { background: #e0e7ff; color: #4f46e5; font-weight: 600; }
.main-content { flex: 1; max-width: 1280px; width: 100%; margin: 0 auto; padding: 24px; }
.footer { text-align: center; padding: 20px; font-size: 13px; color: #94a3b8; border-top: 1px solid #e2e8f0; background: #fff; }

/* ============================================================
   后台布局
   ============================================================ */
.admin-layout { display: flex; height: 100vh; overflow: hidden; }
.admin-layout.collapsed .sidebar { width: 64px; }
.admin-layout.collapsed .sidebar-logo { justify-content: center; }
.sidebar { width: 230px; background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%); display: flex; flex-direction: column; flex-shrink: 0; transition: width .25s ease; box-shadow: 2px 0 8px rgba(0,0,0,.1); }
.sidebar-logo { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid rgba(148,163,184,.12); cursor: pointer; transition: padding .25s; }
.sidebar-logo .logo-icon { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, #4f46e5, #7c3aed); display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 2px 8px rgba(79,70,229,.4); }
.sidebar-logo .logo-text { display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.sidebar-logo .logo-name { font-size: 15px; font-weight: 700; color: #fff; white-space: nowrap; }
.sidebar-logo .logo-badge { font-size: 10px; color: #64748b; white-space: nowrap; }
.menu-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; }
.menu-group-label { padding: 18px 20px 6px; font-size: 11px; font-weight: 600; color: #475569; text-transform: uppercase; letter-spacing: 1px; }
.sidebar-menu { list-style: none; padding: 0; margin: 0; }
.sidebar-menu li { margin: 2px 8px; }
.sidebar-menu a { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 12px; border-radius: 8px; font-size: 14px; color: #94a3b8; transition: all .2s; text-decoration: none; }
.sidebar-menu a:hover { background: rgba(148,163,184,.1); color: #e2e8f0; }
.sidebar-menu a.active { background: linear-gradient(135deg, rgba(79,70,229,.25), rgba(124,58,237,.15)); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 #818cf8; }
.sidebar-menu .menu-icon { font-size: 18px; flex-shrink: 0; }
.sidebar-footer { padding: 12px 14px; border-top: 1px solid rgba(148,163,184,.12); display: flex; flex-direction: column; gap: 10px; }
.goto-front { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #64748b; text-decoration: none; padding: 6px 8px; border-radius: 6px; transition: all .2s; }
.goto-front:hover { color: #e2e8f0; background: rgba(148,163,184,.08); }
.admin-user { display: flex; align-items: center; gap: 10px; padding: 6px 4px; }
.admin-user-info { display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.admin-user-name { font-size: 13px; color: #cbd5e1; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.admin-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.admin-header { height: 54px; background: #fff; border-bottom: 1px solid #e2e8f0; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; flex-shrink: 0; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.header-left { display: flex; align-items: center; gap: 12px; }
.header-right { display: flex; align-items: center; gap: 10px; }
.admin-content { flex: 1; overflow-y: auto; padding: 24px; background: #f1f5f9; }

/* ============================================================
   认证页面
   ============================================================ */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #e0e7ff 0%, #f8fafc 100%); padding: 20px; }
.auth-wrap.auth-wrap-admin { background: linear-gradient(135deg, #1e293b 0%, #312e81 50%, #4f46e5 100%); }
.auth-card { width: 100%; max-width: 420px; background: #fff; border-radius: 16px; padding: 40px; box-shadow: 0 8px 40px rgba(79,70,229,.12); }
.auth-logo { display: flex; align-items: center; gap: 8px; font-size: 22px; font-weight: 800; color: #4f46e5; margin-bottom: 8px; }
.auth-title { font-size: 20px; font-weight: 700; color: #1e293b; margin-bottom: 4px; }
.auth-subtitle { font-size: 14px; color: var(--text-secondary); margin-bottom: 28px; }
.auth-footer { text-align: center; margin-top: 24px; font-size: 13px; color: var(--text-secondary); }
.auth-footer a { color: var(--primary); }
.auth-links { display: flex; justify-content: center; gap: 12px; margin-top: 16px; font-size: 13px; color: var(--text-secondary); }
.auth-links a { color: #4f46e5; }
.auth-sep { color: #e2e8f0; }

/* 验证码行 */
.code-row { display: flex; gap: 10px; }
.code-row .form-input { flex: 1; }
.btn-code {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 16px; background: var(--primary); color: #fff;
  border: none; border-radius: 6px; font-size: 14px; font-family: inherit;
  cursor: pointer; white-space: nowrap; transition: all .2s;
  min-width: 100px;
}
.btn-code:hover { background: var(--primary-dark); }
.btn-code:disabled { opacity: .5; cursor: not-allowed; background: var(--primary-light); }
.btn-code.btn-code-counting { opacity: .6; cursor: not-allowed; background: var(--primary-light); }
.code-tip { font-size: 12px; color: #94a3b8; margin-top: 4px; line-height: 1.4; }

/* 验证消息 */
.val-msg { font-size: 12px; color: var(--danger); margin-top: 4px; }

/* 表单内错误/成功提示 */
.alert-error { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; background: #fee2e2; color: #dc2626; border: 1px solid #fca5a5; }
.alert-success { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; background: #dcfce7; color: #16a34a; border: 1px solid #86efac; }

/* checkbox label */
.checkbox-label { display: flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.checkbox-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }

/* Toast 通知 */
.toast-container { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  pointer-events: auto; padding: 10px 20px; border-radius: 8px; font-size: 14px;
  background: #fff; box-shadow: 0 4px 16px rgba(0,0,0,.15);
  animation: toastIn .3s ease; display: flex; align-items: center; gap: 8px;
  min-width: 200px; max-width: 400px;
}
.toast.success { color: #16a34a; border-left: 3px solid #22c55e; }
.toast.error { color: #dc2626; border-left: 3px solid #ef4444; }
.toast.warning { color: #d97706; border-left: 3px solid #f59e0b; }
.toast.info { color: #4338ca; border-left: 3px solid #818cf8; }
.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast.hiding { animation: toastOut .3s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-20px); } }

/* ============================================================
   首页 Banner
   ============================================================ */
.banner { background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #818cf8 100%); border-radius: 16px; padding: 48px 36px; margin-bottom: 32px; color: #fff; position: relative; overflow: hidden; }
.banner::before { content: ''; position: absolute; top: -40%; right: -10%; width: 400px; height: 400px; background: rgba(255,255,255,.08); border-radius: 50%; }
.banner h1 { font-size: 30px; font-weight: 800; margin-bottom: 12px; position: relative; }
.banner p { font-size: 15px; opacity: .85; margin-bottom: 24px; position: relative; }
.banner-search { display: flex; gap: 8px; max-width: 520px; position: relative; }
.banner-search input { flex: 1; padding: 12px 16px; border: none; border-radius: 8px; font-size: 15px; }
.banner-search input:focus { outline: none; box-shadow: 0 0 0 2px rgba(255,255,255,.3); }
.banner-search button { padding: 12px 24px; background: #fff; color: #4f46e5; border: none; border-radius: 8px; cursor: pointer; font-size: 15px; font-weight: 600; }
.banner-search button:hover { background: #eef2ff; }

/* 分类卡片网格 */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.cat-card { display: flex; align-items: center; gap: 12px; padding: 14px; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; text-decoration: none; transition: all .2s; }
.cat-card:hover { border-color: #4f46e5; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(79,70,229,.12); }
.cat-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cat-info { display: flex; flex-direction: column; gap: 2px; }
.cat-name { font-weight: 600; font-size: 14px; color: #1e293b; }
.cat-count { font-size: 12px; color: #94a3b8; }

/* 排行榜 */
.ranking-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.ranking-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; cursor: pointer; transition: all .2s; text-decoration: none; color: inherit; }
.ranking-item:hover { border-color: #4f46e5; box-shadow: 0 2px 8px rgba(79,70,229,.08); }
.rank-num { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: #f1f5f9; color: #64748b; flex-shrink: 0; }
.rank-num.top-1 { background: #fbbf24; color: #fff; }
.rank-num.top-2 { background: #94a3b8; color: #fff; }
.rank-num.top-3 { background: #d97706; color: #fff; }
.rank-name { flex: 1; font-size: 14px; color: #1e293b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-count { font-size: 12px; color: #94a3b8; flex-shrink: 0; }

/* ============================================================
   页面头部 (Category/Search)
   ============================================================ */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.page-header h2 { font-size: 20px; font-weight: 700; color: var(--text); }
.page-header .header-right { display: flex; align-items: center; gap: 8px; }

/* 子分类导航 */
.sub-cats { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.sub-btn { padding: 6px 14px; border-radius: 6px; font-size: 13px; background: #f1f5f9; color: var(--text-secondary); text-decoration: none; transition: all .2s; border: 1px solid transparent; }
.sub-btn:hover { background: #eef2ff; color: var(--primary); }
.sub-btn.active { background: #e0e7ff; color: var(--primary); border-color: var(--primary-light); font-weight: 600; }

/* 搜索结果头部 */
.search-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.search-title { display: flex; align-items: center; gap: 12px; }
.search-title h2 { font-size: 20px; font-weight: 700; }
.search-title .keyword { font-size: 14px; color: var(--primary); background: #eef2ff; padding: 2px 8px; border-radius: 4px; }
.search-title .total { font-size: 14px; color: var(--text-secondary); }

/* ============================================================
   面包屑 (SoftDetail)
   ============================================================ */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-secondary); }
.breadcrumb a { color: var(--primary); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { color: var(--text); font-weight: 500; }

/* ============================================================
   软件详情页 (SoftDetail)
   ============================================================ */
.detail-header { display: flex; gap: 24px; padding: 24px; }
.soft-cover-wrap { flex-shrink: 0; width: 180px; }
.cover-img { width: 180px; height: 120px; border-radius: 10px; object-fit: cover; }
.soft-cover-placeholder.cover-img { width: 180px; height: 120px; font-size: 48px; border-radius: 10px; }

.soft-main-info { flex: 1; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.soft-title { font-size: 20px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* 元数据网格 */
.meta-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.meta-item { display: flex; flex-direction: column; gap: 2px; }
.meta-label { font-size: 12px; color: var(--text-secondary); }
.meta-value { font-size: 14px; color: var(--text); font-weight: 500; }

/* 标签行 */
.tags-row { display: flex; gap: 6px; flex-wrap: wrap; }
.tags-row .info-tag { background: #f1f5f9; color: var(--text-secondary); padding: 2px 8px; border-radius: 4px; font-size: 12px; }

/* 操作按钮行 */
.action-row { display: flex; gap: 12px; }

/* 解压密码提示 */
.unzip-tip { padding: 10px 16px; background: #fef3c7; color: #d97706; border-radius: 6px; font-size: 14px; border: 1px solid #fcd34d; }
.unzip-tip strong { font-weight: 700; }

/* 详情章节 */
.detail-section { margin-top: 16px; }
.intro-text { font-size: 14px; color: var(--text); line-height: 1.8; }

/* 图文教程 */
.doc-tabs { display: flex; flex-direction: column; gap: 16px; }
.doc-tab-item { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.doc-tab-title { font-size: 15px; font-weight: 600; padding: 12px 16px; background: #f8fafc; border-bottom: 1px solid var(--border); }
.doc-content { padding: 16px; font-size: 14px; line-height: 1.8; }
.doc-content img { max-width: 100%; border-radius: 6px; margin: 8px 0; }

/* 教学视频 */
.video-item { margin-bottom: 16px; }
.video-title { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.video-player { width: 100%; max-height: 400px; border-radius: 8px; background: #000; }

/* 登录提示 */
.login-tip { padding: 16px; text-align: center; font-size: 14px; color: var(--text-secondary); background: #f8fafc; border-radius: 8px; }
.login-tip a { color: var(--primary); font-weight: 600; }

/* ============================================================
   个人中心 (Profile)
   ============================================================ */
.profile-page { max-width: 800px; }

/* Tab 导航 */
.tabs-nav { display: flex; gap: 4px; margin-bottom: 20px; background: #fff; border-radius: 8px; padding: 4px; border: 1px solid var(--border); }
.tab-btn { padding: 10px 20px; border-radius: 6px; font-size: 14px; color: var(--text-secondary); text-decoration: none; transition: all .2s; }
.tab-btn:hover { color: var(--primary); background: #f8fafc; }
.tab-btn.active { background: #e0e7ff; color: var(--primary); font-weight: 600; }

/* 头像信息 */
.profile-avatar { display: flex; align-items: center; gap: 16px; }
.profile-meta { display: flex; flex-direction: column; gap: 4px; }
.profile-name { font-size: 18px; font-weight: 700; color: var(--text); }
.profile-email { font-size: 14px; color: var(--text-secondary); }

/* ============================================================
   软件管理列表 (SoftList 表格内)
   ============================================================ */
.soft-cell { display: flex; align-items: center; gap: 12px; }
.soft-thumb { width: 48px; height: 32px; border-radius: 4px; object-fit: cover; flex-shrink: 0; }
.soft-thumb-placeholder { width: 48px; height: 32px; border-radius: 4px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #e0e7ff, #c7d2fe); color: #4f46e5; font-weight: 700; font-size: 16px; flex-shrink: 0; }
.soft-meta-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.soft-meta-cell .soft-name { font-weight: 600; font-size: 14px; }
.soft-meta-cell .soft-version { font-size: 11px; color: var(--text-secondary); }

/* ============================================================
   Dashboard 仪表盘
   ============================================================ */
.welcome-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  border-radius: 14px; padding: 28px 32px; margin-bottom: 24px; color: #fff;
  box-shadow: 0 6px 20px rgba(79,70,229,.25);
}
.welcome-text h2 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.welcome-text p { font-size: 14px; opacity: .85; }
.welcome-date { display: flex; align-items: center; gap: 8px; font-size: 14px; opacity: .8; }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-cards .stat-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
  padding: 20px; display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.stat-card-top { display: flex; align-items: center; gap: 14px; }
.stat-card-top .stat-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-info { display: flex; flex-direction: column; }
.stat-info .stat-value { font-size: 26px; font-weight: 800; color: #1e293b; }
.stat-info .stat-label { font-size: 13px; color: #64748b; margin-top: 2px; }
.stat-card-bottom { font-size: 13px; font-weight: 600; padding-top: 10px; border-top: 1px solid #f1f5f9; }

.bottom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
@media (max-width: 900px) { .bottom-grid { grid-template-columns: 1fr; } }

.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-size: 16px; font-weight: 700; color: #1e293b; }

.chart-card { padding: 20px; }
.chart-area { display: flex; align-items: flex-end; gap: 12px; height: 200px; padding: 10px 0; }
.bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bar-col { display: flex; flex-direction: column; align-items: center; width: 100%; }
.bar-val { font-size: 12px; color: #64748b; font-weight: 600; margin-bottom: 4px; }
.bar-track { width: 100%; max-width: 36px; height: 160px; background: #f1f5f9; border-radius: 4px; position: relative; }
.bar-fill { position: absolute; bottom: 0; left: 0; right: 0; border-radius: 4px; background: linear-gradient(180deg, #818cf8 0%, #4f46e5 100%); transition: height .4s ease; min-height: 3px; }
.bar-label { font-size: 11px; color: #94a3b8; white-space: nowrap; }

.rank-card { padding: 20px; }
.rank-list { display: flex; flex-direction: column; gap: 8px; }
.rank-item { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 6px; background: #f8fafc; transition: background .2s; }
.rank-item:hover { background: #eef2ff; }
.rank-num.rank-top-1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; box-shadow: 0 2px 4px rgba(245,158,11,.3); }
.rank-num.rank-top-2 { background: linear-gradient(135deg, #94a3b8, #64748b); color: #fff; }
.rank-num.rank-top-3 { background: linear-gradient(135deg, #d97706, #b45309); color: #fff; }

.quick-actions { padding: 20px; }
.action-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.action-item {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 20px 16px; background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 10px; text-decoration: none; color: #1e293b;
  transition: all .2s; font-size: 14px; font-weight: 500;
}
.action-item:hover { border-color: #4f46e5; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(79,70,229,.1); color: #4f46e5; }
.action-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ============================================================
   模态框
   ============================================================ */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: none; align-items: center; justify-content: center; z-index: 1000; }
.modal-overlay.show { display: flex; }
.modal-box { background: #fff; border-radius: 12px; padding: 24px; width: 90%; max-width: 500px; max-height: 80vh; overflow-y: auto; }
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* 标签徽章 */
.role-badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.role-badge.superadmin { background: #fee2e2; color: #dc2626; }
.role-badge.admin { background: #fef3c7; color: #d97706; }
.role-badge.user { background: #e0e7ff; color: #4338ca; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 768px) {
  .banner { padding: 28px 20px; }
  .banner h1 { font-size: 22px; }
  .ranking-list { grid-template-columns: 1fr; }
  .header-inner { flex-wrap: wrap; }
  .search-box { order: 3; width: 100%; max-width: none; }
  .detail-header { flex-direction: column; }
  .soft-cover-wrap { width: 100%; }
  .cover-img, .soft-cover-placeholder.cover-img { width: 100%; height: 180px; }
  .meta-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .meta-grid { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
}
