/* 字型：粉圓體（展示用）＋ Noto Sans TC（內文，中文可讀性較佳） */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;700&family=Quicksand:wght@500;600;700&display=swap');
@import url('https://cdn.jsdelivr.net/npm/font-jf-openhuninn@1.1/css/jf-openhuninn.min.css');

/* ===================== Design tokens ===================== */
:root{
  --bg: #FFF9FC;
  --surface: #FFFFFF;
  --accent: #F0577E;
  --accent-soft: #FCE9EE;
  --highlight: #F2903A;
  --highlight-soft: #FFF6D6;
  --ink: #3A2F36;
  --ink-soft: #8C8189;
  --line: rgba(58,47,54,.10);
  --shadow: rgba(58,47,54,.08);

  --font-display: 'jf-openhuninn', 'Noto Sans TC', sans-serif;
  --font-body: 'Noto Sans TC', 'jf-openhuninn', sans-serif;
  --font-mono: 'Quicksand', 'Noto Sans TC', sans-serif;

  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin:0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.65;
  min-height:100vh;
}
a{ color: inherit; text-decoration: none; }
img{ max-width:100%; display:block; }
ul{ list-style:none; margin:0; padding:0; }
button, input, select{ font-family: inherit; }

.wrap{
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: .001ms !important; animation-iteration-count:1 !important; transition-duration:.001ms !important; }
}

/* ===================== Header ===================== */
.site-header{
  padding: 40px 0 10px;
  position: sticky;
  top:0;
  z-index: 50;
  background-color: #FFD7E3;
  background-image: url('../img/background.svg');
  background-repeat: no-repeat;
  background-size: auto 200px;
  background-position: center ;
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}


.site-header .wrap{ display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap: wrap; }
.brand{ display:flex; align-items:center; gap:10px; font-family: var(--font-display); font-weight:700; font-size: 1.25rem; color: var(--accent); }
.brand .charm-dot{
  width: 28px; height: 28px; border-radius: 50%;
  flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  overflow: hidden;
}
.brand .charm-dot img{ width:100%; height:100%; display:block; }
.brand small{ display:block; font-family: var(--font-mono); font-weight:600; font-size:.68rem; color: var(--ink-soft); letter-spacing:.06em; }
.brand .brand-squeeze{
  display: inline-block;
  font-size: .7em;
  font-weight: 600;
  vertical-align: -1px;
}


.header-nav{ display:flex; align-items:center; gap:8px; flex-wrap: wrap; }
.nav-back{
  font-family: var(--font-mono); font-weight:600; font-size:.82rem;
  color: var(--accent); border:1.5px solid var(--accent); border-radius: 999px;
  padding: 6px 14px; transition: background .15s, color .15s;
  white-space: nowrap;
}
.nav-back:hover{ background: var(--accent); color:var(--surface); }
.header-nav .btn-list{ border-color: var(--ink-soft); color: var(--ink-soft); }
.header-nav .btn-list:hover{ background: var(--ink-soft); color: var(--surface); }

@media (max-width: 600px){
  .site-header .wrap{ flex-direction: column; align-items: flex-start; gap: 10px; }
  .header-nav{ width: 100%; }
}

/* ===================== Hero ===================== */
.hero{ padding: 34px 0 26px; text-align: center; }
.hero p{ width: 100%; max-width: min(90%, 800px); color: var(--ink-soft); font-size: .96rem; margin: 0 auto 18px; }

