﻿:root {
  color-scheme: light;
  --bg: #f8d34c;
  --text: #1c2431;
  --muted: #4b5563;
  --accent: #a3aab4;
  --card-radius: 22px;
  --shadow: 0 24px 50px rgba(28, 36, 49, 0.16);
  --frame-gap: 0.25rem;
  --skill-card-height: 600px;
  --skill-card-media-height: clamp(350px, 36%, 230px);

  /* 間距系統 - 使用 clamp() 實現流暢響應式 */
  --spacing-xs: clamp(0.25rem, 1vw, 0.5rem);
  --spacing-sm: clamp(0.5rem, 2vw, 1rem);
  --spacing-md: clamp(1rem, 3vw, 1.5rem);
  --spacing-lg: clamp(1.5rem, 4vw, 2rem);
  --spacing-xl: clamp(2rem, 5vw, 3rem);

  /* 字體大小系統 - 使用 clamp() 實現流暢縮放 */
  --font-xs: clamp(0.7rem, 1.5vw, 0.85rem);
  --font-sm: clamp(0.8rem, 1.8vw, 0.95rem);
  --font-base: clamp(0.9rem, 2vw, 1.05rem);
  --font-md: clamp(1rem, 2.2vw, 1.2rem);
  --font-lg: clamp(1.2rem, 2.5vw, 1.5rem);
  --font-xl: clamp(1.5rem, 3vw, 2rem);
  --font-2xl: clamp(1.8rem, 3.5vw, 2.5rem);

  /* 觸控目標最小尺寸 */
  --touch-target-min: 44px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei",
    sans-serif;
  background: radial-gradient(
    circle at top left,
    #ffe783 0%,
    #f8d34c 45%,
    #f3b832 100%
  );
  color: var(--text);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}

/* 當管理欄顯示時，為內容添加上方間距 */
body:has(.admin-bar:not([hidden])) {
  padding-top: 3.5rem;
}

.hero {
  padding: clamp(3rem, 5vw, 4.5rem) clamp(1rem, 4vw, 1.8rem)
    clamp(2.2rem, 4vw, 3rem);
}

.hero__content {
  width: min(100%, 1080px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: clamp(0.01rem, 1vw, 0.01rem);
}

.hero__layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.6rem, 4vw, 2.6rem);
  width: 100%;
}

.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
}

