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

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f8f8f8;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 20px 0 20px;
}

.container-footer {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0px 20px 0 20px;
}

.header {
  background: white;
  padding: 60px 50px;
  margin-bottom: 40px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 40px;
  align-items: center;
}

.header-text h1 {
  font-size: 2.5rem;
  font-weight: 300;
  margin-bottom: 10px;
  color: #2c2c2c;
  display: inline-block;
  line-height: 1.2;
}

.header-text h1 span {
  font-size: 0.6em;
  font-weight: normal;
  display: block;
  margin-top: 2px;
}

.header-text .subtitle {
  font-size: 1.1rem;
  color: #666;
  margin-bottom: 20px;
  font-weight: 300;
}

.location {
  color: #999;
  font-size: 1rem;
  margin-bottom: 15px;
  font-weight: 300;
}

.contact-info {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.contact-info a {
  color: #666;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.contact-info a:hover {
  color: #333;
}

.email-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.copy-email-btn {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 2px 4px;
  border-radius: 3px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
}

.copy-email-btn:hover {
  background: #f0f0f0;
}

.copy-email-btn.copied {
  color: #666;
  transform: scale(1.1);
}

.copy-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #333;
  color: white;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 0.9rem;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
}

.copy-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.social-links {
  display: flex;
  gap: 12px;
  margin-top: 15px;
  justify-content: flex-start;
}

.social-icon {
  width: 24px;
  height: 24px;
  background: #f0f0f0;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 12px;
  color: #666;
  transition: all 0.3s ease;
  font-weight: 500;
}

.social-icon:hover {
  background: #e0e0e0;
  border-color: #ccc;
  color: #333;
  transform: translateY(-1px);
}

.social-icon.github:hover {
  background: #333;
  border-color: #333;
  color: white;
}

.social-icon.linkedin:hover {
  background: #0077b5;
  border-color: #0077b5;
  color: white;
}

.social-icon.threads:hover {
  background: #000;
  border-color: #000;
  color: white;
}

.photo-container {
  width: 200px;
  height: 200px;
  background: #e8e8e8;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 0.9rem;
  text-align: center;
  line-height: 1.4;
  overflow: hidden; /* 防止圖片溢出容器 */
}

/* 新增：控制圖片大小的關鍵 CSS */
.photo-container img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* 保持比例並填滿容器 */
  border-radius: 16px; /* 與容器相同的圓角 */
}

