/* ==========================================================================
   坤泰电脑学习网站  —  站点主样式
   暗色科技风 · 响应式 · 零依赖
   ========================================================================== */

:root {
  --bg:            #0b0e14;
  --bg-soft:       #11151f;
  --card:          #151a25;
  --card-hover:    #1b2130;
  --border:        #232a36;
  --border-soft:   #1b212c;

  --text:          #e6eaf2;
  --text-dim:      #99a3b5;
  --text-faint:    #67707f;

  --accent:        #22d3ee;
  --accent-2:      #a78bfa;
  --ok:            #34d399;
  --warn:          #fbbf24;
  --danger:        #f87171;

  --radius:        12px;
  --radius-sm:     8px;
  --maxw:          1140px;

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- 顶栏 ---------- */

.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 14, 20, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
}

.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 20px;
  height: 60px; display: flex; align-items: center; gap: 24px;
}

.logo {
  font-weight: 600; font-size: 15px; color: var(--text); letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.logo:hover { text-decoration: none; }
.logo-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.nav-links { display: flex; gap: 4px; margin-left: auto; align-items: center; }

.nav-links a {
  color: var(--text-dim); font-size: 14px; padding: 6px 12px;
  border-radius: var(--radius-sm); white-space: nowrap;
}
.nav-links a:hover { color: var(--text); background: var(--card); text-decoration: none; }
.nav-links a.on { color: var(--accent); background: rgba(34, 211, 238, 0.09); }

.nav-toggle {
  display: none; margin-left: auto; background: none; border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius-sm); padding: 5px 10px;
  font-size: 16px; cursor: pointer;
}

/* ---------- 通用块 ---------- */

section { padding: 56px 0; }
section.tight { padding: 32px 0; }

.sec-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 22px; }
.sec-head h2 {
  font-size: 20px; font-weight: 600; margin: 0; letter-spacing: -0.01em;
}
.sec-head .more { margin-left: auto; font-size: 13px; color: var(--text-dim); }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---------- 首页 Hero ---------- */

.hero { padding: 76px 0 44px; text-align: center; }

.hero h1 {
  font-size: 38px; line-height: 1.25; font-weight: 600;
  margin: 0 0 16px; letter-spacing: -0.02em;
}
.hero h1 .grad {
  background: linear-gradient(96deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p {
  color: var(--text-dim); font-size: 16px; max-width: 620px;
  margin: 0 auto 28px;
}

.hero-tags {
  display: flex; gap: 8px; justify-content: center;
  flex-wrap: wrap; margin-top: 22px;
}

/* ---------- 搜索 ---------- */

.search {
  max-width: 520px; margin: 0 auto; position: relative;
}
.search input {
  width: 100%; padding: 13px 16px 13px 42px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font-size: 15px;
  font-family: inherit; outline: none;
  transition: border-color .15s;
}
.search input:focus { border-color: var(--accent); }
.search input::placeholder { color: var(--text-faint); }
.search::before {
  content: ""; position: absolute; left: 15px; top: 50%;
  width: 15px; height: 15px; margin-top: -8px;
  border: 1.6px solid var(--text-faint); border-radius: 50%;
}
.search::after {
  content: ""; position: absolute; left: 27px; top: 50%;
  width: 5px; height: 1.6px; margin-top: 5px;
  background: var(--text-faint); transform: rotate(45deg);
}

/* ---------- 卡片 ---------- */

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  transition: background .15s, border-color .15s, transform .15s;
}
.card:hover {
  background: var(--card-hover); border-color: #2e3746;
  transform: translateY(-2px);
}
.card h3 { margin: 0 0 8px; font-size: 16px; font-weight: 600; }
.card p { margin: 0; color: var(--text-dim); font-size: 13.5px; line-height: 1.65; }
.card-link { display: block; color: inherit; }
.card-link:hover { text-decoration: none; }

/* 栏目入口 */
.entry { display: block; }
.entry .ico {
  width: 38px; height: 38px; border-radius: 10px; margin-bottom: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 600;
}
.ico-c1 { background: rgba(34,211,238,.12);  color: var(--accent); }
.ico-c2 { background: rgba(167,139,250,.12); color: var(--accent-2); }
.ico-c3 { background: rgba(52,211,153,.12);  color: var(--ok); }
.ico-c4 { background: rgba(251,191,36,.12);  color: var(--warn); }

/* ---------- 软件卡片 ---------- */

.app {
  display: flex; flex-direction: column; padding: 18px;
}
.app-top { display: flex; gap: 13px; align-items: flex-start; margin-bottom: 12px; }

.app-ico {
  width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 600; font-family: var(--mono);
  background: var(--bg-soft); border: 1px solid var(--border);
  color: var(--accent);
}

.app-name { font-size: 15.5px; font-weight: 600; margin: 0 0 3px; line-height: 1.35; }
.app-meta { font-size: 12px; color: var(--text-faint); font-family: var(--mono); }

.app-desc {
  color: var(--text-dim); font-size: 13.5px; line-height: 1.65;
  margin: 0 0 14px; flex-grow: 1;
}

.app-foot {
  display: flex; align-items: center; gap: 8px;
  padding-top: 13px; border-top: 1px solid var(--border-soft);
}

/* ---------- 标签 / 徽章 ---------- */

.tag {
  display: inline-block; padding: 2px 9px; border-radius: 99px;
  font-size: 11.5px; line-height: 1.7; white-space: nowrap;
  background: var(--bg-soft); border: 1px solid var(--border);
  color: var(--text-dim);
}
.tag-oc { color: var(--accent);   border-color: rgba(34,211,238,.3); }
.tag-ai { color: var(--accent-2); border-color: rgba(167,139,250,.3); }
.tag-ut { color: var(--ok);       border-color: rgba(52,211,153,.3); }
.tag-new{ color: var(--warn);     border-color: rgba(251,191,36,.3); }
.tag-hot{ color: var(--danger);   border-color: rgba(248,113,113,.3); }

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 15px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg-soft);
  color: var(--text); font-family: inherit;
  transition: all .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

