/* ============================================================
   NPX 風險揭露 — npxexchangeltd.cc
   設計概念：警示公告／風險告示
   ============================================================ */

:root {
  --ink: #14110F;
  --panel: #1E1A16;
  --panel-2: #241F1A;
  --text: #E8E2D8;
  --text-soft: #D8D0C3;
  --muted: #9C948A;
  --amber: #E0A030;
  --amber-pale: #F0D8A8;
  --rust: #B4432C;
  --rust-text: #E4896F;
  --line: rgba(232, 226, 216, 0.13);
  --line-strong: rgba(232, 226, 216, 0.26);
  --serif: "Noto Serif TC", "Songti TC", "PMingLiU", Georgia, serif;
  --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --shell: 1120px;
  --ease: cubic-bezier(0.22, 0.68, 0.16, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.9;
  letter-spacing: 0.02em;
  background-color: var(--ink);
  background-image:
    radial-gradient(1150px 620px at 84% -6%, rgba(224, 160, 48, 0.10), transparent 62%),
    radial-gradient(900px 560px at -12% 34%, rgba(180, 67, 44, 0.075), transparent 60%),
    radial-gradient(760px 500px at 50% 108%, rgba(224, 160, 48, 0.05), transparent 65%),
    repeating-linear-gradient(132deg, rgba(232, 226, 216, 0.032) 0 1px, transparent 1px 13px),
    linear-gradient(180deg, #16130F 0%, #14110F 46%, #12100D 100%);
  background-attachment: fixed;
  position: relative;
}

/* 紙張雜訊層 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

img {
  max-width: 100%;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

a {
  color: var(--amber);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color 0.3s var(--ease), text-decoration-color 0.3s var(--ease);
}

a:hover {
  color: var(--amber-pale);
}

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection {
  background: rgba(224, 160, 48, 0.35);
  color: #FFF8EA;
}

.skip {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 100;
  background: var(--amber);
  color: #1A1409;
  font-weight: 500;
  padding: 0.7rem 1.1rem;
  text-decoration: none;
  transition: top 0.25s var(--ease);
}

.skip:focus {
  top: 12px;
  color: #1A1409;
}

.shell {
  width: min(100% - 44px, var(--shell));
  margin-inline: auto;
}

/* ---------- 頁首 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(20, 17, 15, 0.82);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar::before {
  content: "";
  display: block;
  height: 2px;
  background: linear-gradient(90deg, var(--amber) 0%, rgba(224, 160, 48, 0.45) 30%, transparent 78%);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  min-height: 62px;
  flex-wrap: wrap;
  padding-block: 0.35rem;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
  color: var(--text);
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.04rem;
  letter-spacing: 0.12em;
  white-space: nowrap;
  padding-block: 0.5rem;
}

.brand:hover {
  color: var(--text);
}

.brand__mark {
  color: var(--amber);
  font-size: 1.25rem;
  line-height: 1;
}

.brand em {
  font-style: normal;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.86rem;
  letter-spacing: 0.18em;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.35rem 0.7rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  border-bottom: 2px solid transparent;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.nav a:hover {
  color: var(--text);
  border-bottom-color: rgba(224, 160, 48, 0.45);
}

.nav a[aria-current="page"] {
  color: var(--amber);
  border-bottom-color: var(--amber);
}

/* ---------- 首屏 ---------- */

.hero {
  padding-block: clamp(2.6rem, 7vw, 5.2rem) clamp(1.4rem, 3vw, 2.2rem);
  position: relative;
  z-index: 1;
}

.kicker {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0 0 1.2rem;
  color: var(--amber);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.kicker::before {
  content: "";
  width: 34px;
  height: 1px;
  background: var(--amber);
  flex: none;
}

h1 {
  margin: 0 0 1.35rem;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.9rem, 4.6vw, 3.25rem);
  line-height: 1.5;
  letter-spacing: 0.015em;
  color: #F1EADC;
  text-wrap: balance;
  max-width: 18em;
}

.lede {
  margin: 0;
  max-width: 44em;
  padding: 1.05rem 1.2rem 1.05rem 1.15rem;
  border-left: 3px solid var(--amber);
  background: linear-gradient(90deg, rgba(224, 160, 48, 0.075), rgba(224, 160, 48, 0.015) 62%, transparent);
  color: var(--text-soft);
  font-size: 1.02rem;
  line-height: 1.95;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.9rem;
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.79rem;
  letter-spacing: 0.1em;
}

.hero__meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.hero__meta .dot {
  width: 4px;
  height: 4px;
  background: var(--amber);
  border-radius: 50%;
  opacity: 0.8;
}

/* ---------- 內文 ---------- */

.article {
  max-width: 820px;
  padding-left: clamp(0px, 5.5vw, 68px);
  padding-right: clamp(0px, 2vw, 24px);
  padding-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.sec {
  margin-top: clamp(2.7rem, 6vw, 4.2rem);
}

.sec-num {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0;
  color: var(--amber);
  font-family: var(--serif);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.26em;
}

.sec-num::after {
  content: "";
  height: 1px;
  width: 58px;
  background: linear-gradient(90deg, rgba(224, 160, 48, 0.55), transparent);
}

.sec h2 {
  margin: 0.45rem 0 1.1rem;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.42rem, 2.7vw, 1.9rem);
  line-height: 1.62;
  letter-spacing: 0.02em;
  color: #F0E8DA;
  text-wrap: balance;
}

@media (min-width: 900px) {
  .sec h2 {
    margin-left: -52px;
  }
}

.sec h3 {
  margin: 1.9rem 0 0.55rem;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.14rem;
  line-height: 1.7;
  letter-spacing: 0.03em;
  color: #EADFCB;
}

p {
  margin: 0 0 1.15em;
}

.article p {
  max-width: 40em;
}

strong {
  font-weight: 600;
  color: #F2E4C8;
}

em {
  font-style: normal;
  color: var(--text-soft);
}

/* 清單 */

ul,
ol {
  max-width: 40em;
  margin: 0 0 1.35rem;
  padding-left: 1.45em;
}

li {
  margin-bottom: 0.45em;
}

ul li::marker {
  color: var(--amber);
}

ol li::marker {
  color: var(--amber);
  font-weight: 600;
}

.list-plain {
  list-style: none;
  padding-left: 0;
}

.list-plain li {
  position: relative;
  padding-left: 1.4rem;
  margin-bottom: 0.6em;
}

.list-plain li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.78em;
  width: 9px;
  height: 1px;
  background: var(--amber);
}

.list-plain--rust li::before {
  background: var(--rust);
}

/* 條款式風險卡 */

.risklist {
  list-style: none;
  counter-reset: risk;
  padding: 0;
  margin: 1.7rem 0 1.9rem;
  max-width: 42em;
}

.risklist > li {
  counter-increment: risk;
  display: grid;
  grid-template-columns: 3.1rem 1fr;
  gap: 1.1rem;
  padding: 1.35rem 0 1.2rem;
  border-top: 1px solid var(--line);
  margin: 0;
}

.risklist > li:last-child {
  border-bottom: 1px solid var(--line);
}

.risklist > li::before {
  content: "0" counter(risk);
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.1em;
  color: var(--amber);
  padding-top: 0.18rem;
}

.risklist h3 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
}

