:root {
  --profile-bg: #0b0c0f;
  --profile-panel: #121319;
  --profile-muted: #9aa4b2;
  --profile-text: #e7ecf3;
  --profile-accent: #8ec5ff;
  --profile-chip: #1b1f2a;
  --profile-ring: rgba(142, 197, 255, 0.5);
  --profile-border: #202433;
  --profile-highlight: #79a64a;
}

@media (prefers-color-scheme: light) {
  :root {
    --profile-bg: #f7f9fc;
    --profile-panel: #ffffff;
    --profile-muted: #5b6372;
    --profile-text: #0f1222;
    --profile-accent: #0a66ff;
    --profile-chip: #eef4ff;
    --profile-ring: rgba(10, 102, 255, 0.25);
    --profile-border: #e8edf5;
    --profile-highlight: #5c8a31;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

.profile-home-shell {
  margin: 0;
  padding: 0;
  color: var(--profile-text);
  background: var(--profile-bg);
  font-family: Inter, "Noto Sans TC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow-x: hidden;
  min-width: 0;
}

@media (prefers-color-scheme: light) {
  .profile-home-shell {
    background-image:
      radial-gradient(38rem 38rem at 0% 0%, #eaf2ff 0, transparent 50%),
      radial-gradient(38rem 38rem at 100% 0%, #fff1f1 0, transparent 50%);
  }
}

.profile-home-shell a {
  color: var(--profile-accent);
  text-decoration: none;
}

.profile-home-shell a:hover {
  text-decoration: underline;
}

.profile-page {
  width: min(calc(100% - 40px), 780px);
  max-width: 780px;
  margin: 0 auto;
  padding: 0 0 28px;
}

.profile-hero {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 80px;
  align-items: center;
  padding: 30px 0 12px;
  margin-bottom: 6px;
}

.profile-avatar {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 28%;
  border: 0;
  box-shadow: 0 0 0 6px var(--profile-panel);
}

.profile-title {
  margin: 0 0 6px;
  color: var(--profile-text);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.1;
}

.profile-subtitle {
  margin: 6px 0;
  color: var(--profile-muted);
  font-size: 15px;
  line-height: 1.45;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 0;
}

.profile-chip,
.profile-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--profile-border);
  border-radius: 999px;
  background: var(--profile-chip);
  color: var(--profile-text);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.15;
  max-width: 100%;
}

.profile-button:hover,
.profile-chip:hover {
  box-shadow: 0 0 0 6px var(--profile-ring);
  text-decoration: none;
}

.profile-chip a,
.profile-button {
  color: var(--profile-text);
}

.profile-chip a {
  min-width: 0;
  overflow-wrap: anywhere;
}

.profile-section {
  margin: 48px 0 24px;
}

#about.profile-section {
  margin-top: 6px;
}

.profile-section h2 {
  margin: 0 0 16px;
  color: var(--profile-text);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0;
}

.profile-card,
.profile-item {
  border: 1px solid var(--profile-border);
  border-radius: 16px;
  background: var(--profile-panel);
  padding: 16px;
}

.profile-card p,
.profile-item p,
.profile-publication p {
  color: var(--profile-text);
  font-size: 16px;
  line-height: 1.7;
}

.profile-card p {
  margin: 0;
}

.profile-card p + p {
  margin-top: 12px;
}

.profile-highlight {
  color: var(--profile-highlight);
}

.profile-interest-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.profile-interest-list li {
  border: 1px solid var(--profile-border);
  border-radius: 999px;
  background: var(--profile-chip);
  color: var(--profile-text);
  padding: 8px 12px;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.profile-service-list {
  margin-top: 12px;
}

.profile-news-list,
.profile-compact-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.profile-news-list li {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 12px;
  border-left: 2px solid var(--profile-border);
}

.profile-news-list li + li {
  margin-top: 6px;
}

.profile-date {
  color: var(--profile-muted);
  font-size: 14px;
  font-weight: 600;
}

.profile-news-list li:first-child .profile-date,
.profile-news-list li:nth-child(2) .profile-date,
.profile-news-list li:first-child .profile-news-text,
.profile-news-list li:nth-child(2) .profile-news-text {
  color: var(--profile-highlight);
}

.profile-news-text,
.profile-item-text {
  color: var(--profile-text);
  line-height: 1.55;
}

.profile-publication {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--profile-border);
  border-radius: 16px;
  background: var(--profile-panel);
}

.profile-publication + .profile-publication,
.profile-item + .profile-item {
  margin-top: 16px;
}

.profile-pub-thumb,
.profile-pub-placeholder {
  width: 120px;
  height: 80px;
  border: 1px solid var(--profile-border);
  border-radius: 10px;
}

.profile-pub-thumb {
  display: block;
  background: #ffffff;
  object-fit: contain;
  padding: 4px;
}

.profile-pub-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--profile-chip);
  color: var(--profile-highlight);
  font-size: 22px;
}