.section {
  background: white;
  padding: 40px 50px;
  margin-bottom: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.section h2 {
  font-size: 1.5rem;
  font-weight: 300;
  margin-bottom: 30px;
  color: #2c2c2c;
  border-bottom: 1px solid #eee;
  padding-bottom: 15px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.skill-category h3 {
  font-size: 1.1rem;
  font-weight: 400;
  margin-bottom: 15px;
  color: #444;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tag {
  background: #f0f0f0;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  color: #666;
  border: 1px solid #e0e0e0;
  transition: all 0.3s ease;
  cursor: default;
}

.skill-tag:hover {
  background: #e0e0e0;
  border-color: #ccc;
  color: #333;
  transform: translateY(-1px);
}

.project {
  margin-bottom: 35px;
  padding-bottom: 30px;
  border-bottom: 1px solid #f0f0f0;
}

.project:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.project h3 {
  font-size: 1.2rem;
  font-weight: 400;
  margin-bottom: 8px;
  color: #333;
}

.project-meta {
  font-size: 0.9rem;
  color: #888;
  margin-bottom: 15px;
}

.project-description {
  color: #555;
  margin-bottom: 15px;
  line-height: 1.7;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tech-tag {
  background: #e8e8e8;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  color: #555;
  transition: all 0.3s ease;
  cursor: default;
}

.tech-tag:hover {
  background: #d0d0d0;
  color: #333;
  transform: translateY(-1px);
}

/* 在現有 CSS 中新增這些樣式 */
.experience-item {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.experience-main p {
  color: #555;
  line-height: 1.7;
  margin-bottom: 15px;
}

.experience-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: #666;
}

.status-indicator {
  font-size: 0.8rem;
}

.contact-cta {
  display: inline-block;
  background: #333;
  color: white;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  align-self: flex-start;
}

.contact-cta:hover {
  background: #555;
  transform: translateY(-1px);
}

.education-item {
  margin-bottom: 25px;
}

.education-item:last-child {
  margin-bottom: 0;
}

.education-item h3 {
  font-size: 1.1rem;
  font-weight: 400;
  color: #333;
  margin-bottom: 5px;
}

.education-meta {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 8px;
}

.education-note {
  font-size: 0.9rem;
  color: #777;
}

/* 多媒體按鈕樣式 */
.media-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  margin-bottom: 10px;
}

.media-btn {
  all: unset;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  color: #666;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  height: 32px; /* 固定高度 */
  box-sizing: border-box;
}

.media-btn:hover {
  background: #e8e8e8;
  border-color: #ccc;
  color: #333;
  transform: translateY(-1px);
}

.media-btn i {
  font-size: 0.75rem;
}

/* 彈出視窗樣式 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: white;
  border-radius: 8px;
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  position: relative;
  transform: scale(0.8) translateY(20px);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.modal-overlay.show .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  border-bottom: 1px solid #eee;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 400;
  color: #333;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #666;
  cursor: pointer;
  padding: 5px;
  border-radius: 4px;
}

.modal-close:hover {
  background: #f5f5f5;
  color: #333;
}

.modal-content {
  padding: 25px;
  overflow-y: auto;
  flex: 1;
}

.modal-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.modal-content video {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

/* Markdown 內容樣式 */
.markdown-content {
  line-height: 1.6;
}

/* 為段落添加間距，模擬 Markdown 空行 */
.markdown-content p {
  margin: 1em 0; /* 段落之間的垂直間距 */
}

/* 確保 <br> 換行顯示正確 */
.markdown-content br {
  display: block;
  content: "";
  margin-bottom: 1em; /* 為單行換行添加間距 */
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3 {
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  color: #333;
}

.markdown-content h1 {
  font-size: 1.5rem;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

.markdown-content code {
  background: #f5f5f5;
  padding: 2px 4px;
  border-radius: 3px;
  font-family: "Courier New", monospace;
  font-size: 0.9em;
}

.markdown-content pre {
  background: #f5f5f5;
  padding: 15px;
  border-radius: 4px;
  overflow-x: auto;
  margin: 1em 0;
}

/* 在你的 .markdown-content 區塊中添加以下樣式 */

.markdown-content ul {
  margin: 1em 0;
  padding-left: 1.5em; /* 控制整個列表的左邊距 */
}

.markdown-content li {
  margin: 0.5em 0; /* 控制項目之間的間距 */
  line-height: 1.6;
}

/* 嵌套列表的額外縮排 */
.markdown-content ul ul {
  margin: 0.5em 0;
  padding-left: 1.5em; /* 嵌套列表的額外縮排 */
}

/* 有序列表（數字列表）的樣式 */
.markdown-content ol {
  margin: 1em 0;
  padding-left: 1.5em;
}

.markdown-content ol li {
  margin: 0.5em 0;
  line-height: 1.6;
}

/* 嵌套有序列表 */
.markdown-content ol ol {
  margin: 0.5em 0;
  padding-left: 1.5em;
}

/* 混合嵌套列表 */
.markdown-content ul ol,
.markdown-content ol ul {
  margin: 0.5em 0;
  padding-left: 1.5em;
}

/* Footer 樣式 */
.footer {
  background: white;
  margin-top: auto;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  border-radius: 8px 8px 0 0;
}

.footer-content {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 50px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
}

.footer-main {
  flex: 1;
}

.footer-main p {
  color: #666;
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1px;
  font-weight: 300;
  text-align: center;
}

.footer-copyright {
  max-width: 1000px;
  margin: 0 auto;
  text-align: center;
  padding: 0 50px 30px;
  /* border-top: 1px solid #eee; */
}

.footer-copyright p {
  font-size: 0.85rem;
  color: #888;
  font-weight: 300;
  margin: 0;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

@media (max-width: 768px) {
  .container {
    padding: 20px 15px 0px 15px;
  }

  .container-footer {
    padding: 0px 15px;
  }

  .header {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 40px 30px;
  }

  .photo-container {
    justify-self: center;
    margin-top: 20px;
    width: 150px;
    height: 150px;
  }

  .section {
    padding: 30px 25px;
  }

  .header-text h1 {
    font-size: 2rem;
  }

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

  /* 響應式時讓 contact-info 和 social-links 居中對齊 */
  .contact-info {
    justify-content: center;
  }

  .email-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
  }

  .email-container a {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }

  .copy-email-btn {
    position: absolute;
    left: 50%;
    transform: translateX(calc(50% + 60px));
    transform-origin: center;
  }

  .copy-email-btn.copied {
    transform: translateX(calc(50% + 60px)) scale(1.1);
  }

  .social-links {
    justify-content: center;
  }

  .modal {
    width: 95%;
    max-height: 85vh;
  }

  .media-buttons {
    flex-wrap: wrap;
  }

  /* Footer 響應式 */
  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 25px;
    padding: 30px 25px;
  }

  .footer-main {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 100%;
  }
  .footer-main p {
    text-align: center;
  }

  .footer-copyright {
    padding: 0 25px 25px;
  }
}