.risklist p {
  margin: 0 0 0.55rem;
  font-size: 0.98rem;
  color: var(--text-soft);
}

.risklist p:last-child {
  margin-bottom: 0;
}

@media (max-width: 560px) {
  .risklist > li {
    grid-template-columns: 2.2rem 1fr;
    gap: 0.8rem;
  }
}

/* 警示區塊 */

.notice {
  margin: 1.8rem 0;
  padding: 1.15rem 1.3rem 1.2rem;
  background: linear-gradient(180deg, #221D18 0%, #1E1A16 100%);
  border: 1px solid var(--line);
  border-left: 5px solid var(--amber);
  box-shadow: 0 24px 46px -38px #000;
  max-width: 42em;
}

.notice--major {
  border-left-color: var(--rust);
}

.notice__tag {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.45rem;
  color: var(--amber);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
}

.notice--major .notice__tag {
  color: var(--rust-text);
}

.notice p {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.9;
  color: var(--text-soft);
}

.notice p + p {
  margin-top: 0.55rem;
}

/* 引文 */

.quote {
  margin: 1.9rem 0;
  padding: 1.35rem 1.5rem 1.3rem;
  border-left: 4px solid var(--amber);
  background: linear-gradient(135deg, rgba(224, 160, 48, 0.10), rgba(224, 160, 48, 0.025) 70%);
  max-width: 42em;
}

.quote p {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.06rem;
  line-height: 2;
  color: #F3E7D1;
}

.quote .orig {
  display: block;
  margin-bottom: 0.6rem;
  font-family: var(--sans);
  font-size: 0.9rem;
  line-height: 1.85;
  color: var(--text-soft);
}

.quote cite {
  display: block;
  margin-top: 0.75rem;
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  color: var(--muted);
}

/* 可單獨引用的粗體句 */

.pull {
  margin: 1.8rem 0;
  padding: 1rem 0 1rem 1.15rem;
  border-left: 3px solid var(--rust);
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.06rem, 1.8vw, 1.18rem);
  line-height: 1.9;
  letter-spacing: 0.02em;
  color: #F4EBD9;
  max-width: 40em;
}

