/**
 * Single Software Page Styles - Clean & Professional Design
 * 软件详情页样式 - 简洁专业设计
 * Version: 4.0 - 完全匹配HTML结构
 */

/* ==========================================================================
   全局样式
   ========================================================================== */

.single-software {
  min-height: 100vh;
}

/* 侧边栏sticky已在 unified-layout.css 定义，此处仅补充 overflow */
.xu5-page-sidebar {
  overflow: visible !important;
}

/* ==========================================================================
   软件介绍区块头部（图标、标题、标签）
   ========================================================================== */

.card-section-intro {
  padding-bottom: 10px !important;
}

.intro-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e9ecef;
}

/* 软件图标 */
.xu5-software-icon-large {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  background: #f8f9fa;
}

.xu5-icon-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.xu5-icon-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #adb5bd;
}

.xu5-icon-placeholder svg {
  width: 32px;
  height: 32px;
}

/* 软件信息 */
.intro-meta {
  flex: 1;
  min-width: 0;
}

.xu5-software-title {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 6px 0;
  line-height: 1.3;
}

.xu5-software-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.xu5-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
}

.xu5-tag-platform {
  background: #ecf5ff;
  color: #409eff;
}

.xu5-tag-category {
  background: #f3e5f5;
  color: #7b1fa2;
}

/* 软件介绍（在卡片中） */
.xu5-software-desc {
  color: #495057;
  font-size: 14px;
  line-height: 1.6;
}

.xu5-software-desc .desc-brief {
  display: block;
  margin-bottom: 8px;
}

.xu5-software-desc .desc-full {
  display: none;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e9ecef;
}

/* 展开状态 */
.xu5-software-desc.expanded .desc-brief {
  display: none !important;
}

.xu5-software-desc.expanded .desc-full {
  display: block !important;
}

.xu5-software-desc .desc-full img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 10px auto;
  border-radius: 6px;
  box-sizing: border-box;
}

.xu5-software-desc .desc-full p {
  margin-bottom: 12px;
}

.xu5-toggle-desc-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 5px;
  color: #409eff;
  font-size: 12px;
  cursor: pointer;
  padding: 5px 12px;
  margin-top: 8px;
  transition: all 0.2s;
}

.xu5-toggle-desc-btn:hover {
  background: #ecf5ff;
  border-color: #409eff;
  color: #337ecc;
}

.xu5-toggle-desc-btn .btn-icon {
  width: 16px;
  height: 16px;
  transition: transform 0.3s;
}

.xu5-toggle-desc-btn.expanded .btn-icon {
  transform: rotate(180deg);
}

/* ==========================================================================
   主内容区域
   ========================================================================== */

.xu5-main {
  width: 100%;
}

/* 通用卡片样式 */
.card {
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius:5px;
  padding: 24px;
  margin-bottom: 24px;
  width: 100%;
  box-sizing: border-box;
}

/* 统一大卡片样式 - 取消默认padding */
.card-unified {
  padding: 0;
}

/* 卡片内的各个区块 */
.card-section {
  padding: 28px 24px;
  border-bottom: 1px solid #e8e8e8;
}

.card-section:first-child {
  padding-top: 24px;
}

.card-section:last-child {
  border-bottom: none;
  padding-bottom: 24px;
}

/* 区块内的标题样式 */
.card h2,
.card-section h2 {
  font-size: 20px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 16px 0;
  padding-left: 12px;
  border-left: 4px solid #409eff;
}

.card-title {
  font-size: 20px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 16px 0;
  padding-left: 12px;
  border-left: 4px solid #409eff;
}

.software-features,
.software-usage,
.software-faq {
  font-size: 14px;
  line-height: 1.8;
  color: #495057;
}

/* ==========================================================================
   版本列表
   ========================================================================== */

.version-highlight-card {
  padding: 32px 24px;
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 12px;
  margin-bottom: 24px;
}

.version-highlight-title {
  font-size: 20px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 16px 0;
  padding-left: 12px;
  border-left: 4px solid #409eff;
  display: block;
}

.version-highlight-title .bar {
  display: none; /* 隐藏，改用border-left */
}

.version-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* 在大屏幕上固定为3-4列 */
@media (min-width: 900px) {
  .version-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1300px) {
  .version-list {
    grid-template-columns: repeat(4, 1fr);
  }
}

.version-card {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.version-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #409eff, #66b1ff);
  opacity: 0;
  transition: opacity 0.3s;
}

