/* ============================================================
 * AI-News-Radar — 家纺流行趋势板块样式
 * 色彩策略: 采用 CSS 变量与设计令牌，自动响应系统/手动主题切换
 * ============================================================ */

/* ────── 主标签栏 (AI资讯 / 家纺趋势 切换) ────── */

.main-tabs {
  display: flex;
  gap: 4px;
  margin: 1.2rem 0 0.8rem;
  padding: 4px;
  background: var(--panel);
  border: 1px solid var(--trans-border);
  border-radius: 14px;
  backdrop-filter: blur(12px);
  width: fit-content;
}

.main-tab {
  padding: 10px 24px;
  border: none;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.main-tab:hover {
  color: var(--ink);
  background: var(--trans-bg);
}

.main-tab.active {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

/* 家纺趋势标签激活时用温暖色调 */
.main-tab[data-tab="textile"].active {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35);
}

/* ────── 家纺趋势容器 ────── */

.textile-wrap {
  margin-top: 1.5rem;
  animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.textile-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.textile-head-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.textile-head h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}

.textile-tools {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.textile-tools select {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-solid);
  color: var(--ink-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.2s;
}

.textile-tools select:focus {
  outline: none;
  border-color: #f59e0b;
}

#textileUpdatedAt {
  font-size: 0.78rem;
  color: var(--muted);
}

/* ────── 分类 Pills (一级) ────── */

.textile-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1.2rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--trans-border);
}

.textile-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card-trans-bg);
  color: var(--ink-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.textile-pill:hover {
  background: var(--accent-orange-bg);
  border-color: var(--accent-orange-border);
  color: var(--ink);
}

.textile-pill.active {
  background: linear-gradient(135deg, var(--accent-orange-bg), rgba(239, 68, 68, 0.15));
  border-color: var(--accent-orange-border);
  color: var(--accent-orange);
}

.textile-pill-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--trans-bg);
  font-size: 0.72rem;
  font-weight: 600;
}

.textile-pill.active .textile-pill-count {
  background: var(--accent-orange-bg);
}

/* ────── 二级子标签行 (POP趋势网子分类) ────── */

.textile-sub-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -0.6rem 0 1rem 0.5rem;
  padding: 8px 0 8px 12px;
  border-left: 3px solid var(--accent-orange-border);
}

.textile-sub-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border: 1px solid var(--trans-border);
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.textile-sub-pill:hover {
  border-color: var(--accent-orange-border);
  color: var(--ink);
  background: var(--accent-orange-bg);
}

.textile-sub-pill.active {
  border-color: var(--accent-orange-border);
  background: var(--accent-orange-bg);
  color: var(--accent-orange);
  font-weight: 600;
}

.textile-sub-pill-count {
  font-size: 0.68rem;
  opacity: 0.7;
}

/* ────── 趋势卡片网格 ────── */

.textile-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.textile-card {
  position: relative;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card-trans-bg);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  text-decoration: none !important;
  color: inherit;
}

@media (prefers-color-scheme: dark) {
  .textile-card {
    border-color: rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
  }
}

.textile-card:hover {
  transform: translateY(-3px);
  border-color: rgba(245, 158, 11, 0.3);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(245, 158, 11, 0.1);
  background: var(--card-hover);
}

@media (prefers-color-scheme: dark) {
  .textile-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(245, 158, 11, 0.1);
    background: rgba(255, 255, 255, 0.05);
  }
}

.textile-card-thumb {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(139, 92, 246, 0.06));
}

