/* ========== 五面 · 技术内参 共享样式 ========== */

:root {
  --bg: #0a0a12;
  --surface: rgba(18, 18, 34, 0.82);
  --surface-hover: rgba(26, 26, 48, 0.9);
  --border: rgba(155, 123, 213, 0.12);
  --border-hover: rgba(155, 123, 213, 0.3);
  --primary: #9b7bd5;
  --primary-light: #c4a8f0;
  --primary-glow: rgba(155, 123, 213, 0.15);
  --text: #e0e0e0;
  --text-muted: #666;
  --radius: 12px;
  --radius-sm: 8px;
  --font: -apple-system, 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-light); }

/* ---- Animated Background ---- */
.bg-effects {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.bg-glow-1 {
  position: absolute;
  top: -300px;
  right: -200px;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(155,123,213,0.06) 0%, transparent 70%);
  animation: float-glow 12s ease-in-out infinite;
}
.bg-glow-2 {
  position: absolute;
  bottom: -200px;
  left: -150px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(100,80,180,0.04) 0%, transparent 70%);
  animation: float-glow 15s ease-in-out infinite reverse;
}
@keyframes float-glow {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* ---- Grid pattern overlay ---- */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(155,123,213,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(155,123,213,0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* ---- Container ---- */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  position: relative;
  z-index: 1;
}

/* ---- Header ---- */
.header {
  text-align: center;
  padding: 60px 0 36px;
  position: relative;
}
.header h1 {
  font-size: 2.2em;
  font-weight: 700;
  letter-spacing: 3px;
  background: linear-gradient(135deg, #c4a8f0 0%, #9b7bd5 50%, #7b5fb5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}
.header .subtitle {
  color: var(--text-muted);
  font-size: 0.85em;
  letter-spacing: 4px;
}
.header .divider {
  border: none;
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  margin: 20px auto;
  border-radius: 2px;
}

/* ---- Search + Filter bar ---- */
.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 28px;
}
.search-box {
  position: relative;
  width: 100%;
}
.search-box input {
  width: 100%;
  padding: 10px 16px 10px 42px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9em;
  font-family: var(--font);
  outline: none;
  transition: all var(--transition);
  backdrop-filter: blur(10px);
}
.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 20px var(--primary-glow);
}
.search-box input::placeholder { color: #555; }
.search-box .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #555;
  font-size: 1em;
  pointer-events: none;
}

.cat-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.cat-btn {
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 0.82em;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-family: var(--font);
  transition: all var(--transition);
  backdrop-filter: blur(8px);
}
.cat-btn:hover {
  border-color: var(--primary);
  color: var(--primary-light);
  box-shadow: 0 0 16px var(--primary-glow);
}
.cat-btn.active {
  background: rgba(155,123,213,0.15);
  border-color: var(--primary);
  color: var(--primary-light);
  box-shadow: 0 0 20px var(--primary-glow);
}
.cat-btn.all-btn { border-color: rgba(255,255,255,0.1); }
.cat-btn.all-btn.active {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.3);
  color: var(--text);
  box-shadow: 0 0 20px rgba(255,255,255,0.05);
}

/* ---- Stats bar ---- */
.stats-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 4px 16px;
  color: var(--text-muted);
  font-size: 0.8em;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  margin-bottom: 4px;
}

/* ---- Posts list ---- */
.posts { display: flex; flex-direction: column; gap: 8px; }

.post {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  transition: all var(--transition);
  position: relative;
  backdrop-filter: blur(10px);
}
.post:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 40px rgba(155,123,213,0.06), 0 0 0 1px rgba(155,123,213,0.08);
}
.post.hidden { display: none; }
.post.search-hidden { display: none; }

.post-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

