/* ====== CSS重置与全局样式 ====== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #2185d0;
  --primary-light: #4da3e2;
  --primary-dark: #0f6bb3;
  --secondary-color: #f5f5f5;
  --text-dark: #333;
  --text-light: #666;
  --text-white: #fff;
  --border-color: #ddd;
  --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --card-hover-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  --sidebar-width: 240px;
  --header-height: 60px;
  --footer-height: 50px;
  --border-radius: 8px;
  --transition-speed: 0.3s;
  --sql-color: #004880;
  --sql-light: #0066b3;
  --windows-color: #0078d4;
  --windows-light: #4a90e2;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft Yahei", sans-serif;
  background-color: #f9f9f9;
  color: var(--text-dark);
  line-height: 1.5;
  overflow-x: hidden;
}

/* ====== 头部样式 ====== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--primary-color);
  color: var(--text-white);
  padding: 0 24px;
  height: var(--header-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header .logo {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.header .logo::before {
  content: "🚀";
  font-size: 24px;
}

/* ====== Header按钮容器 ====== */
.header-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ====== 下载按钮样式 ====== */
.header .download-btn {
  background-color: rgba(255, 255, 255, 0.15);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--border-radius);
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-speed) ease;
  text-decoration: none;
}

.header .download-btn:hover {
  background-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
  text-decoration: none;
  color: white;
}

.header .download-btn:active {
  transform: translateY(0);
}

/* ====== 收藏按钮样式 ====== */
.header .favorite-btn {
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-speed) ease;
}

.header .favorite-btn:hover {
  background-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.header .favorite-btn:active {
  transform: translateY(0);
}

.header .version-tag {
  background-color: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

/* ====== 主容器布局 ====== */
.container {
  display: flex;
  min-height: calc(100vh - var(--header-height) - var(--footer-height));
}

/* ====== 侧边栏样式 ====== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--secondary-color);
  padding: 20px 0;
  border-right: 1px solid var(--border-color);
  height: calc(100vh - var(--header-height) - var(--footer-height));
  overflow-y: auto;
  position: sticky;
  top: var(--header-height);
  transition: width var(--transition-speed);
}

.sidebar-header {
  padding: 0 20px 15px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.sidebar .category {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 5px;
}

.sidebar .category-subtitle {
  font-size: 13px;
  color: var(--text-light);
}

.filter-group {
  margin-bottom: 24px;
  padding: 0 20px;
}

.filter-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.filter-count {
  background-color: var(--primary-light);
  color: white;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: var(--border-radius);
  transition: all var(--transition-speed) ease;
}

.filter-option:hover {
  background-color: rgba(33, 133, 208, 0.08);
}

.filter-option input[type="radio"] {
  display: none;
}

.radio-label {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #ccc;
  display: inline-block;
  position: relative;
  transition: all var(--transition-speed) ease;
}

.filter-option input:checked + .radio-label {
  border-color: var(--primary-color);
  background-color: var(--primary-color);
}

.filter-option input:checked + .radio-label::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: white;
}

.filter-option input:checked ~ .option-text {
  color: var(--primary-color);
  font-weight: 500;
}

.option-text {
  font-size: 14px;
  color: var(--text-light);
  transition: color var(--transition-speed) ease;
}

/* ====== 主内容区样式 ====== */
.main {
  flex: 1;
  padding: 24px;
  background: #fff;
}

.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 15px;
}

.main-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-dark);
}

.main-subtitle {
  font-size: 14px;
  color: var(--text-light);
  margin-top: 4px;
}

.search-box {
  display: flex;
  align-items: center;
  background-color: #f5f7fa;
  border-radius: var(--border-radius);
  padding: 10px 15px;
  width: 300px;
  border: 1px solid var(--border-color);
  transition: all var(--transition-speed) ease;
}

.search-box:focus-within {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(33, 133, 208, 0.1);
}

.search-box input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  margin-left: 8px;
}