.profile__avatar-wrap {
  width: clamp(152px, 22vw, 210px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  padding: clamp(3px, 0.8vw, 5px);
  background: linear-gradient(135deg, #b2b6bd, #d8dade);
  box-shadow: 0 14px 38px rgba(70, 76, 86, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile__avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.1);
}

.profile__name {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.1rem);
  letter-spacing: 0.05em;
  color: rgba(31, 39, 50, 0.9);
  text-align: center;
}

/* ADMIN 標籤 */
.admin-tag {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  border: none;
  padding: 0;
  background: transparent;
  cursor: pointer;
  font-size: clamp(0.55rem, 1.2vw, 0.7rem);
  font-weight: bold;
  letter-spacing: 0.05em;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: -0.5rem;
}

.profile__tags-wrapper {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  width: 100%;
  max-width: clamp(320px, 32vw, 520px);
  margin: 0 auto;
}

.admin-tag__ad {
  background: white;
  color: #b13a2e;
  padding: 0.1rem 0.25rem;
  border: 1px solid #c0c0c0;
  border-right: none;
  border-radius: 3px 0 0 3px;
}

.admin-tag__min {
  background: linear-gradient(135deg, #b13a2e, #6d1f16);
  color: white;
  padding: 0.1rem 0.25rem;
  border: 1px solid #c0c0c0;
  border-left: none;
  border-radius: 0 3px 3px 0;
}

.custom-admin-tags-container {
  display: contents;
}

.custom-admin-tag {
  display: inline-flex;
  align-items: center;
  font-size: clamp(0.55rem, 1.2vw, 0.7rem);
  font-weight: bold;
  letter-spacing: 0.05em;
  border-radius: 3px;
  overflow: hidden;
}

.custom-admin-tag__front,
.custom-admin-tag__back {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.25rem;
  border: 1px solid #c0c0c0;
}

.custom-admin-tag__front {
  border-right: none;
  border-radius: 3px 0 0 3px;
}

.custom-admin-tag__back {
  border-left: none;
  border-radius: 0 3px 3px 0;
}

.modal__content--admin-tags {
  width: min(90vw, 560px) !important;
  max-width: 560px !important;
  padding: 2rem !important;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.admin-tags-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-tags-empty {
  margin: 0;
  text-align: center;
  color: rgba(28, 36, 49, 0.6);
}

.admin-tags-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(28, 36, 49, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 12px rgba(28, 36, 49, 0.08);
}

.admin-tags-item .custom-admin-tag {
  flex-shrink: 0;
}

.admin-tags-delete {
  padding: 0.35rem 0.9rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #dc3545, #a61f2c);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.admin-tags-delete:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(166, 31, 44, 0.3);
}

.admin-tag-color {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-tag-color__preview {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 4px;
  border: 1px solid rgba(28, 36, 49, 0.2);
  background: #ffffff;
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.admin-tag-color__value {
  font-size: 0.85rem;
  color: rgba(28, 36, 49, 0.7);
  min-width: 3.5rem;
  text-align: right;
  font-family: "Segoe UI", "Noto Sans TC", sans-serif;
}

.admin-tag-color__random {
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  border: 1px solid rgba(28, 36, 49, 0.2);
  background: rgba(28, 36, 49, 0.05);
  font-size: 0.85rem;
  cursor: pointer;
}

.admin-tag-color__random:hover {
  background: rgba(28, 36, 49, 0.1);
}

.admin-tag-hint {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(28, 36, 49, 0.6);
}

.profile__contact-wrapper {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
  justify-content: center;
}

.profile__contact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg, #b13a2e, #6d1f16);
  color: #ffffff;
  padding: 0.55rem 2.4rem;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.08em;
  box-shadow: 0 10px 25px rgba(109, 31, 22, 0.3);
}

/* 留言按鈕 */
.message-btn {
  width: 50px;
  height: 50px;
  min-height: var(--touch-target-min);
  border-radius: 50%;
  background: linear-gradient(135deg, #b13a2e, #6d1f16);
  color: white;
  border: none;
  font-size: var(--font-lg);
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(109, 31, 22, 0.4);
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.message-btn:hover {
  background: linear-gradient(135deg, #9a2f25, #5a1912);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(109, 31, 22, 0.5);
}

.hero__bio {
  max-width: min(100%, 540px);
}

.profile__summary {
  margin: 0;
  color: rgba(28, 36, 49, 0.85);
  line-height: 1.8;
  text-align: justify;
  text-justify: inter-character;
  word-break: break-word;
  hyphens: auto;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5), 0 -1px 0 rgba(0, 0, 0, 0.3);
}

.admin-bar {
  background: linear-gradient(90deg, #0c7cd5, #0f63b8);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-sm) clamp(1rem, 4vw, 2.8rem);
  font-size: var(--font-sm);
  gap: var(--spacing-sm);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 9999;
  box-shadow: 0 8px 22px rgba(12, 124, 213, 0.28);
  min-height: var(--touch-target-min);
}

.admin-bar[data-state="off"] {
  background: linear-gradient(90deg, #b7bdc9, #9da3b1);
  color: #1c2431;
}

.admin-bar[data-state="off"] .admin-btn {
  background: rgba(28, 36, 49, 0.15);
  color: #1c2431;
}

.admin-bar[data-state="off"] .admin-btn--quiet {
  background: rgba(28, 36, 49, 0.08);
}

.admin-bar[data-state="off"] .admin-bar__actions {
  display: none;
}

.admin-bar__actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.admin-bar__actions::-webkit-scrollbar {
  height: 4px;
}

.admin-bar__actions::-webkit-scrollbar-track {
  background: transparent;
}

.admin-bar__actions::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

.admin-bar__actions::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

.admin-bar[hidden] {
  display: none !important;
}

.admin-btn {
  border: none;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  padding: var(--spacing-xs) var(--spacing-md);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease;
  font-size: var(--font-base);
  min-height: var(--touch-target-min);
  min-width: var(--touch-target-min);
}

.admin-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.admin-btn--quiet {
  background: rgba(255, 255, 255, 0.1);
}

.content {
  padding: 3rem 1.5rem 4rem;
  width: min(100%, 1200px);
  margin: 0 auto;
}

.section__title {
  display: inline-flex;
  align-items: baseline;
  gap: var(--spacing-xs);
  font-size: var(--font-2xl);
  margin-bottom: var(--spacing-md);
}

/* ===== 關於我區塊 ===== */
.about-me-section {
  margin-bottom: 3rem;
}

.about-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  padding: 0 clamp(1rem, 4vw, 2rem);
  margin-bottom: var(--spacing-xl);
}

.about-item {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.about-item__label {
  font-weight: 600;
  font-size: var(--font-base);
  color: rgba(28, 36, 49, 0.9);
}

.about-item__value {
  font-size: var(--font-sm);
  color: rgba(28, 36, 49, 0.75);
  margin-left: var(--spacing-md);
}

.about-item__content {
  margin-left: 0.5rem;
}

/* 經歷項目 */
.experience-entry {
  margin-left: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-sm);
  border-bottom: 1px dashed rgba(28, 36, 49, 0.1);
}

.experience-entry:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.experience-header {
  font-weight: 500;
  margin-bottom: var(--spacing-sm);
  color: rgba(28, 36, 49, 0.85);
  font-size: var(--font-sm);
}

.experience-skills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-xs);
  margin-left: var(--spacing-xs);
}

.experience-skill-tag {
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: 999px;
  font-size: var(--font-xs);
  font-weight: 600;
  color: rgba(28, 36, 49, 0.85);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease;
  min-height: var(--touch-target-min);
  display: inline-flex;
  align-items: center;
}

.experience-skill-tag:hover {
  transform: translateY(-1px);
}

/* 任職職務標籤 */
.position-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  margin-left: var(--spacing-xs);
}

.position-tag {
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: 999px;
  font-size: var(--font-base);
  font-weight: 600;
  color: rgba(28, 36, 49, 0.85);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease;
  min-height: var(--touch-target-min);
  display: inline-flex;
  align-items: center;
}

.position-tag:hover {
  transform: translateY(-1px);
}

/* 學歷標籤 */
.education-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  margin-left: var(--spacing-xs);
}

.education-tag {
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: 999px;
  font-size: var(--font-base);
  font-weight: 600;
  color: rgba(28, 36, 49, 0.85);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease;
  min-height: var(--touch-target-min);
  display: inline-flex;
  align-items: center;
}

.education-tag:hover {
  transform: translateY(-1px);
}

/* 證書網格 */
.certificate-grid {
  display: grid;
  grid-template-columns: repeat(
    auto-fill,
    minmax(clamp(120px, 20vw, 160px), 1fr)
  );
  gap: var(--spacing-sm);
  margin-left: var(--spacing-xs);
}

.certificate-item {
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease;
  min-height: var(--touch-target-min);
  padding: var(--spacing-xs);
}

.certificate-item:hover {
  transform: translateY(-2px);
}

.certificate-thumbnail {
  width: 100%;
  height: clamp(80px, 15vw, 120px);
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid rgba(28, 36, 49, 0.1);
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.certificate-thumbnail:hover {
  border-color: rgba(12, 124, 213, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.certificate-title {
  font-size: var(--font-xs);
  margin-top: var(--spacing-xs);
  color: rgba(28, 36, 49, 0.75);
  font-weight: 500;
}

/* 網站列表 */
.website-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  margin-left: var(--spacing-sm);
}

.website-item {
  font-size: var(--font-sm);
  color: rgba(28, 36, 49, 0.75);
  display: flex;
  align-items: center;
  min-height: var(--touch-target-min);
}

.website-icon {
  width: clamp(20px, 4vw, 24px);
  height: clamp(20px, 4vw, 24px);
  margin-right: var(--spacing-xs);
  vertical-align: middle;
  flex-shrink: 0;
  background-color: white;
  border-radius: 4px;
  padding: 2px;
  object-fit: contain;
}

.website-item a {
  text-decoration: none;
  transition: all 0.2s ease;
}

.website-item a:hover {
  text-decoration: underline;
}

/* ===== 技能標籤容器 ===== */
.skill-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-xl);
  margin-top: var(--spacing-sm);
  justify-content: center;
  align-items: center;
}

.skill-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xs) var(--spacing-md);
  border-radius: 999px;
  font-size: var(--font-base);
  font-weight: 600;
  color: rgba(28, 36, 49, 0.85);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  letter-spacing: 0.02em;
  min-height: var(--touch-target-min);
  min-width: var(--touch-target-min);
}

.skill-tag:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.section__title-highlight {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: "Chocolate Classical Sans", sans-serif;
  font-weight: bold;
  font-size: 0.8em;
  background: linear-gradient(to right, #c0c0c0, #4a4a4a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.1em;
}

@keyframes iconFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(
    auto-fit,
    minmax(clamp(240px, 30vw, 300px), 1fr)
  );
  gap: clamp(1.4rem, 3vw, 2.4rem);
  justify-items: center;
  align-items: start;
}

.skill-card {
  background: linear-gradient(180deg, #cfd1d5, #ebecee);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow);
  padding: var(--frame-gap);
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 360px;
  height: var(--skill-card-height);
  min-height: var(--skill-card-height);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.skill-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 32px 70px rgba(0, 0, 0, 0.18);
}

.card-inner {
  background: #ffffff;
  border-radius: calc(var(--card-radius) - var(--frame-gap));
  overflow: hidden;
  display: grid;
  grid-template-rows: var(--skill-card-media-height) minmax(0, 1fr);
  width: 100%;
  height: 100%;
}

.card-media {
  position: relative;
  width: calc(100% + var(--frame-gap) * 2);
  height: var(--skill-card-media-height);
  margin: calc(var(--frame-gap) * -1) calc(var(--frame-gap) * -1) 0;
}

.card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  padding: clamp(1.3rem, 3vw, 1.9rem);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}
.card-body h3 {
  margin: 0;
  font-size: var(--font-lg);
  text-align: center;
  letter-spacing: 0.08em;
}

.card-divider {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 5%,
    rgba(12, 124, 213, 0.25) 20%,
    rgba(12, 124, 213, 0.25) 80%,
    transparent 95%
  );
  margin: var(--spacing-xs) var(--spacing-sm) 0;
}

