/* 化学元素周期表页面样式 - periodic_table */

.periodic-table-page {
    max-width: 1400px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 28px;
    box-shadow: 0 20px 35px -12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.2s;
    padding: 1.8rem 1.5rem 2rem 1.5rem;
}

/* 头部区域 */
.pt-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.pt-title {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #1e3c72, #2b5e6e);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    letter-spacing: -0.5px;
    margin-bottom: 0.5rem;
}

.pt-subtitle {
    font-size: 0.85rem;
    color: #2c6979;
    display: inline-block;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid #bdd4e2;
}

/* 图例 */
.pt-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 16px;
    margin-bottom: 1.5rem;
    padding: 0.8rem 1rem;
    background: #f8fafc;
    border-radius: 20px;
    border: 1px solid #eef2f9;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #334155;
}

.legend-dot {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    display: inline-block;
    border: 1px solid rgba(0,0,0,0.08);
}

/* 族标头行 */
.group-header {
    display: grid;
    grid-template-columns: repeat(18, minmax(68px, 1fr));
    gap: 6px;
    margin-bottom: 10px;
    text-align: center;
    font-weight: bold;
    font-size: 0.8rem;
    color: #1f5e6e;
}

.group-header div {
    background: #eef3fa;
    padding: 6px 2px;
    border-radius: 20px;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 1px 2px rgba(0,0,0,0.02);
}

/* 周期号侧标 */
.period-side {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 6px;
    margin-right: 8px;
    width: 40px;
}

.period-side div {
    background: #d4e2ed;
    height: calc((100% / 7) - 6px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border-radius: 28px;
    color: #1f5e6e;
    min-height: 60px;
}

.table-wrapper {
    display: flex;
    gap: 6px;
}

/* 周期表主体网格 */
.period-grid {
    display: grid;
    grid-template-columns: repeat(18, minmax(68px, 1fr));
    gap: 6px;
    margin-bottom: 2rem;
    overflow-x: auto;
    padding-bottom: 8px;
    flex: 1;
}

/* 元素卡片 */
.element-card {
    background-color: #ffffffdd;
    backdrop-filter: blur(4px);
    border-radius: 12px;
    padding: 8px 4px 6px;
    text-align: center;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: default;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05), inset 0 0 0 1px rgba(255,255,255,0.7);
    border: 1px solid rgba(160, 190, 210, 0.4);
    position: relative;
    min-height: 70px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.element-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 18px -8px rgba(0, 0, 0, 0.2);
    background-color: #fffffff2;
    border-color: #90b4ce;
    z-index: 5;
}

.atomic-number {
    font-size: 0.7rem;
    font-weight: 600;
    color: #4a6272;
    letter-spacing: 0.3px;
}

.element-symbol {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 4px 0 2px;
    line-height: 1.2;
}

.element-name {
    font-size: 0.65rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #2c5a6e;
    font-weight: 500;
}

/* 空单元格 */
.empty-cell {
    background: #eef2f5;
    border-radius: 12px;
    box-shadow: inset 0 0 0 1px #cbdbe0;
    opacity: 0.5;
}

/* 占位符 */
.placeholder-cell {
    background: #e2eaf0;
    color: #2b5c6f;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 600;
    border: 1px dashed #6f9eb3;
}

.placeholder-cell .element-symbol {
    font-size: 1rem;
}

.placeholder-cell .element-name {
    white-space: normal;
    font-size: 0.6rem;
}