.search-icon {
  color: var(--text-light);
  font-size: 18px;
}

/* ====== 内容筛选器样式 ====== */
.content-filter {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 8px 16px;
  background: #f5f5f5;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 14px;
  transition: all var(--transition-speed) ease;
}

.filter-tab:hover {
  background: #e8e8e8;
}

.filter-tab.active {
  background: var(--primary-color);
  color: white;
}

/* ====== 操作系统卡片网格 ====== */
.os-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 24px;
}

.os-card {
  background: white;
  border-radius: var(--border-radius);
  padding: 20px 15px;
  box-shadow: var(--card-shadow);
  transition: all var(--transition-speed) ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border: 1px solid transparent;
  position: relative;
}

.os-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--card-hover-shadow);
}

.windows-card:hover {
  border-color: var(--windows-light);
}

.server-card:hover {
  border-color: var(--sql-light);
}

.os-icon {
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 15px;
  border-radius: 12px;
}

.windows-icon {
  background-color: rgba(0, 120, 212, 0.08);
}

.linux-icon {
  background-color: rgba(233, 84, 32, 0.08);
}

.macos-icon {
  background-color: rgba(0, 0, 0, 0.08);
}

.bsd-icon {
  background-color: rgba(204, 0, 0, 0.08);
}

.server-icon {
  background-color: rgba(0, 104, 179, 0.08);
}

.os-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-dark);
}

.os-type {
  font-size: 12px;
  color: var(--text-light);
  padding: 3px 10px;
  background-color: #f5f5f5;
  border-radius: 12px;
  margin-bottom: 12px;
}

.os-version {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 15px;
}

.os-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
  margin-bottom: 15px;
}

.os-tag {
  font-size: 11px;
  padding: 2px 8px;
  background-color: #eef5fc;
  border-radius: 10px;
  color: var(--primary-color);
}

.os-status {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.status-supported {
  background-color: #d4edda;
  color: #155724;
}

.status-unsupported {
  background-color: #f8d7da;
  color: #721c24;
}

.status-extended {
  background-color: #fff3cd;
  color: #856404;
}

/* ====== 详细信息链接样式 ====== */
.detail-link-container {
  width: 100%;
  margin-top: auto;
}

.detail-link {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  text-align: center;
  text-decoration: none;
  background-color: transparent;
  color: var(--primary-color);
  border: 1px solid var(--border-color);
}

.detail-link:hover {
  background-color: rgba(33, 133, 208, 0.08);
  border-color: var(--primary-light);
  text-decoration: none;
  color: var(--primary-dark);
}

/* ====== 内容区块标题 ====== */
.section-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-dark);
  margin: 30px 0 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  gap: 10px;
}

.windows-title::before {
  content: "🪟";
  font-size: 24px;
}

.server-title::before {
  content: "🗃️";
  font-size: 24px;
}

.linux-title::before {
  content: "🐧";
  font-size: 24px;
}

.macos-title::before {
  content: "🍎";
  font-size: 24px;
}

