/* ==========================================================================
   Academic Personal Webpage Stylesheet
   Design: Classic Minimalist Academic / University Faculty Style
   ========================================================================== */

:root {
  --bg-color: #ffffff;
  --text-color: #222222;
  --text-muted: #555555;
  --border-color: #e0e0e0;
  --link-color: #125699;
  --link-hover: #083361;
  --code-bg: #f6f8fa;
  --code-border: #d0d7de;
  --tag-bg: #f1f3f5;
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-serif: "Charter", "Georgia", "Cambria", serif;
  --font-mono: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --text-muted: #a0a0a0;
    --border-color: #2e2e2e;
    --link-color: #58a6ff;
    --link-hover: #79c0ff;
    --code-bg: #1e1e1e;
    --code-border: #333333;
    --tag-bg: #222222;
  }
}

:root[data-theme="dark"] {
  --bg-color: #121212;
  --text-color: #e0e0e0;
  --text-muted: #a0a0a0;
  --border-color: #2e2e2e;
  --link-color: #58a6ff;
  --link-hover: #79c0ff;
  --code-bg: #1e1e1e;
  --code-border: #333333;
  --tag-bg: #222222;
}

:root[data-theme="light"] {
  --bg-color: #ffffff;
  --text-color: #222222;
  --text-muted: #555555;
  --border-color: #e0e0e0;
  --link-color: #125699;
  --link-hover: #083361;
  --code-bg: #f6f8fa;
  --code-border: #d0d7de;
  --tag-bg: #f1f3f5;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  color: var(--text-color);
  background-color: var(--bg-color);
  line-height: 1.6;
  font-size: 15.5px;
  -webkit-font-smoothing: antialiased;
  padding: 40px 20px 80px 20px;
}

.container {
  max-width: 820px;
  margin: 0 auto;
}

/* Header & Profile */
.profile-section {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  margin-bottom: 35px;
}

.profile-text {
  flex: 1;
}

.profile-name {
  font-size: 1.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-color);
  margin-bottom: 4px;
}

.profile-title {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.profile-affiliations {
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 14px;
}

.profile-links {
  font-size: 0.92rem;
  line-height: 1.8;
}

.profile-links a {
  color: var(--link-color);
  text-decoration: none;
}

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

.profile-links .separator {
  color: var(--border-color);
  margin: 0 6px;
}

.profile-photo {
  width: 155px;
  height: 155px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

/* Typography & Links */
h2 {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-color);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 5px;
  margin-top: 38px;
  margin-bottom: 16px;
}

h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 4px;
}

p {
  margin-bottom: 14px;
}

a {
  color: var(--link-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Navigation Jump Links */
.nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
  margin-bottom: 25px;
  font-size: 0.92rem;
}

.nav-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--link-color);
  text-decoration: underline;
}

.theme-toggle-link {
  font-size: 0.85rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  font-family: inherit;
}

.theme-toggle-link:hover {
  color: var(--link-color);
}

/* News Section */
.news-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin-bottom: 14px;
}

.news-table td {
  padding: 6px 0;
  vertical-align: top;
}

.news-date {
  width: 95px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.news-text {
  color: var(--text-color);
}

/* Publications */
.publication-item {
  margin-bottom: 22px;
}

.pub-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-color);
  margin-bottom: 2px;
  line-height: 1.4;
}

.pub-authors {
  font-size: 0.92rem;
  color: var(--text-color);
  margin-bottom: 2px;
}

.pub-author-self {
  font-weight: 700;
}

.pub-venue {
  font-size: 0.9rem;
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.pub-links {
  font-size: 0.88rem;
}

.pub-links a,
.pub-links button {
  color: var(--link-color);
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
}

.pub-links a:hover,
.pub-links button:hover {
  text-decoration: underline;
}

.pub-details-block {
  display: none;
  margin-top: 8px;
  padding: 10px 14px;
  background-color: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 4px;
  font-size: 0.86rem;
  line-height: 1.5;
}

.pub-details-block.open {
  display: block;
}

.pub-details-block pre {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
}

.copy-inline-btn {
  font-size: 0.78rem;
  margin-bottom: 6px;
  display: inline-block;
  cursor: pointer;
  color: var(--link-color);
  text-decoration: underline;
}

/* Systems & Software */
.system-item {
  margin-bottom: 18px;
}

.system-header {
  font-weight: 600;
  font-size: 0.98rem;
  margin-bottom: 2px;
}

.system-desc {
  font-size: 0.92rem;
  color: var(--text-color);
  margin-bottom: 4px;
}

.system-bullets {
  margin-left: 20px;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.system-bullets li {
  margin-bottom: 2px;
}

/* Experience & Education */
.experience-item,
.education-item {
  margin-bottom: 18px;
}

.item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.98rem;
}

.item-title {
  font-weight: 600;
  color: var(--text-color);
}

.item-date {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.item-sub {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.item-bullets {
  margin-left: 20px;
  font-size: 0.9rem;
  color: var(--text-color);
  line-height: 1.5;
}

.item-bullets li {
  margin-bottom: 3px;
}

/* Awards */
.awards-list {
  margin-left: 20px;
  font-size: 0.92rem;
  line-height: 1.6;
}

.awards-list li {
  margin-bottom: 6px;
}

/* References */
.ref-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  margin-top: 10px;
}

.ref-box {
  font-size: 0.92rem;
  line-height: 1.5;
}

.ref-name {
  font-weight: 600;
  color: var(--text-color);
}

.ref-role {
  color: var(--text-muted);
}

/* Footer */
footer {
  margin-top: 55px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* Responsive */
@media (max-width: 640px) {
  body {
    padding: 20px 16px 60px 16px;
  }

  .profile-section {
    flex-direction: column-reverse;
    align-items: center;
    text-align: center;
  }

  .profile-photo {
    width: 140px;
    height: 140px;
  }

  .ref-grid {
    grid-template-columns: 1fr;
  }

  .item-header {
    flex-direction: column;
  }
}