.card-body p {
  margin: 0;
  color: var(--muted);
  font-size: var(--font-sm);
  text-align: justify;
  line-height: 1.7;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
}

.card-actions {
  text-align: right;
  margin-top: auto;
}

.card-actions button {
  border: none;
  background: rgba(12, 124, 213, 0.12);
  color: #0c7cd5;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: 8px;
  cursor: pointer;
  font-size: var(--font-xs);
  transition: background 0.2s ease;
  min-height: var(--touch-target-min);
  min-width: var(--touch-target-min);
}

.card-actions button:hover {
  background: rgba(12, 124, 213, 0.22);
}

.footer {
  min-height: 2rem;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.modal {
  border: none;
  border-radius: 16px;
  padding: 0;
  max-width: none;
  width: fit-content;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: var(--shadow);
  animation: cinemaScreenOpen 1s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: center center;
}

/* 電影院螢幕展開動畫 */
@keyframes cinemaScreenOpen {
  0% {
    transform: scale(0, 0);
    opacity: 0;
  }
  40% {
    transform: scale(1, 0);
    opacity: 0.5;
  }
  100% {
    transform: scale(1, 1);
    opacity: 1;
  }
}

.modal__content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  transition: width 0.3s ease, padding 0.3s ease;
}

.modal__content h2 {
  margin: 0;
  font-size: var(--font-xl);
  text-align: center;
  word-wrap: break-word;
}

/* ===== 個別 Modal 獨立樣式 ===== */

/* 編輯自我介紹 Modal */
.modal__content--profile {
  width: min(90vw, 500px) !important;
  padding: 2rem !important;
  max-width: 500px !important;
}

/* 編輯技能區塊 Modal */
.modal__content--panel {
  width: min(90vw, 550px) !important;
  padding: 2rem !important;
  max-width: 550px !important;
}

/* 專案編輯器 Modal */
.modal__content--project-editor {
  width: min(90vw, 720px) !important;
  padding: 2rem !important;
  max-width: 720px !important;
}

/* 專案管理器 Modal */
.modal__content--project-manager {
  width: min(90vw, 900px) !important;
  padding: 2rem 2.5rem !important;
  max-width: 900px !important;
}

/* 技能詳情 Modal */
.modal__content--skill-detail {
  width: min(98vw, 2000px) !important;
  min-width: 1000px !important;
  padding: 2.5rem 3rem !important;
  max-width: 2000px !important;
  background: rgba(218, 218, 218, 0.7) !important;
}

#skillDetailModal.modal {
  background: rgba(255, 255, 255, 0.01) !important;
  backdrop-filter: blur(2px) !important;
  -webkit-backdrop-filter: blur(2px) !important;
}

/* 滾動條透明樣式 */
.modal__content--skill-detail::-webkit-scrollbar {
  width: 12px;
}