.search-box{ display:flex; gap:10px; width: 100%; max-width: min(90%, 480px); margin: 0 auto; }
.search-box input{
  flex:1; border: 1px solid var(--line); background: var(--surface);
  border-radius: 999px; padding: 11px 18px; font-size: .92rem; color: var(--ink);
  outline:none; transition: border-color .15s, box-shadow .15s;
}
.search-box input:focus{ border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ===================== Filters ===================== */
.filters{
  width: 100%;
  max-width: min(90%, 800px);
  margin: 22px auto 6px;
  display:flex; flex-wrap:wrap; gap: 14px 12px;
  justify-content: center;
}
.filter-group{ display:flex; flex-direction:column; align-items:center; gap:6px; }
.filter-group label{
  font-family: var(--font-mono); font-size:.7rem; font-weight:700; color: var(--ink-soft);
}
.filter-group select{
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 8px 14px; font-size:.85rem; color: var(--ink); font-weight:500;
  background: var(--surface);
  cursor:pointer;
  transition: border-color .15s;
}
.filter-group select:focus{ border-color: var(--accent); outline: none; }

.result-count{
  font-family: var(--font-mono); font-size:.8rem; color: var(--ink-soft); margin: 18px 0 4px;
}

/* ===================== Studio grid / cards ===================== */
.studio-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
  padding: 16px 0 60px;
}

.charm-card{
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  padding: 22px 20px 18px;
  box-shadow: 0 2px 10px -4px var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  cursor: pointer;
}
.charm-card:hover{
  transform: translateY(-3px);
  box-shadow: 0 10px 20px -10px var(--shadow);
  border-color: var(--accent);
}
.charm-card:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.charm-icon{
  width: 56px; height:56px; border-radius: 50%;
  margin: 0 auto 12px;
  background: var(--accent-soft);
  display:flex; align-items:center; justify-content:center;
  font-family: var(--font-display); font-size: 1.25rem; color: var(--accent);
  overflow:hidden;
}
.charm-icon img{ width:100%; height:100%; object-fit:cover; }

.charm-card h3{
  font-family: var(--font-display); text-align:center; font-size:1.02rem; margin: 0 0 4px; font-weight: 600;
}
.charm-plurk{
  text-align:center; font-family: var(--font-mono); font-size:.76rem; color: var(--ink-soft); margin-bottom:12px;
}
.charm-plurk a{ color: var(--accent); border-bottom: 1px solid transparent; transition: border-color .15s; }
.charm-plurk a:hover{ border-color: var(--accent); }

/* 噗浪帳號 / 官方網站 / E-mail 媒體圖示列 */
.media-row{
  display:flex; align-items:center; justify-content:center; gap:14px;
  margin-bottom:12px;
}
.media-icon{
  display:inline-flex; align-items:center; justify-content:center;
  height:30px; width:30px;
  opacity:.82; transition: opacity .15s ease, transform .15s ease;
  position: relative; z-index: 1; /* 確保點得到圖示連結，不會被卡片整體點擊蓋掉 */
}
.media-icon img{ height:100%; width:100%; object-fit:contain; }
.media-icon:hover{ opacity:1; transform: translateY(-2px); }

/* 首頁卡片上的媒體圖示縮小成 15px，詳情頁維持 30px */
.charm-card .media-icon{ height:15px; width:15px; }