/* ====== 弹窗样式 ====== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  overflow: auto;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.show {
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
}

.modal-content {
  background-color: #fff;
  margin: 5% auto;
  width: 90%;
  max-width: 700px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-dark);
  margin: 0;
}

.close-modal {
  font-size: 28px;
  font-weight: bold;
  color: #999;
  cursor: pointer;
  line-height: 1;
  transition: color 0.3s ease;
}

.close-modal:hover {
  color: var(--primary-color);
}

.modal-body {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
}

.modal-body h4 {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary-color);
  margin: 20px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}

.modal-body h4:first-child {
  margin-top: 0;
}

.modal-body p {
  margin-bottom: 15px;
  line-height: 1.6;
  color: var(--text-dark);
}

.modal-body a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.modal-body a:hover {
  text-decoration: underline;
  color: var(--primary-dark);
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  text-align: right;
}

.modal-close-btn {
  padding: 10px 24px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.modal-close-btn:hover {
  background-color: var(--primary-dark);
}

/* ====== 底部样式 ====== */
.footer {
  background: #f5f5f5;
  padding: 15px 24px;
  font-size: 13px;
  color: var(--text-light);
  border-top: 1px solid var(--border-color);
  height: var(--footer-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-link {
  color: var(--text-light);
  text-decoration: none;
  transition: color var(--transition-speed) ease;
}

.footer-link:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

/* ====== 响应式设计 ====== */
@media (max-width: 992px) {
  .sidebar {
    width: 70px;
    padding: 20px 0;
  }
  
  .sidebar .category, 
  .sidebar .category-subtitle,
  .filter-title span:first-child,
  .option-text {
    display: none;
  }
  
  .filter-group {
    padding: 0 15px;
  }
  
  .filter-title {
    justify-content: center;
  }
  
  .filter-option {
    justify-content: center;
    padding: 10px 0;
  }
  
  .main {
    padding: 20px;
  }
}

@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    overflow-y: visible;
    padding: 15px;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  
  .sidebar-header {
    padding: 0 0 15px;
  }
  
  .filter-group {
    padding: 0;
  }
  
  .filter-options {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .filter-option {
    padding: 8px 12px;
  }
  
  .option-text {
    display: block;
  }
  
  .os-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
  }
  
  .search-box {
    width: 100%;
  }
  
  .main-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .footer {
    flex-direction: column;
    gap: 10px;
    height: auto;
    padding: 15px;
    text-align: center;
  }
  
  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  /* 弹窗响应式调整 */
  .modal-content {
    width: 95%;
    margin: 10% auto;
  }
  
  .modal-header {
    padding: 16px 20px;
  }
  
  .modal-body {
    padding: 20px;
  }
  
  .modal-footer {
    padding: 12px 20px;
  }
  
  /* 调整header按钮在平板上的显示 */
  .header-buttons {
    gap: 8px;
  }
  
  .header .download-btn,
  .header .favorite-btn {
    padding: 6px 12px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .os-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
  
  .header {
    padding: 0 15px;
  }
  
  .header .logo {
    font-size: 16px;
  }
  
  .header .version-tag {
    display: none;
  }
  
  .os-card {
    padding: 15px 10px;
  }
  
  .detail-link {
    padding: 8px 10px;
    font-size: 12px;
  }
  
  /* 在非常小的屏幕上调整按钮文字 */
  .header .download-btn span,
  .header .favorite-btn span {
    display: none; /* 隐藏文字，只显示图标 */
  }
  
  .header .download-btn,
  .header .favorite-btn {
    padding: 8px 10px;
    min-width: 40px;
    justify-content: center;
  }
  
  .header .download-btn::before {
    content: "🔧";
  }
  
  .header .favorite-btn::before {
    content: "⭐";
  }
}

/* ====== 工具类 ====== */
.color-windows { color: var(--windows-color); }
.color-linux { color: #e95420; }
.color-macos { color: #000; }
.color-chromium { color: #4285f4; }
.color-bsd { color: #cc0000; }
.color-ubuntu { color: #e95420; }
.color-centos { color: #27251f; }
.color-deepin { color: #4d4d4d; }
.color-fedora { color: #0066cc; }
.color-fydeos { color: #e61f26; }
.color-uos { color: #0078d7; }
.color-sql { color: var(--sql-color); }
.color-sql-light { color: var(--sql-light); }

.highlight { animation: highlight 2s ease; }

@keyframes highlight {
  0% { background-color: rgba(33, 133, 208, 0.3); }
  100% { background-color: transparent; }
}

.active-filter {
  background-color: rgba(33, 133, 208, 0.1);
  border-left: 3px solid var(--primary-color);
}

.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #999;
  font-size: 16px;
}

/* ====== 仅供搜索引擎爬虫识别的导航链接 ====== */
.seo-hidden-links {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}