.resource-url-page {
  --rd-accent: #8a6a35;
  --rd-accent-dark: #a87b38;
  --rd-line: #dfe7e3;
  --rd-ink: #14202a;
  --rd-muted: #65737e;
  --rd-soft: #f7faf8;
}

.resource-url-page .article-modern-layout {
  grid-template-columns: 330px minmax(0, 820px);
  justify-content: center;
  gap: 20px;
  padding-right: 230px;
}

.resource-url-page .resource-head {
  padding: 30px 34px 28px;
  text-align: left;
}

.resource-head-main {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
}

.resource-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 78px;
  height: 78px;
  overflow: hidden;
  border: 1px solid #dbe4df;
  border-radius: 16px;
  background: #e9efec;
}

.resource-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.resource-logo--empty {
  background: #f4f8f5;
  color: #66747c;
  font-size: 31px;
}

.resource-logo--empty i {
  line-height: 1;
}

.article-modern-list-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid #d8e2dc;
  border-radius: 8px;
  background: #f4f8f5;
  color: #66747c;
  font-size: 20px;
}

.resource-title-block {
  min-width: 0;
}

.resource-url-page .resource-kicker {
  margin-bottom: 8px;
  color: var(--rd-accent);
}

.resource-url-page .resource-head h1 {
  max-width: none;
  margin: 0;
  font-size: 36px;
  line-height: 1.2;
  text-align: left;
}

.resource-url-page .resource-meta {
  justify-content: flex-start;
  margin-top: 12px;
}

.resource-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.resource-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid #cfd7dd;
  border-radius: 999px;
  background: #f7f8f5;
  color: #8a6a35;
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.resource-btn-primary {
  border-color: var(--rd-accent);
  background: var(--rd-accent);
  color: #fff;
}

.resource-btn:hover,
.resource-btn:focus-visible {
  border-color: var(--rd-accent-dark);
  background: var(--rd-accent-dark);
  color: #fff;
}

.resource-url-page .resource-desc {
  max-width: none;
  margin: 22px 0 0;
  border-color: #e6d7cb;
  background: #fffaf6;
}

.resource-url-page .article-modern-reader {
  padding: 30px 34px 34px;
}

.resource-url-page .resource-article h2:first-child {
  margin-top: 0;
}

.resource-url-page .resource-tags {
  margin-top: 26px;
}

.resource-url-page .resource-side .article-modern-widget {
  background: rgba(255, 255, 255, 0.92);
}

.resource-url-page .resource-rail {
  top: 126px;
}

