/* StackBrief — layout inspired by public course portals (compact header, category rail, card grid) */
:root {
  --imooc-orange: #ff6325;
  --imooc-orange-dark: #e55a1f;
  --ink: #1c1f21;
  --muted: #545c63;
  --muted-light: #9199a1;
  --bg: #f3f5f7;
  --card: #ffffff;
  --line: #e8eaec;
  --green-tag: #00b578;
  --blue-tag: #008cc8;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 15px;
}

a {
  color: var(--imooc-orange);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.logo {
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--imooc-orange);
  letter-spacing: -0.02em;
}

.logo small {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.search-pill {
  flex: 1;
  min-width: 200px;
  max-width: 420px;
}

.search-pill input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f7f8fa url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%239199a1' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242.656a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E") 12px center no-repeat;
  font-size: 0.92rem;
}

.nav-bar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.nav-inner a {
  display: inline-block;
  padding: 12px 10px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}

.nav-inner a:hover {
  color: var(--imooc-orange);
  text-decoration: none;
}

.nav-inner a.is-active {
  color: var(--imooc-orange);
  border-bottom-color: var(--imooc-orange);
}

.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }
}

.side-rail {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 0;
  align-self: start;
}

.side-rail h2 {
  margin: 0 0 8px;
  padding: 0 16px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-light);
}

.side-rail a {
  display: block;
  padding: 8px 16px;
  color: var(--ink);
  font-size: 0.9rem;
  border-left: 3px solid transparent;
}

.side-rail a:hover {
  background: #fff7f4;
  color: var(--imooc-orange);
  text-decoration: none;
}

.side-rail a.is-here {
  border-left-color: var(--imooc-orange);
  background: #fff7f4;
  color: var(--imooc-orange);
  font-weight: 700;
}

main.content {
  min-width: 0;
}

.hero-block {
  background: linear-gradient(135deg, #fff7f4 0%, #ffffff 48%, #f7f9fc 100%);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px 24px 26px;
  margin-bottom: 22px;
}

.hero-block h1 {
  margin: 0 0 10px;
  font-size: clamp(1.45rem, 2.4vw, 1.85rem);
  line-height: 1.25;
}

.hero-block p {
  margin: 0;
  color: var(--muted);
  max-width: 72ch;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
}

.section-title h2 {
  margin: 0;
  font-size: 1.05rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tag-news {
  background: rgba(0, 140, 200, 0.12);
  color: var(--blue-tag);
}

.tag-qa {
  background: rgba(0, 181, 120, 0.12);
  color: var(--green-tag);
}

.card-grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 640px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1000px) {
  .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  box-shadow: 0 8px 24px rgba(28, 31, 33, 0.08);
  border-color: rgba(255, 99, 37, 0.35);
}

.card-body {
  padding: 14px 16px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-meta {
  font-size: 0.78rem;
  color: var(--muted-light);
}

.card h3 {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.35;
}

.card h3 a {
  color: var(--ink);
}

.card h3 a:hover {
  color: var(--imooc-orange);
}

.card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.55;
  flex: 1;
}

.card-foot {
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--muted-light);
}

.btn-primary {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--imooc-orange);
  color: #fff !important;
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--imooc-orange-dark);
  text-decoration: none;
}

.site-footer {
  margin-top: 40px;
  padding: 28px 20px;
  background: #2d3134;
  color: #b7bbbf;
  font-size: 0.86rem;
}

.site-footer a {
  color: #cfd2d5;
}

.site-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.topic-article {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px 20px 20px;
  margin-bottom: 16px;
}

.topic-article h2 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  line-height: 1.3;
}

.topic-article .pub {
  font-size: 0.82rem;
  color: var(--muted-light);
  margin-bottom: 12px;
}

.topic-article .body p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.topic-article .sources {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 0.82rem;
  color: var(--muted);
}

.topic-article .sources strong {
  color: var(--ink);
}

.breadcrumb {
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 14px;
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb a:hover {
  color: var(--imooc-orange);
}