.modal__content--skill-detail::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.modal__content--skill-detail::-webkit-scrollbar-thumb {
  background: rgba(25, 31, 27, 0.7);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.modal__content--skill-detail::-webkit-scrollbar-thumb:hover {
  background: rgba(25, 31, 27, 0.9);
  background-clip: padding-box;
}

/* 回到頂部浮動按鈕 */
.scroll-to-top-btn {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0c7cd5, #0a5ea8);
  color: white;
  border: none;
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(12, 124, 213, 0.4);
  transition: all 0.3s ease;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(100px);
}

.scroll-to-top-btn.visible {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

.scroll-to-top-btn:hover {
  background: linear-gradient(135deg, #0a5ea8, #084a8a);
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(12, 124, 213, 0.5);
}

.scroll-to-top-btn:active {
  transform: translateY(-2px);
}

/* 圖片預覽 Modal */
.modal__content--image-preview {
  width: min(90vw, 1200px) !important;
  padding: 2rem !important;
  max-width: 1200px !important;
  background: rgba(255, 255, 255, 0.98) !important;
}

/* 技能標籤管理 Modal */
.modal__content--skill-tags {
  width: min(90vw, 600px) !important;
  padding: 2rem !important;
  max-width: 600px !important;
}

/* 關於我管理 Modal */
.modal__content--about-me {
  width: min(90vw, 700px) !important;
  padding: 2rem !important;
  max-width: 700px !important;
}

.about-me-manager {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

/* 經歷管理列表 */
.experience-manager-list,
.education-manager-list,
.certificate-manager-list,
.website-manager-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-xs);
  margin-bottom: var(--spacing-sm);
}

.manager-item {
  display: flex;
  gap: var(--spacing-sm);
  align-items: flex-start;
  padding: var(--spacing-sm);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(28, 36, 49, 0.1);
  border-radius: 8px;
}

.manager-item__fields {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.manager-item input,
.manager-item textarea {
  width: 100%;
  padding: var(--spacing-sm);
  border: 1px solid rgba(28, 36, 49, 0.15);
  min-height: var(--touch-target-min);
  border-radius: 6px;
  font-size: var(--font-base);
}

.manager-item textarea {
  min-height: 60px;
  resize: vertical;
}

.manager-item__remove {
  border: none;
  background: rgba(217, 83, 79, 0.1);
  color: #d9534f;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: var(--font-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
  min-width: var(--touch-target-min);
  min-height: var(--touch-target-min);
}

.manager-item__remove:hover {
  background: #d9534f;
  color: #fff;
}

.skill-tags-manager {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.skill-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  padding: 1.2rem;
  border: 1px dashed rgba(28, 36, 49, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
  min-height: 120px;
  align-items: flex-start;
  align-content: flex-start;
}

.skill-tags-list:empty::after {
  content: "目前沒有技能標籤，請新增標籤";
  width: 100%;
  text-align: center;
  color: rgba(28, 36, 49, 0.5);
  font-size: var(--font-base);
}

.skill-tag-item {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: 999px;
  font-size: var(--font-base);
  font-weight: 600;
  color: rgba(28, 36, 49, 0.85);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  min-height: var(--touch-target-min);
}

.skill-tag-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.skill-tag-remove {
  border: none;
  background: rgba(255, 255, 255, 0.5);
  color: rgba(217, 83, 79, 0.9);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: var(--font-base);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
}

.skill-tag-remove:hover {
  background: rgba(217, 83, 79, 0.9);
  color: #fff;
  transform: scale(1.1);
}

.skill-tags-input-area {
  display: flex;
  gap: 0.8rem;
  align-items: center;
}

.skill-tags-input {
  flex: 1;
  border: 1px solid rgba(28, 36, 49, 0.18);
  border-radius: 10px;
  padding: 0.8rem;
  font: inherit;
  color: inherit;
  background: #fff;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.skill-tags-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(12, 124, 213, 0.2);
}

.image-preview-container {
  width: 100%;
  max-height: 70vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  padding: 1rem;
}

.image-preview-container img {
  max-width: 100%;
  max-height: 70vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.project-media-card img {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-media-card img:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.project-media-card a {
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.project-media-card a:hover {
  color: #0056b3;
  text-decoration: underline;
}

.project-media-card a .file-icon {
  margin-right: 0;
}

.modal__header {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  position: relative;
}

.modal__close {
  position: absolute;
  right: 0;
  top: 0;
  width: 48px;
  height: 48px;
  padding: 0;
  background-image: url("../assets/photos/power.png");
  background-size: 32px 32px;
  background-repeat: no-repeat;
  background-position: center;
  background-color: transparent;
  border: none;
  border-radius: 50%;
  color: transparent;
  font-size: 0;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease;
  mix-blend-mode: multiply;
}

.modal__close:hover {
  transform: scale(1.1);
  background-color: rgba(0, 0, 0, 0.05);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: left;
}

.field span {
  font-weight: 600;
  color: var(--text);
}

.field input,
.field textarea,
.field select {
  border: 1px solid rgba(28, 36, 49, 0.18);
  border-radius: 10px;
  padding: 0.8rem;
  font: inherit;
  color: inherit;
  background: #fff;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(12, 124, 213, 0.2);
}

.modal__hint {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: left;
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.8rem;
  margin-top: 0.6rem;
}

.modal__actions--split {
  justify-content: space-between;
}

.admin-btn--ghost {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px dashed rgba(28, 36, 49, 0.2);
}

.admin-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.18);
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0.5rem 0 1rem;
  max-height: min(60vh, 520px);
  overflow-y: auto;
}

.project-item {
  border: 1px solid rgba(28, 36, 49, 0.12);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.project-item__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}

.project-item__name {
  font-weight: 700;
  font-size: var(--font-base);
}

.project-item__intro {
  font-size: var(--font-base);
  color: rgba(28, 36, 49, 0.7);
  line-height: 1.5;
}

.project-item__meta {
  font-size: var(--font-sm);
  color: rgba(28, 36, 49, 0.55);
}

.project-item__actions {
  display: flex;
  gap: 0.6rem;
}

.project-empty {
  padding: 1rem;
  border-radius: 12px;
  border: 1px dashed rgba(28, 36, 49, 0.16);
  background: rgba(255, 255, 255, 0.6);
  color: rgba(28, 36, 49, 0.6);
  text-align: center;
}

.media-hint {
  font-size: var(--font-sm);
  color: rgba(28, 36, 49, 0.6);
  margin-bottom: var(--spacing-xs);
}

.media-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.media-item {
  display: grid;
  grid-template-columns: minmax(90px, 120px) 1fr 1fr auto;
  gap: 0.6rem;
  align-items: center;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(28, 36, 49, 0.1);
  border-radius: 10px;
  padding: 0.75rem;
}

.media-item select,
.media-item input {
  width: 100%;
}

.media-remove {
  border: none;
  background: transparent;
  color: rgba(217, 83, 79, 0.85);
  font-size: 1.2rem;
  cursor: pointer;
}

.detail-skill-intro {
  margin-bottom: 2rem;
  color: rgba(28, 36, 49, 0.78);
  line-height: 1.7;
  width: 100%;
}

/* 專案導航列表 */
.project-navigation-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-lg);
  padding: var(--spacing-md);
  background: rgba(12, 124, 213, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(12, 124, 213, 0.1);
}

.project-nav-item {
  display: inline-flex;
  align-items: center;
  padding: var(--spacing-xs) var(--spacing-md);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(12, 124, 213, 0.2);
  border-radius: 999px;
  font-size: var(--font-sm);
  font-weight: 600;
  color: #0c7cd5;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: var(--touch-target-min);
  text-decoration: none;
}

.project-nav-item:hover {
  background: #0c7cd5;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(12, 124, 213, 0.3);
}

.project-nav-item:active {
  transform: translateY(0);
}

.detail-projects {
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
  width: 100%;
  min-width: 0;
}

.detail-project {
  border-radius: 14px;
  border: 1px solid rgba(28, 36, 49, 0.1);
  background: rgba(255, 255, 255, 0.95);
  padding: 1.8rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.detail-project__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  width: 100%;
}

.detail-project h3 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  word-wrap: break-word;
  overflow-wrap: break-word;
  color: rgba(28, 36, 49, 0.9);
  flex: 1;
}

.detail-project__actions {
  display: flex;
  gap: 0.6rem;
  flex-shrink: 0;
}

.detail-project__btn {
  border: none;
  background: rgba(12, 124, 213, 0.1);
  color: #0c7cd5;
  padding: 0.4rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.detail-project__btn:hover {
  background: rgba(12, 124, 213, 0.2);
  transform: translateY(-1px);
}

.detail-project__btn--delete {
  background: rgba(217, 83, 79, 0.1);
  color: #d9534f;
}

.detail-project__btn--delete:hover {
  background: rgba(217, 83, 79, 0.2);
}

.detail-project__timestamps {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(28, 36, 49, 0.08);
  font-size: 0.8rem;
  color: rgba(28, 36, 49, 0.6);
}

.timestamp {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.timestamp__label {
  font-weight: 500;
  color: rgba(28, 36, 49, 0.5);
  white-space: nowrap;
}

.timestamp__value {
  color: rgba(28, 36, 49, 0.7);
  font-family: 'Courier New', Courier, monospace;
}

.project-media-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr));
  gap: 0.9rem;
  width: 100%;
}

.project-media-card {
  border: 1px solid rgba(28, 36, 49, 0.08);
  border-radius: 10px;
  padding: 0.75rem;
  background: rgba(249, 249, 249, 0.9);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
  box-sizing: border-box;
}

.project-media-card img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  object-fit: cover;
  max-height: 160px;
  display: block;
}

.project-media-card a {
  color: #0d6efd;
  word-break: break-all;
  overflow-wrap: break-word;
  font-size: 0.88rem;
}

.project-media-label {
  font-size: 0.85rem;
  color: rgba(28, 36, 49, 0.75);
  word-wrap: break-word;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.file-icon {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  max-width: 32px !important;
  max-height: 32px !important;
  flex-shrink: 0;
  object-fit: contain;
  vertical-align: middle;
  display: inline-block;
}

/* YouTube 影片容器 */
.project-media-card--video {
  min-height: auto;
}

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 比例 */
  height: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #000;
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.markdown-body {
  width: 100%;
  min-width: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.markdown-body p {
  margin: 0 0 0.8rem;
  line-height: 1.6;
}

.markdown-body ul {
  margin: 0 0 0.8rem 1.4rem;
  padding: 0;
}

.markdown-body img {
  max-width: 100%;
  height: auto;
}

.markdown-body pre,
.markdown-body code {
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

.modal__actions button {
  border: none;
  background: rgba(28, 36, 49, 0.08);
  color: var(--text);
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
}

.modal__actions .primary {
  background: var(--accent);
  color: #fff;
}

.modal__error {
  color: #d43f52;
  font-size: 0.9rem;
  text-align: center;
}

@media (min-width: 1200px) {
  body {
    display: grid;
    grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
    grid-template-rows: auto 1fr auto;
    column-gap: clamp(2rem, 4vw, 3.4rem);
  }

  .admin-bar {
    grid-column: 1 / -1;
  }

  .hero {
    grid-column: 1;
    grid-row: 2;
  }

  .hero__content {
    align-items: flex-start;
    gap: clamp(0.5rem, 1vw, 0.8rem);
  }

  .hero__layout {
    align-items: center;
  }

  .profile {
    align-items: center;
  }

  .profile__contact {
    align-self: center;
  }

  .hero__bio {
    max-width: clamp(340px, 32vw, 520px);
    text-align: center;
  }

  .profile__summary {
    max-width: clamp(320px, 32vw, 520px);
  }

  .content {
    grid-column: 2;
    grid-row: 2;
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 3.2rem clamp(1.6rem, 3vw, 2.6rem) 4rem clamp(1.6rem, 3vw, 2.6rem);
  }

  .footer {
    grid-column: 1 / -1;
    grid-row: 3;
  }
}

@media (max-width: 1024px) {
  .profile__avatar-wrap {
    width: clamp(140px, 30vw, 180px);
  }

  .profile__summary {
    max-width: 480px;
  }
}

@media (max-width: 820px) {
  .hero__content {
    align-items: center;
  }

  .hero__layout {
    align-items: center;
  }

  .profile__contact {
    padding: 0.5rem 1.8rem;
    font-size: 0.95rem;
  }

  .skill-card {
    max-width: 100%;
  }
}

/* ===== 響應式設計 - 1400px 以下 ===== */
@media (max-width: 1400px) {
  .modal__content--skill-detail {
    width: 95vw !important;
    min-width: 0 !important;
    background: rgba(218, 218, 218, 0.7) !important;
  }
}

/* ===== 響應式設計 - 1200px 以下 ===== */
@media (max-width: 1200px) {
  .modal__content--skill-detail {
    width: 92vw !important;
    min-width: 0 !important;
    padding: 2rem 2.5rem !important;
    background: rgba(218, 218, 218, 0.7) !important;
  }

  .modal__content--project-manager {
    width: 88vw !important;
  }
}

/* ===== 響應式設計 - 1024px 以下 ===== */
@media (max-width: 1024px) {
  .modal__content--profile {
    width: 85vw !important;
  }

  .modal__content--panel {
    width: 85vw !important;
  }

  .modal__content--project-editor {
    width: 88vw !important;
  }

  .modal__content--project-manager {
    width: 90vw !important;
    padding: 2rem !important;
  }

  .modal__content--skill-detail {
    width: 94vw !important;
    padding: 2rem 2rem !important;
    background: rgba(218, 218, 218, 0.7) !important;
  }

  .modal__content--image-preview {
    width: 92vw !important;
    padding: 1.5rem !important;
  }

  .image-preview-container {
    max-height: 65vh;
  }

  .image-preview-container img {
    max-height: 65vh;
  }
}

/* ===== 響應式設計 - 768px 以下 (平板) ===== */
@media (max-width: 768px) {
  .modal__content--profile,
  .modal__content--panel {
    width: 90vw !important;
    padding: 1.8rem !important;
  }

  .modal__content--project-editor {
    width: 92vw !important;
    padding: 1.8rem 1.5rem !important;
  }

  .modal__content--project-manager {
    width: 93vw !important;
    padding: 1.8rem 1.5rem !important;
  }

  .modal__content--skill-detail {
    width: 96vw !important;
    padding: 1.8rem 1.5rem !important;
    background: rgba(218, 218, 218, 0.7) !important;
  }

  .modal__content--image-preview {
    width: 94vw !important;
    padding: 1.2rem !important;
  }

  .image-preview-container {
    max-height: 60vh;
    padding: 0.8rem;
  }

  .image-preview-container img {
    max-height: 60vh;
  }

  .project-media-gallery {
    grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr));
  }

  .detail-project {
    padding: 1.5rem;
  }

  .detail-project__header {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .modal__header h2 {
    font-size: 1.25rem;
  }

  /* 平板滾動條優化 */
  .modal__content--skill-detail::-webkit-scrollbar {
    width: 10px;
  }
}

@media (max-width: 680px) {
  .hero {
    padding: 3.2rem 1rem 2.2rem;
  }

  .profile__summary {
    font-size: 0.95rem;
    line-height: 1.7;
  }

  .content {
    padding: 2.4rem 1rem 3.2rem;
  }

  .skill-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  /* 關於我區塊調整 */
  .about-content {
    padding: 0 1.5rem;
    gap: 1.3rem;
  }

  .certificate-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.8rem;
  }

  .certificate-thumbnail {
    height: 85px;
  }

  /* 小螢幕管理欄調整 */
  body:has(.admin-bar:not([hidden])) {
    padding-top: 5rem;
  }

  .admin-bar {
    padding: 0.7rem 1rem;
    font-size: 0.88rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }

  .admin-bar__actions {
    gap: 0.6rem;
    flex-wrap: nowrap;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.3rem;
  }

  .admin-btn {
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
    white-space: nowrap;
    flex-shrink: 0;
  }
}

/* ===== 響應式設計 - 600px 以下 (手機) ===== */
@media (max-width: 600px) {
  .media-item {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .media-item select,
  .media-item input {
    width: 100%;
  }

  /* 關於我區塊手機優化 */
  .about-content {
    padding: 0 1.2rem;
    gap: 1.2rem;
  }

  .about-item__label {
    font-size: 1rem;
  }

  .about-item__value {
    font-size: 0.9rem;
    margin-left: 1rem;
  }

  .experience-entry {
    margin-left: 0.5rem;
  }

  .experience-skills {
    margin-left: 0;
  }

  .experience-skill-tag {
    padding: 0.25rem 0.8rem;
    font-size: 0.8rem;
  }

  .position-tags {
    margin-left: 0;
  }

  .position-tag {
    padding: 0.35rem 0.9rem;
    font-size: 0.85rem;
  }

  .education-tags {
    margin-left: 0;
  }

  .education-tag {
    padding: 0.35rem 0.9rem;
    font-size: 0.85rem;
  }

  .certificate-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.7rem;
    margin-left: 0;
  }

  .certificate-thumbnail {
    height: 75px;
  }

  .certificate-title {
    font-size: 0.8rem;
  }

  .website-list {
    margin-left: 0.5rem;
  }

  .website-item {
    font-size: 0.9rem;
    word-break: break-all;
  }

  .website-icon {
    width: 20px;
    height: 20px;
  }

  /* 技能標籤手機優化 */
  .skill-tags-container {
    gap: 0.6rem;
  }

  .skill-tag {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
  }

  /* Modal 優化 */
  .modal__content--profile {
    width: 94vw !important;
    padding: 1.5rem !important;
  }

  .modal__content--panel {
    width: 94vw !important;
    padding: 1.5rem !important;
  }

  .modal__content--project-editor {
    width: 95vw !important;
    padding: 1.5rem 1.2rem !important;
  }

  .modal__content--project-manager {
    width: 96vw !important;
    padding: 1.5rem 1.2rem !important;
  }

  .modal__content--skill-detail {
    width: 97vw !important;
    padding: 1.5rem 1rem !important;
    background: rgba(218, 218, 218, 0.7) !important;
  }

  .modal__content--skill-tags {
    width: 96vw !important;
    padding: 1.5rem 1.2rem !important;
  }

  .modal__content--about-me {
    width: 97vw !important;
    padding: 1.5rem 1.2rem !important;
  }

  .modal__content--image-preview {
    width: 96vw !important;
    padding: 1rem !important;
  }

  .image-preview-container {
    max-height: 55vh;
    padding: 0.6rem;
  }

  .image-preview-container img {
    max-height: 55vh;
  }

  .project-media-gallery {
    grid-template-columns: 1fr;
  }

  .detail-project {
    padding: 1.2rem;
    gap: 1rem;
  }

  .detail-project__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
  }

  .detail-project h3 {
    font-size: 1.15rem;
  }

  .detail-project__actions {
    width: 100%;
  }

  .detail-project__btn {
    flex: 1;
    padding: 0.5rem 0.8rem;
    font-size: 0.8rem;
  }

  .modal__header h2 {
    font-size: 1.15rem;
  }

  /* 手機管理欄優化 */
  body:has(.admin-bar:not([hidden])) {
    padding-top: 4.5rem;
  }

  .admin-bar {
    padding: 0.6rem 0.8rem;
    font-size: 0.82rem;
    flex-direction: column;
    gap: 0.5rem;
  }

  .admin-bar__actions {
    gap: 0.5rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.3rem;
  }

  .admin-btn {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* 手機滾動條優化 */
  .modal__content--skill-detail::-webkit-scrollbar {
    width: 8px;
  }

  .modal__content--skill-detail::-webkit-scrollbar-thumb {
    border: 1px solid transparent;
  }
}

/* ===== 響應式設計 - 500px 以下 (小手機) ===== */
@media (max-width: 500px) {
  .profile__contact {
    width: 100%;
  }

  .card-body {
    padding: 1.3rem 1.3rem 1.5rem;
  }

  .card-divider {
    margin-inline: 0.8rem;
  }

  /* 關於我區塊小手機優化 */
  .about-content {
    padding: 0 1rem;
    gap: 1rem;
  }

  .about-item__label {
    font-size: 0.95rem;
  }

  .about-item__value {
    font-size: 0.85rem;
    margin-left: 0.8rem;
  }

  .experience-header {
    font-size: 0.9rem;
  }

  .experience-skill-tag {
    padding: 0.2rem 0.7rem;
    font-size: 0.75rem;
  }

  .position-tag {
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
  }

  .education-tag {
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
  }

  .certificate-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
  }

  .certificate-thumbnail {
    height: 70px;
  }

  .certificate-title {
    font-size: 0.75rem;
  }

  .website-item {
    font-size: 0.85rem;
  }

  .website-icon {
    width: 18px;
    height: 18px;
  }

  /* 技能標籤小手機優化 */
  .skill-tag {
    padding: 0.35rem 0.9rem;
    font-size: 0.8rem;
  }

  /* 標題調整 */
  .section__title {
    font-size: 1.5rem;
  }

  .section__title-highlight::before,
  .section__title-highlight--about::before,
  .section__title-highlight--skills::before {
    width: 1.3em;
    height: 1.3em;
  }

  /* Modal 優化 */
  .modal__content--profile,
  .modal__content--panel {
    width: 96vw !important;
    padding: 1.2rem !important;
  }

  .modal__content--project-editor {
    width: 97vw !important;
    padding: 1.2rem 1rem !important;
  }

  .modal__content--project-manager {
    width: 98vw !important;
    padding: 1.2rem 1rem !important;
  }

  .modal__content--skill-detail {
    width: 98vw !important;
    padding: 1.2rem 0.8rem !important;
    background: rgba(218, 218, 218, 0.7) !important;
  }

  .modal__content--skill-tags,
  .modal__content--about-me {
    width: 98vw !important;
    padding: 1.2rem 1rem !important;
  }

  .manager-item {
    padding: 0.6rem;
  }

  .manager-item input,
  .manager-item textarea {
    padding: 0.5rem;
  }

  .detail-project {
    padding: 1rem;
  }

  .project-media-card {
    padding: 0.6rem;
  }

  /* 小手機管理欄優化 */
  body:has(.admin-bar:not([hidden])) {
    padding-top: 4rem;
  }

  .admin-bar {
    padding: 0.5rem 0.6rem;
    font-size: 0.78rem;
    flex-direction: column;
    gap: 0.4rem;
  }

  .admin-bar__actions {
    gap: 0.4rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.2rem;
  }

  .admin-btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* 小手機滾動條優化 */
  .modal__content--skill-detail::-webkit-scrollbar {
    width: 6px;
  }
}

/* ===== 響應式設計 - 400px 以下 (超小螢幕) ===== */
@media (max-width: 400px) {
  /* 關於我區塊超小螢幕優化 */
  .about-content {
    padding: 0 0.8rem;
    gap: 0.9rem;
  }

  .about-item__label {
    font-size: 0.9rem;
  }

  .about-item__value {
    font-size: 0.8rem;
    margin-left: 0.5rem;
  }

  .experience-entry {
    margin-left: 0.2rem;
  }

  .experience-header {
    font-size: 0.85rem;
  }

  .experience-skill-tag {
    padding: 0.2rem 0.6rem;
    font-size: 0.7rem;
  }

  .position-tag {
    padding: 0.25rem 0.7rem;
    font-size: 0.75rem;
  }

  .education-tag {
    padding: 0.25rem 0.7rem;
    font-size: 0.75rem;
  }

  .certificate-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .certificate-thumbnail {
    height: 65px;
  }

  .certificate-title {
    font-size: 0.7rem;
    margin-top: 0.3rem;
  }

  .website-list {
    margin-left: 0.3rem;
  }

  .website-item {
    font-size: 0.8rem;
  }

  .website-icon {
    width: 16px;
    height: 16px;
  }

  /* 技能標籤超小螢幕優化 */
  .skill-tags-container {
    gap: 0.5rem;
  }

  .skill-tag {
    padding: 0.3rem 0.8rem;
    font-size: 0.75rem;
  }

  /* 標題進一步調整 */
  .section__title {
    font-size: 1.3rem;
  }

  .section__title-highlight::before,
  .section__title-highlight--about::before,
  .section__title-highlight--skills::before {
    width: 1.2em;
    height: 1.2em;
  }

  /* Modal 全螢幕優化 */
  .modal__content--profile,
  .modal__content--panel,
  .modal__content--project-editor,
  .modal__content--project-manager,
  .modal__content--skill-detail,
  .modal__content--skill-tags,
  .modal__content--about-me {
    width: 100vw !important;
    padding: 1rem 0.8rem !important;
    border-radius: 0 !important;
    min-width: 0 !important;
  }

  .modal__content--skill-detail {
    background: rgba(218, 218, 218, 0.7) !important;
  }

  .modal {
    border-radius: 0;
    max-width: 100vw;
  }

  .manager-item {
    padding: 0.5rem;
  }

  .manager-item input,
  .manager-item textarea {
    padding: 0.45rem;
  }

  .manager-item__remove {
    width: 24px;
    height: 24px;
  }

  .detail-project {
    padding: 0.8rem;
    border-radius: 10px;
  }

  .detail-project h3 {
    font-size: 1.1rem;
  }

  .modal__header h2 {
    font-size: 1.05rem;
  }

  .project-media-gallery {
    gap: 0.7rem;
    grid-template-columns: 1fr;
  }

  .detail-project__actions {
    flex-direction: column;
    gap: 0.5rem;
  }

  .detail-project__btn {
    width: 100%;
  }

  /* 超小螢幕管理欄優化 */
  body:has(.admin-bar:not([hidden])) {
    padding-top: 3.8rem;
  }

  .admin-bar {
    padding: 0.4rem 0.5rem;
    font-size: 0.72rem;
    gap: 0.4rem;
    flex-direction: column;
  }

  .admin-bar__actions {
    gap: 0.35rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.2rem;
  }

  .admin-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* 超小螢幕滾動條優化 */
  .modal__content--skill-detail::-webkit-scrollbar {
    width: 5px;
  }

  .modal__content--skill-detail::-webkit-scrollbar-thumb {
    border: 0;
  }
}

/* ===== 分享連結區塊 ===== */
.share-links-section {
  margin-top: clamp(2rem, 4vw, 3rem);
  width: 100%;
}

.share-links-grid {
  position: relative;
  width: 100%;
  padding: 0;
  /* 高度由 JS 動態設定 */
}

/* 分享連結卡片 */
.share-link-card {
  position: absolute;
  /* left 和 top 由 JS 動態設定 */
  /* width 由 JS 動態設定 */
  aspect-ratio: 1;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  overflow: visible;
}

/* 水流效果：最後4行的卡片 */
.share-link-card--waterfall {
  animation: waterfall-flow 2s ease-out forwards;
  opacity: 0;
}

@keyframes waterfall-flow {
  0% {
    opacity: 0;
    transform: translateY(-20px) scale(0.8);
  }
  60% {
    opacity: 1;
    transform: translateY(5px) scale(1.05);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.share-link-card:hover {
  transform: translateY(-6px) scale(1.05);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
  z-index: 10;
}

.share-link-card:active {
  transform: translateY(-4px) scale(1.02);
}

/* 卡片文字 */
.share-link-text {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  font-weight: 700;
  color: white;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  user-select: none;
  letter-spacing: 0.05em;
}

/* Tooltip 提示框 */
.share-link-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: rgba(28, 36, 49, 0.95);
  color: white;
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  white-space: normal;
  min-width: 250px;
  max-width: 500px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  z-index: 20;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  text-align: left;
}

.share-link-tooltip__name {
  font-size: var(--font-base);
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
  color: #ffd700;
}

.share-link-tooltip__desc {
  font-size: var(--font-sm);
  font-weight: 400;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.9);
}

.share-link-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: var(--arrow-left, 50%);
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(28, 36, 49, 0.95);
  pointer-events: none;
}