.version-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-color: #409eff;
  background: #ffffff;
}

.version-card:hover::before {
  opacity: 1;
}

.version-title-row {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e9ecef;
}

.version-title-center {
  display: flex;
  align-items: center;
  gap: 12px;
}

.version-icon-single {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.version-softname {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
}

.version-badge {
  display: inline-block;
  padding: 4px 10px;
  background: #ecf5ff;
  color: #409eff;
  font-size: 13px;
  font-weight: 500;
  border-radius: 4px;
  margin-left: 8px;
}

/* 下载按钮区域 */
.version-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.version-btns-center {
  align-items: stretch;
}

/* 下载按钮样式（由JS生成的.url类） */
.url {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 12px 20px !important;
  border: none !important;
  border-radius: 6px !important;
  background: #409eff !important;
  color: #ffffff !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  text-decoration: none !important;
  margin-right: 0 !important;
  margin-bottom: 10px !important;
}

.url:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(64, 158, 255, 0.3) !important;
  filter: brightness(0.95) !important;
}


.no-version {
  text-align: center;
  padding: 40px;
  color: #6c757d;
  font-size: 14px;
}

/* ==========================================================================
   相关推荐
   ========================================================================== */

.card-related {
  padding: 10px 12px;
}

.related-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.related-list li {
  padding: 4px 0;
  border-bottom: 1px solid #f5f5f5;
}

.related-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.related-list a {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #333;
  font-size: 16px;
  transition: all 0.2s;
  line-height: 1.4;
}

.related-list a:hover {
  color: #409eff;
}

/* 相关软件缩略图样式 */
.related-thumb {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  object-fit: cover;
  margin-right: 6px;
  flex-shrink: 0;
}

.related-thumb-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: #f0f0f0;
  border-radius: 3px;
  margin-right: 6px;
  font-size: 10px;
  color: #bbb;
  flex-shrink: 0;
}

/* 版本链接样式 */
.version-link {
  color: inherit;
  text-decoration: underline;
  transition: all 0.2s ease;
}

.version-link:hover {
  color: #409eff;
  text-decoration: underline;
}


/* 悬浮按钮样式由 back-to-top.php 全站统一管理 */

/* ==========================================================================
   响应式设计
   ========================================================================== */

