/* 通用 */
:root {
  --color-gold-100: #FCF9F5;
  --color-gold-200: #eadab9;
  --color-gold-300: #DCC28B;
  --color-gold-500: #B98417;

  --color-brown-100: #7E5A43;
  --color-primary-gray: #A0A0A0;

  --color-red: #c82c27;
  --color-green: #299749;
}

em { font-weight: 600; color: var(--color-gold-500); font-style: normal;}

.h2 { color: var(--color-brown-100); }


.text-brown { color: var(--color-brown-100);}
.text-larger { font-size: 1.2em; }
.hr-custom {
  margin-block: 20px;
  border-color: var(--color-gold-500);
}

.monthly-title-md { 
  color: var(--color-gold-500); 
  font-weight: 500; 
  line-height: 1.5; 
  margin-bottom: 12px;
}

.gradient-bar-left {
  height: 5px;
  background: #87553A;
  background: linear-gradient(270deg, rgba(135, 85, 58, 1) 34%, rgba(227, 205, 170, 0.6) 89%, rgba(227, 205, 170, 0) 100%);
}
.gradient-bar-right {
  height: 5px;
  background: #87553A;
  background: linear-gradient(90deg, rgba(135, 85, 58, 1) 34%, rgba(227, 205, 170, 0.6) 89%, rgba(227, 205, 170, 0) 100%);
}

.bg-gradient {
  background: #FFFDF8;
  background: 
  url("../periodical/bg-rectangle.png"),
  linear-gradient(180deg, rgba(255, 253, 248, 1) 9%, rgba(238, 228, 209, 1) 100%);
  background-repeat: no-repeat,no-repeat;
  background-size: 40% auto,100% 100%;
  background-position: left bottom;
}

.bg-gold-100 {
  background-color: var(--color-gold-100);
}

/* hero banner */
.hero-title-container {
  position: absolute;
  left: 6%;
  top: 35%;
}

.hero-title {
  margin-bottom: 0.375rem; /* mb-1.5 → 6px */
  font-size: 1.5rem;       /* text-2xl → 24px */
  font-weight: 600;
  line-height: 28px;       /* leading-[28px] */
  letter-spacing: 0.12em;
  color: white;
}

.hero-subtitle {
  font-size: 1rem;         /* text-base → 16px */
  font-weight: 500;
  letter-spacing: 0.12em;
  color: white;
}

/* ---------- 響應式斷點 ---------- */

/* sm: ≥640px */
@media (min-width: 640px) {
  .hero-title-container {
    left: 6%;
  }
  .hero-title {
    margin-bottom: 1rem;   /* mb-4 */
    font-size: 40px;
    line-height: 1;
    letter-spacing: 0.16em;
  }
  .hero-subtitle {
    font-size: 1.5rem;     /* text-2xl → 24px */
  }
}

/* md: ≥768px */
@media (min-width: 768px) {
  .hero-title-container {
    top: 30%;
  }
}

/* xl: ≥1280px */
@media (min-width: 1280px) {
  .hero-title {
    margin-bottom: 1.25rem; /* mb-5 → 20px */
    font-size: 50px;
    line-height: 1.1;
  }
  .hero-subtitle {
    padding-left: 0.25rem;  /* xl:px-1 → 左右各 4px */
    padding-right: 0.25rem;
    font-size: 1.875rem;    /* text-3xl → 30px */
  }
}

/* 表格 */
.monthly-table {
  width: 100%;
}
.monthly-table .head {
  background-color: var(--color-gold-500);
  color: #fff;
  font-size: 14px;
  line-height: 21px;
  padding-top: .375rem;
  padding-bottom: .375rem;
}
.monthly-table .body td,
.monthly-table .body th{
  font-size: 14px;
  line-height: 21px;
  font-weight: 400;
  padding: .75rem;
}
.monthly-table .border th,
.monthly-table .border td{
  border: 1px solid var(--color-gold-300);
}
.monthly-table .highlight.highlight {
  color: var(--color-brown-100);
  font-weight: 500;
}
.monthly-table .up {
  color: var(--color-red);
}
.monthly-table .down {
  color: var(--color-green);
}
/* 資產天氣表格 */
.weather-table {
  width: 100%;
}
.weather-table .head {
  background-color: var(--color-gold-200);
  color: var(--color-brown-100);
  font-size: 14px;
  line-height: 21px;
  padding-top: .375rem;
  padding-bottom: .375rem;
}
.weather-table .head img{
  margin: auto;
  width: 40%;
}
.weather-table .body td,
.weather-table .body th{
  font-size: 14px;
  line-height: 21px;
  font-weight: 400;
  padding: .75rem;
}
.weather-table .border th,
.weather-table .border td{
  border: 1px solid var(--color-brown-100);
  position: relative;
}
.weather-table .highlight.highlight {
  background-color: var(--color-gold-200);
  color: var(--color-brown-100);
  font-weight: 500;
}
.diagonal-head {
  position: relative;
  height: 70px;
  background: 
    linear-gradient(
      to top right,
      transparent calc(50% - 0.5px),
      var(--color-brown-100) 50%,
      transparent calc(50% + 0.5px)
    );
}

.thead-line {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px 10px;
  z-index: 200;
}
.thead-line-txt1 {
  align-self: flex-end;
  font-size: 14px;
  white-space: nowrap;
}
.thead-line-txt2 {
  align-self: flex-start;
  font-size: 14px;
  white-space: nowrap;
}


/* 文章內元件 */
/* 圖＋底色 標題 */
.bg-title-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 0.5rem;
  background-color: var(--color-gold-100);
}