.resource-url-page .resource-hot-card {
  margin-top: 8px;
  padding: 14px;
  border: 1px solid var(--rd-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
}

.resource-url-page .resource-hot-card h2 {
  position: relative;
  margin: 0 0 11px;
  padding-left: 14px;
  color: var(--rd-ink);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.35;
}

.resource-url-page .resource-hot-card h2::before {
  position: absolute;
  top: 50%;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #d8b56d;
  box-shadow: 0 0 0 3px rgba(31, 41, 48, 0.1);
  content: "";
  transform: translateY(-50%);
}

.resource-url-page .resource-hot-tags {
  gap: 8px;
}

.resource-url-page .resource-prenext {
  margin: 0;
}

.resource-url-page .article-modern-list strong,
.resource-url-page .article-modern-list span span {
  overflow-wrap: anywhere;
}

@media (max-width: 1180px) {
  .resource-url-page .article-modern-layout {
    grid-template-columns: 300px minmax(0, 1fr);
    padding-right: 0;
  }

  .resource-url-page .resource-rail {
    position: static;
    width: auto;
  }
}

@media (max-width: 900px) {
  .resource-url-page .resource-wrap {
    width: min(100% - 20px, 720px);
  }

  .resource-url-page .article-modern-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .resource-url-page .resource-side {
    order: 2;
  }

  .resource-url-page .resource-center {
    order: 1;
  }

  .resource-url-page .resource-rail {
    order: 3;
  }

  .resource-url-page .resource-head {
    padding: 22px 18px 20px;
  }

  .resource-head-main {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 12px;
  }

  .resource-logo {
    width: 58px;
    height: 58px;
    border-radius: 12px;
  }

  .resource-url-page .resource-head h1 {
    font-size: 26px;
  }

  .resource-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .resource-url-page .resource-desc {
    margin-top: 16px;
  }

  .resource-url-page .article-modern-reader {
    padding: 20px 18px 24px;
  }
}

@media (max-width: 480px) {
  .resource-btn {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0 12px;
  }

  .resource-url-page .resource-meta {
    gap: 7px;
  }

  .resource-url-page .resource-meta span {
    min-height: 28px;
    padding: 0 9px;
    font-size: 12px;
  }
}

/* 2026-06-30 premium resource palette */
.resource-url-page {
  --rd-accent: #8a6a35;
  --rd-accent-dark: #6f542b;
  --rd-line: #cfd7dd;
  --rd-ink: #17212a;
  --rd-muted: #526970;
  --rd-soft: #f5f7f7;
}

.resource-btn {
  border-color: #cfd7dd;
  background: #f5f7f7;
  color: #304854;
}

.resource-btn-primary,
.resource-btn:hover,
.resource-btn:focus-visible {
  border-color: rgba(201, 155, 79, 0.62);
  background: linear-gradient(180deg, #e1bf78, #c99b4f);
  color: #141518;
}

.resource-url-page .resource-desc,
.resource-url-page .resource-hot-card {
  border-color: var(--rd-line);
  background: #f5f7f7;
}

/* 2026-09-23 resource detail light unification (align with task/article pages) */
/* 反超 takefu-shell.css L98 (a{color:var(--tf-plum)!important})；外壳 L95 类清单不含 .resource-* */
/* 卡片：.article-modern-card/.article-modern-widget 原仅存在于深色层 → 按浅色卡片还原 */
html body.resource-url-page.takefu-shell-ready:not(.takefu-theme-protected) .article-modern-card,
html body.resource-url-page.takefu-shell-ready:not(.takefu-theme-protected) .article-modern-widget {
  border-color: var(--rd-line) !important;
  background: linear-gradient(180deg, #ffffff, #f8fafa) !important;
  color: var(--rd-ink) !important;
  box-shadow: 0 10px 26px rgba(16, 42, 49, 0.06) !important;
}

/* 资源说明 / 热门卡片：浅灰底（还原浅色层意图） */
html body.resource-url-page.takefu-shell-ready:not(.takefu-theme-protected) .resource-desc,
html body.resource-url-page.takefu-shell-ready:not(.takefu-theme-protected) .resource-hot-card {
  border-color: var(--rd-line) !important;
  background: #f7fafa !important;
}

/* 按钮基础：:not() 排除主按钮，避免自身 (0,5,2) 反超主按钮规则 (0,4,2) */
html body.resource-url-page.takefu-shell-ready:not(.takefu-theme-protected) .resource-btn:not(.resource-btn-primary) {
  border-color: #cfd7dd !important;
  background: #f5f7f7 !important;
  color: #304854 !important;
}

html body.resource-url-page.takefu-shell-ready:not(.takefu-theme-protected) .resource-btn-primary,
html body.resource-url-page.takefu-shell-ready:not(.takefu-theme-protected) .resource-btn:hover,
html body.resource-url-page.takefu-shell-ready:not(.takefu-theme-protected) .resource-btn:focus-visible {
  border-color: rgba(201, 155, 79, 0.62) !important;
  background: linear-gradient(180deg, #e1bf78, #c99b4f) !important;
  color: #141518 !important;
}

/* 标题 / 正文（原深色层用元素级选择器配 !important，命中面极广）。
   ★ 必须排除外壳页眉/抽屉/页脚与广告位 —— 它们是深色底，用浅色主题令牌会反向降低可读性。
     实测：不加排除会让受保护页 html/tkfhz/69.html 的页脚 y[4932..4968] 有 4,448px 变差。
   :where() 零特异性 → 不会额外抬高本规则的选择器权重。 */
html body.resource-url-page.takefu-shell-ready:not(.takefu-theme-protected) :is(h1, h2, h3, strong):not(:where(.takefu-shell-header, .takefu-shell-drawer, .takefu-shell-footer, .takefu-api-side-ad, .takefu-api-bottom-ad) *) {
  color: var(--rd-ink) !important;
}

html body.resource-url-page.takefu-shell-ready:not(.takefu-theme-protected) :is(p, li):not(:where(.takefu-shell-header, .takefu-shell-drawer, .takefu-shell-footer, .takefu-api-side-ad, .takefu-api-bottom-ad) *),
html body.resource-url-page.takefu-shell-ready:not(.takefu-theme-protected) .resource-desc {
  color: var(--rd-muted) !important;
}

/* 【受保护页兼容层】html/tkfhz/69.html 的外壳页脚内含 <p>/<strong>。
   改动前，已删除的深色泄漏层（`.resource-url-page h1, h2, h3, strong` 与
   `.resource-url-page p, li, .resource-desc` —— 后几项是裸元素选择器、未限定作用域）
   会命中该页脚，把它染成深色层的近白色值。
   实测：全站 34 处引用中，只有该页页脚含 <p>/<strong>（其余 32 页页脚仅 <a>/<span>，
   模板 view_article_resource.htm 无渲染页脚）；且只有该页会被 takefu-shell.js
   的 markProtectedVisualSections() 加上 .takefu-theme-protected（见 L108-111 路径白名单），
   因此用 .takefu-theme-protected 精确圈定，作用面 = 1 页。
   目的：让该受保护页逐像素不变。若日后希望它的页脚与全站统一，
   删除本块即可（页脚 p 对比度会由 8.82:1 升到 16.54:1）。  —— 2026-09-23 */
html body.resource-url-page.takefu-shell-ready.takefu-theme-protected .takefu-shell-footer :is(h1, h2, h3, strong) {
  color: #f4f7f8 !important;
}

html body.resource-url-page.takefu-shell-ready.takefu-theme-protected .takefu-shell-footer :is(p, li) {
  color: #a9b7c2 !important;
}
