/* 继承全局样式变量 */
:root {
  /* 定义新的设计系统 */
  --card-radius: 12px;
  --card-bg-hover: rgba(46, 134, 222, 0.05);
  --section-gap: 3rem;
  --title-primary: #1a1f36;
  --title-secondary: #3c4257;
  --badge-bg-soft: rgba(0,0,0,0.05);
  --badge-border: transparent;
  --transition-speed: 0.2s;
  
  /* 深色模式适配 */
  --dark-bg-card: #222222;
  --dark-border: #333333;
}

[data-theme="dark"] {
  --title-primary: #e8e8e8;
  --title-secondary: #aaaaaa;
  --badge-bg-soft: rgba(255,255,255,0.08);
  --dark-bg-card: #222222;
}

/* 页面整体布局优化 */
.modern-layout {
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
  padding: 2rem 0;
}

.modern-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.modern-header-main h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--title-primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.modern-header-sub {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
}

/* 卡片网格系统 */
.modern-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* 现代化卡片设计 */
.modern-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: 1.5rem;
  transition: all var(--transition-speed) ease;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  height: 100%;
}

.modern-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.1);
  border-color: var(--accent);
}

[data-theme="dark"] .modern-card:hover {
  background: var(--dark-bg-card);
  border-color: var(--accent);
  box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.4);
}


/* 卡片头部布局 */
.modern-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.modern-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--title-primary);
  text-decoration: none;
  line-height: 1.4;
  flex: 1;
  padding-right: 1rem; /* 防止遮挡右侧操作 */
}
.modern-card-title:hover {
  color: var(--accent);
}

/* 状态徽章 */
.stat-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  border: 1px solid var(--badge-border);
}

.stat-badge.fire {
  background: rgba(231, 76, 60, 0.08);
  color: #e74c3c;
  border-color: rgba(231, 76, 60, 0.15);
}

.stat-badge.star {
  background: rgba(243, 156, 18, 0.08);
  color: #f39c12;
  border-color: rgba(243, 156, 18, 0.15);
}

.stat-badge.lang {
  background: var(--badge-bg-soft);
  color: var(--text-muted);
}

/* 统计行布局 */
.modern-stat-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

/* 描述文字优化 */
.modern-card-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: auto; /* 将底部内容推到底 */
  padding-bottom: 1.2rem;
  /* 多行省略 */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 底部元信息 */
.modern-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-source {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.footer-time {
  font-family: "JetBrains Mono", monospace;
  opacity: 0.8;
}

/* 语言点指示器 */
.lang-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent);
  margin-right: 6px;
}

/* README 摘要折叠样式优化 */
.modern-readme-summary {
  margin-top: 0.5rem;
  padding: 0.8rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.modern-readme-summary summary {
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  list-style: none; /* 隐藏默认三角 */
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.modern-readme-summary summary::-webkit-details-marker {
  display: none;
}
.modern-readme-summary summary::after {
  content: "Show"; /* 默认提示 */
  font-size: 0.75rem;
  opacity: 0.7;
  margin-left: auto;
}
.modern-readme-summary[open] summary::after {
  content: "Hide";
}

/* 趋势页面特有样式 */
.trend-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.trend-section-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--title-primary);
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

/* 强调区块样式 */
.highlight-block {
  background: linear-gradient(135deg, rgba(46, 134, 222, 0.03) 0%, rgba(40, 200, 160, 0.03) 100%);
  border: 1px solid rgba(46, 134, 222, 0.2);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 3rem;
  box-shadow: 0 8px 32px rgba(46, 134, 222, 0.05);
}
.highlight-block .trend-section-title {
  color: var(--accent);
}

/* Skills 页：去蓝化，与全站中性风格一致 */
.skills-page .highlight-block.skills-section,
.skills-page .highlight-block {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px var(--shadow);
}
.skills-page .highlight-block .trend-section-title {
  color: var(--title-primary);
}
.skills-page .modern-card:hover {
  border-color: var(--border);
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.12);
}
.skills-page .modern-card-title:hover {
  color: var(--text);
}
.skills-page .lang-dot {
  background-color: var(--text-muted);
}
.skills-page .modern-readme-summary summary {
  color: var(--text);
}
.skills-page .section-meta {
  color: var(--text-muted);
}

/* 骨架屏加载动画 */
.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--card-bg) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 4px;
}
@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* 响应式调整 */
@media (max-width: 768px) {
  .modern-grid {
    grid-template-columns: 1fr; /* 移动端单列 */
  }
  .modern-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .modern-card {
    padding: 1.25rem;
  }
}

/* -----------------------------
   Product Master（AI 产品大师）
------------------------------ */
.product-master-page .pm-panel {
  padding: 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 2px var(--shadow);
}