.bg-title-box .h3 {
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.bg-title-box .subtitle {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
}

/* 側邊選單 */
/* === 固定按鈕 === */
.toc-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10;
  color: var(--color-brown-100);
  border: 1px solid var(--color-brown-100);
  border-radius: 8px;
  width: 72px;
  height: 32px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  background: rgba(255,255,255,0.9);
  filter: blur(0.5px);
  display: none; /* 只在小螢幕顯示 */
}
.toc-toggle .icon { width: 15px; }

/* === 左側目錄（桌機預設：左側 sticky） === */
.toc {
  position: sticky;
  top: 96px;
  width: 220px;
  align-self: flex-start;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  transition: transform 0.35s ease, opacity 0.25s ease;
  padding: 40px 0 0 80px;
  z-index: 998;
}
.aside-title { color: var(--color-brown-100); }
.toc .icon { width: 20px; margin-right: 8px; }
.toc ul { list-style: none; margin-left: 6px; margin-top: 10px; }
.toc a {
  display: block;
  padding: 0.24rem 1rem;
  text-decoration: none;
  color: var(--color-primary-gray);
  border-left: 1px solid var(--color-primary-gray);
}
.toc a:hover {
  color: var(--color-gold-500);
  border-left: 1px solid var(--color-gold-500);
}
.toc a.active {
  color: var(--color-gold-500);
  border-left: 1px solid var(--color-gold-500);
}

/* 收起狀態（區域控制） */
.toc.is-collapsed {
  transform: translateX(-12px);
  opacity: 0;
  pointer-events: none;
}

/* === 漂浮膠囊（桌機/手機共用） === */
.toc.is-floating {
  position: fixed;
  top: 72px; /* 依 header 調整 */
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  max-width: calc(100% - 48px);
  max-height: none;
  background: rgba(255,255,255,0.96);
  backdrop-filter: saturate(120%) blur(6px);
  padding: 8px 12px;
  border-radius: 9999px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.12);
  overflow: visible;
}
.toc.is-floating .aside-title { display: none; }
.toc.is-floating ul {
  display: flex;
  align-items: center;
  white-space: nowrap;
  margin-top: 0;
  gap: 0; /* 你的設計以貼合為主，若要間距可改數值 */
}
.toc.is-floating li { margin: 0; }
.toc.is-floating a {
  padding: 8px 14px;
  border: none;            /* 移除左側邊框 */
  line-height: 1;
}
.toc.is-floating a:hover { color: var(--color-brown-100); }
.toc.is-floating a.active {
  color: var(--color-brown-100);
  position: relative;
}
.toc.is-floating a.active::after {
  content: "";
  width: 0; height: 0;
  border-style: solid;
  border-width: 0 6px 10px 6px;
  border-color: transparent transparent #7E5A43 transparent;
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
}
/* 漂浮時不要做左側縮進的 transform/透明 */
.toc.is-floating.is-collapsed {
  transform: translateX(-50%);
  opacity: 1;
  pointer-events: auto;
}

/* === RWD：<1024px 預設為抽屜；但在 is-floating 區間要改成膠囊 === */
@media (max-width: 1200px) {
  /* 抽屜預設 */
  .toc {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    max-height: none;
    background: #fff;
    padding: 1.5rem;
    box-shadow: 2px 0 6px rgba(0,0,0,0.1);
    transform: translateX(-100%);
  }
  .toc.is-open { transform: translateX(0); }

  /* 浮動區間：手機也要顯示膠囊（覆蓋抽屜樣式） */
  .toc.is-floating {
    top: 72px;
    left: 50%;
    transform: translateX(-50%);   /* 置中 */
    width: auto;
    height: auto;
    max-height: none;
    max-width: calc(100% - 48px);
    padding: 8px 12px;
    border-radius: 9999px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.12);
  }
  .toc.is-floating ul {
    display: flex;
    white-space: nowrap;
    margin-top: 0;
  }
  .toc.is-floating a { border: none; }

  /* 固定按鈕在小螢幕顯示 */
  .toc-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .toc.is-floating {
    top: 52px;
    width: 100vw;
    max-width: 1000px;
    padding: 8px 0px;
    border-radius:0px;
    overflow-x: auto;
  }
  .toc.is-floating::-webkit-scrollbar {
    display: none;
  }
}

/* 避免切換膠囊時抖動 */
.toc.no-anim { transition: none !important; }

.overview {
  margin-top: -300px;
}
.toc.is-floating + .overview {
  margin-top: 0;
}
@media screen and (max-width: 1200px) {
  .overview {
    margin-top: 0;
  }
}

/* 內容 */
/* 國旗 */
.title-icon{
  width: 16%;
}

/* 國際財經日曆 */
  .calendar-title{
    color: var(--color-brown-100);
  }
  .calendar {
    width: 100%;
    max-width: 800px;
    border-collapse: collapse;
    table-layout: fixed;
    background: #fff;
  }
  .calendar th {
    background-color: var(--color-gold-200);
    color: var(--color-brown-100);
    font-size: 14px;
    line-height: 21px;
    padding-top: .375rem;
    padding-bottom: .375rem;
    border: 1px solid var(--color-brown-100);
  }
  .calendar td {
    height: 90px;
    vertical-align: top;
    border: 1px solid var(--color-brown-100);
    padding: 2px 6px;
    position: relative;
  }
  .calendar .date {
    color: #555;
    font-size: 12px;
  }
  .calendar .event {
    margin-top: 5px;
    background: var(--color-gold-500);
    border-radius: 6px;
    padding: 4px 6px;
    font-size: 12px;
    color: #ffffff;
    line-height: 1.2;
  }
  .calendar .holiday{
    color: #c1c1c1;
  }
  .calendar .rest{
    background: var(--color-primary-gray);
  }

  /* 禁止使用者選取或修改 */
  /* .calendar {
    user-select: none;
    pointer-events: none;
  } */
