:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --text: #e7ecf3;
  --muted: #9aa8bc;
  --accent: #4f8cff;
  --accent2: #7c5cff;
  --border: #2a3548;
  --capsule: #152033;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
}

.wrap { max-width: 960px; margin: 0 auto; padding: 0 1.25rem; }

.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(15, 20, 25, 0.92);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
}
.brand { font-weight: 700; color: var(--text); text-decoration: none; }
nav a { color: var(--muted); margin-left: 1rem; text-decoration: none; }
nav a:hover { color: var(--accent); }

.hero { padding: 2.5rem 0 1rem; }
.hero h1 { font-size: 2rem; margin: 0 0 0.5rem; }
.lead { color: var(--muted); font-size: 1.1rem; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1rem 0 2rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
}
.card a { color: inherit; text-decoration: none; }
.card h3 { margin: 0 0 0.5rem; font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.card time { display: block; margin-top: 0.5rem; color: var(--muted); font-size: 0.8rem; }

.answer-capsule {
  background: var(--capsule);
  border-left: 4px solid var(--accent);
  padding: 1rem 1.1rem;
  margin: 1rem 0 1.5rem;
  border-radius: 0 8px 8px 0;
}
.answer-capsule p { margin: 0.35rem 0 0; }

.prose h2, .prose h3 { margin-top: 1.5rem; }
.prose pre {
  background: #0a0e14;
  padding: 1rem;
  overflow: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.prose code { font-family: Consolas, monospace; font-size: 0.9em; }
.prose a { color: var(--accent); }

.faq { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.faq-item { margin-bottom: 1rem; }
.faq-item h3 { margin: 0 0 0.35rem; font-size: 1rem; }

.douyin-wrap {
  width: min(324px, 100%);
  margin: 1rem auto 1.5rem;
  aspect-ratio: 9 / 16;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}
@media (min-width: 730px) {
  .douyin-wrap { width: min(360px, 100%); }
}
.douyin-wrap iframe { width: 100%; height: 100%; border: 0; }

.video-badge {
  display: inline-block;
  font-size: 0.72rem;
  color: var(--accent);
  background: rgba(79, 140, 255, 0.12);
  border: 1px solid rgba(79, 140, 255, 0.35);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  margin-bottom: 0.45rem;
}

.tutorial-segments { margin: 1.5rem 0; }
.tutorial-segment {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.tutorial-segment:last-child { border-bottom: 0; }
.segment-title { margin: 0.75rem 0 0.5rem; font-size: 1.25rem; }
.segment-prose { margin-top: 0.75rem; }

.tutorial-interact { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.plk-interact-panel section { margin-bottom: 2rem; }
.plk-auth-bar { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.plk-auth-bar button, .plk-like-btn, .plk-comment-form button, .plk-question-form button {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
  font-size: 0.9rem;
}
.plk-like-btn.active { border-color: var(--accent); color: var(--accent); }
.plk-comment-form textarea, .plk-question-form textarea, .plk-auth-form input {
  width: 100%;
  margin: 0.35rem 0 0.75rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.plk-comment, .plk-question, .plk-feed-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.65rem;
}
.plk-feed-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.35rem; }
.plk-feed-item p { margin: 0.35rem 0 0; }
.plk-reply { color: var(--muted); font-size: 0.92rem; }
.plk-tag {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.plk-tag-comment { color: var(--accent); border-color: rgba(79, 140, 255, 0.4); }
.plk-tag-question { color: var(--accent2); border-color: rgba(124, 92, 255, 0.4); }
.plk-form-row { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 0.5rem; }
.plk-form-row label { font-size: 0.88rem; color: var(--muted); }
.plk-post-form select { margin-left: 0.35rem; }
.plk-form-error { color: #ff8a8a; font-size: 0.88rem; min-height: 1.2em; }

.plk-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.plk-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  width: min(420px, 92vw);
}
.plk-modal h3 { margin: 0 0 1rem; }
.plk-modal-close { margin-top: 0.75rem; }

.badge {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--accent2);
  margin-bottom: 0.5rem;
}
.entity-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 2rem;
}
.entity-table th, .entity-table td {
  border: 1px solid var(--border);
  padding: 0.6rem 0.75rem;
  text-align: left;
}
.entity-table th { width: 140px; background: var(--surface); color: var(--muted); }

.disclaimer {
  margin-top: 2rem;
  padding: 1rem;
  background: var(--surface);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.site-footer {
  margin-top: 3rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer a { color: var(--accent); }

.meta { color: var(--muted); font-size: 0.9rem; }