.pull--amber {
  border-left-color: var(--amber);
}

/* 表格 */

.tablewrap {
  margin: 1.7rem 0 1.9rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: rgba(30, 26, 22, 0.55);
  max-width: 46em;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 0.92rem;
  line-height: 1.75;
}

th {
  padding: 0.8rem 0.95rem;
  text-align: left;
  font-weight: 600;
  color: var(--amber);
  background: rgba(224, 160, 48, 0.07);
  border-bottom: 1px solid var(--line-strong);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

td {
  padding: 0.85rem 0.95rem;
  vertical-align: top;
  color: var(--text-soft);
  border-bottom: 1px solid var(--line);
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody th {
  background: transparent;
  color: var(--text);
  white-space: normal;
  font-weight: 500;
}

@media (max-width: 680px) {
  .tablewrap {
    border: 0;
    background: transparent;
    overflow-x: visible;
  }

  table {
    min-width: 0;
  }

  thead {
    display: none;
  }

  tbody tr {
    display: block;
    margin-bottom: 0.9rem;
    padding: 0.9rem 1rem 0.75rem;
    border: 1px solid var(--line);
    background: rgba(30, 26, 22, 0.6);
  }

  tbody th[scope="row"] {
    padding: 0 0 0.55rem;
    border: 0;
    font-family: var(--serif);
    font-size: 1rem;
    color: #EADFCB;
  }

  tbody td {
    display: block;
    padding: 0.4rem 0 0.45rem;
    border: 0;
  }

  tbody td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.18rem;
    color: var(--amber);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
  }
}

/* 文件圖 */

.docs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.9rem 0 2rem;
  max-width: 46em;
}

.doc {
  margin: 0;
  padding: 0.65rem 0.65rem 0.9rem;
  background: linear-gradient(180deg, #231E19, #1C1814);
  border: 1px solid var(--line);
}

.doc__frame {
  display: grid;
  place-items: center;
  aspect-ratio: 3 / 4;
  padding: 0.5rem;
  background: #F2ECDF;
  border: 1px solid rgba(224, 160, 48, 0.4);
}

.doc img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
}

.doc figcaption {
  margin-top: 0.7rem;
  font-size: 0.79rem;
  line-height: 1.8;
  color: var(--muted);
}

.doc figcaption b {
  display: block;
  margin-bottom: 0.15rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #E4DCCD;
  letter-spacing: 0.04em;
}

@media (max-width: 760px) {
  .docs {
    grid-template-columns: 1fr;
  }

  .doc {
    max-width: 320px;
  }
}

/* 定義清單 */

dl.defs {
  max-width: 40em;
  margin: 1.6rem 0 1.9rem;
}

dl.defs dt {
  margin-top: 1.15rem;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.02rem;
  color: #EBDFC9;
  letter-spacing: 0.04em;
}

dl.defs dt:first-child {
  margin-top: 0;
}

