/* =========================================================
   FutureYSM · Z-Library 暗色风格主题
   结构：工具条 / 主导航 / 首屏搜索 / 数据条 / 侧栏 + 内容 / 页脚
   视觉：炭黑底 + 1px 分隔线 + 蓝色链接 + 绿色主操作
   ========================================================= */

:root,
html[data-theme="dark"] {
  /* 采用 Z-Library 暗色主题的原始色值 */
  --bg: #1E1F22;
  --bg-deep: #18191C;
  --surface: #2B2D31;
  --surface-2: #33363B;
  --surface-3: #3A3D42;
  --border: #3A3D42;
  --border-soft: #2F3236;
  --text: #FAFAFA;
  --text-2: #BFBFBF;
  --text-3: #8C8C8C;
  --link: #49AFD0;
  --link-hover: #6CC4E0;
  --green: #71B82C;
  --green-hover: #7FCC35;
  --green-soft: rgba(113, 184, 44, .14);
  --danger: #E05252;
  --radius: 4px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
          "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

html { background: var(--bg); color-scheme: dark; }

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
img { max-width: 100%; }
::selection { background: #2f5d3a; color: #fff; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 1px;
}

.container { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* ---------------- 顶部工具条 ---------------- */
.topbar {
  background: var(--bg-deep);
  border-bottom: 1px solid var(--surface-2);
  font-size: 12px;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 32px;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 18px; }
.topbar a { color: var(--text-3); }
.topbar a:hover { color: var(--text); }

/* ---------------- 主导航 ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 22px;
  height: 58px;
}
.logo { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.logo-mark {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  background: var(--green);
  border-radius: 3px;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}
.logo-text {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.2px;
}
.logo-sub {
  font-size: 11px;
  color: var(--text-3);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 1px 5px;
  margin-left: 2px;
}
.main-nav { display: flex; align-items: center; gap: 20px; }
.main-nav a {
  color: var(--text-2);
  font-size: 14px;
  padding: 18px 0;
  border-bottom: 2px solid transparent;
}
.main-nav a:hover { color: #fff; }
.main-nav a.active { color: #fff; border-bottom-color: var(--green); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.menu-toggle {
  display: none;
  width: 34px;
  height: 32px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.menu-toggle:hover { border-color: var(--border); color: #fff; }
.mobile-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  padding: 6px 16px 14px;
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .35);
}
.mobile-menu.open { display: block; }
.mobile-menu a {
  display: block;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-2);
  font-size: 14px;
}
.mobile-menu a:last-child { border-bottom: none; }
.mobile-menu a:hover { color: #fff; }
.header-search { display: flex; }
.header-search input {
  width: 190px; height: 32px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 3px 0 0 3px;
  color: var(--text);
  padding: 0 10px;
  font-size: 13px;
}
.header-search input::placeholder { color: var(--text-3); }
.header-search button {
  height: 32px;
  padding: 0 12px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 0 3px 3px 0;
  color: var(--text-2);
  cursor: pointer;
  font-size: 13px;
}
.header-search button:hover { background: #383838; color: #fff; }
.header-search input:focus { border-color: var(--green); outline: none; }
.user-status a { font-size: 12.5px; }

/* 标题花体字（OFL 授权，已子集化） */
@font-face {
  font-family: 'YSM Script';
  src: url('../fonts/ysm-script.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'YSM Brush';
  src: url('../fonts/ysm-brush.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---------------- 首屏 ---------------- */
.hero {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 34px 0 28px;
  text-align: center;
}
.hero h1 {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -.3px;
  color: var(--text);
  margin-bottom: 6px;
}
.hero-logo {
  display: inline-block;
  margin-bottom: 8px;
}
.hero h1.hero-title {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0;
  line-height: 1.1;
  letter-spacing: 0;
}
.hero-script {
  font-family: 'YSM Script', 'Segoe Script', cursive;
  font-size: 58px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: .5px;
  padding-bottom: 18px;
  margin-bottom: -18px;
  background: linear-gradient(100deg, #FFFFFF 0%, #E8FAFF 40%, #8FE0F7 72%, #49AFD0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 22px rgba(73, 175, 208, .35));
}
.hero-brush {
  font-family: 'YSM Brush', 'STKaiti', 'KaiTi', serif;
  font-size: 50px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 3px;
  color: #F7FBFF;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, .45));
}
.hero-underline {
  position: relative;
  display: block;
  width: 72%;
  height: 2px;
  margin: 22px auto 0;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(73, 175, 208, .85) 30%, rgba(113, 184, 44, .75) 70%, transparent);
}
.hero-underline::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  transform: translate(-50%, -50%) rotate(45deg);
  background: #49AFD0;
  box-shadow: 0 0 12px rgba(73, 175, 208, .9);
}
@media (max-width: 768px) {
  .hero-script { font-size: 42px; }
  .hero-brush { font-size: 36px; letter-spacing: 2px; }
  .hero h1.hero-title { gap: 10px; }
}
@media (max-width: 480px) {
  .hero-script { font-size: 34px; }
  .hero-brush { font-size: 30px; letter-spacing: 1px; }
  .hero h1.hero-title { gap: 8px; }
}
.slogan { font-size: 13.5px; color: var(--text-3); }
.search-box {
  display: flex;
  max-width: 640px;
  height: 46px;
  margin: 20px auto 0;
}
.search-box input {
  flex: 1;
  min-width: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  color: var(--text);
  padding: 0 16px;
  font-size: 15px;
}
.search-box input::placeholder { color: var(--text-3); }
.search-box input:focus { border-color: var(--green); outline: none; }
.search-box button {
  width: 108px;
  background: var(--green);
  border: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.search-box button:hover { background: var(--green-hover); }
.hero-hints { margin-top: 12px; font-size: 12px; color: var(--text-3); }
.hero-hints a { margin: 0 4px; color: var(--link); }

/* ---------------- 数据条 ---------------- */
.stats-bar { background: var(--bg-deep); border-bottom: 1px solid var(--border-soft); }
.stats-inner { display: flex; }
.stat {
  flex: 1;
  padding: 11px 0;
  text-align: center;
  border-right: 1px solid var(--border-soft);
}
.stat:last-child { border-right: none; }
.stat b {
  display: block;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.stat span { font-size: 11px; color: var(--text-3); }

/* ---------------- 主布局 ---------------- */
main.container { padding-top: 22px; padding-bottom: 44px; }
.layout {
  display: block;
}
.sidebar { position: sticky; top: 78px; }
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 14px;
}
.panel h3 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: .3px;
  margin-bottom: 6px;
}
.panel > a,
.panel > button {
  display: block;
  width: 100%;
  text-align: left;
  color: var(--text-2);
  font-size: 13px;
  padding: 7px 0;
  border: none;
  border-bottom: 1px solid var(--border-soft);
  background: none;
  cursor: pointer;
}
.panel > a:last-child,
.panel > button:last-child { border-bottom: none; }
.panel > a:hover,
.panel > button:hover { color: var(--text); }
.panel-loading { font-size: 12px; color: var(--text-3); }

.top-authors { display: block; }
.ta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 6px 0;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-2);
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
}
.ta-row:last-child { border-bottom: none; }
.ta-row:hover { color: var(--text); }
.ta-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ta-count { color: var(--text-3); flex-shrink: 0; }
.ta-row:hover .ta-count { color: var(--text-2); }

/* ---------------- 内容工具条 ---------------- */
.content { min-width: 0; }
.content-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.view-tabs { display: flex; gap: 2px; }
.tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--text-3);
  font-size: 14px;
  padding: 9px 14px;
  cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--green); }