/* 无图模式（卡片扁平化设计）：左侧高亮彩条与更宽裕的内边距 */
.textile-card.no-thumb {
  border-left: 4px solid var(--accent-orange-border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.textile-card.no-thumb:hover {
  border-left-color: var(--accent-orange);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.textile-card.no-thumb .textile-card-body {
  padding: 18px 20px;
}

/* ────── POP 趋势网专用双列大文本卡片布局 ────── */

.textile-list.textile-two-cols-mode {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.textile-list.textile-two-cols-mode .textile-card.no-thumb {
  border-left-width: 5px;
}

.textile-list.textile-two-cols-mode .textile-card.no-thumb .textile-card-body {
  padding: 22px 26px;
}

.textile-list.textile-two-cols-mode .textile-card.no-thumb .textile-card-title {
  font-size: 1.05rem;
  margin-top: 6px;
  line-height: 1.5;
}

.textile-list.textile-two-cols-mode .textile-card.no-thumb .textile-card-summary {
  font-size: 0.86rem;
  line-height: 1.6;
  margin-top: 10px;
  color: var(--ink-secondary);
  max-height: none; /* 两列排版下完全不截断摘要，完整优雅地展露所爬取的长内容！ */
  display: block;
  overflow: visible;
}

/* 移动端两列适配回单列 */
@media (max-width: 800px) {
  .textile-list.textile-two-cols-mode {
    grid-template-columns: 1fr;
  }
}

.textile-card-body {
  padding: 14px 16px 16px;
}

.textile-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

/* ────── 来源标签 ────── */

.textile-card-source {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--trans-bg);
  color: var(--muted);
}

/* 按来源着色 (亮色默认 / 暗色覆写) */
.textile-card-source[data-source="POP家居趋势"] {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
}
html.dark .textile-card-source[data-source="POP家居趋势"],
html[data-theme="dark"] .textile-card-source[data-source="POP家居趋势"] {
  color: #fbbf24;
}

.textile-card-source[data-source="TrendHunter"] {
  background: rgba(236, 72, 153, 0.12);
  color: #be185d;
}
html.dark .textile-card-source[data-source="TrendHunter"],
html[data-theme="dark"] .textile-card-source[data-source="TrendHunter"] {
  color: #f472b6;
}

.textile-card-source[data-source="Pantone"] {
  background: rgba(99, 102, 241, 0.12);
  color: #4338ca;
}
html.dark .textile-card-source[data-source="Pantone"],
html[data-theme="dark"] .textile-card-source[data-source="Pantone"] {
  color: #a5b4fc;
}

.textile-card-source[data-source="The Met"] {
  background: rgba(168, 85, 247, 0.12);
  color: #7c3aed;
}
html.dark .textile-card-source[data-source="The Met"],
html[data-theme="dark"] .textile-card-source[data-source="The Met"] {
  color: #c084fc;
}

.textile-card-source[data-source="V&A Museum"] {
  background: rgba(45, 212, 191, 0.12);
  color: #0d9488;
}
html.dark .textile-card-source[data-source="V&A Museum"],
html[data-theme="dark"] .textile-card-source[data-source="V&A Museum"] {
  color: #2dd4bf;
}

.textile-card-source[data-source="Pinterest"] {
  background: rgba(224, 34, 40, 0.12);
  color: #dc2626;
}
html.dark .textile-card-source[data-source="Pinterest"],
html[data-theme="dark"] .textile-card-source[data-source="Pinterest"] {
  color: #f87171;
}

.textile-card-source[data-source="Pexels"] {
  background: rgba(5, 163, 128, 0.12);
  color: #047857;
}
html.dark .textile-card-source[data-source="Pexels"],
html[data-theme="dark"] .textile-card-source[data-source="Pexels"] {
  color: #14b8a6;
}

.textile-card-source[data-source="Unsplash"] {
  background: var(--trans-bg);
  color: var(--ink-secondary);
}

.textile-card-source[data-source="Bing Search"] {
  background: rgba(0, 120, 215, 0.12);
  color: #1d4ed8;
}
html.dark .textile-card-source[data-source="Bing Search"],
html[data-theme="dark"] .textile-card-source[data-source="Bing Search"] {
  color: #60a5fa;
}

/* 趋势博客来源 — 统一绿色调 */
.textile-card-source[data-source*="Dezeen"],
.textile-card-source[data-source*="Fibre2Fashion"],
.textile-card-source[data-source*="Design Milk"],
.textile-card-source[data-source*="Designboom"],
.textile-card-source[data-source*="BoF"],
.textile-card-source[data-source*="Trendstop"],
.textile-card-source[data-source*="Vogue"],
.textile-card-source[data-source*="ArchDaily"],
.textile-card-source[data-source*="Trendland"] {
  background: rgba(52, 211, 153, 0.12);
  color: #047857;
}
html.dark .textile-card-source[data-source*="Dezeen"],
html.dark .textile-card-source[data-source*="Fibre2Fashion"],
html.dark .textile-card-source[data-source*="Design Milk"],
html.dark .textile-card-source[data-source*="Designboom"],
html.dark .textile-card-source[data-source*="BoF"],
html.dark .textile-card-source[data-source*="Trendstop"],
html.dark .textile-card-source[data-source*="Vogue"],
html.dark .textile-card-source[data-source*="ArchDaily"],
html.dark .textile-card-source[data-source*="Trendland"],
html[data-theme="dark"] .textile-card-source[data-source*="Dezeen"],
html[data-theme="dark"] .textile-card-source[data-source*="Fibre2Fashion"],
html[data-theme="dark"] .textile-card-source[data-source*="Design Milk"],
html[data-theme="dark"] .textile-card-source[data-source*="Designboom"],
html[data-theme="dark"] .textile-card-source[data-source*="BoF"],
html[data-theme="dark"] .textile-card-source[data-source*="Trendstop"],
html[data-theme="dark"] .textile-card-source[data-source*="Vogue"],
html[data-theme="dark"] .textile-card-source[data-source*="ArchDaily"],
html[data-theme="dark"] .textile-card-source[data-source*="Trendland"] {
  color: #6ee7b7;
}

/* ────── 卡片其他元素 ────── */

.textile-card-category {
  font-size: 0.72rem;
  color: var(--muted);
}

.textile-card-pay-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(244, 63, 94, 0.1));
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #dc2626;
  letter-spacing: 0.02em;
  line-height: 1;
}

.textile-card-pay-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(244, 63, 94, 0.1));
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #dc2626;
  letter-spacing: 0.02em;
  line-height: 1;
}