.btn-primary {
  background: var(--accent); border-color: var(--accent); color: #04161a;
}
.btn-primary:hover { background: #4de1f5; border-color: #4de1f5; color: #04161a; }

.btn-sm { padding: 5px 11px; font-size: 12.5px; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- 筛选条 ---------- */

.filters {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 24px; align-items: center;
}
.chip {
  padding: 6px 14px; border-radius: 99px; font-size: 13px;
  background: var(--card); border: 1px solid var(--border);
  color: var(--text-dim); cursor: pointer; font-family: inherit;
  transition: all .15s;
}
.chip:hover { color: var(--text); border-color: #2e3746; }
.chip.on {
  background: rgba(34,211,238,.1); border-color: var(--accent); color: var(--accent);
}
.count { margin-left: auto; font-size: 13px; color: var(--text-faint); }

/* ---------- 列表页 ---------- */

.page-head { padding: 48px 0 8px; }
.page-head h1 { font-size: 30px; font-weight: 600; margin: 0 0 10px; letter-spacing: -0.02em; }
.page-head p { color: var(--text-dim); margin: 0; max-width: 640px; }

/* 文章列表 */
.post {
  display: flex; gap: 18px; padding: 20px 0;
  border-bottom: 1px solid var(--border-soft); align-items: flex-start;
}
.post:last-child { border-bottom: 0; }
.post-date {
  flex-shrink: 0; width: 76px; font-size: 12.5px;
  color: var(--text-faint); font-family: var(--mono); padding-top: 4px;
}
.post-body h3 { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
.post-body h3 a { color: var(--text); }
.post-body h3 a:hover { color: var(--accent); text-decoration: none; }
.post-body p { margin: 0 0 9px; color: var(--text-dim); font-size: 14px; }
.post-body .tag { margin-right: 6px; }

/* 作品卡片 */
.work { padding: 0; overflow: hidden; }
.work-cover {
  aspect-ratio: 16 / 9; background: var(--bg-soft);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-faint); font-size: 13px; border-bottom: 1px solid var(--border);
  position: relative; overflow: hidden;
}
.work-cover img { width: 100%; height: 100%; object-fit: cover; }
.work-body { padding: 16px 18px 18px; }
.work-body h3 { margin: 0 0 6px; font-size: 15.5px; }

/* 资源导航 */
.link-item {
  display: flex; align-items: center; gap: 14px; padding: 15px 18px;
}
.link-item .app-ico { width: 38px; height: 38px; font-size: 14px; }
.link-item .grow { flex-grow: 1; min-width: 0; }
.link-item h4 { margin: 0 0 2px; font-size: 14.5px; font-weight: 600; }
.link-item p { margin: 0; font-size: 13px; color: var(--text-dim); }

/* ---------- 空状态 ---------- */

.empty {
  text-align: center; padding: 64px 20px;
  color: var(--text-faint); font-size: 14px;
}

/* ---------- 页脚 ---------- */

footer {
  border-top: 1px solid var(--border-soft);
  margin-top: 40px; padding: 34px 0;
  color: var(--text-faint); font-size: 13px;
}
.foot-inner {
  display: flex; gap: 20px; flex-wrap: wrap; align-items: center;
}
.foot-links { margin-left: auto; display: flex; gap: 18px; }

/* ---------- 正文（文章页 / 关于页） ---------- */

.prose { max-width: 720px; font-size: 15.5px; line-height: 1.85; }
.prose h2 { font-size: 21px; font-weight: 600; margin: 38px 0 14px; }
.prose h3 { font-size: 17px; font-weight: 600; margin: 28px 0 10px; }
.prose p  { color: #c3cad8; }
.prose ul, .prose ol { color: #c3cad8; padding-left: 22px; }
.prose li { margin: 5px 0; }
.prose code {
  font-family: var(--mono); font-size: 13px;
  background: var(--bg-soft); border: 1px solid var(--border);
  padding: 1px 6px; border-radius: 5px; color: var(--accent);
}
.prose pre {
  background: var(--bg-soft); border: 1px solid var(--border);
  padding: 16px; border-radius: var(--radius); overflow-x: auto;
}
.prose pre code { background: none; border: 0; padding: 0; color: #c3cad8; }
.prose blockquote {
  border-left: 2px solid var(--accent); margin: 20px 0; padding: 4px 0 4px 18px;
  color: var(--text-dim);
}
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 34px 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 20px 0; }
.prose th, .prose td {
  border: 1px solid var(--border); padding: 9px 12px; text-align: left;
}
.prose th { background: var(--bg-soft); font-weight: 600; }

/* ---------- 提示条 ---------- */

.notice {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius-sm); padding: 14px 18px;
  font-size: 13.5px; color: var(--text-dim); margin: 20px 0;
}
.notice strong { color: var(--text); }

/* ---------- 响应式 ---------- */

@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  body { font-size: 14.5px; }
  .hero { padding: 48px 0 30px; }
  .hero h1 { font-size: 27px; }
  .page-head h1 { font-size: 24px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  section { padding: 40px 0; }

  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; top: 60px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--bg-soft); border-bottom: 1px solid var(--border);
    padding: 10px 14px 16px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 12px; }

  .post { flex-direction: column; gap: 6px; }
  .post-date { width: auto; padding-top: 0; }
  .count { margin-left: 0; width: 100%; }
}
