/* YRDAO 卡片样式 —— 复刻 Jatra Community 信息卡 */

/* 瓜奇列表给每个条目套了一层 <li class="article-item gq-card-surface">，
   它自带白底 / 内边距 / 圆角 / hover 阴影。这里只对「包含我们卡片的外层 li」清零，
   避免出现双层卡片框。 */

/* 卡片间距：交给父容器的 gap（.yr-card 在 li 内部，margin 作用不到卡片之间） */
.topic-list {
  gap: 24px !important;
}

li.article-item:has(.yr-card) {
  background: transparent !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

li.article-item:has(.yr-card):hover {
  box-shadow: none !important;
}


/* 列表区铺浅灰底 —— 白卡压在白底上会糊成一片，这是层次感的来源 */
.module.common-module-topic {
  background: #eef2f7 !important;
  padding: 20px !important;
  border-radius: 16px;
}

html.dark .module.common-module-topic {
  background: #0b1220 !important;
}

.yr-card {
  list-style: none;
  margin: 0;
  /* 瓜奇的 !p-[var(--gq-card-padding)] 带 !important，必须同样加权覆盖 */
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.yr-card:last-child {
  margin-bottom: 0;
}

.yr-card-link {
  display: block;
  padding: 20px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 2px 8px rgba(15, 23, 42, 0.05);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.yr-card-link:hover {
  border-color: #cbd5e1;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.1);
  transform: translateY(-1px);
}

/* ---- 头部一行 ---- */
.yr-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.yr-card-avatar {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 9999px;
  object-fit: cover;
  background: rgba(127, 127, 127, 0.12);
}

.yr-card-avatar.is-empty {
  display: block;
}

.yr-card-who {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
}

.yr-card-name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yr-card-medal {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  object-fit: contain;
  border-radius: 4px;
}

.yr-card-medal.is-text {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 9999px;
  background: rgba(245, 158, 11, 0.9);
  color: #fff;
  font-size: 11px;
  white-space: nowrap;
}

.yr-card-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
  font-size: 12px;
  line-height: 1.4;
  color: #64748b;
  white-space: nowrap;
}

/* ---- 标题 ---- */
.yr-card-title {
  margin: 14px 0 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: #0f172a;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.yr-card-sticky {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
  font-size: 11px;
  font-weight: 600;
  vertical-align: middle;
}

/* ---- 摘要 ---- */
.yr-card-excerpt {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.6;
  color: #475569;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- 底部胶囊 ---- */
.yr-card-actions {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.yr-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  font-size: 13px;
  line-height: 1;
  color: #334155;
}

.yr-chip-icon {
  font-size: 14px;
  line-height: 1;
}

.yr-chip-text {
  font-weight: 500;
}

.yr-chip-num {
  padding-left: 10px;
  border-left: 1px solid #e2e8f0;
  font-weight: 600;
  color: #0f172a;
}

/* ---- 深色模式 ---- */
html.dark .yr-card-link {
  background: #111b2e;
  border-color: #2b3a55;
}

html.dark .yr-card-link:hover {
  border-color: #3a4b6b;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

html.dark .yr-card-name,
html.dark .yr-card-title,
html.dark .yr-chip-num {
  color: #e6edf7;
}

html.dark .yr-card-meta,
html.dark .yr-card-excerpt {
  color: #94a6bf;
}

html.dark .yr-chip {
  background: #0f1829;
  border-color: #2b3a55;
  color: #cbd5e1;
}

html.dark .yr-chip-num {
  border-left-color: #2b3a55;
}