.count { font-size: 12px; color: var(--text-3); }

.breadcrumb { font-size: 13px; color: var(--text-3); margin-bottom: 14px; }
.breadcrumb a { color: var(--link); }
.breadcrumb-sep { margin: 0 6px; color: var(--border); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.section-head h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.head-right, .model-toolbar { display: flex; align-items: center; gap: 10px; }
.author-sort {
  height: 30px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-2);
  padding: 0 8px;
  font-size: 12.5px;
}

/* ---------------- 模型卡片（海报式） ---------------- */
.software-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 18px 14px;
}
.software-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: #1B1D21;
  border: 1px solid #34373C;
  border-radius: 14px;
  cursor: pointer;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.software-card:hover {
  transform: translateY(-4px);
  border-color: rgba(73, 175, 208, .55);
  box-shadow: 0 16px 32px rgba(0, 0, 0, .45), 0 0 0 1px rgba(73, 175, 208, .12);
}
.card-image-wrap {
  position: relative;
  aspect-ratio: 7 / 12;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(73, 175, 208, .10), transparent 60%),
    #15171A;
  border: none;
  border-radius: 0;
}
.card-image-wrap::before {
  content: '';
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 0;
  z-index: 3;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(73, 175, 208, .9), transparent);
  opacity: .55;
  pointer-events: none;
  transition: opacity .25s ease;
}
.software-card:hover .card-image-wrap::before { opacity: 1; }
.card-image-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 52%, rgba(10, 11, 14, .18) 68%, rgba(10, 11, 14, .55) 84%, rgba(10, 11, 14, .85) 100%);
}
.card-image,
.card-image-wrap video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
  transition: transform .45s cubic-bezier(.2, .7, .2, 1);
}
.software-card:hover .card-image,
.software-card:hover .card-image-wrap video { transform: scale(1.035); }