.share-link-card:hover .share-link-tooltip {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  visibility: visible;
}

/* 分享連結管理器 */
.share-links-manager {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.share-links-manager-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

.share-link-manager-item {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(28, 36, 49, 0.1);
  border-radius: 8px;
}

.share-link-manager-item__fields {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.share-link-manager-item input {
  width: 100%;
  padding: var(--spacing-sm);
  border: 1px solid rgba(28, 36, 49, 0.15);
  border-radius: 6px;
  font-size: var(--font-base);
  transition: border-color 0.2s ease;
  min-height: var(--touch-target-min);
}

.share-link-manager-item input:focus {
  outline: none;
  border-color: #0c7cd5;
  box-shadow: 0 0 0 3px rgba(12, 124, 213, 0.1);
}

.share-link-manager-item__remove {
  border: none;
  background: rgba(217, 83, 79, 0.1);
  color: #d9534f;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: var(--font-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
  min-width: var(--touch-target-min);
  min-height: var(--touch-target-min);
}

.share-link-manager-item__remove:hover {
  background: #d9534f;
  color: #fff;
  transform: rotate(90deg);
}

/* Modal 寬度設定 */
.modal__content--share-links {
  width: min(90vw, 650px) !important;
  padding: 2rem !important;
  max-width: 650px !important;
}

/* TellMe 管理介面 */
.modal__content--tell-me {
  width: min(90vw, 600px) !important;
  padding: 2rem !important;
  max-width: 600px !important;
}

.tell-me-manager {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.tell-me-list-manager {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-bottom: 0.5rem;
}

.tell-me-item {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(28, 36, 49, 0.1);
  border-radius: 8px;
}

.tell-me-item input {
  flex: 1;
  padding: var(--spacing-sm);
  border: 1px solid rgba(28, 36, 49, 0.15);
  border-radius: 6px;
  font-size: var(--font-base);
  transition: border-color 0.2s ease;
  min-height: var(--touch-target-min);
}

.tell-me-item input:focus {
  outline: none;
  border-color: #0c7cd5;
  box-shadow: 0 0 0 3px rgba(12, 124, 213, 0.1);
}

.tell-me-item__remove {
  border: none;
  background: rgba(217, 83, 79, 0.1);
  color: #d9534f;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: var(--font-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
  min-width: var(--touch-target-min);
  min-height: var(--touch-target-min);
}

.tell-me-item__remove:hover {
  background: #d9534f;
  color: #fff;
  transform: rotate(90deg);
}

/* 留言 Modal */
.modal__content--message {
  width: min(95vw, 720px) !important;
  padding: 2rem !important;
  max-width: 720px !important;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: stretch;
}

.message-body {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.message-purpose {
  flex: 0 0 220px;
  border: none;
  border-radius: 12px;
  padding: 1.25rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 0.75rem;
}

.message-purpose__title {
  margin: 0;
  font-size: var(--font-md);
  font-weight: 600;
  color: var(--color-text-strong, #212529);
}

.message-purpose__list {
  margin: 0;
  padding-left: 0;
  text-align: left;
  font-size: var(--font-sm);
  color: var(--color-text, #4b5563);
}

.message-purpose__list li + li {
  margin-top: 0.2rem;
}

.message-fields {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.message-fields .field {
  margin: 0;
  gap: 0.05rem;
}

.message-fields .field + .field {
  margin-top: 0;
}

.message-fields .recaptcha-container {
  justify-content: flex-start;
  margin: 0.5rem 0 0;
  padding: 0;
  background: transparent;
}

.message-fields .message-status {
  margin-top: 0.5rem;
}

@media (max-width: 768px) {
  .message-body {
    flex-direction: column;
    gap: 1rem;
  }

  .message-purpose {
    flex: 1 1 auto;
    width: 100%;
  }
}

.message-status {
  padding: var(--spacing-sm);
  border-radius: 8px;
  font-size: var(--font-sm);
  text-align: center;
  margin-top: var(--spacing-sm);
  display: none;
}

.message-status.success {
  display: block;
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.message-status.error {
  display: block;
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.message-status.sending {
  display: block;
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* reCAPTCHA 容器 */
.recaptcha-container {
  display: flex;
  justify-content: center;
  margin: var(--spacing-md) 0;
  padding: var(--spacing-sm);
  background: rgba(12, 124, 213, 0.03);
  border-radius: 8px;
}

.recaptcha-container .g-recaptcha {
  display: inline-block;
}

/* 響應式設計 - 分享連結 */
@media (max-width: 1024px) {
  .share-links-section {
    max-width: 100%;
    padding: 1rem clamp(1rem, 4vw, 1.8rem) 1rem;
    margin: 0 auto;
    /* 移除背景，融入整體背景 */
    background: transparent;
  }

  .share-links-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 0.1rem;
  }
}

@media (max-width: 600px) {
  .share-links-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.7rem;
  }

  .share-link-tooltip {
    padding: 0.4rem 0.8rem;
  }

  .modal__content--share-links {
    width: 95vw !important;
    padding: 1.5rem !important;
  }

  .share-link-manager-item {
    padding: 0.6rem;
  }

  .share-link-manager-item input {
    padding: 0.5rem;
  }
}

@media (max-width: 500px) {
  .share-links-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
  }

  .share-link-card {
    border-radius: 6px;
  }

  .modal__content--share-links {
    width: 97vw !important;
    padding: 1.2rem !important;
  }
}

@media (max-width: 400px) {
  .share-links-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }

  .share-link-card {
    border-radius: 6px;
  }

  .share-link-tooltip {
    padding: 0.35rem 0.7rem;
  }

  .modal__content--share-links {
    width: 100vw !important;
    padding: 1rem !important;
    border-radius: 0 !important;
  }

  /* 小螢幕 - ADMIN 標籤更小 */
  .admin-tag {
    font-size: clamp(0.5rem, 1vw, 0.65rem);
  }
}

/* ===== 新功能響應式優化 ===== */

/* 留言按鈕 - 確保在小螢幕仍可點擊 */
@media (max-width: 600px) {
  .message-btn {
    width: 44px;
    height: 44px;
    font-size: var(--font-base);
  }
}

/* ADMIN 標籤 - 平板優化 */
@media (max-width: 768px) {
  .admin-tag {
    margin-bottom: -0.3rem;
  }
}

/* reCAPTCHA - 小螢幕優化 */
@media (max-width: 500px) {
  .recaptcha-container {
    padding: var(--spacing-xs);
    margin: var(--spacing-sm) 0;
  }

  .modal__content--message {
    width: 95vw !important;
    padding: 1.5rem !important;
  }
}

@media (max-width: 400px) {
  .modal__content--message {
    width: 100vw !important;
    padding: 1rem !important;
    border-radius: 0 !important;
  }

  .recaptcha-container {
    padding: 0.25rem;
  }

  /* reCAPTCHA 自動縮放 */
  .recaptcha-container .g-recaptcha {
    transform: scale(0.85);
    transform-origin: 0 0;
  }
}

/* YouTube 影片 - 確保響應式比例 */
@media (max-width: 600px) {
  .video-wrapper {
    border-radius: 6px;
  }

  .project-media-card--video {
    padding: 0.5rem;
  }
}
