:root {
  --primary: #4f6ef7;
  --primary-dark: #3b57d9;
  --primary-light: #eef1fe;
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1f2430;
  --muted: #7a8299;
  --border: #e4e8f1;
  --danger: #e5484d;
  --success: #2f9e63;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(31, 41, 66, .06);
  --shadow-hover: 0 8px 24px rgba(31, 41, 66, .12);
}

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

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "WenQuanYi Micro Hei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; width: 100%; }
main.container { flex: 1; padding-top: 28px; padding-bottom: 48px; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: "JetBrains Mono", Consolas, monospace; font-size: 13px; }
.nowrap { white-space: nowrap; }
.inline { display: inline; }

/* ---------- 顶栏 ---------- */
.topbar {
  background: linear-gradient(135deg, #37499c 0%, var(--primary) 60%, #7b8ff9 100%);
  color: #fff;
  box-shadow: var(--shadow);
  position: sticky; top: 0; z-index: 50;
}
.topbar-inner { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 14px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 19px; font-weight: 700; letter-spacing: .5px; flex: none; }
.brand:hover { text-decoration: none; }
.brand-icon { width: 26px; height: 26px; }
/* 顶部导航始终保持单行；空间不足时横向滚动，不换行 */
.nav {
  display: flex; gap: 2px; flex-wrap: nowrap;
  min-width: 0; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
  /* 右侧留出 i 按钮的绝对定位区域，滚动到末尾时最后一项不会被按钮压住 */
  padding-right: 34px;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  color: rgba(255,255,255,.85); padding: 6px 9px; border-radius: 8px;
  font-size: 13.5px; white-space: nowrap; flex: 0 0 auto;
}
.nav a:hover { background: rgba(255,255,255,.15); color: #fff; text-decoration: none; }

/* ---------- Hero + 搜索 ---------- */
.hero { text-align: center; padding: 42px 0 30px; }
.hero h1 { font-size: 34px; background: linear-gradient(120deg, #2b3a8f, var(--primary)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); margin: 8px 0 24px; font-size: 15px; }
.search-box { display: flex; max-width: 560px; margin: 0 auto; background: var(--card); border-radius: 999px; box-shadow: var(--shadow-hover); padding: 6px; border: 1px solid var(--border); }
.search-box input { flex: 1; border: 0; outline: 0; padding: 10px 18px; font-size: 15px; background: transparent; color: var(--text); }
.search-box button { border: 0; background: var(--primary); color: #fff; padding: 10px 30px; border-radius: 999px; font-size: 15px; cursor: pointer; transition: background .2s; }
.search-box button:hover { background: var(--primary-dark); }

/* ---------- 分类 chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 28px; }
.chip { padding: 7px 20px; border-radius: 999px; background: var(--card); border: 1px solid var(--border); color: var(--text); font-size: 14px; box-shadow: var(--shadow); transition: all .2s; }
.chip:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; transform: translateY(-1px); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- 软件卡片 ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }
.sw-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid var(--border); display: flex; gap: 16px; padding: 22px;
  transition: transform .2s, box-shadow .2s;
}
.sw-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.sw-icon {
  width: 54px; height: 54px; flex-shrink: 0; border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), #8fa2ff);
  color: #fff; font-size: 26px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.sw-icon-lg { width: 84px; height: 84px; font-size: 40px; border-radius: 20px; }
.sw-body { flex: 1; min-width: 0; }
.sw-body h3 { font-size: 17px; margin-bottom: 6px; }
.sw-body h3 a { color: var(--text); }
.sw-body h3 a:hover { color: var(--primary); }
.sw-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tag { font-size: 12px; padding: 2px 10px; border-radius: 999px; background: var(--primary-light); color: var(--primary-dark); }
.tag-cat { background: #e8f7ef; color: var(--success); }
.sw-desc { font-size: 13.5px; color: var(--muted); margin-bottom: 14px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 21px; }
.sw-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dl-count { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); }
.dl-count svg { width: 15px; height: 15px; }
.sw-actions { display: flex; gap: 8px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 22px; border-radius: 10px; font-size: 14.5px; cursor: pointer;
  border: 1px solid transparent; transition: all .2s; text-decoration: none !important;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-ghost { background: var(--card); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: #fdebec; color: var(--danger); border-color: #f7c9cb; }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-lg { padding: 13px 38px; font-size: 16.5px; border-radius: 12px; }
.btn-sm { padding: 5px 13px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 70px 0; color: var(--muted); }
.empty svg { width: 56px; height: 56px; opacity: .5; margin-bottom: 14px; }

/* ---------- 详情页 ---------- */
.crumb { font-size: 13.5px; color: var(--muted); margin-bottom: 20px; }
.detail-head {
  display: flex; gap: 26px; align-items: center; background: var(--card);
  border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow); border: 1px solid var(--border);
}
.detail-info h1 { font-size: 26px; margin-bottom: 10px; }
.detail-info .sw-meta { margin-bottom: 18px; }
.detail-body { background: var(--card); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow); border: 1px solid var(--border); margin-top: 22px; }
.detail-body h2 { font-size: 19px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.md-content { font-size: 14.5px; }
.md-content h1, .md-content h2, .md-content h3 { margin: 18px 0 10px; border: 0; padding: 0; }
.md-content p, .md-content li { margin-bottom: 8px; }
.md-content ul, .md-content ol { padding-left: 24px; margin-bottom: 10px; }
.md-content code { background: var(--primary-light); padding: 2px 6px; border-radius: 5px; font-size: 13px; }
.md-content pre { background: #1e2433; color: #dfe5f3; padding: 16px; border-radius: 10px; overflow-x: auto; margin-bottom: 12px; }
.md-content pre code { background: transparent; color: inherit; padding: 0; }
.md-content table { border-collapse: collapse; margin-bottom: 12px; }
.md-content th, .md-content td { border: 1px solid var(--border); padding: 7px 14px; }
.md-content blockquote { border-left: 4px solid var(--primary); padding-left: 14px; color: var(--muted); margin-bottom: 10px; }

/* ---------- 登录页 ---------- */
.login-body { background: linear-gradient(150deg, #2b3a8f 0%, var(--primary) 55%, #8fa2ff 100%); }
.login-card {
  max-width: 400px; margin: 12vh auto; background: var(--card); border-radius: 18px;
  padding: 42px 38px; box-shadow: 0 20px 60px rgba(0,0,20,.35); text-align: center;
}
.login-icon { width: 44px; height: 44px; color: var(--primary); margin-bottom: 10px; }
.login-card h1 { font-size: 22px; }
.login-card form { margin-top: 24px; text-align: left; }
.login-card label { display: block; margin-bottom: 16px; font-size: 14px; color: var(--muted); }
.login-card input { width: 100%; margin-top: 6px; }
.back-link { display: inline-block; margin-top: 20px; font-size: 13.5px; }

/* ---------- 表单通用 ---------- */
input[type=text], input[type=password], input[type=number], input[type=date], input[type=file], select, textarea {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 14.5px; font-family: inherit; background: #fff; color: var(--text);
  outline: 0; transition: border .2s, box-shadow .2s; margin-top: 5px;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,110,247,.14); }
textarea { resize: vertical; line-height: 1.7; }
.form label { display: block; margin-bottom: 18px; font-size: 14px; font-weight: 600; }
.form label em { color: var(--danger); font-style: normal; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-narrow { max-width: 460px; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 8px; }
.checkbox, .radio { display: flex; align-items: center; gap: 8px; font-weight: 400 !important; cursor: pointer; }
.checkbox input, .radio input { width: auto; margin: 0; }
.alert { padding: 12px 16px; border-radius: 10px; font-size: 14px; margin-bottom: 18px; }
.alert-error { background: #fdebec; color: var(--danger); border: 1px solid #f7c9cb; }

/* ---------- 管理后台 ---------- */
body.admin-page main.container { max-width: none; padding-left: 14px; padding-right: 14px; }
.admin-layout { display: grid; grid-template-columns: 320px 1fr; gap: 26px; align-items: start; }
.admin-side { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); overflow-y: auto; max-height: calc(100vh - 100px); position: sticky; top: 84px; }
.admin-user { display: flex; gap: 12px; align-items: center; padding: 20px; background: linear-gradient(135deg, #37499c, var(--primary)); color: #fff; }
.admin-user .muted { color: rgba(255,255,255,.7); font-size: 12.5px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.22); display: flex; align-items: center; justify-content: center; font-size: 19px; font-weight: 700; flex-shrink: 0; }
.side-nav { display: grid; grid-template-columns: 1fr 1fr; align-content: start; padding: 12px; gap: 4px; }
.side-nav a { padding: 9px 10px; border-radius: 9px; color: var(--text); font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.side-nav a svg { width: 16px; height: 16px; flex-shrink: 0; }
.side-nav a:hover { background: var(--primary-light); text-decoration: none; }
.side-nav a.active { background: var(--primary); color: #fff; font-weight: 600; }
.side-nav a.logout { grid-column: 1 / -1; color: var(--danger); margin-top: 6px; border-top: 1px solid var(--border); border-radius: 0 0 9px 9px; }
.side-cats { grid-column: 1 / -1; margin: 4px 0 6px; padding: 10px 12px; background: #f8f9fc; border: 1px solid var(--border); border-radius: 10px; }
.side-cats-title { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.side-cats-list { display: flex; flex-wrap: wrap; gap: 6px; }
.side-nav .side-cats-list a { padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); background: #fff; font-size: 12.5px; line-height: 1.6; }
.side-nav .side-cats-list a.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.admin-main { min-width: 0; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

/* 后台表格：固定列宽，软件名先省略，操作按钮始终一行不换行 */
.admin-main .table-software { table-layout: fixed; width: 100%; }
.admin-main .table-software th,
.admin-main .table-software td { overflow: hidden; padding: 10px 8px; }
.admin-main .table-software th:nth-child(2) { width: 76px; }   /* 版本 */
.admin-main .table-software th:nth-child(3) { width: 80px; }   /* 板块 */
.admin-main .table-software th:nth-child(4) { width: 48px; }   /* 文件 */
.admin-main .table-software th:nth-child(5) { width: 120px; }  /* 下载/浏览 */
.admin-main .table-software th:nth-child(6) { width: 80px; }   /* 状态 */
.admin-main .table-software th:nth-child(7) { width: 108px; }  /* 添加时间 */
.admin-main .table-software th:nth-child(8) { width: 280px; }  /* 操作 */
.admin-main .table-software td.num,
.admin-main .table-software td.nowrap { white-space: nowrap; }
.name-cell { min-width: 0; }
.name-cell .name-line { display: flex; align-items: center; gap: 5px; min-width: 0; }
.name-cell .name-line a { min-width: 0; overflow: hidden; }
.name-cell .name-text { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.name-cell .name-sub { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-main .table-software .row-actions { flex-wrap: nowrap; white-space: nowrap; }
.admin-main .table-software .row-actions form { flex: 0 0 auto; margin: 0; }
.admin-main .table-software .row-actions .btn-sm { margin: 0; padding: 5px 8px; font-size: 13px; white-space: nowrap; }

/* 窗口不够宽时隐藏“添加时间”列，把空间让给软件名 */
@media (max-width: 1500px) {
  .admin-main .table-software th:nth-child(7),
  .admin-main .table-software td:nth-child(7) { display: none; }
}
.page-title { font-size: 22px; margin-bottom: 20px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 14px; flex-wrap: wrap; }
.page-head .page-title { margin-bottom: 0; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 18px; margin-bottom: 24px; }
.stat-card { background: var(--card); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); padding: 24px; text-align: center; transition: transform .2s; }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.stat-num { font-size: 36px; font-weight: 800; background: linear-gradient(120deg, #2b3a8f, var(--primary)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-num small { font-size: 18px; color: var(--muted); -webkit-text-fill-color: var(--muted); }
.stat-label { color: var(--muted); font-size: 13.5px; margin-top: 4px; }

.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.panel { background: var(--card); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); padding: 22px; margin-bottom: 20px; overflow-x: auto; }
.panel h2 { font-size: 16px; margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; }
.panel-link { font-size: 13px; font-weight: 400; }
.panel .form label { font-weight: 600; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--muted); font-size: 12.5px; font-weight: 600; padding: 9px 12px; border-bottom: 2px solid var(--border); text-transform: uppercase; letter-spacing: .4px; white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #f8f9fe; }
.table .num { text-align: right; }
.badge { display: inline-block; background: var(--primary-light); color: var(--primary-dark); font-weight: 700; padding: 2px 12px; border-radius: 999px; font-size: 13px; }
.status-on { color: var(--success); font-weight: 600; font-size: 13px; }
.status-off { color: var(--muted); font-size: 13px; }
.ua { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.filter-bar input { width: auto; flex: 1; min-width: 150px; margin-top: 0; }
.filter-bar .btn { flex-shrink: 0; }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; padding-top: 16px; }

/* ---------- 页脚 ---------- */
.footer { background: var(--card); border-top: 1px solid var(--border); padding: 18px 0; text-align: center; color: var(--muted); font-size: 13px; margin-top: auto; }

/* ---------- 公告条 ---------- */
.announce { background: #fff7e6; border-bottom: 1px solid #ffe1a8; color: #8a5b00; font-size: 14px; padding: 9px 0; }
.announce .container { display: flex; align-items: center; gap: 8px; }
.announce svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ---------- 首页板块 ---------- */
.board { margin-bottom: 34px; }
.board-title {
  display: flex; align-items: center; gap: 10px; font-size: 19px; margin-bottom: 16px;
  padding-left: 13px; border-left: 4px solid var(--board-color, var(--primary));
}
.board-title svg { width: 21px; height: 21px; color: var(--board-color, var(--primary)); }
.board-count { font-size: 12.5px; font-weight: 600; color: var(--muted); background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 1px 10px; }

/* ---------- 标签 chips ---------- */
.chips-tags { gap: 8px; margin-top: -12px; }
.chips-label { color: var(--muted); font-size: 13px; align-self: center; }
.chip-tag { padding: 5px 14px; font-size: 13px; }
.chip-tag em { font-style: normal; color: var(--muted); font-size: 12px; margin-left: 2px; }
.chip-tag.active em { color: rgba(255,255,255,.8); }
.tag-tag { background: #f1f3f9; color: var(--muted); }
.hot-words { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- 角标 / 置顶 ---------- */
.sw-card { position: relative; overflow: hidden; }
.corner-badge {
  position: absolute; top: 0; right: 0; background: linear-gradient(135deg, #ff9a3c, #ff6b6b);
  color: #fff; font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 0 var(--radius) 0 12px;
}
.inline-badge { position: static; border-radius: 6px; padding: 2px 8px; vertical-align: middle; }
.pin-flag {
  display: inline-block; background: var(--danger); color: #fff; font-size: 11.5px; font-weight: 700;
  padding: 1px 7px; border-radius: 6px; margin-right: 6px; vertical-align: middle;
}
.remark-line { font-size: 13.5px; color: var(--muted); background: #f8f9fc; border-left: 3px solid var(--primary); padding: 7px 12px; border-radius: 0 8px 8px 0; }

/* ---------- 详情页文件列表 ---------- */
.file-list { display: flex; flex-direction: column; gap: 12px; }
.file-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: #f8f9fc; border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px;
}
.file-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.file-info strong { font-size: 15px; }

/* ---------- 评论 ---------- */
.comment-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 22px; }
.comment-item { background: #f8f9fc; border-radius: 12px; padding: 14px 18px; border: 1px solid var(--border); }
.comment-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.comment-body { font-size: 14.5px; white-space: pre-wrap; word-break: break-word; }
.comment-form { border-top: 1px dashed var(--border); padding-top: 20px; }
.comment-form > .btn { margin-right: 10px; }

/* ---------- 验证码弹窗 ---------- */
[hidden] { display: none !important; }
.modal-mask { position: fixed; top: 0; left: 0; right: 0; bottom: 0; width: 100%; height: 100%; background: rgba(15, 20, 40, .55); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 20px; }
.modal {
  background: var(--card); border-radius: 16px; padding: 28px; width: 100%; max-width: 330px;
  box-shadow: 0 20px 60px rgba(0,0,20,.35); text-align: center;
}
.modal h3 { font-size: 17px; margin-bottom: 16px; }
.modal img { border: 1px solid var(--border); border-radius: 10px; background: #fff; display: block; margin: 0 auto 6px; }
.modal a { display: inline-block; margin-bottom: 12px; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn { flex: 1; }
.alert-ok { background: #e8f7ef; color: var(--success); border: 1px solid #bfe6d1; }

/* ---------- 后台：趋势图 ---------- */
.trend-chart { display: flex; align-items: flex-end; gap: 14px; height: 210px; }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; min-width: 0; }
.trend-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.trend-bar { width: 62%; max-width: 46px; min-height: 3px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, #7b8ff9, var(--primary)); }
.trend-num { font-size: 13px; font-weight: 700; margin-top: 6px; }
.trend-day { font-size: 12px; color: var(--muted); }

/* ---------- 后台：页头动作 / 标签页 ---------- */
.page-head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab { padding: 7px 18px; border-radius: 999px; background: var(--card); border: 1px solid var(--border); color: var(--text); font-size: 14px; }
.tab:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.tab.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.tab em { font-style: normal; opacity: .75; font-size: 12.5px; margin-left: 3px; }

/* ---------- 后台：评论审核 ---------- */
.comment-admin-item { border-bottom: 1px solid var(--border); padding: 14px 0; }
.comment-admin-item:last-child { border-bottom: 0; padding-bottom: 0; }
.comment-admin-item:first-child { padding-top: 0; }
.comment-actions { display: flex; gap: 8px; margin-top: 10px; }

/* ---------- 后台：板块管理 ---------- */
.cat-edit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cat-edit-row input, .cat-edit-row select { margin-top: 0; }
.cat-name-input { width: 140px; }
.cat-icon-select { width: 100px; }
.cat-color-input { width: 42px; height: 34px; padding: 2px; border: 1px solid var(--border); border-radius: 8px; background: #fff; cursor: pointer; }
.cat-preview svg { width: 22px; height: 22px; display: block; }
.table td .btn-sm { margin: 2px 0 2px 6px; }
.table td form.inline { display: inline; }

/* ---------- 后台：表单增强 ---------- */
.form-inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; }
.form-inline label { margin-bottom: 0 !important; flex: 1; min-width: 170px; }
.form-inline > .btn { flex-shrink: 0; margin-bottom: 1px; }
.form-section { font-size: 16px; margin: 22px 0 12px; padding-top: 18px; border-top: 1px solid var(--border); }
.check-row { background: #f8f9fc; border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; margin-bottom: 12px; }
.check-row .checkbox { margin-bottom: 0; }
.hint { margin: 4px 0 0; font-weight: 400; }
.existing-files { margin-bottom: 16px; }
.file-edit-row, .file-new-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  background: #f8f9fc; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px;
}
.file-edit-row input, .file-new-row input { margin-top: 0; }
.label-input { flex: 0 0 180px; font-weight: 400; }
.file-new-row input[name="file_paths"], .file-new-row input[name="file_links"] { flex: 1 1 220px; }
.file-new-row input[type="file"] { flex: 1 1 220px; }
.file-new-row .file-picked { flex: 0 0 100%; }
.file-edit-row > span { flex: 1 1 240px; }
.file-edit-row .checkbox { flex: 0 0 auto; }
.row-del { flex: 0 0 auto; padding: 6px 10px; }
.tag-pill { display: inline-block; background: var(--primary-light); color: var(--primary-dark); font-size: 12.5px; padding: 2px 11px; border-radius: 999px; }
td.detail { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 漏洞板块 ---------- */
.sev { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.sev-critical { background: #fdebec; color: #c92a2a; }
.sev-high { background: #fff3e6; color: #d9730d; }
.sev-medium { background: #fffae0; color: #b58900; }
.sev-low { background: #e8f7ef; color: #2f9e63; }
.vuln-icon { background: linear-gradient(135deg, #c92a2a, #e8590c); }
.vuln-list { display: flex; flex-direction: column; gap: 12px; }
.vuln-item {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: #f8f9fc; border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px;
  transition: border-color .2s, box-shadow .2s;
}
.vuln-item:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.vuln-main { flex: 1; min-width: 0; }
.vuln-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 5px; }
.vuln-title-row a { color: var(--text); font-size: 15.5px; }
.vuln-title-row a:hover { color: var(--primary); }
.vuln-meta { line-height: 1.5; }

/* ---------- 评论楼中楼 ---------- */
.comment-replies { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; padding-left: 18px; border-left: 3px solid var(--border); }
.comment-reply { background: #fff; }
.admin-badge {
  display: inline-block; background: linear-gradient(135deg, var(--primary), #7b8ff9); color: #fff;
  font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 6px; vertical-align: middle;
}
.reply-link { color: var(--primary); cursor: pointer; }
.reply-hint {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--primary-light); border: 1px solid #cdd7fd; color: var(--primary-dark);
  font-size: 13.5px; padding: 8px 14px; border-radius: 10px; margin-bottom: 14px;
}
.quote-line {
  font-size: 12.5px; color: var(--muted); background: #f1f3f9; border-left: 3px solid var(--border);
  padding: 6px 12px; border-radius: 0 8px 8px 0; margin: 6px 0 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.admin-reply-form { display: flex; gap: 8px; margin-top: 10px; }
.admin-reply-form input { flex: 1; margin-top: 0; }

/* ---------- 审核状态 / 驳回原因 ---------- */
.status-pending { color: #d9730d; font-weight: 600; font-size: 13px; }
.review-note { color: var(--danger); }

/* ---------- 统计卡片链接 ---------- */
.stat-link { display: block; color: inherit; }
.stat-link:hover { text-decoration: none; border-color: var(--primary); }

/* ---------- 首页布局区块 ---------- */
.board-more { margin-left: auto; font-size: 13px; font-weight: 400; }
.board-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.board-row .board { margin-bottom: 34px; }
.announce-block {
  display: flex; align-items: center; gap: 10px; border-radius: 12px; padding: 13px 18px;
  font-size: 14.5px; margin-bottom: 34px; border: 1px solid;
}
.announce-block svg { width: 19px; height: 19px; flex-shrink: 0; }
.announce-info { background: var(--primary-light); border-color: #cdd7fd; color: var(--primary-dark); }
.announce-warn { background: #fff7e6; border-color: #ffe1a8; color: #8a5b00; }
.link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.link-card {
  display: flex; align-items: center; gap: 9px; background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 18px; font-size: 14.5px; font-weight: 600; color: var(--text);
  box-shadow: var(--shadow); transition: all .2s;
}
.link-card svg { width: 17px; height: 17px; color: var(--primary); flex-shrink: 0; }
.link-card:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-hover); }

/* ---------- 后台：首页布局管理 ---------- */
.block-type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.block-type-card {
  display: flex; flex-direction: column; gap: 5px; background: #f8f9fc; border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px; color: var(--text); transition: all .2s;
}
.block-type-card:hover { border-color: var(--primary); text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); }
.block-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.block-row {
  display: flex; align-items: center; gap: 12px; background: #f8f9fc; border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 14px; cursor: grab;
}
.block-row.dragging { opacity: .45; border-style: dashed; }
.block-row.block-off { opacity: .65; }
.drag-handle { color: var(--muted); cursor: grab; display: flex; }
.drag-handle svg { width: 16px; height: 16px; }
.block-desc { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; overflow: hidden; }
.block-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-side { position: static; max-height: none; }
  .panel-grid, .form-row { grid-template-columns: 1fr; }
  .detail-head { flex-direction: column; text-align: center; }
  .sw-meta { justify-content: center; }
  .card-grid { grid-template-columns: 1fr; }
  .table { display: block; overflow-x: auto; }
  .file-row { flex-direction: column; align-items: stretch; }
  .label-input { flex: 1 1 100%; }
  .trend-chart { height: 150px; gap: 6px; }
  .page-head { flex-direction: column; align-items: stretch; }
  .vuln-item { flex-direction: column; align-items: stretch; }
  .admin-reply-form { flex-direction: column; }
  .comment-replies { padding-left: 10px; }
  .board-row { grid-template-columns: 1fr; }
  .block-row { flex-wrap: wrap; }
  .link-grid { grid-template-columns: 1fr; }
}

/* ===== 技术文章 ===== */
.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; margin: 22px 0; }
.article-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; transition: box-shadow .2s, transform .2s; }
.article-card:hover { box-shadow: 0 10px 28px rgba(60,72,120,.12); transform: translateY(-2px); }
.article-cover { aspect-ratio: 16/9; background: var(--primary-light); display: flex; align-items: center; justify-content: center; color: var(--primary); }
.article-cover svg { width: 52px; height: 52px; opacity: .55; }
.article-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.article-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.article-body h3 { font-size: 16px; line-height: 1.45; color: var(--text); }
.article-summary { color: var(--muted); font-size: 13.5px; line-height: 1.6; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article-meta { display: flex; gap: 12px; flex-wrap: wrap; }
.article-detail { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 34px 42px; margin-top: 14px; }
.article-head h1 { font-size: 28px; margin-bottom: 10px; }
.article-cover-lg { margin: 18px 0 24px; border-radius: 12px; overflow: hidden; }
.article-cover-lg img { width: 100%; display: block; }
.article-content { font-size: 15.5px; line-height: 1.85; }

/* ===== 正文媒体 ===== */
.md-content img, .md-content video { max-width: 100%; border-radius: 10px; display: block; margin: 12px 0; background: #000; }
.md-content video { width: 100%; }

/* ===== 编辑器工具栏 ===== */
.md-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0; padding: 7px 9px; background: #f6f8fc; border: 1px solid var(--border); border-radius: 8px 8px 0 0; border-bottom: none; }
.md-toolbar + .md-editor { border-top-left-radius: 0; border-top-right-radius: 0; }
.md-tip { line-height: 1.5; }
textarea.md-editor { line-height: 1.7; transition: box-shadow .15s, border-color .15s; }
textarea.md-editor.md-drag { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }

/* ===== 封面上传行 ===== */
.cover-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.cover-input { flex: 1; min-width: 260px; }
.cover-preview { width: 96px; height: 54px; border: 1px dashed var(--border); border-radius: 8px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #fafbfe; }
.cover-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ===== 上传令牌页 ===== */
.token-box { display: inline-block; background: #1e2433; color: #8ee0a8; padding: 10px 18px; border-radius: 8px; font-size: 15px; letter-spacing: 1px; word-break: break-all; }
.help-steps { padding-left: 22px; }
.help-steps li { margin-bottom: 10px; line-height: 1.7; }
.mono { font-family: "SFMono-Regular", Consolas, Menlo, monospace; }

/* ===== HTML/MHTML 导入与网页应用 ===== */
.doc-import-box { background: #f6f8fc; border: 1px dashed var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; }
.doc-import-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.doc-import-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.radio-pill { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; margin: 0; }
.badge-info { background: #e3f0ff; color: #1a5fb4; margin-right: 8px; }
.badge-danger { background: #fdebec; color: var(--danger); margin-left: 6px; }
.btn-link { background: none; border: 0; color: var(--primary); padding: 0; font: inherit; cursor: pointer; text-decoration: underline; }
.doc-app-panel { margin-top: 12px; }
.app-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0 10px; }
.app-frame-wrap { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; }
.app-frame { width: 100%; height: 75vh; min-height: 480px; border: 0; display: block; }
.app-frame-admin { height: 360px; min-height: 0; margin-top: 10px; border: 1px solid var(--border); border-radius: 8px; }
.app-intro { margin-top: 24px; border-top: 1px solid var(--border); padding-top: 18px; }

/* 导入的外部文档：尽量还原排版并防止溢出 */
.imported-doc { line-height: 1.85; word-wrap: break-word; }
.imported-doc img, .imported-doc video { max-width: 100%; height: auto; border-radius: 6px; }
.imported-doc table { border-collapse: collapse; max-width: 100%; display: block; overflow-x: auto; }
.imported-doc th, .imported-doc td { border: 1px solid var(--border); padding: 6px 12px; }
.imported-doc pre { background: #f4f6fa; color: #333; padding: 12px 14px; border-radius: 8px; overflow-x: auto; border: 1px solid var(--border); }
.imported-doc pre code { background: transparent; color: inherit; padding: 0; }
.imported-doc blockquote { border-left: 4px solid var(--primary); margin: 12px 0; padding: 4px 14px; color: var(--muted); background: #fafbfe; }

/* ===== 关于本站（右上角 i 按钮） ===== */
.site-info-btn {
  position: absolute; right: 6px; top: 17px;
  width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid currentColor;
  background: transparent; color: inherit; font-weight: 700; font-size: 14px;
  font-family: Georgia, "Times New Roman", serif; font-style: italic;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  margin-left: 0; padding: 0; line-height: 1; flex: none;
  opacity: .85; transition: opacity .15s, transform .15s;
}
.site-info-btn:hover { opacity: 1; transform: scale(1.08); }
.site-info-modal {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; width: 100%; height: 100%;
  z-index: 1000; background: rgba(15, 20, 35, .55);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.site-info-modal[hidden] { display: none; }
.site-info-box {
  position: relative; background: #fff; border-radius: 14px; max-width: 640px; width: 100%;
  max-height: 82vh; overflow-y: auto; padding: 28px 32px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .25);
}
.site-info-close {
  position: absolute; top: 12px; right: 14px; border: 0; background: none;
  font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted);
}
.site-info-close:hover { color: #333; }
.site-info-title { margin: 0 0 10px; font-size: 20px; }
.site-info-author {
  background: var(--primary-light); border-radius: 10px; padding: 10px 14px;
  margin-bottom: 10px; font-size: 14.5px;
}
.site-info-version {
  color: var(--muted); font-size: 13.5px; margin: -2px 0 16px;
}
.site-info-version strong { color: var(--primary); }
.site-info-box h3 { margin: 0 0 8px; font-size: 16px; }
.site-info-list { margin: 0; padding-left: 20px; }
.site-info-list li { margin-bottom: 9px; line-height: 1.7; font-size: 14px; }

/* ========== 合集子篇章 / 附件 / TOC ========== */
.panel-head-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.panel-head-row strong { font-size: 15px; }

/* 合集子篇章编辑 */
.part-item { border: 1px solid #e4e7ed; border-radius: 8px; padding: 12px; margin-bottom: 12px; background: #fafbfc; }
.part-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.part-title { flex: 1; font-weight: 600; }
.part-content { width: 100%; font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 13px; }

/* 附件 */
.att-toolbar { display: flex; gap: 8px; margin-bottom: 10px; }
.att-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid #e4e7ed; border-radius: 6px; margin-bottom: 6px; background: #fff; }
.att-kind { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; background: #eef2ff; color: #4f46e5; flex-shrink: 0; }
.att-name { flex: 1; min-width: 120px; }
.att-url { color: #6b7280; font-size: 12.5px; max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-size { color: #6b7280; font-size: 12.5px; flex-shrink: 0; }
@media (max-width: 640px) { .att-url { display: none; } }

/* 详情页合集目录 */
.article-toc { background: #f7f8fa; border-left: 3px solid #4f46e5; border-radius: 6px; padding: 14px 18px; margin: 22px 0; }
.article-toc h3 { margin: 0 0 8px; font-size: 15px; }
.article-toc ol { margin: 0; padding-left: 22px; }
.article-toc li { margin: 5px 0; }
.article-toc a { color: #4f46e5; text-decoration: none; }
.article-toc a:hover { text-decoration: underline; }

.part-section { margin-top: 36px; padding-top: 18px; border-top: 2px dashed #e4e7ed; scroll-margin-top: 70px; }
.part-section .part-title { margin-bottom: 14px; font-size: 22px; }

/* 附件区 */
.article-attachments { margin-top: 30px; padding: 16px 18px; background: #f7f8fa; border-radius: 8px; }
.article-attachments h3 { margin: 0 0 10px; font-size: 16px; }
.article-attachments ul { margin: 0; padding-left: 22px; }
.article-attachments li { margin: 6px 0; }
.article-attachments a { color: #2563eb; text-decoration: none; }
.article-attachments a:hover { text-decoration: underline; }

/* ---------- 网址导航（前台） ---------- */
.nav-section { margin-bottom: 30px; }
.nav-section-title {
  font-size: 18px; margin: 26px 0 12px; padding-left: 10px;
  border-left: 4px solid var(--primary, #4f6ef7); line-height: 1.2;
}
.nav-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px; margin: 12px 0 0;
}
.nav-card {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px; text-decoration: none; color: inherit;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.nav-card:hover {
  transform: translateY(-2px); border-color: var(--primary, #4f6ef7);
  box-shadow: 0 6px 18px rgba(37, 99, 235, .12);
}
.nav-card-icon {
  flex: 0 0 40px; width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-light, #eef2ff); color: var(--primary-dark, #3551d6);
}
.nav-card-icon svg { width: 20px; height: 20px; }
.nav-card-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.nav-card-text strong { font-size: 15px; }
.nav-card-url {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 190px;
}

/* ---------- 网址导航（后台） ---------- */
.section-title { margin: 24px 0 10px; font-size: 17px; }
.nav-admin-cat h3 { margin: 0 0 10px; font-size: 15px; }
.nav-edit-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.nav-name-input { flex: 0 0 140px; }
.nav-url-input { flex: 1 1 260px; min-width: 200px; }
.nav-cat-select { flex: 0 0 130px; }
.nav-cat-name { width: 200px; }
.nav-add-url { flex: 1 1 300px; }

/* ---------- 用户评价（多维度五星） ---------- */
.rating-panel .rating-download { float: right; font-weight: 400; font-size: 13px; }
.rating-download strong { color: var(--primary, #4f6ef7); }
.rating-summary { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.rating-dim, .rate-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rating-name { flex: 0 0 110px; color: var(--text-muted, #64748b); font-size: 14px; }
.stars { letter-spacing: 1px; }
.star { color: #cbd5e1; font-size: 16px; }
.star.on { color: #f59e0b; }
.rating-avg { color: #b45309; }
.rate-box { border-top: 1px dashed var(--border, #e2e8f0); padding-top: 10px; }
.rate-row { margin-top: 6px; }
.rate-star {
  background: none; border: 0; padding: 0 2px; font-size: 20px;
  color: #cbd5e1; cursor: pointer; line-height: 1;
}
.rate-star:hover, .rate-star.on { color: #f59e0b; }
.rate-hint { margin-left: 4px; }
.tag-license { background: #f0f9ff; color: #0369a1; }

/* ---------- 评论配图 / 表情 ---------- */
.comment-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -4px 0 10px; }
.emoji-picker { display: inline-flex; gap: 2px; }
.emoji-btn {
  border: 0; background: none; font-size: 18px; cursor: pointer;
  padding: 0 2px; line-height: 1; transition: transform .12s ease;
}
.emoji-btn:hover { transform: scale(1.15); }
.comment-form textarea {
  width: 100%; resize: vertical; font: inherit; padding: 10px 12px;
  border: 1px solid var(--border, #d7dce5); border-radius: 8px;
}
.comment-img {
  max-width: 100%; max-height: 360px; border-radius: 8px;
  margin: 6px 0; display: block;
}

/* ---------- 软件统计总览 ---------- */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px; margin-bottom: 16px;
}
.stat-bar-row {
  display: grid; grid-template-columns: 120px 1fr 110px;
  align-items: center; gap: 10px; margin: 10px 0; font-size: 13px;
}
.stat-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-bar { height: 12px; background: #eef2f7; border-radius: 999px; overflow: hidden; }
.stat-fill { display: block; height: 100%; border-radius: 999px; min-width: 2px; }
.star-fill { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.dl-fill { background: linear-gradient(90deg, #60a5fa, #4f6ef7); }
.stat-value { text-align: right; color: var(--text-muted, #64748b); }
.table-scroll { overflow-x: auto; }

/* ---------- 教学视频 ---------- */
.video-panel { max-width: 960px; margin: 0 auto; }
.teach-video { width: 100%; max-height: 70vh; background: #000; border-radius: 10px; }
.video-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.video-desc { margin: 6px 0 10px; color: var(--text-muted, #64748b); font-size: 14px; white-space: pre-line; }
.video-section-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px dashed var(--border); }
.video-mode-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.video-section.active, .video-mode.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.video-section.active:hover, .video-mode.active:hover { color: #fff; background: var(--primary-dark); border-color: var(--primary-dark); }
.video-cat-select { max-width: 140px; }
.video-hint { margin: 8px 0 0; }
.video-list { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.video-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--card); color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.video-item:hover { border-color: var(--primary); color: var(--primary); }
.video-item.current { border-color: var(--primary); background: var(--primary-light); color: var(--primary-dark); }
.video-item-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-item-meta { color: var(--muted); font-size: 12px; white-space: nowrap; }
.video-edit-form { display: flex; flex-direction: column; gap: 6px; min-width: 320px; }
.video-title-input { font-weight: 600; }
.video-desc-input { resize: vertical; font: inherit; }
.video-meta-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.video-sort-input { width: 72px; }
.video-file-input { max-width: 240px; font-size: 12px; }

/* ---------- 图片素材 ---------- */
.photo-panel { max-width: 1040px; margin: 0 auto; }
.photo-section-bar {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px;
  padding-bottom: 10px; border-bottom: 1px dashed var(--border);
}
.photo-mode-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.photo-section.active, .photo-mode.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.photo-section.active:hover, .photo-mode.active:hover { color: #fff; background: var(--primary-dark); border-color: var(--primary-dark); }
.photo-stage {
  position: relative; display: flex; align-items: center; justify-content: center;
  background: #0b1220; border-radius: 10px; overflow: hidden;
  height: 60vh; min-height: 320px; max-height: 70vh;
}
.photo-stage img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.photo-stage-caption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 18px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .78));
}
.photo-stage-caption h2 { margin: 0 0 4px; color: #fff; font-size: 18px; }
.photo-stage-caption p { margin: 0; color: #dbeafe; font-size: 13px; white-space: pre-line; }
.photo-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.photo-hint { margin-left: auto; }
.photo-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.photo-item {
  padding: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
  background: var(--card); color: var(--text); font: inherit; text-align: left; cursor: pointer;
  display: flex; flex-direction: column;
}
.photo-item:hover { border-color: var(--primary); }
.photo-item img { width: 100%; height: 110px; object-fit: cover; display: block; background: #e2e8f0; }
.photo-item-title {
  padding: 6px 8px 0; font-size: 13px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.photo-item-meta { padding: 2px 8px 8px; color: var(--muted); font-size: 12px; }
.photo-item.current { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }
.photo-fullscreen {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  width: 100%; height: 100%; min-height: 100vh; z-index: 1000; background: #000;
  display: flex; align-items: center; justify-content: center;
}
.photo-fullscreen[hidden] { display: none; }
.photo-fullscreen img {
  position: absolute; top: 0; left: 0; margin: 0;
  width: 100%; height: 100%;
  max-width: 100vw; max-height: 100vh; object-fit: contain;
}
body.photo-fs-open { overflow: hidden; }
.photo-fs-caption {
  position: absolute; left: 0; right: 0; bottom: 64px; padding: 0 24px;
  text-align: center; color: #fff;
}
.photo-fs-caption h2 { margin: 0 0 6px; color: #fff; }
.photo-fs-caption p { margin: 0; color: #cbd5e1; white-space: pre-line; }
.photo-fs-bar {
  position: absolute; left: 0; right: 0; bottom: 16px;
  display: flex; gap: 10px; justify-content: center;
}
.photo-fs-bar .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .4); background: rgba(255, 255, 255, .08); }
.photo-admin-thumb {
  width: 88px; height: 62px; object-fit: cover; display: block;
  border-radius: 6px; border: 1px solid var(--border);
}
.photo-edit-form { display: flex; flex-direction: column; gap: 6px; min-width: 320px; }
.photo-title-input { font-weight: 600; }
.photo-desc-input { resize: vertical; font: inherit; }
.photo-meta-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.photo-sort-input { width: 72px; }
.photo-file-input { max-width: 240px; font-size: 12px; }
.photo-cat-select { max-width: 140px; }

.bgm-upload-form { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.bgm-upload-form input[type=file] { max-width: 180px; font-size: 12px; margin-top: 0; padding: 4px; }

@media (max-width: 640px) {
  .stat-bar-row { grid-template-columns: 88px 1fr 84px; }
  .rating-name { flex-basis: 88px; }
  .photo-stage { height: 46vh; }
  .photo-hint { margin-left: 0; width: 100%; }
}

/* ---------- 音乐 ---------- */
.music-panel { max-width: 1040px; margin: 0 auto; }
.music-section.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.music-section.active:hover { color: #fff; background: var(--primary-dark); border-color: var(--primary-dark); }
.music-album.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.music-album.active:hover { color: #fff; background: var(--primary-dark); border-color: var(--primary-dark); }
.music-album-bar { align-items: center; }
.music-player {
  background: #0b1220; color: #e6ecff; border-radius: 12px;
  padding: 18px; margin-bottom: 18px;
}
.music-badge { font-size: 12px; color: #93c5fd; letter-spacing: .5px; }
.music-now h2 { color: #fff; margin: 4px 0 2px; font-size: 20px; }
.music-now p { margin: 0; }
.music-player audio { width: 100%; margin: 12px 0; }
.music-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.music-controls .btn-ghost { color: #dbeafe; border-color: rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .06); }
.music-controls .btn-ghost:hover { color: #fff; border-color: #fff; }
.music-mode.active { background: #fff; color: #1f2430; border-color: #fff; }
#music-download { margin-left: auto; }
.music-hint { color: #94a3b8; margin: 10px 0 0; }
.music-item {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
  padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--card);
}
.music-item.current { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }
.music-item-play {
  flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 4px; border: 0; background: none; color: inherit; font: inherit;
  text-align: left; cursor: pointer;
}
.music-item-play:hover .music-item-title { color: var(--primary); }
.music-item-index {
  width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%;
  background: var(--primary-light); color: var(--primary-dark);
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px;
}
.music-item-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.music-item-meta { color: var(--muted); font-size: 12px; }

/* 定时广播：前台提示与播放中横幅 */
.music-schedule-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -4px 0 16px; }
.music-schedule-chip {
  padding: 3px 10px; border-radius: 999px; font-size: 12px;
  background: var(--primary-light); color: var(--primary-dark);
}
.music-broadcast {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px;
  padding: 8px 12px; margin-bottom: 12px; border-radius: 8px;
  background: rgba(79, 110, 247, .16); border: 1px solid rgba(147, 197, 253, .35);
}
.music-broadcast strong { color: #fff; }
.music-broadcast .muted { color: #93c5fd; }

/* 后台定时广播表单 */
.schedule-item {
  padding: 12px 14px; margin-bottom: 12px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--card);
}
.schedule-add { border-style: dashed; }
.schedule-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 10px; }
.schedule-row > label { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: 13px; color: var(--muted); }
.schedule-row input[type="text"], .schedule-row input[type="time"],
.schedule-row input[type="number"], .schedule-row select { min-width: 116px; }
.schedule-name { min-width: 180px !important; }
.schedule-sort { width: 76px; min-width: 76px !important; }
.schedule-days { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.schedule-day {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--bg); cursor: pointer; font-size: 13px;
}
.schedule-day input { margin: 0; }
.schedule-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.schedule-buttons { display: inline-flex; gap: 8px; }

/* ---------- 电子书 ---------- */
.ebook-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.ebook-card {
  display: flex; gap: 14px; padding: 16px; background: var(--card);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
}
.ebook-cover {
  width: 64px; height: 88px; flex-shrink: 0; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 700; letter-spacing: .5px;
  background: linear-gradient(135deg, #4f6ef7, #8fa2ff);
}
.ebook-cover-epub { background: linear-gradient(135deg, #2f9e63, #7bd3a4); }
.ebook-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ebook-info h3 { font-size: 16px; margin-bottom: 4px; }
.ebook-desc {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; margin-bottom: 4px;
}
.ebook-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 10px; }
.ebook-reader { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 16px; align-items: start; }
.ebook-toc {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; position: sticky; top: 76px;
  max-height: calc(100vh - 100px); overflow: auto;
}
.ebook-toc-head h1 { font-size: 18px; margin-bottom: 6px; }
.ebook-toc-head .btn { margin-top: 6px; }
.ebook-toc-list { margin: 12px 0 0; padding-left: 18px; font-size: 14px; }
.ebook-toc-list li { margin-bottom: 8px; }
.ebook-toc-list a.active { font-weight: 700; color: var(--primary-dark); }
.ebook-view { background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.ebook-toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
}
.ebook-view iframe {
  width: 100%; height: calc(100vh - 190px); min-height: 520px;
  border: 0; display: block; background: #fff;
}

/* ---------- 留言板 ---------- */
.board-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.board-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.board-item {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 12px; background: #fff;
}
.board-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.board-content { white-space: pre-wrap; word-break: break-word; margin: 0; }
.board-reply {
  margin-top: 10px; padding: 10px 12px; border-radius: 6px;
  background: var(--primary-light); border-left: 3px solid var(--primary);
}
.board-reply-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.board-admin-item { margin-bottom: 14px; }
.board-admin-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* ---------- 公告栏 ---------- */
.board-announce { position: sticky; top: 84px; }
.ann-list { display: flex; flex-direction: column; }
.ann-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--border); color: var(--text); }
.ann-item:last-child { border-bottom: 0; }
.ann-item:hover { text-decoration: none; }
.ann-item:hover .ann-item-title { color: var(--primary); }
.ann-item-title { font-size: 14px; font-weight: 600; line-height: 1.45; }
.ann-more { margin-top: 12px; }
.announce-list { display: flex; flex-direction: column; gap: 14px; }
.announce-card { display: block; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; color: var(--text); transition: box-shadow .2s, transform .2s; }
.announce-card:hover { text-decoration: none; box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.announce-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.announce-card-head h2 { font-size: 18px; }
.announce-summary { color: var(--muted); font-size: 13.5px; margin-top: 8px; }
.announce-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.announce-banner { padding-bottom: 18px; }
.announce-content { margin-bottom: 18px; }
.announce-doc-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.announce-doc-head .section-title { margin: 0; }
.announce-doc-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.doc-frame { width: 100%; height: calc(100vh - 250px); min-height: 520px; border: 1px solid var(--border); border-radius: 12px; background: #fff; display: block; }
.ann-delete-form { margin-top: 12px; }

@media (max-width: 1100px) {
  .board-layout { grid-template-columns: 1fr 1fr; }
  .board-announce { grid-column: 1 / -1; position: static; }
}

@media (max-width: 900px) {
  .board-layout { grid-template-columns: 1fr; }
  .doc-frame { height: 70vh; min-height: 420px; }
  .ebook-reader { grid-template-columns: 1fr; }
  .ebook-toc { position: static; max-height: none; }
  .ebook-view iframe { height: 70vh; min-height: 420px; }
  #music-download { margin-left: 0; }
}

/* ---------- 软件下载页：铺满屏宽，卡片式 5 列 / 列表式 2 列 ---------- */
body.software-page main.container { max-width: none; padding-left: 14px; padding-right: 14px; }
body.software-page main.container .board { margin-bottom: 26px; }

/* 卡片式：统一高度，标题/标签/说明各占一行，超出省略 */
body.view-card .card-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
body.view-card .card-grid .sw-card { height: 190px; padding: 14px; gap: 10px; overflow: hidden; }
body.view-card .card-grid .sw-icon { width: 40px; height: 40px; border-radius: 10px; font-size: 19px; }
body.view-card .card-grid .sw-body { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
body.view-card .card-grid .sw-body h3 {
  display: flex; align-items: center; gap: 4px;
  font-size: 15px; margin-bottom: 6px; min-width: 0;
}
/* 有“荐”角标时给标题右侧留位，避免压字 */
body.view-card .card-grid .sw-card:has(.corner-badge) .sw-body h3 { padding-right: 22px; }
body.view-card .card-grid .sw-body h3 a { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.view-card .card-grid .sw-meta { flex-wrap: nowrap; overflow: hidden; margin-bottom: 6px; }
body.view-card .card-grid .sw-meta .tag { flex: 0 0 auto; }
body.view-card .card-grid .sw-desc {
  margin-bottom: 0; min-height: 0; -webkit-line-clamp: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
body.view-card .card-grid .sw-foot { margin-top: auto; flex-wrap: nowrap; padding-top: 10px; }
body.view-card .card-grid .sw-actions { margin-left: auto; }
body.view-card .card-grid .dl-count { white-space: nowrap; font-size: 12px; }
body.view-card .card-grid .sw-foot .btn { flex: 0 0 auto; padding: 6px 12px; font-size: 13px; white-space: nowrap; }

/* 窄屏卡片较窄：先隐藏下载次数、再只留前两个标签，避免被裁成半截 */
@media (max-width: 1500px) {
  body.view-card .card-grid .dl-count { display: none; }
  body.view-card .card-grid .sw-meta .tag:nth-child(n+3) { display: none; }
}
@media (max-width: 1300px) {
  body.view-card .card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  body.view-card .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  body.view-card .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  body.view-card .card-grid { grid-template-columns: 1fr; }
  body.view-card .card-grid .sw-card { height: auto; }
}

/* ---------- 前台显示风格：卡片式 / 列表式（管理员在站点设置切换） ---------- */
body.view-list .article-grid,
body.view-list .ebook-grid,
body.view-list .nav-grid { display: flex; flex-direction: column; gap: 10px; }
body.view-list .card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }

@media (max-width: 900px) {
  body.view-list .card-grid { grid-template-columns: 1fr; }
}

/* 列表式：等高一行一条，名称与说明单行省略 */
body.view-list .sw-card { padding: 12px 16px; gap: 12px; align-items: center; height: 76px; overflow: hidden; }
body.view-list .sw-card:hover { transform: none; }
body.view-list .sw-icon { width: 40px; height: 40px; border-radius: 10px; font-size: 19px; }
body.view-list .corner-badge { position: static; align-self: center; padding: 2px 8px; border-radius: 6px; }
body.view-list .sw-body {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 16px; row-gap: 2px; align-items: center;
  min-width: 0; overflow: hidden;
}
body.view-list .sw-body h3 { grid-column: 1; display: flex; align-items: center; gap: 4px; min-width: 0; margin: 0; }
body.view-list .sw-body h3 a { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.view-list .sw-meta { grid-column: 2; grid-row: 1; flex-wrap: nowrap; justify-content: flex-end; overflow: hidden; margin: 0; }
body.view-list .sw-meta .tag { flex: 0 0 auto; }
body.view-list .sw-meta .tag:nth-child(n+3) { display: none; }
body.view-list .sw-desc {
  grid-column: 1; margin: 0; min-height: 0; -webkit-line-clamp: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
body.view-list .sw-foot { grid-column: 2; grid-row: 2; justify-content: flex-end; flex-wrap: nowrap; white-space: nowrap; }
body.view-list .sw-foot .dl-count { display: none; }
body.view-list .sw-foot .btn { padding: 5px 12px; font-size: 13px; }

body.view-list .article-card { flex-direction: row; align-items: center; border-radius: 12px; }
body.view-list .article-card:hover { transform: none; }
body.view-list .article-cover { flex: 0 0 120px; width: 120px; height: 74px; aspect-ratio: auto; }
body.view-list .article-cover svg { width: 30px; height: 30px; }
body.view-list .article-body { padding: 12px 16px; gap: 6px; }
body.view-list .article-summary { flex: none; -webkit-line-clamp: 1; }

body.view-list .ebook-card { padding: 12px 16px; align-items: center; gap: 12px; }
body.view-list .ebook-cover { width: 44px; height: 58px; font-size: 11px; }
body.view-list .ebook-info {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 16px; row-gap: 2px; align-items: center;
}
body.view-list .ebook-info h3 { grid-column: 1; margin: 0; }
body.view-list .ebook-info > p:not(.ebook-desc) { grid-column: 1; }
body.view-list .ebook-desc { grid-column: 1; margin: 0; -webkit-line-clamp: 1; }
body.view-list .ebook-actions { grid-column: 2; grid-row: 1 / span 3; margin: 0; padding: 0; }

body.view-list .nav-grid { gap: 8px; }
body.view-list .nav-card { padding: 10px 14px; border-radius: 10px; }
body.view-list .nav-card:hover { transform: none; }
body.view-list .nav-card-url { max-width: none; }

@media (max-width: 640px) {
  body.view-list .sw-body { grid-template-columns: 1fr; }
  body.view-list .sw-meta,
  body.view-list .sw-foot { grid-column: 1; grid-row: auto; justify-content: flex-start; }
  body.view-list .ebook-info { grid-template-columns: 1fr; }
  body.view-list .ebook-actions { grid-column: 1; grid-row: auto; margin-top: 8px; }
}


