.tool-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 2.5rem;
    background: #fff;
}
.tool-title {
    text-align: center;
    font-size: 28px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}
.tool-desc {
    text-align: center;
    color: #6b7280;
    font-size: 15px;
    margin-bottom: 30px;
}
.periodic-table {
    display: grid;
    grid-template-columns: repeat(18, 1fr);
    gap: 4px;
}
.element {
    border-radius: 6px;
    padding: 6px;
    text-align: center;
    cursor: pointer;
    transition: 0.2s;
    border: 1px solid #e5e7eb;
    min-height: 70px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.element:hover {
    transform: scale(1.08);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.element-num {
    font-size: 11px;
    opacity: 0.8;
}
.element-symbol {
    font-size: 17px;
    font-weight: bold;
    margin: 2px 0;
}
.element-name {
    font-size: 12px;
}
.empty {
    background: transparent;
    border: none;
    pointer-events: none;
}

/* 原始颜色 100% 还原 */
.type-0 { background: #fecdd3; }
.type-1 { background: #fed7aa; }
.type-2 { background: #bfdbfe; }
.type-3 { background: #a7f3d0; }
.type-4 { background: #ddd6fe; }
.type-5 { background: #fbcfe8; }
.type-6 { background: #bae6fd; }
.type-7 { background: #fde68a; }
.type-8 { background: #99f6e4; }

/* 弹出框 - 柔和背景 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.modal.show {
    display: flex;
}
.modal-box {
    background: #f0f7ff; /* 柔和舒服的背景 */
    width: 90%;
    max-width: 420px;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    animation: modalIn 0.25s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.modal-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 18px;
    color: #222;
}
.modal-info {
    font-size: 15px;
    line-height: 1.9;
    color: #333;
}
.modal-close {
    margin-top: 22px;
    padding: 10px 24px;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
}
.lanthanide-label {
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}
.actinide-label {
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}