/* 版本角标（左上） */
.card-ver-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  padding: 2px 6px;
  background: rgba(12, 13, 16, .78);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 5px;
  color: #D7DCE2;
  font-size: 10px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* 正文叠加在图片底部 */
.card-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 30px 11px 11px;
  background: linear-gradient(180deg, rgba(10, 11, 14, 0) 0%, rgba(10, 11, 14, .72) 24%, rgba(10, 11, 14, .96) 55%, #0C0D10 100%);
}
.card-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #F3F5F8;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.42;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .55);
}
.software-card:hover .card-title { color: #FFFFFF; }
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 8px;
  margin-top: 4px;
  color: #A2AAB4;
  font-size: 10.5px;
}

/* 操作按钮（右上，悬浮出现） */
.card-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  display: flex;
  gap: 6px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .2s ease, transform .2s ease;
}
.software-card:hover .card-actions,
.software-card:focus-within .card-actions { opacity: 1; transform: none; }
.btn-download, .btn-comment {
  padding: 4px 8px;
  background: rgba(12, 13, 16, .78);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.4;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.btn-download { color: #8FE05A; font-weight: 600; }
.btn-comment { color: #7CC8E8; }
.btn-download:hover, .btn-comment:hover { background: rgba(12, 13, 16, .92); text-decoration: none; }
.btn-download:disabled, .btn-comment:disabled { opacity: .5; cursor: default; }

/* 无预览图的兜底 */
.software-card.no-image { padding: 12px; }
.software-card.no-image .card-body { position: static; padding: 0; background: none; }
.software-card.no-image .card-actions { position: static; opacity: 1; transform: none; margin-top: 8px; }
.software-card.no-image .card-title { color: var(--text); text-shadow: none; }
.software-card.no-image .card-meta { color: var(--text-3); }

@media (hover: none) {
  .card-actions { opacity: 1; transform: none; }
}

/* ---------------- 作者卡片 ---------------- */
.author-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}
.author-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.author-card:hover { border-color: #4a4a4a; background: var(--surface-2); }
.author-cover {
  position: relative;
  width: 44px; height: 44px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--border-soft);
  border-radius: 3px;
}
.author-cover img { width: 100%; height: 100%; object-fit: cover; }
.author-badge {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, .72);
  color: var(--text-2);
  font-size: 9px;
  text-align: center;
  padding: 1px 0;
}
.author-initial {
  width: 44px; height: 44px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: var(--border-soft);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-3);
  font-size: 17px;
  font-weight: 600;
}
.author-body { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.author-info { flex: 1; min-width: 0; }
.author-title-row { display: block; }
.author-title {
  display: block;
  font-size: 13.5px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.author-model-count, .author-rating { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.author-avatar-wrap img {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.grade-SSS, .grade-SS, .grade-S { color: #ffc24b; font-weight: 700; }
.grade-A { color: #7bc96f; font-weight: 700; }
.grade-B { color: var(--link); font-weight: 700; }
.grade-C { color: var(--text-3); font-weight: 700; }

/* ---------------- 加载更多 / 空态 ---------------- */
.model-load-more {
  display: block;
  margin: 26px auto 0;
  padding: 9px 28px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
}
.model-load-more:hover { border-color: var(--green); color: var(--text); }
.empty-tip { padding: 34px 0; text-align: center; font-size: 13px; color: var(--text-3); }

/* ---------------- 评论 ---------------- */
.comment-block {
  margin: 8px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: default;
}
.comment-block h4 { font-size: 12px; font-weight: 600; color: var(--text-3); margin-bottom: 8px; }
.comment-list { max-height: 260px; overflow-y: auto; }
.comment-item { padding: 8px 0; border-bottom: 1px solid var(--border-soft); }
.comment-item:last-child { border-bottom: none; }
.comment-item-head { display: flex; align-items: baseline; gap: 8px; }
.comment-nick { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.comment-time { font-size: 11px; color: var(--text-3); }
.comment-content { margin-top: 4px; font-size: 12.5px; line-height: 1.6; color: var(--text-2); }
.comment-input-row { display: flex; gap: 8px; margin-top: 10px; }
.comment-input {
  flex: 1;
  min-height: 36px;
  padding: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text);
  font-size: 12.5px;
  resize: vertical;
}
.comment-input::placeholder { color: var(--text-3); }
.comment-send {
  padding: 0 16px;
  background: var(--green);
  border: none;
  border-radius: 3px;
  color: #fff;
  font-size: 12.5px;
  cursor: pointer;
}
.comment-send:hover { background: var(--green-hover); }
.comment-empty { font-size: 12px; color: var(--text-3); }

/* ---------------- 关于 ---------------- */
.about-section {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.about-section h2 { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.about-section p { font-size: 12.5px; line-height: 1.7; color: var(--text-3); margin: 4px 0; }

/* ---------------- 页脚 ---------------- */
.site-footer {
  margin-top: 20px;
  padding: 28px 0 20px;
  background: var(--bg-deep);
  border-top: 1px solid var(--border-soft);
}
.footer-cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.footer-col h4 { font-size: 12px; font-weight: 600; color: var(--text-3); margin-bottom: 8px; }
.footer-col a { display: block; padding: 3px 0; font-size: 12.5px; color: var(--text-3); }
.footer-col a:hover { color: var(--text-2); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--surface-2);
  font-size: 12px;
  color: var(--text-3);
}

/* ---------------- 公告弹窗 ---------------- */
.announce-mask {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, .72);
}
.announce-modal {
  width: min(560px, 100%);
  max-height: 82vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.announce-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.announce-title { font-size: 14px; font-weight: 600; color: var(--text); }
.announce-close {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.announce-close:hover { color: var(--text); }
.announce-body {
  padding: 16px 18px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-2);
}
.announce-body p { margin-bottom: 8px; }
.announce-body strong { color: var(--text); }
.announce-sub { margin: 12px 0 4px; font-weight: 600; color: var(--text); }
.announce-ok {
  display: block;
  width: calc(100% - 36px);
  height: 38px;
  margin: 0 18px 18px;
  background: var(--green);
  border: none;
  border-radius: 3px;
  color: #fff;
  font-size: 13.5px;
  cursor: pointer;
}
.announce-ok:hover { background: var(--green-hover); }

/* =========================================================
   详情页
   ========================================================= */
.detail-page { padding-top: 20px; }
.detail-hero {
  display: flex;
  gap: 26px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.detail-preview-wrap {
  position: relative;
  width: 260px;
  flex-shrink: 0;
  aspect-ratio: 7 / 12;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.detail-preview,
.detail-preview-wrap img,
.detail-preview-wrap video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.detail-ver-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, .72);
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--text-2);
  font-size: 10px;
  padding: 1px 5px;
}
.detail-info { flex: 1; min-width: 0; }
.detail-title {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  margin-bottom: 10px;
}
.detail-meta-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.detail-meta-tag {
  font-size: 11.5px;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 2px 7px;
}
.detail-author-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.detail-author-chip {
  font-size: 12px;
  color: var(--link);
  background: #24323A;
  border: 1px solid #3A5666;
  border-radius: 2px;
  padding: 2px 8px;
}
.detail-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.detail-actions .btn-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 26px;
  border-radius: 3px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  background: var(--green);
  color: #fff;
}
.detail-actions .btn-download:hover { background: var(--green-hover); text-decoration: none; }
.detail-actions .btn-download:not(.detail-dl-btn) {
  background: var(--surface-2) !important;
  border: 1px solid var(--surface-3);
  border-radius: 3px !important;
  color: var(--text-2) !important;
  font-weight: 400;
  padding: 0 18px !important;
  margin-left: 0 !important;
  text-decoration: none !important;
}
.detail-actions .btn-download:not(.detail-dl-btn):hover { border-color: var(--green); color: var(--text) !important; }

.detail-section { margin-top: 22px; }
.detail-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  padding-bottom: 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.detail-tips { font-size: 13px; line-height: 1.8; color: var(--text-2); }
.detail-tips p { margin-bottom: 6px; }
.detail-ver-hint { font-size: 12px; color: var(--text-3); margin-bottom: 8px; }

.detail-author-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.detail-author-card {
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.detail-author-card-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.detail-author-card-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.detail-author-card-role { font-size: 12px; color: var(--text-3); }
.detail-author-card-comment { font-size: 12px; line-height: 1.6; color: var(--text-3); margin-top: 4px; }
.detail-author-card-links { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; }
.detail-contact-link { font-size: 12px; color: var(--link); }
.detail-contact-text { font-size: 12px; color: var(--text-3); }
.detail-link-row { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12.5px; color: var(--text-3); margin: 4px 0; }
.detail-license-desc { font-size: 12.5px; line-height: 1.7; color: var(--text-3); }

.detail-version-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
}
.detail-version-left { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; min-width: 0; }
.detail-version-num { font-size: 13.5px; font-weight: 600; color: var(--text); }
.detail-version-size { font-size: 12px; color: var(--text-3); }
.detail-version-new {
  font-size: 10px;
  color: #7bc96f;
  border: 1px solid #4A6B45;
  border-radius: 2px;
  padding: 0 5px;
}
.detail-version-btn {
  flex-shrink: 0;
  height: 32px;
  padding: 0 16px;
  background: var(--surface-2);
  border: 1px solid var(--surface-3);
  border-radius: 3px;
  color: var(--text-2);
  font-size: 12.5px;
  cursor: pointer;
}
.detail-version-btn:hover { border-color: var(--green); color: var(--text); }

.detail-loading, .detail-error { padding: 40px 0; text-align: center; font-size: 13px; color: var(--text-3); }
.detail-error { color: #E08A8A; }

/* 质量等级小标签 */
.detail-quality-s, .detail-quality-a, .detail-quality-b, .detail-quality-c,
.detail-quality-d, .detail-quality-e {
  font-size: 11px;
  font-weight: 700;
  padding: 0 4px;
  border-radius: 2px;
  border: 1px solid currentColor;
}
.detail-quality-s { color: #ffc24b; }
.detail-quality-a { color: #7bc96f; }
.detail-quality-b { color: var(--link); }
.detail-quality-c, .detail-quality-d, .detail-quality-e { color: var(--text-3); }

/* =========================================================
   响应式
   ========================================================= */
@media (hover: none) {
  .card-actions { opacity: 1; }
}

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .content { order: 1; }
  .sidebar {
    order: 2;
    position: static;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
  .sidebar .panel { margin-bottom: 0; }
  .main-nav { display: none; }
  .menu-toggle { display: block; }
  .footer-cols { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .topbar { display: none; }
  .header-inner { gap: 10px; }
  .logo-sub { display: none; }
  .header-search { display: none; }
  .sidebar { grid-template-columns: 1fr 1fr; }
  .software-grid { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 16px 10px; }
  .author-grid { grid-template-columns: 1fr; }
  .detail-hero { flex-direction: column; }
  .detail-preview-wrap { width: 100%; max-width: 260px; margin: 0 auto; }
  .detail-title { font-size: 20px; }
  .hero { padding: 24px 0; }
  .hero h1 { font-size: 24px; }
  .stats-inner { flex-wrap: wrap; }
  .stat { flex: 1 0 50%; border-bottom: 1px solid var(--border-soft); }
  .stat:nth-child(2n) { border-right: none; }
  .stat:nth-last-child(-n+2) { border-bottom: none; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 420px) {
  .sidebar { grid-template-columns: 1fr; }
  .search-box button { width: 84px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* =========================================================
   宽屏：无侧栏，6 列网格居中
   ========================================================= */
@media (min-width: 1360px) {
  main.container {
    max-width: none;
    padding-left: 16px;
    padding-right: 16px;
  }
  .layout { display: block; }
  .content {
    max-width: 1208px;
    margin: 0 auto;
    min-width: 0;
  }
  .software-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 18px 14px;
  }
}

/* 更宽时保持 6 列，卡片尺寸按原 7 列基准放大 */
@media (min-width: 1520px) {
  .content {
    max-width: calc((100vw - 232px - 84px) * 6 / 7 + 70px);
  }
  .card-title { font-size: 13.5px; }
  .card-meta { font-size: 11px; }
  .card-body { padding: 32px 12px 12px; }
  .btn-download, .btn-comment { font-size: 11.5px; }
}

@media (min-width: 1800px) {
  .card-title { font-size: 14px; }
  .card-meta { font-size: 11.5px; }
  .card-body { padding: 36px 14px 14px; }
  .btn-download, .btn-comment { font-size: 12px; }
}

/* 详情页 meta 图标与 3D 按钮 */
.detail-meta-tag i { font-size: 12px; margin-right: 3px; color: var(--text-3); vertical-align: -1px; }
.detail-actions .detail-3d-btn { display: inline-flex; align-items: center; gap: 6px; }
.detail-3d-btn .ico-3d { width: 16px; height: 16px; color: var(--link); flex-shrink: 0; }
