/* ===== 元素周期表 ptable 整屏布局 ===== */
body[data-page="ptable"] .app { max-width: 100%; }
body[data-page="ptable"] .main-content { max-width: 100%; width: 100%; border-right: 0; }
.pt-page { max-width: none; margin: 0; box-sizing: border-box; padding: 14px 18px 22px; display: flex; flex-direction: column; gap: 12px; min-height: calc(100vh - 56px); }
@media (max-width: 700px) { .pt-page { padding: 10px 10px 16px; } }

/* 顶栏 */
.pt-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pt-bar-left { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pt-title { font-size: 20px; font-weight: 700; margin: 0; letter-spacing: .5px; }
.pt-bar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pt-seg { display: inline-flex; border: 1px solid var(--border, #e2e2e2); border-radius: 9px; overflow: hidden; background: var(--bg-secondary, #fff); }
.pt-seg-btn { border: 0; background: transparent; color: var(--text-secondary, #555); padding: 7px 13px; font-size: 13.5px; cursor: pointer; transition: background .15s, color .15s; }
.pt-seg-btn + .pt-seg-btn { border-left: 1px solid var(--border, #e2e2e2); }
.pt-seg-btn.is-active { background: var(--accent, #136ce9); color: #fff; }
.pt-select { border: 1px solid var(--border, #e2e2e2); border-radius: 8px; padding: 7px 9px; font-size: 13.5px; background: var(--bg-secondary, #fff); color: var(--text-primary, #222); }
.pt-temp-unit { width: 58px; }
.pt-range { width: 150px; vertical-align: middle; accent-color: var(--accent, #136ce9); }
.pt-temp-val { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--text-secondary, #555); min-width: 64px; display: inline-block; }
.pt-search { border: 1px solid var(--border, #e2e2e2); border-radius: 8px; padding: 7px 12px; font-size: 13.5px; width: 190px; background: var(--bg-secondary, #fff); color: var(--text-primary, #222); }
.pt-lang-btn { border: 1px solid var(--border, #e2e2e2); border-radius: 8px; padding: 7px 12px; font-size: 13.5px; background: var(--bg-secondary, #fff); color: var(--text-primary, #222); cursor: pointer; }
.pt-lang-btn:hover { border-color: var(--accent, #136ce9); color: var(--accent, #136ce9); }

/* 主体 */
.pt-main { display: flex; gap: 16px; align-items: stretch; flex: 1; min-height: 0; }
.pt-table-area { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }

/* 表格滚动容器 */
.pt-scroll { overflow: auto; padding-bottom: 4px; }
.pt-grid { display: grid; grid-template-columns: repeat(18, minmax(46px, 1fr)); grid-auto-rows: minmax(46px, auto); gap: 4px; min-width: 880px; }

/* 元素格 */
.pt-cell { position: relative; border-radius: 7px; padding: 4px 5px; min-height: 46px; cursor: pointer; color: #14202e; background: #ccc; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; transition: transform .12s, box-shadow .12s, opacity .15s; border: 1px solid rgba(0,0,0,.06); }
.pt-cell:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,.18); z-index: 3; }
.pt-cell.is-selected { outline: 2.5px solid var(--accent, #136ce9); outline-offset: 1px; z-index: 4; }
.pt-cell.is-dim { opacity: .22; filter: grayscale(.5); }
.pt-cell.is-hidden { display: none; }
.pt-num { font-size: 10.5px; line-height: 1; opacity: .85; }
.pt-sym { font-size: 17px; font-weight: 700; line-height: 1.05; text-align: center; }
.pt-name { font-size: 9.5px; line-height: 1.1; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .9; }
.pt-mass { font-size: 9px; line-height: 1.1; text-align: center; opacity: .8; }

/* 占位标记（57-71 / 89-103） */
.pt-placeholder { grid-column: 3; border-radius: 7px; border: 1px dashed var(--border, #c8c8c8); display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--text-secondary, #777); background: transparent; }
.pt-placeholder.period6 { grid-row: 6; }
.pt-placeholder.period7 { grid-row: 7; }

/* 分类配色 */
.pt-cat-alkali              { background: #ff9e6d; }
.pt-cat-alkaline            { background: #ffd166; }
.pt-cat-transition          { background: #ef8354; }
.pt-cat-post_transition     { background: #a3c4bc; }
.pt-cat-metalloid           { background: #52b788; }
.pt-cat-nonmetal_diatomic   { background: #57c4ff; }
.pt-cat-nonmetal_polyatomic { background: #4cc9f0; }
.pt-cat-noble_gas           { background: #b8c0ff; }
.pt-cat-lanthanide          { background: #d0a2e0; }
.pt-cat-actinide            { background: #f2a6c2; }
.pt-cat-unknown             { background: #9aa0a6; }

/* 区块配色 */
.pt-block-s { background: #7fd1c4 !important; }
.pt-block-p { background: #f6c453 !important; }
.pt-block-d { background: #e08e6d !important; }
.pt-block-f { background: #c79be0 !important; }

/* 状态配色（JS 注入） */
.pt-state-solid  { background: #4a7fb5 !important; color: #fff; }
.pt-state-liquid { background: #e0a458 !important; color: #fff; }
.pt-state-gas    { background: #cf6f6f !important; color: #fff; }
.pt-state-unknown{ background: #8a9099 !important; color: #fff; }

/* 图例 */
.pt-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 6px 2px; }
.pt-legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-secondary, #555); cursor: pointer; user-select: none; padding: 2px 4px; border-radius: 6px; }
.pt-legend-item:hover { background: var(--bg-secondary, #f2f4f7); }
.pt-legend-item.is-off { opacity: .35; }
.pt-legend-swatch { width: 14px; height: 14px; border-radius: 4px; border: 1px solid rgba(0,0,0,.1); }
.pt-note { font-size: 12px; color: var(--text-secondary, #8a8f98); margin: 2px 0 0; line-height: 1.5; }

/* 详情面板 */
.pt-detail { width: 360px; flex: 0 0 360px; border: 1px solid var(--border, #e2e2e2); border-radius: 12px; background: var(--bg-secondary, #fff); align-self: flex-start; position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow: auto; }
.pt-detail-empty { padding: 40px 22px; text-align: center; color: var(--text-secondary, #8a8f98); }
.pt-detail-empty-inner .pt-de-icon { font-size: 34px; opacity: .4; margin-bottom: 8px; }
.pt-detail-empty-inner p { font-size: 13.5px; line-height: 1.6; }
.pt-detail-close { position: absolute; top: 10px; right: 10px; border: 0; background: transparent; font-size: 16px; color: var(--text-secondary, #888); cursor: pointer; z-index: 2; }
.pt-detail-close:hover { color: var(--text-primary, #222); }
.pt-dh { padding: 18px 18px 12px; border-radius: 12px 12px 0 0; color: #14202e; position: relative; }
.pt-dh .pt-dh-num { font-size: 13px; opacity: .8; }
.pt-dh .pt-dh-sym { font-size: 40px; font-weight: 800; line-height: 1; margin: 2px 0 4px; }
.pt-dh .pt-dh-name { font-size: 16px; font-weight: 600; }
.pt-dh .pt-dh-en { font-size: 12.5px; opacity: .8; }
.pt-dh .pt-dh-mass { font-size: 12.5px; opacity: .85; margin-top: 2px; }
.pt-tabs { display: flex; gap: 4px; padding: 0 12px; border-bottom: 1px solid var(--border, #eee); }
.pt-tab { border: 0; background: transparent; padding: 10px 10px; font-size: 13.5px; color: var(--text-secondary, #666); cursor: pointer; border-bottom: 2px solid transparent; }
.pt-tab.is-active { color: var(--accent, #136ce9); border-bottom-color: var(--accent, #136ce9); font-weight: 600; }
.pt-tab-body { padding: 14px 16px 20px; }
.pt-kv { display: grid; grid-template-columns: 96px 1fr; gap: 8px 10px; font-size: 13px; }
.pt-kv dt { color: var(--text-secondary, #777); }
.pt-kv dd { margin: 0; color: var(--text-primary, #222); word-break: break-word; }
.pt-summary { font-size: 13px; line-height: 1.65; color: var(--text-primary, #2a2f36); margin: 0 0 12px; }
.pt-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; color: #14202e; margin: 0 6px 6px 0; }
.pt-section-title { font-size: 12.5px; font-weight: 700; color: var(--text-secondary, #666); margin: 14px 0 6px; text-transform: none; }
.pt-ie-list { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.pt-ie-list li { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px dashed var(--border, #eee); }
.pt-ie-list li span:last-child { font-variant-numeric: tabular-nums; }

/* 玻尔模型 */
.pt-bohr { display: flex; justify-content: center; padding: 10px 0 4px; }
.pt-bohr svg { max-width: 240px; }

/* 响应式 */
@media (max-width: 980px) {
  .pt-main { flex-direction: column; }
  .pt-detail { width: 100%; flex: none; position: static; max-height: none; }
  .pt-detail-empty { padding: 24px; }
}
@media (max-width: 560px) {
  .pt-title { font-size: 17px; }
  .pt-seg-btn { padding: 6px 10px; font-size: 12.5px; }
  .pt-search { width: 140px; }
  .pt-range { width: 110px; }
  .pt-grid { grid-template-columns: repeat(18, 42px); min-width: 820px; }
  .pt-cell { min-height: 42px; }
  .pt-sym { font-size: 15px; }
}