/* 元素分类颜色 */
.metal-alkali { background: linear-gradient(135deg, #ffecb3, #ffe0a3); border-left: 3px solid #ff9800; }
.metal-alkaline { background: linear-gradient(135deg, #ffefcf, #ffe5b5); border-left: 3px solid #ffb74d; }
.metal-transition { background: linear-gradient(135deg, #cfe9ff, #c2e0ff); border-left: 3px solid #4a90e2; }
.lanthanide { background: linear-gradient(135deg, #f0e0ff, #e6d0fa); border-left: 3px solid #aa6dc9; }
.actinide { background: linear-gradient(135deg, #fcd9e8, #f9c8df); border-left: 3px solid #e84393; }
.metal-post { background: linear-gradient(135deg, #dcf5e0, #c8eed0); border-left: 3px solid #2e9c5c; }
.metalloid { background: linear-gradient(135deg, #d9f0ec, #c6eae4); border-left: 3px solid #2c9f8f; }
.nonmetal { background: linear-gradient(135deg, #ffe2d6, #ffd6c4); border-left: 3px solid #f49c63; }
.halogen { background: linear-gradient(135deg, #c5e9fa, #b1dfef); border-left: 3px solid #29a9d9; }
.noble-gas { background: linear-gradient(135deg, #e0ddfa, #d3cef5); border-left: 3px solid #8d7ecc; }

/* 图例颜色对应 */
.legend-dot.metal-alkali { background: linear-gradient(135deg, #ffecb3, #ffe0a3); }
.legend-dot.metal-alkaline { background: linear-gradient(135deg, #ffefcf, #ffe5b5); }
.legend-dot.metal-transition { background: linear-gradient(135deg, #cfe9ff, #c2e0ff); }
.legend-dot.metal-post { background: linear-gradient(135deg, #dcf5e0, #c8eed0); }
.legend-dot.metalloid { background: linear-gradient(135deg, #d9f0ec, #c6eae4); }
.legend-dot.nonmetal { background: linear-gradient(135deg, #ffe2d6, #ffd6c4); }
.legend-dot.halogen { background: linear-gradient(135deg, #c5e9fa, #b1dfef); }
.legend-dot.noble-gas { background: linear-gradient(135deg, #e0ddfa, #d3cef5); }
.legend-dot.lanthanide { background: linear-gradient(135deg, #f0e0ff, #e6d0fa); }
.legend-dot.actinide { background: linear-gradient(135deg, #fcd9e8, #f9c8df); }

/* 底部镧系/锕系区域 */
.lanthanide-actinide {
    margin-top: 2rem;
    background: #eef3f9;
    border-radius: 2rem;
    padding: 1rem 1.2rem;
    box-shadow: inset 0 1px 4px #0001, 0 6px 12px -6px rgba(0,0,0,0.1);
}

.series-title {
    font-weight: bold;
    font-size: 0.9rem;
    margin-bottom: 12px;
    color: #1f6e7a;
    padding-left: 8px;
    border-left: 4px solid #3f8da0;
}

.lanthanide-list, .actinide-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
    margin-bottom: 1rem;
}

.lanthanide-list .element-card, .actinide-list .element-card {
    min-width: 70px;
    flex: 0 0 auto;
    width: 70px;
}

.series-note {
    font-size: 0.7rem;
    text-align: center;
    margin-top: 12px;
    color: #527a8a;
}

/* 滚动条 */
.period-grid::-webkit-scrollbar {
    height: 6px;
}
.period-grid::-webkit-scrollbar-track {
    background: #cddfe8;
    border-radius: 8px;
}
.period-grid::-webkit-scrollbar-thumb {
    background: #7f9eb5;
    border-radius: 8px;
}

/* 页脚 */
.periodic-table-page footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.75rem;
    color: #6c86a3;
    border-top: 1px solid #eef2f9;
    padding-top: 1.2rem;
}

/* 响应式 */
@media (max-width: 1000px) {
    .period-grid { gap: 4px; }
    .element-card { padding: 5px 2px; min-height: 55px; }
    .element-symbol { font-size: 1rem; }
    .atomic-number { font-size: 0.6rem; }
    .element-name { font-size: 0.55rem; white-space: normal; line-height: 1.2; }
    .group-header { font-size: 0.65rem; }
    .group-header div { padding: 4px 1px; }
    .period-side { width: 30px; }
    .period-side div { min-height: 45px; font-size: 0.8rem; }
    .pt-legend { gap: 6px 10px; }
    .legend-item { font-size: 0.7rem; }
}

@media (max-width: 680px) {
    .periodic-table-page { padding: 1.2rem 0.8rem; }
    .pt-title { font-size: 1.6rem; }
    .period-grid { grid-template-columns: repeat(18, minmax(48px, 1fr)); }
    .element-card { min-height: 48px; padding: 3px 1px; }
    .element-symbol { font-size: 0.85rem; margin: 2px 0; }
    .atomic-number { font-size: 0.55rem; }
    .element-name { font-size: 0.5rem; }
    .group-header { grid-template-columns: repeat(18, minmax(48px, 1fr)); }
}
