:root {
  --hw-cds-badge-blue: #0071E3;
  --hw-cds-badge-black: #1D1D1F;
  --hw-cds-badge-gray: #8E8E93;
  --hw-cds-badge-red: #FF3B30;
  --hw-cds-badge-green: #34C759;
  --hw-cds-badge-purple: #AF52DE;
  --hw-cds-badge-orange: #FF9500;
  --hw-cds-badge-gold: #FFD700;

  --hw-cds-gradient-ai: linear-gradient(135deg, #9B59B6, #8E44AD);
  --hw-cds-gradient-typography: linear-gradient(135deg, #27AE60, #229954);
  --hw-cds-gradient-time: linear-gradient(135deg, #E67E22, #D35400);
  --hw-cds-gradient-data: linear-gradient(135deg, #3498DB, #2980B9);
  --hw-cds-gradient-other: linear-gradient(135deg, #95A5A6, #7F8C8D);

  --hw-cds-font-serif: "SimSun", "FangSong", "STSong", serif;

  --hw-cds-glow-gold: 0 0 8px rgba(255, 215, 0, 0.6);
  --hw-cds-glow-blue: 0 0 8px rgba(0, 113, 227, 0.6);

  --hw-cds-card-gap: 24px;
}

.cb-horizontal-card {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: var(--hw-cds-card-gap);
  padding: 16px 20px;
  background: var(--hw-bg-primary);
  border-radius: var(--hw-radius-md);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.2s ease;
}

.cb-horizontal-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.cb-tool-card {
  aspect-ratio: 1;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.cb-tool-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.cb-tool-card:active::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: scale(0);
  animation: cb-ripple 0.6s ease-out;
  pointer-events: none;
}

@keyframes cb-ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

.cb-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
  line-height: 1.4;
}

.cb-type-badge--blue { color: var(--hw-cds-badge-blue); background: rgba(0, 113, 227, 0.1); }
.cb-type-badge--black { color: var(--hw-cds-badge-black); background: rgba(29, 29, 31, 0.08); }
.cb-type-badge--gray { color: var(--hw-cds-badge-gray); background: rgba(142, 142, 147, 0.1); }
.cb-type-badge--red { color: var(--hw-cds-badge-red); background: rgba(255, 59, 48, 0.1); }
.cb-type-badge--green { color: var(--hw-cds-badge-green); background: rgba(52, 199, 89, 0.1); }
.cb-type-badge--purple { color: var(--hw-cds-badge-purple); background: rgba(175, 82, 222, 0.1); }
.cb-type-badge--orange { color: var(--hw-cds-badge-orange); background: rgba(255, 149, 0, 0.1); }
.cb-type-badge--gold { color: var(--hw-cds-badge-gold); background: rgba(255, 215, 0, 0.15); }

.cb-official-glow {
  box-shadow: var(--hw-cds-glow-gold);
  border: 1px solid rgba(255, 215, 0, 0.3);
}

.cb-official-glow--blue {
  box-shadow: var(--hw-cds-glow-blue);
  border: 1px solid rgba(0, 113, 227, 0.3);
}

.cb-pinned-content {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--hw-bg-primary);
  border-radius: var(--hw-radius-md);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  padding: 16px 20px;
  margin-bottom: var(--hw-cds-card-gap);
}

.cb-pinned-content__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--hw-text-secondary);
}

.policy-document-layout {
  font-family: var(--hw-cds-font-serif);
  text-indent: 2em;
  line-height: 1.8;
  font-size: 16px;
  color: var(--hw-text-primary);
}

.policy-document-layout h1,
.policy-document-layout h2,
.policy-document-layout h3 {
  text-indent: 0;
  font-weight: bold;
}

.policy-document-layout p {
  margin-bottom: 12px;
}

.article-narrow-layout {
  max-width: 720px;
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.8;
  color: var(--hw-text-primary);
  padding: 24px 16px;
}

.article-narrow-layout h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.3;
}

.article-narrow-layout h2 {
  font-size: 22px;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 12px;
}

.article-narrow-layout p {
  margin-bottom: 16px;
}

.topic-hero-banner {
  height: 240px;
  background-size: cover;
  background-position: center;
  position: relative;
  border-radius: var(--hw-radius-lg);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 24px;
}

.topic-hero-banner__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.5));
}

.topic-hero-banner__content {
  position: relative;
  z-index: 1;
  color: white;
}

.topic-hero-banner__name {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
}

.topic-hero-banner__followers {
  font-size: 14px;
  opacity: 0.9;
}

.topic-sticky-tabs {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  gap: 0;
  background: var(--hw-bg-primary);
  border-bottom: 1px solid var(--hw-bg-tertiary);
  padding: 0 16px;
}

