/*
Theme Name: 3的N次方下载
Theme URI: https://www.nnnxz.cn
Author: Momoko
Author URI: https://www.nnnxz.cn
Description: 电脑软件资源下载站主题 — 绿色安装包、官方最新版、安装教程、网盘下载、无复杂广告。主色蓝白配色，辅色橙色按钮，响应式布局。
Version: 2.0.0
Text Domain: san-download
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: software, download, blue, orange, responsive, two-column, custom-menu, featured-images, custom-logo
*/

/* ========== Reset ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: #f1f5f9;
  color: #1e293b;
  font-size: 14px;
  line-height: 1.6;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { display: block; max-width: 100%; }
input[type="search"] { -webkit-appearance: none; appearance: none; border-radius: 0; }
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }

/* ========== Variables ========== */
:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #dbeafe;
  --orange: #f97316;
  --orange-hover: #ea580c;
  --text-dark: #1e293b;
  --text-mid: #475569;
  --text-light: #94a3b8;
  --bg-page: #f1f5f9;
  --bg-card: #ffffff;
  --bg-nav: #ffffff;
  --border: #e2e8f0;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.12);
  --container: 1200px;
}

/* ========== Container ========== */
.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }

/* ========== Header / Nav ========== */
.header {
  background: var(--bg-nav);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.header-inner {
  max-width: var(--container); margin: 0 auto; padding: 0 20px;
  height: 64px; display: flex; align-items: center; gap: 40px;
}
.logo {
  display: flex; align-items: center; gap: 8px;
  font-size: 20px; font-weight: 700; color: var(--primary); white-space: nowrap;
}
.logo-icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700;
}

/* WP nav menu: output <ul><li> structure, style as inline flex */
.nav { display: flex; gap: 28px; flex: 1; }
.nav ul { display: flex; gap: 28px; list-style: none; flex: 1; }
.nav li { list-style: none; }
.nav a {
  font-size: 15px; color: var(--text-dark); font-weight: 500;
  padding: 6px 0; border-bottom: 2px solid transparent; transition: 0.2s;
}
.nav a:hover,
.nav a.active,
.nav li.current-menu-item > a,
.nav li.current_page_item > a,
.nav li.current-cat > a {
  color: var(--primary); border-bottom-color: var(--primary);
}

/* Nav search form */
.search-box {
  display: flex; align-items: center; background: #f1f5f9; border: 1px solid var(--border);
  border-radius: 6px; padding: 0 12px; width: 240px; transition: 0.2s;
}
.search-box:focus-within { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px var(--primary-light); }
.search-box input {
  border: none; background: none; outline: none; flex: 1; height: 36px;
  font-size: 13px; color: var(--text-dark);
}
.search-box button {
  background: none; border: none; cursor: pointer; color: var(--text-light);
  font-size: 16px; padding: 0 4px; display: flex; align-items: center;
}
.search-box button:hover { color: var(--primary); }

/* ========== Hero ========== */
.hero {
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #3b82f6 100%);
  padding: 48px 0; text-align: center; color: #fff;
}
.hero h1 { font-size: 32px; font-weight: 700; margin-bottom: 10px; letter-spacing: 1px; }
.hero p { font-size: 15px; opacity: 0.9; margin-bottom: 24px; }

/* Hero search form */
.hero-search {
  display: flex; max-width: 520px; margin: 0 auto; background: #fff;
  border-radius: 8px; overflow: hidden; box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.hero-search input {
  flex: 1; border: none; outline: none; height: 48px; padding: 0 16px;
  font-size: 14px; color: var(--text-dark);
}
.hero-search button {
  background: var(--orange); color: #fff; border: none; padding: 0 28px;
  font-size: 15px; font-weight: 600; cursor: pointer; transition: 0.2s;
}
.hero-search button:hover { background: var(--orange-hover); }

.hero-tags { margin-top: 16px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-tags a {
  font-size: 12px; color: rgba(255,255,255,0.8); background: rgba(255,255,255,0.15);
  padding: 4px 12px; border-radius: 20px; transition: 0.2s;
}
.hero-tags a:hover { background: rgba(255,255,255,0.25); color: #fff; }

/* ========== Section ========== */
.section { padding: 36px 0; }
.section-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px;
}
.section-title {
  font-size: 20px; font-weight: 700; color: var(--text-dark);
  display: flex; align-items: center; gap: 8px;
}
.section-title::before {
  content: ''; width: 4px; height: 20px; background: var(--primary); border-radius: 2px;
}
.section-more { font-size: 13px; color: var(--text-mid); }
.section-more:hover { color: var(--primary); }

/* ========== Hot Download Cards ========== */
.card-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.sw-card {
  background: var(--bg-card); border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); transition: 0.2s; cursor: pointer; border: 1px solid transparent;
}
.sw-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); border-color: var(--primary-light); }
.sw-card-icon {
  width: 56px; height: 56px; border-radius: 12px; margin-bottom: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; color: #fff;
}
.sw-card h3 { font-size: 15px; font-weight: 600; color: var(--text-dark); margin-bottom: 4px; }
.sw-card h3 a { color: inherit; text-decoration: none; }
.sw-card:hover h3 a { color: var(--primary); }
.sw-card .ver { font-size: 12px; color: var(--text-light); margin-bottom: 8px; }
.sw-card .desc { font-size: 12px; color: var(--text-mid); line-height: 1.5; margin-bottom: 12px;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sw-card .card-footer {
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--border); padding-top: 10px;
}
.sw-card .cat-tag {
  font-size: 11px; color: var(--primary); background: var(--primary-light);
  padding: 2px 8px; border-radius: 4px;
}
.sw-card .dl-btn {
  font-size: 12px; color: var(--orange); font-weight: 600; display: flex; align-items: center; gap: 3px;
  text-decoration: none;
}
.sw-card .dl-btn::before { content: '\2193'; font-size: 14px; }