.profile-pub-venue {
  margin: 0 0 6px;
  color: var(--profile-highlight);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.profile-publication h3,
.profile-item h3 {
  margin: 0 0 6px;
  color: var(--profile-text);
  font-size: 18px;
  line-height: 1.35;
}

.profile-authors,
.profile-meta {
  color: var(--profile-muted);
  font-size: 14px;
  line-height: 1.5;
}

.profile-authors strong {
  color: var(--profile-highlight);
  font-weight: 500;
}

.profile-publication p,
.profile-item p {
  margin: 10px 0 0;
}

.profile-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.profile-link-row a {
  display: inline-block;
  border: 1px solid var(--profile-border);
  border-radius: 10px;
  background: var(--profile-panel);
  color: var(--profile-text);
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
}

.profile-link-row a:hover {
  box-shadow: 0 0 0 6px var(--profile-ring);
  text-decoration: none;
}

.profile-grid {
  display: grid;
  gap: 16px;
}

.profile-compact-list li {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  padding: 9px 0;
}

.profile-compact-list li + li {
  border-top: 1px solid var(--profile-border);
}

.profile-footer {
  margin: 48px 0 24px;
  color: var(--profile-muted);
  text-align: center;
  font-size: 14px;
}

@media (max-width: 820px) {
  .profile-page {
    width: min(calc(100% - 28px), 780px);
  }

  .profile-hero {
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 18px;
    padding-top: 24px;
  }

  .profile-avatar {
    width: 110px;
    height: 110px;
  }

  .profile-title {
    font-size: 32px;
  }

  .profile-section {
    margin: 40px 0 22px;
  }

  .profile-news-list li {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 10px;
    padding: 10px 0;
    border-left: 0;
  }

  .profile-publication,
  .profile-compact-list li {
    grid-template-columns: 1fr;
  }

  .profile-publication,
  .profile-card,
  .profile-item {
    border-radius: 12px;
    padding: 14px;
  }

  .profile-pub-thumb,
  .profile-pub-placeholder {
    width: 100%;
    height: auto;
    min-height: 64px;
  }

  .profile-pub-thumb {
    aspect-ratio: 16 / 9;
    max-height: 170px;
  }
}

@media (max-width: 640px) {
  .profile-page {
    width: min(calc(100% - 24px), 780px);
    padding-bottom: 22px;
  }

  .profile-hero {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding-top: 20px;
  }

  .profile-avatar {
    width: 104px;
    height: 104px;
    box-shadow: 0 0 0 4px var(--profile-panel);
  }

  .profile-title {
    font-size: 30px;
    line-height: 1.12;
  }

  .profile-subtitle {
    font-size: 14px;
  }

  .profile-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
  }

  .profile-chip {
    grid-column: 1 / -1;
    justify-content: center;
    width: 100%;
  }

  .profile-button {
    justify-content: center;
    padding: 10px;
    min-width: 0;
  }

  .profile-section {
    margin: 34px 0 18px;
  }

  .profile-section h2 {
    margin-bottom: 12px;
    font-size: 20px;
  }

  .profile-card p,
  .profile-item p,
  .profile-publication p {
    font-size: 15px;
    line-height: 1.65;
  }

  .profile-publication h3,
  .profile-item h3 {
    font-size: 17px;
  }

  .profile-interest-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .profile-interest-list li {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 7px 10px;
    text-align: center;
    font-size: 13px;
    line-height: 1.25;
  }

  .profile-news-list li {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .profile-date,
  .profile-authors,
  .profile-meta {
    font-size: 13px;
  }

  .profile-link-row a {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 380px) {
  .profile-page {
    width: min(calc(100% - 18px), 780px);
  }

  .profile-title {
    font-size: 28px;
  }

  .profile-actions,
  .profile-interest-list {
    grid-template-columns: 1fr;
  }

  .profile-chip,
  .profile-button {
    justify-content: flex-start;
  }
}