.topic-sticky-tabs__tab {
  padding: 12px 16px;
  font-size: 14px;
  color: var(--hw-text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.topic-sticky-tabs__tab--active {
  color: var(--hw-accent);
  border-bottom-color: var(--hw-accent);
  font-weight: 500;
}

.charity-zone {
  padding: 24px 16px;
}

.charity-zone__project-card {
  border-radius: var(--hw-radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
  background: var(--hw-bg-primary);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.charity-zone__project-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.charity-zone__project-body {
  padding: 20px;
}

.charity-zone__project-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--hw-text-primary);
}

.charity-zone__project-description {
  font-size: 14px;
  color: var(--hw-text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}

.charity-zone__donate-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  border-radius: var(--hw-radius-sm);
  background: var(--hw-accent);
  color: white;
  font-size: 15px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}

.charity-zone__donate-button:hover {
  opacity: 0.9;
}

.cb-content-card--external-weakened {
  opacity: 0.75;
}

.cb-content-card--external-weakened .cb-content-card__title {
  color: var(--hw-text-tertiary);
}

.contribution-grid {
  display: grid;
  grid-template-columns: repeat(53, 1fr);
  gap: 2px;
  padding: 8px 0;
}

.contribution-grid__cell {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  background: var(--hw-bg-tertiary);
  cursor: pointer;
  transition: transform 0.1s;
}

.contribution-grid__cell:hover {
  transform: scale(1.3);
}

.contribution-grid__cell--level-1 { background: rgba(52, 199, 89, 0.25); }
.contribution-grid__cell--level-2 { background: rgba(52, 199, 89, 0.5); }
.contribution-grid__cell--level-3 { background: rgba(52, 199, 89, 0.75); }
.contribution-grid__cell--level-4 { background: var(--hw-cds-badge-green); }

.contribution-grid__empty-text {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--hw-text-tertiary);
  font-size: 13px;
  padding: 16px 0;
}

.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--hw-accent);
  z-index: 9999;
  transition: width 0.1s ease;
  width: 0%;
}

.tip-author-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: var(--hw-radius-md);
  background: var(--hw-accent);
  color: white;
  font-size: 16px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.tip-author-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 113, 227, 0.4);
}

.tool-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60vh;
  background: var(--hw-bg-primary);
  border-radius: var(--hw-radius-lg) var(--hw-radius-lg) 0 0;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
  transform: translateY(100%);
  transition: transform 200ms ease;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.tool-drawer--open {
  transform: translateY(0);
}

.tool-drawer__handle {
  width: 40px;
  height: 4px;
  background: var(--hw-bg-tertiary);
  border-radius: 2px;
  margin: 8px auto;
  cursor: grab;
}

.tool-drawer__header {
  padding: 12px 20px;
  border-bottom: 1px solid var(--hw-bg-tertiary);
}

.tool-drawer__title {
  font-size: 16px;
  font-weight: 600;
}

.tool-drawer__close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--hw-bg-secondary);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.canvas-thumbnail-card {
  border-radius: var(--hw-radius-md);
  overflow: hidden;
  background: var(--hw-bg-primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: box-shadow 0.2s;
}

.canvas-thumbnail-card:hover {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

.canvas-thumbnail-card__image {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
  background: var(--hw-bg-tertiary);
}

.canvas-thumbnail-card__placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--hw-bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--hw-text-tertiary);
  font-size: 14px;
}

.canvas-thumbnail-card__title {
  padding: 12px 16px 4px;
  font-size: 14px;
  font-weight: 500;
  color: var(--hw-text-primary);
}

.canvas-thumbnail-card__author {
  padding: 0 16px 12px;
  font-size: 12px;
  color: var(--hw-text-secondary);
}

.ad-card {
  position: relative;
  padding: 16px 20px;
  background: var(--hw-bg-secondary);
  border-radius: var(--hw-radius-md);
  border: 1px solid var(--hw-bg-tertiary);
}

.ad-card__label {
  display: inline-block;
  font-size: 11px;
  color: var(--hw-text-tertiary);
  background: var(--hw-bg-tertiary);
  padding: 1px 6px;
  border-radius: 3px;
  margin-bottom: 8px;
}

.ad-card__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--hw-text-tertiary);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.repo-detail-three-column {
  display: grid;
  grid-template-columns: 25% 50% 25%;
  gap: 16px;
  min-height: 60vh;
}

.repo-detail-three-column__file-tree {
  background: var(--hw-bg-primary);
  border-radius: var(--hw-radius-md);
  padding: 12px;
  overflow-y: auto;
  max-height: 80vh;
}

.repo-detail-three-column__content {
  background: var(--hw-bg-primary);
  border-radius: var(--hw-radius-md);
  padding: 20px 24px;
  overflow-y: auto;
  max-height: 80vh;
}

.repo-detail-three-column__meta {
  background: var(--hw-bg-primary);
  border-radius: var(--hw-radius-md);
  padding: 12px;
  overflow-y: auto;
  max-height: 80vh;
}

.repo-detail-three-column__meta-section {
  margin-bottom: 16px;
}

.repo-detail-three-column__meta-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--hw-text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.repo-detail-three-column__contributors {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.repo-detail-three-column__contributor-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.repo-detail-three-column__commit-item {
  font-size: 12px;
  padding: 4px 0;
  border-bottom: 1px solid var(--hw-bg-tertiary);
}

.repo-detail-three-column__commit-time {
  color: var(--hw-text-tertiary);
  font-size: 11px;
}

.paragraph-issue-marker {
  position: absolute;
  left: -24px;
  top: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--hw-accent);
  color: white;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  z-index: 5;
}

.paragraph-issue-marker--visible {
  display: flex;
}

.policy-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  color: white;
  margin-bottom: 12px;
}

.policy-tag--red {
  background: var(--hw-cds-badge-red);
}

.policy-tag--blue {
  background: var(--hw-cds-badge-blue);
}

.license-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.license-tag--green {
  background: rgba(52, 199, 89, 0.15);
  color: var(--hw-cds-badge-green);
}

.license-tag--yellow {
  background: rgba(255, 149, 0, 0.15);
  color: var(--hw-cds-badge-orange);
}

.license-tag--blue {
  background: rgba(0, 113, 227, 0.15);
  color: var(--hw-cds-badge-blue);
}