/* =====================================================
   Ran Wei — extra.css for Material for MkDocs
   ===================================================== */

/* ---- Hero Layout ---- */
.rw-hero {
  display: flex;
  align-items: flex-start;
  gap: 3rem;
  padding: 2rem 0 1.5rem;
}

.rw-hero-text {
  flex: 1;
}

.rw-hero-photo img {
  width: 200px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  display: block;
}

.rw-name {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 0.3rem;
  border-bottom: none !important;
}

.rw-name-chinese {
  font-size: 1.4rem;
  font-weight: 400;
  opacity: 0.6;
  margin-left: 0.5rem;
}

.rw-subtitle {
  font-size: 0.95rem;
  line-height: 1.75;
  margin-bottom: 1rem;
}

/* ---- Nav pill groups ---- */
.rw-nav-groups {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1rem;
}

.rw-nav-group {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.rw-nav-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.5;
  min-width: 5rem;
  flex-shrink: 0;
}

.rw-nav-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.rw-nav-pills a {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  background: var(--md-primary-fg-color--light);
  color: var(--md-primary-fg-color);
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  opacity: 0.85;
}

[data-md-color-scheme="default"] .rw-nav-pills a {
  background: rgba(37, 99, 235, 0.1);
  color: var(--md-primary-fg-color);
}

[data-md-color-scheme="slate"] .rw-nav-pills a {
  background: rgba(144, 202, 249, 0.15);
  color: var(--md-primary-fg-color);
}

.rw-nav-pills a:hover {
  background: var(--md-primary-fg-color);
  color: var(--md-primary-bg-color);
  transform: translateY(-1px);
  opacity: 1;
}

/* ---- News items ---- */
.rw-news-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.rw-news-item {
  padding: 0.6rem 0.85rem;
  font-size: 0.9rem;
  line-height: 1.65;
  border-radius: 6px;
  transition: background 0.15s;
}

.rw-news-item:hover {
  background: var(--md-code-bg-color);
}

.rw-news-date {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0.55;
  min-width: 3.5rem;
  margin-right: 0.5rem;
  font-variant-numeric: tabular-nums;
}

.rw-paper-title {
  font-weight: 500;
  color: var(--md-primary-fg-color);
}

.rw-paper-title a {
  color: inherit;
}

/* ---- Career timeline list ---- */
ul.rw-career-list {
  list-style: none;
  padding: 0;
  position: relative;
  margin-left: 0;
}

ul.rw-career-list::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 2px;
  background: var(--md-default-fg-color--lighter);
}

ul.rw-career-list li {
  position: relative;
  padding: 0.6rem 0 0.6rem 2rem;
  font-size: 0.93rem;
}

ul.rw-career-list li::before {
  content: '';
  position: absolute;
  left: 1px;
  top: 1.05rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--md-default-bg-color);
  border: 2px solid var(--md-primary-fg-color);
  z-index: 1;
}

/* ---- Person cards ---- */
.rw-person-card {
  display: flex;
  gap: 2rem;
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--md-default-fg-color--lightest);
  margin-bottom: 1rem;
  transition: all 0.25s ease;
}

.rw-person-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.rw-person-card img {
  width: 110px;
  height: 110px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.rw-person-info {
  flex: 1;
  min-width: 0;
}

.rw-person-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.rw-person-name a {
  color: var(--md-primary-fg-color);
  text-decoration: none;
}

.rw-person-name a:hover {
  text-decoration: underline;
}

.rw-person-info p {
  font-size: 0.88rem;
  line-height: 1.7;
  margin-top: 0.4rem;
  margin-bottom: 0.4rem;
}

/* ---- Publications ---- */
ul.rw-pub-list {
  list-style: none;
  padding: 0;
  margin-left: 0;
}

ul.rw-pub-list li {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
  font-size: 0.9rem;
  line-height: 1.7;
}

ul.rw-pub-list li:last-child {
  border-bottom: none;
}

.rw-pub-note {
  display: inline-block;
  font-style: italic;
  font-size: 0.82rem;
  margin-top: 0.3rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  background: var(--md-code-bg-color);
}

/* ---- Visitor counter ---- */
.rw-visitor-counter {
  text-align: center;
  padding: 2rem 0 1rem;
  opacity: 0.5;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .rw-hero {
    flex-direction: column-reverse;
    text-align: center;
    gap: 1.5rem;
  }

  .rw-hero-photo img {
    width: 160px;
    margin: 0 auto;
  }

  .rw-nav-group {
    flex-direction: column;
    align-items: center;
  }

  .rw-nav-label {
    min-width: auto;
  }

  .rw-nav-pills {
    justify-content: center;
  }

  .rw-person-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}
