/* 🔥 完美修复：页头250px高 + 背景图完整显示 + 内容紧贴下方 */

.main-content {
  margin-top: 0 !important;
  padding-top: 0 !important;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* 主题变量定义 */
:root {
  --bg-color: #ffffff;
  --text-color: #333333;
  --card-bg: #f8f8f8 !important;
  --border-color: #333333;
  --primary-color: #007bff;
  --success-color: #28a745;
  --warning-color: #ffc107;
  --secondary-color: #6c757d;
  --shadow: none !important;
  --copyright-border: #333333; /* 版权声明边框色 */
  --copyright-text: #6c757d; /* 版权声明文字色 */
}

[data-theme="dark"] {
  --bg-color: #121212;
  --text-color: #e0e0e0;
  --card-bg: #242018;
  --border-color: #3a352d;
  --primary-color: #4dabf7;
  --success-color: #38b000;
  --warning-color: #ffdd00;
  --secondary-color: #94a3b8;
  --shadow: 0 1px 3px rgba(0,0,0,0.2);
  --copyright-border: #495057;
  --copyright-text: #adb5bd;
}

/* 全局样式 */
body {
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 全局容器：统一所有页面的最大宽度 + 居中 */
.container {
  max-width: 1200px !important; /* 全局最大宽度（所有页面统一） */
  width: 100% !important;       /* 宽度铺满屏幕（自适应） */
  margin: 0 auto !important;    /* 水平居中（核心：保证所有页面居中且宽度一致） */
  padding: 10px !important;
  flex: 1;
  margin-top: 10px !important;
}

/* 主内容布局：自适应弹性布局 */
.main-content {
  display: flex !important;
  gap: 20px !important;         /* 内容区和侧边栏间距固定 */
  margin-top: 10px !important;
  width: 100% !important;       /* 铺满全局容器（保证宽度统一） */
  flex-wrap: wrap !important;   /* 窄屏时自动换行（适配移动端） */
}

/* 🔥 核心1：文章内容区 - 统一宽度 + 自适应 */
.article-content {
  flex: 1 1 900px !important;   /* 自适应规则：
                                   1. 优先占剩余空间（flex-grow:1）
                                   2. 窄屏时允许收缩（flex-shrink:1）
                                   3. 最小宽度700px（保证阅读体验）
                                 */
  max-width: 900px !important;  /* 最大宽度固定（所有页面文章宽度统一） */
  width: 100% !important;
}

/* 🔥 核心2：侧边栏 - 自适应 + 不挤压文章区 */
.sidebar {
  flex: 0 1 300px !important;  /* 自适应规则：
                                   1. 不抢占文章区空间（flex-grow:0）
                                   2. 窄屏时允许收缩（flex-shrink:1）
                                   3. 基础宽度300px（宽屏时的默认宽度）
                                 */
  max-width: 350px !important;  /* 侧边栏最大宽度（防止过宽） */
  min-width: 260px !important;  /* 侧边栏最小宽度（防止过窄） */
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* 🔥 兼容原有tutorial-content类名（保证旧页面也生效） */
.tutorial-content {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 auto !important;
}

/* 响应式适配：窄屏（如平板/手机）自动调整 */
@media (max-width: 992px) {
  .main-content {
    gap: 15px !important;
  }
  .article-content {
    max-width: 100% !important; /* 窄屏时文章区铺满（放弃最大宽度限制） */
  }
  .sidebar {
    flex: 1 1 100% !important;  /* 窄屏时侧边栏铺满整行 */
    max-width: 100% !important;
  }
}
    /* 所有卡片容器统一使用浅灰色背景（亮色模式） */
    /* 软件详情卡片 */
    .software-card {
      flex: 1;
      background: var(--card-bg);   /* 亮色模式显示#f5f5f5浅灰，深色模式显示原有色 */
      border-radius: 4px;
      padding: 20px;
      box-shadow: var(--shadow);
      border: 1px solid var(--border-color);
      /* 新增：内容内边距优化，避免贴边 */
      padding: 25px 30px;
    }

    /* 用户信息卡片 */
    .user-card {
      background: var(--card-bg);
      border-radius: 4px;
      padding: 20px;
      box-shadow: var(--shadow);
      border: 1px solid var(--border-color);
      text-align: center;
      /* 新增：内容内边距优化 */
      padding: 25px 20px;
    }

    /* 登录框（视同卡片） */
    .login-box {
      background: var(--card-bg);
      border-radius: 4px;
      padding: 20px;
      box-shadow: var(--shadow);
      border: 1px solid var(--border-color);
      /* 新增：内容内边距优化 */
      padding: 25px 20px;
    }

    /* 统计/推荐/导航卡片（批量定义） */
    .stat-card, .random-card, .nav-card {
      background: var(--card-bg);
      border-radius: 4px;
      padding: 15px;
      box-shadow: var(--shadow);
      border: 1px solid var(--border-color);
      /* 新增：内容内边距优化 */
      padding: 20px 18px;
    }

    /* 弹窗内容卡片 */
    .modal-content {
      background: var(--card-bg);
      border-radius: 4px;
      padding: 20px;
      width: 90%;
      max-width: 400px;
      box-shadow: 0 2px 8px rgba(0,0,0,0.15);
      border: 1px solid var(--border-color);
      position: relative;
      /* 新增：内容内边距优化 */
      padding: 25px 25px;
    }


    /* 软件标题栏 */
    .software-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 25px;
      border-bottom: 1px solid var(--border-color);
      padding-bottom: 12px;
    }

    .software-title-wrap {
      display: flex;
      align-items: center;
      gap: 15px;
    }

    /* 软件图标容器样式 */
.software-icon {
  width: 60px;                  /* 图标固定宽度 */
  height: 60px;                 /* 图标固定高度 */
  object-fit: contain;          /* 图片等比缩放，完整显示在容器内（不拉伸、不裁剪） */
  border-radius: 8px;           /* 轻微圆角，避免直角生硬 */
  background: var(--bg-color);  /* 背景色使用全局变量，保证风格统一 */
  padding: 3px;                 /* 内边距，让图标和边框有间距 */
  border: 1px solid var(--border-color); /* 1px细边框，使用全局边框色变量 */
  display: flex;                /* 弹性布局，用于子元素居中 */
  justify-content: center;      /* 水平居中对齐 */
  align-items: center;          /* 垂直居中对齐 */
}

/* 软件信息标题样式 */
.software-info h1 {
  font-size: 18px;              /* 标题字号 */
  margin-bottom: 8px;           /* 标题下方留白，与下方内容分隔 */
  font-weight: 500;             /* 字体粗细（500为中等，比常规粗一点但不突兀） */
}

/* 软件元信息容器（如版本、更新时间等） */
.software-meta {
  display: flex;                /* 弹性布局，让子元素横向排列 */
  gap: 20px;                    /* 子元素之间的间距（替代margin，更简洁） */
  font-size: 12px;              /* 元信息字号（比正文小，次要信息） */
  color: #ff7800;               /* 浅灰色，弱化次要信息视觉权重 */
}

/* 通用徽章样式（基础样式，供不同类型徽章继承） */
.badge {
  padding: 3px 8px;             /* 上下3px、左右8px内边距，保证文字不贴边 */
  border-radius: 2px;           /* 极小圆角，保持徽章精致感 */
  font-size: 12px;              /* 徽章字号（小号，突出标签属性） */
  font-weight: 500;             /* 字体加粗，提升辨识度 */
}

/* SVIP专属徽章样式 */
.badge-svip {
  background: var(--warning-color); /* 背景色用全局警告色（通常为黄色/橙色，突出VIP属性） */
  color: #212529;               /* 深灰色文字，在亮色背景上更易读 */
}

/* 普通徽章样式 */
.badge-normal {
  background: var(--secondary-color); /* 背景色用全局次要色（通常为蓝色/灰色） */
  color: white;                 /* 白色文字，在深色背景上对比明显 */
}

 /* 下载按钮 */
.download-btn {
  background: #28a745 !important; /* 直接写死颜色+!important */
  color: white !important;       /* 保障文字白色不被覆盖 */
  border: none !important;
  padding: 10px 20px !important;
  border-radius: 2px !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  white-space: nowrap !important;
  box-shadow: none !important;   /* 强制去掉默认阴影 */
}
/* hover状态也加固 */
.download-btn:hover {
  background: #dc6a05 !important; /* hover也用同一个颜色（如果想深一点可以调#c55e04） */
  box-shadow: 0 1px 2px rgba(0,0,0,0.1) !important;
}

    /* 教程区域 */
    .tutorial-section {
      margin-top: 20px;
      width: 100%; /* 修改：恢复100%宽度，通过父容器padding控制边距 */
    }
    
    /* 核心修复：教程内容中的图片样式 */
    .tutorial-content {
      padding: 15px 10px;
      line-height: 1.8;
      font-size: 15px;
      /* 新增：内容左右内边距，避免贴边 */
      padding: 15px 10px;
      /* 核心：移除强制text-align，保留继承 */
    }
    
/* 关键：限制所有图片最大宽度，强制居中 + 相框样式（核心优化） */
.tutorial-content img {
  max-width: 100% !important;  /* 最大宽度不超过容器 */
  height: auto !important;     /* 高度自动适应，保持比例 */
  /* 相框式双层边框 + 内间距：模拟相框效果 */
  border: 1px solid var(--border-color) !important; /* 内层细边框 */
  outline: 3px solid #fff !important; /* 中层留白（相框内边） */
  outline-offset: 4px !important; /* 留白与外层边框的间距 */
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08) !important; /* 外层极细边框（替代outline） */
  border-radius: 12px !important; /* 匹配相框的圆角，更协调 */
  margin: 20px auto !important;   /* 增加上下间距，适配相框 */
  display: block !important;   /* 块级显示，防止行内错乱 */
  box-sizing: border-box !important; /* 边框计入宽度 */
  /* 放慢过渡速度：从0.3s改为0.6s，更平缓 */
  transition: all 0.6s ease !important; /* 动画速度减半，更柔和 */
}

/* 鼠标悬停特效：适配相框样式，动画更平缓 */
.tutorial-content img:hover {
  transform: scale(1.015) !important; /* 放大比例减小，避免相框超出容器 */
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.1) !important; /* 相框阴影增强 */
  outline-color: #f8f9fa !important; /* 悬停时内层留白轻微变色 */
  border-color: var(--primary-color, #409eff) !important; /* 内层边框变主题色 */
  cursor: pointer !important; /* 鼠标手型提示 */
}

    /* 教程内容中的视频也居中 */
    .tutorial-content video {
      max-width: 100% !important;
      height: auto !important;
      margin: 10px auto !important;
      display: block !important;
    }

    /* 核心修复：文本对齐规则 */
    .tutorial-content p {
      margin: 10px 0 !important;
      /* 移除强制左对齐，保留默认继承 */
      text-align: inherit;
    }
    
    /* 未手动设置对齐的文本默认靠左（优先级低于内联样式） */
    .tutorial-content p:not([style*="text-align"]) {
      text-align: left;
    }

    /* 手动设置居中的文本强制居中 */
    .tutorial-content p[style*="text-align:center"],
    .tutorial-content h3[style*="text-align:center"],
    .tutorial-content [style*="text-align:center"] {
      text-align: center !important;
    }

    .tutorial-title {
      font-size: 18px;
      font-weight: 500;
      margin-bottom: 10px;
      padding-bottom: 8px;
      border-bottom: 1px solid var(--border-color);
      /* 新增：标题左边距，和内容对齐 */
      padding-left: 10px;
      text-align: left; /* 标题靠左 */
    }

    /* 用户卡片子元素 */
    .user-avatar {
      width: 80px;
      height: 80px;
      border-radius: 50%;
      margin: 0 auto 15px;
      object-fit: cover;
      border: 1px solid var(--border-color);
      background: var(--bg-color);
      display: flex;
      justify-content: center;
      align-items: center;
    }
    .user-name {
      font-size: 16px;
      font-weight: 500;
      margin-bottom: 8px;
    }
    .user-signature {
      font-size: 12px;
      color: var(--secondary-color);
      margin-bottom: 10px;
    }
    .member-type {
      display: inline-block;
      padding: 3px 10px;
      border-radius: 15px;
      font-size: 12px;
      font-weight: 500;
      margin-bottom: 10px;
    }
    .member-type.svip {
      background: var(--warning-color);
      color: #212529;
    }
    .member-type.normal {
      background: var(--secondary-color);
      color: white;
    }
    .user-actions {
      display: flex;
      gap: 10px;
      margin-top: 15px;
    }
    .user-btn {
      flex: 1;
      padding: 8px 0;
      border-radius: 2px;
      text-align: center;
      font-size: 12px;
      font-weight: 500;
      text-decoration: none;
      transition: all 0.2s;
      border: none;
      cursor: pointer;
      box-shadow: none;
    }
    .user-btn.primary {
      background: var(--success-color);
      color: white;
    }
    .user-btn.secondary {
      background: var(--card-bg);
      color: var(--success-color);
      border: 1px solid var(--success-color);
    }
    .user-btn:hover {
      box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    }

    /* 登录框子元素 */
    .login-title {
      font-size: 18px;
      font-weight: 500;
      margin-bottom: 15px;
      text-align: center;
    }
    .form-control {
      width: 100%;
      padding: 8px 10px;
      margin-bottom: 15px;
      border: 1px solid var(--border-color);
      border-radius: 2px;
      background: var(--bg-color);
      color: var(--text-color);
      height: 38px;
      line-height: 1;
      font-size: 14px;
    }
    .captcha-container {
      display: flex;
      align-items: stretch;
      gap: 10px;
      margin-bottom: 15px;
    }
    .captcha-input {
      flex: 1;
      margin-bottom: 0 !important;
    }
    .captcha-img {
      width: 100px;
      height: 38px;
      cursor: pointer;
      border: 1px solid var(--border-color);
      border-radius: 2px;
      object-fit: cover;
    }
    .btn {
      width: 100%;
      padding: 10px;
      border-radius: 2px;
      border: none;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.2s;
      box-shadow: none;
      height: 38px;
      line-height: 1;
    }
    .btn:hover {
      box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    }
    .btn-success {
      background: var(--success-color);
      color: white;
    }
    .btn-primary {
      background: var(--primary-color);
      color: white;
    }
    .login-links {
      display: flex;
      justify-content: space-between;
      margin-top: 10px;
      font-size: 12px;
    }
    .login-links a {
      color: var(--primary-color);
      text-decoration: none;
    }
    .login-error {
      color: red;
      font-size: 12px;
      margin-bottom: 10px;
      text-align: center;
    }

    /* 统计卡片子元素 */
    .stat-item {
      display: flex;
      justify-content: space-between;
      padding: 8px 0;
      border-bottom: 1px solid var(--border-color);
    }
    .stat-item:last-child {
      border-bottom: none;
    }

    /* 推荐卡片子元素 */
    .random-app-item {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 8px 0;
      border-bottom: 1px solid var(--border-color);
    }
    .random-app-item:last-child {
      border-bottom: none;
    }
    .random-app-icon {
      width: 30px;
      height: 30px;
      object-fit: contain;
      display: flex;
      justify-content: center;
      align-items: center;
    }
    .random-app-name {
      font-size: 14px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      flex: 1;
      color: var(--text-color);
      text-decoration: none;
    }

    /* 导航卡片子元素 */
    .sidebar-nav-link {
      display: block;
      padding: 10px 0;
      color: var(--text-color);
      text-decoration: none;
      border-bottom: 1px solid var(--border-color);
      font-size: 14px;
      /* 新增：导航链接左边距，避免贴边 */
      padding-left: 8px;
    }
    .sidebar-nav-link:last-child {
      border-bottom: none;
    }
    .sidebar-nav-link:hover {
      color: var(--primary-color);
    }

    /* 弹窗样式 */
    .modal {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0,0,0,0.5);
      z-index: 1000;
      align-items: center;
      justify-content: center;
      overflow-y: auto;
    }
    .modal.show {
      display: flex;
    }
    .modal-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 15px;
      padding-bottom: 10px;
      border-bottom: 1px solid var(--border-color);
    }
    .modal-title {
      font-size: 18px;
      font-weight: 500;
    }
    .modal-close {
      background: none;
      border: none;
      font-size: 20px;
      cursor: pointer;
      color: var(--text-color);
      width: 30px;
      height: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 50%;
      transition: background 0.2s;
    }
    .modal-close:hover {
      background: var(--border-color);
    }
    .modal-footer {
      margin-top: 20px;
      display: flex;
      gap: 10px;
    }
    .modal-login-btn {
      display: block;
      width: 100%;
      padding: 10px;
      margin-top: 15px;
      background: var(--primary-color);
      color: white;
      text-align: center;
      border-radius: 2px;
      text-decoration: none;
      font-weight: 500;
      transition: background 0.2s;
      box-shadow: none;
      height: 38px;
      line-height: 1;
    }
    .modal-login-btn:hover {
      background: #0069d9;
      box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    }

    /* 移动端适配 */
    @media (max-width: 768px) {
      .main-content {
        flex-direction: column;
      }
      .sidebar {
        width: 100%;
      }
      .software-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
      }
      .download-btn {
        width: 100%;
      }
      .software-meta {
        flex-wrap: wrap;
        gap: 10px;
      }
      .captcha-container {
        flex-direction: row;
      }
      .captcha-img {
        width: 80px;
      }
      /* 移动端优化内容边距 */
      .software-card {
        padding: 20px 15px !important;
      }
      .tutorial-content {
        padding: 15px 5px !important;
      }
      .copyright-section {
        padding: 12px !important;
        font-size: 12px !important;
      }
    }

    /* 专题推荐卡片样式 */
    .topic-card {
      background: var(--card-bg);
      border-radius: 4px;
      padding: 20px 18px;
      box-shadow: var(--shadow);
      border: 1px solid var(--border-color);
      margin-bottom: 15px;
    }
    .card-title {
      color:#2ecc71;
      font-size:15px;
      font-weight:500;
      margin-bottom:10px;
      border-bottom:2px solid #2ecc71;
      padding-bottom:10px;
    }
    .topic-item {
      margin-bottom:15px;
      border-radius:4px;
      overflow:hidden;
    }
    .topic-item:last-child {
      margin-bottom:0;
    }
    .topic-item a {
      text-decoration:none;
    }

    .copyright-section p {
      margin: 5px 0 !important;
      text-align: left !important;
    }
    .copyright-section a {
      color: var(--primary-color);
      text-decoration: none;
    }
    .copyright-section a:hover {
      text-decoration: underline;
    }
    .copyright-title {
      font-weight: 500;
      color: var(--text-color);
      margin-bottom: 8px !important;
      font-size: 14px;
    }
/* 全局重置：防止宽度溢出 + 去掉横向滚动条 */
*, *::before, *::after {
  box-sizing: border-box; /* 内边距/边框不撑大宽度 */
}
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden; /* 核心：禁止水平拖动/滚动条 */
}