html.dark .textile-card-pay-badge,
html[data-theme="dark"] .textile-card-pay-badge {
  color: #ff6584;
}

.textile-card-time {
  font-size: 0.72rem;
  color: var(--subtle);
  margin-left: auto;
}

.textile-card-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.45;
  margin: 0;
  display: block !important;
  -webkit-line-clamp: unset !important;
  line-clamp: unset !important;
  transition: color 0.2s;
}

.textile-card:hover .textile-card-title {
  color: var(--accent-orange);
}

.textile-card-title .title-sub {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 400;
}

.textile-card-summary {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 6px;
  display: block !important;
  -webkit-line-clamp: unset !important;
  line-clamp: unset !important;
  max-height: 4.5rem;
  overflow: hidden;
  position: relative;
  transition: max-height 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.textile-card:hover .textile-card-summary {
  max-height: 15rem;
}

/* ────── 空状态 ────── */

.textile-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.textile-empty-icon {
  font-size: 3rem;
  margin-bottom: 0.8rem;
  display: block;
}

/* ────── 加载状态 ────── */

.textile-loading {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}

.textile-loading::after {
  content: "";
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 2px solid var(--accent-orange-border);
  border-top-color: var(--accent-orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-left: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ────── 统计条 ────── */

.textile-stats {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.textile-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 18px;
  border-radius: 12px;
  background: var(--card-trans-bg);
  border: 1px solid var(--line);
  min-width: 80px;
}

.textile-stat .k {
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.textile-stat .v {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-orange);
}

/* ────── 响应式 ────── */

@media (max-width: 768px) {
  .main-tabs {
    width: 100%;
    justify-content: stretch;
  }

  .main-tab {
    flex: 1;
    text-align: center;
    padding: 10px 12px;
    font-size: 0.85rem;
  }

  .textile-list {
    grid-template-columns: 1fr;
  }

  .textile-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .textile-pills {
    gap: 6px;
  }

  .textile-pill {
    padding: 5px 10px;
    font-size: 0.78rem;
  }

  .textile-card-thumb {
    height: 140px;
  }

  .textile-stats {
    gap: 0.5rem;
  }

  .textile-stat {
    padding: 8px 12px;
    min-width: 60px;
  }

  .textile-sub-pills {
    margin-left: 0;
    padding-left: 8px;
  }
}

@media (max-width: 480px) {
  .textile-card-body {
    padding: 10px 12px 14px;
  }

  .textile-card-title {
    font-size: 0.87rem;
  }

  .textile-sub-pill {
    padding: 3px 8px;
    font-size: 0.72rem;
  }
}

/* ────── 灵感图库瀑布流画廊模式 ────── */

.textile-list.textile-gallery-mode {
  display: block !important;
  column-count: 3;
  column-gap: 16px;
}

.textile-list.textile-gallery-mode .textile-card {
  display: inline-block !important;
  width: 100%;
  margin-bottom: 16px;
  break-inside: avoid;
}

.textile-list.textile-gallery-mode .textile-card-thumb {
  height: auto !important;
  max-height: 420px;
  object-fit: cover !important;
  display: block;
  background: var(--trans-bg);
}

.textile-list.textile-gallery-mode .textile-card-body {
  padding: 12px 14px;
}

/* 移动端瀑布流适配 */
@media (max-width: 1024px) {
  .textile-list.textile-gallery-mode {
    column-count: 2;
  }
}

@media (max-width: 640px) {
  .textile-list.textile-gallery-mode {
    column-count: 1;
  }
}

/* ────── 分享按钮 (标题旁小型内联图标) ────── */

.textile-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.textile-share-btn:hover {
  border-color: var(--accent-orange-border);
  background: var(--accent-orange-bg);
  color: var(--accent-orange);
  transform: scale(1.05);
}

.textile-share-btn:active {
  transform: scale(0.95);
}