.badge-row{ display:flex; flex-wrap:wrap; gap:6px; justify-content:center; margin-bottom:12px; }
.badge{
  font-size:.7rem; font-weight:600; font-family: var(--font-mono);
  padding: 4px 10px; border-radius: 999px;
  background: var(--bg); color: var(--ink-soft); border: 1px solid var(--line);
}
.status-active{ background: #EAF6EA; color:#3B8A4E; border-color: transparent; }
.status-pause{ background: var(--highlight-soft); color: var(--highlight); border-color: transparent; }
.status-stop{ background:#FBEAEA; color:#C24A4A; border-color: transparent; }
.status-unknown{ background:#F0EEEC; color:#8A8178; border-color: transparent; }
.badge-score{ background:#FFF6D6; color:#9C7A1E; border-color: transparent; }

.tag-row{ display:flex; flex-wrap:wrap; gap:6px; justify-content:center; }
.tag{
  font-size:.7rem; padding:3px 10px; border-radius: var(--radius-sm);
  background: var(--accent-soft); color: var(--accent); font-weight:500;
}

/* ===================== States ===================== */
.state-msg{
  text-align:center; padding: 60px 20px; color: var(--ink-soft);
  font-family: var(--font-mono); font-size: .88rem;
}
.state-msg.error{ color:#C24A4A; }
.spinner{
  width: 30px; height:30px; border-radius:50%;
  border: 3px solid var(--accent-soft); border-top-color: var(--accent);
  margin: 0 auto 14px; animation: spin .8s linear infinite;
}
@keyframes spin{ to{ transform: rotate(360deg); } }

/* ===================== Studio detail page ===================== */
.studio-hero{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin: 24px 0 28px;
  display:flex; gap: 22px; align-items:center; flex-wrap:wrap;
  box-shadow: 0 2px 10px -4px var(--shadow);
}
.studio-hero .charm-icon{ width:84px; height:84px; font-size:1.8rem; margin:0; flex-shrink:0; }
.studio-hero-info .title-row{
  display:flex; align-items:center; flex-wrap:wrap; gap:12px;
  margin-bottom:10px;
}
.studio-hero-info h1{ font-family: var(--font-display); font-size: 1.6rem; margin:0; font-weight: 700; }
.studio-hero-info .charm-plurk{ text-align:left; margin-bottom:10px; }
.studio-hero-info .title-row .media-row{ justify-content:flex-start; margin-bottom:0; }
.studio-hero-info .badge-row{ justify-content:flex-start; }

.info-grid{
  display:grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr));
  gap: 12px; margin-bottom: 32px;
}
.info-card{
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 15px 18px;
}
.info-card .label{ font-family: var(--font-mono); font-size:.7rem; font-weight:700; color: var(--ink-soft); margin-bottom:6px; }
.info-card .value{ font-weight:500; word-break: break-word; }

.section-title{
  font-family: var(--font-display); font-size:1.2rem; margin: 0;
  display:flex; align-items:center; gap:10px; font-weight: 700;
}
.section-title .count{
  font-family: var(--font-mono); font-size:.72rem; background: var(--highlight-soft);
  color: var(--highlight); padding:3px 10px; border-radius:999px; font-weight:700;
}

/* 「經驗回報」標題與排序控制放在同一行，兩端對齊 */
.review-header{
  display:flex; align-items:center; justify-content:space-between;
  flex-wrap: wrap; gap: 10px 16px;
  margin: 32px 0 16px;
}

.score-summary{ display:flex; align-items:baseline; gap:8px; margin-bottom: 18px; }
.score-summary:empty{ display:none; margin-bottom:0; }
.score-summary .num{ font-family: var(--font-display); font-size:2.2rem; color: var(--accent); font-weight: 700; }
.score-summary .of{ color: var(--ink-soft); font-family: var(--font-mono); font-size: .85rem; }

.review-list{ display:flex; flex-direction:column; gap:14px; padding-bottom:60px; }
.review-card{
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 16px 18px;
  border-left: 3px solid var(--accent);
}
.review-top{ display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:8px; }
.review-reviewer{ font-weight:700; }
.review-score{
  font-family: var(--font-mono); font-weight:700; color: var(--highlight);
  background: var(--highlight-soft); border-radius:999px; padding:2px 12px; font-size:.82rem;
}
.review-meta{ font-family: var(--font-mono); font-size:.74rem; color: var(--ink-soft); margin-bottom:10px; }
.review-meta a{ color: var(--accent); border-bottom: 1px solid var(--accent); word-break: break-all; }
.review-comment{ white-space: pre-wrap; }
.review-comment a{ color: var(--accent); border-bottom: 1px solid var(--accent); word-break: break-all; }
.review-images{
  display:flex; flex-wrap:wrap; gap:10px; margin-top:10px;
}
.review-image-link{ display:block; flex: 0 0 auto; width: 200px; max-width: 100%; min-width:0; }
.review-thumb{
  display:block; width:100%; height:auto; border-radius: var(--radius-md);
  border: 1px solid var(--line); box-shadow: 0 2px 10px -4px var(--shadow);
  transition: opacity .15s ease;
}
.review-image-link:hover .review-thumb{ opacity:.88; }
.review-image-link{ cursor: zoom-in; }

/* 工作室回覆：跟原本的經驗分享內容做視覺區隔，凸顯是工作室的官方回應 */
.review-reply{
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius-md);
}
.review-reply-label{
  font-family: var(--font-mono); font-size:.74rem; font-weight:700;
  color: var(--accent); margin-bottom: 4px;
}
.review-reply-content{ white-space: pre-wrap; }
.review-reply-content a{ color: var(--accent); border-bottom: 1px solid var(--accent); word-break: break-all; }

/* 返圖 Lightbox 彈窗 */
.lightbox-overlay{
  display:none; position: fixed; inset:0; z-index: 999;
  background: rgba(0,0,0,.86);
  align-items:center; justify-content:center;
  padding: 40px;
}
.lightbox-overlay.is-open{ display:flex; }
.lightbox-img{
  max-width: min(90vw, 900px); max-height: 85vh;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 40px -8px rgba(0,0,0,.6);
  object-fit: contain;
}
.lightbox-close{
  position:absolute; top:18px; right:22px;
  width:40px; height:40px; border-radius:999px; border:none;
  background: rgba(255,255,255,.12); color:#fff; font-size:1.1rem; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  transition: background .15s ease;
}
.lightbox-close:hover{ background: rgba(255,255,255,.24); }
.lightbox-nav{
  position:absolute; top:50%; transform: translateY(-50%);
  width:48px; height:48px; border-radius:999px; border:none;
  background: rgba(255,255,255,.12); color:#fff; font-size:1.8rem; line-height:1; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  transition: background .15s ease;
}
.lightbox-nav:hover{ background: rgba(255,255,255,.24); }
.lightbox-prev{ left:18px; }
.lightbox-next{ right:18px; }
.lightbox-nav[hidden]{ display:none; }
.lightbox-count{
  position:absolute; bottom:22px; left:50%; transform: translateX(-50%);
  font-family: var(--font-mono); font-size:.8rem; color:#fff; opacity:.8;
}

/* 返圖網址不是圖片格式時，改用連結按鈕呈現 */
.review-link-btn{
  display:inline-flex; align-items:center; justify-content:center;
  font-family: var(--font-mono); font-weight:700; font-size:.8rem;
  padding: 8px 18px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid transparent;
  transition: background .15s ease, color .15s ease;
}
.review-link-btn:hover{ background: var(--accent); color: var(--surface); }

/* 經驗回報排序控制 */
.review-controls{
  display:flex; align-items:center; gap:10px;
}
.review-controls label{
  font-family: var(--font-mono); font-size:.7rem; font-weight:700; color: var(--ink-soft);
}
.review-controls select{
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 7px 12px; font-size:.85rem; color: var(--ink); font-weight:500;
  background: var(--surface); cursor:pointer;
  transition: border-color .15s;
}
.review-controls select:focus{ border-color: var(--accent); outline: none; }

/* ===================== Footer ===================== */
.site-footer{
  border-top: 1px solid var(--line);
  padding: 24px 0 40px; margin-top: 30px;
  color: var(--ink-soft); font-size: .8rem; text-align:center;
}
.site-footer a{ color: var(--accent); font-weight:600; }

@media (max-width: 560px){
  .studio-hero{ flex-direction:column; text-align:center; }
  .studio-hero-info .title-row{ justify-content:center; }
  .studio-hero-info .charm-plurk, .studio-hero-info .badge-row{ justify-content:center; text-align:center; }
}

/* ===================== 站內資訊 (使用說明／更新日誌／前人種樹，共用一個摺疊區塊) ===================== */
.info-details{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  margin: 0 auto 20px;
  overflow: hidden;
  width: 100%;
  max-width: min(90%, 800px);
  text-align: left;
  transition: box-shadow .2s ease;
}
.info-details[open]{ box-shadow: 0 6px 20px var(--shadow); }
.info-summary{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
  list-style: none;
}
.info-summary::-webkit-details-marker{ display: none; }
.info-arrow{
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--ink-soft);
  transition: transform 0.2s ease;
}
.info-details[open] .info-arrow{ transform: rotate(180deg); }

.info-tabs{
  display: flex;
  gap: 4px;
  padding: 0 14px;
  border-top: 1px solid var(--line);
  background: var(--bg-soft, rgba(0,0,0,.02));
}
.info-tab{
  appearance: none;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.info-tab:hover{ color: var(--ink); }
.info-tab.is-active{ color: var(--accent); border-bottom-color: var(--accent); }

.info-panel{ display: none; }
.info-panel.is-active{ display: block; }

.usage-icon{
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: .85rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.usage-content{
  padding: 18px;
  max-height: 280px;
  overflow-y: auto;
  background: var(--surface);
}
.usage-content::-webkit-scrollbar{ width: 6px; }
.usage-content::-webkit-scrollbar-track{ background: transparent; }
.usage-content::-webkit-scrollbar-thumb{ background: var(--accent-soft); border-radius: 99px; }

.usage-line{
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.usage-line:last-child{ margin-bottom: 0; }
.usage-line-num{
  flex-shrink: 0;
  width: 20px; height: 20px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: .68rem;
  display: flex; align-items: center; justify-content: center;
}
.usage-line-text{
  margin: 0;
  font-size: .86rem;
  color: var(--ink-soft);
  line-height: 1.55;
}
.usage-line-text a{ color: var(--accent); border-bottom: 1px solid var(--accent); word-break: break-all; }

/* ---- 更新日誌內容（放在 info-panel 內） ---- */
.changelog-content{
  padding: 18px;
  max-height: 280px;
  overflow-y: auto;
}
.changelog-content::-webkit-scrollbar{ width: 6px; }
.changelog-content::-webkit-scrollbar-track{ background: transparent; }
.changelog-content::-webkit-scrollbar-thumb{ background: var(--accent-soft); border-radius: 99px; }

.changelog-list{ display: flex; flex-direction: column; gap: 14px; }
.changelog-item{ border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.changelog-item:last-child{ border-bottom: none; padding-bottom: 0; }
.changelog-meta{ display: flex; align-items: baseline; gap: 12px; margin-bottom: 4px; flex-wrap: wrap; }
.changelog-time{ font-family: var(--font-mono); font-size: 0.8rem; font-weight: 700; color: var(--accent); }
.changelog-event{
  font-size: 0.82rem; font-weight: 700; color: var(--ink);
  background: var(--highlight-soft); padding: 1px 8px; border-radius: 4px;
}
.changelog-text{ font-size: 0.86rem; color: var(--ink-soft); line-height: 1.55; }
.changelog-text a{ color: var(--accent); border-bottom: 1px solid var(--accent); word-break: break-all; }

/* ---- 前人種樹內容（放在 info-panel 內） ---- */
.credits-content{
  padding: 18px;
  max-height: 280px;
  overflow-y: auto;
}
.credits-content::-webkit-scrollbar{ width: 6px; }
.credits-content::-webkit-scrollbar-track{ background: transparent; }
.credits-content::-webkit-scrollbar-thumb{ background: var(--accent-soft); border-radius: 99px; }

.credits-list{ display: flex; flex-direction: column; gap: 12px; }
.credits-item{
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.credits-item:first-child{
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}
.credits-name{ font-size: 0.86rem; color: var(--ink-soft); }
.credits-name a{ color: var(--accent); border-bottom: 1px solid var(--accent); }