/* 平板 (768px - 1023px) */
@media (max-width: 1023px) {
  .xu5-software-title {
    font-size: 28px;
  }
  
  .version-list {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* 手机 (< 768px) */
@media (max-width: 768px) {
  .intro-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .xu5-software-icon-large {
    width: 80px;
    height: 80px;
  }
  
  .xu5-software-title {
    font-size: 22px;
  }
  
  .xu5-software-tags {
    justify-content: center;
  }
  
  .version-list {
    grid-template-columns: 1fr !important;
  }
  
  .card {
    padding: 20px;
  }
  
  .version-highlight-card {
    padding: 20px;
  }
}

/* 小屏手机 (< 480px) */
@media (max-width: 480px) {
  .xu5-software-title {
    font-size: 20px;
  }
  
  .version-highlight-title {
    font-size: 20px;
  }
  
  .card h2,
  .card-title {
    font-size: 18px;
  }
  
  .version-card {
    padding: 16px;
  }
}

/* ==========================================================================
   打印样式
   ========================================================================== */

@media print {
  .xu5-float-btns,
  .xu5-modal-overlay,
  .version-btns {
    display: none !important;
  }
  
  .xu5-software-hero {
    border: none;
  }
  
  .version-card,
  .card {
    break-inside: avoid;
  }
}

/* ==========================================================================
   可访问性
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: high) {
  .version-card,
  .card {
    border-width: 2px;
  }
  
  .xu5-tag {
    border: 1px solid currentColor;
  }
}


/* ==========================================================================
   软件信息列表 - 超紧凑样式
   ========================================================================== */

.xu5-software-info-list {
  margin: 0;
  padding: 0;
}

.xu5-software-info-list .info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #f5f5f5;
  font-size: 14px;
  gap: 8px;
}

.xu5-software-info-list .info-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.xu5-software-info-list .info-label {
  color: #888;
  flex-shrink: 0;
}

.xu5-software-info-list .info-value {
  color: #333;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xu5-software-info-list .info-value a {
  color: #409eff;
  text-decoration: none;
}

.xu5-software-info-list .info-value a:hover {
  text-decoration: underline;
}

/* 教程列表样式 - 已在 unified-layout.css 中定义 */

/* 软件列表样式 - 已在 unified-layout.css 中定义 */

/* ==========================================================================
   软件详情页侧边栏卡片 - 覆盖统一样式
   ========================================================================== */

.xu5-page-sidebar .xu5-sidebar-card {
  padding: 8px 10px;
  margin-bottom: 8px;
}

.xu5-page-sidebar .xu5-sidebar-card h3 {
  font-size: 16px;
  margin-bottom: 10px;
  padding-bottom: 6px;
}

/* ==========================================================================
   软件详情页 - 卡片区块覆盖
   ========================================================================== */

.xu5-software-wrapper .card-unified {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.xu5-software-wrapper .card-section {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 20px 0;
  margin-bottom: 0;
  box-shadow: none;
  border-bottom: 1px solid #eee;
}

.xu5-software-wrapper .card-section:last-child {
  border-bottom: none;
}

/* ==========================================================================
   版本下载 - 横向布局
   ========================================================================== */

.version-list-horizontal {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.version-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #f9f9f9;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.version-row:hover {
  background: #f0f7ff;
  border-color: #409eff;
  box-shadow: 0 2px 8px rgba(64,158,255,0.1);
}

.version-info-col {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.version-icon-horizontal {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.version-icon-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: #f0f0f0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.version-details {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.version-row .version-softname {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.version-row .version-badge {
  font-size: 12px;
  color: #666;
  background: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid #ddd;
  display: inline-block;
  width: fit-content;
}

.version-btns-col {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* ==========================================================================
   版本下载区 - 视觉突出
   ========================================================================== */

.card-section-download {
  background: transparent !important;
  border-left: none !important;
}

/* ==========================================================================
   右侧操作按钮（订阅 + 打赏）
   ========================================================================== */

.xu5-software-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  align-items: flex-end;
}

.xu5-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  min-width: 120px;
}

.xu5-action-subscribe {
  background: linear-gradient(135deg, #409eff, #337ecc);
  color: white;
  box-shadow: 0 2px 8px rgba(64, 158, 255, 0.3);
}

.xu5-action-subscribe:hover {
  box-shadow: 0 4px 12px rgba(64, 158, 255, 0.4);
}

.xu5-action-donate {
  background: linear-gradient(135deg, #ff6b6b, #ff8e53);
  color: white;
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.xu5-action-donate:hover {
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

/* ==========================================================================
   软件 meta 信息行（介绍区内嵌）
   ========================================================================== */

.xu5-software-meta-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 5px;
  font-size: 12px;
  color: #888;
}

.xu5-software-meta-inline span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   侧边栏图标统一类
   ========================================================================== */

.related-icon-emoji {
  display: inline-flex;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}


/* FAQ 数字编号列表 */
.xu5-faq-numbered-list {
  margin: 0;
  padding: 0 0 0 22px;
  list-style: decimal;
}
.xu5-faq-numbered-list li {
  margin-bottom: 2px;
  padding: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #888;
}
.xu5-faq-numbered-list li::marker {
  color: #aaa;
  font-size: 12px;
}
.xu5-faq-numbered-list li a {
  display: block;
  padding: 4px 2px;
  color: #333;
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
  word-break: break-word;
}
.xu5-faq-numbered-list li a:hover {
  background: #f5f5f5;
  color: #409eff;
}
.related-icon-emoji.software {
  background: #f0f0f0;
  text-align: center;
  line-height: 30px;
  font-size: 16px;
}

.related-icon-software-img {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

/* ==========================================================================
   版本横向布局 + 操作按钮 - 响应式
   ========================================================================== */

@media screen and (max-width: 768px) {
  .xu5-software-actions {
    display: none;
  }
  .version-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .version-btns-col {
    width: 100%;
    justify-content: flex-start;
  }
  .version-btns-col .download-btn,
  .version-btns-col .tutorial-btn {
    padding: 6px 14px !important;
    font-size: 12px !important;
    margin-right: 0 !important;
    margin-bottom: 0 !important;
  }
  .xu5-software-meta-inline {
    justify-content: center;
  }
  .xu5-software-wrapper .card-section {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 15px 0 !important;
    margin-bottom: 10px !important;
  }
  .card-section-download {
    background: transparent !important;
    border-left: none !important;
  }
}