* {
  margin: 0;
}

/* 標楷體 */
@font-face {
  font-family: 'cwTeXKai';
  font-style: normal;
  font-weight: 500;
  src: url(//fonts.gstatic.com/ea/cwtexkai/v3/cwTeXKai-zhonly.eot);
  src: url(//fonts.gstatic.com/ea/cwtexkai/v3/cwTeXKai-zhonly.eot?#iefix) format('embedded-opentype'),
       url(//fonts.gstatic.com/ea/cwtexkai/v3/cwTeXKai-zhonly.woff2) format('woff2'),
       url(//fonts.gstatic.com/ea/cwtexkai/v3/cwTeXKai-zhonly.woff) format('woff'),
       url(//fonts.gstatic.com/ea/cwtexkai/v3/cwTeXKai-zhonly.ttf) format('truetype');
}

/* 明體 */
@font-face {
  font-family: 'cwTeXMing';
  font-style: normal;
  font-weight: 500;
  src: url(//fonts.gstatic.com/ea/cwtexming/v3/cwTeXMing-zhonly.eot);
  src: url(//fonts.gstatic.com/ea/cwtexming/v3/cwTeXMing-zhonly.eot?#iefix) format('embedded-opentype'),
       url(//fonts.gstatic.com/ea/cwtexming/v3/cwTeXMing-zhonly.woff2) format('woff2'),
       url(//fonts.gstatic.com/ea/cwtexming/v3/cwTeXMing-zhonly.woff) format('woff'),
       url(//fonts.gstatic.com/ea/cwtexming/v3/cwTeXMing-zhonly.ttf) format('truetype');
}

/* 仿宋體 */
@font-face {
  font-family: 'cwTeXFangSong';
  font-style: normal;
  font-weight: 500;
  src: url(//fonts.gstatic.com/ea/cwtexfangsong/v3/cwTeXFangSong-zhonly.eot);
  src: url(//fonts.gstatic.com/ea/cwtexfangsong/v3/cwTeXFangSong-zhonly.eot?#iefix) format('embedded-opentype'),
       url(//fonts.gstatic.com/ea/cwtexfangsong/v3/cwTeXFangSong-zhonly.woff2) format('woff2'),
       url(//fonts.gstatic.com/ea/cwtexfangsong/v3/cwTeXFangSong-zhonly.woff) format('woff'),
       url(//fonts.gstatic.com/ea/cwtexfangsong/v3/cwTeXFangSong-zhonly.ttf) format('truetype');
}


/* body{
  font-family:cwTeXMing,cwTeXKai,serif;
} */


.logo-text a {
  color: inherit;              
  text-decoration: none;       
}

h1.logo-text{
  font-family:cwTeXFangSong,cwTeXMing,cwTeXKai,serif;
  font-size: 40px;
}

.topicweb {
  display: block;
  color: inherit;          
  text-decoration: none;   
  height: 100%;
}
/* 

/* logo btn */

/* 外層 wrapper 負責置中 */
.logo-btn-wrapper {
  width: 100%;
  text-align: center;
  margin-top: 40px;
}

/* 按鈕樣式 */
.logo-btn {
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 2rem;
  text-decoration: none;
  display: inline-block;
  border: 1px solid gray;
  background: unset;
  color: #9496c9;
  border-color: #9496c9;
  transition: all 0.3s ease;
}

@keyframes blink {
  0%, 100% {
    background-color: #787ab6;   
    color: #f8f4f4;              
  }
  50% {
    background-color: unset;     
    color: #9496c9;
  }
}


.blink {
  animation: blink 3s infinite;
}

/* logo btn end */



h2.party-list {
  color: white;
  background: #a4a6ce;
  padding: 16px;
  text-align: center;
  letter-spacing: 2px;
  box-shadow: 0px 2px 4px gray;
  margin-bottom: 16px;
  border-radius: 8px;
  font-size: 30px;
}

h4.topic-inner {
  color: black;
  padding: 16px;
  text-align: right;
  letter-spacing: 2px;  
  font-size: 15px;
}

h2.topic-inner {
  color: black;
  background: transparent;
  border: 5px dashed #a4a6ce;
  padding: 16px;
  text-align: center;
  letter-spacing: 2px;  
  margin-bottom: 16px;
  border-radius: 16px;
  font-size: 30px;
}

h3.inner-page {
  color: black;
  background: transparent;
  border: none !important;
  padding: 16px;
  text-align: center;
  letter-spacing: 2px;  
  margin-bottom: 16px;
  border-radius: 16px;
  font-size: 30px;
}

.font-md {
  font-size: 22px;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
  margin-bottom: 15px;
}

.font-sm {
  font-size: 20px;
  text-align: justify;
  margin-left: 10px;
  margin-right: 10px;
}

.font-md a,
.font-sm a {
  text-decoration: none;
  color: inherit;
}

.header {
  position: fixed;
  width: 100%;
  height: 66px;
  background: #a4a6ce;
  box-shadow: 0px 2px 4px grey;
}

.header-height {
  position: relative;
  display: flex;
  align-items: center;
  height: 66px;
}

.burger {
  display: none;
  width: 36px;
  height: 24px;
  position: absolute;
  top: 22px;
  right: 0;
  cursor: pointer;
}

.burger1,
.burger2,
.burger3 {
  position: absolute;
  width: 36px;
  height: 4px;
  background: #363636;
  border-radius: 8px;
}

.burger1 {
  top: 0;
  left: 0;
}

.burger2 {
  top: 10px;
  left: 0;
}

.burger3 {
  top: 20px;
  left: 0;
}

.navbar {
  position: fixed;
  right: 140px;
  top: 0px;
  transition: right 0.3s ease;
  z-index: 500;  
}

/* 開啟 nav 時滑出 */
.nav-open .navbar {
  right: 0;
}

/* 遮罩顯示 */
.overlay {
  display: none;
  position: fixed;
  top: 66px;
  left: 0;
  width: 100vw;
  height: calc(100vh - 66px);
  background-color: rgba(0, 0, 0, 0.3);
  z-index: 400;
}
.nav-open .overlay {
  display: block;
}

.navbar ul {
  display: flex;
  align-items: center;   
  height: 66px;        
  margin: 0;
}

.navbar ul li {
  display: flex;
  align-items: center;  
  height: 100%;
}

.navbar a {
  display: block;
  padding: 0 24px;
  font-size: 25px;
  font-weight: 600;
  font-family: cwTeXFangSong, cwTeXMing, cwTeXKai, serif;
  color: rgb(8, 8, 8);
  text-decoration: none;
}

.navbar ul li:hover {
  background: #9496c9;
}

.content {
  width: 100%;
  min-height: 100vh;
  background: #e5e5e5;
  padding-top: 100px;
}

.container {
  width: 80%;
  margin: 0 auto;
}

.card-outer {
  display: flex;
  flex-wrap: wrap;
}

.card {
  width: calc(100% / 3 - 20px);
  background: #f9f9f9;
  margin: 10px;
  border-radius: 8px;
  box-shadow: 2px 2px 8px lightgray;
  overflow: hidden;
}

.card:hover {
  cursor: pointer;
}

.card-img:hover img {
  transform: scale(1.2, 1.2);
}

.card-img {
  overflow: hidden;
}

.card-img img {
  width: 100%;
  max-height: 600px;
  display: block;
}

.card-text {
  padding: 12px;
}


.bang-img img {
  width: 60%;
  max-height: 80px;
  max-width: 250px; 
  display: block;
  margin: 0 auto;
  margin-top:10px;
}



/* 內頁 */



.topic-content {
  width: 100%;
  min-height: 100vh;
  background: #e5e5e5;
  padding-top: 100px;
}

.topic-container {
  width: 95%;
  margin: 0 auto;  
}

.intro{
  font-size:25px;
}

.upper-band {
  background: #cfd1e6;
  width:100%;
  height: 60px; 
  display: flex; 
  align-items: center; 
  font-size:25px;
}

.topic-card-body {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px; 
}

.inner-img {
  width: 40%;
  height: auto;
  border-radius: 8px;
  object-fit: cover;
  padding:10px;
}



/* button */

.btn-group {
  width: 60%;
  display: flex;
  flex-direction: column;
}

.btn-group .btn {
  text-align: left;
  width: 95%;
}

.btn {
  border-radius: 8px;
  margin: 10px;
  padding: 10px 20px;
  width: 60%;          
  text-align: left;        
  box-sizing: border-box;  
  display: block;  
  float:right;       
}

.btn:hover {
  cursor: pointer;
}

.btn-outline {
  border: 1px solid gray;
  background: unset;
}

.btn-md {
  font-size: 1.5rem;  
}

a.btn {
  text-decoration: none; 
  display: inline-block;  
}

.btn-outline-light {
  color: #9496c9;
  border-color: #9496c9;
}

.btn-outline-light:hover {
  color: #f8f4f4;
  background-color: #787ab6;
}

  /* button end */



.topic-card-outer {
  display: flex;
  flex-wrap: wrap;
}

.topic-card {
  width: 100%;  
  margin: 10px;
  border-radius: 8px;
  box-shadow: 2px 2px 8px lightgray;
  overflow: hidden;
  border: 1px solid #a4a6ce;
}

.topic-card:hover {
  cursor: pointer;
}


.topic-card-text {
  padding: 12px;
}

.topic-bang-img img {
  width: 60%;
  max-height: 80px;
  max-width: 250px; 
  display: block;
  margin: 0 auto;
  margin-top:10px;
}

/* 內頁end */

.fixed-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: #cfd1e6;
  color: #333;
  text-align: center;
  padding: 12px 20px;
  font-size: 1.5rem;
  font-weight: bold;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
  z-index: 999;
}


/* 文章 */

.title-font {
  background-color: rgba(207, 209, 230, 0.4);  
  color: #333;
  text-align: left;                      
  padding: 12px 20px;
  font-size: 2rem;
  font-weight: bold;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);   
  border-radius: 6px;                         
}

.reference {
  background-color: rgba(207, 209, 230, 0.4);  
  color: #333;
  text-align: center;                      
  padding: 12px 20px;
  font-size: 2rem;
  font-weight: bold;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);   
  border-radius: 6px;                      
}

.inner-font{
  text-align: justify;  
  padding: 30px 30px;
  padding-left:60px;
  font-size: 1.5rem;
  line-height:50px;
}

/* 問答區 */

.upper-band {
  background: #cfd1e6;
  width:100%;
  height: 60px; 
  display: flex; 
  align-items: center; 
  padding: 0 30px;
  font-size:25px;
}

.topic-card-body {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px; 
}

/* 問答區end */



/* 文章 end */

@media screen and (max-width: 768px) {
  .container {
    width: 90%;
  }
  .card {
    width: calc(50% - 20px);
  }
  .burger {
    display: block;
  }
  .header {
    z-index: 550;
  }
  .navbar {
    top: 66px;
    z-index: 500;
  }
  .navbar ul {
    flex-direction: column;
    background: #a4a6ce;
    width: 240px;
    height: 100vh;
  }
}

@media screen and (max-width: 480px) {
  .card {
    width: calc(100% - 20px);
  }
}


@media screen and (max-width: 768px) {
  .navbar {
    width: 240px;
    right: -240px; /* 一開始藏起來 */
    transition: right 0.3s ease;
  }

  .nav-open .navbar {
    right: 0; /* 打開時滑入 */
  }

  .navbar ul {
    flex-direction: column;
    background: #a4a6ce;
    width: 240px;
    height: 100vh;
    padding: 0;  /* 確保沒有空白 */
  }

  .navbar ul li {
    width: 100%;
    height: auto;
  }

  .navbar a {
    display: block;
    padding: 16px 24px;
    width: 100%;               
    box-sizing: border-box;   
    text-align: left;         
  }

  .navbar ul li:hover {
    background: rgb(138, 133, 201);
  }

    .topic-card-body {
    flex-direction: column;
    align-items: center;
  }

  .inner-img {
    width: 90%;
  }

  .btn-group {
    width: 100%;
    align-items: center;
  }

  .btn {
    width: 90%;
    font-size: 1.2rem;
  }

    .fixed-footer {
    font-size: 1rem;
    padding: 8px 12px;
    line-height: 1.3;
  }

  .force-break {
  word-break: break-word;
  display: inline-block;
  }

  .content {
    padding-bottom: 60px;
  }

  .inner-font {
    font-size: 1rem;           /* 或改用 clamp() 比較彈性 */
    line-height: 1.6;          /* 改為倍數，避免過高 */
    padding: 20px;             /* 縮減左右邊距 */
  }

  .inner-font {
    font-size: 1rem;
    line-height: 1.6;
    padding: 20px;
  }

  /* 標題區塊：.title-font */
  .title-font,.reference {
    font-size: 1.2rem;
    padding: 10px 16px;
  }

  /* 子標題：.topic-inner h2 */
  .topic-inner h2,
  h2.topic-inner,h3.inner-page {
    font-size: 1.3rem;
    padding: 12px;
  }

  .upper-band {
    font-size: 1.2rem;
    padding: 10px;
    max-height: 30px; 
    align-items: center;
  }

  .intro{
  font-size:15px;
  }

  .logo-btn {
    font-size: 1.5rem;      
    padding: 8px 16px;      
  }



}
