/**
 * author_card - 作者名片 + 订阅
 * 竖排结构，专为 30% 窄栏设计
 */

.author-card {
  margin-bottom: 14px;
  border-radius: var(--border-radius);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.author-card--plain {
  background: transparent;
  box-shadow: none;
}

/* ---------- 名片主体 ---------- */

.author-card__profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 16px 16px;
  min-width: 0;
}

.author-card__avatar {
  position: relative;
  width: 64px;
  height: 64px;
  margin-bottom: 10px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-logo-placeholder, var(--bg-hover));
}

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

.author-card__avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 26px;
  font-weight: 600;
  color: var(--theme-color);
}

.author-card__name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.author-card__desc {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-muted);
  word-break: break-word;
}

/* 小数字 */
.author-card__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-primary);
}

.author-card__stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 0;
}

.author-card__stat-value {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--theme-color);
  font-variant-numeric: tabular-nums;
}

.author-card__stat-label {
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* ---------- 订阅区 ---------- */

.author-card__subscribe {
  padding: 14px 16px 18px;
  border-top: 1px dashed var(--border-primary);
}

.author-card__sub-title {
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  text-align: center;
}

.author-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.author-card__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
  padding: 7px 12px;
  border: 1px solid var(--border-primary);
  border-radius: var(--border-radius-sm);
  background: var(--bg-secondary);
  color: var(--text-content);
  font-size: 12px;
  line-height: 1.5;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.author-card__action:hover {
  border-color: var(--theme-color);
  color: var(--theme-color);
  background: var(--bg-hover);
}

.author-card__action--primary {
  background: var(--theme-color);
  border-color: var(--theme-color);
  color: #fff;
}

.author-card__action--primary:hover {
  background: var(--color-link-hover, var(--theme-color));
  border-color: var(--color-link-hover, var(--theme-color));
  color: #fff;
}

.author-card__action--primary svg {
  transition: transform 0.25s ease;
}

.author-card__action--primary:hover svg {
  transform: translateX(3px);
}

/* 二维码 */
.author-card__qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
}

.author-card__qr img {
  display: block;
  width: 104px;
  height: 104px;
  object-fit: cover;
  border: 1px solid var(--border-primary);
  border-radius: var(--border-radius-sm);
  background: #fff;
  padding: 4px;
}

.author-card__qr-text {
  font-size: 11px;
  color: var(--text-muted);
}

/* ---------- 渐变样式 ---------- */

.author-card--gradient {
  background: linear-gradient(150deg, var(--theme-color) 0%, var(--theme-color) 100%);
  background: linear-gradient(150deg, var(--theme-color) 0%, color-mix(in srgb, var(--theme-color) 62%, #000) 100%);
}

.author-card--gradient .author-card__name {
  color: #fff;
}

.author-card--gradient .author-card__desc {
  color: rgba(255, 255, 255, 0.8);
}

.author-card--gradient .author-card__avatar {
  background: rgba(255, 255, 255, 0.22);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.28);
}

.author-card--gradient .author-card__avatar-fallback {
  color: #fff;
}

.author-card--gradient .author-card__stats {
  border-top-color: rgba(255, 255, 255, 0.22);
}

.author-card--gradient .author-card__stat-value {
  color: #fff;
}

.author-card--gradient .author-card__stat-label {
  color: rgba(255, 255, 255, 0.78);
}

.author-card--gradient .author-card__subscribe {
  border-top-color: rgba(255, 255, 255, 0.22);
}

.author-card--gradient .author-card__sub-title {
  color: rgba(255, 255, 255, 0.82);
}

.author-card--gradient .author-card__action {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.24);
  color: #fff;
}

.author-card--gradient .author-card__action:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.42);
  color: #fff;
}

.author-card--gradient .author-card__action--primary {
  background: #fff;
  border-color: #fff;
  color: var(--theme-color);
}

.author-card--gradient .author-card__action--primary:hover {
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(255, 255, 255, 0.86);
  color: var(--theme-color);
}

.author-card--gradient .author-card__qr-text {
  color: rgba(255, 255, 255, 0.78);
}

/* ---------- 窄容器 ---------- */

@container (max-width: 240px) {
  .author-card__profile {
    padding: 16px 12px 14px;
  }

  .author-card__subscribe {
    padding: 12px 12px 16px;
  }

  .author-card__action {
    flex: 1 1 100%;
  }

  .author-card__qr img {
    width: 88px;
    height: 88px;
  }
}

@media (max-width: 768px) {
  .author-card__profile {
    padding: 16px 14px 14px;
  }
}