/* ---- Category icon circle ---- */
.post-cat {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15em;
  margin-top: 2px;
  position: relative;
  overflow: hidden;
}
.post-cat::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.15;
  border-radius: 10px;
}
.post-cat.反诈::before { background: linear-gradient(135deg, #ff4444, #cc2222); }
.post-cat.渗透::before { background: linear-gradient(135deg, #ff6a00, #ee5a24); }
.post-cat.APK::before { background: linear-gradient(135deg, #ffd700, #f0a500); }
.post-cat.技能::before { background: linear-gradient(135deg, #00c8ff, #0099cc); }
.post-cat.溯源::before { background: linear-gradient(135deg, #00ffaa, #00cc88); }
.post-cat.基建::before { background: linear-gradient(135deg, #ffa500, #e09000); }
.post-cat.杂谈::before { background: linear-gradient(135deg, #c4a8f0, #9b7bd5); }

/* ---- Post body ---- */
.post-body { flex: 1; min-width: 0; }
.post-title {
  font-size: 1.05em;
  margin-bottom: 4px;
  font-weight: 500;
}
.post-title a {
  color: var(--text);
  transition: color var(--transition);
}
.post-title a:hover { color: var(--primary-light); }

.post-meta {
  font-size: 0.78em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.post-meta .tag {
  display: inline-block;
  padding: 1px 10px;
  border-radius: 10px;
  font-size: 0.85em;
  background: rgba(155,123,213,0.08);
  cursor: pointer;
  transition: all var(--transition);
}
.post-meta .tag:hover {
  background: rgba(155,123,213,0.2);
  color: var(--primary-light);
}
.post-meta .tag.反诈 { color: #ff6b6b; }
.post-meta .tag.渗透 { color: #ff8c00; }
.post-meta .tag.APK { color: #ffd700; }
.post-meta .tag.技能 { color: #00c8ff; }
.post-meta .tag.溯源 { color: #00ffaa; }
.post-meta .tag.基建 { color: #ffa500; }
.post-meta .tag.杂谈 { color: #c4a8f0; }

.post-desc {
  font-size: 0.82em;
  color: #555;
  margin-top: 6px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- Delete button ---- */
.post-del {
  position: absolute;
  top: 10px;
  right: 14px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(26,26,42,0.8);
  border: 1px solid var(--border);
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75em;
  cursor: pointer;
  opacity: 0;
  transition: all var(--transition);
  z-index: 2;
  backdrop-filter: blur(4px);
}
.post:hover .post-del { opacity: 1; }
.post-del:hover {
  background: rgba(60,20,20,0.9);
  border-color: #ff4444;
  color: #ff4444;
  transform: scale(1.1);
}

/* ---- No result ---- */
.no-result {
  text-align: center;
  padding: 60px 20px;
  color: #555;
  display: none;
}
.no-result.show { display: block; }
.no-result .emoji { font-size: 2.5em; margin-bottom: 12px; }

/* ---- Back to top ---- */
.back-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2em;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  transition: all var(--transition);
  z-index: 100;
  backdrop-filter: blur(12px);
}
.back-top.visible {
  opacity: 1;
  transform: translateY(0);
}
.back-top:hover {
  border-color: var(--primary);
  color: var(--primary-light);
  box-shadow: 0 0 20px var(--primary-glow);
}

/* ---- Footer ---- */
.footer {
  text-align: center;
  padding: 50px 0 20px;
  color: #444;
  font-size: 0.8em;
  border-top: 1px solid rgba(255,255,255,0.04);
  margin-top: 40px;
}
.footer .icons { font-size: 1.2em; margin-top: 10px; letter-spacing: 8px; }

/* ---- Post article styles ---- */
.post-article .nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.post-article .nav-bar .back-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.85em;
  transition: color var(--transition);
}
.post-article .nav-bar .back-link:hover { color: var(--primary-light); }
.post-article .nav-bar .post-stat {
  color: #555;
  font-size: 0.78em;
}
.post-article h1 {
  font-size: 2em;
  background: linear-gradient(135deg, #e0e0e0, #c4a8f0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 30px 0 16px;
  text-align: center;
  line-height: 1.4;
}
.post-article .meta {
  color: #555;
  font-size: 0.85em;
  text-align: center;
  margin-bottom: 30px;
}
.post-article h2 {
  font-size: 1.3em;
  color: var(--primary-light);
  margin: 32px 0 14px;
  padding-left: 14px;
  border-left: 3px solid var(--primary);
}
.post-article h3 {
  font-size: 1.1em;
  color: #b8a0e8;
  margin: 24px 0 10px;
}
.post-article p { margin: 14px 0; }
.post-article .highlight {
  background: rgba(155,123,213,0.06);
  border-left: 3px solid var(--primary);
  padding: 14px 18px;
  margin: 18px 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.post-article .tag {
  display: inline-block;
  background: rgba(155,123,213,0.1);
  color: var(--primary-light);
  padding: 2px 12px;
  border-radius: 12px;
  font-size: 0.8em;
  cursor: pointer;
  transition: all var(--transition);
}
.post-article .tag:hover {
  background: rgba(155,123,213,0.2);
  box-shadow: 0 0 12px var(--primary-glow);
}
.post-article hr {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin: 32px 0;
}
.post-article pre {
  background: #111120;
  padding: 18px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 18px 0;
  border: 1px solid var(--border);
  font-size: 0.85em;
  line-height: 1.6;
}
.post-article ul, .post-article ol {
  margin: 14px 0;
  padding-left: 24px;
}
.post-article li { margin: 6px 0; }
.post-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 0.9em;
}
.post-article th, .post-article td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
}
.post-article th {
  background: rgba(155,123,213,0.08);
  color: var(--primary-light);
  font-weight: 500;
}
.post-article td { color: #ccc; }
.post-article blockquote {
  border-left: 3px solid var(--primary);
  padding: 10px 18px;
  margin: 16px 0;
  color: #999;
  background: rgba(155,123,213,0.04);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.post-article img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  margin: 18px 0;
}
.post-article code {
  background: rgba(155,123,213,0.1);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.85em;
}
.post-article pre code {
  background: none;
  padding: 0;
}

/* ---- Reading progress bar ---- */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  z-index: 1000;
  transition: width 0.1s linear;
  width: 0;
}

/* ---- Search highlight ---- */
.search-highlight {
  background: rgba(155,123,213,0.2);
  color: var(--primary-light);
  padding: 0 2px;
  border-radius: 2px;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .container { padding: 12px; }
  .header { padding: 40px 0 24px; }
  .header h1 { font-size: 1.6em; }
  .post { padding: 14px 16px; }
  .post-cat { width: 32px; height: 32px; font-size: 1em; }
  .post-title { font-size: 0.95em; }
  .post-desc { -webkit-line-clamp: 3; }
  .stats-bar { flex-direction: column; gap: 4px; align-items: flex-start; }
  .back-top { bottom: 20px; right: 20px; width: 38px; height: 38px; }
  .post-article h1 { font-size: 1.5em; }
}