/* Category colors */
.cat-design { background: linear-gradient(135deg, #667eea, #764ba2); }
.cat-office { background: linear-gradient(135deg, #f093fb, #f5576c); }
.cat-video { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.cat-system { background: linear-gradient(135deg, #43e97b, #38f9d7); }

/* ========== Category Sections ========== */
.cat-sections { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.cat-block {
  background: var(--bg-card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: 0.2s;
}
.cat-block:hover { box-shadow: var(--shadow-hover); }
.cat-block-header {
  padding: 16px 20px; color: #fff; display: flex; align-items: center; gap: 10px;
}
.cat-block-header h3 { font-size: 16px; font-weight: 600; }
.cat-block-header .more { margin-left: auto; font-size: 12px; opacity: 0.9; text-decoration: none; color: #fff; }
.cat-block-header .more:hover { opacity: 1; text-decoration: underline; }
.cat-block-body { padding: 12px 20px 20px; }
.cat-block-body li {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px dashed var(--border);
}
.cat-block-body li:last-child { border-bottom: none; }
.cat-block-body li .name {
  font-size: 13px; color: var(--text-dark); display: flex; align-items: center; gap: 8px;
  text-decoration: none;
}
.cat-block-body li .name::before { content: '\2022'; color: var(--text-light); }
.cat-block-body li .name:hover { color: var(--primary); }
.cat-block-body li .date { font-size: 12px; color: var(--text-light); }
.cat-block-body li .badge {
  font-size: 10px; padding: 1px 6px; border-radius: 3px; margin-left: 6px;
  background: #fef3c7; color: #92400e;
}
.cat-block-body li .badge.new { background: #dbeafe; color: #1e40af; }

/* Category header backgrounds */
.cat-header-design { background: linear-gradient(135deg, #667eea, #764ba2); }
.cat-header-office { background: linear-gradient(135deg, #f093fb, #f5576c); }
.cat-header-video { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.cat-header-system { background: linear-gradient(135deg, #43e97b, #38f9d7); }

/* ========== Latest Updates ========== */
.update-list { background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.update-item {
  display: flex; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--border);
  transition: 0.15s;
}
.update-item:last-child { border-bottom: none; }
.update-item:hover { background: #f8fafc; }
.update-item .num {
  width: 24px; height: 24px; border-radius: 4px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--text-light); background: #f1f5f9; margin-right: 12px;
}
.update-item:nth-child(1) .num { background: var(--orange); color: #fff; }
.update-item:nth-child(2) .num { background: #fb923c; color: #fff; }
.update-item:nth-child(3) .num { background: #fbbf24; color: #fff; }
.update-item .info { flex: 1; display: flex; align-items: center; gap: 10px; }
.update-item .info .title { font-size: 14px; color: var(--text-dark); font-weight: 500; text-decoration: none; }
.update-item .info .title:hover { color: var(--primary); }
.update-item .info .ver { font-size: 12px; color: var(--text-light); }
.update-item .info .tag {
  font-size: 11px; padding: 1px 7px; border-radius: 3px;
  background: var(--primary-light); color: var(--primary);
}
.update-item .date { font-size: 12px; color: var(--text-light); flex-shrink: 0; }

/* ========== Empty State ========== */
.empty-msg { text-align: center; padding: 40px; color: var(--text-light); font-size: 14px; }

/* ========== Footer ========== */
.footer {
  background: #1e293b; color: #94a3b8; padding: 40px 0 20px; margin-top: 40px;
}
.footer-inner {
  max-width: var(--container); margin: 0 auto; padding: 0 20px;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px;
}
.footer-col h4 { color: #fff; font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.footer-col p { font-size: 13px; line-height: 1.8; margin-bottom: 8px; }
.footer-col a { font-size: 13px; color: #94a3b8; transition: 0.2s; display: block; margin-bottom: 6px; text-decoration: none; }
.footer-col a:hover { color: #fff; }

/* WP footer menu output */
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 6px; }
.footer-col ul li a { display: block; font-size: 13px; color: #94a3b8; }
.footer-col ul li a:hover { color: #fff; }

.footer-bottom {
  max-width: var(--container); margin: 30px auto 0; padding: 16px 20px 0;
  border-top: 1px solid #334155; text-align: center; font-size: 12px; color: #64748b;
}
.footer-links { display: flex; gap: 20px; justify-content: center; margin-bottom: 10px; }
.footer-links a { font-size: 12px; color: #64748b; text-decoration: none; }
.footer-links a:hover { color: #fff; }

/* CM Download Manager button override */
.cmdownload-btn,
.cmdownload {
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
  background: var(--orange) !important;
  color: #fff !important;
  padding: 4px 12px !important;
  border-radius: 4px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  border: none !important;
  transition: background 0.2s;
}
.cmdownload-btn:hover,
.cmdownload:hover {
  background: var(--orange-hover) !important;
  color: #fff !important;
}

/* ========== Responsive ========== */
@media (max-width: 1024px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .cat-sections { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .header-inner { flex-wrap: wrap; gap: 12px; height: auto; padding: 12px 20px; }
  .nav { order: 3; width: 100%; overflow-x: auto; gap: 20px; }
  .nav ul { gap: 20px; }
  .search-box { width: 100%; order: 2; }
  .hero h1 { font-size: 24px; }
  .card-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
}
