/* 元素週期表 — on top of the land lab's shell (land.css): the table of elements over the room, the element panel. */

/* ---------- two views: the table, or one element on the table ---------- */
.elnav { display: none; }
body.el .elnav { display: flex; }
body.el .ptable { opacity: 0; pointer-events: none; transform: translateY(10px); }
body:not(.el) .panel { opacity: 0; pointer-events: none; }
.elname { font: 400 18px/1 var(--serif); letter-spacing: .12em; color: #1b1f2e; }

/* ---------- the table: glass tiles on the calm room, Noto Sans with IBM Plex Mono numbers, like the panel ---------- */
body:not(.el) .peek { opacity: 1; }
body.el .peek { opacity: 0; pointer-events: none; }
.ptable { position: fixed; left: 24px; right: 344px; top: 150px; z-index: 4; font-family: "Noto Sans TC", var(--body); transition: opacity .35s var(--ease), transform .35s var(--ease); }
body.el .ptable { opacity: 0; pointer-events: none; transform: translateY(10px); }
.pt-tools { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-bottom: 14px; }
.filters { display: flex; gap: 2px; padding: 3px; background: rgba(34, 38, 46, .78); border-radius: 11px; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.filters button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; color: #9aa2b1; font: 500 13px/1 "Noto Sans TC", var(--body); cursor: pointer; }
.filters button[aria-pressed="true"] { background: rgba(255, 255, 255, .12); color: #fff; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 2px; }
.legend button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 5px 8px; border-radius: 7px; color: #4a4e5c; font: 500 12px/1 "Noto Sans TC", var(--body); cursor: pointer; }
.legend button:hover { background: rgba(255, 255, 255, .45); }
.legend button[aria-pressed="true"] { background: rgba(34, 38, 46, .82); color: #fff; }
.legend i { width: 8px; height: 8px; border-radius: 2px; }
.grid { display: grid; grid-template-columns: 18px repeat(18, minmax(0, 1fr)); grid-template-rows: 16px repeat(7, auto) 12px repeat(2, auto); gap: 4px; }
.glabel, .plabel { font: 500 10px/1 "IBM Plex Mono", var(--mono); color: #7d8190; display: grid; place-items: center; }
.flabel { font: 500 11px/1 "Noto Sans TC", var(--body); color: #6b6f7d; display: flex; align-items: center; justify-content: flex-end; padding-right: 8px; letter-spacing: .1em; }
.ph { display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px dashed rgba(34, 38, 46, .25); border-radius: 8px; font: 500 11px/1.3 "Noto Sans TC", var(--body); color: #6b6f7d; }
.ph span { font: 500 9px/1 "IBM Plex Mono", var(--mono); margin-bottom: 4px; }
.cell { position: relative; aspect-ratio: 1 / 1.06; min-width: 0; padding: 0; border: 1px solid rgba(255, 255, 255, .07); border-radius: 8px; background: color-mix(in srgb, var(--c) 12%, rgba(34, 38, 46, .8)); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: #d3d8e1; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; overflow: hidden; transition: opacity .25s, transform .15s var(--ease), border-color .2s, background .2s; }
.cell::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--c); opacity: .9; }
.cell i { position: absolute; left: 6px; top: 7px; font: 500 9px/1 "IBM Plex Mono", var(--mono); font-style: normal; color: #8e96a6; }
.cell b { margin-top: 4px; font: 700 clamp(12px, 1.25vw, 18px)/1 "Noto Sans TC", var(--body); color: #fff; letter-spacing: .01em; }
.cell span { margin-top: 5px; font: 400 clamp(9px, .72vw, 11px)/1 "Noto Sans TC", var(--body); color: #9aa2b1; }
.cell em { position: absolute; right: 6px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: #e5c48f; box-shadow: 0 0 0 3px rgba(229, 196, 143, .2); }
.cell.feat { background: color-mix(in srgb, var(--c) 22%, rgba(40, 45, 55, .86)); border-color: rgba(255, 255, 255, .14); }
.cell.has { border-color: rgba(229, 196, 143, .55); }
.cell:hover, .cell:focus-visible { transform: translateY(-2px); border-color: #e5c48f; outline: none; }
.cell.off { opacity: .22; }

/* ---------- the preview card at the right of the table ---------- */
.peek { position: fixed; right: 24px; top: 150px; z-index: 4; width: 296px; overflow: hidden; color: #eceef3; font-family: "Noto Sans TC", var(--body); background: rgba(34, 38, 46, .78); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border: 1px solid rgba(255, 255, 255, .08); border-radius: 18px; box-shadow: 0 18px 40px rgba(30, 28, 50, .2); transition: opacity .3s var(--ease); }
.peek .pk-head { position: relative; display: flex; justify-content: space-between; align-items: flex-start; padding: 20px 22px 0; }
.peek .eyebrow { font: 500 11px/1 "IBM Plex Mono", var(--mono); letter-spacing: .16em; color: #8e96a6; }
.peek h2 { margin: 10px 0 0; font: 700 28px/1 "Noto Sans TC", var(--body); letter-spacing: .04em; }
.peek h2 small { font: 400 14px/1 "Noto Sans TC", var(--body); color: #9aa2b1; margin-left: 8px; }
.peek .cat { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 12px; color: #b9c0cc; }
.peek .cat i { width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.peek .sym { font: 500 40px/1 "IBM Plex Mono", var(--mono); color: #e5c48f; }
.peek .pk-img { display: block; width: calc(100% - 44px); height: 190px; margin: 16px 22px 0; object-fit: cover; border-radius: 12px; background: #d8d5e0; }
.peek .pk-hook { margin: 14px 22px 0; font-size: 14px; line-height: 1.7; color: #d3d8e1; text-wrap: pretty; }
.peek .pk-nums { display: grid; grid-template-columns: 1fr 1fr; margin: 16px 0 0; border-top: 1px solid rgba(255, 255, 255, .08); }
.peek .pk-nums div { padding: 12px 0 12px 22px; } .peek .pk-nums div + div { border-left: 1px solid rgba(255, 255, 255, .08); padding-left: 16px; }
.peek dt { font: 500 11px/1 "Noto Sans TC", var(--body); letter-spacing: .14em; color: #8e96a6; }
.peek dd { margin: 5px 0 0; font: 500 15px/1 "IBM Plex Mono", var(--mono); color: #fff; }
.peek .pk-go { display: flex; justify-content: space-between; align-items: center; width: calc(100% - 32px); margin: 0 16px 16px; padding: 11px 14px; border: 0; border-radius: 11px; background: #e5c48f; color: #1f2229; font: 700 14px/1 "Noto Sans TC", var(--body); cursor: pointer; }
.peek .pk-go span { font-size: 18px; }

/* ---------- the step markers on the model: a small glass circle with the number; the name opens beside it only for
   the step in the panel or under the pointer; no stem, just a dot where it points ---------- */
.tag.mk { pointer-events: auto; cursor: pointer; transform-origin: 50% 100%; }
.tag.mk .t { display: inline-flex; align-items: center; gap: 0; padding: 3px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 999px; background: rgba(34, 38, 46, .72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); font: 500 13px/1 "Noto Sans TC", var(--body); color: #fff; letter-spacing: .02em; transition: padding .2s var(--ease); }
.tag.mk .n { width: 22px; height: 22px; margin: 0; border: 0; background: #e5c48f; color: #1f2229; font: 600 12px/1 "IBM Plex Mono", var(--mono); }
.tag.mk .nm { display: none; white-space: nowrap; padding: 0 10px 0 8px; }
.tag.mk .nm small { display: inline; margin-left: 6px; font: 400 12px/1 "Noto Sans TC", var(--body); color: #b9c0cc; }
.tag.mk:hover .nm, .tag.mk.hl .nm { display: inline; }
.tag.mk.hl .t { background: rgba(34, 38, 46, .86); border-color: rgba(229, 196, 143, .6); }
.tag.mk .stem { height: 8px; background: rgba(255, 255, 255, .7); }
.tag.mk .dot { width: 5px; height: 5px; background: #fff; box-shadow: 0 0 0 2px rgba(34, 38, 46, .5); }

/* ---------- the element panel: glass, Noto Sans with IBM Plex Mono numbers (黑體清爽) ----------
   as tall as what it holds; anything longer scrolls without a bar; text-wrap: pretty keeps a lone character off the
   last line */
#panel.panel { top: 92px; bottom: auto; right: 24px; width: 408px; max-height: calc(100vh - 116px); display: flex; flex-direction: column; padding: 0; color: #eceef3; font-family: "Noto Sans TC", var(--body); background: rgba(34, 38, 46, 0.76); -webkit-backdrop-filter: blur(16px) saturate(1.1); backdrop-filter: blur(16px) saturate(1.1); border: 1px solid rgba(255, 255, 255, .08); border-radius: 18px; box-shadow: 0 18px 40px rgba(30, 28, 50, .2); overflow: auto; scrollbar-width: none; }
#panel.panel::-webkit-scrollbar { display: none; }
#panel :is(p, li, h3) { text-wrap: pretty; line-break: strict; }
#panel section { border-bottom: 0; padding: 0; } /* land.css pads and rules every section; this panel sets its own */
#panel .ghead { position: relative; padding: 22px 24px 0; }
#panel .eyebrow { font: 500 11px/1 "IBM Plex Mono", var(--mono); letter-spacing: .16em; color: #8e96a6; }
#panel h2 { margin: 10px 0 0; font: 700 32px/1 "Noto Sans TC", var(--body); letter-spacing: .04em; }
#panel h2 small { font: 400 15px/1 "Noto Sans TC", var(--body); color: #9aa2b1; margin-left: 10px; letter-spacing: .02em; }
#panel .zno { position: absolute; right: 24px; top: 22px; text-align: right; }
#panel .zno b { display: block; font: 500 30px/1 "IBM Plex Mono", var(--mono); color: #e5c48f; }
#panel .zno span { font: 10px/1 "IBM Plex Mono", var(--mono); letter-spacing: .14em; color: #8e96a6; }
#panel .ghook { margin: 10px 24px 0; font: 400 15px/1.7 "Noto Sans TC", var(--body); color: #c9cfda; }
#panel .gtabs { display: flex; gap: 18px; margin: 18px 24px 0; border-bottom: 1px solid rgba(255, 255, 255, .1); }
#panel .gtabs button { border: 0; background: none; padding: 0 0 9px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: #8e96a6; font: 500 14px/1 "Noto Sans TC", var(--body); cursor: pointer; }
#panel .gtabs button i { font: 500 11px "IBM Plex Mono", var(--mono); font-style: normal; margin-right: 6px; opacity: .7; }
#panel .gtabs button:hover { color: #d3d8e1; }
#panel .gtabs button[aria-pressed="true"] { color: #fff; border-bottom-color: #e5c48f; }
#panel .gbody { padding: 16px 24px 0; }
#panel .gbody h3 { margin: 0 0 8px; font: 700 16px/1.4 "Noto Sans TC", var(--body); color: #fff; }
#panel .gbody p { margin: 0; font-size: 14.5px; line-height: 1.8; color: #d3d8e1; }
#panel .gbody .gnote { margin-top: 10px; font-size: 13px; color: #8e96a6; }
#panel .gexam { margin: 16px 24px 0; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .1); }
#panel .gexam h4 { margin: 0 0 8px; font: 500 11px/1 "Noto Sans TC", var(--body); letter-spacing: .14em; color: #8e96a6; }
#panel .gexam ol { margin: 0; padding: 0; list-style: none; counter-reset: q; }
/* 考試會問 lines break only at their spaces and punctuation (氧化鐵 ＋ 碳 → 鐵 ＋ 二氧化碳 never splits 二氧／化碳);
   paragraphs wrap normally (breaking only at punctuation left them ragged), text-wrap: pretty evens their last line */
#panel .gexam li { word-break: keep-all; overflow-wrap: anywhere; }
#panel .gexam li { position: relative; padding-left: 24px; counter-increment: q; font-size: 13.5px; line-height: 1.7; color: #d3d8e1; }
#panel .gexam li + li { margin-top: 6px; }
#panel .gexam li::before { content: counter(q, decimal-leading-zero); position: absolute; left: 0; font: 500 11px/2.05 "IBM Plex Mono", var(--mono); color: #e5c48f; }
#panel .gnums { display: grid; grid-template-columns: repeat(3, 1fr); margin: 18px 0 0; border-top: 1px solid rgba(255, 255, 255, .08); }
#panel .gnums div { padding: 12px 0 14px 24px; }
#panel .gnums div + div { border-left: 1px solid rgba(255, 255, 255, .08); padding-left: 16px; }
#panel .gnums dt { font: 500 11px/1 "Noto Sans TC", var(--body); letter-spacing: .14em; color: #8e96a6; }
#panel .gnums dd { margin: 5px 0 0; font: 500 15px/1 "IBM Plex Mono", var(--mono); color: #fff; }
#panel .gfoot { display: flex; gap: 6px; padding: 10px 16px 14px; border-top: 1px solid rgba(255, 255, 255, .08); }
#panel .gfoot .gap { flex: 1; }
#panel .gfoot button { border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .04); color: #c9cfda; border-radius: 9px; padding: 6px 12px; font: 500 13px/1 "Noto Sans TC", var(--body); cursor: pointer; }
#panel .gfoot button:hover { color: #fff; border-color: rgba(229, 196, 143, .6); }

@media (max-width: 899px) {
  .ptable { position: static; transform: none; width: auto; margin: 0; padding: 12px; background: #22262e; }
  .pt-wrap { overflow-x: auto; scrollbar-width: none; }
  body.el .ptable { display: none; }
  .grid { min-width: 960px; }
  /* the table view needs no 3D strip on a phone: keep only the title bar above the table */
  body:not(.el) #stage { height: 86px; }
  .legend button { color: #b9c0cc; }
  .peek { display: none; }
  body:not(.el) .panel { display: none; }
  #panel.panel { position: static; width: auto; max-height: none; border-radius: 0; border-left: 0; border-right: 0; background: #22262e; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; }
  body.el .nav.elnav { display: flex; position: absolute; right: 14px; top: 12px; }
}
