/* d6ka 站群模板 — 类名前缀 dk-，参考 d6ka.com 红灰书库布局 */
*, *::before, *::after { box-sizing: border-box; }
body.dk-theme {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.55;
  font-size: 15px;
}
a { color: #c0392b; text-decoration: none; transition: color 0.2s; }
a:hover { color: #e74c3c; }
.dk-shell { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.dk-masthead {
  background: linear-gradient(135deg, #ff6b6b, #ee5a52);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.dk-masthead-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
}
.dk-site-title { margin: 0; font-size: 1.25rem; font-weight: 600; line-height: 1.35; }
.dk-site-title a { color: #fff; }
.dk-site-title a:hover { color: #fff; opacity: 0.92; }
.dk-site-tagline { display: block; font-size: 12px; font-weight: 400; opacity: 0.88; margin-top: 4px; }
.dk-masthead-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.dk-masthead-nav a {
  color: #fff;
  font-size: 13px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
}
.dk-masthead-nav a:hover { background: rgba(255, 255, 255, 0.22); color: #fff; }
.dk-navbar { background: #fff; border-bottom: 1px solid #e8e8e8; }
.dk-navbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0;
}
.dk-nav-scroll {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-width: 0;
}
.dk-nav-scroll a {
  flex: 0 0 auto;
  padding: 12px 16px;
  color: #666;
  font-size: 14px;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.dk-nav-scroll a:hover { color: #ff6b6b; }
.dk-nav-scroll a.dk-nav-on { color: #ff6b6b; border-bottom-color: #ff6b6b; }
.dk-search-bar { padding: 8px 0; }
.dk-search-bar form { display: flex; }
.dk-search-bar input {
  padding: 7px 12px;
  border: 1px solid #ddd;
  border-radius: 4px 0 0 4px;
  font-size: 13px;
  outline: none;
  min-width: 160px;
}
.dk-search-bar button {
  padding: 7px 14px;
  background: #ff6b6b;
  color: #fff;
  border: none;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  font-size: 13px;
}
.dk-search-bar button:hover { background: #ee5a52; }
.dk-layout { display: flex; gap: 20px; padding: 20px 0 28px; align-items: flex-start; }
.dk-primary { flex: 1; min-width: 0; }
.dk-rail { width: 280px; flex-shrink: 0; }
.dk-block {
  background: #fff;
  margin-bottom: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}
.dk-block-head {
  font-size: 16px;
  font-weight: 600;
  padding: 12px 16px;
  background: #fafafa;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dk-block-head a.dk-more { font-size: 13px; font-weight: 400; color: #999; }
.dk-block-head a.dk-more:hover { color: #ff6b6b; }
.dk-tile-grid {
  list-style: none;
  margin: 0;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.dk-tile-grid li {
  padding: 14px;
  border-radius: 8px;
  border: 1px solid #e8e8e8;
  transition: transform 0.2s, box-shadow 0.2s;
}
.dk-tile-grid li:nth-child(4n + 1) { background: #ffe8e8; border-color: #ffd0d0; }
.dk-tile-grid li:nth-child(4n + 2) { background: #fff6da; border-color: #ffe8a8; }
.dk-tile-grid li:nth-child(4n + 3) { background: #e8f5e9; border-color: #c8e6c9; }
.dk-tile-grid li:nth-child(4n + 4) { background: #e3f2fd; border-color: #bbdefb; }
.dk-tile-grid li:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); }
.dk-tile-title { font-size: 14px; font-weight: 500; color: #333; display: block; margin-bottom: 6px; }
.dk-tile-title:hover { color: #ff6b6b; }
.dk-tile-meta { font-size: 12px; color: #999; line-height: 1.5; }
.dk-cat-links { list-style: none; margin: 0; padding: 10px 16px; }
.dk-cat-links li { padding: 6px 0; }
.dk-cat-links a {
  color: #666;
  font-size: 14px;
  display: block;
  padding-left: 8px;
  border-left: 3px solid transparent;
}
.dk-cat-links a:hover { color: #ff6b6b; padding-left: 12px; border-left-color: #ff6b6b; }
.dk-rank-ol { list-style: none; margin: 0; padding: 10px 16px; counter-reset: dk-rank; }
.dk-rank-ol li {
  counter-increment: dk-rank;
  padding: 8px 0 8px 28px;
  position: relative;
  border-bottom: 1px dashed #f0f0f0;
  font-size: 14px;
}
.dk-rank-ol li::before {
  content: counter(dk-rank);
  position: absolute;
  left: 0;
  width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  font-size: 11px;
  background: #ff6b6b;
  color: #fff;
  border-radius: 4px;
}
.dk-rank-ol li:nth-child(n + 4)::before { background: #bbb; }
.dk-crumb { font-size: 13px; color: #888; margin-bottom: 14px; }
.dk-crumb a { color: #666; }
.dk-crumb span { margin: 0 6px; color: #ccc; }
.dk-book-row {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid #f5f5f5;
}
.dk-book-row:last-child { border-bottom: none; }
.dk-thumb { width: 72px; flex-shrink: 0; }
.dk-thumb img { width: 100%; height: auto; border-radius: 4px; display: block; }
.dk-book-body h3 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.dk-book-body h3 a { color: #333; }
.dk-book-body h3 a:hover { color: #ff6b6b; }
.dk-book-meta { font-size: 12px; color: #999; margin-bottom: 6px; }
.dk-book-meta span { margin-right: 10px; }
.dk-book-intro { font-size: 13px; color: #777; line-height: 1.6; }
.dk-badge { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 11px; background: #ff6b6b; color: #fff; }
.dk-badge.dk-done { background: #95a5a6; }
.dk-detail-grid { display: grid; grid-template-columns: 140px 1fr; gap: 20px; padding: 16px; }
@media (max-width: 640px) { .dk-detail-grid { grid-template-columns: 1fr; } }
.dk-detail-grid img { max-width: 140px; border-radius: 6px; }
.dk-detail-grid h1 { font-size: 22px; margin: 0 0 10px; }
.dk-stat-row { display: flex; gap: 20px; margin: 12px 0; font-size: 13px; color: #666; }
.dk-stat-row b { display: block; font-size: 18px; color: #ff6b6b; }
.dk-btn-row { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; }
.dk-btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 14px;
  background: #ff6b6b;
  color: #fff !important;
}
.dk-btn:hover { background: #ee5a52; color: #fff !important; }
.dk-btn.dk-outline { background: #fff; color: #ff6b6b !important; border: 1px solid #ff6b6b; }
.dk-chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  padding: 12px 16px;
}
.dk-chapter-grid a {
  padding: 8px 10px;
  background: #fafafa;
  border-radius: 4px;
  font-size: 13px;
  color: #555;
  border: 1px solid #eee;
}
.dk-chapter-grid a:hover { border-color: #ff6b6b; color: #ff6b6b; }
.dk-read-wrap { max-width: 860px; margin: 0 auto; padding: 16px; }
.dk-read-title { font-size: 22px; margin: 12px 0; text-align: center; }
.dk-read-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
  padding: 10px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #eee;
}
.dk-read-toolbar button, .dk-read-toolbar select {
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
}
.dk-read-body {
  background: #fff;
  padding: 24px 20px;
  border-radius: 8px;
  line-height: 1.85;
  font-size: 17px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.dk-read-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  padding: 14px 0;
  font-size: 14px;
}
.dk-read-nav span { color: #ccc; }
.dk-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; }
.dk-tabs a {
  padding: 8px 16px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 4px;
  color: #666;
  font-size: 14px;
}
.dk-tabs a.dk-tab-on { background: #ff6b6b; color: #fff; border-color: #ff6b6b; }
.dk-tag-pill {
  display: inline-block;
  margin: 4px 6px 4px 0;
  padding: 3px 10px;
  font-size: 12px;
  background: #fff0f0;
  color: #c0392b;
  border-radius: 12px;
  border: 1px solid #ffd0d0;
}
.dk-tag-pill:hover { background: #ff6b6b; color: #fff; border-color: #ff6b6b; }
.dk-footer {
  background: #2d2d2d;
  color: #aaa;
  text-align: center;
  padding: 18px 16px;
  font-size: 12px;
  margin-top: 8px;
}
.dk-footer a { color: #ddd; margin: 0 8px; }
.dk-footer a:hover { color: #ff6b6b; }
.dk-flinks { margin-bottom: 10px; line-height: 2; }
.dk-empty { padding: 40px; text-align: center; color: #999; }
.pagination { padding: 16px; text-align: center; }
.pagination a, .pagination span {
  display: inline-block;
  margin: 2px 4px;
  padding: 6px 12px;
  border: 1px solid #eee;
  border-radius: 4px;
  font-size: 13px;
  color: #666;
}
.pagination a:hover, .pagination .current { background: #ff6b6b; color: #fff; border-color: #ff6b6b; }
@media (max-width: 768px) {
  .dk-layout { flex-direction: column; }
  .dk-rail { width: 100%; }
  .dk-tile-grid { grid-template-columns: 1fr; }
  .dk-search-bar { width: 100%; }
  .dk-search-bar form { width: 100%; }
  .dk-search-bar input { flex: 1; min-width: 0; }
}
