/* HTTP 参考（状态码 / MIME / Header）- 页面专属样式
   公共部分（header/container/links-section/footer）由 css/style.css 提供 */

/* ---------- 简介卡片 ---------- */
.hr-intro {
  background: #fff;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-top: 20px;
  line-height: 1.8;
  font-size: 0.95rem;
  color: var(--gray-700);
}
.hr-intro h2 {
  font-size: 1.1rem;
  margin: 18px 0 8px;
  color: var(--gray-900);
}
.hr-intro h2:first-child { margin-top: 0; }
.hr-intro p { margin: 8px 0; }
.hr-intro strong { color: var(--gray-900); }
.hr-intro code {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 0.85em;
  color: #b91c1c;
}
.hr-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.hr-stats span {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 0.85rem;
  color: var(--gray-700);
}
.hr-stats span b { color: var(--primary); font-size: 0.95rem; }

/* ---------- 搜索与选项卡 ---------- */
.hr-toolbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #f5f6fa;
  padding: 12px 0;
  margin-top: 20px;
}
.hr-toolbar-inner {
  background: #fff;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hr-search-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.hr-search-row input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s;
  min-width: 0;
}
.hr-search-row input:focus { border-color: var(--primary); }
.hr-search-row .hr-count {
  white-space: nowrap;
  font-size: 0.82rem;
  color: var(--gray-500);
}
.hr-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.hr-tab {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gray-600);
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  cursor: pointer;
  user-select: none;
  transition: all 0.12s;
}
.hr-tab:hover { border-color: var(--primary); color: var(--primary); }
.hr-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
/* 状态码分类过滤 chips */
.hr-cats { display: none; }
.hr-cats.visible { display: flex; }
.hr-cat {
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray-500);
  background: #fff;
  border: 1px solid var(--gray-200);
  cursor: pointer;
  user-select: none;
  transition: all 0.12s;
}
.hr-cat:hover { color: var(--gray-800); }
.hr-cat.active { color: #fff; border-color: transparent; }
.hr-cat[data-k="all"].active     { background: var(--gray-700); }
.hr-cat[data-k="info"].active    { background: #2563eb; }
.hr-cat[data-k="success"].active { background: #15803d; }
.hr-cat[data-k="redirect"].active{ background: #b45309; }
.hr-cat[data-k="client"].active  { background: #dc2626; }
.hr-cat[data-k="server"].active  { background: #7c3aed; }

/* ---------- 状态码 ---------- */
.hr-section {
  background: #fff;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 18px 24px;
  margin-top: 18px;
}
.hr-section > h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  color: var(--gray-900);
  padding-bottom: 10px;
  border-bottom: 2px solid var(--gray-100);
}
.hr-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 28px;
  border-radius: 8px;
  color: #fff;
  font-size: 0.9rem;
  letter-spacing: 1px;
}
.hr-k-info     .hr-badge, .hr-badge.k-info,     .hr-item-code.k-info     { background: #2563eb; }
.hr-k-success  .hr-badge, .hr-badge.k-success,  .hr-item-code.k-success  { background: #15803d; }
.hr-k-redirect .hr-badge, .hr-badge.k-redirect, .hr-item-code.k-redirect { background: #b45309; }
.hr-k-client   .hr-badge, .hr-badge.k-client,   .hr-item-code.k-client   { background: #dc2626; }
.hr-k-server   .hr-badge, .hr-badge.k-server,   .hr-item-code.k-server   { background: #7c3aed; }
.hr-ktag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 10px;
  white-space: nowrap;
}
.hr-ktag.t-info     { background: #dbeafe; color: #1d4ed8; }
.hr-ktag.t-success  { background: #dcfce7; color: #166534; }
.hr-ktag.t-redirect { background: #fef3c7; color: #92400e; }
.hr-ktag.t-client   { background: #fee2e2; color: #b91c1c; }
.hr-ktag.t-server   { background: #ede9fe; color: #6d28d9; }
.hr-section > h2 .hr-count {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--gray-400);
  margin-left: auto;
}

.hr-item {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--gray-200);
}
.hr-item:last-child { border-bottom: none; }
.hr-item-code {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 30px;
  border-radius: 8px;
  color: #fff;
  font-family: Consolas, Monaco, monospace;
  font-size: 0.98rem;
  font-weight: 700;
}
.hr-item-body { flex: 1; min-width: 0; }
.hr-item-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.hr-item-name {
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--gray-900);
}
.hr-item-cn { font-size: 0.9rem; color: var(--gray-600); }
.hr-item-desc {
  margin-top: 4px;
  font-size: 0.87rem;
  color: var(--gray-600);
  line-height: 1.65;
  word-break: break-word;
}

/* ---------- MIME 表格 ---------- */
.hr-table-wrap { overflow-x: auto; }
.hr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin-top: 14px;
}
.hr-table th {
  background: var(--primary);
  color: #fff;
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}
.hr-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: top;
}
.hr-table tr:nth-child(even) td { background: var(--gray-50); }
.hr-table tr:hover td { background: #eef2ff; }
.hr-table code, .hr-code {
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 0.85em;
  color: #b91c1c;
  word-break: break-all;
}

/* ---------- Header 条目 ---------- */
.hr-hdr {
  padding: 12px 0;
  border-bottom: 1px dashed var(--gray-200);
}
.hr-hdr:last-child { border-bottom: none; }
.hr-hdr-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.hr-hdr-name {
  font-family: Consolas, Monaco, monospace;
  font-weight: 700;
  font-size: 0.96rem;
  color: var(--primary);
}
.hr-hdr-dir {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 10px;
  white-space: nowrap;
}
.hr-hdr-dir.d-req  { background: #dbeafe; color: #1d4ed8; }
.hr-hdr-dir.d-res  { background: #dcfce7; color: #166534; }
.hr-hdr-dir.d-both { background: var(--gray-100); color: var(--gray-600); }
.hr-hdr-desc {
  margin-top: 4px;
  font-size: 0.87rem;
  color: var(--gray-600);
  line-height: 1.65;
}
.hr-hdr-sample {
  margin-top: 6px;
  background: var(--gray-50);
  border-left: 3px solid var(--gray-300);
  padding: 6px 10px;
  border-radius: 0 6px 6px 0;
  font-family: Consolas, Monaco, monospace;
  font-size: 0.8rem;
  color: var(--gray-700);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ---------- FAQ ---------- */
.hr-faq {
  background: #fff;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 20px 24px;
  margin-top: 18px;
}
.hr-faq h2 { font-size: 1.2rem; margin-bottom: 6px; color: var(--gray-900); }
.hr-faq details {
  border-bottom: 1px dashed var(--gray-200);
  padding: 10px 0;
}
.hr-faq details:last-child { border-bottom: none; }
.hr-faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--gray-800);
  list-style-position: outside;
}
.hr-faq summary::marker { color: var(--primary); }
.hr-faq .hr-faq-a {
  margin-top: 8px;
  font-size: 0.89rem;
  color: var(--gray-600);
  line-height: 1.75;
}

/* ---------- 空结果 / noscript ---------- */
.hr-empty {
  display: none;
  text-align: center;
  color: var(--gray-500);
  padding: 40px 0;
  font-size: 0.95rem;
}

@media (max-width: 640px) {
  .hr-intro, .hr-section, .hr-faq { padding: 16px; }
  .hr-toolbar-inner { padding: 10px 12px; }
  .hr-search-row .hr-count { display: none; }
  .hr-item { gap: 10px; }
  .hr-item-code { min-width: 44px; height: 27px; font-size: 0.9rem; }
}