dl.defs dd {
  margin: 0.3rem 0 0;
  padding-left: 1.1rem;
  border-left: 1px solid var(--line-strong);
  color: var(--text-soft);
  font-size: 0.96rem;
}

/* 頁面導覽卡 */

.nextgrid {
  display: grid;
  gap: 0.85rem;
  margin: 1.6rem 0 1.9rem;
  max-width: 42em;
}

.next {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem;
  background: linear-gradient(180deg, #211C17, #1D1915);
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.35s var(--ease), background 0.35s var(--ease);
}

.next:hover {
  border-color: rgba(224, 160, 48, 0.5);
  background: #241F19;
  color: var(--text);
}

.next iconify-icon {
  font-size: 1.45rem;
  color: var(--amber);
}

.next span {
  display: block;
}

.next .next__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.6;
  letter-spacing: 0.03em;
}

.next .next__desc {
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.7;
}

.next .next__arrow {
  color: var(--muted);
  font-size: 1.1rem;
  transition: transform 0.35s var(--ease), color 0.35s var(--ease);
}

.next:hover .next__arrow {
  transform: translateX(4px);
  color: var(--amber);
}

/* 更新日期 */

.updated {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 2.6rem 0 0;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  width: 100%;
  max-width: 40em;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}

.updated iconify-icon {
  font-size: 1rem;
  color: var(--amber);
}

/* ---------- 頁尾 ---------- */

.foot {
  position: relative;
  z-index: 1;
  margin-top: clamp(3.5rem, 8vw, 6rem);
  padding: 3rem 0 2.2rem;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(30, 26, 22, 0.5), rgba(16, 14, 12, 0.92));
}

.foot::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: min(220px, 40%);
  height: 2px;
  background: linear-gradient(90deg, var(--amber), transparent);
}

.foot__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 2.4rem;
  align-items: start;
}

.foot h2 {
  margin: 0 0 0.9rem;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.22em;
  color: var(--amber);
}

.foot ul {
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: none;
}

.foot li {
  margin-bottom: 0.7rem;
  font-size: 0.87rem;
  line-height: 1.8;
  color: var(--muted);
}

.foot li a {
  display: inline-block;
  padding-block: 0.15rem;
  color: var(--text-soft);
  font-weight: 500;
  text-decoration-color: rgba(224, 160, 48, 0.55);
}

.foot li a:hover {
  color: var(--amber);
}

.disclaimer {
  margin: 0;
  padding: 1.05rem 1.15rem;
  border: 1px solid var(--line);
  background: rgba(20, 17, 15, 0.6);
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.9;
  max-width: 46em;
}

.colophon {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin: 2rem 0 0;
  padding-top: 1.3rem;
  border-top: 1px solid var(--line);
  color: rgba(156, 148, 138, 0.78);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
}

@media (max-width: 760px) {
  .foot__grid {
    grid-template-columns: 1fr;
    gap: 1.8rem;
  }
}

/* ---------- 進場動畫 ---------- */

@media (prefers-reduced-motion: no-preference) {
  .hero h1,
  .hero .lede,
  .hero__meta,
  .kicker {
    animation: rise 0.7s var(--ease) both;
  }

  .hero .lede {
    animation-delay: 0.08s;
  }

  .hero__meta {
    animation-delay: 0.16s;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 響應式 ---------- */

@media (max-width: 860px) {
  body {
    font-size: 16.5px;
  }

  .topbar__inner {
    gap: 0.4rem;
  }

  .nav {
    width: 100%;
    padding-bottom: 0.25rem;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav a {
    white-space: nowrap;
    font-size: 0.85rem;
    padding-inline: 0.6rem;
  }
}

@media (max-width: 480px) {
  .shell {
    width: min(100% - 32px, var(--shell));
  }

  .article {
    padding-left: 0;
    padding-right: 0;
  }

  .nav a {
    font-size: 0.82rem;
    padding-inline: 0.48rem;
    letter-spacing: 0.02em;
  }

  h1 {
    font-size: 1.78rem;
  }

  .lede {
    padding: 0.95rem 1rem;
  }

  .doc {
    max-width: 100%;
  }
}