.product-master-page .pm-status-ok { color: var(--text-muted); }
.product-master-page .pm-status-warn { color: #f39c12; }
.product-master-page .pm-status-bad { color: #e74c3c; }

.product-master-page .ai-summary-box {
  border-radius: 12px;
}

.pm-right-sub {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.8rem;
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
}

.pm-right-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.pm-right-block {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
}

.pm-right-title {
  font-weight: 800;
  color: var(--text);
  font-size: 0.92rem;
  margin-bottom: 0.6rem;
}

.pm-right-kv {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 0.6rem;
  margin-bottom: 0.45rem;
  align-items: start;
}

.pm-right-k {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.82rem;
}

.pm-right-v {
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.55;
  word-break: break-word;
}

.pm-right-warn {
  margin: 0.5rem 0 0.8rem;
  padding: 0.65rem 0.75rem;
  background: var(--highlight);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.pm-right-details {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-bg);
  padding: 0.6rem 0.75rem;
  margin-top: 0.6rem;
}
.pm-right-details summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}
.pm-right-details summary::-webkit-details-marker { display: none; }
.pm-right-details summary::after {
  content: "展开";
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.78rem;
}
.pm-right-details[open] summary::after { content: "收起"; }
.pm-right-details-body { margin-top: 0.7rem; }

.pm-right-item { padding: 0.65rem 0; border-top: 1px dashed var(--border); }
.pm-right-item:first-child { border-top: none; padding-top: 0; }
.pm-right-item-title { font-weight: 800; font-size: 0.88rem; color: var(--text); }
.pm-right-item-title a { color: var(--accent); text-decoration: none; }
.pm-right-item-title a:hover { text-decoration: underline; }
.pm-right-item-meta { margin-top: 0.35rem; }
.pm-right-item-desc { margin-top: 0.35rem; color: var(--text-muted); font-size: 0.85rem; line-height: 1.55; }

.pm-right-pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  padding: 0.75rem;
  border-radius: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--text);
}

.pm-right-conclusion-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
}
.pm-right-score {
  font-family: "JetBrains Mono", monospace;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.9rem;
}
.pm-right-conclusion-text {
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.6;
}
.pm-right-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.7rem;
}

.pm-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
.pm-field { display: flex; flex-direction: column; gap: 0.5rem; }
.pm-field-full { grid-column: 1 / -1; }

.pm-label {
  font-weight: 700;
  color: var(--title-primary);
  font-size: 0.95rem;
}
.pm-help {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.pm-input, .pm-textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  outline: none;
  transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}
.pm-textarea { resize: vertical; min-height: 120px; }
.pm-input:focus, .pm-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(46, 134, 222, 0.12);
}

.pm-actions {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  margin-top: 1.2rem;
  flex-wrap: wrap;
}

.pm-sections { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 2.2rem; }
.pm-section { }
.pm-h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--title-primary);
  margin: 0 0 1rem 0;
}

.pm-card-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--title-primary);
}

.pm-score {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  margin: 0.8rem 0 0.4rem 0;
}
.pm-score-num {
  font-size: 2.3rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--title-primary);
}
.pm-score-sub { color: var(--text-muted); font-weight: 700; }

.pm-mini {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}
.pm-mini-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--title-secondary);
  margin-bottom: 0.4rem;
}
.pm-bullets {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 0.9rem;
}
.pm-muted { color: var(--text-muted); font-size: 0.9rem; }
.pm-line { margin-top: 0.5rem; color: var(--text); }

.pm-stack-row { display: grid; grid-template-columns: 60px 1fr; gap: 0.8rem; margin: 0.5rem 0; }
.pm-stack-k { color: var(--text-muted); font-weight: 800; font-size: 0.85rem; }
.pm-stack-v { display: flex; flex-wrap: wrap; gap: 0.45rem; }

.pm-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--title-secondary);
}
.pm-chip-soft {
  background: rgba(46, 134, 222, 0.06);
  border-color: rgba(46, 134, 222, 0.18);
  color: var(--accent);
}
.pm-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.6rem; }

.pm-list { display: flex; flex-direction: column; gap: 0.9rem; }
.pm-q {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
}
.pm-q-title { font-weight: 900; color: var(--title-primary); margin-bottom: 0.35rem; }
.pm-q-why { color: var(--text-muted); line-height: 1.6; margin-bottom: 0.8rem; }
.pm-q-btn { padding: 0.45rem 0.8rem; }

.pm-skill {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
}
.pm-skill summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 900;
  color: var(--title-primary);
}
.pm-skill summary::-webkit-details-marker { display: none; }
.pm-skill-body { margin-top: 0.8rem; color: var(--text-muted); line-height: 1.6; }
.pm-skill-excerpt {
  margin-top: 0.7rem;
  padding: 0.9rem;
  border-radius: 12px;
  background: var(--bg-secondary);
  border: 1px dashed var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
}

@media (max-width: 960px) {
  .pm-mini { grid-template-columns: 1fr; }
}
